mirror of
https://github.com/garrytan/gstack.git
synced 2026-07-07 16:48:01 +02:00
merge: integrate origin/main (v0.18.1.0) into open-agents-learnings
Main moved forward 6 commits while this branch was local. Integrated
both sides preserving all functionality:
From main (v0.16.4.0 → v0.18.1.0):
- v0.17.0.0 — UX behavioral foundations + ux-audit (generateUXPrinciples,
{{UX_PRINCIPLES}} placeholder, triggers frontmatter on skills)
- v0.18.0.0 — Confusion Protocol, Hermes + GBrain hosts, brain-first
resolver (generateBrainHealthInstruction, generateConfusionProtocol,
generateGBrainContextLoad, generateGBrainSaveResults, hosts/gbrain.ts,
hosts/hermes.ts, scripts/resolvers/gbrain.ts, GBrain bash health check)
- v0.18.0.1 — ngrok Windows build fix
- 0cc830b6 — tilde-in-assignment permission fix
- cc42f14a — gstack compact design doc (tabled)
- 822e843a — headed browser auto-shutdown + disconnect cleanup (v0.18.1.0)
Integration approach: keep this branch's preamble.ts submodule refactor
as the structure of record. Extracted main's two new generators into
their own submodules:
- scripts/resolvers/preamble/generate-brain-health-instruction.ts
- scripts/resolvers/preamble/generate-confusion-protocol.ts
Updated scripts/resolvers/preamble/generate-preamble-bash.ts to absorb
main's GBrain health check (host-conditional on gbrain/hermes).
scripts/resolvers/index.ts now imports BOTH:
- This branch's adds: MODEL_OVERLAY, TASTE_PROFILE, BIN_DIR resolvers
- Main's adds: UX_PRINCIPLES, GBRAIN_CONTEXT_LOAD, GBRAIN_SAVE_RESULTS
resolvers
scripts/resolvers/design.ts keeps both generateTasteProfile (this
branch) and generateUXPrinciples (main). Sibling exports, no overlap.
scripts/gen-skill-docs.ts keeps both this branch's --model flag wiring
and main's edits.
Templates auto-merged where possible. The 35 generated SKILL.md /
golden conflicts auto-resolved via `bun run gen:skill-docs --host all`
followed by re-snapshotting the ship goldens for claude/codex/factory.
Verification:
- bun run gen:skill-docs --host all completes cleanly
- bun test: 1 pre-existing failure (gstack-community-dashboard Supabase
network test, 235s timeout). NOT related to merge — unchanged Supabase
test infra times out without live network. Flagged in PR body.
Token-ceiling warnings on plan-ceo-review (29K), office-hours (26K),
and ship (34K). These existed on origin/main before the merge — the
preamble grew substantially from main's GBrain + UX additions plus this
branch's continuous-checkpoint, context-health, model-overlay, taste-profile,
and feature-discovery additions. Worth a follow-up reduction pass but
doesn't block this merge.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,12 @@ allowed-tools:
|
||||
- Glob
|
||||
- AskUserQuestion
|
||||
- WebSearch
|
||||
triggers:
|
||||
- debug this
|
||||
- fix this bug
|
||||
- why is this broken
|
||||
- root cause analysis
|
||||
- investigate this error
|
||||
hooks:
|
||||
PreToolUse:
|
||||
- matcher: "Edit"
|
||||
@@ -447,6 +453,19 @@ AI makes completeness near-free. Always recommend the complete option over short
|
||||
|
||||
Include `Completeness: X/10` for each option (10=all edge cases, 7=happy path, 3=shortcut).
|
||||
|
||||
## Confusion Protocol
|
||||
|
||||
When you encounter high-stakes ambiguity during coding:
|
||||
- Two plausible architectures or data models for the same requirement
|
||||
- A request that contradicts existing patterns and you're unsure which to follow
|
||||
- A destructive operation where the scope is unclear
|
||||
- Missing context that would change your approach significantly
|
||||
|
||||
STOP. Name the ambiguity in one sentence. Present 2-3 options with tradeoffs.
|
||||
Ask the user. Do not guess on architectural or data model decisions.
|
||||
|
||||
This does NOT apply to routine coding, small features, or obvious changes.
|
||||
|
||||
## Continuous Checkpoint Mode
|
||||
|
||||
If `CHECKPOINT_MODE` is `"continuous"` (from preamble output): auto-commit work as
|
||||
@@ -673,6 +692,8 @@ Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address r
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Phase 1: Root Cause Investigation
|
||||
|
||||
Gather context before forming any hypothesis.
|
||||
@@ -689,6 +710,8 @@ Gather context before forming any hypothesis.
|
||||
|
||||
4. **Reproduce:** Can you trigger the bug deterministically? If not, gather more evidence before proceeding.
|
||||
|
||||
5. **Check investigation history:** Search prior learnings for investigations on the same files. Recurring bugs in the same area are an architectural smell. If prior investigations exist, note patterns and check if the root cause was structural.
|
||||
|
||||
## Prior Learnings
|
||||
|
||||
Search for relevant learnings from previous sessions:
|
||||
@@ -850,6 +873,12 @@ Status: DONE | DONE_WITH_CONCERNS | BLOCKED
|
||||
════════════════════════════════════════
|
||||
```
|
||||
|
||||
Log the investigation as a learning for future sessions. Use `type: "investigation"` and include the affected files so future investigations on the same area can find this:
|
||||
|
||||
```bash
|
||||
~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"investigate","type":"investigation","key":"ROOT_CAUSE_KEY","insight":"ROOT_CAUSE_SUMMARY","confidence":9,"source":"observed","files":["affected/file1.ts","affected/file2.ts"]}'
|
||||
```
|
||||
|
||||
## Capture Learnings
|
||||
|
||||
If you discovered a non-obvious pattern, pitfall, or architectural insight during
|
||||
@@ -875,6 +904,8 @@ staleness detection: if those files are later deleted, the learning can be flagg
|
||||
**Only log genuine discoveries.** Don't log obvious things. Don't log things the user
|
||||
already knows. A good test: would this insight save time in a future session? If yes, log it.
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Important Rules
|
||||
|
||||
@@ -19,6 +19,12 @@ allowed-tools:
|
||||
- Glob
|
||||
- AskUserQuestion
|
||||
- WebSearch
|
||||
triggers:
|
||||
- debug this
|
||||
- fix this bug
|
||||
- why is this broken
|
||||
- root cause analysis
|
||||
- investigate this error
|
||||
hooks:
|
||||
PreToolUse:
|
||||
- matcher: "Edit"
|
||||
@@ -45,6 +51,8 @@ Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address r
|
||||
|
||||
---
|
||||
|
||||
{{GBRAIN_CONTEXT_LOAD}}
|
||||
|
||||
## Phase 1: Root Cause Investigation
|
||||
|
||||
Gather context before forming any hypothesis.
|
||||
@@ -61,6 +69,8 @@ Gather context before forming any hypothesis.
|
||||
|
||||
4. **Reproduce:** Can you trigger the bug deterministically? If not, gather more evidence before proceeding.
|
||||
|
||||
5. **Check investigation history:** Search prior learnings for investigations on the same files. Recurring bugs in the same area are an architectural smell. If prior investigations exist, note patterns and check if the root cause was structural.
|
||||
|
||||
{{LEARNINGS_SEARCH}}
|
||||
|
||||
Output: **"Root cause hypothesis: ..."** — a specific, testable claim about what is wrong and why.
|
||||
@@ -186,8 +196,16 @@ Status: DONE | DONE_WITH_CONCERNS | BLOCKED
|
||||
════════════════════════════════════════
|
||||
```
|
||||
|
||||
Log the investigation as a learning for future sessions. Use `type: "investigation"` and include the affected files so future investigations on the same area can find this:
|
||||
|
||||
```bash
|
||||
~/.claude/skills/gstack/bin/gstack-learnings-log '{"skill":"investigate","type":"investigation","key":"ROOT_CAUSE_KEY","insight":"ROOT_CAUSE_SUMMARY","confidence":9,"source":"observed","files":["affected/file1.ts","affected/file2.ts"]}'
|
||||
```
|
||||
|
||||
{{LEARNINGS_LOG}}
|
||||
|
||||
{{GBRAIN_SAVE_RESULTS}}
|
||||
|
||||
---
|
||||
|
||||
## Important Rules
|
||||
|
||||
Reference in New Issue
Block a user