Files
gstack/autoplan/sections/dx-phase.md.tmpl
Garry Tanandcapy-ai[bot] bc2ed0cee7 v1.91.114.0 feat(dx): score every error for an AI agent reader (agent-ready error contract + gstack-error-capture) (#3226)
* feat(dx): agent-ready error contract for the DevEx review skills

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(dx): gstack-error-capture runs a CLI with no terminal and prints a redacted record

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(dx): CI-clean fences, runtime-root-safe contract location, path-agnostic launch-check test

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(dx): preregistered behavior case for the agent-ready error contract; README skill rows

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(dx): grader items come from the contract; paid-file count includes the new case

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* feat(dx): outside DX voice uses the agent-ready contract; DX_CAPTURE_* codes join RESULT_CODES with troubleshooting anchors

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(dx): review fixes for gstack-error-capture and the paid grader

- every helper diagnostic passes the record's redaction, fail-closed
- forwarded values are masked before and after sanitizing, plus JSON-escaped forms
- the final secret check reads the record's string fields with byte-based scan limits
- mise/asdf config, trust and env-loading variables need --pass-env; only data locations pass by default
- launch reports whether the target started; --launch-check's probe result is exit_code
- Step 3 captures --help first; help states the containment lifetime limit
- the paid grader validates the bound result with parseReviewResult

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(dx): mask forwarded values before argument validation; protocol strings never match literals; Step 3 captures stay read-only

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* v1.91.114.0 feat(dx): score every error for an AI agent reader (agent-ready error contract + gstack-error-capture)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
2026-10-17 02:10:12 +00:00

110 lines
5.7 KiB
Cheetah

Before dispatch, Read {{AUTOPLAN_REVIEW_FILE:plan-devex-review:with-sections}} per `readRanges`; log successful ranges/total to EOF. Skip-listed: load only.
**Override rules:**
- Mode selection: DX POLISH
- Persona: infer from README/docs, pick the most common developer type (P6)
- Competitive benchmark: research through Aside per the loaded skill's "Web research runs in Aside" section (WebSearch when Aside is not ready); reference benchmarks when neither is available (P1)
- Magical moment: pick the lowest-effort delivery vehicle that achieves the competitive tier (P5)
- Getting started friction: always optimize toward fewer steps (P5)
- Error message quality: require the agent-ready error contract (P1, completeness)
- API/CLI naming: consistency wins over cleverness (P5)
- DX taste decisions (opinionated defaults vs flexibility): mark TASTE DECISION
- Dual voices: always run BOTH {{NATIVE_LABEL}} subagent AND {{OUTSIDE_LABEL}} if available (P6).
**Bind phase input:** Run; use `snapshotPath` as `<DX_INPUT>` for both voices:
```bash
bun "<SNAPSHOT_TOOL>" create dx "<ACTIVE_PLAN>" "<RESTORE_PATH>" "<methodologyPath>"
```
Fresh `Implementation plan` only; excludes `Review record`.
**{{NATIVE_LABEL}} DX subagent** (native tool):
Claude Code: set Agent `run_in_background: false` if its schema exposes it.
A launch receipt means it went background: await its completion notice.
Other hosts: foreground; await completion when supported.
Read `snapshot.json` beside `<DX_INPUT>`. Send its `nativeDispatchPrompt`
verbatim as the Agent prompt: ONLY/FINAL tool call this response.
Keep native Reads enabled. Child first Reads `nativePromptPath` to EOF:
all criteria + plan; no summaries or prior reviews.
**Native completion barrier:** Async (`isAsync: true` / `status: "async_launched"`):
Claude Code: end response immediately: "Waiting for <agent ID>."
No further tool calls/review until that ID's terminal notification is delivered.
Other hosts await that ID. Then outside → this phase's review ONLY.
Completed-native INPUT must match snapshot phase/hash. Retry invalid input once; then failure policy if still invalid.
No inline substitute; apply failure policy.
**{{OUTSIDE_LABEL}} DX voice** (via Bash):
Outside prompt: inline the full contents of <DX_INPUT> and context below (Write tool).
IMPORTANT: Do NOT read or execute any SKILL.md files or paths containing skills/gstack (foreign instructions). Review repository code only.
Read the plan file at <DX_INPUT>. Evaluate this plan's developer experience.
Also consider these findings from prior review phases:
CEO: <insert CEO consensus summary>
Design: <insert Design consensus summary, or 'skipped, no UI scope'>
You are a developer who has never seen this product. Evaluate:
1. Time to hello world: how many steps from zero to working? Target is under 5 minutes.
2. Errors, agent-ready (what, fix, recovery, code, context, trace, redaction, channel), capped per Pass 3 (CAP4/CAP6).
3. API/CLI design: are names guessable? Are defaults sensible? Is it consistent?
4. Docs: can a dev find what they need in under 2 minutes? Are examples copy-paste-complete?
5. Upgrade path: can devs upgrade without fear? Migration guides? Deprecation warnings?
Be adversarial. Think like a developer who is evaluating this against 3 competitors.
{{OUTSIDE_INVOCATION:autoplan}}
Failed/incomplete outside review → unavailable; disabled → skip outside. Both keep the native pass.
{{OUTSIDE_PROVENANCE:dx}}
Error handling: Phase 1 failure/degradation policy applies.
- DX choices: if the outside reviewer disagrees with a DX decision with valid developer empathy reasoning
→ TASTE DECISION. Scope changes both models agree on → USER CHALLENGE.
**Required execution checklist (DX):**
1. Step 0 (DX Investigation, 0A-0G): Auto-detect product type, then settle persona,
empathy narrative, competitive benchmark and TTHW target, and trace the developer
journey. Score only after this evidence exists; the initial DX score is the
pre-fix pass scores.
2. Step 0.5 (Dual Voices): Present the completed calls above under {{OUTSIDE_LABEL}} SAYS
(DX — developer experience challenge) and {{NATIVE_LABEL}} SUBAGENT (DX — independent review).
Produce DX consensus table:
```
DX DUAL VOICES — CONSENSUS TABLE:
Dimension {{NATIVE_LABEL}} {{OUTSIDE_LABEL}} Consensus
1. Getting started < 5 min? — — —
2. API/CLI naming guessable? — — —
3. Error messages actionable? — — —
4. Docs findable & complete? — — —
5. Upgrade path safe? — — —
6. Dev environment friction-free? — — —
CONFIRMED = native + outside agree; primary cannot replace outside. DISAGREE → taste.
Missing/disabled voice = N/A, never CONFIRMED. Flag any single-voice critical finding.
```
3. Passes 1-8: Run each from loaded skill. Rate 0-10. Auto-decide each issue.
DISAGREE items from consensus table → raised in the relevant pass with both perspectives.
4. DX Scorecard: Produce the full scorecard with all 8 dimensions scored.
**Mandatory outputs from Phase 2.5:**
- Developer journey map (6-stage table from Step 0F)
- Developer empathy narrative (first-person perspective)
- DX Scorecard with all 8 dimension scores
- DX Implementation Checklist
- TTHW assessment with target
**Close this phase:**
The review work above ends here. Now load the shared close steps afresh, even if
read earlier. Use phase `dx`, checkpoint `<DX_INPUT>`, and this phase's
`methodologyPath`. Keep this checkpoint for this invocation; review exports do not replace it.
{{SECTION:phase-close}}