diff --git a/AGENTS.md b/AGENTS.md index e2175c6..4b3b38d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ This repository contains skills for Guided Coding. The root package supports the - Keep canonical skill instructions under `skills//SKILL.md`. - Use only `name`, `description`, and `license` in `SKILL.md` frontmatter. - Keep the skill directory and frontmatter name identical. -- State in every description that the skill runs only when explicitly requested. +- State in every description that the skill runs only when explicitly requested by the user. Skills that another Guided Coding skill invokes (`guided-coding-write-plan` and `guided-coding-review-plan`) state that they run only when explicitly requested by the user or by another Guided Coding skill, and allow model invocation in `agents/openai.yaml` and `claude-skills.json`. Keep every other skill blocked; `implement`, `freeze-plan`, and `write-deviations` change code or freeze decisions. - Put Codex-specific interface and invocation policy in `agents/openai.yaml`. - Configure Claude-specific names and frontmatter in `tools/GuidedCoding.ClaudeGenerator/claude-skills.json`. - Do not edit `claude-plugin/claude-skills` directly. Regenerate it with `dotnet run --project tools/GuidedCoding.ClaudeGenerator`. diff --git a/CHANGELOG.md b/CHANGELOG.md index 902102a..1dec257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to Guided Coding are documented here. ## [Unreleased] +- Add `guided-coding-plan-and-review`, which writes a plan and refines it through independent reviewers in bounded rounds. Reviewers run `guided-coding-review-plan` in fresh contexts; the planner addresses every finding but never changes a decision the user made explicitly, and reports every finding with its resolution. +- Let models invoke `guided-coding-write-plan` and `guided-coding-review-plan`, so other Guided Coding skills can use them. Their descriptions limit them to explicit requests by the user or by another Guided Coding skill. - Add RDAT (Rationale, Decisions, Acceptance Criteria, Technical Details), an opt-in plan structure next to the default one: numbered Decisions summarize what a reviewer approves, and each section adds information instead of repeating earlier ones. - Let `guided-coding-write-plan` take a plan structure when invoked, either a path to a Markdown file or the name of a bundled structure such as `rdat-plan-structure.md`. `ai-plans/AGENTS.md` can name one the same way. diff --git a/README.md b/README.md index ba43251..2da1f26 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,30 @@ The full method is documented at | `guided-coding-setup` | Set up or upgrade Guided Coding in a repository. | | `guided-coding-write-plan` | After discussing an issue with your agent, write a plan or follow-up plan. | | `guided-coding-review-plan` | Review a plan draft against the repository (use in fresh conversation). | +| `guided-coding-plan-and-review` | Write a plan and refine it through independent reviewer subagents in rounds before you review it. | | `guided-coding-freeze-plan` | Freeze a plan by timestamping its file name and title. | | `guided-coding-implement` | Implement a frozen plan and verify it through the repository's feedback loops. | | `guided-coding-implement-show-me` | (Guided Learning) Implement a frozen plan step-by-step where the agent shows you complete code fragments that you enter and discuss. | | `guided-coding-implement-coach-me` | (Guided Learning) Implement a frozen plan yourself through coached, verifiable milestones. The agent reveals implementation hints progressively. | | `guided-coding-write-deviations` | Summarize follow-up plans and record material implementation differences. | -In most Agent Harnesses, these workflows must be invoked explicitly. All workflows set `allow_implicit_invocation: false` for Agent Plugins and `disable-model-invocation: true` for Claude Plugins, respectively. +In most Agent Harnesses, these workflows must be invoked explicitly. They set `allow_implicit_invocation: false` for Agent Plugins and `disable-model-invocation: true` for Claude Plugins, respectively. The exceptions are `guided-coding-write-plan` and `guided-coding-review-plan`: `guided-coding-plan-and-review` invokes them, so models may invoke them too. Their descriptions still tell the model to run them only when the user or another Guided Coding skill asks for it. + +## Plan and Review + +`guided-coding-plan-and-review` writes a plan with `guided-coding-write-plan`, or picks up an existing draft, and has it reviewed by reviewers that do not share your conversation (subagents, threads, or separate sessions). Each reviewer runs `guided-coding-review-plan` in a fresh context and classifies its findings as `blocking`, `gap`, or `nit`. The planner applies every finding, rejects it with a reason, or leaves it open for you; it never changes a decision you made explicitly. The run stops when a round finds no `blocking` or `gap` findings, or after the round limit. The report lists every finding with its resolution and, separately, every decision and scope change the planner made. + +Configure it in a `## Plan Review` section of `ai-plans/AGENTS.md`, or with arguments when invoking the skill: + +```markdown +## Plan Review + +- Reviewers: two, one on GPT-6.1-Sol and one on Claude Fable 5.2 +- Round limit: 3 +- User decisions: collect +``` + +The defaults are one reviewer on the harness default model, a round limit of 3, and `collect`, which continues and reports findings against your decisions as open for you; `pause` stops the round and asks you instead. Each round starts one subagent per reviewer, so a run costs reviewers × rounds subagent runs at most, plus one replacement for each reviewer that fails. ## Plan Structures diff --git a/claude-plugin/claude-skills/plan-and-review/SKILL.md b/claude-plugin/claude-skills/plan-and-review/SKILL.md new file mode 100644 index 0000000..b04ed39 --- /dev/null +++ b/claude-plugin/claude-skills/plan-and-review/SKILL.md @@ -0,0 +1,74 @@ +--- +name: plan-and-review +description: "Write a Guided Coding plan and refine it through independent reviewers in bounded rounds before presenting it to the user. Run only when explicitly requested by the user." +license: "MIT" +disable-model-invocation: true +--- + +# Plan and Review + +Your goal is to write a plan draft into `ai-plans/`, refine it through independent reviewers in rounds, report the result, and stop. You are the planner: you keep the planning conversation, the reviewers never see it. Never freeze the plan. + +Harnesses may shorten or namespace skill names, e.g., `guided-coding:write-plan` in Claude Code. Use the name under which each skill is installed. + +## 1. Read the Configuration + +Read the `## Plan Review` section of `ai-plans/AGENTS.md` if it exists. Arguments given when invoking this skill override the corresponding configured values. Use the defaults for values that neither sets: + +- **Reviewers:** one reviewer on the harness default model. The configuration can name several, each with a model preference. +- **Round limit:** 3. +- **User decisions:** findings against a decision the user made explicitly in the conversation are never applied without the user. `collect`: continue, and report the finding as open for the user. `pause`: stop the round, ask the user, and continue with the answer. The default is `collect`. + +Model names are harness-specific. If a configured model is unavailable, run that reviewer on the harness default and say so in the report. + +## 2. Get the Plan Draft + +If the user named a plan draft, use it. Otherwise use an uncommitted draft in `ai-plans/` only if it clearly belongs to the work discussed in this conversation; ask the user when several could. Without a draft, invoke `guided-coding-write-plan` to write it, passing on a plan structure the user named. If you cannot invoke it, stop and tell the user to run `guided-coding-write-plan` first and then this skill. Never write the plan without that skill. + +Record the plan's word count. + +## 3. Check for Independent Reviewers + +A reviewer must not share this conversation: it runs as a subagent, thread, or separate session, whichever this harness provides. If this harness provides none, report the plan path, state that no review ran, and point the user to `guided-coding-review-plan` in a fresh session. Never review the plan in your own context as a substitute. + +## 4. Run the Review Rounds + +In each round, start a fresh reviewer for every configured reviewer and run them in parallel where the harness allows. Never reuse a reviewer from an earlier round. Give each reviewer: + +- the instruction to invoke `guided-coding-review-plan` on the plan path, return its findings, and write nothing; +- the paths of the earlier documents for the same work; +- the finding classes below, asking it to classify every finding; +- from round 2 on, every earlier finding with its resolution. This is context, not a limit: the reviewer may report anything, but repeats a rejected finding only with a new argument. + +Never give a reviewer the planning conversation or your reasoning. + +The finding classes are: + +- `blocking`: a false premise, an open decision, an acceptance criterion that cannot be verified, or a contradiction with the code. +- `gap`: a missing scenario or fact. +- `nit`: everything else. + +A round is complete when every reviewer has returned its findings. Replace a reviewer that fails or times out once with a fresh one. If the replacement fails too, address the findings already returned, then report the incomplete round and stop. + +Then address every finding of every class: + +- Handle a finding against a decision the user made explicitly as configured under **User decisions**. +- Apply every other finding or reject it with a one-line reason. You may change anything else in the plan, including decisions you made alone and the scope. +- When findings contradict each other, apply at most one and reject the others with a reason. Treat findings that say the same thing as one, with the highest class among them. +- A fix corrects a decision, criterion, or fact. It adds only the explanation the plan structure requires for a changed decision, never review commentary, and never turns a `nit` into a new rule. +- The plan keeps following the rules of `guided-coding-write-plan` and the plan structure it selected. + +Keep the reviewers' classes. Stop when a complete round reports no `blocking` or `gap` findings, after addressing its `nit` findings, or when the round limit is reached. + +## 5. Report + +Report to the user: + +- the plan path, the rounds run, and why the run stopped; +- the reviewers and the models actually used, including fallbacks; +- every finding with its round, class, a one-line summary, and its resolution: applied, rejected with the reason, or open for the user; +- a separate list of the decision and scope changes you applied, including those the user approved during a pause, so the user can confirm them without comparing versions; +- the plan's word count before and after review; +- whether the plan changed after the last review round. Those changes are unreviewed. + +Then stop. The user reviews the plan before it is frozen. diff --git a/claude-plugin/claude-skills/review-plan/SKILL.md b/claude-plugin/claude-skills/review-plan/SKILL.md index 99f4cf8..3f354aa 100644 --- a/claude-plugin/claude-skills/review-plan/SKILL.md +++ b/claude-plugin/claude-skills/review-plan/SKILL.md @@ -1,13 +1,13 @@ --- name: review-plan -description: "Review a completed Guided Coding plan draft against the codebase before its Planning Phase ends. Run only when explicitly requested by the user." +description: "Review a completed Guided Coding plan draft against the codebase before its Planning Phase ends. Run only when explicitly requested by the user or by another Guided Coding skill." license: "MIT" -disable-model-invocation: true +disable-model-invocation: false --- # Review a Plan -Review the plan named by the user. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`; otherwise ask for its path. Report findings only; never edit the plan or any other file. +Review the plan named by the user or by the invoking skill. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`; otherwise ask for its path. Report findings only; never edit the plan or any other file. Read the plan, applicable repository instructions, the code it discusses, and every earlier document for the same issue, including legacy filenames. Verify assertions about existing types, members, files, APIs, and extension points. Do not reject files or types merely because the plan intends to create them. diff --git a/claude-plugin/claude-skills/setup/SKILL.md b/claude-plugin/claude-skills/setup/SKILL.md index a4bc35f..72940a4 100644 --- a/claude-plugin/claude-skills/setup/SKILL.md +++ b/claude-plugin/claude-skills/setup/SKILL.md @@ -57,6 +57,7 @@ Then explain how Guided Coding can be customized, so the user knows the defaults - **Plan structure:** `guided-coding-write-plan` uses a default structure with `## Rationale`, `## Acceptance Criteria`, and `## Technical Details`. It also ships the RDAT structure (`rdat-plan-structure.md`), which adds a `## Decisions` section with numbered Decisions as a summary for the reviewer. Name a structure file when invoking `guided-coding-write-plan`, or name it or describe your own structure in `ai-plans/AGENTS.md` to override the default. - **File names:** the skills use the placeholders `` (UTC, `YYYY-MM-DD-HHMM`), ``, and `` (kebab-case, shortened ticket title). Conventions for these, e.g., a `` format or a maximum length for ``, belong in `ai-plans/AGENTS.md`. - **Feedback loops:** plans should reference the feedback loops in the root `AGENTS.md` to make Acceptance Criteria verifiable. Adding or removing a feedback loop later only requires updating that list. +- **Plan review:** `guided-coding-plan-and-review` reads an optional `## Plan Review` section in `ai-plans/AGENTS.md`: the number of reviewers and a model preference for each, the round limit (default 3), and how findings against the user's decisions are handled: `collect` (default) reports them as open for the user, `pause` stops the round and asks the user. Each round starts one subagent per reviewer, so a run costs reviewers × rounds subagent runs at most, plus one replacement for each reviewer that fails. - **Deviations:** the threshold for what counts as a material deviation can be tightened or relaxed in `ai-plans/AGENTS.md`. Repository-specific conventions in `AGENTS.md` files take precedence over the skills' defaults. diff --git a/claude-plugin/claude-skills/write-plan/SKILL.md b/claude-plugin/claude-skills/write-plan/SKILL.md index 223451d..7d679b1 100644 --- a/claude-plugin/claude-skills/write-plan/SKILL.md +++ b/claude-plugin/claude-skills/write-plan/SKILL.md @@ -1,13 +1,13 @@ --- name: write-plan -description: "Write a Guided Coding plan or follow-up plan after its approach has been discussed. Run only when explicitly requested by the user." +description: "Write a Guided Coding plan or follow-up plan after its approach has been discussed. Run only when explicitly requested by the user or by another Guided Coding skill." license: "MIT" -disable-model-invocation: true +disable-model-invocation: false --- # Write a Plan -Your goal is to write an Initial Plan or Follow-Up Plan into the `ai-plans/` folder at the repository root. After writing, report the plan path and stop. +Your goal is to write an Initial Plan or Follow-Up Plan into the `ai-plans/` folder at the repository root. After writing, report the plan path and stop. When another Guided Coding skill invoked this one, return to it instead of stopping. ## Plan File Name diff --git a/skills/guided-coding-plan-and-review/SKILL.md b/skills/guided-coding-plan-and-review/SKILL.md new file mode 100644 index 0000000..a72c418 --- /dev/null +++ b/skills/guided-coding-plan-and-review/SKILL.md @@ -0,0 +1,73 @@ +--- +name: guided-coding-plan-and-review +description: Write a Guided Coding plan and refine it through independent reviewers in bounded rounds before presenting it to the user. Run only when explicitly requested by the user. +license: MIT +--- + +# Plan and Review + +Your goal is to write a plan draft into `ai-plans/`, refine it through independent reviewers in rounds, report the result, and stop. You are the planner: you keep the planning conversation, the reviewers never see it. Never freeze the plan. + +Harnesses may shorten or namespace skill names, e.g., `guided-coding:write-plan` in Claude Code. Use the name under which each skill is installed. + +## 1. Read the Configuration + +Read the `## Plan Review` section of `ai-plans/AGENTS.md` if it exists. Arguments given when invoking this skill override the corresponding configured values. Use the defaults for values that neither sets: + +- **Reviewers:** one reviewer on the harness default model. The configuration can name several, each with a model preference. +- **Round limit:** 3. +- **User decisions:** findings against a decision the user made explicitly in the conversation are never applied without the user. `collect`: continue, and report the finding as open for the user. `pause`: stop the round, ask the user, and continue with the answer. The default is `collect`. + +Model names are harness-specific. If a configured model is unavailable, run that reviewer on the harness default and say so in the report. + +## 2. Get the Plan Draft + +If the user named a plan draft, use it. Otherwise use an uncommitted draft in `ai-plans/` only if it clearly belongs to the work discussed in this conversation; ask the user when several could. Without a draft, invoke `guided-coding-write-plan` to write it, passing on a plan structure the user named. If you cannot invoke it, stop and tell the user to run `guided-coding-write-plan` first and then this skill. Never write the plan without that skill. + +Record the plan's word count. + +## 3. Check for Independent Reviewers + +A reviewer must not share this conversation: it runs as a subagent, thread, or separate session, whichever this harness provides. If this harness provides none, report the plan path, state that no review ran, and point the user to `guided-coding-review-plan` in a fresh session. Never review the plan in your own context as a substitute. + +## 4. Run the Review Rounds + +In each round, start a fresh reviewer for every configured reviewer and run them in parallel where the harness allows. Never reuse a reviewer from an earlier round. Give each reviewer: + +- the instruction to invoke `guided-coding-review-plan` on the plan path, return its findings, and write nothing; +- the paths of the earlier documents for the same work; +- the finding classes below, asking it to classify every finding; +- from round 2 on, every earlier finding with its resolution. This is context, not a limit: the reviewer may report anything, but repeats a rejected finding only with a new argument. + +Never give a reviewer the planning conversation or your reasoning. + +The finding classes are: + +- `blocking`: a false premise, an open decision, an acceptance criterion that cannot be verified, or a contradiction with the code. +- `gap`: a missing scenario or fact. +- `nit`: everything else. + +A round is complete when every reviewer has returned its findings. Replace a reviewer that fails or times out once with a fresh one. If the replacement fails too, address the findings already returned, then report the incomplete round and stop. + +Then address every finding of every class: + +- Handle a finding against a decision the user made explicitly as configured under **User decisions**. +- Apply every other finding or reject it with a one-line reason. You may change anything else in the plan, including decisions you made alone and the scope. +- When findings contradict each other, apply at most one and reject the others with a reason. Treat findings that say the same thing as one, with the highest class among them. +- A fix corrects a decision, criterion, or fact. It adds only the explanation the plan structure requires for a changed decision, never review commentary, and never turns a `nit` into a new rule. +- The plan keeps following the rules of `guided-coding-write-plan` and the plan structure it selected. + +Keep the reviewers' classes. Stop when a complete round reports no `blocking` or `gap` findings, after addressing its `nit` findings, or when the round limit is reached. + +## 5. Report + +Report to the user: + +- the plan path, the rounds run, and why the run stopped; +- the reviewers and the models actually used, including fallbacks; +- every finding with its round, class, a one-line summary, and its resolution: applied, rejected with the reason, or open for the user; +- a separate list of the decision and scope changes you applied, including those the user approved during a pause, so the user can confirm them without comparing versions; +- the plan's word count before and after review; +- whether the plan changed after the last review round. Those changes are unreviewed. + +Then stop. The user reviews the plan before it is frozen. diff --git a/skills/guided-coding-plan-and-review/agents/openai.yaml b/skills/guided-coding-plan-and-review/agents/openai.yaml new file mode 100644 index 0000000..26b2ecf --- /dev/null +++ b/skills/guided-coding-plan-and-review/agents/openai.yaml @@ -0,0 +1,7 @@ +interface: + display_name: "Plan and Review with Guided Coding" + short_description: "Write a plan and refine it through independent reviewers" + default_prompt: "Use $guided-coding-plan-and-review to write the agreed plan for this work and refine it through independent reviewers." + +policy: + allow_implicit_invocation: false diff --git a/skills/guided-coding-review-plan/SKILL.md b/skills/guided-coding-review-plan/SKILL.md index de1e589..36efb38 100644 --- a/skills/guided-coding-review-plan/SKILL.md +++ b/skills/guided-coding-review-plan/SKILL.md @@ -1,12 +1,12 @@ --- name: guided-coding-review-plan -description: Review a completed Guided Coding plan draft against the codebase before its Planning Phase ends. Run only when explicitly requested by the user. +description: Review a completed Guided Coding plan draft against the codebase before its Planning Phase ends. Run only when explicitly requested by the user or by another Guided Coding skill. license: MIT --- # Review a Plan -Review the plan named by the user. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`; otherwise ask for its path. Report findings only; never edit the plan or any other file. +Review the plan named by the user or by the invoking skill. If none is named, proceed only when exactly one uncommitted plan draft exists in `ai-plans/`; otherwise ask for its path. Report findings only; never edit the plan or any other file. Read the plan, applicable repository instructions, the code it discusses, and every earlier document for the same issue, including legacy filenames. Verify assertions about existing types, members, files, APIs, and extension points. Do not reject files or types merely because the plan intends to create them. diff --git a/skills/guided-coding-review-plan/agents/openai.yaml b/skills/guided-coding-review-plan/agents/openai.yaml index ff55869..a238b64 100644 --- a/skills/guided-coding-review-plan/agents/openai.yaml +++ b/skills/guided-coding-review-plan/agents/openai.yaml @@ -4,4 +4,4 @@ interface: default_prompt: "Use $guided-coding-review-plan to review this plan draft against the repository." policy: - allow_implicit_invocation: false + allow_implicit_invocation: true diff --git a/skills/guided-coding-setup/SKILL.md b/skills/guided-coding-setup/SKILL.md index 3d8ca43..d5a906c 100644 --- a/skills/guided-coding-setup/SKILL.md +++ b/skills/guided-coding-setup/SKILL.md @@ -56,6 +56,7 @@ Then explain how Guided Coding can be customized, so the user knows the defaults - **Plan structure:** `guided-coding-write-plan` uses a default structure with `## Rationale`, `## Acceptance Criteria`, and `## Technical Details`. It also ships the RDAT structure (`rdat-plan-structure.md`), which adds a `## Decisions` section with numbered Decisions as a summary for the reviewer. Name a structure file when invoking `guided-coding-write-plan`, or name it or describe your own structure in `ai-plans/AGENTS.md` to override the default. - **File names:** the skills use the placeholders `` (UTC, `YYYY-MM-DD-HHMM`), ``, and `` (kebab-case, shortened ticket title). Conventions for these, e.g., a `` format or a maximum length for ``, belong in `ai-plans/AGENTS.md`. - **Feedback loops:** plans should reference the feedback loops in the root `AGENTS.md` to make Acceptance Criteria verifiable. Adding or removing a feedback loop later only requires updating that list. +- **Plan review:** `guided-coding-plan-and-review` reads an optional `## Plan Review` section in `ai-plans/AGENTS.md`: the number of reviewers and a model preference for each, the round limit (default 3), and how findings against the user's decisions are handled: `collect` (default) reports them as open for the user, `pause` stops the round and asks the user. Each round starts one subagent per reviewer, so a run costs reviewers × rounds subagent runs at most, plus one replacement for each reviewer that fails. - **Deviations:** the threshold for what counts as a material deviation can be tightened or relaxed in `ai-plans/AGENTS.md`. Repository-specific conventions in `AGENTS.md` files take precedence over the skills' defaults. diff --git a/skills/guided-coding-write-plan/SKILL.md b/skills/guided-coding-write-plan/SKILL.md index c833a97..1cfce28 100644 --- a/skills/guided-coding-write-plan/SKILL.md +++ b/skills/guided-coding-write-plan/SKILL.md @@ -1,12 +1,12 @@ --- name: guided-coding-write-plan -description: Write a Guided Coding plan or follow-up plan after its approach has been discussed. Run only when explicitly requested by the user. +description: Write a Guided Coding plan or follow-up plan after its approach has been discussed. Run only when explicitly requested by the user or by another Guided Coding skill. license: MIT --- # Write a Plan -Your goal is to write an Initial Plan or Follow-Up Plan into the `ai-plans/` folder at the repository root. After writing, report the plan path and stop. +Your goal is to write an Initial Plan or Follow-Up Plan into the `ai-plans/` folder at the repository root. After writing, report the plan path and stop. When another Guided Coding skill invoked this one, return to it instead of stopping. ## Plan File Name diff --git a/skills/guided-coding-write-plan/agents/openai.yaml b/skills/guided-coding-write-plan/agents/openai.yaml index 05c4204..9c5fb57 100644 --- a/skills/guided-coding-write-plan/agents/openai.yaml +++ b/skills/guided-coding-write-plan/agents/openai.yaml @@ -4,4 +4,4 @@ interface: default_prompt: "Use $guided-coding-write-plan to write the agreed plan for this work." policy: - allow_implicit_invocation: false + allow_implicit_invocation: true diff --git a/tests/GuidedCoding.Tests/PackageValidationTests.cs b/tests/GuidedCoding.Tests/PackageValidationTests.cs index 30f4105..8e07cfe 100644 --- a/tests/GuidedCoding.Tests/PackageValidationTests.cs +++ b/tests/GuidedCoding.Tests/PackageValidationTests.cs @@ -9,7 +9,10 @@ namespace GuidedCoding.Tests; public sealed class PackageValidationTests { - private const string ExplicitInvocation = "Run only when explicitly requested by the user."; + private const string UserInvocation = "Run only when explicitly requested by the user."; + + private const string SkillInvocation = + "Run only when explicitly requested by the user or by another Guided Coding skill."; private const string PluginName = "guided-coding"; private static readonly string[] ExpectedPortableSkillNames = @@ -18,12 +21,20 @@ public sealed class PackageValidationTests "guided-coding-implement", "guided-coding-implement-coach-me", "guided-coding-implement-show-me", + "guided-coding-plan-and-review", "guided-coding-review-plan", "guided-coding-setup", "guided-coding-write-deviations", "guided-coding-write-plan" ]; + // guided-coding-plan-and-review invokes these skills, so models may invoke them too. + private static readonly string[] ModelInvocableSkillNames = + [ + "guided-coding-review-plan", + "guided-coding-write-plan" + ]; + private static readonly Dictionary ExpectedClaudeSkillNames = new ( StringComparer.Ordinal ) @@ -32,6 +43,7 @@ public sealed class PackageValidationTests ["guided-coding-implement"] = "implement", ["guided-coding-implement-coach-me"] = "implement-coach-me", ["guided-coding-implement-show-me"] = "implement-show-me", + ["guided-coding-plan-and-review"] = "plan-and-review", ["guided-coding-review-plan"] = "review-plan", ["guided-coding-setup"] = "setup", ["guided-coding-write-deviations"] = "write-deviations", @@ -84,6 +96,9 @@ private static readonly (string LeadIn, string[] SkillNames)[] SharedSnippets = private static string RepositoryRoot { get; } = FindRepositoryRoot(); + private static bool IsModelInvocable(string skillName) => + ModelInvocableSkillNames.Contains(skillName, StringComparer.Ordinal); + public static TheoryData SharedSectionNames => new ( SharedSections.Select(shared => shared.Section) ); @@ -171,7 +186,7 @@ public void ExpectedClaudeSkillsArePresent() [Theory] [MemberData(nameof(PortableSkillNames))] - public void SkillIsPortableAndRequiresExplicitInvocation(string skillName) + public void SkillIsPortableAndStatesWhoMayInvokeIt(string skillName) { var skillPath = Path.Combine(RepositoryRoot, "skills", skillName, "SKILL.md"); var skill = File.ReadAllText(skillPath); @@ -179,7 +194,11 @@ public void SkillIsPortableAndRequiresExplicitInvocation(string skillName) Assert.Equal(["description", "license", "name"], frontmatter.Keys.Order(StringComparer.Ordinal)); Assert.Equal(skillName, frontmatter["name"]); - Assert.Contains(ExplicitInvocation, frontmatter["description"], StringComparison.Ordinal); + Assert.EndsWith( + IsModelInvocable(skillName) ? SkillInvocation : UserInvocation, + frontmatter["description"], + StringComparison.Ordinal + ); Assert.NotEqual( ReadJson("plugin.json").GetProperty("description").GetString(), frontmatter["description"] @@ -195,7 +214,7 @@ public void SkillIsPortableAndRequiresExplicitInvocation(string skillName) [Theory] [MemberData(nameof(PortableSkillNames))] - public void CodexMetadataRequiresExplicitInvocation(string skillName) + public void CodexMetadataMatchesTheInvocationPolicy(string skillName) { var metadataPath = Path.Combine(RepositoryRoot, "skills", skillName, "agents", "openai.yaml"); var metadata = File.ReadAllText(metadataPath); @@ -204,7 +223,11 @@ public void CodexMetadataRequiresExplicitInvocation(string skillName) Assert.Contains("short_description:", metadata, StringComparison.Ordinal); Assert.Contains("default_prompt:", metadata, StringComparison.Ordinal); Assert.Contains($"${skillName}", metadata, StringComparison.Ordinal); - Assert.Contains("allow_implicit_invocation: false", metadata, StringComparison.Ordinal); + Assert.Contains( + $"allow_implicit_invocation: {(IsModelInvocable(skillName) ? "true" : "false")}", + metadata, + StringComparison.Ordinal + ); Assert.DoesNotContain( ReadJson("plugin.json").GetProperty("description").GetString()!, metadata, @@ -282,7 +305,10 @@ public void ClaudeSkillIsGeneratedFromPortableSkill(string portableName, string ) ); Assert.Equal(claudeName, claudeFrontmatter["name"]); - Assert.Equal("true", claudeFrontmatter["disable-model-invocation"]); + Assert.Equal( + IsModelInvocable(portableName) ? "false" : "true", + claudeFrontmatter["disable-model-invocation"] + ); Assert.Equal( portableFrontmatter["description"], JsonSerializer.Deserialize(claudeFrontmatter["description"]) diff --git a/tools/GuidedCoding.ClaudeGenerator/claude-skills.json b/tools/GuidedCoding.ClaudeGenerator/claude-skills.json index 2b846eb..2f1c963 100644 --- a/tools/GuidedCoding.ClaudeGenerator/claude-skills.json +++ b/tools/GuidedCoding.ClaudeGenerator/claude-skills.json @@ -16,9 +16,13 @@ "name": "implement-show-me", "disableModelInvocation": true }, + "guided-coding-plan-and-review": { + "name": "plan-and-review", + "disableModelInvocation": true + }, "guided-coding-review-plan": { "name": "review-plan", - "disableModelInvocation": true + "disableModelInvocation": false }, "guided-coding-setup": { "name": "setup", @@ -30,7 +34,7 @@ }, "guided-coding-write-plan": { "name": "write-plan", - "disableModelInvocation": true + "disableModelInvocation": false } } }