create-kuckit-app 2.0.2 → 2.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 (62) hide show
  1. package/README.md +24 -14
  2. package/package.json +3 -1
  3. package/templates/base/.claude/skills/beads/CLAUDE.md +87 -0
  4. package/templates/base/.claude/skills/beads/README.md +123 -0
  5. package/templates/base/.claude/skills/beads/SKILL.md +77 -715
  6. package/templates/base/.claude/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +61 -0
  7. package/templates/base/.claude/skills/beads/resources/AGENTS.md +62 -0
  8. package/templates/base/.claude/skills/beads/resources/ASYNC_GATES.md +175 -0
  9. package/templates/base/.claude/skills/beads/resources/BOUNDARIES.md +520 -0
  10. package/templates/base/.claude/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  11. package/templates/base/.claude/skills/beads/resources/CLI_REFERENCE.md +561 -0
  12. package/templates/base/.claude/skills/beads/resources/DEPENDENCIES.md +754 -0
  13. package/templates/base/.claude/skills/beads/resources/INTEGRATION_PATTERNS.md +438 -0
  14. package/templates/base/.claude/skills/beads/resources/ISSUE_CREATION.md +150 -0
  15. package/templates/base/.claude/skills/beads/resources/MOLECULES.md +370 -0
  16. package/templates/base/.claude/skills/beads/resources/PATTERNS.md +363 -0
  17. package/templates/base/.claude/skills/beads/resources/RESUMABILITY.md +239 -0
  18. package/templates/base/.claude/skills/beads/resources/STATIC_DATA.md +61 -0
  19. package/templates/base/.claude/skills/beads/resources/TROUBLESHOOTING.md +537 -0
  20. package/templates/base/.claude/skills/beads/resources/WORKFLOWS.md +638 -0
  21. package/templates/base/.claude/skills/beads/resources/WORKTREES.md +95 -0
  22. package/templates/base/.claude/skills/browser-skill/SKILL.md +72 -0
  23. package/templates/base/.claude/skills/knowledge/SKILL.md +155 -205
  24. package/templates/base/.claude/skills/knowledge/reference/doc-mapping.md +49 -0
  25. package/templates/base/.claude/skills/knowledge/reference/extraction-prompts.md +102 -0
  26. package/templates/base/.claude/skills/kuckit/SKILL.md +15 -9
  27. package/templates/base/.claude/skills/kuckit/references/MODULE-DEVELOPMENT.md +142 -0
  28. package/templates/base/.claude/skills/kuckit/references/PACKAGES.md +22 -17
  29. package/templates/base/.claude/skills/kuckit/references/PUBLISHING.md +92 -0
  30. package/templates/base/.claude/skills/module-testing/SKILL.md +1 -1
  31. package/templates/base/.claude/skills/planning/SKILL.md +26 -1
  32. package/templates/base/.env.example +1 -1
  33. package/templates/base/AGENTS.md +155 -418
  34. package/templates/base/apps/server/package.json +3 -3
  35. package/templates/base/apps/server/src/modules.ts +14 -1
  36. package/templates/base/apps/web/.env.example +1 -1
  37. package/templates/base/apps/web/package.json +2 -2
  38. package/templates/base/apps/web/src/components/dashboard/nav-user.tsx +3 -3
  39. package/templates/base/apps/web/src/components/ui/sidebar.tsx +2 -1
  40. package/templates/base/apps/web/src/routes/$.tsx +0 -1
  41. package/templates/base/apps/web/src/routes/__root.tsx +7 -1
  42. package/templates/base/apps/web/src/routes/dashboard.tsx +3 -1
  43. package/templates/base/apps/web/src/routes/index.tsx +17 -22
  44. package/templates/base/apps/web/src/routes/login.tsx +81 -50
  45. package/templates/base/apps/web/tsconfig.json +1 -0
  46. package/templates/base/docs/ARCHITECTURE.md +689 -0
  47. package/templates/base/docs/DEPENDENCY-INJECTION.md +871 -0
  48. package/templates/base/docs/DEPLOYMENT.md +573 -0
  49. package/templates/base/docs/INDEX.md +135 -0
  50. package/templates/base/docs/MIGRATION.md +989 -0
  51. package/templates/base/docs/MODULE_CSS.md +343 -0
  52. package/templates/base/docs/MODULE_TESTING.md +368 -0
  53. package/templates/base/docs/MULTI_AGENT_WORKFLOW.md +909 -0
  54. package/templates/base/docs/TESTING.md +579 -0
  55. package/templates/base/docs/TROUBLESHOOTING.md +360 -0
  56. package/templates/base/drizzle.config.ts +17 -1
  57. package/templates/base/package.json +8 -6
  58. package/templates/base/packages/items-module/AGENTS.md +3 -1
  59. package/templates/base/packages/items-module/package.json +4 -4
  60. package/templates/base/packages/items-module/src/server/adapters/{item.drizzle.ts → item.repository.ts} +1 -13
  61. package/templates/base/packages/items-module/src/server/module.ts +2 -1
  62. package/templates/base/packages/items-module/src/server/schema/item.ts +13 -0
@@ -0,0 +1,61 @@
1
+ # ADR-0001: Use bd prime as CLI Reference Source of Truth
2
+
3
+ ## Status
4
+
5
+ Accepted
6
+
7
+ ## Context
8
+
9
+ The beads skill maintained CLI reference documentation in multiple locations:
10
+
11
+ - `SKILL.md` inline (~2,000+ words of CLI reference)
12
+ - `references/CLI_REFERENCE.md` (~2,363 words)
13
+ - Scattered examples throughout resource files
14
+
15
+ This created:
16
+
17
+ - **Duplication**: Same commands documented 2-3 times
18
+ - **Drift risk**: Documentation can fall behind bd versions
19
+ - **Token overhead**: ~3,000+ tokens loaded even for simple operations
20
+
21
+ Meanwhile, bd provides `bd prime` which generates AI-optimized workflow context automatically.
22
+
23
+ ## Decision
24
+
25
+ Use `bd prime` as the single source of truth for CLI commands:
26
+
27
+ 1. **SKILL.md** contains only value-add content (decision frameworks, cognitive patterns)
28
+ 2. **CLI reference** points to `bd prime` (auto-loaded by hooks) and `bd --help`
29
+ 3. **Resources** provide depth for advanced features (molecules, agents, gates)
30
+
31
+ ## Consequences
32
+
33
+ ### Positive
34
+
35
+ - **Zero maintenance**: CLI docs auto-update with bd versions
36
+ - **DRY**: Single source of truth
37
+ - **Accurate**: No version drift possible
38
+ - **Lighter SKILL.md**: ~500 words vs ~3,300
39
+
40
+ ### Negative
41
+
42
+ - **Dependency on bd prime format**: If output changes significantly, may need adaptation
43
+ - **External tool requirement**: Skill assumes bd is installed
44
+
45
+ ## Implementation
46
+
47
+ Files restructured:
48
+
49
+ - `SKILL.md` — Reduced from 3,306 to ~500 words
50
+ - `references/` → `resources/` — Directory rename for consistency
51
+ - New resources added: `agents.md`, `async-gates.md`, `chemistry-patterns.md`, `worktrees.md`
52
+ - Existing resources preserved with path updates
53
+
54
+ ## Related
55
+
56
+ - Claude Code skill progressive disclosure guidelines
57
+ - Similar pattern implemented in other Claude Code skill ecosystems
58
+
59
+ ## Date
60
+
61
+ 2025-01-02
@@ -0,0 +1,62 @@
1
+ # Agent Beads
2
+
3
+ > Adapted from ACF beads skill
4
+
5
+ **v0.40+**: First-class support for agent tracking via `type=agent` beads.
6
+
7
+ ## When to Use Agent Beads
8
+
9
+ | Scenario | Agent Bead? | Why |
10
+ | ------------------------------ | ----------- | ------------------------------------ |
11
+ | Multi-agent orchestration | Yes | Track state, assign work via slots |
12
+ | Single Claude session | No | Overkill—just use regular beads |
13
+ | Long-running background agents | Yes | Heartbeats enable liveness detection |
14
+ | Role-based agent systems | Yes | Role beads define agent capabilities |
15
+
16
+ ## Bead Types
17
+
18
+ | Type | Purpose | Has Slots? |
19
+ | ------- | --------------------------- | ---------------- |
20
+ | `agent` | AI agent tracking | Yes (hook, role) |
21
+ | `role` | Role definitions for agents | No |
22
+
23
+ Other types (`task`, `bug`, `feature`, `epic`) remain unchanged.
24
+
25
+ ## State Machine
26
+
27
+ Agent beads track state for coordination:
28
+
29
+ ```
30
+ idle → spawning → running/working → done → idle
31
+
32
+ stuck → (needs intervention)
33
+ ```
34
+
35
+ **Key states**: `idle`, `spawning`, `running`, `working`, `stuck`, `done`, `stopped`, `dead`
36
+
37
+ The `dead` state is set by Witness (monitoring system) via heartbeat timeout—agents don't set this themselves.
38
+
39
+ ## Slot Architecture
40
+
41
+ Slots are named references from agent beads to other beads:
42
+
43
+ | Slot | Cardinality | Purpose |
44
+ | ------ | ----------- | ------------------------------- |
45
+ | `hook` | 0..1 | Current work attached to agent |
46
+ | `role` | 1 | Role definition bead (required) |
47
+
48
+ **Why slots?** They enforce constraints (one work item at a time) and enable queries like "what is agent X working on?" or "which agent has this work?"
49
+
50
+ ## Monitoring Integration
51
+
52
+ Agent beads enable:
53
+
54
+ - **Witness System**: Monitors agent health via heartbeats
55
+ - **State Coordination**: ZFC-compliant state machine for multi-agent systems
56
+ - **Work Attribution**: Track which agent owns which work
57
+
58
+ ## CLI Reference
59
+
60
+ Run `bd agent --help` for state/heartbeat/show commands.
61
+ Run `bd slot --help` for set/clear/show commands.
62
+ Run `bd create --help` for `--type=agent` and `--type=role` options.
@@ -0,0 +1,175 @@
1
+ # Async Gates for Workflow Coordination
2
+
3
+ > Adapted from ACF beads skill
4
+
5
+ `bd gate` provides async coordination primitives for cross-session and external-condition workflows. Gates are **wisps** (ephemeral issues) that block until a condition is met.
6
+
7
+ ---
8
+
9
+ ## Gate Types
10
+
11
+ | Type | Await Syntax | Use Case |
12
+ | ----- | ------------------ | ---------------------------------- |
13
+ | Human | `human:<prompt>` | Cross-session human approval |
14
+ | CI | `gh:run:<id>` | Wait for GitHub Actions completion |
15
+ | PR | `gh:pr:<id>` | Wait for PR merge/close |
16
+ | Timer | `timer:<duration>` | Deployment propagation delay |
17
+ | Mail | `mail:<pattern>` | Wait for matching email |
18
+
19
+ ---
20
+
21
+ ## Creating Gates
22
+
23
+ ```bash
24
+ # Human approval gate
25
+ bd gate create --await human:deploy-approval \
26
+ --title "Approve production deploy" \
27
+ --timeout 4h
28
+
29
+ # CI gate (GitHub Actions)
30
+ bd gate create --await gh:run:123456789 \
31
+ --title "Wait for CI" \
32
+ --timeout 30m
33
+
34
+ # PR merge gate
35
+ bd gate create --await gh:pr:42 \
36
+ --title "Wait for PR approval" \
37
+ --timeout 24h
38
+
39
+ # Timer gate (deployment propagation)
40
+ bd gate create --await timer:15m \
41
+ --title "Wait for deployment propagation"
42
+ ```
43
+
44
+ **Required options**:
45
+
46
+ - `--await <spec>` — Gate condition (see types above)
47
+ - `--timeout <duration>` — Recommended: prevents forever-open gates
48
+
49
+ **Optional**:
50
+
51
+ - `--title <text>` — Human-readable description
52
+ - `--notify <recipients>` — Email/beads addresses to notify
53
+
54
+ ---
55
+
56
+ ## Monitoring Gates
57
+
58
+ ```bash
59
+ bd gate list # All open gates
60
+ bd gate list --all # Include closed
61
+ bd gate show <gate-id> # Details for specific gate
62
+ bd gate eval # Auto-close elapsed/completed gates
63
+ bd gate eval --dry-run # Preview what would close
64
+ ```
65
+
66
+ **Auto-close behavior** (`bd gate eval`):
67
+
68
+ - `timer:*` — Closes when duration elapsed
69
+ - `gh:run:*` — Checks GitHub API, closes on success/failure
70
+ - `gh:pr:*` — Checks GitHub API, closes on merge/close
71
+ - `human:*` — Requires explicit `bd gate approve`
72
+
73
+ ---
74
+
75
+ ## Closing Gates
76
+
77
+ ```bash
78
+ # Human gates require explicit approval
79
+ bd gate approve <gate-id>
80
+ bd gate approve <gate-id> --comment "Reviewed and approved by Steve"
81
+
82
+ # Manual close (any gate)
83
+ bd gate close <gate-id>
84
+ bd gate close <gate-id> --reason "No longer needed"
85
+
86
+ # Auto-close via evaluation
87
+ bd gate eval
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Best Practices
93
+
94
+ 1. **Always set timeouts**: Prevents forever-open gates
95
+
96
+ ```bash
97
+ bd gate create --await human:... --timeout 24h
98
+ ```
99
+
100
+ 2. **Clear titles**: Title should indicate what's being gated
101
+
102
+ ```bash
103
+ --title "Approve Phase 2: Core Implementation"
104
+ ```
105
+
106
+ 3. **Eval periodically**: Run at session start to close elapsed gates
107
+
108
+ ```bash
109
+ bd gate eval
110
+ ```
111
+
112
+ 4. **Clean up obsolete gates**: Close gates that are no longer needed
113
+
114
+ ```bash
115
+ bd gate close <id> --reason "superseded by new approach"
116
+ ```
117
+
118
+ 5. **Check before creating**: Avoid duplicate gates
119
+ ```bash
120
+ bd gate list | grep "spec-myfeature"
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Gates vs Issues
126
+
127
+ | Aspect | Gates (Wisp) | Issues |
128
+ | ----------- | ----------------------------- | ------------------------- |
129
+ | Persistence | Ephemeral (not synced) | Permanent (synced to git) |
130
+ | Purpose | Block on external condition | Track work items |
131
+ | Lifecycle | Auto-close when condition met | Manual close |
132
+ | Visibility | `bd gate list` | `bd list` |
133
+ | Use case | CI, approval, timers | Tasks, bugs, features |
134
+
135
+ Gates are designed to be temporary coordination primitives—they exist only until their condition is satisfied.
136
+
137
+ ---
138
+
139
+ ## Troubleshooting
140
+
141
+ ### Gate won't close
142
+
143
+ ```bash
144
+ # Check gate details
145
+ bd gate show <gate-id>
146
+
147
+ # For gh:run gates, verify the run exists
148
+ gh run view <run-id>
149
+
150
+ # Force close if stuck
151
+ bd gate close <gate-id> --reason "manual override"
152
+ ```
153
+
154
+ ### Can't find gate ID
155
+
156
+ ```bash
157
+ # List all gates (including closed)
158
+ bd gate list --all
159
+
160
+ # Search by title pattern
161
+ bd gate list | grep "Phase 2"
162
+ ```
163
+
164
+ ### CI run ID detection fails
165
+
166
+ ```bash
167
+ # Check GitHub CLI auth
168
+ gh auth status
169
+
170
+ # List runs manually
171
+ gh run list --branch <branch>
172
+
173
+ # Use specific workflow
174
+ gh run list --workflow ci.yml --branch <branch>
175
+ ```