Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repository contains skills for Guided Coding. The root package supports the
- Keep canonical skill instructions under `skills/<skill-name>/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`.
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
74 changes: 74 additions & 0 deletions claude-plugin/claude-skills/plan-and-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 3 additions & 3 deletions claude-plugin/claude-skills/review-plan/SKILL.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
1 change: 1 addition & 0 deletions claude-plugin/claude-skills/setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<timestamp>` (UTC, `YYYY-MM-DD-HHMM`), `<ticket-id>`, and `<short-title>` (kebab-case, shortened ticket title). Conventions for these, e.g., a `<ticket-id>` format or a maximum length for `<short-title>`, 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.
6 changes: 3 additions & 3 deletions claude-plugin/claude-skills/write-plan/SKILL.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
73 changes: 73 additions & 0 deletions skills/guided-coding-plan-and-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 7 additions & 0 deletions skills/guided-coding-plan-and-review/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading