Skip to content

Commit 87c650c

Browse files
alexsoyesblafourcadeclaude
authored
feat(aidd-vcs): add repo-init skill (init + publish a repository) (#269)
New skill aidd-vcs:00-repo-init: init a project's repository (git init, default branch, CONTRIBUTING.md, bootstrap commit) and, on request, create the remote and push. Provider- and mechanism-agnostic: host + reach (CLI, MCP, or API) resolved from VCS memory or environment, main as default-branch fallback. No hardcoded provider or fixed mechanism. Conforms to the skill-authoring contract (R1-R13 + action anatomy). Co-authored-by: Baptiste LAFOURCADE <baptiste.lafourcade@gmail.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d08bd55 commit 87c650c

9 files changed

Lines changed: 163 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<p><b>🇫🇷 The first French open-source framework for AI-driven development.</b></p>
1919

2020
<p>
21-
<!--counts:start--><kbd>7 plugins</kbd> · <kbd>39 skills</kbd> · <kbd>3 agents</kbd><!--counts:end--> · <kbd>MIT</kbd>
21+
<!--counts:start--><kbd>7 plugins</kbd> · <kbd>40 skills</kbd> · <kbd>3 agents</kbd><!--counts:end--> · <kbd>MIT</kbd>
2222
</p>
2323

2424
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
@@ -178,7 +178,7 @@ SDLC loop: sdlc, plan, implement, assert, audit, review, test, refactor, debug,
178178

179179
### 🌿 [aidd-vcs](plugins/aidd-vcs/README.md)
180180

181-
`4 skills` · stable
181+
`5 skills` · stable
182182

183183
Commits, pull / merge requests, release tags, issue creation.
184184

plugins/aidd-vcs/.claude-plugin/plugin.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
33
"name": "aidd-vcs",
44
"version": "2.0.0",
5-
"description": "External artifacts: commit, pull-request, release-tag, issue-create",
5+
"description": "External artifacts: repo-init, commit, pull-request, release-tag, issue-create",
66
"author": {
77
"name": "AI-Driven Dev",
88
"url": "https://github.com/ai-driven-dev"
99
},
1010
"skills": [
11+
"./skills/00-repo-init",
1112
"./skills/01-commit",
1213
"./skills/02-pull-request",
1314
"./skills/03-release-tag",
1415
"./skills/04-issue-create"
1516
],
1617
"keywords": [
1718
"git",
19+
"repo-init",
1820
"commit",
1921
"pull-request",
2022
"release",

plugins/aidd-vcs/CATALOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai
88

99
- [`.claude-plugin`](#claude-plugin)
1010
- [`skills`](#skills)
11+
- [`skills/00-repo-init`](#skills00-repo-init)
1112
- [`skills/01-commit`](#skills01-commit)
1213
- [`skills/02-pull-request`](#skills02-pull-request)
1314
- [`skills/03-release-tag`](#skills03-release-tag)
@@ -23,6 +24,16 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai
2324

2425
### `skills`
2526

27+
#### `skills/00-repo-init`
28+
29+
| Group | File | Description |
30+
|-------|------|---|
31+
| `actions` | [01-init.md](skills/00-repo-init/actions/01-init.md) | - |
32+
| `actions` | [02-publish.md](skills/00-repo-init/actions/02-publish.md) | - |
33+
| `assets` | [CONTRIBUTING.md](skills/00-repo-init/assets/CONTRIBUTING.md) | - |
34+
| `-` | [README.md](skills/00-repo-init/README.md) | - |
35+
| `-` | [SKILL.md](skills/00-repo-init/SKILL.md) | `Initialize a project's repository - resolve the default branch and VCS provider, run git init with a bootstrap commit, write CONTRIBUTING.md, and on request create the remote repository and push. Use when the user says "init a repo", "git init", "initialize version control", "set up a new repo", "start a project", "create the remote and push", or "publish this repo". Do NOT use for committing changes (use 01-commit), opening pull requests (use 02-pull-request), tagging releases (use 03-release-tag), or cloning an existing remote.` |
36+
2637
#### `skills/01-commit`
2738

2839
| Group | File | Description |
@@ -42,7 +53,7 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai
4253
| `assets` | [pull_request.md](skills/02-pull-request/assets/pull_request.md) | `VCS pull/merge request template` |
4354
| `assets` | [README.md](skills/02-pull-request/assets/README.md) | `Project README template` |
4455
| `-` | [README.md](skills/02-pull-request/README.md) | - |
45-
| `-` | [SKILL.md](skills/02-pull-request/SKILL.md) | `Create a draft pull or merge request from the current branch. Use when the user says "open a pr", "open a pull request", "create a pr", "create a merge request", "open mr", "draft a pr for this branch", or invokes `/pull-request`. Do NOT use for committing changes, pushing a branch directly, tagging releases, merging an existing request, or amending commits.` |
56+
| `-` | [SKILL.md](skills/02-pull-request/SKILL.md) | `Create a draft pull or merge request from the current branch. Use when the user ask to create a PR or invokes `/pull-request`.` |
4657

4758
#### `skills/03-release-tag`
4859

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[aidd-vcs](../../README.md)
2+
3+
# 00-repo-init
4+
5+
Initializes a project's repository locally and, on request, on the remote host: `git init`, sets the default branch, resolves the provider, and can create the remote repository and push, returning its URL.
6+
7+
> Status: experimental.
8+
9+
## When to use
10+
11+
- Starting version control on a new project (e.g. right after scaffolding it).
12+
- Creating the remote repository and pushing the initial state.
13+
14+
## When NOT to use
15+
16+
- Cloning an existing remote, opening pull requests, or tagging releases.
17+
- Re-initializing a directory that is already a repository (the local step no-ops there).
18+
19+
## How to invoke
20+
21+
`aidd-vcs:00-repo-init`, or say "initialize a git repository here" / "create the remote and publish".
22+
23+
## Outputs
24+
25+
- `init`: an initialized `.git`, the default branch set, the resolved provider, and `origin` added when a remote URL is given.
26+
- `publish`: the created remote repository and a push, returning its URL.
27+
28+
## Prerequisites
29+
30+
- `git` on the PATH. For `publish`, the resolved host's tooling (CLI, MCP, or API) available and authenticated.
31+
32+
## Technical details
33+
34+
Two actions: `init` (local) and `publish` (remote, outward-facing, confirms first). See [SKILL.md](SKILL.md).
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: 00-repo-init
3+
description: Initialize a project's repository - resolve the default branch and VCS provider, run git init with a bootstrap commit, write CONTRIBUTING.md, and on request create the remote repository and push. Use when the user says "init a repo", "git init", "initialize version control", "set up a new repo", "start a project", "create the remote and push", or "publish this repo". Do NOT use for committing changes (use 01-commit), opening pull requests (use 02-pull-request), tagging releases (use 03-release-tag), or cloning an existing remote.
4+
argument-hint: init | publish
5+
---
6+
7+
# Repo Init
8+
9+
Initializes a project's repository locally and, on request, on the remote host, then returns the remote URL.
10+
11+
## Available actions
12+
13+
| # | Action | Role | Input |
14+
| --- | --------- | ------------------------------------------------------------------------------------------------- | ------------------------------- |
15+
| 01 | `init` | Resolve VCS config, `git init`, set the default branch, write `CONTRIBUTING.md`, bootstrap commit | cwd, default_branch, remote_url |
16+
| 02 | `publish` | Create the remote repo on the resolved host and push, return its URL | cwd, non_interactive |
17+
18+
## Default flow
19+
20+
Chain `01 → 02`, testing each before the next. The router runs `init` alone for a local-only request, and runs `publish` after an `init` when asked to create the remote.
21+
22+
## Transversal rules
23+
24+
- The local step is idempotent. If the target is already a git work tree, `init` does nothing and reports.
25+
- `init` makes one bootstrap commit (`--allow-empty`) so `HEAD` exists and is pushable. The project's real first commit stays the commit skill's job.
26+
- `publish` is outward-facing. It confirms before creating the remote unless `non_interactive` is set.
27+
- The provider is open. Resolve the host and how to reach it (CLI, MCP, or API) from the VCS memory when present, else from the VCS tooling available in the environment. Never restrict to a fixed list or a fixed mechanism. `main` is the default-branch fallback.
28+
29+
## Assets
30+
31+
- `assets/CONTRIBUTING.md`: the project-root `CONTRIBUTING.md` template.
32+
33+
## External data
34+
35+
- `aidd_docs/memory/vcs.md`: the project's VCS config (default branch, provider), read by both actions when present and pointed to, never copied.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# 01 - Init
2+
3+
Initialize a fresh local git repository on the resolved default branch.
4+
5+
## Input
6+
7+
- `cwd` (optional): directory to initialize. Defaults to the current directory.
8+
- `default_branch` (optional): overrides the resolved branch.
9+
- `remote_url` (optional): added as `origin` when given.
10+
11+
## Output
12+
13+
A report of the repo root, the resolved default branch and provider, and whether `origin` was added. Reports `created: false` and stops when the target is already a git work tree.
14+
15+
## Process
16+
17+
1. **Guard.** If `cwd` is already a git work tree, skip and report `created: false`.
18+
2. **Resolve.** Read the default branch and provider from the project's VCS memory. If absent, infer the provider from the environment (an installed VCS CLI, a configured MCP, or an existing remote URL). Fall back to `main` when nothing resolves. An explicit `default_branch` wins.
19+
3. **Init.** Run `git init -b <default_branch> <cwd>`.
20+
4. **Contribute.** Write `CONTRIBUTING.md` at the repo root from the template, filling `{{PROJECT_NAME}}`. Leave no raw `{{...}}`.
21+
22+
```markdown
23+
@../assets/CONTRIBUTING.md
24+
```
25+
26+
5. **Bootstrap.** Commit once so `HEAD` exists and is pushable: `git -C <cwd> commit --allow-empty -m "chore: initialize repository"`.
27+
6. **Remote.** If `remote_url` is given, run `git -C <cwd> remote add origin <remote_url>`.
28+
29+
## Test
30+
31+
- `git -C <cwd> rev-parse --is-inside-work-tree` prints `true`.
32+
- `git -C <cwd> symbolic-ref --short HEAD` equals the resolved default branch.
33+
- `CONTRIBUTING.md` exists at the repo root and contains no `{{`.
34+
- `git -C <cwd> rev-parse HEAD` resolves to a commit.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# 02 - Publish
2+
3+
Create the project's remote repository on the resolved host and push to it. Outward-facing; runs after `01-init`.
4+
5+
## Input
6+
7+
- `cwd` (optional): the initialized local repository. Defaults to the current directory.
8+
- `non_interactive` (optional, default `false`): skip the confirmation prompt for scaffolder or auto runs.
9+
10+
## Output
11+
12+
A report of the created remote URL, the resolved provider, and the pushed default branch.
13+
14+
## Process
15+
16+
1. **Resolve.** Read the host and how to reach it (CLI, MCP, or API) from the project's VCS memory. If absent, detect it from the VCS tooling available in the environment. Use no fixed provider list or fixed mechanism.
17+
2. **Confirm.** Unless `non_interactive`, confirm before creating the remote. The remote may be public, so create it private by default.
18+
3. **Create.** Create the remote repository and push through the resolved host tooling. `01-init` already left a pushable `HEAD`. If no host tooling is available, stop and report.
19+
4. **Return.** Report the remote URL to the user.
20+
21+
## Test
22+
23+
- The action prints a non-empty remote URL.
24+
- `git -C <cwd> remote get-url origin` resolves to that URL.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Contributing to {{PROJECT_NAME}}
2+
3+
## Setup
4+
5+
See `INSTALL.md`.
6+
7+
## Workflow
8+
9+
1. Branch off the default branch.
10+
2. Implement against the wired route stubs - keep architecture boundaries (see `INSTALL.md`).
11+
3. Add or extend tests alongside the code (see `INSTALL.md` for how to run them).
12+
4. Run the suite before opening a request.
13+
14+
## Conventions
15+
16+
- Commits: conventional commits (`<type>(<scope>): description`).
17+
- The CI pipeline runs the test suite on every push; keep it green.
18+
- Do not put business logic in route stubs until you replace them with real handlers.

plugins/aidd-vcs/skills/02-pull-request/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: 02-pull-request
3-
description: Create a draft pull or merge request from the current branch. Use when the user says "open a pr", "open a pull request", "create a pr", "create a merge request", "open mr", "draft a pr for this branch", or invokes `/pull-request`. Do NOT use for committing changes, pushing a branch directly, tagging releases, merging an existing request, or amending commits.
3+
description: Create a draft pull or merge request from the current branch. Use when the user ask to create a PR or invokes `/pull-request`.
44
---
55

66
# Pull Request

0 commit comments

Comments
 (0)