Skills: breakdown — generate issues from specs/*.md with routing labels #54

Closed
opened 2026-04-18 15:02:00 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a maintainer, I want to drop a spec.md in a repo's specs/ folder and, via a /breakdown slash-command comment on a tracking issue, have boss read the spec, generate a user-story-format issue per section (with labels like area:*, type:user-story, and security where warranted), so that routing (A3) can then send security-labeled PRs to a senior reviewer instance automatically.

Context

No skill currently drives this — the CLAUDE.md convention for well-structured user stories is applied manually by the interactive operator via the MCP. Automating it enables spec → issues → typed-review loops without human authoring of each ticket.

Trigger choice: slash-command on an issue comment. Explicit, no ambiguity, scoped. Alternatives (push-webhook on specs/** changes, issue labels) defer for now.

Acceptance criteria

New skill

  • skills/breakdown.md — instructs boss to:
    1. List specs/*.md in the repo (via forgejo-mcp get_file_content against the repo root + directory listing).
    2. Read each spec file.
    3. For each logical section, create one Forgejo issue with: user-story statement (As a <role>, I want <capability>, so that <outcome>), acceptance criteria grouped by sub-section, out-of-scope list, references list, dependencies footer.
    4. Apply labels:
      • type:user-story always.
      • area:<slug> per existing repo convention (read the label list first; don't invent new area:* labels — log a warning and skip if the spec implies one that doesn't exist).
      • security when the spec section mentions authentication, authorization, crypto / key material, secrets, session tokens, SSRF / injection / XSS patterns. Mechanical keyword-match; over-tag is fine, under-tag is the failure mode.
    5. Assign each issue to the appropriate agent type (dev for typical implementation, boss for architecture-heavy work the spec explicitly flags as senior).
    6. Post a summary comment on the triggering tracking issue: "Created #A, #B, #C from specs/<file>.md. Security-labeled: #B."
  • The skill file lives in git like every other skill; no runtime-editable part.

Dispatch path

  • Webhook handles issue_comment events (new event handler in src/webhook-handlers.ts). When the comment body starts with /breakdown and the commenter is a configured trusted user (owner + any agent — NOT arbitrary Forgejo users), dispatch a breakdown task to the boss pool.
  • buildTaskRequest (existing helper) extended for the breakdown flow: the skill is breakdown, the prompt interpolates {{repo}}, {{tracking_issue_number}}, and {{trigger_comment_body}}.
  • Non-/breakdown comments are ignored (no dispatch, webhook returns 200).

Security label as A3 fodder

  • Document in the skill: emitting security on an issue means any PR that closes that issue inherits the label (via Forgejo's Closes #N resolution), and A3's reviewer routing picks the reviewer-security instance on that PR. So the skill authoring quality directly affects review-model cost.

Tests

  • Webhook test for issue_comment: /breakdown from trusted user dispatches; /breakdown from random user → 200 + skip log; non-slash comment → 200 + skip log.
  • Skill prompt renders — snapshot test on the interpolated output.
  • No integration test against live Forgejo — manual verification only.

Manual verification

  • On a test repo with a small specs/hello.md (2–3 sections, one mentioning "authentication"), comment /breakdown on a tracking issue. Confirm:
    • Boss opens N issues matching the spec sections.
    • The auth-related issue has the security label.
    • If a reviewer-security instance exists with match_labels: ["security"], a PR that closes the security issue gets routed to that reviewer instance per A3's log line.

Out of scope

  • Cross-repo breakdowns.
  • Scheduling (cron-triggered breakdowns).
  • Re-running on updated spec content (no diffing — v1 is idempotent against a spec that hasn't already been broken down, via "skip if tracking issue already has a summary comment from a prior breakdown").
  • Advanced classification beyond keyword matching for the security label.
  • Editing / approving generated issues before posting (ship-them-as-is; operator closes the bad ones).

References

  • Tracking issue: #47.
  • CLAUDE.md issue-authoring conventions (user-story + AC + out-of-scope + references).
  • A3's label-aware routing is what makes the emitted labels load-bearing.

Dependencies

  • Blocked by: A3 (labels matter only once routing consumes them).
  • Branch off: main (after A3 lands).
  • Milestone stretch goal. Nice-to-have for closing the milestone; not gating.
## User story As a **maintainer**, I want to drop a `spec.md` in a repo's `specs/` folder and, via a `/breakdown` slash-command comment on a tracking issue, have boss read the spec, generate a user-story-format issue per section (with labels like `area:*`, `type:user-story`, and `security` where warranted), so that routing (A3) can then send `security`-labeled PRs to a senior reviewer instance automatically. ## Context No skill currently drives this — the CLAUDE.md convention for well-structured user stories is applied manually by the interactive operator via the MCP. Automating it enables spec → issues → typed-review loops without human authoring of each ticket. Trigger choice: **slash-command on an issue comment**. Explicit, no ambiguity, scoped. Alternatives (push-webhook on `specs/**` changes, issue labels) defer for now. ## Acceptance criteria ### New skill - [ ] `skills/breakdown.md` — instructs boss to: 1. List `specs/*.md` in the repo (via forgejo-mcp `get_file_content` against the repo root + directory listing). 2. Read each spec file. 3. For each logical section, create one Forgejo issue with: user-story statement (`As a <role>, I want <capability>, so that <outcome>`), acceptance criteria grouped by sub-section, out-of-scope list, references list, dependencies footer. 4. Apply labels: - `type:user-story` always. - `area:<slug>` per existing repo convention (read the label list first; don't invent new `area:*` labels — log a warning and skip if the spec implies one that doesn't exist). - `security` when the spec section mentions authentication, authorization, crypto / key material, secrets, session tokens, SSRF / injection / XSS patterns. Mechanical keyword-match; over-tag is fine, under-tag is the failure mode. 5. Assign each issue to the appropriate agent type (`dev` for typical implementation, `boss` for architecture-heavy work the spec explicitly flags as senior). 6. Post a summary comment on the triggering tracking issue: "Created #A, #B, #C from `specs/<file>.md`. Security-labeled: #B." - [ ] The skill file lives in git like every other skill; no runtime-editable part. ### Dispatch path - [ ] Webhook handles `issue_comment` events (new event handler in `src/webhook-handlers.ts`). When the comment body starts with `/breakdown` and the commenter is a configured trusted user (owner + any agent — NOT arbitrary Forgejo users), dispatch a `breakdown` task to the `boss` pool. - [ ] `buildTaskRequest` (existing helper) extended for the breakdown flow: the skill is `breakdown`, the prompt interpolates `{{repo}}`, `{{tracking_issue_number}}`, and `{{trigger_comment_body}}`. - [ ] Non-`/breakdown` comments are ignored (no dispatch, webhook returns 200). ### Security label as A3 fodder - [ ] Document in the skill: emitting `security` on an issue means any PR that closes that issue inherits the label (via Forgejo's `Closes #N` resolution), and A3's reviewer routing picks the `reviewer-security` instance on that PR. So the skill authoring quality directly affects review-model cost. ### Tests - [ ] Webhook test for `issue_comment`: `/breakdown` from trusted user dispatches; `/breakdown` from random user → 200 + skip log; non-slash comment → 200 + skip log. - [ ] Skill prompt renders — snapshot test on the interpolated output. - [ ] No integration test against live Forgejo — manual verification only. ### Manual verification - [ ] On a test repo with a small `specs/hello.md` (2–3 sections, one mentioning "authentication"), comment `/breakdown` on a tracking issue. Confirm: - Boss opens N issues matching the spec sections. - The auth-related issue has the `security` label. - If a `reviewer-security` instance exists with `match_labels: ["security"]`, a PR that closes the security issue gets routed to that reviewer instance per A3's log line. ## Out of scope - Cross-repo breakdowns. - Scheduling (cron-triggered breakdowns). - Re-running on updated spec content (no diffing — v1 is idempotent against a spec that hasn't already been broken down, via "skip if tracking issue already has a summary comment from a prior breakdown"). - Advanced classification beyond keyword matching for the `security` label. - Editing / approving generated issues before posting (ship-them-as-is; operator closes the bad ones). ## References - Tracking issue: #47. - CLAUDE.md issue-authoring conventions (user-story + AC + out-of-scope + references). - A3's label-aware routing is what makes the emitted labels load-bearing. ## Dependencies - **Blocked by:** A3 (labels matter only once routing consumes them). - **Branch off:** `main` (after A3 lands). - **Milestone stretch goal.** Nice-to-have for closing the milestone; not gating.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#54
No description provided.