Phase 0-pre now runs two targeted searches instead of one unfiltered:
- --type architecture (limit 15): workflow maps, system boundaries
- --type operational (limit 10): env-profile, db host mappings, env quirks
This ensures workflow maps and environment knowledge aren't crowded out
by root-cause pitfalls that go stale after fixes.
End-of-session learnings reordered by durability:
1. Workflow maps (always save — most expensive to rebuild)
2. Environment quirks (db host traps, staging/prod differences)
3. Cross-system boundary patterns
4. Environment profile updates
Removed automatic root-cause and dead-end logging — these go stale after
fixes. Only log pitfalls that represent recurring structural patterns,
not one-off bug findings.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New learnings the skill saves after each session:
- Workflow maps (architecture type, key: workflow-FLOW_NAME) — the most
expensive artifact to build (10-15 tool calls). Compact arrow notation
with file:line references. Future sessions reuse instead of re-tracing.
- Environment quirks (operational type, key: env-*) — database host
mappings, staging/prod gotchas. Prevents the wrong-database trap.
New learnings the skill consumes at start:
- Phase 0-pre now loads ALL learnings (limit 20) via gstack-learnings-search,
not just env-profile. Explicitly looks for workflow-*, env-*, and pitfall
learnings relevant to the current issue.
- Phase 1f checks for cached workflow maps BEFORE building from scratch.
If a matching workflow-* learning exists, starts from it and spot-checks
2-3 file:line refs instead of re-reading all the code.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tested on real issue #3449. Without budgets, model burned 162 tool calls
exploring code without building the workflow map or printing Evidence Gate.
With budgets: env check printed immediately, workflow map built with file
refs, 4 hypotheses with testability ratings, all in 113 tool calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Analyzed a real diagnostic session that wasted 500+ lines querying the wrong
database, skipped the workflow map, jumped between hypotheses without testing,
and declared confidence 8/10 without reproducing the issue.
New guardrails:
- "5 Deadly Sins" section: wrong database, skipping workflow map, narrative
bias, premature confidence, sequential hypothesis testing
- Phase 0-env: mandatory environment verification before ANY database query
(print host/db, verify it matches the reported environment)
- Phase 1f: "MANDATORY BEFORE ANY HYPOTHESIS" with explicit warning about
the #1 failure mode (skipping the map → anchoring on first suspicious thing)
- Evidence Gate 1: now a printable checklist that must include workflow map
completion; "print it with answers" instruction
- Anti-narrative rule in Phase 2: catch "so it must be..." reasoning
- Anti-premature-convergence rules: max confidence 7 without reproduction,
"what ELSE could explain this?" prompt after every suspicious finding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three root causes for env-profile learnings never being saved:
1. Bare `gstack-learnings-log` / `gstack-learnings-search` without full path —
binary not on PATH in all environments. Fixed: use ~/.claude/skills/gstack/bin/
2. Phase 0j used angle-bracket template placeholders (<FULL INVENTORY...>) that
the model treated as examples rather than fill-in-the-blank instructions.
Fixed: explicit YOUR_ACTUAL_INVENTORY_HERE with format example and rules.
3. Model burned all turns retrying Phase 0-pre learnings search (empty output
from gstack-learnings-search was ambiguous). Fixed: use Grep tool instead
of Bash, single call with explicit "do not retry" instruction.
Also: added Phase 0 turn budget (≤5 tool calls) and $B quoting fix (line 232).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Read-only evidence-gathering complement to /investigate. Overcomes the
model's bias towards action by enforcing evidence gates at each phase.
Produces a diagnostic report with certainty scores — no code changes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>