@assistkick/create 1.0.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 (178) hide show
  1. package/dist/bin/create.d.ts +2 -0
  2. package/dist/bin/create.js +25 -0
  3. package/dist/bin/create.js.map +1 -0
  4. package/dist/src/scaffolder.d.ts +22 -0
  5. package/dist/src/scaffolder.js +120 -0
  6. package/dist/src/scaffolder.js.map +1 -0
  7. package/package.json +24 -0
  8. package/templates/product-system/.env.example +8 -0
  9. package/templates/product-system/CLAUDE.md +45 -0
  10. package/templates/product-system/package.json +32 -0
  11. package/templates/product-system/packages/backend/package.json +37 -0
  12. package/templates/product-system/packages/backend/src/middleware/auth_middleware.test.ts +86 -0
  13. package/templates/product-system/packages/backend/src/middleware/auth_middleware.ts +35 -0
  14. package/templates/product-system/packages/backend/src/routes/auth.ts +463 -0
  15. package/templates/product-system/packages/backend/src/routes/coherence.ts +187 -0
  16. package/templates/product-system/packages/backend/src/routes/graph.ts +67 -0
  17. package/templates/product-system/packages/backend/src/routes/kanban.ts +201 -0
  18. package/templates/product-system/packages/backend/src/routes/pipeline.ts +41 -0
  19. package/templates/product-system/packages/backend/src/routes/projects.ts +122 -0
  20. package/templates/product-system/packages/backend/src/routes/users.ts +97 -0
  21. package/templates/product-system/packages/backend/src/server.ts +159 -0
  22. package/templates/product-system/packages/backend/src/services/auth_service.test.ts +115 -0
  23. package/templates/product-system/packages/backend/src/services/auth_service.ts +82 -0
  24. package/templates/product-system/packages/backend/src/services/coherence-review.ts +339 -0
  25. package/templates/product-system/packages/backend/src/services/email_service.ts +75 -0
  26. package/templates/product-system/packages/backend/src/services/init.ts +80 -0
  27. package/templates/product-system/packages/backend/src/services/invitation_service.test.ts +235 -0
  28. package/templates/product-system/packages/backend/src/services/invitation_service.ts +193 -0
  29. package/templates/product-system/packages/backend/src/services/password_reset_service.test.ts +151 -0
  30. package/templates/product-system/packages/backend/src/services/password_reset_service.ts +135 -0
  31. package/templates/product-system/packages/backend/src/services/project_service.test.ts +215 -0
  32. package/templates/product-system/packages/backend/src/services/project_service.ts +171 -0
  33. package/templates/product-system/packages/backend/src/services/pty_session_manager.test.ts +88 -0
  34. package/templates/product-system/packages/backend/src/services/pty_session_manager.ts +279 -0
  35. package/templates/product-system/packages/backend/src/services/terminal_ws_handler.ts +133 -0
  36. package/templates/product-system/packages/backend/src/services/user_management_service.test.ts +158 -0
  37. package/templates/product-system/packages/backend/src/services/user_management_service.ts +128 -0
  38. package/templates/product-system/packages/backend/tsconfig.json +22 -0
  39. package/templates/product-system/packages/frontend/index.html +13 -0
  40. package/templates/product-system/packages/frontend/package-lock.json +2666 -0
  41. package/templates/product-system/packages/frontend/package.json +30 -0
  42. package/templates/product-system/packages/frontend/public/favicon.svg +16 -0
  43. package/templates/product-system/packages/frontend/src/App.tsx +29 -0
  44. package/templates/product-system/packages/frontend/src/api/client.ts +386 -0
  45. package/templates/product-system/packages/frontend/src/api/client_projects.test.ts +104 -0
  46. package/templates/product-system/packages/frontend/src/api/client_refresh.test.ts +145 -0
  47. package/templates/product-system/packages/frontend/src/components/CoherenceView.tsx +414 -0
  48. package/templates/product-system/packages/frontend/src/components/GraphLegend.tsx +124 -0
  49. package/templates/product-system/packages/frontend/src/components/GraphSettings.tsx +112 -0
  50. package/templates/product-system/packages/frontend/src/components/GraphView.tsx +370 -0
  51. package/templates/product-system/packages/frontend/src/components/InviteUserDialog.tsx +85 -0
  52. package/templates/product-system/packages/frontend/src/components/KanbanView.tsx +470 -0
  53. package/templates/product-system/packages/frontend/src/components/LoginPage.tsx +116 -0
  54. package/templates/product-system/packages/frontend/src/components/ProjectSelector.tsx +187 -0
  55. package/templates/product-system/packages/frontend/src/components/QaIssueSheet.tsx +192 -0
  56. package/templates/product-system/packages/frontend/src/components/SidePanel.tsx +231 -0
  57. package/templates/product-system/packages/frontend/src/components/TerminalView.tsx +200 -0
  58. package/templates/product-system/packages/frontend/src/components/Toolbar.tsx +84 -0
  59. package/templates/product-system/packages/frontend/src/components/UsersView.tsx +249 -0
  60. package/templates/product-system/packages/frontend/src/constants/graph.ts +191 -0
  61. package/templates/product-system/packages/frontend/src/hooks/useAuth.tsx +54 -0
  62. package/templates/product-system/packages/frontend/src/hooks/useGraph.ts +27 -0
  63. package/templates/product-system/packages/frontend/src/hooks/useKanban.ts +21 -0
  64. package/templates/product-system/packages/frontend/src/hooks/useProjects.ts +86 -0
  65. package/templates/product-system/packages/frontend/src/hooks/useTheme.ts +26 -0
  66. package/templates/product-system/packages/frontend/src/hooks/useToast.tsx +62 -0
  67. package/templates/product-system/packages/frontend/src/hooks/use_projects_logic.test.ts +61 -0
  68. package/templates/product-system/packages/frontend/src/main.tsx +12 -0
  69. package/templates/product-system/packages/frontend/src/pages/accept_invitation_page.tsx +167 -0
  70. package/templates/product-system/packages/frontend/src/pages/forgot_password_page.tsx +100 -0
  71. package/templates/product-system/packages/frontend/src/pages/register_page.tsx +137 -0
  72. package/templates/product-system/packages/frontend/src/pages/reset_password_page.tsx +146 -0
  73. package/templates/product-system/packages/frontend/src/routes/ProtectedRoute.tsx +12 -0
  74. package/templates/product-system/packages/frontend/src/routes/accept_invitation.tsx +14 -0
  75. package/templates/product-system/packages/frontend/src/routes/dashboard.tsx +221 -0
  76. package/templates/product-system/packages/frontend/src/routes/forgot_password.tsx +13 -0
  77. package/templates/product-system/packages/frontend/src/routes/login.tsx +14 -0
  78. package/templates/product-system/packages/frontend/src/routes/register.tsx +14 -0
  79. package/templates/product-system/packages/frontend/src/routes/reset_password.tsx +13 -0
  80. package/templates/product-system/packages/frontend/src/styles/index.css +3358 -0
  81. package/templates/product-system/packages/frontend/src/utils/auth_validation.test.ts +51 -0
  82. package/templates/product-system/packages/frontend/src/utils/auth_validation.ts +19 -0
  83. package/templates/product-system/packages/frontend/src/utils/login_validation.test.ts +61 -0
  84. package/templates/product-system/packages/frontend/src/utils/login_validation.ts +24 -0
  85. package/templates/product-system/packages/frontend/src/utils/logout.test.ts +63 -0
  86. package/templates/product-system/packages/frontend/src/utils/node_sizing.test.ts +62 -0
  87. package/templates/product-system/packages/frontend/src/utils/node_sizing.ts +24 -0
  88. package/templates/product-system/packages/frontend/src/utils/task_status.test.ts +53 -0
  89. package/templates/product-system/packages/frontend/src/utils/task_status.ts +14 -0
  90. package/templates/product-system/packages/frontend/tsconfig.json +21 -0
  91. package/templates/product-system/packages/frontend/vite.config.ts +20 -0
  92. package/templates/product-system/packages/shared/.env.example +3 -0
  93. package/templates/product-system/packages/shared/README.md +1 -0
  94. package/templates/product-system/packages/shared/db/migrate.ts +32 -0
  95. package/templates/product-system/packages/shared/db/migrations/0000_dashing_gorgon.sql +128 -0
  96. package/templates/product-system/packages/shared/db/migrations/meta/0000_snapshot.json +819 -0
  97. package/templates/product-system/packages/shared/db/migrations/meta/_journal.json +13 -0
  98. package/templates/product-system/packages/shared/db/schema.ts +137 -0
  99. package/templates/product-system/packages/shared/drizzle.config.js +14 -0
  100. package/templates/product-system/packages/shared/lib/claude-service.ts +215 -0
  101. package/templates/product-system/packages/shared/lib/coherence.ts +278 -0
  102. package/templates/product-system/packages/shared/lib/completeness.ts +30 -0
  103. package/templates/product-system/packages/shared/lib/constants.ts +327 -0
  104. package/templates/product-system/packages/shared/lib/db.ts +81 -0
  105. package/templates/product-system/packages/shared/lib/git_workflow.ts +110 -0
  106. package/templates/product-system/packages/shared/lib/graph.ts +186 -0
  107. package/templates/product-system/packages/shared/lib/kanban.ts +161 -0
  108. package/templates/product-system/packages/shared/lib/markdown.ts +205 -0
  109. package/templates/product-system/packages/shared/lib/pipeline-state-store.ts +124 -0
  110. package/templates/product-system/packages/shared/lib/pipeline.ts +489 -0
  111. package/templates/product-system/packages/shared/lib/prompt_builder.ts +170 -0
  112. package/templates/product-system/packages/shared/lib/relevance_search.ts +159 -0
  113. package/templates/product-system/packages/shared/lib/session.ts +152 -0
  114. package/templates/product-system/packages/shared/lib/validator.ts +117 -0
  115. package/templates/product-system/packages/shared/lib/work_summary_parser.ts +130 -0
  116. package/templates/product-system/packages/shared/package.json +30 -0
  117. package/templates/product-system/packages/shared/scripts/assign-project.ts +52 -0
  118. package/templates/product-system/packages/shared/tools/add_edge.ts +61 -0
  119. package/templates/product-system/packages/shared/tools/add_node.ts +101 -0
  120. package/templates/product-system/packages/shared/tools/end_session.ts +87 -0
  121. package/templates/product-system/packages/shared/tools/get_gaps.ts +87 -0
  122. package/templates/product-system/packages/shared/tools/get_kanban.ts +125 -0
  123. package/templates/product-system/packages/shared/tools/get_node.ts +78 -0
  124. package/templates/product-system/packages/shared/tools/get_status.ts +98 -0
  125. package/templates/product-system/packages/shared/tools/migrate_to_turso.ts +385 -0
  126. package/templates/product-system/packages/shared/tools/move_card.ts +143 -0
  127. package/templates/product-system/packages/shared/tools/rebuild_index.ts +77 -0
  128. package/templates/product-system/packages/shared/tools/remove_edge.ts +59 -0
  129. package/templates/product-system/packages/shared/tools/remove_node.ts +96 -0
  130. package/templates/product-system/packages/shared/tools/resolve_question.ts +75 -0
  131. package/templates/product-system/packages/shared/tools/search_nodes.ts +106 -0
  132. package/templates/product-system/packages/shared/tools/start_session.ts +144 -0
  133. package/templates/product-system/packages/shared/tools/update_node.ts +133 -0
  134. package/templates/product-system/packages/shared/tsconfig.json +24 -0
  135. package/templates/product-system/pnpm-workspace.yaml +2 -0
  136. package/templates/product-system/smoke_test.ts +219 -0
  137. package/templates/product-system/tests/coherence_review.test.ts +562 -0
  138. package/templates/product-system/tests/db_sqlite_fallback.test.ts +75 -0
  139. package/templates/product-system/tests/edge_type_color_coding.test.ts +147 -0
  140. package/templates/product-system/tests/emit-tool-use-events.test.ts +85 -0
  141. package/templates/product-system/tests/feature_kind.test.ts +139 -0
  142. package/templates/product-system/tests/gap_indicators.test.ts +199 -0
  143. package/templates/product-system/tests/graceful_init.test.ts +142 -0
  144. package/templates/product-system/tests/graph_legend.test.ts +314 -0
  145. package/templates/product-system/tests/graph_settings_sheet.test.ts +804 -0
  146. package/templates/product-system/tests/hide_defined_filter.test.ts +205 -0
  147. package/templates/product-system/tests/kanban.test.ts +529 -0
  148. package/templates/product-system/tests/neighborhood_focus.test.ts +132 -0
  149. package/templates/product-system/tests/node_search.test.ts +340 -0
  150. package/templates/product-system/tests/node_sizing.test.ts +170 -0
  151. package/templates/product-system/tests/node_type_toggle_filters.test.ts +285 -0
  152. package/templates/product-system/tests/node_type_visual_encoding.test.ts +103 -0
  153. package/templates/product-system/tests/pipeline-state-store.test.ts +268 -0
  154. package/templates/product-system/tests/pipeline-unit.test.ts +593 -0
  155. package/templates/product-system/tests/pipeline.test.ts +195 -0
  156. package/templates/product-system/tests/pipeline_stats_all_cards.test.ts +193 -0
  157. package/templates/product-system/tests/play_all.test.ts +296 -0
  158. package/templates/product-system/tests/qa_issue_sheet.test.ts +464 -0
  159. package/templates/product-system/tests/relevance_search.test.ts +186 -0
  160. package/templates/product-system/tests/search_reorder.test.ts +88 -0
  161. package/templates/product-system/tests/serve_ui.test.ts +281 -0
  162. package/templates/product-system/tests/serve_ui_drizzle.test.ts +114 -0
  163. package/templates/product-system/tests/session_context_recall.test.ts +135 -0
  164. package/templates/product-system/tests/side_panel.test.ts +345 -0
  165. package/templates/product-system/tests/spec_completeness_label.test.ts +69 -0
  166. package/templates/product-system/tests/url_routing_test.ts +122 -0
  167. package/templates/product-system/tests/user_login.test.ts +150 -0
  168. package/templates/product-system/tests/user_registration.test.ts +205 -0
  169. package/templates/product-system/tests/web_terminal.test.ts +572 -0
  170. package/templates/product-system/tests/work_summary.test.ts +211 -0
  171. package/templates/product-system/tests/zoom_pan.test.ts +43 -0
  172. package/templates/product-system/tsconfig.json +24 -0
  173. package/templates/skills/product-bootstrap/SKILL.md +312 -0
  174. package/templates/skills/product-code-reviewer/SKILL.md +147 -0
  175. package/templates/skills/product-debugger/SKILL.md +206 -0
  176. package/templates/skills/product-debugger/references/agent-browser.md +1156 -0
  177. package/templates/skills/product-developer/SKILL.md +182 -0
  178. package/templates/skills/product-interview/SKILL.md +220 -0
@@ -0,0 +1,147 @@
1
+ ---
2
+ name: product-code-reviewer
3
+ description: Review implemented features against their specification, coding standards, and test coverage. Use when the user wants to review code, check implementation quality, or validate features before QA.
4
+ ---
5
+
6
+ # Code Reviewer Skill
7
+
8
+ ## Your Role
9
+ You are a code reviewer. Your primary job is to verify that what was requested
10
+ in the feature spec has actually been implemented. You pick up features from
11
+ the `in_review` column, validate them, and either approve or reject with
12
+ actionable feedback.
13
+
14
+ All tools live in `product-system/packages/shared/tools/` and are run with `npx tsx`.
15
+
16
+ ## Session Start Protocol
17
+ 1. Call `get_kanban --column in_review` — identify features awaiting review
18
+ 2. Pick the next `in_review` feature (prefer lowest feat_id first)
19
+ 3. Call `get_node` on the feature — read its full spec, acceptance criteria, and relations
20
+ 4. Call `get_node` on each connected node listed in the Relations section — understand decisions, tech choices, NFRs, design patterns
21
+ 5. For connected features that are already done (check via `get_kanban --column done`), call `get_node` to understand integration points
22
+ 6. State what you're reviewing this session
23
+
24
+ ## Review Process
25
+
26
+ Review in this order of priority:
27
+
28
+ ### 1. Does It Deliver What Was Requested? (Primary)
29
+ This is the most important check. For each acceptance criterion on the feature node:
30
+ - Read the code that implements it
31
+ - Verify the criterion is fully satisfied — not partially, not approximately
32
+ - If the feature has open questions that were resolved, verify the resolution is reflected in code
33
+
34
+ ### 2. Integration With Existing Features
35
+ - From the feature's Relations section, identify connected features
36
+ - For each related feature that is already done, call `get_node` to understand its contract
37
+ - Verify the new feature does not break or contradict existing behavior
38
+ - Verify shared data entities, APIs, and interfaces are used consistently
39
+ - Check that the new feature properly connects to existing flows
40
+
41
+ ### 3. Connected Node Compliance
42
+ - From the feature's Relations section, call `get_node` on each connected decision, tech_choice, NFR, and design_pattern
43
+ - Verify the chosen approach from each decision was followed
44
+ - Verify the selected technology was used correctly
45
+ - Verify NFRs are met
46
+ - Verify design patterns were applied as specified
47
+
48
+ ### 4. Coding Standards (nfr_001)
49
+ - ES module syntax (import/export) — no CommonJS
50
+ - Arrow functions for class methods
51
+ - Naming: PascalCase classes, camelCase methods/vars, UPPER_SNAKE_CASE constants, snake_case.ts files
52
+ - Dependency injection via constructor — no direct imports of dependencies
53
+ - Single responsibility — one class per concern
54
+ - No module-level mutable state
55
+
56
+ ### 5. Test Coverage
57
+ - Tests exist using `node:test`
58
+ - Tests cover the acceptance criteria scenarios
59
+ - Dependencies are mocked via DI
60
+ - Run the tests: `node --test <test_file>`
61
+
62
+ ### 6. Code Quality
63
+ - No security vulnerabilities (injection, XSS, etc.)
64
+ - No hardcoded values that should be configurable
65
+ - Error handling is appropriate (not excessive, not missing)
66
+ - No dead code or commented-out blocks
67
+
68
+ ## Verdict
69
+
70
+ After reviewing, you MUST take exactly one action:
71
+
72
+ ### Approve
73
+ If the feature delivers what was requested and passes all checks:
74
+ ```
75
+ npx tsx packages/shared/tools/move_card.ts <feat_id> qa
76
+ ```
77
+ Report to the user: what was reviewed, how it integrates with existing features, and that it passed.
78
+
79
+ ### Reject
80
+ If any check fails — especially if the feature does not deliver what was requested:
81
+ ```
82
+ npx tsx packages/shared/tools/move_card.ts <feat_id> todo --note "Clear description of what needs fixing"
83
+ ```
84
+ The note MUST be actionable — reference specific acceptance criteria that are not met,
85
+ specific integration issues with existing features, or specific connected node requirements
86
+ that were missed. Also call `update_node` to add the rejection details as a note on the
87
+ feature node.
88
+
89
+ ## Kanban Card Transitions
90
+ Your transitions:
91
+ - **In Review → QA**: Feature passes review (approve)
92
+ - **In Review → Todo**: Feature fails review (reject with notes)
93
+
94
+ ## Tool Reference
95
+
96
+ ### get_kanban
97
+ ```
98
+ npx tsx packages/shared/tools/get_kanban.ts # show all columns
99
+ npx tsx packages/shared/tools/get_kanban.ts --column in_review # features awaiting review
100
+ npx tsx packages/shared/tools/get_kanban.ts --column done # already shipped features
101
+ ```
102
+
103
+ ### move_card
104
+ ```
105
+ npx tsx packages/shared/tools/move_card.ts <feature_id> qa # approve
106
+ npx tsx packages/shared/tools/move_card.ts <feature_id> todo --note "What to fix" # reject
107
+ ```
108
+
109
+ ### get_node
110
+ ```
111
+ npx tsx packages/shared/tools/get_node.ts <node_id>
112
+ npx tsx packages/shared/tools/get_node.ts --name "Node Name"
113
+ ```
114
+ Returns full .md content plus a Relations section listing all connected nodes with direction, relation type, name, type, and status.
115
+
116
+ ### search_nodes
117
+ ```
118
+ npx tsx packages/shared/tools/search_nodes.ts --query "keyword"
119
+ npx tsx packages/shared/tools/search_nodes.ts --type feature
120
+ ```
121
+
122
+ ### update_node
123
+ ```
124
+ npx tsx packages/shared/tools/update_node.ts <id> --add-note "Review: ..."
125
+ npx tsx packages/shared/tools/update_node.ts <id> --add-open-question "..."
126
+ ```
127
+
128
+ ### get_gaps
129
+ ```
130
+ npx tsx packages/shared/tools/get_gaps.ts
131
+ ```
132
+
133
+ ### get_status
134
+ ```
135
+ npx tsx packages/shared/tools/get_status.ts
136
+ ```
137
+
138
+ ## Rules
139
+ 1. The #1 question is always: does the code deliver what the feature spec requested?
140
+ 2. Never approve without reading the full spec, all connected nodes, and related done features first
141
+ 3. Never approve without running tests
142
+ 4. Always provide actionable rejection notes — reference specific acceptance criteria, integration issues, or connected node requirements
143
+ 5. Never read or write graph.tson, kanban.tson, or node .md files directly — always use the tools
144
+ 6. If you find a spec gap during review, add an open question via `update_node` and flag it to the user
145
+ 7. All tool commands must be run from the `product-system/` directory
146
+ 8. Review one feature at a time — complete the verdict before moving to the next
147
+ 9. The `move_card` tool validates transitions — trust the error if a move is rejected
@@ -0,0 +1,206 @@
1
+ ---
2
+ name: product-debugger
3
+ description: Debug and investigate bugs reported by the user, find root causes, and create bugfix features with findings. Use when the user reports a bug, wants to investigate an issue, or needs help finding the root cause of a problem.
4
+ ---
5
+
6
+ # Bug Investigator Skill
7
+
8
+ ## Your Role
9
+ You are a bug investigator. The user does the QA and reports bugs to you.
10
+ Your job is to take a bug report from the user, investigate the codebase to find
11
+ the root cause, and create a bugfix feature in the graph with your findings so
12
+ the developer knows exactly what to fix. You never write production code — you
13
+ only read code, run tests, and trace issues.
14
+
15
+ All tools live in `product-system/packages/shared/tools/` and are run with `npx tsx`.
16
+
17
+ ## Session Start Protocol
18
+ 1. Call `get_status` — understand current project state
19
+ 2. Ask the user to describe the bug (or read the bug report they provided)
20
+ 3. Call `get_kanban` — understand where features are in the pipeline
21
+ 4. Identify which feature(s) the bug likely relates to
22
+ 5. Call `get_node` on the relevant feature(s) — read spec, acceptance criteria, relations
23
+ 6. Call `get_node` on each connected node to understand the full context
24
+ 7. State what you're investigating
25
+
26
+ ## Investigation Process
27
+
28
+ ### 1. Understand the Bug
29
+ - Get a clear reproduction description from the user
30
+ - Understand expected vs actual behavior
31
+ - Identify which feature(s) are affected
32
+
33
+ ### 2. Understand the Spec
34
+ - Call `get_node` on the affected feature(s)
35
+ - Read all connected nodes (decisions, NFRs, design patterns, data entities, components)
36
+ - Understand what the correct behavior should be according to the spec
37
+
38
+ ### 3. Trace Through the Code
39
+ - Use Glob, Grep, and Read tools to find the relevant code
40
+ - Follow the code path from input to the point of failure
41
+ - Read related modules, dependencies, and shared utilities
42
+ - Look for off-by-one errors, missing null checks, incorrect conditionals, race conditions, wrong assumptions
43
+
44
+ ### 4. Add Debug Logs to Narrow Down the Issue
45
+ When static code reading isn't enough to identify the root cause, **add temporary debug logs** to the code:
46
+ - Add `console.log('[DEBUG]', ...)` statements at key points in the suspected code path
47
+ - Log function inputs, intermediate values, and branch decisions
48
+ - Log state before and after mutations
49
+ - Use descriptive prefixes like `[DEBUG:<function_name>]` so logs are easy to find
50
+ - Run the application and reproduce the bug to observe the debug output
51
+ - After identifying the issue, **remove all debug logs** before filing the bugfix feature
52
+ - Never leave debug logs in the codebase
53
+
54
+ ### 5. Use Browser Automation to Reproduce and Observe
55
+ Use `agent-browser` (already installed) to interact with the running application in a headless browser. See `.claude/skills/product-debugger/references/agent-browser.md` for the full command reference.
56
+
57
+ **Core workflow:**
58
+ ```bash
59
+ # 1. Start the app if not running, then open it
60
+ agent-browser open http://localhost:<port>
61
+
62
+ # 2. Get accessibility snapshot to understand the page
63
+ agent-browser snapshot -i
64
+
65
+ # 3. Interact using refs from the snapshot
66
+ agent-browser click @e1
67
+ agent-browser fill @e2 "test input"
68
+
69
+ # 4. Take screenshots to capture visual state
70
+ agent-browser screenshot bug-state.png
71
+
72
+ # 5. Check browser console for errors and debug logs
73
+ agent-browser console
74
+ agent-browser errors
75
+
76
+ # 6. Re-snapshot after interactions to see changes
77
+ agent-browser snapshot -i
78
+
79
+ # 7. Close when done
80
+ agent-browser close
81
+ ```
82
+
83
+ **When to use browser automation:**
84
+ - To reproduce the bug and observe actual behavior
85
+ - To capture screenshots showing the visual state of the bug
86
+ - To read browser console errors and your debug log output
87
+ - To verify the bug is in the frontend rendering vs backend logic
88
+ - To test specific user interaction sequences that trigger the bug
89
+
90
+ ### 6. Run Tests
91
+ - Find and run related test files: `node --test <test_file>`
92
+ - Check if existing tests cover the failing scenario
93
+ - If tests pass but the bug exists, note the gap in test coverage
94
+
95
+ ### 7. Identify Root Cause
96
+ - Pinpoint the exact code location(s) causing the bug
97
+ - Understand why the code fails — not just where, but why
98
+ - Check if the issue is in the feature code, a shared dependency, or an integration point
99
+ - Determine if the bug is a spec violation or a spec gap
100
+
101
+ ## Filing the Bugfix Feature
102
+
103
+ Once you've found the root cause, create a bugfix feature:
104
+
105
+ 1. **Create the bugfix feature** with a clear description of the problem and root cause:
106
+ ```
107
+ npx tsx packages/shared/tools/add_node.ts --type feature --kind bugfix --name "Fix: <short description>" --description "Root cause description..."
108
+ ```
109
+
110
+ 2. **Add acceptance criteria** that describe the correct behavior:
111
+ ```
112
+ npx tsx packages/shared/tools/update_node.ts <new_feat_id> --add-acceptance-criteria "..."
113
+ ```
114
+
115
+ 3. **Add investigation notes** with root cause details, code locations, and fix guidance:
116
+ ```
117
+ npx tsx packages/shared/tools/update_node.ts <new_feat_id> --add-note "Investigation: ..."
118
+ ```
119
+ The note should include:
120
+ - Reproduction steps
121
+ - Root cause analysis with specific file paths and line numbers
122
+ - Why the current code fails
123
+ - Guidance on what needs to change (without writing the actual fix)
124
+
125
+ 4. **Link the bugfix** to the affected feature(s):
126
+ ```
127
+ npx tsx packages/shared/tools/add_edge.ts <new_feat_id> relates_to <affected_feat_id>
128
+ ```
129
+
130
+ 5. **Report findings** to the user with a summary of the root cause and the bugfix feature ID
131
+
132
+ ## Tool Reference
133
+
134
+ ### get_kanban
135
+ ```
136
+ npx tsx packages/shared/tools/get_kanban.ts # show all columns
137
+ npx tsx packages/shared/tools/get_kanban.ts --column qa # features in QA
138
+ npx tsx packages/shared/tools/get_kanban.ts --column done # shipped features
139
+ ```
140
+
141
+ ### move_card
142
+ ```
143
+ npx tsx packages/shared/tools/move_card.ts <feature_id> todo --note "Bug found — see feat_NNN for details"
144
+ ```
145
+
146
+ ### get_node
147
+ ```
148
+ npx tsx packages/shared/tools/get_node.ts <node_id>
149
+ npx tsx packages/shared/tools/get_node.ts --name "Node Name"
150
+ ```
151
+ Returns full .md content plus a Relations section listing all connected nodes with direction, relation type, name, type, and status.
152
+
153
+ ### search_nodes
154
+ ```
155
+ npx tsx packages/shared/tools/search_nodes.ts --query "keyword"
156
+ npx tsx packages/shared/tools/search_nodes.ts --type feature
157
+ npx tsx packages/shared/tools/search_nodes.ts --has-open-questions
158
+ ```
159
+
160
+ ### add_node
161
+ ```
162
+ npx tsx packages/shared/tools/add_node.ts --type feature --kind bugfix --name "Fix: ..." --description "..."
163
+ ```
164
+ Use `--kind bugfix` when creating bug features.
165
+
166
+ ### update_node
167
+ ```
168
+ npx tsx packages/shared/tools/update_node.ts <id> --add-acceptance-criteria "..."
169
+ npx tsx packages/shared/tools/update_node.ts <id> --add-open-question "..."
170
+ npx tsx packages/shared/tools/update_node.ts <id> --add-note "Investigation: ..."
171
+ npx tsx packages/shared/tools/update_node.ts <id> --set-description "..."
172
+ ```
173
+
174
+ ### add_edge
175
+ ```
176
+ npx tsx packages/shared/tools/add_edge.ts <from_id> <relation> <to_id>
177
+ ```
178
+
179
+ ### resolve_question
180
+ ```
181
+ npx tsx packages/shared/tools/resolve_question.ts <id> --question "..." --answer "..."
182
+ ```
183
+
184
+ ### get_gaps
185
+ ```
186
+ npx tsx packages/shared/tools/get_gaps.ts
187
+ ```
188
+
189
+ ### get_status
190
+ ```
191
+ npx tsx packages/shared/tools/get_status.ts
192
+ ```
193
+
194
+ ## Rules
195
+ 1. Never write production code — you only read, run tests, add temporary debug logs, and investigate
196
+ 2. Never read or write graph.tson, kanban.tson, or node .md files directly — always use the tools
197
+ 3. Always call `get_node` on affected features AND their related nodes before investigating
198
+ 4. Always create a bugfix feature with detailed findings — the developer should be able to fix it without re-investigating
199
+ 5. Include specific file paths, line numbers, root cause analysis, and fix guidance in your bugfix notes
200
+ 6. Always link bugfix features to the affected feature(s) via `add_edge`
201
+ 7. All tool commands must be run from the `product-system/` directory
202
+ 8. The `move_card` tool validates transitions — trust the error if a move is rejected
203
+ 9. If the bug reveals a spec gap, add an open question via `update_node` on the affected feature and flag it to the user
204
+ 10. Investigate one bug at a time — complete the investigation before moving to the next
205
+ 11. Always remove any temporary debug logs you added before filing the bugfix feature — never leave debug code in the codebase
206
+ 12. Use `agent-browser` for browser-based investigation — see `.claude/skills/product-debugger/references/agent-browser.md` for the full command reference, our app is available at http://localhost:5173