diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 199782b..a9aedbe 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -6,6 +6,7 @@ "name": "Ægir Máni Hauksson", "email": "agir96@gmail.com" }, + "repository": "https://github.com/sourcehawk/feature-dev-workflow", "license": "MIT", "keywords": [ "workflow", diff --git a/README.md b/README.md index 80c1bb8..01ddf5c 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ It is also the faster path. Breaking the feature into independent PRs lets the m | `maintaining-architectural-coherence` | Work split across PRs/agents/waves must read as one author. Invoked when agreeing conventions before parallel work, and when reviewing the merged union for structural, interface, naming, and vocabulary drift. | | `product-epic` | Standalone, upstream of the flow. A product manager has a rough epic — an idea, a few bullets, a draft — that must be scoped and clarified before an engineer can design against it. Surfaces the gaps with a fresh-reader test, refines them with the PM (challenging scope and feasibility), and files the result. | | `drafting-a-release` | Standalone (not part of the feature flow). About to cut a release: drafts curated release notes that explain the why, proposes the version, and gates `gh release create` on the user. | +| `reporting-a-skill-gap` | Standalone (not part of the feature flow). A skill in this plugin let the work down: the user had to add an instruction by hand, a skill gave wrong or missing guidance, or it did not trigger. Files the gap as an issue on this plugin's repository, with a reproduction a maintainer can replay as a test, and with the user's project details removed. | ## How it works diff --git a/skills/reporting-a-skill-gap/SKILL.md b/skills/reporting-a-skill-gap/SKILL.md new file mode 100644 index 0000000..d1f41a8 --- /dev/null +++ b/skills/reporting-a-skill-gap/SKILL.md @@ -0,0 +1,94 @@ +--- +name: reporting-a-skill-gap +description: + Use when a feature-dev-workflow skill let the work down, such as when the + user had to add an instruction by hand that a skill should have carried, a + skill gave wrong or missing guidance, a skill did not trigger when it + should have, or the agent repeated or undid work that a skill should have + prevented, or when asked to report such a gap to the plugin's maintainers. +--- + +# reporting-a-skill-gap + +A gap in one of this plugin's skills shows up in a user's session, in a user's project. The fix happens somewhere else: in the plugin's own repository, by a maintainer who was not in the session. This skill turns what went wrong into an issue that maintainer can act on. + +The maintainer fixes a skill under `superpowers:writing-skills`, and that loop starts with a RED baseline: a fresh subagent runs a scenario without the fix and fails in a way someone can check. **The reproduction is the most valuable part of the report.** A story of what happened tells the maintainer that something broke. A scenario with a task prompt and a failure predicate lets them watch it break, then watch the fix work. + +## When to invoke + +- The user asks to report a skill problem to the plugin, or says a skill should have handled something. +- You notice the gap yourself: you, or the user, had to add an instruction the skill did not carry; you followed a skill and it led you wrong; a skill did not load when the work matched its trigger. Then offer the report to the user once, in one sentence. Do not file it unasked. + +This skill covers the skills of `feature-dev-workflow` only. A gap in another plugin's skill goes to that plugin's maintainers; a gap in the user's own project instructions is the user's to fix. + +## Step 1: resolve the target repository + +The issue goes to the plugin's repository, never to the repository of the current project. `gh` defaults to the repository of the working directory, so a bare `gh issue create` files the report in the user's project, and that can publish their session to their own team or lose it entirely. + +1. Read `${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json`. Its `repository` field holds the URL of the plugin's repository. Take `OWNER/REPO` from it (`https://github.com/OWNER/REPO` gives `OWNER/REPO`). Its `version` field is the plugin version for the report. +2. If the file or the field is missing, ask the user for the repository. Do not take it from a README, a marketplace file, or the current remote. +3. Pass `--repo OWNER/REPO` on every `gh issue` command this skill runs, and name the repository in the path of every `gh api` call (`repos/OWNER/REPO/...`): `gh api` takes no `--repo`. + +## Step 2: locate the gap in the skill + +Open the installed skill, `${CLAUDE_PLUGIN_ROOT}/skills//SKILL.md`, and find the section the agent was following when it went wrong. Copy its heading exactly. If the skill did not trigger, the section is its `description`. Confirm the gap is real in the text: if the skill does cover the case and the agent missed it, say so in the report, because then the fix is to make the guidance easier to find, not to add it. + +## Step 3: search for an existing report + +``` +gh issue list --repo OWNER/REPO --state all --search " " --limit 20 +``` + +Run a second search with other words if the first finds nothing. The list shows titles only, so open each plausible match with `gh issue view --repo OWNER/REPO --comments` before you pick a branch below. Then: + +- **An open issue covers the same gap:** comment on it instead of filing a new one. The comment adds your reproduction and evidence (see the template's comment form). If the issue already has a reproduction of the same case, tell the user and stop. +- **A closed issue covers it, fixed in a version newer than the installed one:** tell the user to update the plugin. File nothing. +- **A closed issue covers it and the installed version has the fix:** it is a regression. File a new issue and name the closed one in `## Evidence`. +- **No match:** file a new issue. + +## Step 4: draft the body from the template + +Fill `${CLAUDE_PLUGIN_ROOT}/skills/reporting-a-skill-gap/templates/skill-gap.md`, each section per its `` guidance. + +**Sanitize everything.** The plugin's repository is public; the user's project usually is not. The report keeps the generic shape of the failure and drops everything else: + +| From the session | In the report | +| --- | --- | +| Project, company, product, or repository name | A role: `a service repository`, `the project` | +| A person's name, including the user's | `the user` | +| Paths, branch names, issue or PR numbers in the user's repository | Neutral stand-ins: ``, ``, or nothing | +| A secret, key, token, or credential, even a test one | Nothing. Not the value, not a masked form. | +| Domain details of the feature (what the code is for) | Only what the failure depends on | +| Session ids, logs | Described in `## Evidence`, not pasted, unless the user says to include them | + +Read the draft once against this table before you show it. A quoted instruction the user typed by hand is quoted, but with the same reductions. + +**Write the reproduction to be replayed.** Check each part before you move on: + +- The situation and environment facts hold every fact the agent needs, so a fresh subagent with only this text can play the scenario. +- The task prompt is the message the agent under test receives. It does not mention the fix. It asks for a neutral change ("I changed a function", "check the change"), not the user's feature, because the sanitizing table applies to the reproduction too. +- The failure predicate is something to grep or check in the agent's output, with a pass condition beside it. "The agent handles it badly" is not a predicate; "no dispatch prompt names a per-subagent scratch path" is. + +**OPTIONAL SUB-SKILL:** `simple-english:simple-english` for the prose of the issue body or comment. If it is available, load it before you draft and write the sentences under it. Where its formatting rules (headings, bold, lists, or its register for chat replies) differ from the host skill or its template, the host skill and its template win. It sets sentence style only: the template still decides the sections, their order, and their length, and the task prompt and failure predicate keep their exact wording. If the skill is not available, do not stop or wait for it. If you have not already done so in this session, tell the user once that it can be installed with `/plugin marketplace add AminBlg/SimpleEnglish` and then `/plugin install simple-english@simple-english`. Then write short, plain, active sentences without it. + +## Step 5: land it + +**REQUIRED SUB-SKILL:** `feature-dev-workflow:writing-github-issues` to create the issue (its Step 2A) or post the comment. That skill owns the confirmation gate. It has no step that only comments, so post a comment on an existing issue with `gh issue comment --repo OWNER/REPO --body-file `, under the same gate, and do not edit the issue's body: a second occurrence adds evidence, it does not change what the issue states. Three points apply on top of it: + +- The confirmation names the target as the plugin's `OWNER/REPO` from Step 1, so the user sees that the report leaves their project. +- Say which sanitizing reductions you made, in one line, so the user can check that nothing private is left. +- Set the label `bug` and the assignee only when the user can push to the plugin's repository (`gh api repos/OWNER/REPO --jq .permissions.push` prints `true`). Otherwise pass neither: GitHub drops both for a user without push access, and the triage is the maintainers' work. + +Do not edit the installed copy of the skill under `${CLAUDE_PLUGIN_ROOT}`: the plugin cache is replaced on update. Until the fix ships, keep any instruction the user added by hand in the session's own prompts. + +## Red flags + +| Thought | Reality | +| --- | --- | +| "`gh` is set up for this repo, I'll just run `gh issue create`" | That files the report in the user's project. Pass `--repo` with the plugin's repository from `plugin.json`. | +| "What happened explains it, the maintainer can work out a test" | The maintainer was not there. Without a task prompt and a failure predicate they will test a scenario that may not fail. Write the reproduction. | +| "The skill name is enough, they can find the section" | Name the skill as `feature-dev-workflow:` and copy the heading. A report that points at a whole skill gets a fix in the wrong place. | +| "I'll mention the project so they see it was a real case" | The repository is public. The generic shape is the real case; the names add only risk. | +| "It's only a test key, I'll mask it" | Leave it out. A masked key still tells a reader what kind of secret leaked and where. | +| "This is probably new, I'll skip the search" | A second issue splits the thread. Search first; a reproduction is worth more on the existing issue. | +| "I'll fix the installed skill file so it works now" | The cache is overwritten on update, and the fix needs the maintainer's RED baseline. Report it and keep the hand-added instruction in your prompts. | diff --git a/skills/reporting-a-skill-gap/templates/skill-gap.md b/skills/reporting-a-skill-gap/templates/skill-gap.md new file mode 100644 index 0000000..56d18f6 --- /dev/null +++ b/skills/reporting-a-skill-gap/templates/skill-gap.md @@ -0,0 +1,71 @@ + + +# + + + +## What happened + + + +## Expected + + + +## Where in the plugin + + + + + +## Instruction added by hand + + + +## Reproduction + + + +### Situation + + + +### Environment facts + + + +### Task prompt + + + +### Failure predicate + + + +## Suggested fix location + + + + + +## Evidence + + diff --git a/templates/user-CLAUDE.md b/templates/user-CLAUDE.md index 767ce48..49afc66 100644 --- a/templates/user-CLAUDE.md +++ b/templates/user-CLAUDE.md @@ -28,5 +28,6 @@ This file applies to every project. A project's own `CLAUDE.md` comes first wher | Act on review feedback (Copilot, a person, or a local review), and again before every push of a review fix | `feature-dev-workflow:addressing-review-feedback` | | Run a review loop on a PR until it is clean | `feature-dev-workflow:copilot-review-loop` | | Cut, draft, tag, or publish a release | `feature-dev-workflow:drafting-a-release` | +| Report a feature-dev-workflow skill that let the work down: an instruction you had to add by hand, wrong or missing guidance, or a skill that did not trigger | `feature-dev-workflow:reporting-a-skill-gap` | | Write prose that people read: PR and issue bodies, review replies, docs, release notes, commit bodies | `simple-english:simple-english` | | Say that work is complete, fixed, or passing | `superpowers:verification-before-completion` |