Skip to content

feat(harness): name the PTC loop and add /critique command#9

Merged
datashaman merged 2 commits into
mainfrom
feat/harness-ptc-loop
May 2, 2026
Merged

feat(harness): name the PTC loop and add /critique command#9
datashaman merged 2 commits into
mainfrom
feat/harness-ptc-loop

Conversation

@datashaman
Copy link
Copy Markdown
Owner

@datashaman datashaman commented May 2, 2026

Summary

Closes #6. Names the implicit Plan → Tool → Critique loop in the harness, adds /critique for mid-flow critique passes, and records a recommendation against shipping a PostToolUse critique hook.

What changed

  • assets/CLAUDE.md.tmpl — new ## The PTC loop section above ## Tools I expect you to use. Three bullets (Plan / Tool / Critique → the surfaces that implement each) and a one-line Reflexion citation (Shinn et al. 2023). Added /critique to the tools list.
  • assets/commands/critique.md — new slash command. Re-reads git diff HEAD (catches staged + unstaged), self-critiques, calls advisor(), reports a punch list under 200 words. Treats $ARGUMENTS as a scope hint. Explicitly does not start new implementation work in the same turn.
  • SKILL.md — registers /critique in the file table and command paths. New ## PostToolUse critique hook — recommendation section: don't ship it. Boundary critiques (verify-before-stop.sh, advisor(), on-demand /critique) cover the same gap with much better signal-to-noise; an always-on PostToolUse critique would burn tokens on edits that don't need it and train the agent to ignore the noise. Revisit if mid-flow drift escapes all three boundary surfaces — but tune when /critique gets suggested, not make it automatic.
  • README.md/critique listed alongside /verify, /plan in the user-scope, project-scope, and file tables.
  • scripts/{install,uninstall}.sh — preflight banner strings updated from {verify,plan}.md to {verify,plan,critique}.md. The install/uninstall plumbing already iterates assets/commands/*.md as a glob, so no logic changes were needed.

Why

Critique only fired at boundaries (Stop, advisor calls). Reflexion / self-refine patterns critique between tool steps — we had no equivalent. Naming the loop also gives users vocabulary: "run a PTC pass on this file" now means something specific.

Validation

  • ./scripts/harness-check.sh passes (shellcheck, ruff, mypy, pytest).
  • bash skills/harness/scripts/install.sh --target=/tmp/h-ptc-test/.claude --dry-run shows commands/{verify,plan,critique}.md in the preflight and lists critique.md under "installing slash commands".
  • Real install → ls /tmp/h-ptc-test/.claude/commands/ returns critique.md plan.md verify.md.
  • bash skills/harness/scripts/uninstall.sh --target=/tmp/h-ptc-test/.claude --dry-run lists critique.md among files it would remove (round-trip clean).
  • advisor() pass before commit caught two polish items that landed in the diff: git diff HEAD (vs plain git diff which misses staged changes) and PTC section placement above the tools list (frame before implementation).

@datashaman datashaman added the enhancement New feature or request label May 2, 2026
@datashaman datashaman self-assigned this May 2, 2026
@datashaman datashaman requested a review from Copilot May 2, 2026 06:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the harness’s implicit Plan → Tool → Critique workflow explicit, adds a new /critique slash command for mid-flow review passes, and updates the surrounding harness documentation/install messaging to reflect that workflow.

Changes:

  • Add a new assets/commands/critique.md slash command that re-reads recent changes, performs self-critique, calls advisor(), and reports a short punch list.
  • Document the named “PTC loop” in the CLAUDE template and add /critique to the expected tools/docs.
  • Update harness docs and install/uninstall preflight banners so the new slash command appears in user/project scope inventories.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
skills/harness/scripts/uninstall.sh Updates uninstall preflight output to mention the new /critique command.
skills/harness/scripts/install.sh Updates install preflight output to mention the new /critique command.
skills/harness/assets/commands/critique.md Adds the new mid-flow critique slash command instructions.
skills/harness/assets/CLAUDE.md.tmpl Documents the PTC loop and adds /critique to the expected tool list.
skills/harness/SKILL.md Registers /critique in skill docs and records the recommendation against an always-on critique hook.
skills/harness/README.md Updates user-facing documentation/tables to include /critique.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/harness/scripts/uninstall.sh Outdated
Comment thread skills/harness/assets/commands/critique.md Outdated
Comment thread skills/harness/assets/commands/critique.md Outdated
Comment thread skills/harness/assets/commands/critique.md Outdated
Comment thread skills/harness/scripts/install.sh Outdated
- /critique now handles untracked files (Read after git status --porcelain),
  fresh repos / non-git dirs, and clean trees with the change in HEAD
  (git show HEAD).
- install.sh / uninstall.sh banners use commands/*.md instead of a
  hand-maintained brace list, matching the hooks convention so the dry-run
  output can't drift from the actual install glob.
@datashaman datashaman marked this pull request as ready for review May 2, 2026 06:30
@datashaman datashaman merged commit 7fbb8d6 into main May 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

harness: name the PTC loop + add /critique slash command

2 participants