diff --git a/test/fixtures/golden/claude-ship-SKILL.md b/test/fixtures/golden/claude-ship-SKILL.md index 04e5fe98e..d1c783395 100644 --- a/test/fixtures/golden/claude-ship-SKILL.md +++ b/test/fixtures/golden/claude-ship-SKILL.md @@ -131,6 +131,8 @@ ELI10 is always present, in plain English, not function names. Recommendation is Completeness: use `Completeness: N/10` only when options differ in coverage. 10 = complete, 7 = happy path, 3 = shortcut. If options differ in kind, write: `Note: options differ in kind, not coverage — no completeness score.` +Accepted shortcuts leave a trail: when the user selects an option that is BOTH Completeness ≤ 7 AND a durable-scope call (architecture or scope-cut — never a turn-level choice), log it via `gstack-decision-log` with the ceiling and the upgrade trigger in the rationale, and — as part of implementing that option, same edit, no follow-up question — mark each cut corner in code with `gstack-shortcut(dec-): , upgrade when ` in the language's comment syntax. Never agent-initiated: the marker exists only downstream of the user's explicit choice. /retro harvests these into a debt ledger, joined on the decision id. + Pros / cons: use ✅ and ❌. Minimum 2 pros and 1 con per option when the choice is real; Minimum 40 characters per bullet. Hard-stop escape for one-way/destructive confirmations: `✅ No cons — this is a hard-stop choice`. Neutral posture: `Recommendation: — this is a taste call, no strong preference either way`; `(recommended)` STAYS on the default option for AUTO_DECIDE. @@ -225,6 +227,11 @@ GStack voice: Garry-shaped product and engineering judgment, compressed for runt Good: "auth.ts:47 returns undefined when the session cookie expires. Users hit a white screen. Fix: add a null check and redirect to /login. Two lines." Bad: "I've identified a potential issue in the authentication flow that may cause problems under certain conditions." +**Bounded closer.** After completing work, report in at most a few short lines: what changed, what was skipped, what to watch. No feature tours, no unrequested design notes. If the explanation outgrows the change, cut the explanation. Exempt: AskUserQuestion decision briefs, completion-status blocks, anything the user explicitly asked to be explained, and a skill's mandated report format — the report IS the work in report-shaped skills (/qa-only, /plan-*-review, /retro, /document-generate); this rule governs unrequested prose around the deliverable, never the deliverable. + +Good closer: "Renamed the flag in 3 files, regenerated docs, tests green. Skipped the CLI alias (unused since v1.2); watch the Windows job." +Bad closer: a tour of every edit, a restatement of the plan, and three paragraphs justifying choices nobody questioned. + ## Context Recovery At session start or after compaction, recover recent project context. @@ -354,6 +361,16 @@ Always flag anything that looks wrong — one sentence, what you noticed and its Before building anything unfamiliar, **search first.** See `~/.claude/skills/gstack/ETHOS.md`. - **Layer 1** (tried and true) — don't reinvent. **Layer 2** (new and popular) — scrutinize. **Layer 3** (first principles) — prize above all. +**The reuse ladder — before writing new code, stop at the first rung that holds:** +1. A helper, util, or pattern already in this repo — re-implementing what's a few files over is the most common slop. +2. The standard library. +3. A native platform feature (CSS over JS, DB constraint over app code, `` over a picker lib). +4. An already-installed dependency — never add a new one for what a few lines cover. + +Then build the complete version of what remains. + +**Bug fixes hit root cause, not symptom:** one guard in the shared function beats a guard in every caller — grep the callers, fix it once where they all route through. + **Eureka:** When first-principles reasoning contradicts conventional wisdom, name it and log: ```bash jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true diff --git a/test/fixtures/golden/codex-ship-SKILL.md b/test/fixtures/golden/codex-ship-SKILL.md index ba44f2899..0b5ac1df8 100644 --- a/test/fixtures/golden/codex-ship-SKILL.md +++ b/test/fixtures/golden/codex-ship-SKILL.md @@ -117,6 +117,8 @@ ELI10 is always present, in plain English, not function names. Recommendation is Completeness: use `Completeness: N/10` only when options differ in coverage. 10 = complete, 7 = happy path, 3 = shortcut. If options differ in kind, write: `Note: options differ in kind, not coverage — no completeness score.` +Accepted shortcuts leave a trail: when the user selects an option that is BOTH Completeness ≤ 7 AND a durable-scope call (architecture or scope-cut — never a turn-level choice), log it via `gstack-decision-log` with the ceiling and the upgrade trigger in the rationale, and — as part of implementing that option, same edit, no follow-up question — mark each cut corner in code with `gstack-shortcut(dec-): , upgrade when ` in the language's comment syntax. Never agent-initiated: the marker exists only downstream of the user's explicit choice. /retro harvests these into a debt ledger, joined on the decision id. + Pros / cons: use ✅ and ❌. Minimum 2 pros and 1 con per option when the choice is real; Minimum 40 characters per bullet. Hard-stop escape for one-way/destructive confirmations: `✅ No cons — this is a hard-stop choice`. Neutral posture: `Recommendation: — this is a taste call, no strong preference either way`; `(recommended)` STAYS on the default option for AUTO_DECIDE. @@ -233,6 +235,11 @@ GStack voice: Garry-shaped product and engineering judgment, compressed for runt Good: "auth.ts:47 returns undefined when the session cookie expires. Users hit a white screen. Fix: add a null check and redirect to /login. Two lines." Bad: "I've identified a potential issue in the authentication flow that may cause problems under certain conditions." +**Bounded closer.** After completing work, report in at most a few short lines: what changed, what was skipped, what to watch. No feature tours, no unrequested design notes. If the explanation outgrows the change, cut the explanation. Exempt: AskUserQuestion decision briefs, completion-status blocks, anything the user explicitly asked to be explained, and a skill's mandated report format — the report IS the work in report-shaped skills (/qa-only, /plan-*-review, /retro, /document-generate); this rule governs unrequested prose around the deliverable, never the deliverable. + +Good closer: "Renamed the flag in 3 files, regenerated docs, tests green. Skipped the CLI alias (unused since v1.2); watch the Windows job." +Bad closer: a tour of every edit, a restatement of the plan, and three paragraphs justifying choices nobody questioned. + ## Context Recovery At session start or after compaction, recover recent project context. @@ -362,6 +369,16 @@ Always flag anything that looks wrong — one sentence, what you noticed and its Before building anything unfamiliar, **search first.** See `$GSTACK_ROOT/ETHOS.md`. - **Layer 1** (tried and true) — don't reinvent. **Layer 2** (new and popular) — scrutinize. **Layer 3** (first principles) — prize above all. +**The reuse ladder — before writing new code, stop at the first rung that holds:** +1. A helper, util, or pattern already in this repo — re-implementing what's a few files over is the most common slop. +2. The standard library. +3. A native platform feature (CSS over JS, DB constraint over app code, `` over a picker lib). +4. An already-installed dependency — never add a new one for what a few lines cover. + +Then build the complete version of what remains. + +**Bug fixes hit root cause, not symptom:** one guard in the shared function beats a guard in every caller — grep the callers, fix it once where they all route through. + **Eureka:** When first-principles reasoning contradicts conventional wisdom, name it and log: ```bash jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true diff --git a/test/fixtures/golden/factory-ship-SKILL.md b/test/fixtures/golden/factory-ship-SKILL.md index 70a00b582..1994ba580 100644 --- a/test/fixtures/golden/factory-ship-SKILL.md +++ b/test/fixtures/golden/factory-ship-SKILL.md @@ -119,6 +119,8 @@ ELI10 is always present, in plain English, not function names. Recommendation is Completeness: use `Completeness: N/10` only when options differ in coverage. 10 = complete, 7 = happy path, 3 = shortcut. If options differ in kind, write: `Note: options differ in kind, not coverage — no completeness score.` +Accepted shortcuts leave a trail: when the user selects an option that is BOTH Completeness ≤ 7 AND a durable-scope call (architecture or scope-cut — never a turn-level choice), log it via `gstack-decision-log` with the ceiling and the upgrade trigger in the rationale, and — as part of implementing that option, same edit, no follow-up question — mark each cut corner in code with `gstack-shortcut(dec-): , upgrade when ` in the language's comment syntax. Never agent-initiated: the marker exists only downstream of the user's explicit choice. /retro harvests these into a debt ledger, joined on the decision id. + Pros / cons: use ✅ and ❌. Minimum 2 pros and 1 con per option when the choice is real; Minimum 40 characters per bullet. Hard-stop escape for one-way/destructive confirmations: `✅ No cons — this is a hard-stop choice`. Neutral posture: `Recommendation: — this is a taste call, no strong preference either way`; `(recommended)` STAYS on the default option for AUTO_DECIDE. @@ -213,6 +215,11 @@ GStack voice: Garry-shaped product and engineering judgment, compressed for runt Good: "auth.ts:47 returns undefined when the session cookie expires. Users hit a white screen. Fix: add a null check and redirect to /login. Two lines." Bad: "I've identified a potential issue in the authentication flow that may cause problems under certain conditions." +**Bounded closer.** After completing work, report in at most a few short lines: what changed, what was skipped, what to watch. No feature tours, no unrequested design notes. If the explanation outgrows the change, cut the explanation. Exempt: AskUserQuestion decision briefs, completion-status blocks, anything the user explicitly asked to be explained, and a skill's mandated report format — the report IS the work in report-shaped skills (/qa-only, /plan-*-review, /retro, /document-generate); this rule governs unrequested prose around the deliverable, never the deliverable. + +Good closer: "Renamed the flag in 3 files, regenerated docs, tests green. Skipped the CLI alias (unused since v1.2); watch the Windows job." +Bad closer: a tour of every edit, a restatement of the plan, and three paragraphs justifying choices nobody questioned. + ## Context Recovery At session start or after compaction, recover recent project context. @@ -342,6 +349,16 @@ Always flag anything that looks wrong — one sentence, what you noticed and its Before building anything unfamiliar, **search first.** See `$GSTACK_ROOT/ETHOS.md`. - **Layer 1** (tried and true) — don't reinvent. **Layer 2** (new and popular) — scrutinize. **Layer 3** (first principles) — prize above all. +**The reuse ladder — before writing new code, stop at the first rung that holds:** +1. A helper, util, or pattern already in this repo — re-implementing what's a few files over is the most common slop. +2. The standard library. +3. A native platform feature (CSS over JS, DB constraint over app code, `` over a picker lib). +4. An already-installed dependency — never add a new one for what a few lines cover. + +Then build the complete version of what remains. + +**Bug fixes hit root cause, not symptom:** one guard in the shared function beats a guard in every caller — grep the callers, fix it once where they all route through. + **Eureka:** When first-principles reasoning contradicts conventional wisdom, name it and log: ```bash jq -n --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$(git branch --show-current 2>/dev/null)" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> ~/.gstack/analytics/eureka.jsonl 2>/dev/null || true @@ -1802,6 +1819,7 @@ Based on the scope signals above, select which specialists to dispatch. 5. **Data Migration** — if SCOPE_MIGRATIONS=true. Read `$GSTACK_ROOT/review/specialists/data-migration.md` 6. **API Contract** — if SCOPE_API=true. Read `$GSTACK_ROOT/review/specialists/api-contract.md` 7. **Design** — if SCOPE_FRONTEND=true. Use the existing design review checklist at `$GSTACK_ROOT/review/design-checklist.md` +8. **Simplification** — if DIFF_LINES > 100. Read `$GSTACK_ROOT/review/specialists/simplification.md`. Advisory-only lens: hunts unrequested structure (hand-rolled stdlib, one-implementation abstractions, dependencies duplicating platform features), never coverage. ### Adaptive gating @@ -1811,7 +1829,7 @@ For each conditional specialist that passed scope gating, check the `gstack-spec - If tagged `[GATE_CANDIDATE]` (0 findings in 10+ dispatches): skip it. Print: "[specialist] auto-gated (0 findings in N reviews)." - If tagged `[NEVER_GATE]`: always dispatch regardless of hit rate. Security and data-migration are insurance policy specialists — they should run even when silent. -**Force flags:** If the user's prompt includes `--security`, `--performance`, `--testing`, `--maintainability`, `--data-migration`, `--api-contract`, `--design`, or `--all-specialists`, force-include that specialist regardless of gating. +**Force flags:** If the user's prompt includes `--security`, `--performance`, `--testing`, `--maintainability`, `--data-migration`, `--api-contract`, `--design`, `--simplification`, or `--all-specialists`, force-include that specialist regardless of gating. Note which specialists were selected, gated, and skipped. Print the selection: "Dispatching N specialists: [names]. Skipped: [names] (scope not detected). Gated: [names] (0 findings in N+ reviews)." @@ -1896,8 +1914,14 @@ Group findings by fingerprint. For findings sharing the same fingerprint: - Confidence 3-4: move to appendix (suppress from main findings) - Confidence 1-2: suppress entirely +**Advisory carve-out (simplification specialist):** +Findings with `"advisory": true` are excluded from BOTH the quality_score +summation and the findings-count header below — they are structure suggestions, +not defects, and must not make "5 findings … 10/10" look contradictory. In +Fix-First they are ASK-only: NEVER auto-applied, even when mechanical. + **Compute PR Quality Score:** -After merging, compute the quality score: +After merging, compute the quality score over NON-advisory findings only: `quality_score = max(0, 10 - (critical_count * 2 + informational_count * 0.5))` Cap at 10. Log this in the review result at the end. @@ -1907,7 +1931,8 @@ Present the merged findings in the same format as the current review: ``` SPECIALIST REVIEW: N findings (X critical, Y informational) from Z specialists -[For each finding, in order: CRITICAL first, then INFORMATIONAL, sorted by confidence descending] +[For each finding, in order: CRITICAL first, then INFORMATIONAL, sorted by confidence descending; + advisory findings last, each rendered with an [ADVISORY] label in place of the severity] [SEVERITY] (confidence: N/10, specialist: name) path:line — summary Fix: recommended fix [If MULTI-SPECIALIST CONFIRMED: show confirmation note] @@ -1915,12 +1940,20 @@ SPECIALIST REVIEW: N findings (X critical, Y informational) from Z specialists PR Quality Score: X/10 ``` +**Simplification footer (after the score line):** +- If the simplification specialist was dispatched and returned findings, sum + their `lines_removable` values and print: `net: -N lines possible` (omit + findings without the field from the sum). +- If it was dispatched and returned NO FINDINGS, print: + `Simplification: lean already — nothing to cut.` +- If it was not dispatched, print neither line. + These findings flow into the Fix-First flow (item 4) alongside the checklist pass (Step 9). -The Fix-First heuristic applies identically — specialist findings follow the same AUTO-FIX vs ASK classification. +The Fix-First heuristic applies identically — specialist findings follow the same AUTO-FIX vs ASK classification (except advisory findings, which are ASK-only per the carve-out above). **Compile per-specialist stats:** After merging findings, compile a `specialists` object for the review-log persist. -For each specialist (testing, maintainability, security, performance, data-migration, api-contract, design, red-team): +For each specialist (testing, maintainability, security, performance, data-migration, api-contract, design, simplification, red-team): - If dispatched: `{"dispatched": true, "findings": N, "critical": N, "informational": N}` - If skipped by scope: `{"dispatched": false, "reason": "scope"}` - If skipped by gating: `{"dispatched": false, "reason": "gated"}`