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,95 @@
1
+ # Git Worktree Support
2
+
3
+ > Adapted from ACF beads skill
4
+
5
+ **v0.40+**: First-class worktree management via `bd worktree` command.
6
+
7
+ ## When to Use Worktrees
8
+
9
+ | Scenario | Worktree? | Why |
10
+ | -------------------- | --------- | ------------------------------------------- |
11
+ | Parallel agent work | Yes | Each agent gets isolated working directory |
12
+ | Long-running feature | Yes | Avoids stash/switch dance for interruptions |
13
+ | Quick branch switch | No | `git switch` is simpler |
14
+ | PR review isolation | Yes | Review without disturbing main work |
15
+
16
+ ## Why `bd worktree` over `git worktree`
17
+
18
+ **Always use `bd worktree`** instead of raw `git worktree` commands.
19
+
20
+ ```bash
21
+ bd worktree create .worktrees/{name} --branch feature/{name}
22
+ bd worktree remove .worktrees/{name}
23
+ ```
24
+
25
+ **Why?** `bd worktree` auto-configures:
26
+
27
+ - Beads database redirect files
28
+ - Proper gitignore entries
29
+ - Daemon bypass for worktree operations
30
+
31
+ ## Architecture
32
+
33
+ All worktrees share one `.beads/` database via redirect files:
34
+
35
+ ```
36
+ main-repo/
37
+ ├── .beads/ ← Single source of truth
38
+ └── .worktrees/
39
+ ├── feature-a/
40
+ │ └── .beads ← Redirect file (not directory)
41
+ └── feature-b/
42
+ └── .beads ← Redirect file
43
+ ```
44
+
45
+ **Key insight**: Daemon auto-bypasses for wisp operations in worktrees.
46
+
47
+ ## Commands
48
+
49
+ ```bash
50
+ # Create worktree with beads support
51
+ bd worktree create .worktrees/my-feature --branch feature/my-feature
52
+
53
+ # List worktrees
54
+ bd worktree list
55
+
56
+ # Show worktree info
57
+ bd worktree info .worktrees/my-feature
58
+
59
+ # Remove worktree cleanly
60
+ bd worktree remove .worktrees/my-feature
61
+ ```
62
+
63
+ ## Debugging
64
+
65
+ When beads commands behave unexpectedly in a worktree:
66
+
67
+ ```bash
68
+ bd where # Shows actual .beads location (follows redirects)
69
+ bd doctor --deep # Validates graph integrity across all refs
70
+ ```
71
+
72
+ ## Protected Branch Workflows
73
+
74
+ For repos with protected `main` branch:
75
+
76
+ ```bash
77
+ bd init --branch beads-metadata # Use separate branch for beads data
78
+ bd init --contributor # Auto-configure sync.remote=upstream for forks
79
+ ```
80
+
81
+ This creates `.git/beads-worktrees/` for internal management.
82
+
83
+ ## Multi-Clone Support
84
+
85
+ Multi-clone, multi-branch workflows:
86
+
87
+ - Hash-based IDs (`bd-abc`) eliminate collision across clones
88
+ - Each clone syncs independently via git
89
+ - See [WORKTREES.md](https://github.com/steveyegge/beads/blob/main/docs/WORKTREES.md) for comprehensive guide
90
+
91
+ ## External References
92
+
93
+ - **Official Docs**: [github.com/steveyegge/beads/docs](https://github.com/steveyegge/beads/tree/main/docs)
94
+ - **Sync Branch**: [PROTECTED_BRANCHES.md](https://github.com/steveyegge/beads/blob/main/docs/PROTECTED_BRANCHES.md)
95
+ - **Worktrees**: [WORKTREES.md](https://github.com/steveyegge/beads/blob/main/docs/WORKTREES.md)
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: browser-skill
3
+ description: Minimal Chrome DevTools Protocol tools for browser automation and scraping. Use when you need to start Chrome, navigate pages, execute JavaScript, take screenshots, or interactively pick DOM elements.
4
+ ---
5
+
6
+ # Browser Tools
7
+
8
+ Minimal CDP tools for collaborative site exploration and scraping.
9
+
10
+ ## Installation
11
+
12
+ Install dependencies before first use:
13
+
14
+ ```bash
15
+ cd .claude/skills/browser-skill/scripts && npm install
16
+ ```
17
+
18
+ ## Start Chrome
19
+
20
+ ```bash
21
+ node .claude/skills/browser-skill/scripts/start.js # Fresh profile
22
+ node .claude/skills/browser-skill/scripts/start.js --profile # Copy your profile (cookies, logins)
23
+ ```
24
+
25
+ Start Chrome on `:9222` with remote debugging.
26
+
27
+ ## Navigate
28
+
29
+ ```bash
30
+ node .claude/skills/browser-skill/scripts/nav.js https://example.com
31
+ node .claude/skills/browser-skill/scripts/nav.js https://example.com --new
32
+ ```
33
+
34
+ Navigate current tab or open new tab.
35
+
36
+ ## Evaluate JavaScript
37
+
38
+ ```bash
39
+ node .claude/skills/browser-skill/scripts/eval.js 'document.title'
40
+ node .claude/skills/browser-skill/scripts/eval.js 'document.querySelectorAll("a").length'
41
+ ```
42
+
43
+ Execute JavaScript in active tab (async context).
44
+
45
+ **IMPORTANT**: The code must be a single expression or use IIFE for multiple statements:
46
+
47
+ - Single expression: `'document.title'`
48
+ - Multiple statements: `'(() => { const x = 1; return x + 1; })()'`
49
+ - Avoid newlines in the code string - keep it on one line
50
+
51
+ ## Screenshot
52
+
53
+ ```bash
54
+ node .claude/skills/browser-skill/scripts/screenshot.js
55
+ ```
56
+
57
+ Screenshot current viewport, returns temp file path.
58
+
59
+ ## Pick Elements
60
+
61
+ ```bash
62
+ node .claude/skills/browser-skill/scripts/pick.js "Click the submit button"
63
+ ```
64
+
65
+ Interactive element picker. Click to select, Cmd/Ctrl+Click for multi-select, Enter to finish.
66
+
67
+ ## Usage Notes
68
+
69
+ - Start Chrome first before using other tools
70
+ - The `--profile` flag syncs your actual Chrome profile so you're logged in everywhere
71
+ - JavaScript evaluation runs in an async context in the page
72
+ - Pick tool allows you to visually select DOM elements by clicking on them
@@ -1,281 +1,231 @@
1
1
  ---
2
2
  name: knowledge
3
- description: Extract knowledge from Amp thread chains and update project documentation. Use when synthesizing learnings from multi-session work, updating docs after major features, or capturing architectural decisions from conversation history.
3
+ description: Extracts knowledge from Amp threads and updates project docs. Use when asked to document recent work, sync docs after an epic, summarize what changed, or update AGENTS.md from thread history.
4
4
  ---
5
5
 
6
6
  # Knowledge Extraction & Documentation Sync
7
7
 
8
- ## Overview
8
+ Extracts knowledge from Amp threads and synchronizes project documentation.
9
9
 
10
- This skill enables extracting knowledge from Amp thread chains and synchronizing project documentation. It bridges the gap between ephemeral conversation context and persistent project knowledge.
10
+ ## Pipeline
11
11
 
12
- ## When to Use This Skill
13
-
14
- ### Use knowledge extraction when:
12
+ ```
13
+ REQUEST → THREADS → TOPICS → CODE → DOCS
14
+ ```
15
15
 
16
- - **Major feature completed** - Need to update docs to reflect new capabilities
17
- - **Architecture changed** - Decisions made across threads need documenting
18
- - **Epic finished** - Multi-session work produced learnings worth capturing
19
- - **Patterns emerged** - Repeated approaches should be documented for consistency
20
- - **Onboarding prep** - Capture context that would help future contributors
16
+ | Phase | Action | Tools |
17
+ | ------------ | -------------------------- | ---------------------- |
18
+ | 1. Discover | Find threads by query/time | `find_thread` |
19
+ | 2. Extract | Parallel topic extraction | `Task` + `read_thread` |
20
+ | 3. Verify | Ground topics in code | `gkg`, `finder` |
21
+ | 4. Map | Find target docs | `Read`, `Grep` |
22
+ | 5. Reconcile | Compare all sources | `Oracle` |
23
+ | 6. Apply | Surgical updates | `edit_file`, `mermaid` |
21
24
 
22
- ### Don't use when:
25
+ ## Phase 1: Discover Threads
23
26
 
24
- - **Single conversation** - Use Episteme agent for same-session updates
25
- - **Simple edits** - Direct edit_file is sufficient
26
- - **Code changes only** - No documentation impact
27
+ Start from user request:
27
28
 
28
- ## Thread Chain Traversal
29
+ ```bash
30
+ # "Document last 2 weeks"
31
+ find_thread after:2w
29
32
 
30
- ### Finding Related Threads
33
+ # "Summarize auth work"
34
+ find_thread "authentication"
31
35
 
32
- Use `find_thread` to locate related work:
36
+ # "What touched the SDK?"
37
+ find_thread file:packages/sdk
33
38
 
39
+ # Combined
40
+ find_thread "refactor" after:1w file:packages/api
34
41
  ```
35
- find_thread query patterns:
36
42
 
37
- # By topic
38
- find_thread "Framework Refactor"
43
+ ## Phase 2: Extract Topics
39
44
 
40
- # By file touched
41
- find_thread file:packages/sdk/src/module.ts
45
+ Spawn parallel `Task` agents (2-3 threads each):
42
46
 
43
- # By date range
44
- find_thread "auth" after:7d
45
-
46
- # By author
47
- find_thread author:me after:2w
48
47
  ```
48
+ Task prompt:
49
+ "Read threads [T-xxx, T-yyy] using read_thread.
50
+ Goal: 'Extract topics, decisions, changes'
49
51
 
50
- ### Reading Thread Content
51
-
52
- Use `read_thread` with specific goals:
53
-
54
- | Extraction Goal | Goal Parameter |
55
- | ---------------------- | -------------------------------------------------------------------- |
56
- | Architecture decisions | "Extract architectural decisions, patterns, and design rationale" |
57
- | CLI changes | "Extract CLI command changes, new options, and usage patterns" |
58
- | API changes | "Extract API changes, new endpoints, breaking changes" |
59
- | Module changes | "Extract module structure changes, hooks, and registration patterns" |
60
- | Bug context | "Extract bug description, root cause, and fix approach" |
61
- | Feature details | "Extract feature requirements, implementation, and usage examples" |
52
+ Return JSON:
53
+ {
54
+ 'topics': [{
55
+ 'name': 'topic name',
56
+ 'threads': ['T-xxx'],
57
+ 'summary': '1-2 sentences',
58
+ 'decisions': ['...'],
59
+ 'patterns': ['...'],
60
+ 'changes': ['...']
61
+ }]
62
+ }"
63
+ ```
62
64
 
63
- ### Chain Traversal Pattern
65
+ Collect outputs Oracle synthesizes:
64
66
 
65
67
  ```
66
- 1. Start with provided thread ID or search query
67
- 2. Read initial thread with broad goal
68
- 3. Extract references to parent/related threads
69
- 4. Use find_thread to discover connected threads
70
- 5. Build chronological list (oldest → newest)
71
- 6. Read each thread with focused goal
72
- 7. Synthesize across all threads
68
+ Oracle: "Cluster these extractions. Deduplicate.
69
+ Latest thread wins conflicts. Output unified topic list."
73
70
  ```
74
71
 
75
- **Stop conditions:**
76
-
77
- - Reached epic/feature start
78
- - 10+ threads traversed
79
- - No more related threads found
80
-
81
- ## Knowledge Extraction Framework
82
-
83
- ### Phase 1: Discovery
84
-
85
- For each thread, extract:
86
-
87
- | Field | Description |
88
- | ------------ | -------------------------------------- |
89
- | Thread ID | Unique identifier |
90
- | Date | When the work occurred |
91
- | Summary | 1-2 sentence description |
92
- | Key Changes | Files modified, features added |
93
- | Decisions | Architectural or design decisions |
94
- | Patterns | Code patterns, conventions established |
95
- | Dependencies | What this work required or enabled |
96
-
97
- ### Phase 2: Synthesis
98
-
99
- Combine thread knowledge into structured output:
100
-
101
- ```markdown
102
- ## Knowledge Summary: [Epic/Feature Name]
103
-
104
- ### Timeline
105
-
106
- - [Date]: [Thread ID] - [Summary]
107
- - [Date]: [Thread ID] - [Summary]
108
-
109
- ### Architectural Decisions
110
-
111
- | Decision | Rationale | Thread |
112
- | -------- | --------- | ------- |
113
- | [What] | [Why] | [T-xxx] |
114
-
115
- ### New Patterns
116
-
117
- | Pattern | When to Use | Example |
118
- | --------- | ----------- | ----------- |
119
- | [Pattern] | [Context] | [Code/Link] |
120
-
121
- ### Breaking Changes
72
+ See `reference/extraction-prompts.md` for full templates.
122
73
 
123
- - [Change]: [Migration path]
74
+ ## Phase 3: Verify Against Code
124
75
 
125
- ### New Capabilities
76
+ For each topic, verify claims:
126
77
 
127
- - [Capability]: [How to use]
128
78
  ```
79
+ Topic: "Added retry logic to API client"
129
80
 
130
- ### Phase 3: Mapping
81
+ 1. finder "retry logic API client"
82
+ → finds src/api/client.ts
131
83
 
132
- Map extracted knowledge to documentation targets:
84
+ 2. gkg__search_codebase_definitions "retry"
85
+ → RetryPolicy class at L45
133
86
 
134
- | Change Type | Target Files |
135
- | --------------- | -------------------------------------------------- |
136
- | Architecture | `AGENTS.md`, `docs/ARCHITECTURE.md` |
137
- | CLI commands | `packages/kuckit-cli/AGENTS.md` |
138
- | SDK/API | `packages/sdk/AGENTS.md`, `packages/api/AGENTS.md` |
139
- | Patterns | `.claude/skills/*/SKILL.md` |
140
- | Quick start | `README.md` |
141
- | Templates | `packages/create-kuckit-app/AGENTS.md` |
142
- | Troubleshooting | `docs/TROUBLESHOOTING.md` |
87
+ 3. gkg__get_references "RetryPolicy"
88
+ 12 usages across 4 files
143
89
 
144
- ## Documentation Update Guidelines
145
-
146
- ### Update Principles
147
-
148
- 1. **Preserve structure** - Maintain existing formatting and organization
149
- 2. **Surgical changes** - Only modify sections affected by new knowledge
150
- 3. **Add, don't overwrite** - Enhance existing content, don't replace unless outdated
151
- 4. **Cross-reference** - Link related sections across documents
152
- 5. **Version awareness** - Note when changes apply to specific versions
153
-
154
- ### Content Guidelines by File Type
155
-
156
- **AGENTS.md files:**
157
-
158
- - Command references with examples
159
- - Architecture diagrams (ASCII or mermaid)
160
- - Dependency rules tables
161
- - File structure trees
162
- - Quick reference tables
90
+ Confirmed: topic matches code
91
+ ```
163
92
 
164
- **README.md:**
93
+ | Claim Type | Verification |
94
+ | ----------------- | -------------------------------------- |
95
+ | "Added X" | `gkg__search_codebase_definitions "X"` |
96
+ | "Refactored Y" | `finder "Y"` → `gkg__get_references` |
97
+ | "Changed pattern" | `warpgrep "pattern implementation"` |
98
+ | "Updated config" | `gkg__repo_map` on config paths |
165
99
 
166
- - Quick start commands
167
- - Feature lists with brief descriptions
168
- - Installation/setup instructions
169
- - Links to detailed docs
100
+ ## Phase 4: Map to Docs
170
101
 
171
- **SKILL.md files:**
102
+ Discover existing documentation:
172
103
 
173
- - When to use guidance
174
- - Patterns with examples
175
- - Reference tables
176
- - Troubleshooting sections
104
+ ```bash
105
+ # Structure
106
+ gkg__repo_map on docs/, .claude/skills/, */AGENTS.md
177
107
 
178
- ### Quality Checklist
108
+ # Find existing mentions
109
+ Grep "topic keyword" docs/
110
+ Grep "RetryPolicy" AGENTS.md
111
+ ```
179
112
 
180
- Before finalizing updates:
113
+ Read target files before updating:
181
114
 
182
115
  ```
183
- Documentation Update Checklist:
184
- - [ ] All affected files identified
185
- - [ ] Changes match source thread content
186
- - [ ] Code examples are syntactically correct
187
- - [ ] Links are valid (file paths, URLs)
188
- - [ ] Terminology is consistent with existing docs
189
- - [ ] No duplicate information introduced
190
- - [ ] Deprecated info marked or removed
116
+ Read docs/ARCHITECTURE.md
117
+ Note structure, sections, voice
118
+ Identify insertion point
191
119
  ```
192
120
 
193
- ## Verification
194
-
195
- After updates:
196
-
197
- 1. **Type check**: `bun run check-types` (if code examples included)
198
- 2. **Link check**: Verify file:// links point to existing files
199
- 3. **Consistency check**: Grep for conflicting information
200
- 4. **Summary**: Report what was updated and why
121
+ See `reference/doc-mapping.md` for target file conventions.
201
122
 
202
- ## Reference: Thread Goal Templates
123
+ ## Phase 5: Reconcile
203
124
 
204
- Copy these goals when using `read_thread`:
205
-
206
- ### For Architecture Work
125
+ Oracle compares three sources:
207
126
 
208
127
  ```
209
- "Extract architectural decisions made, patterns established,
210
- design rationale, and any trade-offs discussed. Include
211
- specific file paths and code patterns where mentioned."
128
+ Oracle prompt:
129
+ "Compare:
130
+ 1. TOPICS: [extracted]
131
+ 2. CODE: [verified state]
132
+ 3. DOCS: [current content]
133
+
134
+ Output:
135
+ - GAPS: topics not in docs
136
+ - STALE: docs ≠ code
137
+ - UPDATES: [{file, section, change, rationale}]"
212
138
  ```
213
139
 
214
- ### For Feature Implementation
140
+ ## Phase 6: Apply Updates
141
+
142
+ **Text updates**:
215
143
 
216
144
  ```
217
- "Extract feature requirements, implementation approach,
218
- API surface, usage examples, and any configuration options.
219
- Note breaking changes or migration needs."
145
+ Read target edit_file with precise changes
146
+ Preserve structure and voice
220
147
  ```
221
148
 
222
- ### For Refactoring Work
149
+ **Architecture diagrams**:
223
150
 
224
151
  ```
225
- "Extract what was refactored, why (motivation), how (approach),
226
- what patterns changed, and any migration guidance for existing code."
152
+ mermaid with citations:
153
+ {
154
+ "code": "flowchart LR\n A[Client] --> B[RetryPolicy]",
155
+ "citations": {
156
+ "Client": "file:///src/api/client.ts#L10",
157
+ "RetryPolicy": "file:///src/api/retry.ts#L45"
158
+ }
159
+ }
227
160
  ```
228
161
 
229
- ### For Bug Fixes
162
+ **Parallel updates**: Multiple unrelated files → spawn Task per file.
230
163
 
231
- ```
232
- "Extract the bug description, root cause analysis, fix approach,
233
- and any patterns to avoid similar issues in the future."
234
- ```
164
+ ## Concrete Example
235
165
 
236
- ### For Documentation Updates
166
+ User: "Document the auth refactor from last week"
237
167
 
238
168
  ```
239
- "Extract what documentation was updated, what information was added,
240
- and any structural changes to documentation organization."
241
- ```
169
+ 1. find_thread "auth" after:7d
170
+ [T-abc, T-def, T-ghi]
242
171
 
243
- ## Integration with Other Skills
172
+ 2. Task agents extract (parallel):
173
+ Agent A: T-abc → {topics: [{name: "JWT migration"}]}
174
+ Agent B: T-def, T-ghi → {topics: [{name: "session cleanup"}]}
244
175
 
245
- ### With Beads (bd)
176
+ 3. Oracle clusters:
177
+ → "Auth Refactor" with sub-topics
246
178
 
247
- - Check `bd list --status closed` for completed work to document
248
- - Use bead notes as additional context source
249
- - Create follow-up beads for documentation gaps
179
+ 4. Verify:
180
+ gkg__search_codebase_definitions "JWTService"
181
+ confirmed at packages/auth/jwt.ts
250
182
 
251
- ### With Episteme
183
+ 5. Map docs:
184
+ Grep "authentication" AGENTS.md
185
+ → Section exists at line 45
252
186
 
253
- - Episteme handles same-session updates
254
- - Knowledge skill handles cross-session synthesis
255
- - Hand off to Episteme for final polish
187
+ 6. Oracle reconciles:
188
+ Gap: JWT migration not documented
189
+ Update: AGENTS.md auth section
256
190
 
257
- ## Troubleshooting
191
+ 7. Apply:
192
+ edit_file AGENTS.md add JWT details
193
+ mermaid auth flow diagram
194
+ ```
258
195
 
259
- **Thread not found:**
196
+ ## Tool Quick Reference
260
197
 
261
- - Verify thread ID format: `T-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
262
- - Try `find_thread` with topic keywords instead
263
- - Check date range if searching
198
+ | Goal | Tool |
199
+ | ------------------- | ---------------------------------------- |
200
+ | Find threads | `find_thread query\|after:Xd\|file:path` |
201
+ | Read thread | `read_thread` with focused goal |
202
+ | Parallel extraction | `Task` (spawn multiple) |
203
+ | Find definitions | `gkg__search_codebase_definitions` |
204
+ | Find references | `gkg__get_references` |
205
+ | Semantic search | `finder` or `warpgrep` |
206
+ | Area overview | `gkg__repo_map` |
207
+ | Synthesis | `Oracle` |
208
+ | Read doc | `Read` |
209
+ | Search docs | `Grep` |
210
+ | Update doc | `edit_file` |
211
+ | Diagram | `mermaid` with citations |
264
212
 
265
- **Too many threads:**
213
+ ## Quality Checklist
266
214
 
267
- - Narrow with date range: `after:7d`
268
- - Filter by file: `file:packages/sdk`
269
- - Focus on specific keywords
215
+ ```
216
+ - [ ] Topics verified against code (GKG)
217
+ - [ ] Existing docs read before updating
218
+ - [ ] Changes surgical, not wholesale
219
+ - [ ] Mermaid diagrams have citations
220
+ - [ ] Terminology matches existing docs
221
+ ```
222
+
223
+ ## Troubleshooting
270
224
 
271
- **Conflicting information across threads:**
225
+ **Thread not found**: Try topic keywords, widen date range
272
226
 
273
- - Use chronological order (latest wins)
274
- - Note evolution in documentation
275
- - Ask user to clarify if critical
227
+ **Too many threads**: Add `file:` filter, narrow dates
276
228
 
277
- **Documentation structure unclear:**
229
+ **Topic code**: Code is truth; note as "planned" or "historical"
278
230
 
279
- - Read target file first to understand format
280
- - Match existing section patterns
281
- - When in doubt, add new section at end
231
+ **Doc structure unclear**: Read first, match existing patterns
@@ -0,0 +1,49 @@
1
+ # Documentation Target Mapping
2
+
3
+ ## By Topic Type
4
+
5
+ | Topic Type | Target Files |
6
+ | --------------- | ----------------------------------------- |
7
+ | Architecture | `AGENTS.md`, `docs/ARCHITECTURE.md` |
8
+ | CLI commands | `packages/cli/AGENTS.md` |
9
+ | SDK/API | `packages/sdk/AGENTS.md` |
10
+ | Patterns | `.claude/skills/*/SKILL.md` |
11
+ | Quick start | `README.md` |
12
+ | Module dev | `packages/sdk/docs/MODULE_DEVELOPMENT.md` |
13
+ | Troubleshooting | `docs/TROUBLESHOOTING.md` |
14
+ | Deployment | `docs/DEPLOYMENT.md` |
15
+ | Migration | `docs/MIGRATION.md` |
16
+
17
+ ## By Change Type
18
+
19
+ | Change | Primary Doc | Secondary |
20
+ | --------------- | ------------------ | ------------------ |
21
+ | New command | Package AGENTS.md | README.md |
22
+ | New hook | SDK AGENTS.md | Skill if pattern |
23
+ | Breaking change | MIGRATION.md | Affected AGENTS.md |
24
+ | New pattern | Relevant SKILL.md | AGENTS.md |
25
+ | Bug fix pattern | TROUBLESHOOTING.md | - |
26
+ | Config change | README.md | DEPLOYMENT.md |
27
+
28
+ ## Section Conventions
29
+
30
+ ### AGENTS.md
31
+
32
+ - Commands table with examples
33
+ - Architecture diagrams (mermaid)
34
+ - Dependency rules tables
35
+ - Quick reference tables
36
+
37
+ ### README.md
38
+
39
+ - Quick start commands
40
+ - Feature lists (brief)
41
+ - Installation steps
42
+ - Links to detailed docs
43
+
44
+ ### SKILL.md
45
+
46
+ - When to use section
47
+ - Patterns with examples
48
+ - Reference tables
49
+ - Troubleshooting section