start-vibing 1.1.2 → 1.1.3
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/package.json +1 -1
- package/template/.claude/CLAUDE.md +129 -168
- package/template/.claude/README.md +135 -126
- package/template/.claude/agents/analyzer.md +0 -14
- package/template/.claude/agents/commit-manager.md +0 -19
- package/template/.claude/agents/documenter.md +0 -10
- package/template/.claude/agents/domain-updater.md +194 -200
- package/template/.claude/agents/final-validator.md +0 -18
- package/template/.claude/agents/orchestrator.md +0 -12
- package/template/.claude/agents/quality-checker.md +0 -24
- package/template/.claude/agents/research.md +251 -262
- package/template/.claude/agents/security-auditor.md +1 -14
- package/template/.claude/agents/tester.md +0 -8
- package/template/.claude/agents/ui-ux-reviewer.md +0 -8
- package/template/.claude/commands/feature.md +48 -102
- package/template/.claude/config/README.md +30 -30
- package/template/.claude/config/domain-mapping.json +55 -26
- package/template/.claude/config/project-config.json +56 -53
- package/template/.claude/config/quality-gates.json +46 -46
- package/template/.claude/config/security-rules.json +45 -45
- package/template/.claude/config/testing-config.json +168 -168
- package/template/.claude/hooks/SETUP.md +52 -181
- package/template/.claude/hooks/user-prompt-submit.py +37 -246
- package/template/.claude/settings.json +39 -267
- package/template/.claude/skills/codebase-knowledge/SKILL.md +71 -145
- package/template/.claude/skills/codebase-knowledge/domains/claude-system.md +54 -321
- package/template/.claude/skills/docs-tracker/SKILL.md +63 -239
- package/template/.claude/skills/final-check/SKILL.md +72 -284
- package/template/.claude/skills/quality-gate/SKILL.md +71 -278
- package/template/.claude/skills/research-cache/SKILL.md +73 -207
- package/template/.claude/skills/security-scan/SKILL.md +75 -206
- package/template/.claude/skills/test-coverage/SKILL.md +66 -441
- package/template/.claude/skills/ui-ux-audit/SKILL.md +68 -254
- package/template/.claude/hooks/post-tool-use.py +0 -155
- package/template/.claude/hooks/pre-tool-use.py +0 -159
- package/template/.claude/hooks/stop-validation.py +0 -155
- package/template/.claude/hooks/validate-commit.py +0 -200
- package/template/.claude/hooks/workflow-manager.py +0 -350
- package/template/.claude/workflow-state.schema.json +0 -200
|
@@ -1,206 +1,75 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: security-scan
|
|
3
|
-
description: Audits code security
|
|
4
|
-
allowed-tools: Read, Grep, Glob, Bash
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Security Scan
|
|
8
|
-
|
|
9
|
-
## VETO POWER
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
> **EVERY** tRPC route MUST have `.input(z.object({...}))`.
|
|
77
|
-
> Unvalidated inputs are attack vectors.
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
// WRONG - NO VALIDATION (IMMEDIATE VETO)
|
|
81
|
-
.mutation(async ({ input }) => {
|
|
82
|
-
await db.create(input); // input can have anything!
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
// CORRECT
|
|
86
|
-
.input(createSchema) // Zod schema
|
|
87
|
-
.mutation(async ({ input }) => {
|
|
88
|
-
await db.create(input); // input is validated
|
|
89
|
-
})
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## OWASP Top 10 Checklist
|
|
95
|
-
|
|
96
|
-
### A01: Broken Access Control
|
|
97
|
-
|
|
98
|
-
- [ ] All protected routes use `protectedProcedure`?
|
|
99
|
-
- [ ] User ID from session, not input?
|
|
100
|
-
- [ ] Resources filtered by user/tenant?
|
|
101
|
-
|
|
102
|
-
### A02: Cryptographic Failures
|
|
103
|
-
|
|
104
|
-
- [ ] Passwords hashed with bcrypt (salt >= 10)?
|
|
105
|
-
- [ ] Tokens generated with crypto.randomBytes?
|
|
106
|
-
- [ ] Cookies with HttpOnly, Secure, SameSite?
|
|
107
|
-
- [ ] No secrets in code (use env vars)?
|
|
108
|
-
|
|
109
|
-
### A03: Injection
|
|
110
|
-
|
|
111
|
-
- [ ] Queries use Mongoose (prevents NoSQL injection)?
|
|
112
|
-
- [ ] Inputs validated with Zod?
|
|
113
|
-
- [ ] No string concatenation in queries?
|
|
114
|
-
|
|
115
|
-
### A07: Authentication Failures
|
|
116
|
-
|
|
117
|
-
- [ ] Passwords with minimum requirements?
|
|
118
|
-
- [ ] Brute force protection?
|
|
119
|
-
- [ ] Sessions invalidated on logout?
|
|
120
|
-
- [ ] Tokens with expiration?
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## Detection Patterns
|
|
125
|
-
|
|
126
|
-
### Detect User ID from Input (VETO)
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
grep -r "input\.userId\|input\.user_id\|{ userId }" server/ --include="*.ts"
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Detect Password Return (VETO)
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
grep -r "passwordHash\|password:" server/ --include="*.ts"
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Detect Route Without Validation (VETO)
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
grep -A5 "Procedure\." server/ --include="*.ts" | grep -v ".input("
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Output Format
|
|
147
|
-
|
|
148
|
-
### Approved
|
|
149
|
-
|
|
150
|
-
```markdown
|
|
151
|
-
## SECURITY SCAN - APPROVED
|
|
152
|
-
|
|
153
|
-
### Scope
|
|
154
|
-
|
|
155
|
-
- **Files:** X
|
|
156
|
-
- **Routes:** Y
|
|
157
|
-
|
|
158
|
-
### Checks
|
|
159
|
-
|
|
160
|
-
- [x] User ID always from session
|
|
161
|
-
- [x] No sensitive data in response
|
|
162
|
-
- [x] All routes with Zod validation
|
|
163
|
-
- [x] OWASP Top 10 OK
|
|
164
|
-
|
|
165
|
-
**STATUS: APPROVED**
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Vetoed
|
|
169
|
-
|
|
170
|
-
```markdown
|
|
171
|
-
## SECURITY SCAN - VETOED
|
|
172
|
-
|
|
173
|
-
### CRITICAL VULNERABILITY
|
|
174
|
-
|
|
175
|
-
**Type:** User ID from Input
|
|
176
|
-
**File:** `server/routers/example.ts:45`
|
|
177
|
-
**Risk:** Any user can access other users' data
|
|
178
|
-
|
|
179
|
-
**Fix:** Use `ctx.user._id` instead of `input.userId`
|
|
180
|
-
|
|
181
|
-
**STATUS: VETOED** - Fix before proceeding
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## VETO Rules
|
|
187
|
-
|
|
188
|
-
### IMMEDIATE VETO
|
|
189
|
-
|
|
190
|
-
1. User ID from input/request body
|
|
191
|
-
2. Password returned in response
|
|
192
|
-
3. API tokens exposed
|
|
193
|
-
4. Protected route without `protectedProcedure`
|
|
194
|
-
5. Query without user/tenant filter
|
|
195
|
-
|
|
196
|
-
### VETO BEFORE MERGE
|
|
197
|
-
|
|
198
|
-
1. Route without Zod validation
|
|
199
|
-
2. Unsanitized sensitive data
|
|
200
|
-
3. bun audit (or npm audit) with critical vulnerabilities
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
## Version
|
|
205
|
-
|
|
206
|
-
- **v2.0.0** - Generic template
|
|
1
|
+
---
|
|
2
|
+
name: security-scan
|
|
3
|
+
description: Audits code for security vulnerabilities. HAS VETO POWER. Activates when code touches authentication, passwords, tokens, API routes, database queries, user data, sessions, or cookies. Blocks insecure code from being committed.
|
|
4
|
+
allowed-tools: Read, Grep, Glob, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Security Scan
|
|
8
|
+
|
|
9
|
+
## VETO POWER
|
|
10
|
+
|
|
11
|
+
This skill CAN and MUST block insecure code.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- When code touches: auth, session, user data, API, database
|
|
16
|
+
- Before committing security-sensitive changes
|
|
17
|
+
- When user mentions: password, token, authentication, permissions
|
|
18
|
+
|
|
19
|
+
## Critical Rules (VETO if violated)
|
|
20
|
+
|
|
21
|
+
### 1. User ID ALWAYS from Session
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
// WRONG (VETO)
|
|
25
|
+
async function getData({ userId }: { userId: string }) { ... }
|
|
26
|
+
|
|
27
|
+
// CORRECT
|
|
28
|
+
async function getData({ ctx }: { ctx: Context }) {
|
|
29
|
+
const userId = ctx.user._id; // From session
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. No Sensitive Data to Frontend
|
|
34
|
+
|
|
35
|
+
Never send: passwords (even hashed), API tokens, secret keys, stack traces
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// WRONG (VETO)
|
|
39
|
+
return { user: await UserModel.findById(id) }; // Has passwordHash!
|
|
40
|
+
|
|
41
|
+
// CORRECT
|
|
42
|
+
return { user: user.toPublic() };
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 3. Zod Validation Required
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// WRONG (VETO)
|
|
49
|
+
.mutation(async ({ input }) => { await db.create(input); })
|
|
50
|
+
|
|
51
|
+
// CORRECT
|
|
52
|
+
.input(createSchema).mutation(async ({ input }) => { ... })
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Detection Commands
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# User ID from input
|
|
59
|
+
grep -r "input\.userId\|input\.user_id" server/
|
|
60
|
+
|
|
61
|
+
# Password in response
|
|
62
|
+
grep -r "passwordHash\|password:" server/
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## OWASP Checklist
|
|
66
|
+
|
|
67
|
+
- [ ] A01: User ID from session, not input?
|
|
68
|
+
- [ ] A02: Passwords hashed (bcrypt, salt >= 10)?
|
|
69
|
+
- [ ] A03: Queries use ORM (no string concat)?
|
|
70
|
+
- [ ] A07: Sessions invalidated on logout?
|
|
71
|
+
|
|
72
|
+
## Output
|
|
73
|
+
|
|
74
|
+
**APPROVED:** No vulnerabilities found
|
|
75
|
+
**VETOED:** Critical vulnerability - must fix before commit
|