agentboot 0.1.0 → 0.2.0

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.
Files changed (66) hide show
  1. package/README.md +8 -7
  2. package/agentboot.config.json +4 -1
  3. package/package.json +2 -2
  4. package/scripts/cli.ts +42 -14
  5. package/scripts/compile.ts +30 -7
  6. package/scripts/dev-sync.ts +1 -1
  7. package/scripts/lib/config.ts +17 -1
  8. package/scripts/validate.ts +12 -7
  9. package/.github/ISSUE_TEMPLATE/persona-request.md +0 -62
  10. package/.github/ISSUE_TEMPLATE/quality-feedback.md +0 -67
  11. package/.github/workflows/cla.yml +0 -25
  12. package/.github/workflows/validate.yml +0 -49
  13. package/.idea/agentboot.iml +0 -9
  14. package/.idea/misc.xml +0 -6
  15. package/.idea/modules.xml +0 -8
  16. package/.idea/vcs.xml +0 -6
  17. package/CLAUDE.md +0 -230
  18. package/CONTRIBUTING.md +0 -168
  19. package/PERSONAS.md +0 -156
  20. package/core/instructions/baseline.instructions.md +0 -133
  21. package/core/instructions/security.instructions.md +0 -186
  22. package/core/personas/code-reviewer/SKILL.md +0 -175
  23. package/core/personas/security-reviewer/SKILL.md +0 -233
  24. package/core/personas/test-data-expert/SKILL.md +0 -234
  25. package/core/personas/test-generator/SKILL.md +0 -262
  26. package/core/traits/audit-trail.md +0 -182
  27. package/core/traits/confidence-signaling.md +0 -172
  28. package/core/traits/critical-thinking.md +0 -129
  29. package/core/traits/schema-awareness.md +0 -132
  30. package/core/traits/source-citation.md +0 -174
  31. package/core/traits/structured-output.md +0 -199
  32. package/docs/ci-cd-automation.md +0 -548
  33. package/docs/claude-code-reference/README.md +0 -21
  34. package/docs/claude-code-reference/agentboot-coverage.md +0 -484
  35. package/docs/claude-code-reference/feature-inventory.md +0 -906
  36. package/docs/cli-commands-audit.md +0 -112
  37. package/docs/cli-design.md +0 -924
  38. package/docs/concepts.md +0 -1117
  39. package/docs/config-schema-audit.md +0 -121
  40. package/docs/configuration.md +0 -645
  41. package/docs/delivery-methods.md +0 -758
  42. package/docs/developer-onboarding.md +0 -342
  43. package/docs/extending.md +0 -448
  44. package/docs/getting-started.md +0 -298
  45. package/docs/knowledge-layer.md +0 -464
  46. package/docs/marketplace.md +0 -822
  47. package/docs/org-connection.md +0 -570
  48. package/docs/plans/architecture.md +0 -2429
  49. package/docs/plans/design.md +0 -2018
  50. package/docs/plans/prd.md +0 -1862
  51. package/docs/plans/stack-rank.md +0 -261
  52. package/docs/plans/technical-spec.md +0 -2755
  53. package/docs/privacy-and-safety.md +0 -807
  54. package/docs/prompt-optimization.md +0 -1071
  55. package/docs/test-plan.md +0 -972
  56. package/docs/third-party-ecosystem.md +0 -496
  57. package/domains/compliance-template/README.md +0 -173
  58. package/domains/compliance-template/traits/compliance-aware.md +0 -228
  59. package/examples/enterprise/agentboot.config.json +0 -184
  60. package/examples/minimal/agentboot.config.json +0 -46
  61. package/tests/REGRESSION-PLAN.md +0 -705
  62. package/tests/TEST-PLAN.md +0 -111
  63. package/tests/cli.test.ts +0 -705
  64. package/tests/pipeline.test.ts +0 -608
  65. package/tests/validate.test.ts +0 -278
  66. package/tsconfig.json +0 -62
@@ -1,705 +0,0 @@
1
- # Regression Plan — Manual Testing
2
-
3
- Run before each release. Each scenario is in Gherkin format with copy-paste
4
- commands embedded in the steps. Run the commands, verify the output matches.
5
-
6
- Scenarios marked **CRITICAL** cannot be fully automated because they:
7
- - Require running outside the repo context (external cwd, path substitution)
8
- - Involve multi-step stateful operations where interrupted cleanup corrupts state
9
- - Verify safety behaviors that protect user data (hash checks, dry-run, no-overwrite)
10
- - Depend on environment-specific conditions (installed tools, filesystem layout)
11
-
12
- These MUST be run by a human before every release. Non-CRITICAL scenarios are
13
- covered by the automated suite (`npx vitest run`) and are included here as a
14
- secondary verification layer.
15
-
16
- Prerequisite for all scenarios:
17
-
18
- ```bash
19
- cd /path/to/agentboot
20
- npm install
21
- ```
22
-
23
- ---
24
-
25
- ## Feature: CLI entry point
26
-
27
- ### Scenario: Version output matches package.json
28
-
29
- ```gherkin
30
- Given the agentboot repo is checked out
31
- When the user runs the CLI with --version
32
- Then the output matches the version in package.json
33
- ```
34
-
35
- ```bash
36
- # When
37
- npx tsx scripts/cli.ts --version
38
-
39
- # Then — compare with:
40
- node -p "require('./package.json').version"
41
- # Both outputs must be identical
42
- ```
43
-
44
- ### Scenario: Help lists all Phase 2 commands
45
-
46
- ```gherkin
47
- Given the agentboot repo is checked out
48
- When the user runs the CLI with --help
49
- Then the output lists all implemented commands
50
- ```
51
-
52
- ```bash
53
- # When + Then
54
- npx tsx scripts/cli.ts --help | grep -E "build|validate|sync|setup|add|doctor|status|lint|uninstall|config"
55
- # Expected: all 10 commands appear (one per line)
56
- ```
57
-
58
- ---
59
-
60
- ## Feature: Full build pipeline
61
-
62
- ### Scenario: Clean build completes without errors
63
-
64
- ```gherkin
65
- Given dist/ does not exist
66
- When the user runs full-build
67
- Then validate passes all 4 checks
68
- And compile produces output for 3 platforms
69
- And dev-sync copies files to .claude/
70
- And the exit code is 0
71
- ```
72
-
73
- ```bash
74
- # Given
75
- rm -rf dist/
76
-
77
- # When
78
- npx tsx scripts/cli.ts full-build
79
-
80
- # Then — verify output contains:
81
- # "All 4 checks passed"
82
- # "Compiled 4 persona(s) × 3 platform(s)"
83
- # "Dev-synced N files across 3 platforms"
84
- # "full-build complete"
85
- ```
86
-
87
- ### Scenario: Build output has correct structure
88
-
89
- ```gherkin
90
- Given a full-build has completed
91
- When the user inspects dist/
92
- Then each platform has a core/ directory
93
- And claude has skills/, agents/, traits/, rules/
94
- And skill and copilot have persona directories
95
- ```
96
-
97
- ```bash
98
- # When + Then
99
- ls dist/skill/core/
100
- # Expected: code-reviewer/ security-reviewer/ test-data-expert/ test-generator/ instructions/ PERSONAS.md
101
-
102
- ls dist/claude/core/
103
- # Expected: agents/ skills/ traits/ rules/ CLAUDE.md PERSONAS.md
104
-
105
- ls dist/copilot/core/
106
- # Expected: code-reviewer/ security-reviewer/ test-data-expert/ test-generator/ instructions/ PERSONAS.md
107
- ```
108
-
109
- ---
110
-
111
- ## Feature: CC-native skill output (AB-18)
112
-
113
- ### Scenario: Skills have context:fork frontmatter
114
-
115
- ```gherkin
116
- Given a full-build has completed
117
- When the user reads a compiled CC skill file
118
- Then the frontmatter contains context: fork
119
- And the frontmatter contains a quoted agent reference
120
- And the description is quoted
121
- And there is exactly one frontmatter block
122
- ```
123
-
124
- ```bash
125
- # When + Then
126
- head -6 dist/claude/core/skills/review-code/SKILL.md
127
- # Expected:
128
- # ---
129
- # description: "Senior code reviewer — finds real bugs, not style nits"
130
- # context: fork
131
- # agent: "code-reviewer"
132
- # ---
133
-
134
- # Verify all 4 skills:
135
- for skill in review-code review-security gen-tests gen-testdata; do
136
- echo "=== $skill ==="
137
- head -6 "dist/claude/core/skills/$skill/SKILL.md"
138
- echo
139
- done
140
- # Each must have: description: "...", context: fork, agent: "..."
141
- ```
142
-
143
- ---
144
-
145
- ## Feature: CLAUDE.md with @imports (AB-19 + AB-77)
146
-
147
- ### Scenario: CLAUDE.md has correct imports and welcome fragment
148
-
149
- ```gherkin
150
- Given a full-build has completed
151
- When the user reads dist/claude/core/CLAUDE.md
152
- Then it contains @import directives for all 6 traits
153
- And instruction imports do NOT have double .md.md extension
154
- And it contains an Available Personas section with all 4 invocations
155
- ```
156
-
157
- ```bash
158
- # When
159
- cat dist/claude/core/CLAUDE.md
160
-
161
- # Then — verify:
162
- grep '@.claude/traits/' dist/claude/core/CLAUDE.md | wc -l
163
- # Expected: 6
164
-
165
- grep '@.claude/rules/' dist/claude/core/CLAUDE.md
166
- # Expected exactly:
167
- # @.claude/rules/baseline.instructions.md
168
- # @.claude/rules/security.instructions.md
169
- # NOT: @.claude/rules/baseline.instructions.md.md
170
-
171
- grep -c '.md.md' dist/claude/core/CLAUDE.md
172
- # Expected: 0
173
-
174
- grep '/review-code' dist/claude/core/CLAUDE.md
175
- grep '/review-security' dist/claude/core/CLAUDE.md
176
- grep '/gen-tests' dist/claude/core/CLAUDE.md
177
- grep '/gen-testdata' dist/claude/core/CLAUDE.md
178
- # All 4 must match
179
- ```
180
-
181
- ---
182
-
183
- ## Feature: Agent output (AB-17)
184
-
185
- ### Scenario: Agent files have quoted YAML frontmatter
186
-
187
- ```gherkin
188
- Given a full-build has completed
189
- When the user reads a compiled agent file
190
- Then name and description are double-quoted in YAML
191
- And model is only present if explicitly configured
192
- ```
193
-
194
- ```bash
195
- # When + Then
196
- head -4 dist/claude/core/agents/code-reviewer.md
197
- # Expected:
198
- # ---
199
- # name: "code-reviewer"
200
- # description: "Senior code reviewer — finds real bugs, not style nits"
201
- # ---
202
-
203
- # Verify no unquoted names across all agents:
204
- for agent in code-reviewer security-reviewer test-generator test-data-expert; do
205
- head -4 "dist/claude/core/agents/${agent}.md"
206
- echo "---"
207
- done
208
- # Every name: and description: value must be wrapped in double quotes
209
- ```
210
-
211
- ---
212
-
213
- ## Feature: Setup wizard (AB-33)
214
-
215
- ### Scenario: Setup scaffolds a new project — CRITICAL
216
-
217
- > Cannot be fully automated: requires running outside the repo context with
218
- > manual path substitution. Verifies the first-run experience for new users.
219
-
220
- ```gherkin
221
- Given a fresh empty directory
222
- When the user runs agentboot setup
223
- Then agentboot.config.json is created with valid JSON
224
- And repos.json is created as an empty array
225
- And core/ directory structure is created
226
- ```
227
-
228
- ```bash
229
- # Given
230
- export TESTDIR=$(mktemp -d)
231
-
232
- # When
233
- npx tsx scripts/cli.ts setup --skip-detect 2>&1
234
- # (run from the temp dir — cd or pass cwd)
235
- cd "$TESTDIR" && npx tsx /path/to/agentboot/scripts/cli.ts setup --skip-detect
236
-
237
- # Then
238
- cat "$TESTDIR/agentboot.config.json" | python3 -m json.tool > /dev/null && echo "Valid JSON"
239
- cat "$TESTDIR/repos.json"
240
- # Expected: []
241
-
242
- ls "$TESTDIR/core/"
243
- # Expected: gotchas/ instructions/ personas/ traits/
244
-
245
- # Cleanup
246
- rm -rf "$TESTDIR"
247
- ```
248
-
249
- ### Scenario: Setup does not overwrite existing config — CRITICAL
250
-
251
- > Cannot be fully automated: verifies safety behavior (no-overwrite) in an
252
- > external directory. A bug here silently destroys user configuration.
253
-
254
- ```gherkin
255
- Given a directory with an existing agentboot.config.json
256
- When the user runs agentboot setup
257
- Then the existing config is not overwritten
258
- And a warning is printed
259
- ```
260
-
261
- ```bash
262
- export TESTDIR=$(mktemp -d)
263
- echo '{"org":"do-not-overwrite"}' > "$TESTDIR/agentboot.config.json"
264
-
265
- cd "$TESTDIR" && npx tsx /path/to/agentboot/scripts/cli.ts setup
266
- # Expected output contains: "already exists"
267
-
268
- cat "$TESTDIR/agentboot.config.json"
269
- # Expected: {"org":"do-not-overwrite"}
270
-
271
- rm -rf "$TESTDIR"
272
- ```
273
-
274
- ---
275
-
276
- ## Feature: Add scaffolding (AB-34/35)
277
-
278
- ### Scenario: Add persona creates correct files
279
-
280
- ```gherkin
281
- Given the agentboot repo is checked out
282
- When the user runs add persona test-regression
283
- Then core/personas/test-regression/SKILL.md is created
284
- And core/personas/test-regression/persona.config.json is created
285
- And SKILL.md has trait injection markers
286
- And SKILL.md has all 5 style guide sections
287
- And persona.config.json has invocation "/test-regression"
288
- ```
289
-
290
- ```bash
291
- # When
292
- npx tsx scripts/cli.ts add persona test-regression
293
-
294
- # Then
295
- cat core/personas/test-regression/SKILL.md | head -10
296
- # Expected: frontmatter with name: test-regression
297
-
298
- grep 'traits:start' core/personas/test-regression/SKILL.md
299
- grep 'traits:end' core/personas/test-regression/SKILL.md
300
- # Both must match
301
-
302
- grep '## Identity' core/personas/test-regression/SKILL.md
303
- grep '## Setup' core/personas/test-regression/SKILL.md
304
- grep '## Rules' core/personas/test-regression/SKILL.md
305
- grep '## Output Format' core/personas/test-regression/SKILL.md
306
- grep '## What Not To Do' core/personas/test-regression/SKILL.md
307
- # All 5 must match
308
-
309
- cat core/personas/test-regression/persona.config.json | python3 -m json.tool
310
- # Expected: invocation is "/test-regression", traits is []
311
-
312
- # Cleanup
313
- rm -rf core/personas/test-regression
314
- ```
315
-
316
- ### Scenario: Add rejects invalid names
317
-
318
- ```gherkin
319
- Given the agentboot repo is checked out
320
- When the user runs add persona with an invalid name
321
- Then the command exits non-zero
322
- And an error message is printed
323
- ```
324
-
325
- ```bash
326
- npx tsx scripts/cli.ts add persona UPPERCASE 2>&1; echo "exit: $?"
327
- # Expected: error message + exit: 1
328
-
329
- npx tsx scripts/cli.ts add persona 1starts-with-digit 2>&1; echo "exit: $?"
330
- # Expected: error message + exit: 1
331
-
332
- npx tsx scripts/cli.ts add persona has_underscore 2>&1; echo "exit: $?"
333
- # Expected: error message + exit: 1
334
- ```
335
-
336
- ### Scenario: Add trait creates correct file
337
-
338
- ```gherkin
339
- Given the agentboot repo is checked out
340
- When the user runs add trait test-trait
341
- Then core/traits/test-trait.md is created
342
- And it has When to Apply, What to Do, What Not to Do sections
343
- ```
344
-
345
- ```bash
346
- npx tsx scripts/cli.ts add trait test-trait
347
- cat core/traits/test-trait.md
348
- # Expected: has ## When to Apply, ## What to Do, ## What Not to Do
349
-
350
- rm core/traits/test-trait.md
351
- ```
352
-
353
- ---
354
-
355
- ## Feature: Doctor (AB-36)
356
-
357
- ### Scenario: Doctor passes on healthy project
358
-
359
- ```gherkin
360
- Given the agentboot repo is checked out and built
361
- When the user runs doctor
362
- Then all checks pass
363
- And the exit code is 0
364
- ```
365
-
366
- ```bash
367
- npx tsx scripts/cli.ts doctor; echo "exit: $?"
368
- # Expected output contains:
369
- # ✓ Node.js
370
- # ✓ git
371
- # ✓ agentboot.config.json found
372
- # ✓ Config parses successfully
373
- # ✓ All 4 enabled personas found
374
- # ✓ All 6 enabled traits found
375
- # ✓ repos.json found
376
- # ✓ dist/ exists
377
- # All checks passed
378
- # exit: 0
379
- ```
380
-
381
- ---
382
-
383
- ## Feature: Status (AB-37)
384
-
385
- ### Scenario: Status shows project info
386
-
387
- ```gherkin
388
- Given the agentboot repo is checked out
389
- When the user runs status
390
- Then it shows the org name, version, personas, traits, and platforms
391
- ```
392
-
393
- ```bash
394
- npx tsx scripts/cli.ts status
395
- # Expected output contains:
396
- # Org: Your Organization
397
- # Version: 0.1.0
398
- # Personas: 4 enabled
399
- # Traits: 6 enabled
400
- # Platforms: skill, claude, copilot
401
- ```
402
-
403
- ### Scenario: Status JSON output is parseable
404
-
405
- ```gherkin
406
- Given the agentboot repo is checked out
407
- When the user runs status with --format json
408
- Then the output is valid JSON with org, personas, and repos fields
409
- ```
410
-
411
- ```bash
412
- npx tsx scripts/cli.ts status --format json | python3 -m json.tool > /dev/null && echo "Valid JSON"
413
- npx tsx scripts/cli.ts status --format json | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['org'], len(d['personas']), 'personas')"
414
- # Expected: your-org 4 personas
415
- ```
416
-
417
- ---
418
-
419
- ## Feature: Lint (AB-38)
420
-
421
- ### Scenario: Lint reports trait length warnings
422
-
423
- ```gherkin
424
- Given the agentboot repo is checked out
425
- When the user runs lint
426
- Then it reports trait-too-long warnings for traits exceeding 100 lines
427
- ```
428
-
429
- ```bash
430
- npx tsx scripts/cli.ts lint
431
- # Expected: shows "trait-too-long" WARN for multiple traits
432
- ```
433
-
434
- ### Scenario: Lint JSON output has no header
435
-
436
- ```gherkin
437
- Given the agentboot repo is checked out
438
- When the user runs lint with --format json
439
- Then the output starts with [ (valid JSON array, no header text)
440
- ```
441
-
442
- ```bash
443
- npx tsx scripts/cli.ts lint --format json --severity warn | head -c 1
444
- # Expected: [ (first character is opening bracket)
445
-
446
- npx tsx scripts/cli.ts lint --format json --severity warn | python3 -m json.tool > /dev/null && echo "Valid JSON"
447
- ```
448
-
449
- ### Scenario: Lint severity filtering works
450
-
451
- ```gherkin
452
- Given the agentboot repo is checked out
453
- When the user runs lint with --severity error
454
- Then only ERROR findings are shown (no WARN)
455
- ```
456
-
457
- ```bash
458
- npx tsx scripts/cli.ts lint --severity error
459
- # Expected: either "No issues found" or only ERROR-level findings (no WARN lines)
460
- ```
461
-
462
- ---
463
-
464
- ## Feature: Sync and uninstall (AB-15 + AB-45)
465
-
466
- ### Scenario: Sync to target repo then uninstall cleanly — CRITICAL
467
-
468
- > Cannot be fully automated: mutates repos.json in the live project. If
469
- > interrupted, repos.json is corrupted. Multi-step stateful flow where each
470
- > step depends on the previous. The only way to verify "clean removal" end-to-end.
471
-
472
- ```gherkin
473
- Given a fresh temporary directory as sync target
474
- And repos.json points to that directory
475
- When the user runs sync
476
- Then .claude/ is created with skills, rules, agents, traits
477
- And .agentboot-manifest.json is created with SHA-256 hashes
478
- When the user runs uninstall on that directory
479
- Then all synced files are removed
480
- And .agentboot-manifest.json is removed
481
- And no files remain in .claude/
482
- ```
483
-
484
- ```bash
485
- # Given
486
- export SYNC_TARGET=$(mktemp -d)
487
- cp repos.json repos.json.bak
488
- echo "[{\"path\":\"$SYNC_TARGET\",\"label\":\"regression-test\",\"platform\":\"claude\"}]" > repos.json
489
-
490
- # When (sync)
491
- npx tsx scripts/cli.ts sync
492
- # Expected: "Synced 1 repo"
493
-
494
- # Then (verify sync)
495
- ls "$SYNC_TARGET/.claude/skills/"
496
- # Expected: gen-testdata/ gen-tests/ review-code/ review-security/
497
-
498
- cat "$SYNC_TARGET/.claude/.agentboot-manifest.json" | python3 -c "import sys,json; d=json.load(sys.stdin); print(len(d['files']), 'files tracked')"
499
- # Expected: N files tracked (N > 10)
500
-
501
- # When (uninstall)
502
- npx tsx scripts/cli.ts uninstall --repo "$SYNC_TARGET"
503
- # Expected: "removed" lines for each file
504
-
505
- # Then (verify clean)
506
- ls "$SYNC_TARGET/.claude/" 2>&1
507
- # Expected: error or empty directory
508
-
509
- test -f "$SYNC_TARGET/.claude/.agentboot-manifest.json" && echo "FAIL: manifest still exists" || echo "PASS: manifest removed"
510
-
511
- # Cleanup
512
- mv repos.json.bak repos.json
513
- rm -rf "$SYNC_TARGET"
514
- ```
515
-
516
- ### Scenario: Uninstall skips modified files — CRITICAL
517
-
518
- > Cannot be fully automated: verifies the safety invariant that user-modified
519
- > files are never deleted. A regression here causes data loss. Requires human
520
- > verification that the specific modified file survives while others are removed.
521
-
522
- ```gherkin
523
- Given a synced target directory
524
- When one file is manually modified
525
- And the user runs uninstall
526
- Then the modified file is skipped with a warning
527
- And unmodified files are removed
528
- ```
529
-
530
- ```bash
531
- export SYNC_TARGET=$(mktemp -d)
532
- cp repos.json repos.json.bak
533
- echo "[{\"path\":\"$SYNC_TARGET\",\"label\":\"mod-test\",\"platform\":\"claude\"}]" > repos.json
534
-
535
- npx tsx scripts/cli.ts sync
536
-
537
- # Modify one file
538
- echo "<!-- manually edited -->" >> "$SYNC_TARGET/.claude/skills/review-code/SKILL.md"
539
-
540
- npx tsx scripts/cli.ts uninstall --repo "$SYNC_TARGET"
541
- # Expected output: "modified .claude/skills/review-code/SKILL.md (hash mismatch — skipping)"
542
-
543
- test -f "$SYNC_TARGET/.claude/skills/review-code/SKILL.md" && echo "PASS: modified file preserved" || echo "FAIL: modified file was deleted"
544
-
545
- mv repos.json.bak repos.json
546
- rm -rf "$SYNC_TARGET"
547
- ```
548
-
549
- ### Scenario: Uninstall dry-run removes nothing — CRITICAL
550
-
551
- > Cannot be fully automated: verifies the no-damage guarantee of dry-run mode.
552
- > A regression here means `--dry-run` silently deletes files. Requires human
553
- > verification that zero filesystem mutations occur.
554
-
555
- ```gherkin
556
- Given a synced target directory
557
- When the user runs uninstall with --dry-run
558
- Then no files are actually removed
559
- And the output says "would remove"
560
- ```
561
-
562
- ```bash
563
- export SYNC_TARGET=$(mktemp -d)
564
- cp repos.json repos.json.bak
565
- echo "[{\"path\":\"$SYNC_TARGET\",\"label\":\"dry-test\",\"platform\":\"claude\"}]" > repos.json
566
-
567
- npx tsx scripts/cli.ts sync
568
- npx tsx scripts/cli.ts uninstall --repo "$SYNC_TARGET" --dry-run
569
- # Expected: "would remove" (not "removed")
570
-
571
- test -f "$SYNC_TARGET/.claude/skills/review-code/SKILL.md" && echo "PASS: files still exist" || echo "FAIL: files were removed"
572
-
573
- mv repos.json.bak repos.json
574
- rm -rf "$SYNC_TARGET"
575
- ```
576
-
577
- ---
578
-
579
- ## Feature: Scope merging (AB-16)
580
-
581
- ### Scenario: Team overrides group overrides core — CRITICAL
582
-
583
- > Cannot be fully automated: creates temporary scope override files in dist/
584
- > and mutates repos.json. Scope merging is a core differentiator — the content
585
- > of the winning file must be human-verified, not just its existence. Interrupted
586
- > cleanup leaves orphan directories in dist/.
587
-
588
- ```gherkin
589
- Given dist/ has core, group, and team skill overrides for the same file
590
- And repos.json has a repo with group and team scope
591
- When the user runs sync
592
- Then the team-level file wins in the target repo
593
- ```
594
-
595
- ```bash
596
- # Given — create scope overrides in dist/
597
- mkdir -p dist/claude/groups/platform/skills/review-code
598
- echo -e "---\ndescription: group\n---\n\n# Group Override" > dist/claude/groups/platform/skills/review-code/SKILL.md
599
-
600
- mkdir -p dist/claude/teams/platform/api/skills/review-code
601
- echo -e "---\ndescription: team\n---\n\n# Team Override" > dist/claude/teams/platform/api/skills/review-code/SKILL.md
602
-
603
- export SYNC_TARGET=$(mktemp -d)
604
- cp repos.json repos.json.bak
605
- echo "[{\"path\":\"$SYNC_TARGET\",\"label\":\"scope-test\",\"platform\":\"claude\",\"group\":\"platform\",\"team\":\"api\"}]" > repos.json
606
-
607
- # When
608
- npx tsx scripts/cli.ts sync
609
-
610
- # Then
611
- grep "Team Override" "$SYNC_TARGET/.claude/skills/review-code/SKILL.md" && echo "PASS: team wins" || echo "FAIL: team did not win"
612
- grep "Group Override" "$SYNC_TARGET/.claude/skills/review-code/SKILL.md" && echo "FAIL: group should not be present" || echo "PASS: group overridden"
613
-
614
- # Cleanup
615
- mv repos.json.bak repos.json
616
- rm -rf "$SYNC_TARGET" dist/claude/groups dist/claude/teams
617
- ```
618
-
619
- ---
620
-
621
- ## Feature: Gotchas compilation (AB-52)
622
-
623
- ### Scenario: Gotcha file compiles to rules output
624
-
625
- ```gherkin
626
- Given a gotcha file exists in core/gotchas/
627
- When the user runs build
628
- Then the gotcha appears in dist/claude/core/rules/
629
- And the gotcha appears in dist/skill/core/gotchas/
630
- And README.md is not compiled
631
- ```
632
-
633
- ```bash
634
- # Given
635
- cat > core/gotchas/regression-gotcha.md << 'EOF'
636
- ---
637
- paths:
638
- - "**/*.test.ts"
639
- ---
640
-
641
- # Regression Gotcha
642
-
643
- - Always check for flaky assertions
644
- EOF
645
-
646
- # When
647
- npx tsx scripts/cli.ts build
648
-
649
- # Then
650
- test -f dist/claude/core/rules/regression-gotcha.md && echo "PASS: in claude rules" || echo "FAIL"
651
- test -f dist/skill/core/gotchas/regression-gotcha.md && echo "PASS: in skill gotchas" || echo "FAIL"
652
- test -f dist/claude/core/rules/README.md && echo "FAIL: README compiled" || echo "PASS: README filtered"
653
-
654
- # Cleanup
655
- rm core/gotchas/regression-gotcha.md
656
- rm -f dist/claude/core/rules/regression-gotcha.md dist/skill/core/gotchas/regression-gotcha.md
657
- ```
658
-
659
- ---
660
-
661
- ## Feature: Config command
662
-
663
- ### Scenario: Read top-level and nested config values
664
-
665
- ```gherkin
666
- Given the agentboot repo is checked out
667
- When the user runs config with a valid key
668
- Then the value is printed
669
- When the user runs config with a nested key
670
- Then the nested value is printed as JSON
671
- When the user runs config with an invalid key
672
- Then exit code is 1
673
- ```
674
-
675
- ```bash
676
- npx tsx scripts/cli.ts config org
677
- # Expected: your-org
678
-
679
- npx tsx scripts/cli.ts config personas.enabled
680
- # Expected: JSON array with 4 persona names
681
-
682
- npx tsx scripts/cli.ts config nonexistent 2>&1; echo "exit: $?"
683
- # Expected: "Key not found" + exit: 1
684
- ```
685
-
686
- ---
687
-
688
- ## Feature: Automated test suite
689
-
690
- ### Scenario: All automated tests pass
691
-
692
- ```gherkin
693
- Given the agentboot repo is checked out with dependencies installed
694
- When the user runs the test suite
695
- Then all tests pass
696
- And the test count is at least 100
697
- ```
698
-
699
- ```bash
700
- npx vitest run
701
- # Expected:
702
- # Test Files 3 passed (3)
703
- # Tests 107 passed (107)
704
- # (or higher — never lower)
705
- ```