create-baton 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-baton",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Set up Baton AI orchestration protocol in any project",
5
5
  "bin": {
6
6
  "create-baton": "./bin/create-baton.js"
package/src/scaffold.js CHANGED
@@ -49,7 +49,7 @@ function scaffold(dest, { tool, stack, projectName }) {
49
49
  ).length;
50
50
  results.push(`Copied skills/ (${coreCount} core + ${stackCount} stack + ${patternCount} pattern + ${domainCount} domain)`);
51
51
 
52
- // 3. Create .ai-rules/ with stub files
52
+ // 3. Create .ai-rules/ with stub files (non-destructive)
53
53
  const aiRulesDir = path.join(dest, '.ai-rules');
54
54
  fs.mkdirSync(aiRulesDir, { recursive: true });
55
55
  const stubs = {
@@ -58,10 +58,21 @@ function scaffold(dest, { tool, stack, projectName }) {
58
58
  'patterns.md': `# Patterns & Quirks — ${projectName}\n\n> AI adds entries here as it discovers gotchas and solutions.\n`,
59
59
  'structure.md': `# Project Structure — ${projectName}\n\n> AI will fill this once the project scaffolding is set up.\n`,
60
60
  };
61
+ let createdStubCount = 0;
61
62
  for (const [file, content] of Object.entries(stubs)) {
62
- fs.writeFileSync(path.join(aiRulesDir, file), content);
63
+ const stubPath = path.join(aiRulesDir, file);
64
+ if (fs.existsSync(stubPath)) {
65
+ const altStubFile = getNextBatonFilename(aiRulesDir, file);
66
+ fs.writeFileSync(path.join(aiRulesDir, altStubFile), content);
67
+ results.push(`.ai-rules/${file} exists - created .ai-rules/${altStubFile} (review and merge manually if needed)`);
68
+ } else {
69
+ fs.writeFileSync(stubPath, content);
70
+ createdStubCount += 1;
71
+ }
72
+ }
73
+ if (createdStubCount > 0) {
74
+ results.push(`Created .ai-rules/ (${createdStubCount} stub files)`);
63
75
  }
64
- results.push('Created .ai-rules/ (4 stub files)');
65
76
 
66
77
  // 4. Create handoff/ with .gitkeep
67
78
  const handoffDir = path.join(dest, 'handoff');
@@ -155,9 +166,9 @@ ${stackLine}
155
166
  This project uses the Baton protocol for AI-assisted development.
156
167
 
157
168
  1. Read \`BATON_v3.1.md\` — the orchestration protocol
158
- 2. Read \`.ai-rules/\` — project context files (AI-generated)
159
- 3. Read \`skills/\` — curated best practices for this stack
160
- 4. Check \`handoff/\` session handoff files for continuity
169
+ 2. Read \`.ai-rules/tech-stack.md\` and \`.ai-rules/patterns.md\` condensed project context
170
+ 3. Check \`handoff/\` — session handoff files for continuity
171
+ 4. Use \`skills/\` only for new problem areas not covered in \`.ai-rules/tech-stack.md\`
161
172
 
162
173
  ## Build & Development Commands
163
174
 
@@ -186,6 +197,7 @@ skills/ # Best practice skills
186
197
  core/ # Universal rules
187
198
  stacks/ # Stack-specific patterns
188
199
  patterns/ # Implementation patterns
200
+ domains/ # Domain-specific guidance
189
201
  handoff/ # Session handoff files
190
202
  PROGRESS.md # Session progress log
191
203
  BACKLOG.md # Deferred items
@@ -195,8 +207,9 @@ BACKLOG.md # Deferred items
195
207
 
196
208
  This project follows the Baton protocol. Key rules:
197
209
  - Read BATON_v3.1.md before starting work
198
- - Check skills/ before web searching
199
- - Document discoveries in .ai-rules/patterns.md
210
+ - Check .ai-rules/tech-stack.md first, then .ai-rules/patterns.md
211
+ - Use skills/ only when needed for new problem areas
212
+ - Document discoveries in .ai-rules/patterns.md and keep .ai-rules/tech-stack.md updated
200
213
  - Create handoff files at session end
201
214
  - Update PROGRESS.md after each session
202
215
  `;
@@ -184,8 +184,8 @@ Create the appropriate config file for the user's AI tool:
184
184
  | Claude Code | CLAUDE.md |
185
185
  | Cursor | .cursorrules |
186
186
  | Windsurf | .windsurfrules |
187
- | Kiro | .kiro/context.md |
188
- | Warp | .warp/rules/project.md |
187
+ | Kiro | CLAUDE.md |
188
+ | Warp | CLAUDE.md |
189
189
  | Multiple/Other | Create CLAUDE.md as universal fallback |
190
190
 
191
191
  **IDE Config Must Include:**
@@ -567,13 +567,13 @@ This project uses **Baton Protocol** — an AI orchestration system where:
567
567
  2. Follow the session protocol
568
568
  3. End by creating the next handoff
569
569
 
570
- **Current Session:** `handoff/SESSION_[N].md`
570
+ **Current Session:** `handoff/SESSION_{{CURRENT_SESSION}}.md`
571
571
 
572
572
  ## Context Files (Read in Order)
573
573
 
574
574
  | Priority | File | Purpose |
575
575
  |----------|------|---------|
576
- | 1 | `handoff/SESSION_N.md` | Current session tasks |
576
+ | 1 | `handoff/SESSION_{{CURRENT_SESSION}}.md` | Current session tasks |
577
577
  | 2 | `.ai-rules/project.md` | Project decisions & rules |
578
578
  | 3 | `.ai-rules/tech-stack.md` | Stack patterns |
579
579
  | 4 | `.ai-rules/patterns.md` | Discovered quirks |
@@ -582,7 +582,8 @@ This project uses **Baton Protocol** — an AI orchestration system where:
582
582
 
583
583
  ## Skills Library
584
584
 
585
- Check these BEFORE web searching:
585
+ Use `.ai-rules/tech-stack.md` and `.ai-rules/patterns.md` first.
586
+ Check these skill folders only for new problem areas not covered there:
586
587
 
587
588
  - `skills/core/` — Security, testing, production rules
588
589
  - `skills/stacks/` — Tech stack patterns
@@ -593,16 +594,17 @@ Check these BEFORE web searching:
593
594
 
594
595
  1. **Flexible tasks** — Do 1-4 tasks based on size (tiny=4, large=1)
595
596
  2. **Verify before moving on** — Build must pass, feature must work
596
- 3. **Document as you go** — Update structure.md, patterns.md
597
- 4. **Create handoff at end** — Next session file is mandatory
598
- 5. **Ask when unsure** — Never guess on business logic
597
+ 3. **Knowledge order** — Check `.ai-rules/tech-stack.md`, then `.ai-rules/patterns.md`, then `skills/` only if needed
598
+ 4. **Document as you go** — Update structure.md, patterns.md
599
+ 5. **Create handoff at end** — Next session file is mandatory
600
+ 6. **Ask when unsure** — Never guess on business logic
599
601
 
600
602
  ## Session End Checklist
601
603
 
602
604
  - [ ] Build passes
603
605
  - [ ] New features work
604
606
  - [ ] PROGRESS.md updated
605
- - [ ] handoff/SESSION_{N+1}.md created
607
+ - [ ] `handoff/SESSION_{{NEXT_SESSION}}.md` created
606
608
  - [ ] Ask user: "next" or "done"?
607
609
  ```
608
610
 
@@ -614,7 +616,7 @@ Check these BEFORE web searching:
614
616
  This project uses Baton — an AI orchestration system.
615
617
 
616
618
  ## Start Each Session
617
- 1. Read handoff/SESSION_N.md (current session)
619
+ 1. Read handoff/SESSION_{{CURRENT_SESSION}}.md (current session)
618
620
  2. Read .ai-rules/ files for context
619
621
  3. Follow the tasks in the handoff
620
622
 
@@ -627,17 +629,20 @@ This project uses Baton — an AI orchestration system.
627
629
  ## End Each Session
628
630
  - Verify build passes
629
631
  - Update PROGRESS.md
630
- - Create handoff/SESSION_{N+1}.md
632
+ - Create handoff/SESSION_{{NEXT_SESSION}}.md
631
633
  - Ask: "next" or "done"?
632
634
 
633
635
  ## Skills (Check Before Web Search)
636
+ - .ai-rules/tech-stack.md — Condensed technical rules (read first)
637
+ - .ai-rules/patterns.md — Project-specific quirks
634
638
  - skills/core/ — Universal rules
635
- - skills/stacks/ — Tech patterns
636
- - skills/patterns/ — Implementation guides
639
+ - skills/stacks/ — Tech patterns (load only if needed)
640
+ - skills/patterns/ — Implementation guides (load only if needed)
637
641
 
638
642
  ## Key Files
639
- - handoff/SESSION_N.md — Current session
643
+ - handoff/SESSION_{{CURRENT_SESSION}}.md — Current session
640
644
  - .ai-rules/project.md — Decisions
645
+ - .ai-rules/tech-stack.md — Condensed stack + pattern rules
641
646
  - .ai-rules/patterns.md — Quirks discovered
642
647
  - PROGRESS.md — Session log
643
648
  - BACKLOG.md — Deferred work
@@ -646,8 +651,11 @@ This project uses Baton — an AI orchestration system.
646
651
  - Never commit secrets
647
652
  - Always use environment variables
648
653
  - RLS on all database tables
654
+ - Zod validation on all inputs
649
655
  - Verify before declaring done
650
656
  - Document quirks in patterns.md
657
+ - Update tech-stack.md when loading new skills
658
+ - Create handoff before ending session
651
659
  ```
652
660
 
653
661
  ### .windsurfrules (Windsurf)
@@ -695,7 +703,7 @@ Same content as .cursorrules — Windsurf uses similar format.
695
703
  - Update documentation as you go
696
704
  - If unsure about anything, ASK before building
697
705
  - If scope grows, pause and discuss
698
- - Check skills/ and patterns.md before web searching
706
+ - Check `.ai-rules/tech-stack.md` and `.ai-rules/patterns.md` before web searching; use `skills/` only if needed
699
707
 
700
708
  ### Ending a Session
701
709
 
@@ -36,7 +36,8 @@ This project uses **Baton Protocol** — an AI orchestration system where:
36
36
 
37
37
  ## Skills Library
38
38
 
39
- **Check these BEFORE web searching:**
39
+ Use `.ai-rules/tech-stack.md` and `.ai-rules/patterns.md` first.
40
+ Check these skill folders only for new problem areas not covered there:
40
41
 
41
42
  | Folder | Contains |
42
43
  |--------|----------|
@@ -75,7 +76,7 @@ This project uses **Baton Protocol** — an AI orchestration system where:
75
76
 
76
77
  1. **Verify before moving on** — Build must pass, feature must work
77
78
  2. **Document as you go** — Update structure.md, patterns.md
78
- 3. **Skills before search** — Check skills/ before web research
79
+ 3. **Knowledge order** — Check `.ai-rules/tech-stack.md`, then `.ai-rules/patterns.md`, then `skills/` only if needed
79
80
  4. **Ask when unsure** — Never guess on business logic
80
81
  5. **Handoff is mandatory** — Session isn't done without next handoff
81
82
 
@@ -28,15 +28,17 @@ This project uses Baton — an AI orchestration protocol.
28
28
 
29
29
  ## Skills (Check Before Web Search)
30
30
 
31
- - `skills/core/`Security, testing, production rules
32
- - `skills/stacks/` — {{STACK}} patterns
33
- - `skills/patterns/` — Implementation guides
31
+ - `.ai-rules/tech-stack.md` — Condensed technical rules (read first)
34
32
  - `.ai-rules/patterns.md` — Project-specific quirks
33
+ - `skills/core/` — Security, testing, production rules
34
+ - `skills/stacks/` — {{STACK}} patterns (load only if needed)
35
+ - `skills/patterns/` — Implementation guides (load only if needed)
35
36
 
36
37
  ## Key Files
37
38
 
38
39
  - `handoff/SESSION_{{CURRENT_SESSION}}.md` — Current session tasks
39
40
  - `.ai-rules/project.md` — Decisions and rules
41
+ - `.ai-rules/tech-stack.md` — Condensed stack + pattern rules
40
42
  - `.ai-rules/patterns.md` — Discovered quirks
41
43
  - `PROGRESS.md` — Session log
42
44
  - `BACKLOG.md` — Deferred work
@@ -49,6 +51,7 @@ This project uses Baton — an AI orchestration protocol.
49
51
  - Zod validation on all inputs
50
52
  - Verify before declaring done
51
53
  - Document quirks in patterns.md
54
+ - Update tech-stack.md when loading new skills
52
55
  - Create handoff before ending session
53
56
 
54
57
  ## Commands