mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-21 12:18:24 +08:00
fix: resolve merge conflicts — rebase onto main v0.13.10.0
CHANGELOG: keep both main's entries (0.13.10.0 Office Hours, 0.13.9.0 Composable Skills) and our sidebar inspector entry, re-versioned to 0.13.11.0 since our features land after main's 0.13.10.0. VERSION: 0.13.9.0 (ours) vs 0.13.10.0 (main) → 0.13.11.0 (combined). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,14 @@ if [ -f "$_LEARN_FILE" ]; then
|
||||
else
|
||||
echo "LEARNINGS: 0"
|
||||
fi
|
||||
# Check if CLAUDE.md has routing rules
|
||||
_HAS_ROUTING="no"
|
||||
if [ -f CLAUDE.md ] && grep -q "## Skill routing" CLAUDE.md 2>/dev/null; then
|
||||
_HAS_ROUTING="yes"
|
||||
fi
|
||||
_ROUTING_DECLINED=$(~/.claude/skills/gstack/bin/gstack-config get routing_declined 2>/dev/null || echo "false")
|
||||
echo "HAS_ROUTING: $_HAS_ROUTING"
|
||||
echo "ROUTING_DECLINED: $_ROUTING_DECLINED"
|
||||
```
|
||||
|
||||
If `PROACTIVE` is `"false"`, do not proactively suggest gstack skills AND do not
|
||||
@@ -151,6 +159,49 @@ touch ~/.gstack/.proactive-prompted
|
||||
|
||||
This only happens once. If `PROACTIVE_PROMPTED` is `yes`, skip this entirely.
|
||||
|
||||
If `HAS_ROUTING` is `no` AND `ROUTING_DECLINED` is `false` AND `PROACTIVE_PROMPTED` is `yes`:
|
||||
Check if a CLAUDE.md file exists in the project root. If it does not exist, create it.
|
||||
|
||||
Use AskUserQuestion:
|
||||
|
||||
> gstack works best when your project's CLAUDE.md includes skill routing rules.
|
||||
> This tells Claude to use specialized workflows (like /ship, /investigate, /qa)
|
||||
> instead of answering directly. It's a one-time addition, about 15 lines.
|
||||
|
||||
Options:
|
||||
- A) Add routing rules to CLAUDE.md (recommended)
|
||||
- B) No thanks, I'll invoke skills manually
|
||||
|
||||
If A: Append this section to the end of CLAUDE.md:
|
||||
|
||||
```markdown
|
||||
|
||||
## Skill routing
|
||||
|
||||
When the user's request matches an available skill, ALWAYS invoke it using the Skill
|
||||
tool as your FIRST action. Do NOT answer directly, do NOT use other tools first.
|
||||
The skill has specialized workflows that produce better results than ad-hoc answers.
|
||||
|
||||
Key routing rules:
|
||||
- Product ideas, "is this worth building", brainstorming → invoke office-hours
|
||||
- Bugs, errors, "why is this broken", 500 errors → invoke investigate
|
||||
- Ship, deploy, push, create PR → invoke ship
|
||||
- QA, test the site, find bugs → invoke qa
|
||||
- Code review, check my diff → invoke review
|
||||
- Update docs after shipping → invoke document-release
|
||||
- Weekly retro → invoke retro
|
||||
- Design system, brand → invoke design-consultation
|
||||
- Visual audit, design polish → invoke design-review
|
||||
- Architecture review → invoke plan-eng-review
|
||||
```
|
||||
|
||||
Then commit the change: `git add CLAUDE.md && git commit -m "chore: add gstack skill routing rules to CLAUDE.md"`
|
||||
|
||||
If B: run `~/.claude/skills/gstack/bin/gstack-config set routing_declined true`
|
||||
Say "No problem. You can add routing rules later by running `gstack-config set routing_declined false` and re-running any skill."
|
||||
|
||||
This only happens once per project. If `HAS_ROUTING` is `yes` or `ROUTING_DECLINED` is `true`, skip this entirely.
|
||||
|
||||
## Voice
|
||||
|
||||
**Tone:** direct, concrete, sharp, never corporate, never academic. Sound like a builder, not a consultant. Name the file, the function, the command. No filler, no throat-clearing.
|
||||
|
||||
@@ -135,4 +135,62 @@ describe('gstack-config', () => {
|
||||
const { stdout } = run(['get', 'test_special']);
|
||||
expect(stdout).toBe('a/b&c\\d');
|
||||
});
|
||||
|
||||
// ─── annotated header ──────────────────────────────────────
|
||||
test('first set writes annotated header with docs', () => {
|
||||
run(['set', 'telemetry', 'off']);
|
||||
const content = readFileSync(join(stateDir, 'config.yaml'), 'utf-8');
|
||||
expect(content).toContain('# gstack configuration');
|
||||
expect(content).toContain('edit freely');
|
||||
expect(content).toContain('proactive:');
|
||||
expect(content).toContain('telemetry:');
|
||||
expect(content).toContain('auto_upgrade:');
|
||||
expect(content).toContain('skill_prefix:');
|
||||
expect(content).toContain('routing_declined:');
|
||||
expect(content).toContain('codex_reviews:');
|
||||
expect(content).toContain('skip_eng_review:');
|
||||
});
|
||||
|
||||
test('header written only once, not duplicated on second set', () => {
|
||||
run(['set', 'foo', 'bar']);
|
||||
run(['set', 'baz', 'qux']);
|
||||
const content = readFileSync(join(stateDir, 'config.yaml'), 'utf-8');
|
||||
const headerCount = (content.match(/# gstack configuration/g) || []).length;
|
||||
expect(headerCount).toBe(1);
|
||||
});
|
||||
|
||||
test('header does not break get on commented-out keys', () => {
|
||||
run(['set', 'telemetry', 'community']);
|
||||
// Header contains "# telemetry: anonymous" as a comment example.
|
||||
// get should return the real value, not the comment.
|
||||
const { stdout } = run(['get', 'telemetry']);
|
||||
expect(stdout).toBe('community');
|
||||
});
|
||||
|
||||
test('existing config file is not overwritten with header', () => {
|
||||
writeFileSync(join(stateDir, 'config.yaml'), 'existing: value\n');
|
||||
run(['set', 'new_key', 'new_value']);
|
||||
const content = readFileSync(join(stateDir, 'config.yaml'), 'utf-8');
|
||||
expect(content).toContain('existing: value');
|
||||
expect(content).not.toContain('# gstack configuration');
|
||||
});
|
||||
|
||||
// ─── routing_declined ──────────────────────────────────────
|
||||
test('routing_declined defaults to empty (not set)', () => {
|
||||
const { stdout } = run(['get', 'routing_declined']);
|
||||
expect(stdout).toBe('');
|
||||
});
|
||||
|
||||
test('routing_declined can be set and read', () => {
|
||||
run(['set', 'routing_declined', 'true']);
|
||||
const { stdout } = run(['get', 'routing_declined']);
|
||||
expect(stdout).toBe('true');
|
||||
});
|
||||
|
||||
test('routing_declined can be reset to false', () => {
|
||||
run(['set', 'routing_declined', 'true']);
|
||||
run(['set', 'routing_declined', 'false']);
|
||||
const { stdout } = run(['get', 'routing_declined']);
|
||||
expect(stdout).toBe('false');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user