From a976fceed8d30b30fe2eb342009593f4f0eb8cab Mon Sep 17 00:00:00 2001 From: Sebastien Taggart Date: Fri, 24 Apr 2026 12:44:30 -0400 Subject: [PATCH] Add /delegate skill for multi-agent task delegation --- .agents/skills/delegate/SKILL.md | 102 ++++++++++++++++++++++++++++++ .agents/skills/start/SKILL.md | 6 +- .claude/commands/delegate.md | 97 ++++++++++++++++++++++++++++ .claude/commands/start.md | 6 +- .cursor/rules/delegate.mdc | 103 ++++++++++++++++++++++++++++++ .cursor/rules/start.mdc | 6 +- .gemini/skills/delegate/SKILL.md | 102 ++++++++++++++++++++++++++++++ .gemini/skills/start/SKILL.md | 6 +- config.schema.yaml | 4 +- skills/delegate.md | 104 +++++++++++++++++++++++++++++++ skills/start.md | 4 +- 11 files changed, 524 insertions(+), 16 deletions(-) create mode 100644 .agents/skills/delegate/SKILL.md create mode 100644 .claude/commands/delegate.md create mode 100644 .cursor/rules/delegate.mdc create mode 100644 .gemini/skills/delegate/SKILL.md create mode 100644 skills/delegate.md diff --git a/.agents/skills/delegate/SKILL.md b/.agents/skills/delegate/SKILL.md new file mode 100644 index 0000000..01e0251 --- /dev/null +++ b/.agents/skills/delegate/SKILL.md @@ -0,0 +1,102 @@ +--- +name: delegate +description: Code Cannon: Generate a scoped prompt for delegating work to another agent +--- + +> **Codex CLI:** This skill is triggered by description matching. State any arguments in your message. Sub-agent spawning is not supported — perform any review steps inline. + +--- + +## What `/delegate` does + +`/delegate` generates a ready-to-paste prompt that gives another AI agent everything it needs to contribute code on the current branch. Run it during the planning gate of `/start` (Step 2), before saying `go`, to carve off part of the work for another agent. + +Each `/delegate` invocation also tells the lead agent to skip that work when it proceeds. + +--- + +## Prerequisites + +`/delegate` relies on context already loaded by `/start`. If you are not in the middle of a `/start` planning gate (Case A Step 2 or Case B Step 2), say: + +> "`/delegate` is meant to be run during the planning step of `/start`, before you type `go`. Run `/start` first to load the issue context, then use `/delegate` to carve off tasks." + +Stop. + +If `$ARGUMENTS` is empty, ask: **"What task should the prompt describe?"** and wait for a response. + +--- + +## Step 1 — Gather branch and diff context + +```bash +git branch --show-current +``` + +```bash +git diff --name-only dev...HEAD 2>/dev/null || git diff --name-only main...HEAD +``` + +--- + +## Step 2 — Build the prompt + +Compose the following as a fenced markdown block (` ```markdown `) so the operator can copy it. + +Use the issue title, body, and agent implementation notes from the current `/start` session — do not re-fetch them. + +```markdown +## Your task + +<$ARGUMENTS — the operator's description of the delegated work> + +## Branch + +You are on branch ``. Stay on this branch. + +## Context + +**Issue #: ** + +<issue body — include the full body as-is> + +<if there are agent implementation notes from the issue comments, include them under a "### Agent notes" subheading> + +## What's already been done on this branch + +<list of changed files from git diff, or "No changes yet — clean branch." if empty> + +## Rules + +- **Do not commit.** Leave all changes unstaged. The lead developer will handle commits. +- **Be surgical.** Only modify what is necessary for your task. Do not refactor adjacent code, reorganize imports, or "improve" files outside the scope of your task. +- **Do not start until the branch exists on the remote.** The lead developer will create and push the branch. Wait until `git checkout <branch name> && git pull origin <branch name>` succeeds before beginning work. +``` + +--- + +## Step 3 — Present to operator and update lead scope + +Print the generated prompt preceded by: + +> Here's a delegation prompt for: **$ARGUMENTS** +> +> Review and edit as needed, then paste into your agent of choice after the lead agent has created and pushed the branch. + +Then print the fenced prompt block. + +After presenting, record internally that `$ARGUMENTS` has been delegated. When the operator says `go` and the lead agent proceeds to write code, it must skip the delegated work. If multiple `/delegate` invocations occur before `go`, accumulate all of them. + +After presenting, say: + +> Noted — the lead agent will skip this part when you say `go`. Run `/delegate <another task>` to delegate more, or type `go` to proceed. + +--- + +## Hard rules + +- Never commit, push, or modify any files. +- Never post to GitHub (no comments, labels, or issue updates). +- Output only — the skill produces text for the operator to copy. +- Do not suggest or name a specific agent to paste into — that is the operator's choice. +<!-- generated by CodeCannon/sync.py | skill: delegate | adapter: codex | hash: 09337683 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.agents/skills/start/SKILL.md b/.agents/skills/start/SKILL.md index 902a15f..8389046 100644 --- a/.agents/skills/start/SKILL.md +++ b/.agents/skills/start/SKILL.md @@ -109,7 +109,7 @@ Read the relevant code. Propose a concrete implementation approach. Be specific Say exactly: -> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first."** +> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Stop. Wait for the user to respond. @@ -248,7 +248,7 @@ Tell the user: - What was previously done (from agent notes if present) - What appears to remain -Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first."** +Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Proceed only on unconditional approval. If the user's response includes conditions, questions, or adjustments, treat it as discussion — address their input and re-ask. If the user wants a fresh start, restart as Case A. If the user abandons, stop — nothing to clean up. @@ -324,4 +324,4 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit <number> --remove-assignee @me`. - Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. -<!-- generated by CodeCannon/sync.py | skill: start | adapter: codex | hash: 13614291 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> +<!-- generated by CodeCannon/sync.py | skill: start | adapter: codex | hash: 834fb83e | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.claude/commands/delegate.md b/.claude/commands/delegate.md new file mode 100644 index 0000000..1bfe65d --- /dev/null +++ b/.claude/commands/delegate.md @@ -0,0 +1,97 @@ +Code Cannon: Generate a scoped prompt for delegating work to another agent + +--- + +## What `/delegate` does + +`/delegate` generates a ready-to-paste prompt that gives another AI agent everything it needs to contribute code on the current branch. Run it during the planning gate of `/start` (Step 2), before saying `go`, to carve off part of the work for another agent. + +Each `/delegate` invocation also tells the lead agent to skip that work when it proceeds. + +--- + +## Prerequisites + +`/delegate` relies on context already loaded by `/start`. If you are not in the middle of a `/start` planning gate (Case A Step 2 or Case B Step 2), say: + +> "`/delegate` is meant to be run during the planning step of `/start`, before you type `go`. Run `/start` first to load the issue context, then use `/delegate` to carve off tasks." + +Stop. + +If `$ARGUMENTS` is empty, ask: **"What task should the prompt describe?"** and wait for a response. + +--- + +## Step 1 — Gather branch and diff context + +```bash +git branch --show-current +``` + +```bash +git diff --name-only dev...HEAD 2>/dev/null || git diff --name-only main...HEAD +``` + +--- + +## Step 2 — Build the prompt + +Compose the following as a fenced markdown block (` ```markdown `) so the operator can copy it. + +Use the issue title, body, and agent implementation notes from the current `/start` session — do not re-fetch them. + +```markdown +## Your task + +<$ARGUMENTS — the operator's description of the delegated work> + +## Branch + +You are on branch `<branch name>`. Stay on this branch. + +## Context + +**Issue #<number>: <title>** + +<issue body — include the full body as-is> + +<if there are agent implementation notes from the issue comments, include them under a "### Agent notes" subheading> + +## What's already been done on this branch + +<list of changed files from git diff, or "No changes yet — clean branch." if empty> + +## Rules + +- **Do not commit.** Leave all changes unstaged. The lead developer will handle commits. +- **Be surgical.** Only modify what is necessary for your task. Do not refactor adjacent code, reorganize imports, or "improve" files outside the scope of your task. +- **Do not start until the branch exists on the remote.** The lead developer will create and push the branch. Wait until `git checkout <branch name> && git pull origin <branch name>` succeeds before beginning work. +``` + +--- + +## Step 3 — Present to operator and update lead scope + +Print the generated prompt preceded by: + +> Here's a delegation prompt for: **$ARGUMENTS** +> +> Review and edit as needed, then paste into your agent of choice after the lead agent has created and pushed the branch. + +Then print the fenced prompt block. + +After presenting, record internally that `$ARGUMENTS` has been delegated. When the operator says `go` and the lead agent proceeds to write code, it must skip the delegated work. If multiple `/delegate` invocations occur before `go`, accumulate all of them. + +After presenting, say: + +> Noted — the lead agent will skip this part when you say `go`. Run `/delegate <another task>` to delegate more, or type `go` to proceed. + +--- + +## Hard rules + +- Never commit, push, or modify any files. +- Never post to GitHub (no comments, labels, or issue updates). +- Output only — the skill produces text for the operator to copy. +- Do not suggest or name a specific agent to paste into — that is the operator's choice. +<!-- generated by CodeCannon/sync.py | skill: delegate | adapter: claude | hash: 5f7a03dc | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.claude/commands/start.md b/.claude/commands/start.md index d73956b..e538771 100644 --- a/.claude/commands/start.md +++ b/.claude/commands/start.md @@ -104,7 +104,7 @@ Read the relevant code. Propose a concrete implementation approach. Be specific Say exactly: -> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first."** +> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Stop. Wait for the user to respond. @@ -243,7 +243,7 @@ Tell the user: - What was previously done (from agent notes if present) - What appears to remain -Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first."** +Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Proceed only on unconditional approval. If the user's response includes conditions, questions, or adjustments, treat it as discussion — address their input and re-ask. If the user wants a fresh start, restart as Case A. If the user abandons, stop — nothing to clean up. @@ -319,4 +319,4 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit <number> --remove-assignee @me`. - Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. -<!-- generated by CodeCannon/sync.py | skill: start | adapter: claude | hash: 1829879a | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> +<!-- generated by CodeCannon/sync.py | skill: start | adapter: claude | hash: d7feebf1 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.cursor/rules/delegate.mdc b/.cursor/rules/delegate.mdc new file mode 100644 index 0000000..3dfde80 --- /dev/null +++ b/.cursor/rules/delegate.mdc @@ -0,0 +1,103 @@ +--- +description: Code Cannon: Generate a scoped prompt for delegating work to another agent +globs: +alwaysApply: false +--- + +> **Cursor:** Trigger this skill via `@delegate` in Agent mode. State any arguments in your message. Sub-agent spawning is not supported — the automated review step in `/submit-for-review` must be done manually using the review-agent prompt. + +--- + +## What `/delegate` does + +`/delegate` generates a ready-to-paste prompt that gives another AI agent everything it needs to contribute code on the current branch. Run it during the planning gate of `/start` (Step 2), before saying `go`, to carve off part of the work for another agent. + +Each `/delegate` invocation also tells the lead agent to skip that work when it proceeds. + +--- + +## Prerequisites + +`/delegate` relies on context already loaded by `/start`. If you are not in the middle of a `/start` planning gate (Case A Step 2 or Case B Step 2), say: + +> "`/delegate` is meant to be run during the planning step of `/start`, before you type `go`. Run `/start` first to load the issue context, then use `/delegate` to carve off tasks." + +Stop. + +If `$ARGUMENTS` is empty, ask: **"What task should the prompt describe?"** and wait for a response. + +--- + +## Step 1 — Gather branch and diff context + +```bash +git branch --show-current +``` + +```bash +git diff --name-only dev...HEAD 2>/dev/null || git diff --name-only main...HEAD +``` + +--- + +## Step 2 — Build the prompt + +Compose the following as a fenced markdown block (` ```markdown `) so the operator can copy it. + +Use the issue title, body, and agent implementation notes from the current `/start` session — do not re-fetch them. + +```markdown +## Your task + +<$ARGUMENTS — the operator's description of the delegated work> + +## Branch + +You are on branch `<branch name>`. Stay on this branch. + +## Context + +**Issue #<number>: <title>** + +<issue body — include the full body as-is> + +<if there are agent implementation notes from the issue comments, include them under a "### Agent notes" subheading> + +## What's already been done on this branch + +<list of changed files from git diff, or "No changes yet — clean branch." if empty> + +## Rules + +- **Do not commit.** Leave all changes unstaged. The lead developer will handle commits. +- **Be surgical.** Only modify what is necessary for your task. Do not refactor adjacent code, reorganize imports, or "improve" files outside the scope of your task. +- **Do not start until the branch exists on the remote.** The lead developer will create and push the branch. Wait until `git checkout <branch name> && git pull origin <branch name>` succeeds before beginning work. +``` + +--- + +## Step 3 — Present to operator and update lead scope + +Print the generated prompt preceded by: + +> Here's a delegation prompt for: **$ARGUMENTS** +> +> Review and edit as needed, then paste into your agent of choice after the lead agent has created and pushed the branch. + +Then print the fenced prompt block. + +After presenting, record internally that `$ARGUMENTS` has been delegated. When the operator says `go` and the lead agent proceeds to write code, it must skip the delegated work. If multiple `/delegate` invocations occur before `go`, accumulate all of them. + +After presenting, say: + +> Noted — the lead agent will skip this part when you say `go`. Run `/delegate <another task>` to delegate more, or type `go` to proceed. + +--- + +## Hard rules + +- Never commit, push, or modify any files. +- Never post to GitHub (no comments, labels, or issue updates). +- Output only — the skill produces text for the operator to copy. +- Do not suggest or name a specific agent to paste into — that is the operator's choice. +<!-- generated by CodeCannon/sync.py | skill: delegate | adapter: cursor | hash: 30cddce6 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.cursor/rules/start.mdc b/.cursor/rules/start.mdc index 6323594..afde6cf 100644 --- a/.cursor/rules/start.mdc +++ b/.cursor/rules/start.mdc @@ -110,7 +110,7 @@ Read the relevant code. Propose a concrete implementation approach. Be specific Say exactly: -> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first."** +> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Stop. Wait for the user to respond. @@ -249,7 +249,7 @@ Tell the user: - What was previously done (from agent notes if present) - What appears to remain -Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first."** +Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Proceed only on unconditional approval. If the user's response includes conditions, questions, or adjustments, treat it as discussion — address their input and re-ask. If the user wants a fresh start, restart as Case A. If the user abandons, stop — nothing to clean up. @@ -325,4 +325,4 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit <number> --remove-assignee @me`. - Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. -<!-- generated by CodeCannon/sync.py | skill: start | adapter: cursor | hash: 2ff02ba9 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> +<!-- generated by CodeCannon/sync.py | skill: start | adapter: cursor | hash: c2521db6 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.gemini/skills/delegate/SKILL.md b/.gemini/skills/delegate/SKILL.md new file mode 100644 index 0000000..b0ca160 --- /dev/null +++ b/.gemini/skills/delegate/SKILL.md @@ -0,0 +1,102 @@ +--- +name: delegate +description: Code Cannon: Generate a scoped prompt for delegating work to another agent +--- + +> **Gemini CLI:** This skill is triggered by description matching. State any arguments in your message. Sub-agent spawning is not supported — the automated review step in `/submit-for-review` must be done manually using the review-agent prompt in a separate session. + +--- + +## What `/delegate` does + +`/delegate` generates a ready-to-paste prompt that gives another AI agent everything it needs to contribute code on the current branch. Run it during the planning gate of `/start` (Step 2), before saying `go`, to carve off part of the work for another agent. + +Each `/delegate` invocation also tells the lead agent to skip that work when it proceeds. + +--- + +## Prerequisites + +`/delegate` relies on context already loaded by `/start`. If you are not in the middle of a `/start` planning gate (Case A Step 2 or Case B Step 2), say: + +> "`/delegate` is meant to be run during the planning step of `/start`, before you type `go`. Run `/start` first to load the issue context, then use `/delegate` to carve off tasks." + +Stop. + +If `$ARGUMENTS` is empty, ask: **"What task should the prompt describe?"** and wait for a response. + +--- + +## Step 1 — Gather branch and diff context + +```bash +git branch --show-current +``` + +```bash +git diff --name-only dev...HEAD 2>/dev/null || git diff --name-only main...HEAD +``` + +--- + +## Step 2 — Build the prompt + +Compose the following as a fenced markdown block (` ```markdown `) so the operator can copy it. + +Use the issue title, body, and agent implementation notes from the current `/start` session — do not re-fetch them. + +```markdown +## Your task + +<$ARGUMENTS — the operator's description of the delegated work> + +## Branch + +You are on branch `<branch name>`. Stay on this branch. + +## Context + +**Issue #<number>: <title>** + +<issue body — include the full body as-is> + +<if there are agent implementation notes from the issue comments, include them under a "### Agent notes" subheading> + +## What's already been done on this branch + +<list of changed files from git diff, or "No changes yet — clean branch." if empty> + +## Rules + +- **Do not commit.** Leave all changes unstaged. The lead developer will handle commits. +- **Be surgical.** Only modify what is necessary for your task. Do not refactor adjacent code, reorganize imports, or "improve" files outside the scope of your task. +- **Do not start until the branch exists on the remote.** The lead developer will create and push the branch. Wait until `git checkout <branch name> && git pull origin <branch name>` succeeds before beginning work. +``` + +--- + +## Step 3 — Present to operator and update lead scope + +Print the generated prompt preceded by: + +> Here's a delegation prompt for: **$ARGUMENTS** +> +> Review and edit as needed, then paste into your agent of choice after the lead agent has created and pushed the branch. + +Then print the fenced prompt block. + +After presenting, record internally that `$ARGUMENTS` has been delegated. When the operator says `go` and the lead agent proceeds to write code, it must skip the delegated work. If multiple `/delegate` invocations occur before `go`, accumulate all of them. + +After presenting, say: + +> Noted — the lead agent will skip this part when you say `go`. Run `/delegate <another task>` to delegate more, or type `go` to proceed. + +--- + +## Hard rules + +- Never commit, push, or modify any files. +- Never post to GitHub (no comments, labels, or issue updates). +- Output only — the skill produces text for the operator to copy. +- Do not suggest or name a specific agent to paste into — that is the operator's choice. +<!-- generated by CodeCannon/sync.py | skill: delegate | adapter: gemini | hash: 4fe30efe | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/.gemini/skills/start/SKILL.md b/.gemini/skills/start/SKILL.md index 5447e44..f792167 100644 --- a/.gemini/skills/start/SKILL.md +++ b/.gemini/skills/start/SKILL.md @@ -109,7 +109,7 @@ Read the relevant code. Propose a concrete implementation approach. Be specific Say exactly: -> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first."** +> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Stop. Wait for the user to respond. @@ -248,7 +248,7 @@ Tell the user: - What was previously done (from agent notes if present) - What appears to remain -Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first."** +Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Proceed only on unconditional approval. If the user's response includes conditions, questions, or adjustments, treat it as discussion — address their input and re-ask. If the user wants a fresh start, restart as Case A. If the user abandons, stop — nothing to clean up. @@ -324,4 +324,4 @@ When done, say: **"The code is ready for review. Please run `make dev` and test - The issue is assigned to `@me` at creation. If you are creating a ticket on someone else's behalf, remove the assignee after creation with `gh issue edit <number> --remove-assignee @me`. - Apply resolved labels and milestone to every new issue. Label resolution order: per-invocation flag → pool selection from `bug, documentation, enhancement, chore` → omit `--label` entirely. Never apply a label outside `bug, documentation, enhancement, chore`. - Milestone resolution order: per-invocation flag → auto-detected from GitHub open milestones. Never prompt for a milestone more than once per invocation. -<!-- generated by CodeCannon/sync.py | skill: start | adapter: gemini | hash: 53a1eebe | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> +<!-- generated by CodeCannon/sync.py | skill: start | adapter: gemini | hash: bfd6c6c5 | DO NOT EDIT — run CodeCannon/sync.py to regenerate --> diff --git a/config.schema.yaml b/config.schema.yaml index 7f20a21..00182e1 100644 --- a/config.schema.yaml +++ b/config.schema.yaml @@ -21,7 +21,7 @@ placeholders: a different name (e.g. "master", "prod"). All release promotion targets this branch. default: "main" category: branches - used_in: [submit-for-review, deploy] + used_in: [submit-for-review, deploy, delegate] BRANCH_DEV: description: > @@ -29,7 +29,7 @@ placeholders: Set to enable two-branch mode (feature → BRANCH_DEV → BRANCH_PROD). Common values: "development", "dev", "staging". default: "" category: branches - used_in: [submit-for-review, deploy, qa, review-agent] + used_in: [submit-for-review, deploy, qa, review-agent, delegate] BRANCH_TEST: description: > diff --git a/skills/delegate.md b/skills/delegate.md new file mode 100644 index 0000000..51bfbe6 --- /dev/null +++ b/skills/delegate.md @@ -0,0 +1,104 @@ +--- +skill: delegate +type: skill +description: "Code Cannon: Generate a scoped prompt for delegating work to another agent" +args: "description of the task to delegate" +--- + +## What `/delegate` does + +`/delegate` generates a ready-to-paste prompt that gives another AI agent everything it needs to contribute code on the current branch. Run it during the planning gate of `/start` (Step 2), before saying `go`, to carve off part of the work for another agent. + +Each `/delegate` invocation also tells the lead agent to skip that work when it proceeds. + +--- + +## Prerequisites + +`/delegate` relies on context already loaded by `/start`. If you are not in the middle of a `/start` planning gate (Case A Step 2 or Case B Step 2), say: + +> "`/delegate` is meant to be run during the planning step of `/start`, before you type `go`. Run `/start` first to load the issue context, then use `/delegate` to carve off tasks." + +Stop. + +If `$ARGUMENTS` is empty, ask: **"What task should the prompt describe?"** and wait for a response. + +--- + +## Step 1 — Gather branch and diff context + +```bash +git branch --show-current +``` + +```bash +{{#if BRANCH_DEV}} +git diff --name-only {{BRANCH_DEV}}...HEAD 2>/dev/null || git diff --name-only {{BRANCH_PROD}}...HEAD +{{/if}} +{{#if !BRANCH_DEV}} +git diff --name-only {{BRANCH_PROD}}...HEAD +{{/if}} +``` + +--- + +## Step 2 — Build the prompt + +Compose the following as a fenced markdown block (` ```markdown `) so the operator can copy it. + +Use the issue title, body, and agent implementation notes from the current `/start` session — do not re-fetch them. + +```markdown +## Your task + +<$ARGUMENTS — the operator's description of the delegated work> + +## Branch + +You are on branch `<branch name>`. Stay on this branch. + +## Context + +**Issue #<number>: <title>** + +<issue body — include the full body as-is> + +<if there are agent implementation notes from the issue comments, include them under a "### Agent notes" subheading> + +## What's already been done on this branch + +<list of changed files from git diff, or "No changes yet — clean branch." if empty> + +## Rules + +- **Do not commit.** Leave all changes unstaged. The lead developer will handle commits. +- **Be surgical.** Only modify what is necessary for your task. Do not refactor adjacent code, reorganize imports, or "improve" files outside the scope of your task. +- **Do not start until the branch exists on the remote.** The lead developer will create and push the branch. Wait until `git checkout <branch name> && git pull origin <branch name>` succeeds before beginning work. +``` + +--- + +## Step 3 — Present to operator and update lead scope + +Print the generated prompt preceded by: + +> Here's a delegation prompt for: **$ARGUMENTS** +> +> Review and edit as needed, then paste into your agent of choice after the lead agent has created and pushed the branch. + +Then print the fenced prompt block. + +After presenting, record internally that `$ARGUMENTS` has been delegated. When the operator says `go` and the lead agent proceeds to write code, it must skip the delegated work. If multiple `/delegate` invocations occur before `go`, accumulate all of them. + +After presenting, say: + +> Noted — the lead agent will skip this part when you say `go`. Run `/delegate <another task>` to delegate more, or type `go` to proceed. + +--- + +## Hard rules + +- Never commit, push, or modify any files. +- Never post to GitHub (no comments, labels, or issue updates). +- Output only — the skill produces text for the operator to copy. +- Do not suggest or name a specific agent to paste into — that is the operator's choice. diff --git a/skills/start.md b/skills/start.md index 9ea21fd..5fe8fcd 100644 --- a/skills/start.md +++ b/skills/start.md @@ -152,7 +152,7 @@ Read the relevant code. Propose a concrete implementation approach. Be specific Say exactly: -> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first."** +> **"Does this approach sound right? Type `go` to create a GitHub issue and branch, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Stop. Wait for the user to respond. @@ -307,7 +307,7 @@ Tell the user: - What was previously done (from agent notes if present) - What appears to remain -Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first."** +Ask: **"Does this match your understanding? Type `go` to start coding, or share any questions/adjustments first. To delegate part of the work to another agent, run `/delegate <task description>` before typing `go`."** Proceed only on unconditional approval. If the user's response includes conditions, questions, or adjustments, treat it as discussion — address their input and re-ask. If the user wants a fresh start, restart as Case A. If the user abandons, stop — nothing to clean up.