@crouton-kit/crouter 0.1.8 → 0.2.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/dist/builtin-skills/.crouter-plugin/plugin.json +5 -0
- package/dist/builtin-skills/skills/crouter-development/marketplaces/SKILL.md +157 -0
- package/dist/builtin-skills/skills/crouter-development/plugins/SKILL.md +156 -0
- package/dist/builtin-skills/skills/crouter-development/skills/SKILL.md +166 -0
- package/dist/commands/doctor.js +54 -2
- package/dist/commands/plugin.js +4 -1
- package/dist/commands/skill.js +78 -7
- package/dist/core/artifact.js +14 -3
- package/dist/core/frontmatter.d.ts +1 -1
- package/dist/core/frontmatter.js +5 -0
- package/dist/core/resolver.d.ts +6 -2
- package/dist/core/resolver.js +208 -20
- package/dist/core/scope.d.ts +1 -0
- package/dist/core/scope.js +13 -2
- package/dist/prompts/agent.js +87 -27
- package/dist/prompts/plan.js +34 -1
- package/dist/prompts/review.js +48 -28
- package/dist/prompts/skill.js +291 -27
- package/dist/prompts/spec.js +24 -9
- package/dist/types.d.ts +6 -1
- package/dist/types.js +4 -0
- package/package.json +2 -2
package/dist/prompts/skill.js
CHANGED
|
@@ -5,6 +5,22 @@ Skills are markdown the agent loads on demand. **Audience: future LLM agent
|
|
|
5
5
|
sessions, not humans.** Write for the model: terse, decision-first, dense.
|
|
6
6
|
The CLI is the index — \`crtr skill list/search/grep\` discovers what's saved.
|
|
7
7
|
|
|
8
|
+
## Route by intent
|
|
9
|
+
|
|
10
|
+
If a query follows this prompt, route based on it. Run the suggested command
|
|
11
|
+
first, then act on its output.
|
|
12
|
+
|
|
13
|
+
- **Capture** ("save", "remember", "build context for", "make a skill"):
|
|
14
|
+
\`crtr skill create [topic]\` — picks template, hints next command.
|
|
15
|
+
- **Find** ("what do we have on X", "skill for Y"):
|
|
16
|
+
\`crtr skill search <query>\` → \`crtr skill show <name>\` on best hit.
|
|
17
|
+
- **Load by name** ("show me X"): \`crtr skill show <name>\`.
|
|
18
|
+
- **List all**: \`crtr skill list\`.
|
|
19
|
+
- **No intent given / query empty**: ask the user what they want before running.
|
|
20
|
+
|
|
21
|
+
Don't load \`create\` and \`template\` outputs in the same turn — \`create\` decides
|
|
22
|
+
the type, then call \`template\`.
|
|
23
|
+
|
|
8
24
|
Locations (resolution order):
|
|
9
25
|
1. **Scope-direct** \`<scope-root>/skills/<name>/SKILL.md\` → \`user:<name>\` / \`project:<name>\`
|
|
10
26
|
2. **Plugin skills** \`<plugin>/skills/<name>/SKILL.md\` → \`<scope>:<plugin>/<name>\`
|
|
@@ -32,14 +48,30 @@ crtr skill where <name> # {scope, plugin, path} JSON
|
|
|
32
48
|
## Author (progressive disclosure)
|
|
33
49
|
|
|
34
50
|
\`\`\`
|
|
35
|
-
crtr skill create [topic...]
|
|
36
|
-
crtr skill template <type> [topic]
|
|
37
|
-
crtr skill new <name>
|
|
51
|
+
crtr skill create [topic...] # pick a template type
|
|
52
|
+
crtr skill template <type> [topic] # workflow + skeleton for that type
|
|
53
|
+
crtr skill new <name> --type <type> # bare scaffold with typed frontmatter
|
|
38
54
|
\`\`\`
|
|
39
55
|
|
|
56
|
+
Five types — pick by what the agent does after reading:
|
|
57
|
+
|
|
58
|
+
- \`playbook\` — decide (judgment, heuristics, when-to-use)
|
|
59
|
+
- \`primer\` — navigate (codebase facts, architecture)
|
|
60
|
+
- \`reference\` — look up (stable facts, tables)
|
|
61
|
+
- \`runbook\` — execute (numbered procedure)
|
|
62
|
+
- \`freeform\` — none of the above (catchall)
|
|
63
|
+
|
|
40
64
|
Don't load \`create\` and \`template\` in the same turn — \`create\` decides the
|
|
41
65
|
type, then call \`template\`.
|
|
42
66
|
|
|
67
|
+
## Neighbors auto-append
|
|
68
|
+
|
|
69
|
+
\`crtr skill show <name>\` appends a \`## Neighbors\` section listing siblings
|
|
70
|
+
(same parent dir) and nested skills. Skill bodies should write \`## Related\`
|
|
71
|
+
**only** for cross-plugin or distant refs — within-plugin links are redundant.
|
|
72
|
+
|
|
73
|
+
Suppress with \`crtr skill show <name> --no-neighbors\`.
|
|
74
|
+
|
|
43
75
|
## Toggle
|
|
44
76
|
|
|
45
77
|
\`\`\`
|
|
@@ -65,11 +97,22 @@ ${topicLine}
|
|
|
65
97
|
|
|
66
98
|
## Templates
|
|
67
99
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- \`playbook\` —
|
|
71
|
-
|
|
72
|
-
- \`
|
|
100
|
+
Pick by what the agent does after reading the skill:
|
|
101
|
+
|
|
102
|
+
- \`playbook\` — **decide**. Judgment, heuristics, when-to-use / when-not-to-use.
|
|
103
|
+
Examples: skill-authoring, debugging methodology. Most skills are this.
|
|
104
|
+
- \`primer\` — **navigate**. Codebase/architectural facts. *"How does this
|
|
105
|
+
subsystem work, why, what are the gotchas."* Triggers parallel-explore.
|
|
106
|
+
- \`reference\` — **look up**. Stable facts: protocol fields, API surface,
|
|
107
|
+
glossaries, lookup tables. Source of truth is external (spec, docs).
|
|
108
|
+
- \`runbook\` — **execute**. Numbered procedure with decision points and
|
|
109
|
+
rollback. Examples: deploy, incident response, review workflow.
|
|
110
|
+
- \`freeform\` — **none of the above**. Catchall for decision records, prefs,
|
|
111
|
+
miscellany.
|
|
112
|
+
|
|
113
|
+
Litmus: *"when X, do Y"* → playbook. *"these are the fields of Y"* →
|
|
114
|
+
reference. *"step 1, step 2, step 3"* → runbook. *"how X is built inside
|
|
115
|
+
this repo"* → primer.
|
|
73
116
|
|
|
74
117
|
## Next
|
|
75
118
|
|
|
@@ -87,6 +130,7 @@ ${topicLine}
|
|
|
87
130
|
|
|
88
131
|
- Subsystem is small/self-evident → suggest CLAUDE.md note instead of primer.
|
|
89
132
|
- "Topic" is really a one-off task → don't capture; just do the work.
|
|
133
|
+
- Content is one-off lookup that lives elsewhere → link to it, don't mirror.
|
|
90
134
|
`;
|
|
91
135
|
}
|
|
92
136
|
export function skillTemplatePrompt(type, topic) {
|
|
@@ -95,9 +139,13 @@ export function skillTemplatePrompt(type, topic) {
|
|
|
95
139
|
return primerTemplatePrompt(topic);
|
|
96
140
|
if (t === 'playbook')
|
|
97
141
|
return playbookTemplatePrompt(topic);
|
|
142
|
+
if (t === 'reference')
|
|
143
|
+
return referenceTemplatePrompt(topic);
|
|
144
|
+
if (t === 'runbook')
|
|
145
|
+
return runbookTemplatePrompt(topic);
|
|
98
146
|
if (t === 'freeform')
|
|
99
147
|
return freeformTemplatePrompt(topic);
|
|
100
|
-
return `unknown template type: ${type}\nvalid: primer |
|
|
148
|
+
return `unknown template type: ${type}\nvalid: playbook | primer | reference | runbook | freeform\nrun \`crtr skill create\` to pick.\n`;
|
|
101
149
|
}
|
|
102
150
|
function topicLine(topic) {
|
|
103
151
|
return topic
|
|
@@ -160,7 +208,7 @@ assumptions.**
|
|
|
160
208
|
## 5. Scaffold
|
|
161
209
|
|
|
162
210
|
\`\`\`
|
|
163
|
-
crtr skill new <name> --scope project --description "<what+when, ≤250 chars, front-loaded triggers>"
|
|
211
|
+
crtr skill new <name> --type primer --scope project --description "<what+when, ≤250 chars, front-loaded triggers>"
|
|
164
212
|
\`\`\`
|
|
165
213
|
|
|
166
214
|
## 6. Write the body
|
|
@@ -188,11 +236,12 @@ Domain terms, invariants, non-obvious constraints.
|
|
|
188
236
|
|
|
189
237
|
## Gotchas
|
|
190
238
|
Non-obvious coupling. Looks-broken-but-isn't. Past footguns.
|
|
191
|
-
|
|
192
|
-
## Related
|
|
193
|
-
- \`<other-skill>\` — interaction
|
|
194
239
|
\`\`\`
|
|
195
240
|
|
|
241
|
+
**No \`## Related\` for within-plugin siblings** — the CLI auto-appends a
|
|
242
|
+
\`## Neighbors\` section on \`crtr skill show\`. Add a manual \`## Related\`
|
|
243
|
+
only for cross-plugin or distant refs.
|
|
244
|
+
|
|
196
245
|
**Density rules:**
|
|
197
246
|
- \`file:line\` over prose
|
|
198
247
|
- Tables where structure fits
|
|
@@ -213,7 +262,7 @@ Sharpen description if discovery misses. Cut body if bloated.
|
|
|
213
262
|
## Updates
|
|
214
263
|
|
|
215
264
|
If updating existing primer: diff draft vs current, call out changes + why
|
|
216
|
-
before writing.
|
|
265
|
+
before writing.
|
|
217
266
|
`;
|
|
218
267
|
}
|
|
219
268
|
function playbookTemplatePrompt(topic) {
|
|
@@ -259,7 +308,7 @@ PR over many small ones for refactors here, because review churn dominates"*
|
|
|
259
308
|
## 3. Scaffold
|
|
260
309
|
|
|
261
310
|
\`\`\`
|
|
262
|
-
crtr skill new <name> --scope <user|project> --description "<what it teaches + when to load, ≤250 chars, front-loaded triggers>"
|
|
311
|
+
crtr skill new <name> --type playbook --scope <user|project> --description "<what it teaches + when to load, ≤250 chars, front-loaded triggers>"
|
|
263
312
|
\`\`\`
|
|
264
313
|
|
|
265
314
|
## 4. Density rules
|
|
@@ -298,11 +347,12 @@ to read the whole thing for value, you've buried the judgment.
|
|
|
298
347
|
|
|
299
348
|
## Failure modes
|
|
300
349
|
- **<name>**: what it looks like; how to avoid
|
|
301
|
-
|
|
302
|
-
## Related
|
|
303
|
-
- \`<other-skill>\` — interaction
|
|
304
350
|
\`\`\`
|
|
305
351
|
|
|
352
|
+
**No \`## Related\` for within-plugin siblings** — the CLI auto-appends a
|
|
353
|
+
\`## Neighbors\` section on \`crtr skill show\`. Add a manual \`## Related\`
|
|
354
|
+
only for cross-plugin or distant refs.
|
|
355
|
+
|
|
306
356
|
## 6. Progressive disclosure
|
|
307
357
|
|
|
308
358
|
If deep reference is needed:
|
|
@@ -331,18 +381,17 @@ For canonical SKILL.md authoring (frontmatter fields, argument passing,
|
|
|
331
381
|
dynamic context, subagent forking, hooks):
|
|
332
382
|
|
|
333
383
|
\`\`\`
|
|
334
|
-
crtr skill show
|
|
384
|
+
crtr skill show crouter-development/skills
|
|
335
385
|
\`\`\`
|
|
336
386
|
|
|
337
|
-
The playbook above gives you structure + density rules.
|
|
338
|
-
covers the SKILL.md surface itself.
|
|
387
|
+
The playbook above gives you structure + density rules.
|
|
388
|
+
\`crouter-development/skills\` covers the SKILL.md surface itself.
|
|
339
389
|
|
|
340
390
|
## Constraints
|
|
341
391
|
|
|
342
|
-
- Topic fails litmus? → \`crtr skill template freeform\` or \`
|
|
392
|
+
- Topic fails litmus? → \`crtr skill template freeform\`, \`reference\`, or \`runbook\`.
|
|
343
393
|
- No unconfirmed heuristics — if not from user experience or clear principle,
|
|
344
394
|
leave it out.
|
|
345
|
-
- Update related skills' \`## Related\` if interactions exist.
|
|
346
395
|
`;
|
|
347
396
|
}
|
|
348
397
|
function freeformTemplatePrompt(topic) {
|
|
@@ -375,7 +424,7 @@ or grep, omit it.
|
|
|
375
424
|
## 3. Scope + name + scaffold
|
|
376
425
|
|
|
377
426
|
\`\`\`
|
|
378
|
-
crtr skill new <name> --scope <user|project> --description "<what+when, ≤250 chars, front-loaded triggers>"
|
|
427
|
+
crtr skill new <name> --type freeform --scope <user|project> --description "<what+when, ≤250 chars, front-loaded triggers>"
|
|
379
428
|
\`\`\`
|
|
380
429
|
|
|
381
430
|
## 4. Body — pick the closest skeleton
|
|
@@ -425,11 +474,226 @@ crtr skill search <keyword>
|
|
|
425
474
|
|
|
426
475
|
## Switch templates if needed
|
|
427
476
|
|
|
428
|
-
|
|
477
|
+
Content actually fits a typed template?
|
|
478
|
+
|
|
479
|
+
\`\`\`
|
|
480
|
+
crtr skill template playbook ${topic ? topic : '<topic>'} # decide
|
|
481
|
+
crtr skill template primer ${topic ? topic : '<topic>'} # navigate codebase
|
|
482
|
+
crtr skill template reference ${topic ? topic : '<topic>'} # look up stable facts
|
|
483
|
+
crtr skill template runbook ${topic ? topic : '<topic>'} # execute a procedure
|
|
484
|
+
\`\`\`
|
|
485
|
+
`;
|
|
486
|
+
}
|
|
487
|
+
function referenceTemplatePrompt(topic) {
|
|
488
|
+
return `# Reference — lookup-fact skill
|
|
489
|
+
|
|
490
|
+
**Audience: future LLM agent sessions.** Captures *stable lookup facts* an
|
|
491
|
+
agent will grep or scan: protocol fields, API surfaces, glossaries, enum
|
|
492
|
+
tables, status-code maps. Source of truth lives *outside* the skill (RFC,
|
|
493
|
+
spec, vendor docs); the skill is a fast in-repo cache.
|
|
494
|
+
|
|
495
|
+
${topicLine(topic)}
|
|
496
|
+
|
|
497
|
+
## Litmus test
|
|
498
|
+
|
|
499
|
+
> Would you *grep* this rather than *read* it?
|
|
500
|
+
|
|
501
|
+
If you'd skim end-to-end → it's not reference. If you'd jump straight to
|
|
502
|
+
the row you need → reference. If you'd make a decision after reading →
|
|
503
|
+
\`crtr skill template playbook\`. If you'd execute steps → \`runbook\`.
|
|
504
|
+
|
|
505
|
+
**Reference markers:** mostly tables · stable across releases · authoritative
|
|
506
|
+
source elsewhere · agent loads to *answer*, not to *think*.
|
|
507
|
+
|
|
508
|
+
## 1. Confirm reference, not playbook
|
|
509
|
+
|
|
510
|
+
Use \`AskUserQuestion\` (≤4, multi-choice, best-guess first):
|
|
511
|
+
|
|
512
|
+
- The lookup the agent will perform (e.g., "what does HTTP 423 mean")
|
|
513
|
+
- Stability: does this change every release? If yes, push back — link the
|
|
514
|
+
upstream source instead of mirroring it.
|
|
515
|
+
- Authoritative source URL (cite in the body)
|
|
516
|
+
|
|
517
|
+
Skip if the topic is clearly facts (RFCs, public API). **Never invent
|
|
518
|
+
field/flag/code values** — pull verbatim from source.
|
|
519
|
+
|
|
520
|
+
## 2. Scope + name
|
|
521
|
+
|
|
522
|
+
- **Scope**: \`user\` for cross-project facts. \`project\` for repo-specific.
|
|
523
|
+
- **Name**: noun-phrase. \`http-status-codes\` not \`learn-http-status\`.
|
|
524
|
+
- Check \`crtr skill where <name>\`.
|
|
525
|
+
|
|
526
|
+
## 3. Scaffold
|
|
527
|
+
|
|
528
|
+
\`\`\`
|
|
529
|
+
crtr skill new <name> --type reference --scope <user|project> --description "<what to look up + when to load, ≤250 chars>"
|
|
530
|
+
\`\`\`
|
|
531
|
+
|
|
532
|
+
## 4. Density rules
|
|
533
|
+
|
|
534
|
+
Reference skills are *load and scan*, not *load and read*. Optimize for jump-to-row.
|
|
535
|
+
|
|
536
|
+
- Tables for anything multi-row. Columns: most-queried field first.
|
|
537
|
+
- One topic per file. Split if it doesn't fit one screen.
|
|
538
|
+
- Source URL at the top — agent verifies before trusting cached facts.
|
|
539
|
+
- No prose paragraphs longer than 2 lines.
|
|
540
|
+
- Skip *why* — playbooks teach why. Reference teaches what.
|
|
541
|
+
|
|
542
|
+
## 5. Body skeleton
|
|
543
|
+
|
|
544
|
+
\`\`\`markdown
|
|
545
|
+
# <topic> reference
|
|
546
|
+
|
|
547
|
+
**Source of truth:** <URL or spec name>
|
|
548
|
+
**Last verified:** <date — when an agent should re-check>
|
|
549
|
+
|
|
550
|
+
## <table 1 title>
|
|
551
|
+
| <field> | <value> | <notes> |
|
|
552
|
+
|---------|---------|---------|
|
|
553
|
+
| … | … | … |
|
|
554
|
+
|
|
555
|
+
## <table 2 title>
|
|
556
|
+
…
|
|
557
|
+
|
|
558
|
+
## Edge cases / gotchas
|
|
559
|
+
- Brief bullets. *What* is misleading, not *why*.
|
|
560
|
+
\`\`\`
|
|
561
|
+
|
|
562
|
+
**No \`## Related\` for within-plugin siblings** — auto-appended by the CLI.
|
|
563
|
+
|
|
564
|
+
## 6. Progressive disclosure
|
|
565
|
+
|
|
566
|
+
If reference is large, split:
|
|
567
|
+
|
|
568
|
+
\`\`\`
|
|
569
|
+
<skill-dir>/
|
|
570
|
+
SKILL.md # top-level index + most-queried table
|
|
571
|
+
full-table.md # the full set
|
|
572
|
+
examples.md # rarely-needed worked examples
|
|
573
|
+
\`\`\`
|
|
574
|
+
|
|
575
|
+
SKILL.md links to siblings (\`see [full-table.md](full-table.md)\`).
|
|
576
|
+
|
|
577
|
+
## 7. Verify
|
|
429
578
|
|
|
430
579
|
\`\`\`
|
|
431
|
-
crtr skill
|
|
432
|
-
crtr skill
|
|
580
|
+
crtr skill where <name>
|
|
581
|
+
crtr skill show <name>
|
|
582
|
+
crtr skill search <keyword>
|
|
433
583
|
\`\`\`
|
|
584
|
+
|
|
585
|
+
Search must surface the skill on a typical lookup query. Sharpen the
|
|
586
|
+
description if it doesn't.
|
|
587
|
+
|
|
588
|
+
## Constraints
|
|
589
|
+
|
|
590
|
+
- No invented values. If you can't cite the source, leave the row out.
|
|
591
|
+
- Topic teaches *judgment*, not facts? → \`crtr skill template playbook\`.
|
|
592
|
+
- Topic is a *procedure*? → \`crtr skill template runbook\`.
|
|
593
|
+
- Source updates faster than you'll update the skill? → don't capture; link.
|
|
594
|
+
`;
|
|
595
|
+
}
|
|
596
|
+
function runbookTemplatePrompt(topic) {
|
|
597
|
+
return `# Runbook — procedure skill
|
|
598
|
+
|
|
599
|
+
**Audience: future LLM agent sessions.** Captures a *procedure* the agent
|
|
600
|
+
executes: numbered steps, decision points, verification, rollback. Examples:
|
|
601
|
+
deploy, incident response, review workflow, release cut.
|
|
602
|
+
|
|
603
|
+
${topicLine(topic)}
|
|
604
|
+
|
|
605
|
+
## Litmus test
|
|
606
|
+
|
|
607
|
+
> After loading this, does the agent *do steps in order*?
|
|
608
|
+
|
|
609
|
+
If yes → runbook. If the agent makes a decision and stops → \`playbook\`. If
|
|
610
|
+
the agent looks up a value → \`reference\`. If neither fits → \`freeform\`.
|
|
611
|
+
|
|
612
|
+
**Runbook markers:** numbered steps · ordering matters · has rollback or
|
|
613
|
+
verification · maps an outcome to a known sequence.
|
|
614
|
+
|
|
615
|
+
## 1. Capture the procedure
|
|
616
|
+
|
|
617
|
+
Use \`AskUserQuestion\` (≤4, multi-choice, best-guess first):
|
|
618
|
+
|
|
619
|
+
- The trigger (when does the agent run this?)
|
|
620
|
+
- Steps in order — explicit, atomic. *"Update X"* is not atomic; *"run
|
|
621
|
+
\\\`pnpm db:migrate\\\` and confirm exit 0"* is.
|
|
622
|
+
- Decision points within the sequence (when does the agent branch?)
|
|
623
|
+
- Rollback / verification (how to confirm success; how to undo on failure)
|
|
624
|
+
|
|
625
|
+
Push back on vagueness. *"Deploy to prod"* is a label; *"run \\\`pnpm build\\\`,
|
|
626
|
+
push to \\\`main\\\`, wait for green CI, click promote"* is a runbook step.
|
|
627
|
+
|
|
628
|
+
## 2. Scope + name
|
|
629
|
+
|
|
630
|
+
- **Scope**: \`project\` for repo-specific procedures. \`user\` for cross-project.
|
|
631
|
+
- **Name**: verb-phrase. \`deploy-to-prod\` not \`production-deployment-guide\`.
|
|
632
|
+
- Check \`crtr skill where <name>\`.
|
|
633
|
+
|
|
634
|
+
## 3. Scaffold
|
|
635
|
+
|
|
636
|
+
\`\`\`
|
|
637
|
+
crtr skill new <name> --type runbook --scope <user|project> --description "<when to run + outcome, ≤250 chars, front-loaded trigger>"
|
|
638
|
+
\`\`\`
|
|
639
|
+
|
|
640
|
+
## 4. Density rules
|
|
641
|
+
|
|
642
|
+
- Steps are commands, not advice. Each step is something the agent can verify.
|
|
643
|
+
- Decision points get explicit branches, not "use judgment."
|
|
644
|
+
- Verification belongs in-line, after the step that produces the change.
|
|
645
|
+
- Rollback is mandatory if the procedure changes prod state.
|
|
646
|
+
|
|
647
|
+
## 5. Body skeleton
|
|
648
|
+
|
|
649
|
+
\`\`\`markdown
|
|
650
|
+
# <procedure>
|
|
651
|
+
|
|
652
|
+
## When to run
|
|
653
|
+
- <trigger>
|
|
654
|
+
|
|
655
|
+
## Pre-flight
|
|
656
|
+
- [ ] <thing that must be true before starting>
|
|
657
|
+
|
|
658
|
+
## Steps
|
|
659
|
+
|
|
660
|
+
1. **<atomic action>** — \\\`<command>\\\`
|
|
661
|
+
Verify: <observation that confirms success>
|
|
662
|
+
If <error condition>: <what to do>
|
|
663
|
+
|
|
664
|
+
2. **<atomic action>** — …
|
|
665
|
+
|
|
666
|
+
## Decision points
|
|
667
|
+
|
|
668
|
+
- After step N, if X then go to step M; else continue.
|
|
669
|
+
|
|
670
|
+
## Verification (post-flight)
|
|
671
|
+
- [ ] <how to confirm the procedure succeeded end-to-end>
|
|
672
|
+
|
|
673
|
+
## Rollback
|
|
674
|
+
1. <reverse-order undo steps with their own verification>
|
|
675
|
+
\`\`\`
|
|
676
|
+
|
|
677
|
+
**No \`## Related\` for within-plugin siblings** — auto-appended by the CLI.
|
|
678
|
+
|
|
679
|
+
## 6. Verify
|
|
680
|
+
|
|
681
|
+
\`\`\`
|
|
682
|
+
crtr skill where <name>
|
|
683
|
+
crtr skill show <name>
|
|
684
|
+
crtr skill search <keyword>
|
|
685
|
+
\`\`\`
|
|
686
|
+
|
|
687
|
+
Walk through the runbook mentally. Each step verifiable? Each decision
|
|
688
|
+
explicit? Rollback covers the state changes? If any answer is no, fix
|
|
689
|
+
before shipping.
|
|
690
|
+
|
|
691
|
+
## Constraints
|
|
692
|
+
|
|
693
|
+
- Steps without verification are wishes. Add the verify line or cut the step.
|
|
694
|
+
- "Use your judgment at step 4" → either turn step 4 into a playbook
|
|
695
|
+
reference, or write the decision criteria explicitly.
|
|
696
|
+
- A procedure that's actually one command isn't a runbook — make it a
|
|
697
|
+
CLAUDE.md note.
|
|
434
698
|
`;
|
|
435
699
|
}
|
package/dist/prompts/spec.js
CHANGED
|
@@ -12,6 +12,10 @@ Specs for this directory live at:
|
|
|
12
12
|
If a relevant prior spec already exists there, read it first. Treat an
|
|
13
13
|
existing spec as the starting point — extend or revise rather than restart.
|
|
14
14
|
|
|
15
|
+
**Anti-pattern: do not fish for clarifications upfront.** Draft a concrete
|
|
16
|
+
spec first based on your investigation, *then* iterate. A specific draft the
|
|
17
|
+
user can react to converges faster than a list of questions in a vacuum.
|
|
18
|
+
|
|
15
19
|
## Phase 1: Shape
|
|
16
20
|
|
|
17
21
|
Build a comprehensive picture of the problem and the relevant code. Surface
|
|
@@ -36,18 +40,25 @@ should be:
|
|
|
36
40
|
- **Behavior-focused** — describes what the system does, not how.
|
|
37
41
|
- **Scoped** — covers one observable behavior.
|
|
38
42
|
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
Group requirements by capability. Plain English is fine for most things. If
|
|
44
|
+
a requirement is conditional or stateful enough that phrasing gets fuzzy,
|
|
45
|
+
EARS templates can sharpen it (\`When <trigger>, the system shall <behavior>\`
|
|
46
|
+
or \`If <condition>, then the system shall <response>\`) — reach for them
|
|
47
|
+
when they earn their keep, not by default.
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
For larger / multi-component designs, before moving on it's worth walking
|
|
50
|
+
the design end-to-end as a sanity check: at each step from trigger to
|
|
51
|
+
final state, ask whether preconditions, state, failure handling, and
|
|
52
|
+
handoffs between components are actually specified. Skip this for small
|
|
53
|
+
self-contained specs — it's the kind of thing that catches bugs in the
|
|
54
|
+
seams, so apply it where there are seams.
|
|
44
55
|
|
|
45
56
|
## Phase 3: Deepen
|
|
46
57
|
|
|
47
58
|
- Read the critical files identified during Phase 1 to deepen your
|
|
48
59
|
understanding before locking decisions.
|
|
49
|
-
- Reconcile
|
|
50
|
-
|
|
60
|
+
- Reconcile requirements against the shape — if a requirement reveals a gap
|
|
61
|
+
in the design, refine the design before saving.
|
|
51
62
|
- Use **AskUserQuestion** for any remaining ambiguities. Bias toward asking
|
|
52
63
|
when a decision is non-obvious or when the user's intent is genuinely
|
|
53
64
|
unclear.
|
|
@@ -74,10 +85,10 @@ outcome. Include relevant constraints — user goals, stakeholders, deadlines.>
|
|
|
74
85
|
they were chosen. Reference existing code with \`file_path:line_number\`.>
|
|
75
86
|
|
|
76
87
|
## Requirements
|
|
77
|
-
<grouped behavioral requirements. Each one testable.>
|
|
88
|
+
<grouped behavioral requirements. Each one testable. Plain English is fine.>
|
|
78
89
|
|
|
79
90
|
### <Capability A>
|
|
80
|
-
-
|
|
91
|
+
- <one observable behavior>
|
|
81
92
|
- ...
|
|
82
93
|
|
|
83
94
|
### <Capability B>
|
|
@@ -96,7 +107,11 @@ EOF
|
|
|
96
107
|
(\`crtr spec --name auth/refresh-tokens\`).
|
|
97
108
|
- The file lands at \`${specsDir}/<name>.md\`.
|
|
98
109
|
- If you are running inside tmux, the saved spec auto-opens in a side pane
|
|
99
|
-
via termrender.
|
|
110
|
+
(or a new window when the current one is full) via termrender. The pane
|
|
111
|
+
is **live** — it re-renders whenever the file changes on disk. For small
|
|
112
|
+
tweaks, **edit the file path directly with the Edit tool** instead of
|
|
113
|
+
re-running the heredoc save; the pane updates in place. Re-save via
|
|
114
|
+
heredoc only when you want to re-trigger the reviewer.
|
|
100
115
|
|
|
101
116
|
## Phase 5: Review
|
|
102
117
|
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Scope = 'user' | 'project';
|
|
1
|
+
export type Scope = 'user' | 'project' | 'builtin';
|
|
2
2
|
export declare const ExitCode: {
|
|
3
3
|
readonly SUCCESS: 0;
|
|
4
4
|
readonly GENERAL: 1;
|
|
@@ -71,10 +71,14 @@ export interface ScopeState {
|
|
|
71
71
|
last_self_check?: string;
|
|
72
72
|
bootstrap_done?: boolean;
|
|
73
73
|
}
|
|
74
|
+
export declare const SKILL_TYPES: readonly ["playbook", "primer", "reference", "runbook", "freeform"];
|
|
75
|
+
export type SkillType = (typeof SKILL_TYPES)[number];
|
|
76
|
+
export declare function isSkillType(v: unknown): v is SkillType;
|
|
74
77
|
export interface SkillFrontmatter {
|
|
75
78
|
name: string;
|
|
76
79
|
description?: string;
|
|
77
80
|
keywords?: string[];
|
|
81
|
+
type?: SkillType;
|
|
78
82
|
}
|
|
79
83
|
export interface Skill {
|
|
80
84
|
name: string;
|
|
@@ -92,6 +96,7 @@ export interface InstalledPlugin {
|
|
|
92
96
|
root: string;
|
|
93
97
|
manifest: PluginManifest;
|
|
94
98
|
enabled: boolean;
|
|
99
|
+
builtin?: boolean;
|
|
95
100
|
sourceMarketplace?: string;
|
|
96
101
|
version?: string;
|
|
97
102
|
}
|
package/dist/types.js
CHANGED
|
@@ -7,6 +7,10 @@ export const ExitCode = {
|
|
|
7
7
|
NETWORK: 5,
|
|
8
8
|
};
|
|
9
9
|
export const SCHEMA_VERSION = 1;
|
|
10
|
+
export const SKILL_TYPES = ['playbook', 'primer', 'reference', 'runbook', 'freeform'];
|
|
11
|
+
export function isSkillType(v) {
|
|
12
|
+
return typeof v === 'string' && SKILL_TYPES.includes(v);
|
|
13
|
+
}
|
|
10
14
|
export const PLUGIN_MANIFEST_DIR = '.crouter-plugin';
|
|
11
15
|
export const PLUGIN_MANIFEST_FILE = 'plugin.json';
|
|
12
16
|
export const MARKETPLACE_MANIFEST_DIR = '.crouter-marketplace';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crouton-kit/crouter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "crtr — fast access to skills, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"bin"
|
|
24
24
|
],
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsc",
|
|
26
|
+
"build": "tsc && rm -rf dist/builtin-skills && cp -R src/builtin-skills dist/builtin-skills",
|
|
27
27
|
"dev": "tsx src/cli.ts",
|
|
28
28
|
"link": "npm link",
|
|
29
29
|
"prepublishOnly": "npm run build"
|