class-ai-agent 1.2.2 → 1.3.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 (172) hide show
  1. package/.agent/README.md +33 -0
  2. package/.agent/SESSION.md +54 -0
  3. package/.agent/SESSION.template.md +46 -0
  4. package/.claude/CLAUDE.md +21 -6
  5. package/.claude/commands/build.md +5 -4
  6. package/.claude/commands/debug.md +2 -1
  7. package/.claude/commands/handoff.md +94 -0
  8. package/.claude/commands/plan.md +1 -0
  9. package/.claude/commands/publish-npm.md +119 -0
  10. package/.claude/commands/resume.md +107 -0
  11. package/.claude/commands/spec.md +2 -1
  12. package/.claude/references/agent-continuity.md +42 -0
  13. package/.claude/references/codegraph.md +50 -0
  14. package/.claude/rules/agent-continuity.md +39 -0
  15. package/.claude/skills/agent-continuity/SKILL.md +70 -0
  16. package/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
  17. package/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
  18. package/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
  19. package/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
  20. package/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
  21. package/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
  22. package/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  23. package/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  24. package/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  25. package/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  26. package/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  27. package/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  28. package/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  29. package/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  30. package/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  31. package/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  32. package/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  33. package/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  34. package/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  35. package/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  36. package/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
  37. package/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
  38. package/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  39. package/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  40. package/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  41. package/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
  42. package/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  43. package/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
  44. package/.cursor/CURSOR.md +37 -5
  45. package/.cursor/commands/build.md +5 -4
  46. package/.cursor/commands/debug.md +2 -1
  47. package/.cursor/commands/handoff.md +94 -0
  48. package/.cursor/commands/plan.md +1 -0
  49. package/.cursor/commands/publish-npm.md +119 -0
  50. package/.cursor/commands/resume.md +107 -0
  51. package/.cursor/commands/spec.md +2 -1
  52. package/.cursor/mcp.json +15 -0
  53. package/.cursor/references/agent-continuity.md +42 -0
  54. package/.cursor/references/codegraph.md +87 -0
  55. package/.cursor/rules/agent-continuity.mdc +44 -0
  56. package/.cursor/rules/codegraph.mdc +47 -0
  57. package/.cursor/rules/cursor-overview.mdc +10 -3
  58. package/.cursor/skills/agent-continuity/SKILL.md +70 -0
  59. package/.cursor/skills/ui-ux-pro-max/SKILL.md +288 -0
  60. package/.cursor/skills/ui-ux-pro-max/data/charts.csv +26 -0
  61. package/.cursor/skills/ui-ux-pro-max/data/colors.csv +97 -0
  62. package/.cursor/skills/ui-ux-pro-max/data/icons.csv +101 -0
  63. package/.cursor/skills/ui-ux-pro-max/data/landing.csv +31 -0
  64. package/.cursor/skills/ui-ux-pro-max/data/products.csv +97 -0
  65. package/.cursor/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  66. package/.cursor/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  67. package/.cursor/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  68. package/.cursor/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  69. package/.cursor/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  70. package/.cursor/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  71. package/.cursor/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  72. package/.cursor/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  73. package/.cursor/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  74. package/.cursor/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  75. package/.cursor/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  76. package/.cursor/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  77. package/.cursor/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  78. package/.cursor/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  79. package/.cursor/skills/ui-ux-pro-max/data/styles.csv +68 -0
  80. package/.cursor/skills/ui-ux-pro-max/data/typography.csv +58 -0
  81. package/.cursor/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  82. package/.cursor/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  83. package/.cursor/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  84. package/.cursor/skills/ui-ux-pro-max/scripts/core.py +253 -0
  85. package/.cursor/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  86. package/.cursor/skills/ui-ux-pro-max/scripts/search.py +114 -0
  87. package/.kiro/KIRO.md +146 -0
  88. package/.kiro/agents/backend.md +395 -0
  89. package/.kiro/agents/code-reviewer.md +110 -0
  90. package/.kiro/agents/copywriter-seo.md +236 -0
  91. package/.kiro/agents/frontend.md +384 -0
  92. package/.kiro/agents/project-manager.md +201 -0
  93. package/.kiro/agents/qa.md +221 -0
  94. package/.kiro/agents/security-auditor.md +143 -0
  95. package/.kiro/agents/systems-architect.md +211 -0
  96. package/.kiro/agents/test-engineer.md +123 -0
  97. package/.kiro/agents/ui-ux-designer.md +210 -0
  98. package/.kiro/commands/build.md +133 -0
  99. package/.kiro/commands/debug.md +243 -0
  100. package/.kiro/commands/deploy.md +40 -0
  101. package/.kiro/commands/fix-issue.md +42 -0
  102. package/.kiro/commands/handoff.md +94 -0
  103. package/.kiro/commands/plan.md +126 -0
  104. package/.kiro/commands/publish-npm.md +119 -0
  105. package/.kiro/commands/resume.md +107 -0
  106. package/.kiro/commands/review.md +50 -0
  107. package/.kiro/commands/simplify.md +222 -0
  108. package/.kiro/commands/spec.md +96 -0
  109. package/.kiro/commands/test.md +214 -0
  110. package/.kiro/references/accessibility-checklist.md +174 -0
  111. package/.kiro/references/agent-continuity.md +42 -0
  112. package/.kiro/references/codegraph.md +86 -0
  113. package/.kiro/references/performance-checklist.md +150 -0
  114. package/.kiro/references/security-checklist.md +94 -0
  115. package/.kiro/references/testing-patterns.md +183 -0
  116. package/.kiro/settings/mcp.json +15 -0
  117. package/.kiro/settings.json +8 -0
  118. package/.kiro/skills/agent-continuity/SKILL.md +70 -0
  119. package/.kiro/skills/code-review/SKILL.md +208 -0
  120. package/.kiro/skills/deploy/SKILL.md +68 -0
  121. package/.kiro/skills/deploy/deploy.md +735 -0
  122. package/.kiro/skills/incremental-implementation/SKILL.md +210 -0
  123. package/.kiro/skills/security-review/SKILL.md +71 -0
  124. package/.kiro/skills/tdd/SKILL.md +217 -0
  125. package/.kiro/skills/ui-ux-pro-max/SKILL.md +288 -0
  126. package/.kiro/skills/ui-ux-pro-max/data/charts.csv +26 -0
  127. package/.kiro/skills/ui-ux-pro-max/data/colors.csv +97 -0
  128. package/.kiro/skills/ui-ux-pro-max/data/icons.csv +101 -0
  129. package/.kiro/skills/ui-ux-pro-max/data/landing.csv +31 -0
  130. package/.kiro/skills/ui-ux-pro-max/data/products.csv +97 -0
  131. package/.kiro/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  132. package/.kiro/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  133. package/.kiro/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  134. package/.kiro/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  135. package/.kiro/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  136. package/.kiro/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  137. package/.kiro/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  138. package/.kiro/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  139. package/.kiro/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  140. package/.kiro/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  141. package/.kiro/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  142. package/.kiro/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  143. package/.kiro/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  144. package/.kiro/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  145. package/.kiro/skills/ui-ux-pro-max/data/styles.csv +68 -0
  146. package/.kiro/skills/ui-ux-pro-max/data/typography.csv +58 -0
  147. package/.kiro/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  148. package/.kiro/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  149. package/.kiro/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  150. package/.kiro/skills/ui-ux-pro-max/scripts/core.py +253 -0
  151. package/.kiro/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  152. package/.kiro/skills/ui-ux-pro-max/scripts/search.py +114 -0
  153. package/.kiro/steering/agent-continuity.md +44 -0
  154. package/.kiro/steering/api-conventions.md +85 -0
  155. package/.kiro/steering/clean-code.md +211 -0
  156. package/.kiro/steering/code-style.md +92 -0
  157. package/.kiro/steering/codegraph.md +47 -0
  158. package/.kiro/steering/database.md +66 -0
  159. package/.kiro/steering/error-handling.md +98 -0
  160. package/.kiro/steering/git-workflow.md +83 -0
  161. package/.kiro/steering/kiro-overview.md +38 -0
  162. package/.kiro/steering/monitoring.md +317 -0
  163. package/.kiro/steering/naming-conventions.md +266 -0
  164. package/.kiro/steering/project-structure.md +71 -0
  165. package/.kiro/steering/security.md +95 -0
  166. package/.kiro/steering/system-design.md +168 -0
  167. package/.kiro/steering/tech-stack.md +462 -0
  168. package/.kiro/steering/testing.md +110 -0
  169. package/AGENTS.md +13 -7
  170. package/README.md +126 -18
  171. package/bin/class-ai-agent.cjs +165 -11
  172. package/package.json +10 -4
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: debug
3
+ description: Systematic debugging and error recovery — find root cause, not symptoms
4
+ ---
5
+
6
+ # /debug — Debugging & Error Recovery
7
+
8
+ > "Fix root causes, not symptoms."
9
+
10
+ ## Purpose
11
+
12
+ Systematically diagnose and fix errors. Stop feature work, preserve evidence, find root cause, add guards, then resume.
13
+
14
+ ## The Stop-the-Line Rule
15
+
16
+ When unexpected failures occur:
17
+
18
+ 1. **STOP** — Halt feature work immediately
19
+ 2. **PRESERVE** — Save error messages, logs, stack traces
20
+ 3. **DIAGNOSE** — Follow the 6-step triage process
21
+ 4. **FIX** — Address root cause, not symptoms
22
+ 5. **GUARD** — Add tests to prevent recurrence
23
+ 6. **RESUME** — Only continue after verification; update `.agent/SESSION.md` with root cause, guard tests, and **Next**
24
+
25
+ ---
26
+
27
+ ## 6-Step Triage Process
28
+
29
+ ### Step 1: Reproduce
30
+
31
+ Make the failure happen reliably.
32
+
33
+ ```bash
34
+ # Run the failing test
35
+ npm test -- --grep "failing test name"
36
+
37
+ # Or reproduce manually with specific steps
38
+ ```
39
+
40
+ **If not reproducible**, investigate:
41
+ - Timing/race conditions
42
+ - Environment differences (dev vs CI)
43
+ - State leakage between tests
44
+ - Random/flaky behavior
45
+
46
+ ### Step 2: Localize
47
+
48
+ Identify which layer fails:
49
+
50
+ | Layer | Symptoms |
51
+ |-------|----------|
52
+ | **UI/Frontend** | Render errors, missing elements, wrong display |
53
+ | **API/Backend** | HTTP errors, wrong responses, timeout |
54
+ | **Database** | Query errors, constraint violations, missing data |
55
+ | **Build** | Compilation errors, missing dependencies |
56
+ | **External** | Third-party API failures, network issues |
57
+ | **Test itself** | Flaky assertion, wrong expectations |
58
+
59
+ **Use `git bisect` for regressions:**
60
+
61
+ ```bash
62
+ git bisect start
63
+ git bisect bad HEAD
64
+ git bisect good <last-known-good-commit>
65
+ # Git will guide you to the breaking commit
66
+ ```
67
+
68
+ ### Step 3: Reduce
69
+
70
+ Strip away unrelated elements:
71
+
72
+ ```javascript
73
+ // Original complex failing code
74
+ const result = await complexFunction(
75
+ await getConfig(),
76
+ await fetchData(),
77
+ processOptions(opts)
78
+ );
79
+
80
+ // Reduced to find the problem
81
+ const config = await getConfig();
82
+ console.log('config:', config); // Check each step
83
+
84
+ const data = await fetchData();
85
+ console.log('data:', data);
86
+
87
+ const result = await complexFunction(config, data, opts);
88
+ ```
89
+
90
+ ### Step 4: Fix Root Cause
91
+
92
+ **Fix the actual problem, not the symptom:**
93
+
94
+ | Symptom | Bad Fix | Good Fix |
95
+ |---------|---------|----------|
96
+ | Duplicate list items | Dedupe in UI | Fix query returning duplicates |
97
+ | Null reference error | Add `?.` everywhere | Ensure data is loaded before access |
98
+ | Slow API response | Increase timeout | Optimize the query |
99
+ | Flaky test | Add retry logic | Fix the race condition |
100
+
101
+ ### Step 5: Guard Against Recurrence
102
+
103
+ Write a test that catches this specific failure:
104
+
105
+ ```javascript
106
+ it('should not return duplicate items (regression #123)', async () => {
107
+ // Setup that caused the original bug
108
+ await createOrder({ items: [item, item] });
109
+
110
+ // The query that was returning duplicates
111
+ const result = await getOrderItems();
112
+
113
+ // Guard: ensure no duplicates
114
+ const ids = result.map(r => r.id);
115
+ expect(ids).toEqual([...new Set(ids)]);
116
+ });
117
+ ```
118
+
119
+ ### Step 6: Verify End-to-End
120
+
121
+ ```bash
122
+ # Run the specific test
123
+ npm test -- --grep "regression"
124
+
125
+ # Run full test suite
126
+ npm test
127
+
128
+ # Run build
129
+ npm run build
130
+
131
+ # Manual verification if needed
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Error-Specific Triage Trees
137
+
138
+ ### Test Failure
139
+
140
+ ```
141
+ Test fails
142
+ ├── Assertion error
143
+ │ ├── Expected value wrong → Check test expectation
144
+ │ └── Actual value wrong → Debug implementation
145
+ ├── Runtime error
146
+ │ ├── ReferenceError → Check imports, variable names
147
+ │ ├── TypeError → Check types, null checks
148
+ │ └── NetworkError → Check test setup, mocks
149
+ └── Timeout
150
+ ├── Async not awaited → Add missing await
151
+ └── Infinite loop → Check loop conditions
152
+ ```
153
+
154
+ ### Build Error
155
+
156
+ ```
157
+ Build fails
158
+ ├── TypeScript error
159
+ │ ├── Type mismatch → Fix types or add assertion
160
+ │ └── Missing import → Add import statement
161
+ ├── Module not found
162
+ │ ├── Package missing → npm install
163
+ │ └── Path wrong → Fix import path
164
+ └── Syntax error
165
+ └── Check recent changes → git diff
166
+ ```
167
+
168
+ ### Runtime Error
169
+
170
+ ```
171
+ Runtime error
172
+ ├── API returns error
173
+ │ ├── 4xx → Client issue, check request
174
+ │ └── 5xx → Server issue, check logs
175
+ ├── CORS error
176
+ │ └── Check server CORS config
177
+ ├── Undefined/null
178
+ │ └── Add loading state or null check
179
+ └── Network timeout
180
+ └── Check connectivity, increase timeout
181
+ ```
182
+
183
+ ---
184
+
185
+ ## Debugging Tools
186
+
187
+ ### Console Logging (Temporary)
188
+
189
+ ```javascript
190
+ // Add strategic logs
191
+ console.log('[DEBUG] Input:', input);
192
+ console.log('[DEBUG] After transform:', result);
193
+
194
+ // Remove all debug logs before commit
195
+ git diff | grep console.log
196
+ ```
197
+
198
+ ### Node Inspector
199
+
200
+ ```bash
201
+ # Debug Node.js
202
+ node --inspect-brk src/index.js
203
+
204
+ # Debug tests
205
+ node --inspect-brk node_modules/.bin/vitest
206
+ ```
207
+
208
+ ### Git Bisect
209
+
210
+ ```bash
211
+ git bisect start
212
+ git bisect bad # Current commit is broken
213
+ git bisect good abc123 # This commit was working
214
+ # Test each commit git suggests
215
+ git bisect good # or git bisect bad
216
+ git bisect reset # When done
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Common Rationalizations (Avoid These)
222
+
223
+ | Excuse | Reality |
224
+ |--------|---------|
225
+ | "It works on my machine" | Environment differences are bugs |
226
+ | "It's just flaky" | Flaky tests have root causes |
227
+ | "Let's just retry" | Retries hide real problems |
228
+ | "It's a third-party issue" | Still need to handle gracefully |
229
+ | "We'll fix it later" | Tech debt compounds |
230
+
231
+ ---
232
+
233
+ ## Output
234
+
235
+ - Root cause identified and fixed
236
+ - Regression test added
237
+ - All tests passing
238
+ - Clear commit message explaining the fix
239
+ - **`.agent/SESSION.md`** updated (Gotchas, Decisions, **Next**)
240
+
241
+ ## Next Step
242
+
243
+ After fixing, continue with `/build` or run `/review` for verification.
@@ -0,0 +1,40 @@
1
+ # Deploy Command
2
+
3
+ ## Description
4
+ Deploy the application to the target environment.
5
+
6
+ ## Usage
7
+ Tell Claude: "Run the deploy command" or "Deploy to [environment]"
8
+
9
+ ## Steps
10
+
11
+ ### 1. Pre-deploy Checklist
12
+ - [ ] All tests pass (`npm test`)
13
+ - [ ] No linting errors (`npm run lint`)
14
+ - [ ] Environment variables are configured
15
+ - [ ] Database migrations are ready
16
+
17
+ ### 2. Build
18
+ ```bash
19
+ npm run build
20
+ ```
21
+
22
+ ### 3. Deploy
23
+ ```bash
24
+ # Development
25
+ npm run deploy:dev
26
+
27
+ # Production
28
+ npm run deploy:prod
29
+ ```
30
+
31
+ ### 4. Post-deploy Verification
32
+ - Check application health endpoint
33
+ - Verify logs for errors
34
+ - Run smoke tests
35
+
36
+ ## Rollback
37
+ If deployment fails:
38
+ ```bash
39
+ npm run rollback
40
+ ```
@@ -0,0 +1,42 @@
1
+ # Fix Issue Command
2
+
3
+ ## Description
4
+ Analyze and fix a reported bug or issue systematically.
5
+
6
+ ## Usage
7
+ Tell Claude: "Fix issue: [describe the issue]" or "Fix bug in [file/module]"
8
+
9
+ ## Process
10
+
11
+ ### 1. Understand the Issue
12
+ - Read the error message or bug description carefully
13
+ - Identify the affected component(s)
14
+ - Reproduce the issue locally if possible
15
+
16
+ ### 2. Root Cause Analysis
17
+ - Check recent git changes: `git log --oneline -20`
18
+ - Review affected files
19
+ - Look for related tests that may reveal expected behavior
20
+
21
+ ### 3. Plan the Fix
22
+ - Identify the minimal change needed
23
+ - Consider side effects on other components
24
+ - Update or add tests to cover the fix
25
+
26
+ ### 4. Implement
27
+ - Make the targeted fix
28
+ - Ensure code follows `.claude/rules/code-style.md`
29
+ - Handle errors per `.claude/rules/error-handling.md`
30
+
31
+ ### 5. Verify
32
+ - Run relevant tests: `npm test -- --testPathPattern=[affected]`
33
+ - Run full test suite: `npm test`
34
+ - Check linting: `npm run lint`
35
+
36
+ ### 6. Commit
37
+ Follow `.claude/rules/git-workflow.md`:
38
+ ```
39
+ fix: [short description of the fix]
40
+
41
+ Closes #[issue-number]
42
+ ```
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: handoff
3
+ description: End-of-session — update .agent/SESSION.md for the next agent or tool
4
+ ---
5
+
6
+ # /handoff — Session handoff
7
+
8
+ > "Leave the next agent a map, not a maze."
9
+
10
+ ## Purpose
11
+
12
+ Capture current work in **`.agent/SESSION.md`** so another chat, persona, or tool (Cursor, Claude Code, Kiro) can continue without re-discovering context.
13
+
14
+ ## When to use
15
+
16
+ - End of a work session (before closing chat)
17
+ - Switching tools (Cursor → Claude Code → Kiro)
18
+ - Switching persona (e.g. architect → backend)
19
+ - After completing a workflow phase (spec, plan, build, test, review)
20
+ - Before opening a PR (document what reviewers should know)
21
+
22
+ ## Prerequisites
23
+
24
+ - `.agent/SESSION.md` exists (created by `npx class-ai-agent` or copy from `.agent/SESSION.template.md`)
25
+ - You have context on what was done this session
26
+
27
+ ## Workflow
28
+
29
+ ### Phase 1: Gather state
30
+
31
+ 1. **Review git** — branch name, uncommitted files, last commits
32
+ 2. **Review tasks** — open `tasks/todo.md`; sync checkboxes with reality
33
+ 3. **Review spec** — note linked `SPEC.md` or `docs/specs/...` path
34
+ 4. **Scan decisions** — what did we choose that is not obvious from code alone?
35
+ 5. **Scan gotchas** — what failed, env quirks, commands that matter
36
+
37
+ ### Phase 2: Update `.agent/SESSION.md`
38
+
39
+ Refresh every section (use `.agent/SESSION.template.md` as schema):
40
+
41
+ | Section | Content |
42
+ |---------|---------|
43
+ | **Meta** | `Updated` (today), `Phase`, `Tool` (cursor/claude/kiro), optional `Persona` |
44
+ | **Goal** | One paragraph — still accurate? |
45
+ | **Done** | Bullets with file paths or commit refs |
46
+ | **In progress** | Current task; **Blockers** (none or describe) |
47
+ | **Next** | Numbered steps for the *next* agent |
48
+ | **Decisions** | Non-obvious choices made this session |
49
+ | **Gotchas** | Failed attempts, test commands, env notes |
50
+ | **Pointers** | Spec path, `tasks/todo.md`, branch, key files |
51
+
52
+ ### Phase 3: Sync `tasks/todo.md`
53
+
54
+ - Mark completed items `[x]`
55
+ - Add new tasks discovered during work
56
+ - Remove or defer items that are out of scope
57
+
58
+ ### Phase 4: Risk note (if applicable)
59
+
60
+ If work is **not** safe to pick up blindly, add under **Gotchas** or **In progress**:
61
+
62
+ - Uncommitted changes and why
63
+ - Failing tests or broken build
64
+ - External blockers (API, review, dependency)
65
+
66
+ ### Phase 5: Optional milestone archive
67
+
68
+ For major milestones, copy `SESSION.md` to:
69
+
70
+ ```
71
+ .agent/history/YYYY-MM-DD-short-slug.md
72
+ ```
73
+
74
+ Commit both `SESSION.md` and the history file when ready.
75
+
76
+ ## Security
77
+
78
+ **Never** write to `SESSION.md`:
79
+
80
+ - API keys, passwords, tokens, credentials
81
+ - PII or customer data
82
+ - Full stack traces with secrets
83
+
84
+ Use issue links or commit SHAs instead.
85
+
86
+ ## Output
87
+
88
+ - Updated **`.agent/SESSION.md`**
89
+ - Updated **`tasks/todo.md`** (if it exists)
90
+ - Short summary for the user: phase, next steps, blockers
91
+
92
+ ## Next step
93
+
94
+ Tell the user to run **`/resume`** in the next session or tool, or commit and share the branch.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: plan
3
+ description: Decompose specs into small, verifiable tasks with dependency ordering
4
+ ---
5
+
6
+ # /plan — Planning & Task Breakdown
7
+
8
+ > "Vertical slices, not horizontal layers."
9
+
10
+ ## Purpose
11
+
12
+ Transform a specification into an ordered list of small, verifiable tasks. Each task delivers end-to-end functionality.
13
+
14
+ ## Prerequisites
15
+
16
+ - A specification exists (`SPEC.md` or described requirements)
17
+ - Understanding of the codebase structure
18
+
19
+ ## Workflow
20
+
21
+ ### Phase 1: Analysis (Read-Only)
22
+
23
+ 1. **Read the spec** — Understand objectives and acceptance criteria
24
+ 2. **Survey the codebase** — Identify relevant files, patterns, and integration points
25
+ 3. **Map dependencies** — Which components depend on which?
26
+
27
+ > **Do NOT modify code during planning.**
28
+
29
+ ### Phase 2: Vertical Slicing
30
+
31
+ Break work into **vertical slices** — each slice delivers complete functionality through all layers:
32
+
33
+ ```
34
+ ❌ Horizontal (anti-pattern):
35
+ Task 1: Create all DB models
36
+ Task 2: Create all API routes
37
+ Task 3: Create all UI components
38
+
39
+ ✅ Vertical (correct):
40
+ Task 1: User can create a task (DB + API + UI)
41
+ Task 2: User can view task list (DB + API + UI)
42
+ Task 3: User can mark task complete (DB + API + UI)
43
+ ```
44
+
45
+ ### Phase 3: Task Definition
46
+
47
+ Each task must include:
48
+
49
+ ```markdown
50
+ ## Task: [Short description]
51
+
52
+ **Objective**: [What this achieves]
53
+
54
+ **Files to modify**:
55
+ - `src/models/task.ts`
56
+ - `src/routes/tasks.ts`
57
+ - `src/components/TaskList.tsx`
58
+
59
+ **Acceptance Criteria**:
60
+ - [ ] User can [action]
61
+ - [ ] [Validation] is enforced
62
+ - [ ] Test covers [scenario]
63
+
64
+ **Dependencies**: [Task IDs this depends on]
65
+
66
+ **Verification**:
67
+ - [ ] Unit tests pass
68
+ - [ ] Integration test added
69
+ - [ ] Manual verification: [steps]
70
+ ```
71
+
72
+ ### Phase 4: Ordering
73
+
74
+ Order tasks by:
75
+ 1. **Foundation first** — DB models, types, shared utilities
76
+ 2. **Risk-first** — Tackle uncertain/complex items early
77
+ 3. **Dependencies** — Respect the dependency graph
78
+ 4. **Quick wins** — Early momentum with smaller tasks
79
+
80
+ ### Phase 5: Checkpoints
81
+
82
+ Insert checkpoints between major phases:
83
+
84
+ ```markdown
85
+ ---
86
+ ## Checkpoint: Core CRUD Complete
87
+
88
+ **Verify before proceeding**:
89
+ - [ ] All CRUD operations work
90
+ - [ ] Test coverage > 80%
91
+ - [ ] No console errors
92
+ - [ ] Performance acceptable
93
+
94
+ ---
95
+ ```
96
+
97
+ ## Output
98
+
99
+ Save to `tasks/` directory:
100
+
101
+ - `tasks/plan.md` — Full planning document with context
102
+ - `tasks/todo.md` — Actionable task checklist
103
+ - **`.agent/SESSION.md`** — Update Meta `phase` to `build`, **Pointers** → `tasks/todo.md` and spec path, **Next** → first `/build` task
104
+
105
+ ```markdown
106
+ # TODO: [Feature Name]
107
+
108
+ ## Phase 1: Foundation
109
+ - [ ] Task 1.1: [Description]
110
+ - [ ] Task 1.2: [Description]
111
+
112
+ ## Checkpoint: Foundation Complete
113
+
114
+ ## Phase 2: Core Features
115
+ - [ ] Task 2.1: [Description]
116
+ - [ ] Task 2.2: [Description]
117
+
118
+ ## Checkpoint: Core Complete
119
+
120
+ ## Phase 3: Polish
121
+ - [ ] Task 3.1: [Description]
122
+ ```
123
+
124
+ ## Next Step
125
+
126
+ After plan is approved, run `/build` to implement tasks incrementally.
@@ -0,0 +1,119 @@
1
+ # Publish to npm (maintainers)
2
+
3
+ ## Description
4
+
5
+ Publish **`class-ai-agent`** to the npm registry: draft release notes from git, get maintainer approval, update README, bump version, verify CLI, publish.
6
+
7
+ ## Triggers
8
+
9
+ Use when the maintainer says any of:
10
+
11
+ - **push to npm repo**
12
+ - **publish to npm**
13
+ - **publish class-ai-agent**
14
+
15
+ Or **@ mention this file** in Chat/Composer (`.cursor/commands/publish-npm.md` in Cursor; `.kiro/commands/publish-npm.md` in Kiro).
16
+
17
+ ## Prerequisites
18
+
19
+ - Changes are ready to ship; working tree reflects what you are publishing.
20
+ - **`npm login`** completed for the `class-ai-agent` package scope.
21
+ - Two-factor auth enabled for npm **writes** if the account requires it (see README *Publishing to npm*).
22
+
23
+ ## Workflow
24
+
25
+ ### 1. Resolve baseline version
26
+
27
+ ```bash
28
+ git tag -l 'v*' --sort=-v:refname | head -1
29
+ ```
30
+
31
+ If no `v*` tags exist, use the latest `### x.y.z` heading under **## Release notes** in README, or `package.json` version as the last shipped baseline.
32
+
33
+ Strip a leading `v` from tags when comparing to semver (e.g. `v1.2.4` → `1.2.4`).
34
+
35
+ ### 2. Draft release notes (do not publish yet)
36
+
37
+ ```bash
38
+ git log <lastTagOrBaseline>..HEAD --pretty=format:'- %s (%h)'
39
+ ```
40
+
41
+ - Group related commits; rewrite subjects for user-facing clarity.
42
+ - Drop noise (merge commits, duplicate WIP messages) unless relevant.
43
+ - Present the bullet list to the maintainer and **wait for explicit approval or edits**.
44
+
45
+ ### 3. Confirm version bump
46
+
47
+ Default: **`patch`** (`npm version patch --no-git-tag-version`).
48
+
49
+ Use **`minor`** or **`major`** only if the maintainer requests it.
50
+
51
+ ### 4. Bump version
52
+
53
+ ```bash
54
+ npm version patch --no-git-tag-version # or minor | major
55
+ ```
56
+
57
+ Read the new version from `package.json`.
58
+
59
+ ### 5. Update README
60
+
61
+ Prefer the helper script after approval (write bullets to a temp file):
62
+
63
+ ```bash
64
+ npm run release:readme -- --version NEW_VERSION --date YYYY-MM-DD --notes-file /path/to/notes.md
65
+ ```
66
+
67
+ `notes.md` should contain one bullet per line (with or without leading `- `).
68
+
69
+ If **## Release notes** is missing, add it before **## Contributing** first, then run the script.
70
+
71
+ Fallback: manually insert at the top of **## Release notes**:
72
+
73
+ ```markdown
74
+ ### NEW_VERSION — YYYY-MM-DD
75
+
76
+ - …
77
+ ```
78
+
79
+ And sync the version badge: `version-NEW_VERSION` in the shields.io img (line ~21).
80
+
81
+ ### 6. Verify CLI
82
+
83
+ ```bash
84
+ npm run test:cli
85
+ ```
86
+
87
+ Stop on failure; do not publish.
88
+
89
+ ### 7. Publish
90
+
91
+ ```bash
92
+ npm publish --access public
93
+ ```
94
+
95
+ If npm prompts for **OTP**, the maintainer enters it in the terminal.
96
+
97
+ On **403 / cannot publish over previously published versions**: bump with `npm version patch --no-git-tag-version` and retry (each semver can only be published once).
98
+
99
+ ### 8. Report
100
+
101
+ Tell the maintainer:
102
+
103
+ - Published version (from `package.json`)
104
+ - https://www.npmjs.com/package/class-ai-agent
105
+
106
+ **Do not** `git commit`, tag, or push unless the maintainer separately asks.
107
+
108
+ ## Maintainer quick reference
109
+
110
+ | Step | Command / action |
111
+ |------|------------------|
112
+ | Draft | `git log <tag>..HEAD --pretty=format:'- %s (%h)'` |
113
+ | Approve | Maintainer edits bullets in chat |
114
+ | Bump | `npm version patch --no-git-tag-version` |
115
+ | README | `npm run release:readme -- --version … --notes-file …` |
116
+ | Test | `npm run test:cli` |
117
+ | Publish | `npm publish --access public` |
118
+
119
+ See also [README — Publishing to npm](../../README.md#publishing-to-npm-maintainers) and [README — Release notes](../../README.md#release-notes).