@wipal/agent-team 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.
- package/.claude/rules/common/general-rules.md +141 -0
- package/.claude/rules/lessons/lessons.md +91 -0
- package/.claude/rules/role-rules/dev-fe-rules.md +146 -0
- package/.claude/rules/role-rules/sa-rules.md +226 -0
- package/.claude/skills/SKILL-INDEX.md +299 -0
- package/.claude/skills/community/security-validator/SKILL.md +392 -0
- package/.claude/skills/core/agent-creation/SKILL.md +338 -0
- package/.claude/skills/core/code-review/SKILL.md +154 -0
- package/.claude/skills/core/git-automation/SKILL.md +93 -0
- package/.claude/skills/core/retrospect-work/SKILL.md +172 -0
- package/.claude/skills/domain/architecture/adr-writing/SKILL.md +254 -0
- package/.claude/skills/domain/architecture/adr-writing/references/adr-best-practices.md +257 -0
- package/.claude/skills/domain/architecture/adr-writing/references/adr-examples.md +246 -0
- package/.claude/skills/domain/architecture/adr-writing/references/adr-template.md +160 -0
- package/.claude/skills/domain/architecture/architecture-patterns/SKILL.md +316 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/event-driven.md +393 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/microservices.md +315 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/monolith.md +321 -0
- package/.claude/skills/domain/architecture/architecture-patterns/references/serverless.md +457 -0
- package/.claude/skills/domain/architecture/performance-engineering/SKILL.md +227 -0
- package/.claude/skills/domain/architecture/performance-engineering/references/benchmarking.md +336 -0
- package/.claude/skills/domain/architecture/performance-engineering/references/caching-strategies.md +284 -0
- package/.claude/skills/domain/architecture/performance-engineering/references/optimization.md +298 -0
- package/.claude/skills/domain/architecture/security-architecture/SKILL.md +206 -0
- package/.claude/skills/domain/architecture/security-architecture/references/auth-patterns.md +209 -0
- package/.claude/skills/domain/architecture/security-architecture/references/compliance.md +246 -0
- package/.claude/skills/domain/architecture/security-architecture/references/threat-modeling.md +219 -0
- package/.claude/skills/domain/architecture/system-design/SKILL.md +227 -0
- package/.claude/skills/domain/architecture/system-design/references/distributed-systems.md +231 -0
- package/.claude/skills/domain/architecture/system-design/references/resilience.md +344 -0
- package/.claude/skills/domain/architecture/system-design/references/scalability.md +303 -0
- package/.claude/skills/domain/architecture/tech-selection/SKILL.md +192 -0
- package/.claude/skills/domain/architecture/tech-selection/references/build-vs-buy.md +258 -0
- package/.claude/skills/domain/architecture/tech-selection/references/evaluation-framework.md +203 -0
- package/.claude/skills/domain/architecture/tech-selection/references/tech-radar.md +257 -0
- package/.claude/skills/domain/backend/api-design/SKILL.md +121 -0
- package/.claude/skills/domain/backend/database-design/SKILL.md +156 -0
- package/.claude/skills/domain/backend/performance-be/SKILL.md +210 -0
- package/.claude/skills/domain/backend/security/SKILL.md +138 -0
- package/.claude/skills/domain/backend/testing-be/SKILL.md +203 -0
- package/.claude/skills/domain/devops/ci-cd/SKILL.md +188 -0
- package/.claude/skills/domain/devops/containerization/SKILL.md +177 -0
- package/.claude/skills/domain/devops/deployment/SKILL.md +198 -0
- package/.claude/skills/domain/devops/infrastructure-as-code/SKILL.md +178 -0
- package/.claude/skills/domain/devops/monitoring/SKILL.md +163 -0
- package/.claude/skills/domain/frontend/accessibility/SKILL.md +179 -0
- package/.claude/skills/domain/frontend/frontend-design/SKILL.md +138 -0
- package/.claude/skills/domain/frontend/performance-fe/SKILL.md +195 -0
- package/.claude/skills/domain/frontend/state-management/SKILL.md +190 -0
- package/.claude/skills/domain/frontend/testing-fe/SKILL.md +193 -0
- package/.claude/skills/domain/product/requirements-gathering/SKILL.md +136 -0
- package/.claude/skills/domain/product/roadmap-planning/SKILL.md +169 -0
- package/.claude/skills/domain/product/sprint-planning/SKILL.md +151 -0
- package/.claude/skills/domain/product/stakeholder-communication/SKILL.md +162 -0
- package/.claude/skills/domain/product/user-stories/SKILL.md +141 -0
- package/.claude/skills/domain/quality/bug-reporting/SKILL.md +150 -0
- package/.claude/skills/domain/quality/regression-testing/SKILL.md +178 -0
- package/.claude/skills/domain/quality/test-automation/SKILL.md +185 -0
- package/.claude/skills/domain/quality/test-planning/SKILL.md +177 -0
- package/.claude/skills/leadership/code-review-advanced/SKILL.md +167 -0
- package/.claude/skills/leadership/mentoring/SKILL.md +151 -0
- package/.claude/skills/leadership/technical-debt/SKILL.md +166 -0
- package/.claude/skills/leadership/technical-decision/SKILL.md +160 -0
- package/.claude/skills/security-reports/.gitkeep +0 -0
- package/.claude/skills/skills-registry.yaml +441 -0
- package/README.md +232 -0
- package/bin/agent-team.js +107 -0
- package/package.json +51 -0
- package/src/commands/add.js +227 -0
- package/src/commands/init.js +136 -0
- package/src/commands/list.js +66 -0
- package/src/commands/remove.js +71 -0
- package/src/commands/switch.js +53 -0
- package/src/index.js +11 -0
- package/src/interactive/prompts.js +153 -0
- package/src/server/api/agents.js +150 -0
- package/src/server/api/roles.js +97 -0
- package/src/server/api/skills.js +79 -0
- package/src/server/index.js +78 -0
- package/src/ui/agents.html +174 -0
- package/src/ui/css/styles.css +470 -0
- package/src/ui/index.html +107 -0
- package/src/ui/roles.html +371 -0
- package/src/ui/skills.html +332 -0
- package/src/utils/file-utils.js +193 -0
- package/src/utils/skill-resolver.js +594 -0
- package/src/utils/skill-scanner.js +154 -0
- package/templates/CLAUDE.md.tmpl +42 -0
- package/templates/knowledge.md.tmpl +31 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-creation
|
|
3
|
+
description: |
|
|
4
|
+
Guide for creating new agents with skills.sh integration.
|
|
5
|
+
Use when user asks to create new agent, setup agent, or add agent to project.
|
|
6
|
+
ALWAYS search skills.sh before creating new skills.
|
|
7
|
+
Triggers: "tạo agent", "setup agent", "create agent", "add agent", "new agent"
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
category: core
|
|
10
|
+
tags:
|
|
11
|
+
- agent
|
|
12
|
+
- setup
|
|
13
|
+
- skills
|
|
14
|
+
- skills.sh
|
|
15
|
+
depends_on: []
|
|
16
|
+
recommends:
|
|
17
|
+
- security-validator
|
|
18
|
+
used_by: []
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Skill: Agent Creation with skills.sh Integration
|
|
22
|
+
|
|
23
|
+
## Core Principle
|
|
24
|
+
**Always search skills.sh first, then copy and customize.**
|
|
25
|
+
Never create a skill from scratch without checking if a better version exists.
|
|
26
|
+
|
|
27
|
+
## When to Use This Skill
|
|
28
|
+
|
|
29
|
+
### Trigger Conditions
|
|
30
|
+
- User says: "tạo agent", "setup agent", "create new agent"
|
|
31
|
+
- User provides role + variants: "dev-fe với React + Tailwind"
|
|
32
|
+
- User asks to add agent to project
|
|
33
|
+
- User mentions "skills.sh" or "find skills"
|
|
34
|
+
|
|
35
|
+
## Prerequisites
|
|
36
|
+
- Access to web search (for skills.sh)
|
|
37
|
+
- Project has .claude/ directory structure
|
|
38
|
+
|
|
39
|
+
## Agent Creation Workflow
|
|
40
|
+
|
|
41
|
+
### STEP 1: Parse Requirements
|
|
42
|
+
|
|
43
|
+
Extract from user request:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Agent Name: ____________
|
|
47
|
+
Base Role: ____________ (dev-fe, dev-be, sa, devops, tech-lead, pm, qa, ba)
|
|
48
|
+
Variants:
|
|
49
|
+
- framework: ____________ (react, vue, angular, nestjs, fastapi...)
|
|
50
|
+
- styling: ____________ (tailwind, css-modules, styled-components...)
|
|
51
|
+
- state: ____________ (zustand, redux, pinia...)
|
|
52
|
+
- database: ____________ (postgresql, mongodb, mysql...)
|
|
53
|
+
- orm: ____________ (prisma, typeorm, sequelize...)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### STEP 2: Search skills.sh for Relevant Skills
|
|
57
|
+
|
|
58
|
+
**MANDATORY:** Before creating any skill, search skills.sh.
|
|
59
|
+
|
|
60
|
+
Use web search with these patterns:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
site:skills.sh <keyword> <category>
|
|
64
|
+
site:skills.sh react frontend
|
|
65
|
+
site:skills.sh tailwind styling
|
|
66
|
+
site:skills.sh nestjs backend
|
|
67
|
+
site:skills.sh devops ci-cd
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Search Query Examples:**
|
|
71
|
+
|
|
72
|
+
| Role/Variant | Search Queries |
|
|
73
|
+
|--------------|----------------|
|
|
74
|
+
| dev-fe + react | `site:skills.sh react`, `site:skills.sh frontend react` |
|
|
75
|
+
| dev-fe + vue | `site:skills.sh vue`, `site:skills.sh frontend vue` |
|
|
76
|
+
| dev-be + nestjs | `site:skills.sh nestjs`, `site:skills.sh backend typescript` |
|
|
77
|
+
| dev-be + fastapi | `site:skills.sh fastapi`, `site:skills.sh python backend` |
|
|
78
|
+
| devops | `site:skills.sh docker`, `site:skills.sh ci-cd`, `site:skills.sh kubernetes` |
|
|
79
|
+
|
|
80
|
+
### STEP 3: Present Found Skills to User
|
|
81
|
+
|
|
82
|
+
Format the results:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
🔍 Found skills from skills.sh:
|
|
86
|
+
|
|
87
|
+
Official Sources (✅ Auto-validated):
|
|
88
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
89
|
+
│ Skill │ Source │ Installs │
|
|
90
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
91
|
+
│ react-best-practices │ vercel-labs │ 169K │
|
|
92
|
+
│ frontend-design │ anthropics │ 100K │
|
|
93
|
+
│ next-best-practices │ vercel-labs │ 21K │
|
|
94
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
95
|
+
|
|
96
|
+
Community Sources (⚠️ Needs Review):
|
|
97
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
98
|
+
│ Skill │ Source │ Installs │
|
|
99
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
100
|
+
│ tailwind-design-system │ wshobson │ 11K │
|
|
101
|
+
│ vue-best-practices │ antfu │ 7K │
|
|
102
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
103
|
+
|
|
104
|
+
[✅ = Official source, auto-validated | ⚠️ = Community, security review required]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### STEP 4: Select Skills
|
|
108
|
+
|
|
109
|
+
**Auto-suggest based on role:**
|
|
110
|
+
|
|
111
|
+
| Role | Suggested Skills from skills.sh |
|
|
112
|
+
|------|--------------------------------|
|
|
113
|
+
| dev-fe | react-best-practices, frontend-design, webapp-testing |
|
|
114
|
+
| dev-be | api-design-patterns, database-design, security |
|
|
115
|
+
| sa | architecture-patterns, adr-writing, tech-selection |
|
|
116
|
+
| devops | ci-cd, containerization, infrastructure-as-code |
|
|
117
|
+
| tech-lead | code-review-advanced, technical-decision, mentoring |
|
|
118
|
+
| pm | requirements-gathering, user-stories, sprint-planning |
|
|
119
|
+
| qa | test-planning, test-automation, bug-reporting |
|
|
120
|
+
|
|
121
|
+
Ask user to confirm or modify selection.
|
|
122
|
+
|
|
123
|
+
### STEP 5: Security Validation
|
|
124
|
+
|
|
125
|
+
For **Official Sources** (anthropics, vercel-labs, microsoft, google, expo):
|
|
126
|
+
- Auto-validate with logging
|
|
127
|
+
- Proceed to installation
|
|
128
|
+
|
|
129
|
+
For **Community Sources**:
|
|
130
|
+
- Run security validation (use security-validator skill)
|
|
131
|
+
- Check for dangerous patterns
|
|
132
|
+
- Generate security report
|
|
133
|
+
- If issues found: Present to user for decision
|
|
134
|
+
|
|
135
|
+
**Security Report Format:**
|
|
136
|
+
|
|
137
|
+
```markdown
|
|
138
|
+
⚠️ Security Review Required: <skill-name>
|
|
139
|
+
|
|
140
|
+
| Check | Status | Notes |
|
|
141
|
+
|-------|--------|-------|
|
|
142
|
+
| Code Review | PASS | No malicious patterns |
|
|
143
|
+
| Command Scan | WARN | eval() found on line 42 |
|
|
144
|
+
| URL Check | PASS | All URLs from safe domains |
|
|
145
|
+
| Dependency Audit | PASS | No known vulnerabilities |
|
|
146
|
+
|
|
147
|
+
Recommendation: REVIEW REQUIRED
|
|
148
|
+
User Decision: [ ] APPROVE [ ] FIX FIRST [ ] REJECT
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### STEP 6: Copy & Customize
|
|
152
|
+
|
|
153
|
+
**Installation Strategy:**
|
|
154
|
+
|
|
155
|
+
| Source Type | Strategy | Reason |
|
|
156
|
+
|-------------|----------|--------|
|
|
157
|
+
| Official | COPY | Version control, offline access |
|
|
158
|
+
| Community | COPY | Customize for project, security |
|
|
159
|
+
| Base (core) | SYMLINK | Shared across agents |
|
|
160
|
+
|
|
161
|
+
**Customization Checklist:**
|
|
162
|
+
|
|
163
|
+
- [ ] Review skill content
|
|
164
|
+
- [ ] Adjust examples for project context
|
|
165
|
+
- [ ] Add project-specific rules
|
|
166
|
+
- [ ] Update dependencies in frontmatter
|
|
167
|
+
- [ ] Add to SKILL-INDEX.md if domain skill
|
|
168
|
+
|
|
169
|
+
**Copy Command:**
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Fetch from skills.sh
|
|
173
|
+
npx skills add <owner/repo> --dry-run
|
|
174
|
+
|
|
175
|
+
# Copy to project
|
|
176
|
+
cp -r ~/.skills/<skill> .claude/skills/domain/<category>/<skill>/
|
|
177
|
+
|
|
178
|
+
# Or for community
|
|
179
|
+
cp -r ~/.skills/<skill> .claude/skills/community/<skill>/
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### STEP 7: Create Agent Structure
|
|
183
|
+
|
|
184
|
+
**Directory Structure:**
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
.claude/agents/<agent-name>/
|
|
188
|
+
├── CLAUDE.md # Agent configuration
|
|
189
|
+
├── knowledge.md # Knowledge base (empty initially)
|
|
190
|
+
└── skills/ # Skills (symlinks or copies)
|
|
191
|
+
├── frontend-design -> ../../skills/domain/frontend/frontend-design
|
|
192
|
+
└── react-best-practices/ # Copied
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**CLAUDE.md Template:**
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
# Agent: <agent-name>
|
|
199
|
+
|
|
200
|
+
## Role
|
|
201
|
+
- Base Role: <role>
|
|
202
|
+
- Variants: <variants>
|
|
203
|
+
|
|
204
|
+
## Tech Stack
|
|
205
|
+
<extracted from variants>
|
|
206
|
+
|
|
207
|
+
## Skills
|
|
208
|
+
- <skill-1> (source: <owner/repo>)
|
|
209
|
+
- <skill-2> (source: local)
|
|
210
|
+
|
|
211
|
+
## MCP Integration
|
|
212
|
+
- Context7: REQUIRED for documentation lookup
|
|
213
|
+
- <other-mcp>: <purpose>
|
|
214
|
+
|
|
215
|
+
## Knowledge Base
|
|
216
|
+
- Read from: .claude/agents/<agent-name>/knowledge.md
|
|
217
|
+
- Update via: /retrospect
|
|
218
|
+
|
|
219
|
+
## How to Work
|
|
220
|
+
1. Always use Context7 for latest documentation
|
|
221
|
+
2. Follow skill guidelines
|
|
222
|
+
3. Run tests before completion
|
|
223
|
+
4. Update knowledge.md with learnings
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### STEP 8: Verify & Report
|
|
227
|
+
|
|
228
|
+
**Verification Commands:**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Check agent structure
|
|
232
|
+
ls -la .claude/agents/<agent-name>/
|
|
233
|
+
|
|
234
|
+
# Verify skills
|
|
235
|
+
ls -la .claude/agents/<agent-name>/skills/
|
|
236
|
+
|
|
237
|
+
# Test agent (if agent.sh exists)
|
|
238
|
+
./scripts/agent.sh check <agent-name>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Creation Report:**
|
|
242
|
+
|
|
243
|
+
```markdown
|
|
244
|
+
✅ Agent Created: <agent-name>
|
|
245
|
+
|
|
246
|
+
## Summary
|
|
247
|
+
- Role: <role>
|
|
248
|
+
- Variants: <variants>
|
|
249
|
+
- Skills installed: <count>
|
|
250
|
+
|
|
251
|
+
## Skills
|
|
252
|
+
| Skill | Source | Category | Status |
|
|
253
|
+
|-------|--------|----------|--------|
|
|
254
|
+
| react-best-practices | vercel-labs | frontend | ✅ Installed |
|
|
255
|
+
| frontend-design | local | frontend | ✅ Linked |
|
|
256
|
+
| tailwind-patterns | community | styling | ⚠️ Needs review |
|
|
257
|
+
|
|
258
|
+
## Next Steps
|
|
259
|
+
1. Review community skills with security concerns
|
|
260
|
+
2. Test agent with sample task
|
|
261
|
+
3. Update knowledge.md after first use
|
|
262
|
+
|
|
263
|
+
## Files Created
|
|
264
|
+
- .claude/agents/<agent-name>/CLAUDE.md
|
|
265
|
+
- .claude/agents/<agent-name>/knowledge.md
|
|
266
|
+
- .claude/agents/<agent-name>/skills/ (directory)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Rules
|
|
270
|
+
|
|
271
|
+
### MUST Do
|
|
272
|
+
- ✅ ALWAYS search skills.sh before creating new skill
|
|
273
|
+
- ✅ ALWAYS validate community skills for security
|
|
274
|
+
- ✅ ALWAYS present options to user before installation
|
|
275
|
+
- ✅ ALWAYS copy skills (not symlink) for customization
|
|
276
|
+
- ✅ ALWAYS register installed skills in skills-registry.yaml
|
|
277
|
+
- ✅ ALWAYS generate creation report
|
|
278
|
+
|
|
279
|
+
### MUST NOT Do
|
|
280
|
+
- ❌ NEVER skip skills.sh search
|
|
281
|
+
- ❌ NEVER auto-reject skills with security issues (let user decide)
|
|
282
|
+
- ❌ NEVER create skill from scratch without checking skills.sh first
|
|
283
|
+
- ❌ NEVER install skills without security validation
|
|
284
|
+
|
|
285
|
+
## Example Usage
|
|
286
|
+
|
|
287
|
+
### Example 1: Simple Agent
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
User: "Tạo agent payment-fe dev-fe với React"
|
|
291
|
+
|
|
292
|
+
Claude:
|
|
293
|
+
1. Parse: name=payment-fe, role=dev-fe, variant=react
|
|
294
|
+
2. Search skills.sh: "react frontend"
|
|
295
|
+
3. Found: react-best-practices, frontend-design
|
|
296
|
+
4. Present options to user
|
|
297
|
+
5. User confirms: Install both
|
|
298
|
+
6. Validate: Both official sources, auto-approved
|
|
299
|
+
7. Copy to .claude/skills/domain/frontend/
|
|
300
|
+
8. Create agent structure
|
|
301
|
+
9. Generate report
|
|
302
|
+
|
|
303
|
+
✅ Agent payment-fe created with 2 skills
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Example 2: Complex Agent with Community Skills
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
User: "Tạo agent admin-fe dev-fe với Vue + Tailwind + Pinia"
|
|
310
|
+
|
|
311
|
+
Claude:
|
|
312
|
+
1. Parse: name=admin-fe, role=dev-fe, variants=vue,tailwind,pinia
|
|
313
|
+
2. Search skills.sh: "vue", "tailwind styling", "pinia"
|
|
314
|
+
3. Found:
|
|
315
|
+
- vue-best-practices (antfu - community)
|
|
316
|
+
- tailwind-design-system (wshobson - community)
|
|
317
|
+
- No pinia skill found
|
|
318
|
+
4. Present options with security warnings
|
|
319
|
+
5. User confirms: Install vue and tailwind, create pinia
|
|
320
|
+
6. Validate community skills:
|
|
321
|
+
- vue-best-practices: PASS
|
|
322
|
+
- tailwind-design-system: WARN (external URL)
|
|
323
|
+
7. Present security report for tailwind
|
|
324
|
+
8. User approves
|
|
325
|
+
9. Copy and customize
|
|
326
|
+
10. Create pinia skill from scratch (no existing skill)
|
|
327
|
+
11. Create agent structure
|
|
328
|
+
12. Generate report
|
|
329
|
+
|
|
330
|
+
✅ Agent admin-fe created with 3 skills (2 installed, 1 created)
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Integration
|
|
334
|
+
|
|
335
|
+
- **Before**: Use `/discover <keyword>` to search skills.sh
|
|
336
|
+
- **During**: Use `/install-skill <owner/repo>` to install
|
|
337
|
+
- **After**: Use `/review-skills` to audit installed skills
|
|
338
|
+
- **Security**: Use `/install-skill --validate` for security check
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: |
|
|
4
|
+
Systematic code review with technical rigor. Use when reviewing PRs,
|
|
5
|
+
before commits, after implementing features, doing security audits,
|
|
6
|
+
or when user mentions "review", "check code", "look at this code",
|
|
7
|
+
"PR review", "code quality check". Automatically trigger after
|
|
8
|
+
completing significant code changes.
|
|
9
|
+
version: 1.0.0
|
|
10
|
+
category: core
|
|
11
|
+
tags:
|
|
12
|
+
- review
|
|
13
|
+
- quality
|
|
14
|
+
- best-practices
|
|
15
|
+
depends_on: []
|
|
16
|
+
recommends: []
|
|
17
|
+
used_by:
|
|
18
|
+
- frontend-design
|
|
19
|
+
- api-design
|
|
20
|
+
- database-design
|
|
21
|
+
- code-review-advanced
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
# Skill: Code Review
|
|
25
|
+
|
|
26
|
+
## Core Principle
|
|
27
|
+
**Technical correctness over social comfort.**
|
|
28
|
+
Be honest, thorough, and helpful. A good review prevents bugs in production.
|
|
29
|
+
|
|
30
|
+
## Hard Rules
|
|
31
|
+
|
|
32
|
+
1. **NEVER approve without thorough review** - Read all changed files
|
|
33
|
+
2. **NEVER use vague comments** - "LGTM" without specifics is useless
|
|
34
|
+
3. **ALWAYS explain WHY** - Not just what's wrong, but why it matters
|
|
35
|
+
4. **ALWAYS check security** - Every review includes security check
|
|
36
|
+
5. **ALWAYS verify tests exist** - Code without tests is incomplete
|
|
37
|
+
|
|
38
|
+
## Review Checklist (Fast Track)
|
|
39
|
+
|
|
40
|
+
### Must Check (60 seconds)
|
|
41
|
+
- [ ] Logic correct?
|
|
42
|
+
- [ ] Edge cases handled?
|
|
43
|
+
- [ ] Errors handled?
|
|
44
|
+
- [ ] No security issues?
|
|
45
|
+
- [ ] Tests exist?
|
|
46
|
+
|
|
47
|
+
### Should Check (2 minutes)
|
|
48
|
+
- [ ] Readable code?
|
|
49
|
+
- [ ] No unnecessary complexity?
|
|
50
|
+
- [ ] Names are meaningful?
|
|
51
|
+
- [ ] Performance acceptable?
|
|
52
|
+
|
|
53
|
+
### Nice to Check (5 minutes)
|
|
54
|
+
- [ ] Well-documented?
|
|
55
|
+
- [ ] Follows project conventions?
|
|
56
|
+
- [ ] Maintainable long-term?
|
|
57
|
+
|
|
58
|
+
## Feedback Format
|
|
59
|
+
|
|
60
|
+
### Blocking Issue
|
|
61
|
+
```markdown
|
|
62
|
+
🔴 **Issue:** [Clear description]
|
|
63
|
+
|
|
64
|
+
**Why:** [Why this is a problem]
|
|
65
|
+
|
|
66
|
+
**Fix:** [Specific suggestion with code example]
|
|
67
|
+
|
|
68
|
+
**File:** `path/to/file.ts:42`
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Suggestion (Non-blocking)
|
|
72
|
+
```markdown
|
|
73
|
+
⚠️ **Suggestion:** [Description]
|
|
74
|
+
|
|
75
|
+
**Why:** [Optional context]
|
|
76
|
+
|
|
77
|
+
**Consider:** [Alternative approach]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Positive Feedback
|
|
81
|
+
```markdown
|
|
82
|
+
✅ **Good:** [What's good and why]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Common Mistakes
|
|
86
|
+
|
|
87
|
+
| ❌ Mistake | ✅ Fix |
|
|
88
|
+
|------------|--------|
|
|
89
|
+
| "LGTM" without reading | Read ALL changed files |
|
|
90
|
+
| Vague: "looks weird" | Specific: "N+1 query on line 42" |
|
|
91
|
+
| Style nitpicks | Use linter, focus on logic |
|
|
92
|
+
| Only finding problems | Acknowledge good patterns |
|
|
93
|
+
| Blocking without fix | Always suggest solution |
|
|
94
|
+
| Personal tone | Focus on code, not person |
|
|
95
|
+
|
|
96
|
+
## Output Format
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
## Code Review: [PR/File Name]
|
|
100
|
+
|
|
101
|
+
### Summary
|
|
102
|
+
[1-2 sentences on overall assessment]
|
|
103
|
+
|
|
104
|
+
### 🔴 Must Fix
|
|
105
|
+
1. [Issue 1] → `file:line`
|
|
106
|
+
2. [Issue 2] → `file:line`
|
|
107
|
+
|
|
108
|
+
### ⚠️ Suggestions
|
|
109
|
+
1. [Suggestion 1]
|
|
110
|
+
2. [Suggestion 2]
|
|
111
|
+
|
|
112
|
+
### ✅ Good Patterns
|
|
113
|
+
1. [What was done well]
|
|
114
|
+
|
|
115
|
+
**Verdict:** Approve / Request Changes
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Example Review
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
## Code Review: Add user authentication
|
|
122
|
+
|
|
123
|
+
### Summary
|
|
124
|
+
Clean implementation of JWT auth. A few security improvements needed.
|
|
125
|
+
|
|
126
|
+
### 🔴 Must Fix
|
|
127
|
+
|
|
128
|
+
1. **Missing rate limiting on login endpoint**
|
|
129
|
+
Why: Vulnerable to brute force attacks
|
|
130
|
+
Fix: Add rate limiter middleware
|
|
131
|
+
File: `src/routes/auth.ts:23`
|
|
132
|
+
|
|
133
|
+
2. **Password in logs**
|
|
134
|
+
Why: Security leak
|
|
135
|
+
Fix: Remove console.log or sanitize
|
|
136
|
+
File: `src/services/auth.ts:45`
|
|
137
|
+
|
|
138
|
+
### ⚠️ Suggestions
|
|
139
|
+
|
|
140
|
+
1. Consider extracting token validation to middleware
|
|
141
|
+
2. Add refresh token rotation
|
|
142
|
+
|
|
143
|
+
### ✅ Good Patterns
|
|
144
|
+
1. Zod validation on all inputs
|
|
145
|
+
2. Proper error handling with custom errors
|
|
146
|
+
|
|
147
|
+
**Verdict:** Request Changes (2 issues)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Integration
|
|
151
|
+
|
|
152
|
+
- After **review**: Run `/retrospect-work` to extract patterns
|
|
153
|
+
- Before **git-commit**: Quick review of staged changes
|
|
154
|
+
- During **debugging**: Review related code for issues
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-automation
|
|
3
|
+
description: |
|
|
4
|
+
Git workflow automation for commits, branches, and PRs using conventional commits.
|
|
5
|
+
Use when: creating commits, making branches, creating PRs, merging code,
|
|
6
|
+
or when user mentions "commit", "branch", "PR", "push", "merge", "git".
|
|
7
|
+
Automatically suggest conventional commit format for all commits.
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
category: core
|
|
10
|
+
tags:
|
|
11
|
+
- git
|
|
12
|
+
- automation
|
|
13
|
+
- workflow
|
|
14
|
+
depends_on: []
|
|
15
|
+
recommends: []
|
|
16
|
+
used_by:
|
|
17
|
+
- ci-cd
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Skill: Git Automation
|
|
21
|
+
|
|
22
|
+
## Core Principle
|
|
23
|
+
**Clean git history through consistent conventions.**
|
|
24
|
+
Every commit should tell a story.
|
|
25
|
+
|
|
26
|
+
## Hard Rules
|
|
27
|
+
|
|
28
|
+
1. **ALWAYS use conventional commits** - `type(scope): description`
|
|
29
|
+
2. **NEVER commit directly to main** - Use feature branches
|
|
30
|
+
3. **NEVER force push to shared branches** - Use rebase carefully
|
|
31
|
+
4. **ALWAYS write meaningful descriptions** - Not just "fix bug"
|
|
32
|
+
|
|
33
|
+
## Conventional Commits
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
<type>(<scope>): <description>
|
|
37
|
+
|
|
38
|
+
Types: feat, fix, docs, style, refactor, test, chore, perf, ci
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Examples:**
|
|
42
|
+
- `feat(auth): add JWT token refresh`
|
|
43
|
+
- `fix(api): handle null response from user service`
|
|
44
|
+
- `refactor(db): optimize user query performance`
|
|
45
|
+
|
|
46
|
+
## Branch Naming
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
<type>/<ticket>-<description>
|
|
50
|
+
|
|
51
|
+
Types: feature, fix, refactor, docs, test, chore
|
|
52
|
+
Examples: feature/AUTH-123-add-login, fix/AUTH-456-token-expiry
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Common Mistakes
|
|
56
|
+
|
|
57
|
+
| ❌ Mistake | ✅ Fix |
|
|
58
|
+
|------------|--------|
|
|
59
|
+
| "fix bug" | `fix(auth): handle expired tokens` |
|
|
60
|
+
| Commit to main | Create feature branch first |
|
|
61
|
+
| Force push shared | Rebase locally, push normally |
|
|
62
|
+
| Huge commits | Break into logical chunks |
|
|
63
|
+
|
|
64
|
+
## Quick Commands
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Create branch
|
|
68
|
+
git checkout -b feature/TICKET-123-description
|
|
69
|
+
|
|
70
|
+
# Stage & commit
|
|
71
|
+
git add src/features/auth/
|
|
72
|
+
git commit -m "feat(auth): add login validation"
|
|
73
|
+
|
|
74
|
+
# Push & PR
|
|
75
|
+
git push -u origin feature/TICKET-123-description
|
|
76
|
+
gh pr create --title "feat(auth): add login validation"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## PR Template
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
## What
|
|
83
|
+
[Brief description]
|
|
84
|
+
|
|
85
|
+
## Why
|
|
86
|
+
[Context]
|
|
87
|
+
|
|
88
|
+
## Testing
|
|
89
|
+
- [ ] Tests added
|
|
90
|
+
- [ ] Manual testing done
|
|
91
|
+
|
|
92
|
+
Closes #TICKET
|
|
93
|
+
```
|