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.
- package/.agent/README.md +33 -0
- package/.agent/SESSION.md +54 -0
- package/.agent/SESSION.template.md +46 -0
- package/.claude/CLAUDE.md +21 -6
- package/.claude/commands/build.md +5 -4
- package/.claude/commands/debug.md +2 -1
- package/.claude/commands/handoff.md +94 -0
- package/.claude/commands/plan.md +1 -0
- package/.claude/commands/publish-npm.md +119 -0
- package/.claude/commands/resume.md +107 -0
- package/.claude/commands/spec.md +2 -1
- package/.claude/references/agent-continuity.md +42 -0
- package/.claude/references/codegraph.md +50 -0
- package/.claude/rules/agent-continuity.md +39 -0
- package/.claude/skills/agent-continuity/SKILL.md +70 -0
- package/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.cursor/CURSOR.md +37 -5
- package/.cursor/commands/build.md +5 -4
- package/.cursor/commands/debug.md +2 -1
- package/.cursor/commands/handoff.md +94 -0
- package/.cursor/commands/plan.md +1 -0
- package/.cursor/commands/publish-npm.md +119 -0
- package/.cursor/commands/resume.md +107 -0
- package/.cursor/commands/spec.md +2 -1
- package/.cursor/mcp.json +15 -0
- package/.cursor/references/agent-continuity.md +42 -0
- package/.cursor/references/codegraph.md +87 -0
- package/.cursor/rules/agent-continuity.mdc +44 -0
- package/.cursor/rules/codegraph.mdc +47 -0
- package/.cursor/rules/cursor-overview.mdc +10 -3
- package/.cursor/skills/agent-continuity/SKILL.md +70 -0
- package/.cursor/skills/ui-ux-pro-max/SKILL.md +288 -0
- package/.cursor/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.cursor/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.cursor/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.cursor/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.cursor/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.cursor/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.cursor/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.cursor/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.cursor/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.cursor/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.cursor/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.cursor/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.cursor/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.cursor/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.cursor/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.kiro/KIRO.md +146 -0
- package/.kiro/agents/backend.md +395 -0
- package/.kiro/agents/code-reviewer.md +110 -0
- package/.kiro/agents/copywriter-seo.md +236 -0
- package/.kiro/agents/frontend.md +384 -0
- package/.kiro/agents/project-manager.md +201 -0
- package/.kiro/agents/qa.md +221 -0
- package/.kiro/agents/security-auditor.md +143 -0
- package/.kiro/agents/systems-architect.md +211 -0
- package/.kiro/agents/test-engineer.md +123 -0
- package/.kiro/agents/ui-ux-designer.md +210 -0
- package/.kiro/commands/build.md +133 -0
- package/.kiro/commands/debug.md +243 -0
- package/.kiro/commands/deploy.md +40 -0
- package/.kiro/commands/fix-issue.md +42 -0
- package/.kiro/commands/handoff.md +94 -0
- package/.kiro/commands/plan.md +126 -0
- package/.kiro/commands/publish-npm.md +119 -0
- package/.kiro/commands/resume.md +107 -0
- package/.kiro/commands/review.md +50 -0
- package/.kiro/commands/simplify.md +222 -0
- package/.kiro/commands/spec.md +96 -0
- package/.kiro/commands/test.md +214 -0
- package/.kiro/references/accessibility-checklist.md +174 -0
- package/.kiro/references/agent-continuity.md +42 -0
- package/.kiro/references/codegraph.md +86 -0
- package/.kiro/references/performance-checklist.md +150 -0
- package/.kiro/references/security-checklist.md +94 -0
- package/.kiro/references/testing-patterns.md +183 -0
- package/.kiro/settings/mcp.json +15 -0
- package/.kiro/settings.json +8 -0
- package/.kiro/skills/agent-continuity/SKILL.md +70 -0
- package/.kiro/skills/code-review/SKILL.md +208 -0
- package/.kiro/skills/deploy/SKILL.md +68 -0
- package/.kiro/skills/deploy/deploy.md +735 -0
- package/.kiro/skills/incremental-implementation/SKILL.md +210 -0
- package/.kiro/skills/security-review/SKILL.md +71 -0
- package/.kiro/skills/tdd/SKILL.md +217 -0
- package/.kiro/skills/ui-ux-pro-max/SKILL.md +288 -0
- package/.kiro/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.kiro/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.kiro/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.kiro/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.kiro/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.kiro/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.kiro/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.kiro/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.kiro/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.kiro/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.kiro/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.kiro/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.kiro/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.kiro/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.kiro/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.kiro/steering/agent-continuity.md +44 -0
- package/.kiro/steering/api-conventions.md +85 -0
- package/.kiro/steering/clean-code.md +211 -0
- package/.kiro/steering/code-style.md +92 -0
- package/.kiro/steering/codegraph.md +47 -0
- package/.kiro/steering/database.md +66 -0
- package/.kiro/steering/error-handling.md +98 -0
- package/.kiro/steering/git-workflow.md +83 -0
- package/.kiro/steering/kiro-overview.md +38 -0
- package/.kiro/steering/monitoring.md +317 -0
- package/.kiro/steering/naming-conventions.md +266 -0
- package/.kiro/steering/project-structure.md +71 -0
- package/.kiro/steering/security.md +95 -0
- package/.kiro/steering/system-design.md +168 -0
- package/.kiro/steering/tech-stack.md +462 -0
- package/.kiro/steering/testing.md +110 -0
- package/AGENTS.md +13 -7
- package/README.md +126 -18
- package/bin/class-ai-agent.cjs +165 -11
- package/package.json +10 -4
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Testing Patterns Reference
|
|
2
|
+
|
|
3
|
+
> Quick reference for test patterns. See `.claude/rules/testing.md` for full rules.
|
|
4
|
+
|
|
5
|
+
## Test Pyramid
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
┌─────────┐
|
|
9
|
+
│ E2E │ 5% Critical user flows
|
|
10
|
+
├─────────┤
|
|
11
|
+
│ Integ │ 15% API + DB interactions
|
|
12
|
+
├─────────┤
|
|
13
|
+
│ Unit │ 80% Pure logic, fast
|
|
14
|
+
└─────────┘
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Test Structure (AAA)
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
it('should [expected behavior] when [condition]', () => {
|
|
21
|
+
// Arrange — Setup
|
|
22
|
+
const user = createTestUser({ role: 'admin' });
|
|
23
|
+
|
|
24
|
+
// Act — Execute
|
|
25
|
+
const result = checkPermission(user, 'delete');
|
|
26
|
+
|
|
27
|
+
// Assert — Verify
|
|
28
|
+
expect(result).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Unit Test Example
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
describe('calculateDiscount', () => {
|
|
36
|
+
it('should return 10% for orders over $100', () => {
|
|
37
|
+
expect(calculateDiscount(150)).toBe(15);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should return 0 for orders under $100', () => {
|
|
41
|
+
expect(calculateDiscount(50)).toBe(0);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('should handle edge case at exactly $100', () => {
|
|
45
|
+
expect(calculateDiscount(100)).toBe(0);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Integration Test Example
|
|
51
|
+
|
|
52
|
+
```javascript
|
|
53
|
+
describe('POST /api/users', () => {
|
|
54
|
+
it('should create user and return 201', async () => {
|
|
55
|
+
const response = await request(app)
|
|
56
|
+
.post('/api/users')
|
|
57
|
+
.send({ email: 'test@example.com', name: 'Test' })
|
|
58
|
+
.set('Authorization', `Bearer ${token}`);
|
|
59
|
+
|
|
60
|
+
expect(response.status).toBe(201);
|
|
61
|
+
expect(response.body.data.email).toBe('test@example.com');
|
|
62
|
+
|
|
63
|
+
// Verify in database
|
|
64
|
+
const user = await db.user.findUnique({
|
|
65
|
+
where: { email: 'test@example.com' }
|
|
66
|
+
});
|
|
67
|
+
expect(user).toBeDefined();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## E2E Test Example (Playwright)
|
|
73
|
+
|
|
74
|
+
```javascript
|
|
75
|
+
test('user can complete checkout flow', async ({ page }) => {
|
|
76
|
+
// Login
|
|
77
|
+
await page.goto('/login');
|
|
78
|
+
await page.fill('[name="email"]', 'user@example.com');
|
|
79
|
+
await page.fill('[name="password"]', 'password');
|
|
80
|
+
await page.click('button[type="submit"]');
|
|
81
|
+
|
|
82
|
+
// Add to cart
|
|
83
|
+
await page.goto('/products/1');
|
|
84
|
+
await page.click('button:has-text("Add to Cart")');
|
|
85
|
+
|
|
86
|
+
// Checkout
|
|
87
|
+
await page.goto('/checkout');
|
|
88
|
+
await page.fill('[name="card"]', '4242424242424242');
|
|
89
|
+
await page.click('button:has-text("Pay")');
|
|
90
|
+
|
|
91
|
+
// Verify
|
|
92
|
+
await expect(page.locator('.success-message')).toBeVisible();
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## React Component Test
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
100
|
+
|
|
101
|
+
describe('Counter', () => {
|
|
102
|
+
it('should increment count when button clicked', () => {
|
|
103
|
+
render(<Counter initialCount={0} />);
|
|
104
|
+
|
|
105
|
+
const button = screen.getByRole('button', { name: /increment/i });
|
|
106
|
+
fireEvent.click(button);
|
|
107
|
+
|
|
108
|
+
expect(screen.getByText('Count: 1')).toBeInTheDocument();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Test Doubles
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
// 1. Real (preferred)
|
|
117
|
+
const db = createTestDatabase();
|
|
118
|
+
|
|
119
|
+
// 2. Fake (in-memory)
|
|
120
|
+
const fakeUserRepo = {
|
|
121
|
+
users: [],
|
|
122
|
+
create(user) { this.users.push(user); return user; },
|
|
123
|
+
findById(id) { return this.users.find(u => u.id === id); }
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// 3. Stub (canned response)
|
|
127
|
+
const stubbedApi = {
|
|
128
|
+
getUser: () => Promise.resolve({ id: '1', name: 'Test' })
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// 4. Mock (verify interactions — use sparingly)
|
|
132
|
+
const mockLogger = vi.fn();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Naming Convention
|
|
136
|
+
|
|
137
|
+
```javascript
|
|
138
|
+
// Pattern: should [expected] when [condition]
|
|
139
|
+
|
|
140
|
+
// ✅ Good
|
|
141
|
+
'should return null when user not found'
|
|
142
|
+
'should throw ValidationError when email invalid'
|
|
143
|
+
'should emit event when order placed'
|
|
144
|
+
|
|
145
|
+
// ❌ Bad
|
|
146
|
+
'works'
|
|
147
|
+
'test user'
|
|
148
|
+
'error handling'
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Anti-Patterns
|
|
152
|
+
|
|
153
|
+
| Pattern | Problem | Fix |
|
|
154
|
+
|---------|---------|-----|
|
|
155
|
+
| Testing internals | Breaks on refactor | Test behavior |
|
|
156
|
+
| Shared state | Tests affect each other | Reset in beforeEach |
|
|
157
|
+
| Flaky tests | Random failures | Deterministic data |
|
|
158
|
+
| Over-mocking | False confidence | Real implementations |
|
|
159
|
+
| No assertions | Test always passes | Assert outcomes |
|
|
160
|
+
| Magic numbers | Hard to understand | Named constants |
|
|
161
|
+
|
|
162
|
+
## Coverage Thresholds
|
|
163
|
+
|
|
164
|
+
```javascript
|
|
165
|
+
// vitest.config.js
|
|
166
|
+
coverage: {
|
|
167
|
+
thresholds: {
|
|
168
|
+
lines: 80,
|
|
169
|
+
branches: 80,
|
|
170
|
+
functions: 80,
|
|
171
|
+
statements: 80
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Commands
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
npm test # Run all tests
|
|
180
|
+
npm test -- --watch # Watch mode
|
|
181
|
+
npm test -- --coverage # Coverage report
|
|
182
|
+
npm run test:e2e # E2E tests
|
|
183
|
+
```
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"steering_dir": ".kiro/steering",
|
|
3
|
+
"commands_dir": ".kiro/commands",
|
|
4
|
+
"skills_dir": ".kiro/skills",
|
|
5
|
+
"agents_dir": ".kiro/agents",
|
|
6
|
+
"references_dir": ".kiro/references",
|
|
7
|
+
"note": "Parallels .cursor/settings.json. Kiro loads .kiro/steering/*.md and .kiro/settings/mcp.json."
|
|
8
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Agent Continuity
|
|
3
|
+
description: Cross-tool session handoff and resume via .agent/SESSION.md
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent Continuity Skill
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Keep **Cursor**, **Claude Code**, and **Kiro** aligned on the same in-flight work using committed **`.agent/SESSION.md`**.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## When to apply
|
|
15
|
+
|
|
16
|
+
| Situation | Action |
|
|
17
|
+
|-----------|--------|
|
|
18
|
+
| New chat, same feature | **Resume** — read SESSION first |
|
|
19
|
+
| End of session | **Handoff** — update SESSION |
|
|
20
|
+
| Switch IDE/tool | **Handoff** then **Resume** in new tool |
|
|
21
|
+
| Switch persona | Update Meta `persona`; handoff notes for next role |
|
|
22
|
+
| Phase change (plan → build) | Update Meta `phase` |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Handoff checklist
|
|
27
|
+
|
|
28
|
+
- [ ] Meta: date, phase, tool, persona
|
|
29
|
+
- [ ] Goal still accurate (one paragraph)
|
|
30
|
+
- [ ] Done: bullets with paths/commits
|
|
31
|
+
- [ ] In progress + blockers
|
|
32
|
+
- [ ] Next: numbered for next agent
|
|
33
|
+
- [ ] Decisions: non-obvious choices
|
|
34
|
+
- [ ] Gotchas: failures, test commands, env
|
|
35
|
+
- [ ] Pointers: spec, tasks, branch, key files
|
|
36
|
+
- [ ] `tasks/todo.md` synced
|
|
37
|
+
- [ ] No secrets or PII in SESSION
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Resume checklist
|
|
42
|
+
|
|
43
|
+
- [ ] Read `.agent/SESSION.md`
|
|
44
|
+
- [ ] Read `tasks/todo.md` if linked
|
|
45
|
+
- [ ] Read SPEC if linked
|
|
46
|
+
- [ ] `git status` vs SESSION expectations
|
|
47
|
+
- [ ] Run sanity build/test if Gotchas say so
|
|
48
|
+
- [ ] Post resumption summary to user
|
|
49
|
+
- [ ] Execute first **Next** step via workflow command
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## SESSION schema
|
|
54
|
+
|
|
55
|
+
See **`.agent/SESSION.template.md`** for the canonical sections.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Commands
|
|
60
|
+
|
|
61
|
+
| Command | File |
|
|
62
|
+
|---------|------|
|
|
63
|
+
| `/handoff` | `.cursor/commands/handoff.md` (`.claude/`, `.kiro/`) |
|
|
64
|
+
| `/resume` | `.cursor/commands/resume.md` |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Optional history
|
|
69
|
+
|
|
70
|
+
Copy SESSION to `.agent/history/YYYY-MM-DD-slug.md` at milestones; commit for audit trail.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Code Review & Quality
|
|
3
|
+
description: Five-axis code review for comprehensive quality assessment
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review & Quality Skill
|
|
7
|
+
|
|
8
|
+
## Philosophy
|
|
9
|
+
|
|
10
|
+
> "Approve a change when it definitely improves overall code health, even if it isn't perfect."
|
|
11
|
+
|
|
12
|
+
Progress over perfection. Continuous incremental improvement.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Five-Axis Review Framework
|
|
17
|
+
|
|
18
|
+
### Axis 1: Correctness
|
|
19
|
+
|
|
20
|
+
**Questions to ask:**
|
|
21
|
+
- Does the implementation match the specification?
|
|
22
|
+
- Are edge cases handled?
|
|
23
|
+
- Are error paths covered?
|
|
24
|
+
- Are there potential runtime issues?
|
|
25
|
+
- Off-by-one errors
|
|
26
|
+
- Race conditions
|
|
27
|
+
- Null/undefined access
|
|
28
|
+
- Resource leaks
|
|
29
|
+
|
|
30
|
+
**Test adequacy:**
|
|
31
|
+
- Do tests verify the claimed behavior?
|
|
32
|
+
- Are negative cases tested?
|
|
33
|
+
- Would a bug slip through?
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### Axis 2: Readability & Simplicity
|
|
38
|
+
|
|
39
|
+
**Questions to ask:**
|
|
40
|
+
- Can another engineer understand this without explanation?
|
|
41
|
+
- Are names clear and descriptive?
|
|
42
|
+
- Is control flow straightforward?
|
|
43
|
+
- Is the code organized logically?
|
|
44
|
+
|
|
45
|
+
**Complexity checks:**
|
|
46
|
+
- Deep nesting (> 3 levels)?
|
|
47
|
+
- Long functions (> 30 lines)?
|
|
48
|
+
- Clever tricks that obscure intent?
|
|
49
|
+
- Unnecessary abstractions?
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Axis 3: Architecture
|
|
54
|
+
|
|
55
|
+
**Questions to ask:**
|
|
56
|
+
- Does this follow existing patterns in the codebase?
|
|
57
|
+
- Are module boundaries respected?
|
|
58
|
+
- Is there code duplication that should be extracted?
|
|
59
|
+
- Is the abstraction level appropriate?
|
|
60
|
+
- Do dependencies flow in the right direction?
|
|
61
|
+
|
|
62
|
+
**Over-engineering checks:**
|
|
63
|
+
- Is this simpler than it needs to be?
|
|
64
|
+
- Are there abstractions "for future use"?
|
|
65
|
+
- Would a simpler approach work?
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### Axis 4: Security
|
|
70
|
+
|
|
71
|
+
**Input validation:**
|
|
72
|
+
- Is user input validated and sanitized?
|
|
73
|
+
- Are queries parameterized?
|
|
74
|
+
- Is output properly encoded?
|
|
75
|
+
|
|
76
|
+
**Authentication & Authorization:**
|
|
77
|
+
- Are auth checks in place?
|
|
78
|
+
- Is ownership verified for resources?
|
|
79
|
+
- Are permissions enforced?
|
|
80
|
+
|
|
81
|
+
**Secrets management:**
|
|
82
|
+
- No hardcoded secrets?
|
|
83
|
+
- Sensitive data excluded from logs?
|
|
84
|
+
- External data treated as untrusted?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### Axis 5: Performance
|
|
89
|
+
|
|
90
|
+
**Common issues:**
|
|
91
|
+
- N+1 query patterns?
|
|
92
|
+
- Unbounded operations (loops, queries)?
|
|
93
|
+
- Missing pagination?
|
|
94
|
+
- Unnecessary re-renders (React)?
|
|
95
|
+
- Objects created in hot paths?
|
|
96
|
+
- Missing indexes for queries?
|
|
97
|
+
|
|
98
|
+
**Async handling:**
|
|
99
|
+
- Are async operations properly awaited?
|
|
100
|
+
- Could operations be parallelized?
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Change Sizing Guidelines
|
|
105
|
+
|
|
106
|
+
| Size | Lines | Guidance |
|
|
107
|
+
|------|-------|----------|
|
|
108
|
+
| **Ideal** | ~100 | Easy to review thoroughly |
|
|
109
|
+
| **Acceptable** | ~300 | Requires focused review |
|
|
110
|
+
| **Too Large** | 1000+ | Split into smaller PRs |
|
|
111
|
+
|
|
112
|
+
Each PR should be **one logical change**, not an entire feature.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Comment Severity Labels
|
|
117
|
+
|
|
118
|
+
Use prefixes to clarify intent:
|
|
119
|
+
|
|
120
|
+
| Label | Meaning | Action Required |
|
|
121
|
+
|-------|---------|-----------------|
|
|
122
|
+
| (none) | Required change | Must fix before merge |
|
|
123
|
+
| `Critical:` | Merge blocker | Must fix before merge |
|
|
124
|
+
| `Nit:` | Minor/style | Optional, author's choice |
|
|
125
|
+
| `Optional:` | Suggestion | Consider, not required |
|
|
126
|
+
| `FYI:` | Informational | No action needed |
|
|
127
|
+
|
|
128
|
+
**Examples:**
|
|
129
|
+
```
|
|
130
|
+
Critical: This allows SQL injection via the `name` parameter.
|
|
131
|
+
|
|
132
|
+
Nit: Consider renaming `data` to `userData` for clarity.
|
|
133
|
+
|
|
134
|
+
Optional: You could use `Array.from()` here instead of spread.
|
|
135
|
+
|
|
136
|
+
FYI: We have a shared utility for this in `src/utils/format.ts`.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Review Process
|
|
142
|
+
|
|
143
|
+
### Step 1: Understand Context
|
|
144
|
+
|
|
145
|
+
- What is this PR trying to achieve?
|
|
146
|
+
- Is there a linked issue or spec?
|
|
147
|
+
- What's the scope of changes?
|
|
148
|
+
|
|
149
|
+
### Step 2: Review Tests First
|
|
150
|
+
|
|
151
|
+
Tests reveal:
|
|
152
|
+
- What behavior is expected
|
|
153
|
+
- What edge cases are considered
|
|
154
|
+
- Whether coverage is adequate
|
|
155
|
+
|
|
156
|
+
### Step 3: Examine Implementation
|
|
157
|
+
|
|
158
|
+
Walk through changes with the 5 axes in mind.
|
|
159
|
+
|
|
160
|
+
### Step 4: Categorize Findings
|
|
161
|
+
|
|
162
|
+
- **Must fix** — Correctness, security, critical bugs
|
|
163
|
+
- **Should fix** — Readability, architecture concerns
|
|
164
|
+
- **Consider** — Suggestions, style preferences
|
|
165
|
+
|
|
166
|
+
### Step 5: Provide Actionable Feedback
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
❌ "This is confusing"
|
|
170
|
+
|
|
171
|
+
✅ "This nested conditional is hard to follow. Consider extracting
|
|
172
|
+
the inner logic to a named function like `isEligibleForDiscount()`"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Review Output Format
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
## Review: [PR Title]
|
|
181
|
+
|
|
182
|
+
### Summary
|
|
183
|
+
[1-2 sentences on overall assessment]
|
|
184
|
+
|
|
185
|
+
### Critical Issues
|
|
186
|
+
- **[file:line]** [Issue description]
|
|
187
|
+
|
|
188
|
+
### Important
|
|
189
|
+
- **[file:line]** [Issue description]
|
|
190
|
+
|
|
191
|
+
### Suggestions
|
|
192
|
+
- **[file:line]** [Suggestion]
|
|
193
|
+
|
|
194
|
+
### Verdict
|
|
195
|
+
- [ ] Approve
|
|
196
|
+
- [ ] Request changes
|
|
197
|
+
- [ ] Needs discussion
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Rules
|
|
203
|
+
|
|
204
|
+
- **Don't accept "I'll clean it up later"** — It won't happen
|
|
205
|
+
- **Remove dead code** — Don't comment it out
|
|
206
|
+
- **Review within 1 business day** — Faster is better
|
|
207
|
+
- **Be kind, not nice** — Honest feedback helps everyone
|
|
208
|
+
- **One approval minimum** — Before any merge
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deploy
|
|
3
|
+
description: Skill to automate the full deployment process including build, test, and release steps
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deploy Skill
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
Automate the deployment pipeline: build → test → deploy → verify.
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
- All tests passing
|
|
13
|
+
- Environment variables configured
|
|
14
|
+
- Access to deployment target
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
### 1. Verify Clean State
|
|
19
|
+
```bash
|
|
20
|
+
git status
|
|
21
|
+
git pull origin main
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Run Tests
|
|
25
|
+
```bash
|
|
26
|
+
npm test
|
|
27
|
+
```
|
|
28
|
+
If tests fail → STOP. Report failures.
|
|
29
|
+
|
|
30
|
+
### 3. Build
|
|
31
|
+
```bash
|
|
32
|
+
npm run build
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 4. Deploy by Environment
|
|
36
|
+
|
|
37
|
+
**Development:**
|
|
38
|
+
```bash
|
|
39
|
+
docker-compose -f docker-compose.dev.yml up -d --build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Production:**
|
|
43
|
+
```bash
|
|
44
|
+
docker-compose -f docker-compose.prod.yml pull
|
|
45
|
+
docker-compose -f docker-compose.prod.yml up -d
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 5. Health Check
|
|
49
|
+
```bash
|
|
50
|
+
curl -f http://localhost:3000/health || echo "Health check failed"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 6. Tail Logs (first 30 seconds)
|
|
54
|
+
```bash
|
|
55
|
+
docker-compose logs --tail=50 -f app
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Rollback
|
|
59
|
+
```bash
|
|
60
|
+
git revert HEAD --no-edit
|
|
61
|
+
git push origin main
|
|
62
|
+
# Redeploy previous version
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Success Criteria
|
|
66
|
+
- Health endpoint returns 200
|
|
67
|
+
- No error logs in initial 30 seconds
|
|
68
|
+
- All smoke tests pass
|