Skip to content

feat: spec → plan → execute workflow (ADR-020) - #13

Merged
nicholastn1 merged 4 commits into
mainfrom
feat/spec-plan-execute-workflow
Jul 7, 2026
Merged

feat: spec → plan → execute workflow (ADR-020)#13
nicholastn1 merged 4 commits into
mainfrom
feat/spec-plan-execute-workflow

Conversation

@nicholastn1

@nicholastn1 nicholastn1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the single-shot PRP flow with a three-command pipeline/spec-dc (the WHAT) → /plan-dc (the HOW) → /execute-dc (the DO) — adapted from Spec-Driven Development (spec-authorplan-authorplan-executor) and folded into dotcontext's conventions (ADR-020).
  • Separates concerns: the spec is a behavior contract (no implementation, no ADRs); the plan owns ADR review + a 100% traceability table; execution treats the plan as an immutable contract.
  • Adds two adversarial review boundaries (plan and execution), each a dual reviewer-pro + reviewer-fast loop until double-APPROVED.
  • Retires generate-prp/execute-prp non-destructively — existing installs keep working after dotcontext update.

Architecture

flowchart TD
    A([feature idea]) --> B["/spec-dc — the WHAT<br/>.context/specs/spec-*.md<br/>clarity assessment · no ADR review"]
    B -->|user reviews spec| C["/plan-dc — the HOW<br/>.context/plans/plan-*.md<br/>ADR review · 100% traceability<br/>Validation Gate + dual reviewer loop"]
    C -->|/clear · fresh session| D["/execute-dc — the DO<br/>parallel waves · tests per wave<br/>dual review vs git diff"]
    D --> E([implemented + reviewed])
Loading

Changes

  • Commands: templates/.claude/commands/{spec-dc,plan-dc,execute-dc}.md (mirrored into root .claude/commands/).
  • Agents: plan-dc/{reviewer-pro,reviewer-fast} and execute-dc/{reviewer-pro,reviewer-fast} (ADR-012 extraction).
  • Scaffolding: .context/specs/ + .context/plans/ (versioned, with READMEs).
  • Preserved dotcontext strengths: AskUserQuestion stays explicit/mandatory (ADR-005); the Validation Gate (user approval on the approach) and the four-option ADR-conflict resolution (Update / Find alternative / Keep / Let Claude decide + version/History/Supersede mechanics) moved into /plan-dc; worktree isolation kept in /execute-dc with base-branch detection replacing the hardcoded develop.
  • Wiring: init.sh, update.sh, agents.sh (DOTCONTEXT_COMMANDS), help.sh; rebuilt the dotcontext binary.
  • Docs: AGENTS.md Workflows, setup-context.md tree, root CONTEXT.md/CLAUDE.md/README.md/CHANGELOG.md.
  • Decisions: new ADR-020; amended ADR-018 (command list) and ADR-019 (references retargeted to the trio; still Proposed/deferred).
  • Removed two orphaned ~22 MB demo GIFs for the retired commands.

Regression safety: on dotcontext update, generate-prp/execute-prp/.context/prp/ are simply dropped from the managed set — existing local copies are left untouched (they freeze but keep working). New projects get the trio only.

Type

  • Skill / template (new command + agent templates)
  • CLI behavior (src/ change — rebuilt the dotcontext binary)
  • Docs / ADR
  • Other

Checklist

  • Ran make build and committed the rebuilt dotcontext
  • bash -n passes and I tested locally (./dotcontext doctor → 13 passed, 0 failed)
  • New command/agent files carry description/name frontmatter and are wired into init.sh + update.sh
  • Checked .context/decisions/ — added ADR-020, amended ADR-018/019 (no unresolved conflict)
  • Conventional-commit style (feat:)

Test plan

  • dotcontext init --agents claude --yes in a scratch repo → trio installed, .context/specs + .context/plans created, no .context/prp
  • dotcontext update in a repo that predates this change → trio added, old generate-prp/execute-prp and .context/prp/ left intact (nothing broken)
  • dotcontext init --agents opencode,copilot --yes → trio emitted to .opencode/command/ and .github/prompts/; AGENTS.md Workflows lists the trio
  • Walk /spec-dc/plan-dc/execute-dc on a small feature; confirm AskUserQuestion fires, the Validation Gate pauses for approval, and the dual reviewer loops run

Summary by CodeRabbit

  • New Features
    • Added a three-step spec → plan → execute workflow with /spec-dc, /plan-dc, and /execute-dc, including dual fast/pro review loops, 100% traceability-backed planning, and wave-based execution with test gating and final diff verification.
  • Documentation
    • Updated README/help/changelog and .context guidance and ADRs to reflect the new workflow, artifact layout, and retirement of the PRP flow.
  • Chores
    • Retired older PRP-based command/template artifacts and expanded managed templates/prompts to cover the new reviewer variants.

Replace the single-shot PRP flow with a three-command pipeline adapted from
Spec-Driven Development (spec-author → plan-author → plan-executor), folding in
dotcontext's own strengths.

- /spec-dc — behavior spec (the WHAT) in .context/specs/; keeps the clarity
  assessment + reference-material handling; does NOT review ADRs.
- /plan-dc — implementation plan (the HOW) in .context/plans/; owns ADR review,
  100% Traceability, the Validation Gate (user approval on the approach), the
  four-option ADR-conflict resolution with version/History/Supersede mechanics,
  and a dual adversarial reviewer loop until double-APPROVED.
- /execute-dc — parallel waves + tests-per-wave + dual review vs the plan;
  worktree option; base branch detected (no hardcoded develop).
- AskUserQuestion (ADR-005) stays explicit and mandatory in all three.
- Retire generate-prp/execute-prp NON-DESTRUCTIVELY: dropped from init and the
  managed update set, so existing installs keep their files and .context/prp
  untouched; new projects get the trio only.

Wiring: init.sh, update.sh, agents.sh (DOTCONTEXT_COMMANDS), help.sh, make build.
Docs: AGENTS.md workflows, setup-context tree, root CONTEXT/CLAUDE/README/CHANGELOG.
Decisions: new ADR-020; amend ADR-018 (command list); update ADR-019 refs.
Also removes two orphaned ~22MB demo GIFs for the retired commands.
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR replaces the PRP workflow with a three-step /spec-dc/plan-dc/execute-dc flow. It adds new command docs, reviewer prompts, templates, ADRs, documentation updates, and CLI/setup wiring, while removing the old PRP command/template artifacts.

Changes

Spec-Plan-Execute Workflow

Layer / File(s) Summary
spec-dc command and templates
.claude/commands/spec-dc.md, templates/.claude/commands/spec-dc.md, .claude/agents/spec-dc/*, templates/.claude/agents/spec-dc/*, .context/specs/README.md, templates/.context/specs/README.md
Adds the /spec-dc behavior-spec workflow, its reviewer prompts, and the specs README/template copies.
plan-dc command and templates
.claude/commands/plan-dc.md, templates/.claude/commands/plan-dc.md, .claude/agents/plan-dc/*, templates/.claude/agents/plan-dc/*, .context/plans/README.md, templates/.context/plans/README.md
Adds the /plan-dc workflow, reviewer prompts, required plan structure, and the plans README/template copies.
execute-dc command and templates
.claude/commands/execute-dc.md, templates/.claude/commands/execute-dc.md, .claude/agents/execute-dc/*, templates/.claude/agents/execute-dc/*
Adds the /execute-dc workflow, reviewer prompts, wave-based execution rules, and final review loop.
ADR updates
.context/decisions/018-*.md, .context/decisions/019-*.md, .context/decisions/020-*.md, .context/decisions/README.md
Updates ADR-018 and adds ADR-019 and ADR-020 plus the decisions index entries.
Documentation updates
.context/CONTEXT.md, README.md, CLAUDE.md, templates/AGENTS.md, CHANGELOG.md, templates/.claude/commands/setup-context.md
Updates workflow descriptions, directory trees, command tables, and setup guidance to reflect the new pipeline and retired PRP files.
CLI and shell wiring
dotcontext, src/commands/{init,update,help}.sh, src/setup/agents.sh
Updates generated directories, managed templates, seed files, help text, and agent command lists to create and manage the new artifacts.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Poem

Old PRP paths fade from view,
Spec, Plan, Execute take the queue.
What becomes the plan, then done,
Reviewed twice before it's spun.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: the new spec → plan → execute workflow aligned with ADR-020.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/spec-plan-execute-workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/commands/init.sh (1)

105-122: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Don't overwrite the new managed prompt files on re-init.

These /spec-dc / /plan-dc / /execute-dc command files and reviewer prompts still go through the unconditional download path, so rerunning dotcontext init will clobber local edits despite the "without overwriting your content" promise.

Suggested fix
-      download "${BASE_URL}/templates/.claude/commands/${c}.md" ".claude/commands/${c}.md"
+      download_if_missing "${BASE_URL}/templates/.claude/commands/${c}.md" ".claude/commands/${c}.md"
...
-      download "${BASE_URL}/templates/.claude/agents/${a}.md" ".claude/agents/${a}.md"
+      download_if_missing "${BASE_URL}/templates/.claude/agents/${a}.md" ".claude/agents/${a}.md"

Based on learnings: seed files must be create-only, and managed files should not overwrite existing user content without a diff/prompt.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/commands/init.sh` around lines 105 - 122, The init script is still
overwriting managed prompt files on rerun via the unconditional download loops
in init.sh. Update the command and agent seeding logic around the local c/local
a loops so the new managed prompts (including spec-dc, plan-dc, execute-dc, and
reviewer prompts) are create-only: skip downloading if the target file already
exists, or otherwise preserve user edits unless an explicit update/diff flow is
requested. Keep the existing download helper, but add an existence check or
equivalent non-overwrite guard before calling it for each managed template path.

Source: Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/commands/execute-dc.md:
- Around line 49-77: The worktree prompt in execute-dc.md is unreachable when
the working tree has unrelated changes because the clean-tree bailout happens
first. Reorder the flow so the AskUserQuestion/worktree choice is offered before
the clean-tree check, or only run the clean-tree bailout for the in-place
branch; keep the base-branch detection, git checkout/pull, and work branch
creation behavior in the same execute-dc.md flow.

In @.claude/commands/plan-dc.md:
- Around line 54-56: The path snippet in the plan docs is using an untagged
fenced code block, which triggers the markdown lint rule. Update the fenced
snippet in the plan guidance so the
`.context/plans/plan-<unix-timestamp>-<descriptive-kebab>.md` example is marked
as text, keeping the same content but adding the language tag to the fence.
- Around line 219-235: The reviewer prompt fence in the plan guidance block is
missing a language tag, causing the MD040 issue. Update the fenced prompt block
in the plan instructions to use the existing plain-text tag by adjusting the
markdown fence around the “Review the full plan…” prompt, and keep the rest of
the prompt content unchanged so the block remains clearly identified for linting
and reviewers.

In @.claude/commands/spec-dc.md:
- Around line 80-82: The artifact-path example in the spec docs uses an
unlabeled fenced code block, which triggers MD040. Update the fence around the
`.context/specs/spec-<unix-timestamp>-<descriptive-kebab>.md` example in
spec-dc.md to use an explicit language label such as text so the documentation
remains lint-clean.

In @.context/CONTEXT.md:
- Around line 168-190: The flow example in CONTEXT.md is an untyped fenced code
block, which triggers MD040. Update the opening fence for the feature
development flow example to use a text language tag so the markdown lint passes,
keeping the existing content and closing fence unchanged.

In @.context/decisions/019-knowledge-reconciliation-after-prp.md:
- Around line 44-75: This section still documents a stale auto-sync contract, so
update the ADR text to match the deferred/manual reconciliation workflow in
ADR-020. In the `/sync-context` and `Context Impact` sections, remove the claim
that `/execute-dc` invokes sync automatically and rewrite the delta description
to reflect the new PRP/template flow and manual reconciliation semantics. Keep
the guidance aligned with the existing reconciliation policy described in this
ADR and the referenced workflow symbols only.

In @.context/decisions/020-spec-plan-execute-workflow.md:
- Around line 66-67: The ADR references incorrect agent file paths for the
reviewers, so update the plan-dc and execute-dc path examples to the actual
.claude/agents/.../*.md locations used by this PR. Adjust the wording in the
decision doc where the reviewer agents are named so readers are directed to the
real reviewer-pro and reviewer-fast files instead of the old paths.

In @.context/plans/README.md:
- Around line 5-7: The README example fence in the planning filename section is
missing a language tag and triggers markdownlint MD040. Update the fenced block
used for the `plan-<unix-timestamp>-<descriptive-kebab>.md` example to include a
proper language identifier, using the README example block itself as the target
to fix.

In `@dotcontext`:
- Around line 1129-1132: cmd_update_templates now copies managed reviewer
prompts for plan-dc and execute-dc, but it does not remove obsolete files when
templates are renamed or deleted. Update the cleanup logic in
cmd_update_templates to prune stale reviewer files from the plan-dc and
execute-dc directories, keeping only the current set of managed templates. Use
the existing template-management flow and the reviewer path patterns from the
diff to locate and delete any orphaned files during dotcontext update.

In `@README.md`:
- Around line 294-297: The README workflow examples use bare code fences, which
triggers the markdown lint rule for missing language tags. Update the fenced
blocks for the workflow examples to include an explicit language such as text,
and use bash only where the snippet is actual shell syntax. Make the change
consistently across all referenced example blocks so the docs remain lint-clean.

In `@src/setup/agents.sh`:
- Line 272: The DOTCONTEXT_COMMANDS list is dropping the legacy generate-prp and
execute-prp commands, which breaks upgraded installs. Update the command
registration in emit_agent_commands so legacy names are preserved in a
compatibility path during dotcontext update, while keeping the newer command set
intact for fresh installs. Use the DOTCONTEXT_COMMANDS variable and the
emit_agent_commands flow to split legacy aliases from the main update path
instead of removing them.

In `@templates/.claude/commands/execute-dc.md`:
- Around line 49-77: The execute-dc command flow is ordered incorrectly: the
clean-tree check currently runs before offering the optional isolated worktree
path, which makes the no-stash workflow unreachable when the tree is dirty.
Reorder the steps in the command template so the worktree offer comes first,
then branch creation/setup, and only after that enforce the clean working tree
requirement; keep the same sequencing as the source command doc and preserve the
behavior around AskUserQuestion, git checkout, and git worktree add.

In `@templates/.claude/commands/plan-dc.md`:
- Around line 88-93: The ADR update guidance in the plan template is incorrect
because it implies editing the existing ADR in place and hard-coding a 1.0 to
2.0 bump. Update the instructions around the ADR mechanics so they tell authors
to create a new ADR version for the updated decision, record the change in the
plan’s Impact on Existing Decisions table, and mark the prior ADR as superseded
instead of mutating it; reference the ADR/version/history guidance in the plan
doc so the wording aligns with the repo rule.

In `@templates/.claude/commands/spec-dc.md`:
- Around line 80-82: Label the bare code fence in the artifact-path example to
avoid MD040; update the fenced block in the spec template so the path example is
marked with an explicit language such as text. Use the existing template snippet
around `.context/specs/spec-<unix-timestamp>-<descriptive-kebab>.md` to locate
the fence and keep the rest of the content unchanged.

In `@templates/.context/plans/README.md`:
- Around line 5-7: The README example fence in the plans docs is missing a
language tag, triggering markdownlint MD040. Update the fenced code block around
the `plan-<unix-timestamp>-<descriptive-kebab>.md` example to include a valid
language identifier (for example, `text`) while keeping the example content
unchanged.

In `@templates/.context/specs/README.md`:
- Around line 5-7: The README example uses an unlabeled fenced code block, which
triggers the docs lint rule. Update the fenced example in the specs README to
include a language tag such as text or md on the fence, keeping the example
content unchanged so the markdown remains valid and MD040 is satisfied.

---

Outside diff comments:
In `@src/commands/init.sh`:
- Around line 105-122: The init script is still overwriting managed prompt files
on rerun via the unconditional download loops in init.sh. Update the command and
agent seeding logic around the local c/local a loops so the new managed prompts
(including spec-dc, plan-dc, execute-dc, and reviewer prompts) are create-only:
skip downloading if the target file already exists, or otherwise preserve user
edits unless an explicit update/diff flow is requested. Keep the existing
download helper, but add an existence check or equivalent non-overwrite guard
before calling it for each managed template path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 60f77a3f-866a-4cd8-8734-5728da7524d0

📥 Commits

Reviewing files that changed from the base of the PR and between 5836b09 and b9073b1.

⛔ Files ignored due to path filters (3)
  • assets/demo-execute-prp.gif is excluded by !**/*.gif
  • assets/demo-generate-prp.gif is excluded by !**/*.gif
  • templates/.context/prp/generated/.keep is excluded by !**/generated/**
📒 Files selected for processing (38)
  • .claude/agents/execute-dc/reviewer-fast.md
  • .claude/agents/execute-dc/reviewer-pro.md
  • .claude/agents/plan-dc/reviewer-fast.md
  • .claude/agents/plan-dc/reviewer-pro.md
  • .claude/commands/execute-dc.md
  • .claude/commands/execute-prp.md
  • .claude/commands/generate-prp.md
  • .claude/commands/plan-dc.md
  • .claude/commands/spec-dc.md
  • .context/CONTEXT.md
  • .context/decisions/018-command-portability-and-invocation-modes.md
  • .context/decisions/019-knowledge-reconciliation-after-prp.md
  • .context/decisions/020-spec-plan-execute-workflow.md
  • .context/decisions/README.md
  • .context/plans/README.md
  • .context/specs/README.md
  • CHANGELOG.md
  • CLAUDE.md
  • README.md
  • dotcontext
  • src/commands/help.sh
  • src/commands/init.sh
  • src/commands/update.sh
  • src/setup/agents.sh
  • templates/.claude/agents/execute-dc/reviewer-fast.md
  • templates/.claude/agents/execute-dc/reviewer-pro.md
  • templates/.claude/agents/plan-dc/reviewer-fast.md
  • templates/.claude/agents/plan-dc/reviewer-pro.md
  • templates/.claude/commands/execute-dc.md
  • templates/.claude/commands/execute-prp.md
  • templates/.claude/commands/generate-prp.md
  • templates/.claude/commands/plan-dc.md
  • templates/.claude/commands/setup-context.md
  • templates/.claude/commands/spec-dc.md
  • templates/.context/plans/README.md
  • templates/.context/prp/templates/feature.md
  • templates/.context/specs/README.md
  • templates/AGENTS.md
💤 Files with no reviewable changes (5)
  • .claude/commands/generate-prp.md
  • templates/.context/prp/templates/feature.md
  • templates/.claude/commands/execute-prp.md
  • .claude/commands/execute-prp.md
  • templates/.claude/commands/generate-prp.md

Comment thread .claude/commands/execute-dc.md Outdated
Comment thread .claude/commands/plan-dc.md Outdated
Comment thread .claude/commands/plan-dc.md Outdated
Comment thread .claude/commands/spec-dc.md Outdated
Comment thread .context/CONTEXT.md
Comment thread templates/.claude/commands/execute-dc.md Outdated
Comment thread templates/.claude/commands/plan-dc.md Outdated
Comment thread templates/.claude/commands/spec-dc.md Outdated
Comment thread templates/.context/plans/README.md Outdated
Comment thread templates/.context/specs/README.md Outdated
@nicholastn1 nicholastn1 self-assigned this Jul 7, 2026
The source workshop had no spec review; a bad spec poisons everything
downstream (a plan can be 100% faithful to a wrong spec). So /spec-dc now
ends with the same dual reviewer loop as /plan-dc and /execute-dc — but
scoped deliberately narrow.

- New agents spec-dc/{reviewer-pro,reviewer-fast}: judge ONLY well-formedness,
  testability, scope hygiene, internal consistency, grounding (cited paths
  exist), and faithfulness to the original request.
- Hard guardrail: reviewers must NOT judge product merit and must NOT invent
  requirements — "is this the right thing to build" stays the human's call
  (the "Review first" checkpoint + clarity assessment).
- spec-dc.md: new Phase 3 review loop (fresh Pro+Fast each round, verify
  findings, ~3-round cap); old Final verification → Phase 4.
- Wired into init.sh/update.sh; rebuilt binary; mirrored to root.
- Docs: ADR-020 (review at all three boundaries + spec-scope rationale,
  History v1.1), CONTEXT.md (18 agents + flow), README, AGENTS.md, CHANGELOG.

Raised in tech-lead review (Daniel Henrique).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.claude/commands/spec-dc.md (1)

164-181: 📐 Maintainability & Code Quality | 🟡 Minor | 💤 Low value

Label the example fence to keep the docs lint-clean.

The bare fenced block here still triggers MD040. Mark the opening fence as text (or another explicit language) so this example stays lint-clean.

Suggested fix
-```
+```text
 .context/specs/spec-<unix-timestamp>-<descriptive-kebab>.md
-```
+```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/commands/spec-dc.md around lines 164 - 181, The example fenced block
in the spec review instructions is unlabeled, which triggers the docs lint rule.
Update the fence in the spec-dc guidance so the example uses an explicit
language label via the fenced block around the sample path placeholder, keeping
the content otherwise unchanged and preserving the intended markdown example.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.claude/commands/spec-dc.md:
- Around line 164-181: The example fenced block in the spec review instructions
is unlabeled, which triggers the docs lint rule. Update the fence in the spec-dc
guidance so the example uses an explicit language label via the fenced block
around the sample path placeholder, keeping the content otherwise unchanged and
preserving the intended markdown example.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b493495d-4fd1-45d5-bfd7-559a5ce99485

📥 Commits

Reviewing files that changed from the base of the PR and between b9073b1 and 6ef92c0.

📒 Files selected for processing (14)
  • .claude/agents/spec-dc/reviewer-fast.md
  • .claude/agents/spec-dc/reviewer-pro.md
  • .claude/commands/spec-dc.md
  • .context/CONTEXT.md
  • .context/decisions/020-spec-plan-execute-workflow.md
  • CHANGELOG.md
  • README.md
  • dotcontext
  • src/commands/init.sh
  • src/commands/update.sh
  • templates/.claude/agents/spec-dc/reviewer-fast.md
  • templates/.claude/agents/spec-dc/reviewer-pro.md
  • templates/.claude/commands/spec-dc.md
  • templates/AGENTS.md
✅ Files skipped from review due to trivial changes (3)
  • .context/decisions/020-spec-plan-execute-workflow.md
  • CHANGELOG.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • .context/CONTEXT.md
  • src/commands/update.sh
  • templates/.claude/commands/spec-dc.md
  • templates/AGENTS.md
  • src/commands/init.sh
  • dotcontext

@nicholastn1

Copy link
Copy Markdown
Contributor Author

Code review

Found 1 issue:

  1. update.sh declarative-cleanup block is missing the three new reviewer directories (bug: init.sh and update.sh keep cleanup_managed_dir in sync for every managed agent dir — code-review/deep-context/fix-bug — but spec-dc/plan-dc/execute-dc were added only to init.sh's cleanup and update.sh's managed list, not update.sh's cleanup. So a stale reviewer file removed from templates would be pruned by a re-run init but kept forever by dotcontext update --templates.)

# Declarative cleanup: remove stale files from managed-only directories
# NOTE: .claude/commands/ is excluded — users create custom commands there via /add-command
cleanup_managed_dir ".claude/agents/code-review" \
compliance-checker.md bug-detector.md security-analyst.md
cleanup_managed_dir ".claude/agents/deep-context" \
step1-overview.md step2-subsystems.md step3-drill.md step4-dataflow.md
cleanup_managed_dir ".claude/agents/fix-bug" \
investigator.md fix-conservative.md fix-minimal.md fix-refactor.md reviewer.md
cleanup_managed_dir ".claude/scripts" \
statusline.sh

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

- update.sh: add cleanup_managed_dir for spec-dc/plan-dc/execute-dc reviewer
  dirs. init.sh and update.sh must stay in sync for every managed agent dir
  (code-review/deep-context/fix-bug already are); the three new dirs were only
  in init's cleanup + update's managed list, so `update --templates` would keep
  stale reviewer files. Flagged by my code-review + CodeRabbit (dotcontext:1137).
- execute-dc (template + root): offer the worktree BEFORE the clean-tree bailout
  and scope the clean-tree check to the in-place path — a dirty tree could never
  reach the worktree option that exists precisely to sidestep it (CodeRabbit Major).
- plan-dc (template + root): ADR-update guidance now leads with "new ADR +
  supersede" per CLAUDE.md; in-place version bump reserved for minor amendments
  (CodeRabbit).
- ADR-019: mark section 2 as proposed/deferred, not implemented (CodeRabbit).
- markdownlint MD040: tag bare code fences (text) in commands, README, CONTEXT,
  and the specs/plans READMEs.
- Rebuilt the bundled dotcontext binary; mirrored command files to root.
@nicholastn1

Copy link
Copy Markdown
Contributor Author

CodeRabbit review — addressed

Fixed (commit bd3f526):

  • execute-dc (Major): worktree is now offered before the clean-tree bailout, and the clean-tree check is scoped to the in-place path — a dirty tree can no longer block the worktree option that exists to sidestep it.
  • update.sh / dotcontext:1137: added cleanup_managed_dir for the spec-dc/plan-dc/execute-dc reviewer dirs, restoring the initupdate cleanup sync. (Also independently flagged by the PR's own code review.)
  • ADR-019: section 2 marked as proposed/deferred, not implemented.
  • plan-dc: ADR-update guidance now leads with "new ADR + supersede" per CLAUDE.md; in-place version bump reserved for minor amendments.
  • MD040: tagged the bare code fences (text) across the commands, README, CONTEXT.md, and the specs/plans READMEs.

Resolved without change (not applicable):

  • agents.sh:272 (preserve legacy commands): the retirement is intentional and non-destructive — emit_agent_commands is init-only and create-only, so existing installs keep their files; nothing is deleted.
  • ADR-020 agent paths: {reviewer-pro,reviewer-fast} is brace-expansion shorthand for files that exist; the section was also rewritten in a later commit.

🤖 Generated with Claude Code

`dotcontext update` was non-destructive but didn't fully deliver the renamed
workflow to existing projects: Claude got the trio via managed templates, but
opencode/Copilot (whose commands are emitted only by the init-only
emit_agent_commands) and AGENTS.md-only harnesses got nothing.

- update now re-runs emit_agent_commands (create-only) for the per-harness dirs
  it detects (.opencode/command, .github/prompts), so opencode/Copilot pick up
  spec-dc/plan-dc/execute-dc. Guarded by --dry-run.
- Prints a migration notice when a legacy generate-prp/execute-prp is detected:
  the flow moved to spec -> plan -> execute, old commands are kept and still
  work, and Gemini/Cursor/Codex should refresh the ## Workflows table in
  AGENTS.md (create-only, not auto-rewritten).
- Docs: ADR-020 section 6 + CHANGELOG note the delivery path and the AGENTS.md
  limitation. Rebuilt the bundled binary.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/commands/update.sh`:
- Around line 451-463: The re-emit path in update.sh is swallowing failures from
emit_agent_commands, so command delivery issues for existing opencode and
Copilot installs are hidden. Update the re-run block that builds _reemit and
calls emit_agent_commands so failures are surfaced instead of forcing success;
keep the space-separated harness list handling, but replace the silent
suppression with a warning or explicit failure reporting around
emit_agent_commands.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5d87d85-c939-4e4a-af34-3f613ce8ae3c

📥 Commits

Reviewing files that changed from the base of the PR and between 6ef92c0 and 6cf435e.

📒 Files selected for processing (17)
  • .claude/commands/execute-dc.md
  • .claude/commands/plan-dc.md
  • .claude/commands/spec-dc.md
  • .context/CONTEXT.md
  • .context/decisions/019-knowledge-reconciliation-after-prp.md
  • .context/decisions/020-spec-plan-execute-workflow.md
  • .context/plans/README.md
  • .context/specs/README.md
  • CHANGELOG.md
  • README.md
  • dotcontext
  • src/commands/update.sh
  • templates/.claude/commands/execute-dc.md
  • templates/.claude/commands/plan-dc.md
  • templates/.claude/commands/spec-dc.md
  • templates/.context/plans/README.md
  • templates/.context/specs/README.md
✅ Files skipped from review due to trivial changes (9)
  • .context/plans/README.md
  • templates/.context/specs/README.md
  • .context/specs/README.md
  • templates/.context/plans/README.md
  • CHANGELOG.md
  • templates/.claude/commands/execute-dc.md
  • .context/decisions/019-knowledge-reconciliation-after-prp.md
  • .context/CONTEXT.md
  • README.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • templates/.claude/commands/spec-dc.md
  • .claude/commands/execute-dc.md
  • .claude/commands/plan-dc.md
  • templates/.claude/commands/plan-dc.md
  • .claude/commands/spec-dc.md
  • dotcontext

Comment thread src/commands/update.sh
Comment on lines +451 to +463
# ── Deliver renamed workflows to existing per-harness installs (ADR-020) ──
# Claude picks up spec/plan/execute-dc via managed_templates above. opencode and
# Copilot keep their commands in .opencode/command / .github/prompts, emitted only
# by emit_agent_commands (create-only). Re-run it here — inferring the harnesses in
# use from the dirs that exist — so those installs also get the new commands.
if [ "$dry_run" != "true" ]; then
local _reemit=""
[ -d ".opencode/command" ] && _reemit="$_reemit opencode"
[ -d ".github/prompts" ] && _reemit="$_reemit copilot"
_reemit="${_reemit# }"
[ -n "$_reemit" ] && emit_agent_commands "$_reemit" 2>/dev/null || true
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Locate emit_agent_commands definition to confirm its expected argument format.
rg -n 'emit_agent_commands' --type=sh -A 15 src

Repository: goca-se/dotcontext

Length of output: 4223


🏁 Script executed:

#!/bin/bash
# Inspect emit_agent_commands and the download helper for error handling and argument parsing.
sed -n '240,340p' src/setup/agents.sh
printf '\n----\n'
rg -n '^download\(\)|^download ' src/setup/agents.sh -A 25 -B 5

Repository: goca-se/dotcontext

Length of output: 2308


🏁 Script executed:

#!/bin/bash
# Inspect the download helper and surrounding error handling in src/setup/agents.sh.
sed -n '1,240p' src/setup/agents.sh

Repository: goca-se/dotcontext

Length of output: 7716


🏁 Script executed:

#!/bin/bash
# Locate the download helper definition and inspect how it reports failures.
rg -n '^download\(\)|^download ' src -A 40 -B 5

Repository: goca-se/dotcontext

Length of output: 2222


Surface re-emit failures instead of hiding them
emit_agent_commands "$_reemit" 2>/dev/null || true suppresses diagnostics and forces success, so existing opencode/Copilot installs can miss failed command delivery without any warning. emit_agent_commands already accepts a space-separated list, so the argument shape is fine; the missing piece is surfacing failures with at least a warning.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/commands/update.sh` around lines 451 - 463, The re-emit path in update.sh
is swallowing failures from emit_agent_commands, so command delivery issues for
existing opencode and Copilot installs are hidden. Update the re-run block that
builds _reemit and calls emit_agent_commands so failures are surfaced instead of
forcing success; keep the space-separated harness list handling, but replace the
silent suppression with a warning or explicit failure reporting around
emit_agent_commands.

@nicholastn1
nicholastn1 merged commit fe80893 into main Jul 7, 2026
2 checks passed
@nicholastn1
nicholastn1 deleted the feat/spec-plan-execute-workflow branch July 7, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants