get-tbd 0.1.13 → 0.1.15

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 (57) hide show
  1. package/README.md +47 -28
  2. package/dist/bin.mjs +410 -170
  3. package/dist/bin.mjs.map +1 -1
  4. package/dist/cli.mjs +202 -94
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/docs/README.md +47 -28
  7. package/dist/docs/SKILL.md +61 -18
  8. package/dist/docs/guidelines/bun-monorepo-patterns.md +2096 -0
  9. package/dist/docs/guidelines/cli-agent-skill-patterns.md +79 -5
  10. package/dist/docs/guidelines/error-handling-rules.md +66 -0
  11. package/dist/docs/guidelines/pnpm-monorepo-patterns.md +2868 -0
  12. package/dist/docs/guidelines/release-notes-guidelines.md +140 -0
  13. package/dist/docs/guidelines/{sync-troubleshooting.md → tbd-sync-troubleshooting.md} +1 -1
  14. package/dist/docs/guidelines/typescript-sorting-patterns.md +234 -0
  15. package/dist/docs/guidelines/typescript-yaml-handling-rules.md +195 -0
  16. package/dist/docs/install/claude-header.md +13 -6
  17. package/dist/docs/shortcuts/standard/agent-handoff.md +1 -0
  18. package/dist/docs/shortcuts/standard/checkout-third-party-repo.md +50 -0
  19. package/dist/docs/shortcuts/standard/{cleanup-all.md → code-cleanup-all.md} +3 -2
  20. package/dist/docs/shortcuts/standard/{cleanup-update-docstrings.md → code-cleanup-docstrings.md} +1 -0
  21. package/dist/docs/shortcuts/standard/{cleanup-remove-trivial-tests.md → code-cleanup-tests.md} +1 -0
  22. package/dist/docs/shortcuts/standard/{commit-code.md → code-review-and-commit.md} +1 -0
  23. package/dist/docs/shortcuts/standard/coding-spike.md +54 -0
  24. package/dist/docs/shortcuts/standard/create-or-update-pr-simple.md +1 -0
  25. package/dist/docs/shortcuts/standard/create-or-update-pr-with-validation-plan.md +1 -0
  26. package/dist/docs/shortcuts/standard/implement-beads.md +1 -0
  27. package/dist/docs/shortcuts/standard/merge-upstream.md +1 -0
  28. package/dist/docs/shortcuts/standard/new-architecture-doc.md +1 -0
  29. package/dist/docs/shortcuts/standard/new-guideline.md +8 -0
  30. package/dist/docs/shortcuts/standard/new-plan-spec.md +1 -0
  31. package/dist/docs/shortcuts/standard/new-research-brief.md +1 -0
  32. package/dist/docs/shortcuts/standard/new-shortcut.md +27 -1
  33. package/dist/docs/shortcuts/standard/new-validation-plan.md +1 -0
  34. package/dist/docs/shortcuts/standard/plan-implementation-with-beads.md +1 -0
  35. package/dist/docs/shortcuts/standard/precommit-process.md +1 -0
  36. package/dist/docs/shortcuts/standard/review-code-python.md +1 -0
  37. package/dist/docs/shortcuts/standard/review-code-typescript.md +1 -0
  38. package/dist/docs/shortcuts/standard/review-code.md +1 -0
  39. package/dist/docs/shortcuts/standard/review-github-pr.md +89 -17
  40. package/dist/docs/shortcuts/standard/revise-all-architecture-docs.md +1 -0
  41. package/dist/docs/shortcuts/standard/revise-architecture-doc.md +1 -0
  42. package/dist/docs/shortcuts/standard/setup-github-cli.md +1 -0
  43. package/dist/docs/shortcuts/standard/sync-failure-recovery.md +6 -53
  44. package/dist/docs/shortcuts/standard/update-specs-status.md +1 -0
  45. package/dist/docs/shortcuts/standard/welcome-user.md +2 -1
  46. package/dist/docs/shortcuts/system/skill-brief.md +1 -1
  47. package/dist/docs/shortcuts/system/skill.md +48 -12
  48. package/dist/docs/skill-brief.md +1 -1
  49. package/dist/docs/tbd-design.md +13 -1
  50. package/dist/index.d.mts +20 -6
  51. package/dist/index.mjs +2 -2
  52. package/dist/{src-BfhjLZXE.mjs → src-Ct16P2Ox.mjs} +154 -22
  53. package/dist/src-Ct16P2Ox.mjs.map +1 -0
  54. package/dist/tbd +410 -170
  55. package/package.json +1 -1
  56. package/dist/docs/guidelines/typescript-monorepo-patterns.md +0 -72
  57. package/dist/src-BfhjLZXE.mjs.map +0 -1
@@ -183,6 +183,15 @@ This minimizes token overhead while maintaining full capability.
183
183
  Skill activation relies on **pure LLM reasoning**, not keyword matching or embeddings.
184
184
  Description quality directly impacts activation reliability.
185
185
 
186
+ **Activation Reliability Data** (from real-world testing across 200+ prompts):
187
+
188
+ | Approach | Success Rate |
189
+ | --- | --- |
190
+ | No optimization / vague descriptions | ~20% |
191
+ | Optimized descriptions with "Use when..." | ~50% |
192
+ | Descriptions with concrete examples | 72-90% |
193
+ | Forced evaluation hooks | 80-84% |
194
+
186
195
  **The Two-Part Rule**: Every description must answer:
187
196
 
188
197
  1. **What does it do?** (capabilities)
@@ -206,9 +215,55 @@ description: >
206
215
  **Writing Guidelines**:
207
216
 
208
217
  - Use third person always ("Processes files" not “I can help you”)
209
- - Include explicit trigger phrases reflecting user language
218
+ - Include explicit “Use when …” triggers with concrete scenarios
210
219
  - Be specific with keywords users would naturally say
211
220
  - State both capabilities AND activation conditions
221
+ - Front-load the most important trigger keywords in the first 50 characters
222
+ (descriptions may be truncated in large skill collections)
223
+
224
+ ### 2.4 Description Length and Budget Constraints
225
+
226
+ Claude Code has a **cumulative character budget** for all skill descriptions combined.
227
+ Understanding these limits is critical for CLIs that install multiple skills.
228
+
229
+ **Hard Limits**:
230
+
231
+ | Constraint | Limit | Notes |
232
+ | --- | --- | --- |
233
+ | Individual description | 1,024 characters | Per-skill maximum |
234
+ | Skill name | 64 characters | Lowercase, numbers, hyphens only |
235
+ | SKILL.md body | ~500 lines | Soft limit; use supporting files for more |
236
+ | **Cumulative budget** | ~15,000-16,000 chars | For ALL skill descriptions combined |
237
+
238
+ **Per-Skill Overhead**: Each skill consumes ~109 characters of XML overhead (tags, name,
239
+ location) plus the description length.
240
+
241
+ **Truncation Behavior**: When the cumulative budget is exceeded, skills are hidden:
242
+
243
+ | Skills Installed | Skills Visible | Hidden |
244
+ | --- | --- | --- |
245
+ | 63 | 42 | 33% |
246
+ | 92 | 36 | 60% |
247
+
248
+ **No warning is shown** when skills are truncated.
249
+ Run `/context` to check for excluded skills.
250
+
251
+ **Description Length Guidelines by Collection Size**:
252
+
253
+ | Skill Collection Size | Recommended Description Length |
254
+ | --- | --- |
255
+ | < 40 skills | Up to 1,024 characters (full limit) |
256
+ | 40-60 skills | ≤150 characters |
257
+ | 60+ skills | ≤130 characters |
258
+
259
+ **Override**: Set `SLASH_COMMAND_TOOL_CHAR_BUDGET` environment variable to increase the
260
+ limit.
261
+
262
+ **Meta-Skill Pattern**: For CLIs with many resources (50+), use a single meta-skill that
263
+ exposes resources via CLI commands rather than individual skills.
264
+ This consumes only one description slot (~200 chars) instead of 50+ slots that would
265
+ exceed the budget. See
266
+ [Skills vs Meta-Skill Architecture Research](../../project/research/current/research-skills-vs-meta-skill-architecture.md).
212
267
 
213
268
  * * *
214
269
 
@@ -351,7 +406,7 @@ resource name. This removes friction for agents.
351
406
 
352
407
  ```markdown
353
408
  ## Available Shortcuts
354
- - commit-code
409
+ - code-review-and-commit
355
410
  - create-or-update-pr-simple
356
411
  - new-plan-spec
357
412
  ```
@@ -363,7 +418,7 @@ resource name. This removes friction for agents.
363
418
 
364
419
  | Command | Purpose | Description |
365
420
  |---------|---------|-------------|
366
- | `mycli shortcut commit-code` | Commit Code | How to run pre-commit checks and commit |
421
+ | `mycli shortcut code-review-and-commit` | Commit Code | How to run pre-commit checks and commit |
367
422
  | `mycli shortcut create-pr` | Create PR | How to create a pull request |
368
423
  | `mycli shortcut new-plan-spec` | Plan Feature | How to create a planning specification |
369
424
  ```
@@ -642,6 +697,10 @@ Understanding when to use each is critical.
642
697
  + When to use it?
643
698
  11. **Write in third person**: “Processes files” not “I can help you”
644
699
  12. **Include explicit trigger phrases**: Match how users naturally describe needs
700
+ 13. **Front-load keywords**: Put most important triggers in first 50 characters
701
+ 14. **Respect cumulative budget**: All descriptions share a ~15K character limit
702
+ 15. **Use meta-skill pattern for 50+ resources**: One skill + CLI beats 50 individual
703
+ skills
645
704
 
646
705
  ### Self-Documentation
647
706
 
@@ -715,7 +774,17 @@ Understanding when to use each is critical.
715
774
 
716
775
  - [ ] Two-part description: capabilities + activation triggers
717
776
  - [ ] Third-person language only
718
- - [ ] Explicit trigger phrases matching user language
777
+ - [ ] Explicit “Use when …” trigger phrases matching user language
778
+ - [ ] Front-load important keywords in first 50 characters
779
+ - [ ] Description length appropriate for skill collection size (≤130 chars for 60+
780
+ skills)
781
+
782
+ **Budget Management** (for CLIs installing multiple skills)
783
+
784
+ - [ ] Calculate cumulative description size (descriptions + ~109 chars overhead each)
785
+ - [ ] Verify total stays under 15K character budget
786
+ - [ ] Use meta-skill pattern if resources exceed 50
787
+ - [ ] Run `/context` to verify skills aren’t being truncated
719
788
 
720
789
  **Context Management**
721
790
 
@@ -776,6 +845,10 @@ Understanding when to use each is critical.
776
845
  - Claude Code Skills Guide (Gist):
777
846
  https://gist.github.com/mellanon/50816550ecb5f3b239aa77eef7b8ed8d
778
847
  - Awesome Claude Skills: https://github.com/travisvn/awesome-claude-skills
848
+ - Skills Character Budget Research:
849
+ https://github.com/anthropics/claude-code/issues/11045
850
+ - Skill Activation Reliability Testing:
851
+ https://scottspence.com/posts/how-to-make-claude-code-skills-activate-reliably
779
852
 
780
853
  ### MCP Resources
781
854
 
@@ -795,4 +868,5 @@ Understanding when to use each is critical.
795
868
  - For TypeScript CLI implementation details, see
796
869
  `tbd guidelines typescript-cli-tool-rules`
797
870
  - For testing patterns, see `tbd guidelines general-testing-rules`
798
- - For monorepo setup, see `tbd guidelines typescript-monorepo-patterns`
871
+ - For monorepo setup, see `tbd guidelines pnpm-monorepo-patterns` or
872
+ `bun-monorepo-patterns`
@@ -446,6 +446,51 @@ catch (e) {
446
446
 
447
447
  **Tip**: Use `Error.cause` (ES2022) to chain errors without losing the original.
448
448
 
449
+ ### Anti-Pattern 9: Catch-and-Replace with Generic Error
450
+
451
+ **The pattern**: Catching an exception and throwing a new generic error that loses the
452
+ original message and stack trace.
453
+
454
+ ```typescript
455
+ // ❌ BAD: Original error details lost
456
+ try {
457
+ dataCtx = await loadDataContext(tbdRoot);
458
+ issues = await listIssues(dataCtx.dataSyncDir);
459
+ } catch {
460
+ throw new CLIError('Failed to read issues');
461
+ }
462
+ // User sees: "Error: Failed to read issues"
463
+ // Actual error was: "Implicit keys need to be on a single line at line 1..."
464
+ // (YAML parse error due to merge conflict markers in file)
465
+ ```
466
+
467
+ **Why it happens**: Developer wants to “clean up” the error message for users, assuming
468
+ the original error is too technical.
469
+ But this makes debugging impossible—the user can’t report the real problem, and even
470
+ `--debug` mode shows nothing useful.
471
+
472
+ **The fix**: Let errors propagate naturally, or include the original message.
473
+
474
+ ```typescript
475
+ // ✅ GOOD: Let errors propagate (preferred for most cases)
476
+ const dataCtx = await loadDataContext(tbdRoot);
477
+ const issues = await listIssues(dataCtx.dataSyncDir);
478
+ // Errors propagate to central handler which shows message + stack in debug mode
479
+
480
+ // ✅ GOOD: If you must catch, preserve the original message
481
+ try {
482
+ dataCtx = await loadDataContext(tbdRoot);
483
+ } catch (error) {
484
+ const message = error instanceof Error ? error.message : String(error);
485
+ throw new CLIError(`Failed to load data: ${message}`, { cause: error });
486
+ }
487
+ ```
488
+
489
+ **Key insight**: The central error handler should add debug info (stack traces,
490
+ context).
491
+ Individual commands should not catch-and-replace unless adding genuinely useful
492
+ context.
493
+
449
494
  ## Error Messages
450
495
 
451
496
  ### Make Errors Actionable
@@ -495,3 +540,24 @@ When implementing any operation that can fail:
495
540
  | Optimistic success | Search for success messages, trace back to verify guards |
496
541
  | Catch-and-continue | Audit catch blocks that log but don't throw/return |
497
542
  | Lost exception context | Grep for `new Error.*\.message` (wrapping without cause) |
543
+ | Catch-and-replace | Grep for `} catch {` followed by `throw new` (bare catch discards error) |
544
+
545
+ ### Finding Catch-and-Replace Anti-Pattern
546
+
547
+ This command finds catch blocks that throw new errors without using the original:
548
+
549
+ ```bash
550
+ # Find catch blocks that throw new errors without capturing the original
551
+ grep -rn -A2 "} catch {" --include="*.ts" | grep -B1 "throw new"
552
+ ```
553
+
554
+ **What to look for**: Any `} catch {` (no error variable) followed by
555
+ `throw new SomeError`. This means the original error is discarded.
556
+
557
+ **Acceptable patterns**:
558
+ - `throw new NotFoundError('Entity', id)` - Transforming “not found” to semantic error
559
+ - `throw new NotInitializedError(...)` - Expected failure with clear guidance
560
+
561
+ **Problematic patterns**:
562
+ - `throw new CLIError('Failed to do X')` - Loses WHY it failed
563
+ - `throw new Error('Operation failed')` - Generic message hides root cause