Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(document-review): add headless mode for programmatic callers#425

Merged
tmchow merged 5 commits into
mainfrom
feat/document-review-headless-mode
Mar 28, 2026
Merged

feat(document-review): add headless mode for programmatic callers#425
tmchow merged 5 commits into
mainfrom
feat/document-review-headless-mode

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Mar 28, 2026

Summary

  • Adds mode:headless support to document-review for programmatic callers (other skills, pipelines)
  • In headless mode: auto fixes applied silently, batch_confirm + present findings returned as structured text with classifications intact — no interactive prompts
  • Headless mode changes the interaction model, not the classification boundaries
  • Interactive mode completely unchanged when mode:headless is not present

Motivation

Other plugins (e.g., open-source-contributor) want to use document-review as a utility in their plan-creation pipelines. The current interactive flow (AskUserQuestion for batch confirms, present-tier findings) doesn't fit pipelines where the calling skill should handle remaining findings with domain-specific knowledge.

Headless mode enables a multi-tier auto-fix cascade:

  1. document-review auto-fixes auto items (deterministic, same as interactive)
  2. document-review returns batch_confirm + present findings as structured text with classifications
  3. Calling skill resolves findings using its domain knowledge (e.g., maintainer preferences, repo conventions)
  4. User handles only truly ambiguous items

Changes

Single file: plugins/compound-engineering/skills/document-review/SKILL.md

  • Phase 0: Detect mode:headless in skill arguments. mode:* tokens are flags, not file paths — stripped from arguments before the remainder is used as the document path.
  • Phase 1: Headless mode requires a document path. Returns "Review failed: ..." with re-invocation guidance if missing — distinct from "Review complete" so callers can tell a bad invocation from a successful review.
  • Phase 4 Batch Confirm: Headless path returns findings to caller with classification intact (not auto-applied). Interactive path unchanged.
  • Phase 4 Present: Headless path outputs structured text summary with [batch_confirm] and [present] tags. Interactive path unchanged.
  • Phase 5: Headless path returns immediately with "Review complete". Interactive path unchanged.
  • What NOT to Do: Broadened caller list to include external plugin skills.

Test plan

  • Run /document-review interactively on a plan doc — verify no behavior change
  • Run /document-review docs/plans/some-plan.md mode:headless — verify only auto items applied, batch_confirm + present returned as text, no AskUserQuestion calls
  • Run /document-review mode:headless (no path) — verify "Review failed:" returned, no agents dispatched, distinct from "Review complete"
  • Verify headless output includes classification tags ([batch_confirm] vs [present])

🤖 Generated with Claude Code

tmchow and others added 2 commits March 28, 2026 11:21
Enable other skills and pipelines to invoke document-review without
interactive prompts. In headless mode (mode:headless), auto and
batch_confirm fixes are applied automatically, present-tier findings
are returned as structured text, and Phase 5 returns immediately.

Interactive mode is unchanged when mode:headless is not present.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…mode

batch_confirm findings are no longer auto-applied in headless mode.
Headless mode changes the interaction model (no prompts, return text),
not the classification boundaries. batch_confirm and present findings
are both returned with their original classifications intact so the
caller can make its own tier-2 decisions.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8daca4797

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/document-review/SKILL.md
Comment thread plugins/compound-engineering/skills/document-review/SKILL.md Outdated
tmchow and others added 2 commits March 28, 2026 11:30
- Phase 0: explicitly strip mode:* tokens from arguments before using
  the remainder as document path (fixes parsing ambiguity)
- Phase 1: auto-resolve document in headless mode instead of prompting
  (prevents pipeline stalls when no path provided)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Headless callers always know what document they want reviewed.
Return an actionable error message instead of auto-resolving.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 307a08ba85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/document-review/SKILL.md Outdated
Return "Review failed:" instead of "Review complete" so callers can
distinguish a bad invocation from a successful no-findings review.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@tmchow tmchow merged commit 4e4a656 into main Mar 28, 2026
2 checks passed
This was referenced Mar 28, 2026
tmchow added a commit that referenced this pull request Mar 28, 2026
Add mode:headless as a fourth explicit mode for skill-to-skill invocation.
Headless applies safe_auto fixes in a single pass, returns structured text
output with the full findings envelope, writes run artifacts, and emits
"Review complete" as a terminal signal. No interactive prompts, no todos,
no checkout switching.

Follows the pattern established by document-review's headless mode (#425),
adapted for ce:review's richer findings schema (autofix_class, owner,
requires_verification, evidence[], pre_existing).

🤖 Generated with Claude Opus 4.6 via [Claude Code](https://claude.com/claude-code) + Compound Engineering v2.58.1

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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.

1 participant