create-baton 1.1.0 → 1.1.1
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/README.md
CHANGED
|
@@ -38,7 +38,7 @@ $ npx create-baton
|
|
|
38
38
|
Setting up Baton...
|
|
39
39
|
|
|
40
40
|
✓ Copied BATON_v3.1.md
|
|
41
|
-
✓ Copied skills/ (8 core +
|
|
41
|
+
✓ Copied skills/ (8 core + 6 stack + 7 pattern + 4 domain)
|
|
42
42
|
✓ Created .ai-rules/ (4 stub files)
|
|
43
43
|
✓ Created handoff/
|
|
44
44
|
✓ Created CLAUDE.md
|
package/package.json
CHANGED
package/src/scaffold.js
CHANGED
|
@@ -24,8 +24,8 @@ function scaffold(dest, { tool, stack, projectName }) {
|
|
|
24
24
|
copyDir(path.join(skillsSrc, 'core'), path.join(skillsDest, 'core'));
|
|
25
25
|
copyDir(path.join(skillsSrc, 'patterns'), path.join(skillsDest, 'patterns'));
|
|
26
26
|
|
|
27
|
-
//
|
|
28
|
-
|
|
27
|
+
// Always copy domains/
|
|
28
|
+
copyDir(path.join(skillsSrc, 'domains'), path.join(skillsDest, 'domains'));
|
|
29
29
|
|
|
30
30
|
// Copy stack-specific skills (each is a directory with SKILL.md)
|
|
31
31
|
const stackSkills = STACK_MAP[stack] || [];
|
|
@@ -44,7 +44,10 @@ function scaffold(dest, { tool, stack, projectName }) {
|
|
|
44
44
|
const patternCount = fs.readdirSync(path.join(skillsDest, 'patterns')).filter(
|
|
45
45
|
f => fs.statSync(path.join(skillsDest, 'patterns', f)).isDirectory()
|
|
46
46
|
).length;
|
|
47
|
-
|
|
47
|
+
const domainCount = fs.readdirSync(path.join(skillsDest, 'domains')).filter(
|
|
48
|
+
f => fs.statSync(path.join(skillsDest, 'domains', f)).isDirectory()
|
|
49
|
+
).length;
|
|
50
|
+
results.push(`Copied skills/ (${coreCount} core + ${stackCount} stack + ${patternCount} pattern + ${domainCount} domain)`);
|
|
48
51
|
|
|
49
52
|
// 3. Create .ai-rules/ with stub files
|
|
50
53
|
const aiRulesDir = path.join(dest, '.ai-rules');
|
|
@@ -85,8 +88,15 @@ function scaffold(dest, { tool, stack, projectName }) {
|
|
|
85
88
|
.replace(/\{\{TYPECHECK_COMMAND\}\}/g, 'npx tsc --noEmit')
|
|
86
89
|
.replace(/\{\{PROJECT_RULES\}\}/g, '<!-- AI will add project-specific rules here -->');
|
|
87
90
|
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
const idePath = path.join(dest, ide.file);
|
|
92
|
+
if (fs.existsSync(idePath)) {
|
|
93
|
+
const altIdeFile = getNextBatonFilename(dest, ide.file);
|
|
94
|
+
fs.writeFileSync(path.join(dest, altIdeFile), templateContent);
|
|
95
|
+
results.push(`${ide.file} exists - created ${altIdeFile} (review and merge manually if needed)`);
|
|
96
|
+
} else {
|
|
97
|
+
fs.writeFileSync(idePath, templateContent);
|
|
98
|
+
results.push(`Created ${ide.file}`);
|
|
99
|
+
}
|
|
90
100
|
} else {
|
|
91
101
|
// Codex — uses AGENTS.md directly (already generated in step 6)
|
|
92
102
|
results.push('Using AGENTS.md as IDE config (Codex)');
|
|
@@ -94,17 +104,34 @@ function scaffold(dest, { tool, stack, projectName }) {
|
|
|
94
104
|
|
|
95
105
|
// 6. Generate AGENTS.md (universal standard for AI coding agents)
|
|
96
106
|
const agentsMd = generateAgentsMd(projectName, stackLabel);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
const agentsPath = path.join(dest, 'AGENTS.md');
|
|
108
|
+
if (fs.existsSync(agentsPath)) {
|
|
109
|
+
const altAgentsFile = getNextAgentsFilename(dest);
|
|
110
|
+
fs.writeFileSync(path.join(dest, altAgentsFile), agentsMd);
|
|
111
|
+
results.push(`AGENTS.md exists - created ${altAgentsFile} (review and merge manually if needed)`);
|
|
112
|
+
} else {
|
|
113
|
+
fs.writeFileSync(agentsPath, agentsMd);
|
|
114
|
+
results.push('Generated AGENTS.md');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 7. Create PROGRESS.md, BACKLOG.md, FEATURES.md (non-destructive)
|
|
118
|
+
const docsToCreate = {
|
|
119
|
+
'PROGRESS.md': `# Progress — ${projectName}\n\n## Sessions\n\n_No sessions yet. AI will log progress here._\n`,
|
|
120
|
+
'BACKLOG.md': `# Backlog — ${projectName}\n\n_Deferred items go here. AI adds items during sessions._\n`,
|
|
121
|
+
'FEATURES.md': `# Features — ${projectName}\n\n_User-facing feature documentation. AI updates this as features ship._\n`,
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
for (const [file, content] of Object.entries(docsToCreate)) {
|
|
125
|
+
const filePath = path.join(dest, file);
|
|
126
|
+
if (fs.existsSync(filePath)) {
|
|
127
|
+
const altFile = getNextBatonFilename(dest, file);
|
|
128
|
+
fs.writeFileSync(path.join(dest, altFile), content);
|
|
129
|
+
results.push(`${file} exists - created ${altFile} (review and merge manually if needed)`);
|
|
130
|
+
} else {
|
|
131
|
+
fs.writeFileSync(filePath, content);
|
|
132
|
+
results.push(`Created ${file}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
108
135
|
|
|
109
136
|
return results;
|
|
110
137
|
}
|
|
@@ -190,4 +217,24 @@ function copyDir(src, dest) {
|
|
|
190
217
|
}
|
|
191
218
|
}
|
|
192
219
|
|
|
220
|
+
function getNextAgentsFilename(dest) {
|
|
221
|
+
let index = 2;
|
|
222
|
+
let name = `AGENTS${index}.md`;
|
|
223
|
+
while (fs.existsSync(path.join(dest, name))) {
|
|
224
|
+
index += 1;
|
|
225
|
+
name = `AGENTS${index}.md`;
|
|
226
|
+
}
|
|
227
|
+
return name;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function getNextBatonFilename(dest, baseFile) {
|
|
231
|
+
let index = 1;
|
|
232
|
+
let name = `${baseFile}.baton.new`;
|
|
233
|
+
while (fs.existsSync(path.join(dest, name))) {
|
|
234
|
+
index += 1;
|
|
235
|
+
name = `${baseFile}.baton${index}.new`;
|
|
236
|
+
}
|
|
237
|
+
return name;
|
|
238
|
+
}
|
|
239
|
+
|
|
193
240
|
module.exports = { scaffold };
|
package/templates/BATON_v3.1.md
CHANGED
|
@@ -458,11 +458,12 @@ You're a technical co-founder, not a contractor. This is OUR product.
|
|
|
458
458
|
## Knowledge Lookup Order
|
|
459
459
|
|
|
460
460
|
When implementing with libraries/APIs:
|
|
461
|
-
1. **Check
|
|
462
|
-
2. **Check
|
|
463
|
-
3. **
|
|
464
|
-
4. **If
|
|
465
|
-
5. **
|
|
461
|
+
1. **Check `.ai-rules/tech-stack.md` FIRST** — condensed technical rules for this project
|
|
462
|
+
2. **Check `.ai-rules/patterns.md`** — project-specific knowledge cache
|
|
463
|
+
3. **Check `skills/` ONLY if needed** — for new problem areas not covered above
|
|
464
|
+
4. **If not found**, check installed version and docs
|
|
465
|
+
5. **If still unsure**, conduct web research
|
|
466
|
+
6. **After discovering quirks**, ADD to `.ai-rules/patterns.md` and update `.ai-rules/tech-stack.md` if you loaded a new skill
|
|
466
467
|
|
|
467
468
|
---
|
|
468
469
|
|
|
@@ -24,7 +24,7 @@ This project uses **Baton Protocol** — an AI orchestration system where:
|
|
|
24
24
|
|
|
25
25
|
| Priority | File | Purpose |
|
|
26
26
|
|----------|------|---------|
|
|
27
|
-
| 1 | `handoff/
|
|
27
|
+
| 1 | `handoff/SESSION_{{CURRENT_SESSION}}.md` | Current session tasks |
|
|
28
28
|
| 2 | `.ai-rules/project.md` | Project decisions & rules |
|
|
29
29
|
| 3 | `.ai-rules/tech-stack.md` | Stack patterns |
|
|
30
30
|
| 4 | `.ai-rules/patterns.md` | Discovered quirks (check first!) |
|
|
@@ -66,7 +66,7 @@ This project uses **Baton Protocol** — an AI orchestration system where:
|
|
|
66
66
|
1. Build passes
|
|
67
67
|
2. New features work
|
|
68
68
|
3. PROGRESS.md updated
|
|
69
|
-
4. handoff/SESSION_{
|
|
69
|
+
4. `handoff/SESSION_{{NEXT_SESSION}}.md` created
|
|
70
70
|
5. Ask: **"next"** or **"done"**?
|
|
71
71
|
|
|
72
72
|
---
|
|
@@ -5,7 +5,7 @@ This project uses Baton — an AI orchestration protocol.
|
|
|
5
5
|
|
|
6
6
|
## Start Each Session
|
|
7
7
|
|
|
8
|
-
1. Read `handoff/
|
|
8
|
+
1. Read `handoff/SESSION_{{CURRENT_SESSION}}.md` (current session)
|
|
9
9
|
2. Read `.ai-rules/` files for context
|
|
10
10
|
3. Run health check (build, verify previous work)
|
|
11
11
|
4. Ask: Any feedback? Blockers?
|
|
@@ -23,7 +23,7 @@ This project uses Baton — an AI orchestration protocol.
|
|
|
23
23
|
|
|
24
24
|
- Verify build passes
|
|
25
25
|
- Update PROGRESS.md
|
|
26
|
-
- Create `handoff/SESSION_{
|
|
26
|
+
- Create `handoff/SESSION_{{NEXT_SESSION}}.md`
|
|
27
27
|
- Ask user: **"next"** or **"done"**?
|
|
28
28
|
|
|
29
29
|
## Skills (Check Before Web Search)
|
|
@@ -35,7 +35,7 @@ This project uses Baton — an AI orchestration protocol.
|
|
|
35
35
|
|
|
36
36
|
## Key Files
|
|
37
37
|
|
|
38
|
-
- `handoff/
|
|
38
|
+
- `handoff/SESSION_{{CURRENT_SESSION}}.md` — Current session tasks
|
|
39
39
|
- `.ai-rules/project.md` — Decisions and rules
|
|
40
40
|
- `.ai-rules/patterns.md` — Discovered quirks
|
|
41
41
|
- `PROGRESS.md` — Session log
|