From c92b22e2a7aeb392292fb3611af7911352decac9 Mon Sep 17 00:00:00 2001 From: Baptiste LAFOURCADE Date: Tue, 23 Jun 2026 09:32:57 +0200 Subject: [PATCH] feat(aidd-vcs): add repo-init skill (init + publish a repository) 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: Claude Opus 4.8 (1M context) --- README.md | 4 +-- plugins/aidd-vcs/.claude-plugin/plugin.json | 4 ++- plugins/aidd-vcs/CATALOG.md | 13 ++++++- .../aidd-vcs/skills/00-repo-init/README.md | 34 ++++++++++++++++++ plugins/aidd-vcs/skills/00-repo-init/SKILL.md | 35 +++++++++++++++++++ .../skills/00-repo-init/actions/01-init.md | 34 ++++++++++++++++++ .../skills/00-repo-init/actions/02-publish.md | 24 +++++++++++++ .../00-repo-init/assets/CONTRIBUTING.md | 18 ++++++++++ .../aidd-vcs/skills/02-pull-request/SKILL.md | 2 +- 9 files changed, 163 insertions(+), 5 deletions(-) create mode 100644 plugins/aidd-vcs/skills/00-repo-init/README.md create mode 100644 plugins/aidd-vcs/skills/00-repo-init/SKILL.md create mode 100644 plugins/aidd-vcs/skills/00-repo-init/actions/01-init.md create mode 100644 plugins/aidd-vcs/skills/00-repo-init/actions/02-publish.md create mode 100644 plugins/aidd-vcs/skills/00-repo-init/assets/CONTRIBUTING.md diff --git a/README.md b/README.md index 5f1d5e71..b11a07f0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@

🇫🇷 The first French open-source framework for AI-driven development.

- 7 plugins · 39 skills · 3 agents · MIT + 7 plugins · 40 skills · 3 agents · MIT

[![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, ### 🌿 [aidd-vcs](plugins/aidd-vcs/README.md) -`4 skills` · stable +`5 skills` · stable Commits, pull / merge requests, release tags, issue creation. diff --git a/plugins/aidd-vcs/.claude-plugin/plugin.json b/plugins/aidd-vcs/.claude-plugin/plugin.json index fc109aa6..36f72f53 100644 --- a/plugins/aidd-vcs/.claude-plugin/plugin.json +++ b/plugins/aidd-vcs/.claude-plugin/plugin.json @@ -2,12 +2,13 @@ "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json", "name": "aidd-vcs", "version": "2.0.0", - "description": "External artifacts: commit, pull-request, release-tag, issue-create", + "description": "External artifacts: repo-init, commit, pull-request, release-tag, issue-create", "author": { "name": "AI-Driven Dev", "url": "https://github.com/ai-driven-dev" }, "skills": [ + "./skills/00-repo-init", "./skills/01-commit", "./skills/02-pull-request", "./skills/03-release-tag", @@ -15,6 +16,7 @@ ], "keywords": [ "git", + "repo-init", "commit", "pull-request", "release", diff --git a/plugins/aidd-vcs/CATALOG.md b/plugins/aidd-vcs/CATALOG.md index 9f9bf6c2..7a84091d 100644 --- a/plugins/aidd-vcs/CATALOG.md +++ b/plugins/aidd-vcs/CATALOG.md @@ -8,6 +8,7 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai - [`.claude-plugin`](#claude-plugin) - [`skills`](#skills) + - [`skills/00-repo-init`](#skills00-repo-init) - [`skills/01-commit`](#skills01-commit) - [`skills/02-pull-request`](#skills02-pull-request) - [`skills/03-release-tag`](#skills03-release-tag) @@ -23,6 +24,16 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai ### `skills` +#### `skills/00-repo-init` + +| Group | File | Description | +|-------|------|---| +| `actions` | [01-init.md](skills/00-repo-init/actions/01-init.md) | - | +| `actions` | [02-publish.md](skills/00-repo-init/actions/02-publish.md) | - | +| `assets` | [CONTRIBUTING.md](skills/00-repo-init/assets/CONTRIBUTING.md) | - | +| `-` | [README.md](skills/00-repo-init/README.md) | - | +| `-` | [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.` | + #### `skills/01-commit` | Group | File | Description | @@ -42,7 +53,7 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai | `assets` | [pull_request.md](skills/02-pull-request/assets/pull_request.md) | `VCS pull/merge request template` | | `assets` | [README.md](skills/02-pull-request/assets/README.md) | `Project README template` | | `-` | [README.md](skills/02-pull-request/README.md) | - | -| `-` | [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.` | +| `-` | [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`.` | #### `skills/03-release-tag` diff --git a/plugins/aidd-vcs/skills/00-repo-init/README.md b/plugins/aidd-vcs/skills/00-repo-init/README.md new file mode 100644 index 00000000..6c7ecd3b --- /dev/null +++ b/plugins/aidd-vcs/skills/00-repo-init/README.md @@ -0,0 +1,34 @@ +← [aidd-vcs](../../README.md) + +# 00-repo-init + +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. + +> Status: experimental. + +## When to use + +- Starting version control on a new project (e.g. right after scaffolding it). +- Creating the remote repository and pushing the initial state. + +## When NOT to use + +- Cloning an existing remote, opening pull requests, or tagging releases. +- Re-initializing a directory that is already a repository (the local step no-ops there). + +## How to invoke + +`aidd-vcs:00-repo-init`, or say "initialize a git repository here" / "create the remote and publish". + +## Outputs + +- `init`: an initialized `.git`, the default branch set, the resolved provider, and `origin` added when a remote URL is given. +- `publish`: the created remote repository and a push, returning its URL. + +## Prerequisites + +- `git` on the PATH. For `publish`, the resolved host's tooling (CLI, MCP, or API) available and authenticated. + +## Technical details + +Two actions: `init` (local) and `publish` (remote, outward-facing, confirms first). See [SKILL.md](SKILL.md). diff --git a/plugins/aidd-vcs/skills/00-repo-init/SKILL.md b/plugins/aidd-vcs/skills/00-repo-init/SKILL.md new file mode 100644 index 00000000..a205e6dc --- /dev/null +++ b/plugins/aidd-vcs/skills/00-repo-init/SKILL.md @@ -0,0 +1,35 @@ +--- +name: 00-repo-init +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. +argument-hint: init | publish +--- + +# Repo Init + +Initializes a project's repository locally and, on request, on the remote host, then returns the remote URL. + +## Available actions + +| # | Action | Role | Input | +| --- | --------- | ------------------------------------------------------------------------------------------------- | ------------------------------- | +| 01 | `init` | Resolve VCS config, `git init`, set the default branch, write `CONTRIBUTING.md`, bootstrap commit | cwd, default_branch, remote_url | +| 02 | `publish` | Create the remote repo on the resolved host and push, return its URL | cwd, non_interactive | + +## Default flow + +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. + +## Transversal rules + +- The local step is idempotent. If the target is already a git work tree, `init` does nothing and reports. +- `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. +- `publish` is outward-facing. It confirms before creating the remote unless `non_interactive` is set. +- 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. + +## Assets + +- `assets/CONTRIBUTING.md`: the project-root `CONTRIBUTING.md` template. + +## External data + +- `aidd_docs/memory/vcs.md`: the project's VCS config (default branch, provider), read by both actions when present and pointed to, never copied. diff --git a/plugins/aidd-vcs/skills/00-repo-init/actions/01-init.md b/plugins/aidd-vcs/skills/00-repo-init/actions/01-init.md new file mode 100644 index 00000000..5ffc0b7c --- /dev/null +++ b/plugins/aidd-vcs/skills/00-repo-init/actions/01-init.md @@ -0,0 +1,34 @@ +# 01 - Init + +Initialize a fresh local git repository on the resolved default branch. + +## Input + +- `cwd` (optional): directory to initialize. Defaults to the current directory. +- `default_branch` (optional): overrides the resolved branch. +- `remote_url` (optional): added as `origin` when given. + +## Output + +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. + +## Process + +1. **Guard.** If `cwd` is already a git work tree, skip and report `created: false`. +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. +3. **Init.** Run `git init -b `. +4. **Contribute.** Write `CONTRIBUTING.md` at the repo root from the template, filling `{{PROJECT_NAME}}`. Leave no raw `{{...}}`. + + ```markdown + @../assets/CONTRIBUTING.md + ``` + +5. **Bootstrap.** Commit once so `HEAD` exists and is pushable: `git -C commit --allow-empty -m "chore: initialize repository"`. +6. **Remote.** If `remote_url` is given, run `git -C remote add origin `. + +## Test + +- `git -C rev-parse --is-inside-work-tree` prints `true`. +- `git -C symbolic-ref --short HEAD` equals the resolved default branch. +- `CONTRIBUTING.md` exists at the repo root and contains no `{{`. +- `git -C rev-parse HEAD` resolves to a commit. diff --git a/plugins/aidd-vcs/skills/00-repo-init/actions/02-publish.md b/plugins/aidd-vcs/skills/00-repo-init/actions/02-publish.md new file mode 100644 index 00000000..fe6a4499 --- /dev/null +++ b/plugins/aidd-vcs/skills/00-repo-init/actions/02-publish.md @@ -0,0 +1,24 @@ +# 02 - Publish + +Create the project's remote repository on the resolved host and push to it. Outward-facing; runs after `01-init`. + +## Input + +- `cwd` (optional): the initialized local repository. Defaults to the current directory. +- `non_interactive` (optional, default `false`): skip the confirmation prompt for scaffolder or auto runs. + +## Output + +A report of the created remote URL, the resolved provider, and the pushed default branch. + +## Process + +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. +2. **Confirm.** Unless `non_interactive`, confirm before creating the remote. The remote may be public, so create it private by default. +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. +4. **Return.** Report the remote URL to the user. + +## Test + +- The action prints a non-empty remote URL. +- `git -C remote get-url origin` resolves to that URL. diff --git a/plugins/aidd-vcs/skills/00-repo-init/assets/CONTRIBUTING.md b/plugins/aidd-vcs/skills/00-repo-init/assets/CONTRIBUTING.md new file mode 100644 index 00000000..e13f1bbe --- /dev/null +++ b/plugins/aidd-vcs/skills/00-repo-init/assets/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing to {{PROJECT_NAME}} + +## Setup + +See `INSTALL.md`. + +## Workflow + +1. Branch off the default branch. +2. Implement against the wired route stubs - keep architecture boundaries (see `INSTALL.md`). +3. Add or extend tests alongside the code (see `INSTALL.md` for how to run them). +4. Run the suite before opening a request. + +## Conventions + +- Commits: conventional commits (`(): description`). +- The CI pipeline runs the test suite on every push; keep it green. +- Do not put business logic in route stubs until you replace them with real handlers. diff --git a/plugins/aidd-vcs/skills/02-pull-request/SKILL.md b/plugins/aidd-vcs/skills/02-pull-request/SKILL.md index 638e29cb..4a01ea01 100644 --- a/plugins/aidd-vcs/skills/02-pull-request/SKILL.md +++ b/plugins/aidd-vcs/skills/02-pull-request/SKILL.md @@ -1,6 +1,6 @@ --- name: 02-pull-request -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. +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`. --- # Pull Request