Skip to content

Commit 1b82999

Browse files
garrytanclaude
andauthored
fix: /autoplan — prevent analysis compression (v0.10.2.0) (garrytan#329)
* fix: prevent /autoplan from compressing review sections to one-liners Adds explicit auto-decide contract, per-phase execution checklists, pre-gate verification, and test review emphasis. * chore: bump version and changelog (v0.10.2.0) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent df55641 commit 1b82999

5 files changed

Lines changed: 427 additions & 4 deletions

File tree

.agents/skills/gstack-autoplan/SKILL.md

Lines changed: 144 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ _PROACTIVE=$(~/.codex/skills/gstack/bin/gstack-config get proactive 2>/dev/null
2727
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
2828
echo "BRANCH: $_BRANCH"
2929
echo "PROACTIVE: $_PROACTIVE"
30+
source <(~/.codex/skills/gstack/bin/gstack-repo-mode 2>/dev/null) || true
31+
REPO_MODE=${REPO_MODE:-unknown}
32+
echo "REPO_MODE: $REPO_MODE"
3033
_LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no")
3134
echo "LAKE_INTRO: $_LAKE_SEEN"
3235
_TEL=$(~/.codex/skills/gstack/bin/gstack-config get telemetry 2>/dev/null || true)
@@ -127,6 +130,18 @@ AI-assisted coding makes the marginal cost of completeness near-zero. When you p
127130
- BAD: "Let's defer test coverage to a follow-up PR." (Tests are the cheapest lake to boil.)
128131
- BAD: Quoting only human-team effort: "This would take 2 weeks." (Say: "2 weeks human / ~1 hour CC.")
129132

133+
## Repo Ownership Mode — See Something, Say Something
134+
135+
`REPO_MODE` from the preamble tells you who owns issues in this repo:
136+
137+
- **`solo`** — One person does 80%+ of the work. They own everything. When you notice issues outside the current branch's changes (test failures, deprecation warnings, security advisories, linting errors, dead code, env problems), **investigate and offer to fix proactively**. The solo dev is the only person who will fix it. Default to action.
138+
- **`collaborative`** — Multiple active contributors. When you notice issues outside the branch's changes, **flag them via AskUserQuestion** — it may be someone else's responsibility. Default to asking, not fixing.
139+
- **`unknown`** — Treat as collaborative (safer default — ask before fixing).
140+
141+
**See Something, Say Something:** Whenever you notice something that looks wrong during ANY workflow step — not just test failures — flag it briefly. One sentence: what you noticed and its impact. In solo mode, follow up with "Want me to fix it?" In collaborative mode, just flag it and move on.
142+
143+
Never let a noticed issue silently pass. The whole point is proactive communication.
144+
130145
## Search Before Building
131146

132147
Before building infrastructure, unfamiliar patterns, or anything the runtime might have a built-in — **search first.** Read `~/.codex/skills/gstack/ETHOS.md` for the full philosophy.
@@ -319,6 +334,34 @@ Examples: run codex (always yes), run evals (always yes), reduce scope on a comp
319334

320335
---
321336

337+
## What "Auto-Decide" Means
338+
339+
Auto-decide replaces the USER'S judgment with the 6 principles. It does NOT replace
340+
the ANALYSIS. Every section in the loaded skill files must still be executed at the
341+
same depth as the interactive version. The only thing that changes is who answers the
342+
AskUserQuestion: you do, using the 6 principles, instead of the user.
343+
344+
**You MUST still:**
345+
- READ the actual code, diffs, and files each section references
346+
- PRODUCE every output the section requires (diagrams, tables, registries, artifacts)
347+
- IDENTIFY every issue the section is designed to catch
348+
- DECIDE each issue using the 6 principles (instead of asking the user)
349+
- LOG each decision in the audit trail
350+
- WRITE all required artifacts to disk
351+
352+
**You MUST NOT:**
353+
- Compress a review section into a one-liner table row
354+
- Write "no issues found" without showing what you examined
355+
- Skip a section because "it doesn't apply" without stating what you checked and why
356+
- Produce a summary instead of the required output (e.g., "architecture looks good"
357+
instead of the ASCII dependency graph the section requires)
358+
359+
"No issues found" is a valid output for a section — but only after doing the analysis.
360+
State what you examined and why nothing was flagged (1-2 sentences minimum).
361+
"Skipped" is never valid for a non-skip-listed section.
362+
363+
---
364+
322365
## Phase 0: Intake + Restore Point
323366

324367
### Step 1: Capture restore point
@@ -400,6 +443,31 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
400443
Duplicates → reject (P4). Borderline (3-5 files) → mark TASTE DECISION.
401444
- All 10 review sections: run fully, auto-decide each issue, log every decision.
402445

446+
**Required execution checklist (CEO):**
447+
448+
Step 0 (0A-0F) — run each sub-step and produce:
449+
- 0A: Premise challenge with specific premises named and evaluated
450+
- 0B: Existing code leverage map (sub-problems → existing code)
451+
- 0C: Dream state diagram (CURRENT → THIS PLAN → 12-MONTH IDEAL)
452+
- 0C-bis: Implementation alternatives table (2-3 approaches with effort/risk/pros/cons)
453+
- 0D: Mode-specific analysis with scope decisions logged
454+
- 0E: Temporal interrogation (HOUR 1 → HOUR 6+)
455+
- 0F: Mode selection confirmation
456+
457+
Sections 1-10 — for EACH section, run the evaluation criteria from the loaded skill file:
458+
- Sections WITH findings: full analysis, auto-decide each issue, log to audit trail
459+
- Sections with NO findings: 1-2 sentences stating what was examined and why nothing
460+
was flagged. NEVER compress a section to just its name in a table row.
461+
- Section 11 (Design): run only if UI scope was detected in Phase 0
462+
463+
**Mandatory outputs from Phase 1:**
464+
- "NOT in scope" section with deferred items and rationale
465+
- "What already exists" section mapping sub-problems to existing code
466+
- Error & Rescue Registry table (from Section 2)
467+
- Failure Modes Registry table (from review sections)
468+
- Dream state delta (where this plan leaves us vs 12-month ideal)
469+
- Completion Summary (the full summary table from the CEO skill)
470+
403471
---
404472

405473
## Phase 2: Design Review (conditional — skip if no UI scope)
@@ -430,6 +498,42 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
430498
- Test plan: generate artifact at `~/.gstack/projects/$SLUG/{user}-{branch}-test-plan-{datetime}.md`
431499
- TODOS.md: collect all deferred scope expansions from Phase 1, auto-write
432500

501+
**Required execution checklist (Eng):**
502+
503+
1. Step 0 (Scope Challenge): Read actual code referenced by the plan. Map each
504+
sub-problem to existing code. Run the complexity check. Produce concrete findings.
505+
506+
2. Step 0.5 (Codex): Run if available. Present full output under CODEX SAYS header.
507+
508+
3. Section 1 (Architecture): Produce ASCII dependency graph showing new components
509+
and their relationships to existing ones. Evaluate coupling, scaling, security.
510+
511+
4. Section 2 (Code Quality): Identify DRY violations, naming issues, complexity.
512+
Reference specific files and patterns. Auto-decide each finding.
513+
514+
5. **Section 3 (Test Review) — NEVER SKIP OR COMPRESS.**
515+
This section requires reading actual code, not summarizing from memory.
516+
- Read the diff or the plan's affected files
517+
- Build the test diagram: list every NEW UX flow, data flow, codepath, and branch
518+
- For EACH item in the diagram: what type of test covers it? Does one exist? Gaps?
519+
- For LLM/prompt changes: which eval suites must run?
520+
- Auto-deciding test gaps means: identify the gap → decide whether to add a test
521+
or defer (with rationale and principle) → log the decision. It does NOT mean
522+
skipping the analysis.
523+
- Write the test plan artifact to disk
524+
525+
6. Section 4 (Performance): Evaluate N+1 queries, memory, caching, slow paths.
526+
527+
**Mandatory outputs from Phase 3:**
528+
- "NOT in scope" section
529+
- "What already exists" section
530+
- Architecture ASCII diagram (Section 1)
531+
- Test diagram mapping codepaths to coverage (Section 3)
532+
- Test plan artifact written to disk (Section 3)
533+
- Failure modes registry with critical gap flags
534+
- Completion Summary (the full summary from the Eng skill)
535+
- TODOS.md updates (collected from all phases)
536+
433537
---
434538

435539
## Decision Audit Trail
@@ -449,6 +553,44 @@ not accumulated in conversation context.
449553

450554
---
451555

556+
## Pre-Gate Verification
557+
558+
Before presenting the Final Approval Gate, verify that required outputs were actually
559+
produced. Check the plan file and conversation for each item.
560+
561+
**Phase 1 (CEO) outputs:**
562+
- [ ] Premise challenge with specific premises named (not just "premises accepted")
563+
- [ ] All applicable review sections have findings OR explicit "examined X, nothing flagged"
564+
- [ ] Error & Rescue Registry table produced (or noted N/A with reason)
565+
- [ ] Failure Modes Registry table produced (or noted N/A with reason)
566+
- [ ] "NOT in scope" section written
567+
- [ ] "What already exists" section written
568+
- [ ] Dream state delta written
569+
- [ ] Completion Summary produced
570+
571+
**Phase 2 (Design) outputs — only if UI scope detected:**
572+
- [ ] All 7 dimensions evaluated with scores
573+
- [ ] Issues identified and auto-decided
574+
575+
**Phase 3 (Eng) outputs:**
576+
- [ ] Scope challenge with actual code analysis (not just "scope is fine")
577+
- [ ] Architecture ASCII diagram produced
578+
- [ ] Test diagram mapping codepaths to test coverage
579+
- [ ] Test plan artifact written to disk at ~/.gstack/projects/$SLUG/
580+
- [ ] "NOT in scope" section written
581+
- [ ] "What already exists" section written
582+
- [ ] Failure modes registry with critical gap assessment
583+
- [ ] Completion Summary produced
584+
585+
**Audit trail:**
586+
- [ ] Decision Audit Trail has at least one row per auto-decision (not empty)
587+
588+
If ANY checkbox above is missing, go back and produce the missing output. Max 2
589+
attempts — if still missing after retrying twice, proceed to the gate with a warning
590+
noting which items are incomplete. Do not loop indefinitely.
591+
592+
---
593+
452594
## Phase 4: Final Approval Gate
453595

454596
**STOP here and present the final state to the user.**
@@ -531,5 +673,6 @@ Suggest next step: `/ship` when ready to create the PR.
531673
- **Never abort.** The user chose /autoplan. Respect that choice. Surface all taste decisions, never redirect to interactive review.
532674
- **Premises are the one gate.** The only non-auto-decided AskUserQuestion is the premise confirmation in Phase 1.
533675
- **Log every decision.** No silent auto-decisions. Every choice gets a row in the audit trail.
534-
- **Full depth.** Do not compress or skip sections from the loaded skill files (except the skip list in Phase 0).
676+
- **Full depth means full depth.** Do not compress or skip sections from the loaded skill files (except the skip list in Phase 0). "Full depth" means: read the code the section asks you to read, produce the outputs the section requires, identify every issue, and decide each one. A one-sentence summary of a section is not "full depth" — it is a skip. If you catch yourself writing fewer than 3 sentences for any review section, you are likely compressing.
677+
- **Artifacts are deliverables.** Test plan artifact, failure modes registry, error/rescue table, ASCII diagrams — these must exist on disk or in the plan file when the review completes. If they don't exist, the review is incomplete.
535678
- **Sequential order.** CEO → Design → Eng. Each phase builds on the last.

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [0.10.2.0] - 2026-03-22 — Autoplan Depth Fix
4+
5+
### Fixed
6+
7+
- **`/autoplan` now produces full-depth reviews instead of compressing everything to one-liners.** When autoplan said "auto-decide," it meant "decide FOR the user using principles" — but the agent interpreted it as "skip the analysis entirely." Now autoplan explicitly defines the contract: auto-decide replaces your judgment, not the analysis. Every review section still gets read, diagrammed, and evaluated. You get the same depth as running each review manually.
8+
- **Execution checklists for CEO and Eng phases.** Each phase now enumerates exactly what must be produced — premise challenges, architecture diagrams, test coverage maps, failure registries, artifacts on disk. No more "follow that file at full depth" without saying what "full depth" means.
9+
- **Pre-gate verification catches skipped outputs.** Before presenting the final approval gate, autoplan now checks a concrete checklist of required outputs. Missing items get produced before the gate opens (max 2 retries, then warns).
10+
- **Test review can never be skipped.** The Eng review's test diagram section — the highest-value output — is explicitly marked NEVER SKIP OR COMPRESS with instructions to read actual diffs, map every codepath to coverage, and write the test plan artifact.
11+
312
## [0.10.1.0] - 2026-03-22 — Test Coverage Catalog
413

514
### Added

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.1.0
1+
0.10.2.0

0 commit comments

Comments
 (0)