sequant 1.0.0 → 1.1.1
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/README.md +12 -8
- package/dist/bin/cli.js +12 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +46 -0
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/doctor.test.d.ts +2 -0
- package/dist/src/commands/doctor.test.d.ts.map +1 -0
- package/dist/src/commands/doctor.test.js +140 -0
- package/dist/src/commands/doctor.test.js.map +1 -0
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +45 -2
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/init.test.d.ts +2 -0
- package/dist/src/commands/init.test.d.ts.map +1 -0
- package/dist/src/commands/init.test.js +152 -0
- package/dist/src/commands/init.test.js.map +1 -0
- package/dist/src/commands/logs.d.ts +18 -0
- package/dist/src/commands/logs.d.ts.map +1 -0
- package/dist/src/commands/logs.js +188 -0
- package/dist/src/commands/logs.js.map +1 -0
- package/dist/src/commands/run.d.ts +2 -0
- package/dist/src/commands/run.d.ts.map +1 -1
- package/dist/src/commands/run.js +114 -29
- package/dist/src/commands/run.js.map +1 -1
- package/dist/src/lib/stacks.d.ts.map +1 -1
- package/dist/src/lib/stacks.js +39 -0
- package/dist/src/lib/stacks.js.map +1 -1
- package/dist/src/lib/stacks.test.d.ts +2 -0
- package/dist/src/lib/stacks.test.d.ts.map +1 -0
- package/dist/src/lib/stacks.test.js +145 -0
- package/dist/src/lib/stacks.test.js.map +1 -0
- package/dist/src/lib/system.d.ts +16 -0
- package/dist/src/lib/system.d.ts.map +1 -0
- package/dist/src/lib/system.js +52 -0
- package/dist/src/lib/system.js.map +1 -0
- package/dist/src/lib/system.test.d.ts +2 -0
- package/dist/src/lib/system.test.d.ts.map +1 -0
- package/dist/src/lib/system.test.js +80 -0
- package/dist/src/lib/system.test.js.map +1 -0
- package/dist/src/lib/workflow/log-writer.d.ts +83 -0
- package/dist/src/lib/workflow/log-writer.d.ts.map +1 -0
- package/dist/src/lib/workflow/log-writer.js +193 -0
- package/dist/src/lib/workflow/log-writer.js.map +1 -0
- package/dist/src/lib/workflow/run-log-schema.d.ts +261 -0
- package/dist/src/lib/workflow/run-log-schema.d.ts.map +1 -0
- package/dist/src/lib/workflow/run-log-schema.js +234 -0
- package/dist/src/lib/workflow/run-log-schema.js.map +1 -0
- package/package.json +6 -4
- package/stacks/astro.yaml +35 -0
- package/templates/hooks/post-tool.sh +0 -11
- package/templates/hooks/pre-tool.sh +2 -2
- package/templates/memory/constitution.md +8 -0
- package/templates/scripts/cleanup-worktree.sh +1 -1
- package/templates/scripts/new-feature.sh +7 -5
- package/templates/skills/assess/SKILL.md +31 -16
- package/templates/skills/clean/SKILL.md +17 -2
- package/templates/skills/docs/SKILL.md +48 -34
- package/templates/skills/exec/SKILL.md +31 -25
- package/templates/skills/fullsolve/SKILL.md +34 -16
- package/templates/skills/loop/SKILL.md +22 -5
- package/templates/skills/qa/SKILL.md +89 -4
- package/templates/skills/qa/references/code-quality-exemplars.md +23 -28
- package/templates/skills/qa/references/code-review-checklist.md +6 -17
- package/templates/skills/qa/scripts/quality-checks.sh +4 -17
- package/templates/skills/reflect/SKILL.md +18 -2
- package/templates/skills/reflect/references/documentation-tiers.md +3 -3
- package/templates/skills/security-review/SKILL.md +15 -0
- package/templates/skills/security-review/references/security-checklists.md +10 -8
- package/templates/skills/solve/SKILL.md +147 -149
- package/templates/skills/spec/SKILL.md +61 -3
- package/templates/skills/spec/references/parallel-groups.md +1 -1
- package/templates/skills/spec/references/verification-criteria.md +1 -1
- package/templates/skills/test/SKILL.md +20 -5
- package/templates/skills/testgen/SKILL.md +15 -1
- package/templates/skills/verify/SKILL.md +20 -5
- package/templates/skills/reflect/scripts/workflow-queries.ts +0 -165
|
@@ -1,36 +1,31 @@
|
|
|
1
1
|
# Code Quality Exemplars
|
|
2
2
|
|
|
3
|
-
## ✅ Good Example:
|
|
3
|
+
## ✅ Good Example: Feature Dashboard (Complex Feature)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**AC:** Content Ideas Queue with filtering, pagination, bulk actions, and scoring (17 AC items)
|
|
5
|
+
**AC:** Dashboard with filtering, pagination, bulk actions, and analytics (17 AC items)
|
|
8
6
|
|
|
9
7
|
**Changes** (1553 net LOC, 20 files):
|
|
10
|
-
- `components/
|
|
11
|
-
- `components/
|
|
12
|
-
- `components/
|
|
13
|
-
- `components/
|
|
14
|
-
- `components/
|
|
15
|
-
- `
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
-
|
|
19
|
-
- `types/news.ts` (new, 87 LOC) - Type definitions
|
|
20
|
-
- 5 API routes (promote, archive, score, bulk actions)
|
|
8
|
+
- `components/feature/Dashboard.tsx` (new, 349 LOC) - Main interface
|
|
9
|
+
- `components/feature/DetailModal.tsx` (new, 205 LOC) - Full-screen detail view
|
|
10
|
+
- `components/feature/FilterPanel.tsx` (new, 134 LOC) - Multi-criteria filtering
|
|
11
|
+
- `components/feature/ItemCard.tsx` (new, 125 LOC) - Compact card view
|
|
12
|
+
- `components/feature/ActionButtons.tsx` (new, 44 LOC) - Action buttons
|
|
13
|
+
- `lib/queries/feature.ts` (modified, +318 LOC) - Database queries
|
|
14
|
+
- `app/dashboard/page.tsx` (modified, +137 LOC) - Main route
|
|
15
|
+
- `types/feature.ts` (new, 87 LOC) - Type definitions
|
|
16
|
+
- 5 API routes (create, update, delete, bulk actions)
|
|
21
17
|
|
|
22
18
|
**Why it's A+:**
|
|
23
19
|
- ✅ Every file directly serves an AC item (17 AC → ~1500 LOC = 88 LOC/AC)
|
|
24
20
|
- ✅ Size proportional to scope (complex feature with 6 components + 5 API routes)
|
|
25
21
|
- ✅ Zero scope creep - no refactoring of unrelated code
|
|
26
|
-
- ✅ Type safety
|
|
27
|
-
- ✅ Follows existing
|
|
22
|
+
- ✅ Type safety maintained (proper types, no `any` usage)
|
|
23
|
+
- ✅ Follows existing patterns in codebase
|
|
28
24
|
- ✅ Clear separation of concerns (UI, data, types, API)
|
|
29
|
-
- ✅
|
|
30
|
-
- ✅ Build succeeds, all 280 tests pass
|
|
25
|
+
- ✅ Build succeeds, all tests pass
|
|
31
26
|
|
|
32
27
|
**Automated Checks:**
|
|
33
|
-
- Type issues: 0
|
|
28
|
+
- Type issues: 0
|
|
34
29
|
- Deleted tests: 0
|
|
35
30
|
- Files changed: 20
|
|
36
31
|
- Diff size: +2107 -554 (net: +1553)
|
|
@@ -42,17 +37,17 @@
|
|
|
42
37
|
|
|
43
38
|
## ⚠️ Acceptable but Not A+
|
|
44
39
|
|
|
45
|
-
**AC:** Add bulk edit modal
|
|
40
|
+
**AC:** Add bulk edit modal (6 AC items)
|
|
46
41
|
|
|
47
42
|
**Changes** (420 net LOC, 12 files):
|
|
48
|
-
- `components/
|
|
49
|
-
- `lib/queries/
|
|
50
|
-
- `app/
|
|
43
|
+
- `components/feature/BulkEditModal.tsx` (new, 280 LOC)
|
|
44
|
+
- `lib/queries/items.ts` (modified, +85 LOC)
|
|
45
|
+
- `app/feature/actions.ts` (modified, +45 LOC)
|
|
51
46
|
- 9 other files (minor changes, imports, types)
|
|
52
47
|
|
|
53
48
|
**Issues:**
|
|
54
49
|
- ⚠️ BulkEditModal is 280 LOC - could be split into smaller components
|
|
55
|
-
- ⚠️ Added 3 utility functions
|
|
50
|
+
- ⚠️ Added 3 utility functions not directly used by AC
|
|
56
51
|
- ⚠️ Changed formatting in 2 unrelated files ("while I was here" changes)
|
|
57
52
|
|
|
58
53
|
**Why it's acceptable:**
|
|
@@ -79,12 +74,12 @@
|
|
|
79
74
|
|
|
80
75
|
## ❌ Needs Rework
|
|
81
76
|
|
|
82
|
-
**AC:** Display
|
|
77
|
+
**AC:** Display reviews on detail page (3 simple AC items)
|
|
83
78
|
|
|
84
79
|
**Changes** (890 net LOC, 23 files):
|
|
85
80
|
- Rewrote entire reviews system (not in AC)
|
|
86
|
-
- Added new
|
|
87
|
-
- Refactored unrelated
|
|
81
|
+
- Added new API routes (not in AC)
|
|
82
|
+
- Refactored unrelated queries (not in AC)
|
|
88
83
|
- Changed database schema without migration (BLOCKER)
|
|
89
84
|
- Removed type annotations from 5 functions (type safety violation)
|
|
90
85
|
- Deleted 2 test files to "make build pass" (BLOCKER)
|
|
@@ -21,7 +21,7 @@ git diff main...HEAD --name-only | grep "^scripts/"
|
|
|
21
21
|
|
|
22
22
|
### 2. Pattern Compliance
|
|
23
23
|
Do new scripts follow existing patterns?
|
|
24
|
-
- Scripts:
|
|
24
|
+
- Scripts: Database client setup, env validation, CLI flags (`--dry-run`, `--limit`)
|
|
25
25
|
- Components: Follow established admin patterns (List + Card + Modal)
|
|
26
26
|
- Compare with similar files: `ls scripts/fix/` or `ls components/admin/`
|
|
27
27
|
|
|
@@ -42,23 +42,12 @@ If adding new scripts/commands, should they be documented?
|
|
|
42
42
|
|
|
43
43
|
Skip trivial formatting if the repo already has automated formatting tools.
|
|
44
44
|
|
|
45
|
-
##
|
|
45
|
+
## Database Access Check
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
admin_files=$(git diff main...HEAD --name-only | grep -E "^app/admin/")
|
|
52
|
-
if [[ -n "$admin_files" ]]; then
|
|
53
|
-
for file in $admin_files; do
|
|
54
|
-
if [[ -f "$file" ]]; then
|
|
55
|
-
if grep -q "from '@/lib/supabase'" "$file" && grep -qE "\.from\(['\"]($rls_tables)['\"]" "$file"; then
|
|
56
|
-
echo "❌ BLOCKER: $file uses anon client for RLS-protected table"
|
|
57
|
-
fi
|
|
58
|
-
fi
|
|
59
|
-
done
|
|
60
|
-
fi
|
|
61
|
-
```
|
|
47
|
+
If project uses a database with access controls:
|
|
48
|
+
- Verify admin pages use admin/service client (not anonymous client)
|
|
49
|
+
- Check that sensitive tables are accessed with proper permissions
|
|
50
|
+
- Review any new database queries for proper authorization
|
|
62
51
|
|
|
63
52
|
## Integration Check
|
|
64
53
|
|
|
@@ -45,26 +45,13 @@ else
|
|
|
45
45
|
echo "❌ Size: Very large (>500 net LOC) - may indicate scope creep"
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
|
-
# 6.
|
|
48
|
+
# 6. Database access check (admin pages should use proper access controls)
|
|
49
49
|
echo ""
|
|
50
|
-
echo "🔒 Checking
|
|
51
|
-
rls_tables="content_updates|content_ideas|fact_check_logs"
|
|
50
|
+
echo "🔒 Checking database access patterns..."
|
|
52
51
|
admin_files=$(git diff main...HEAD --name-only | grep -E "^app/admin/" || true)
|
|
53
52
|
if [[ -n "$admin_files" ]]; then
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if [[ -f "$file" ]]; then
|
|
57
|
-
# Check if file imports anon client and queries RLS-protected tables
|
|
58
|
-
if grep -q "from '@/lib/supabase'" "$file" && grep -qE "\.from\(['\"]($rls_tables)['\"]" "$file"; then
|
|
59
|
-
echo "❌ BLOCKER: $file uses anon client for RLS-protected table"
|
|
60
|
-
echo " Fix: Use supabaseAdmin from '@/lib/supabase-admin' instead"
|
|
61
|
-
rls_violations=$((rls_violations + 1))
|
|
62
|
-
fi
|
|
63
|
-
fi
|
|
64
|
-
done
|
|
65
|
-
if [[ $rls_violations -eq 0 ]]; then
|
|
66
|
-
echo "✅ RLS access: No violations found in admin files"
|
|
67
|
-
fi
|
|
53
|
+
echo " Admin files modified - manually verify proper database access controls"
|
|
54
|
+
echo " (admin pages should use service/admin clients, not anonymous clients)"
|
|
68
55
|
else
|
|
69
56
|
echo " No admin files modified"
|
|
70
57
|
fi
|
|
@@ -10,7 +10,6 @@ allowed-tools:
|
|
|
10
10
|
- Write
|
|
11
11
|
- Glob
|
|
12
12
|
- Grep
|
|
13
|
-
- mcp__supabase__execute_sql
|
|
14
13
|
---
|
|
15
14
|
|
|
16
15
|
# Reflection Agent
|
|
@@ -137,7 +136,10 @@ Generate a checklist:
|
|
|
137
136
|
|
|
138
137
|
## Workflow Analytics
|
|
139
138
|
|
|
140
|
-
For `/reflect workflow`,
|
|
139
|
+
For `/reflect workflow`, analyze:
|
|
140
|
+
- Log files in `/tmp/claude-issue-*.log`
|
|
141
|
+
- Git history and commit patterns
|
|
142
|
+
- Issue comments and PR history
|
|
141
143
|
|
|
142
144
|
See [phase-reflection.md](references/phase-reflection.md) for phase-specific guidance.
|
|
143
145
|
|
|
@@ -157,3 +159,17 @@ At the end of reflection, ask:
|
|
|
157
159
|
- Did I identify root causes or just symptoms?
|
|
158
160
|
- Will these changes be maintainable long-term?
|
|
159
161
|
- Am I in the right workflow phase for this reflection focus?
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Output Verification
|
|
166
|
+
|
|
167
|
+
**Before responding, verify your output includes ALL of these:**
|
|
168
|
+
|
|
169
|
+
- [ ] **Session Summary** - What was accomplished, what went well, friction points
|
|
170
|
+
- [ ] **Effectiveness Analysis** - Token efficiency, context gathering, pattern reuse
|
|
171
|
+
- [ ] **Proposed Changes** - Specific changes with target files and rationale
|
|
172
|
+
- [ ] **Documentation Health** - Line count, bloat assessment, recommendations
|
|
173
|
+
- [ ] **Action Items** - Checklist of concrete next steps
|
|
174
|
+
|
|
175
|
+
**DO NOT respond until all items are verified.**
|
|
@@ -25,9 +25,9 @@ Organize information by access frequency:
|
|
|
25
25
|
- Review quarterly
|
|
26
26
|
|
|
27
27
|
**Current specialized docs:**
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
30
|
-
- `TESTING.md` -
|
|
28
|
+
- `ARCHITECTURE.md` - System architecture overview
|
|
29
|
+
- `DATA_PIPELINE.md` - Data processing workflows
|
|
30
|
+
- `TESTING.md` - Testing patterns and strategies
|
|
31
31
|
- `ADMIN_CMS_ARCHITECTURE.md` - Full CMS architecture
|
|
32
32
|
|
|
33
33
|
## Tier 3: Archive (docs/archive/)
|
|
@@ -342,3 +342,18 @@ EOF
|
|
|
342
342
|
- Trace session lifecycle
|
|
343
343
|
- Review token handling
|
|
344
344
|
- Check for timing vulnerabilities
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Output Verification
|
|
349
|
+
|
|
350
|
+
**Before responding, verify your output includes ALL of these:**
|
|
351
|
+
|
|
352
|
+
- [ ] **Security Domain** - Identified domains (Auth, API, Admin, Data, Infra)
|
|
353
|
+
- [ ] **Threat Model Summary** - Attack surface, threat actors, attack vectors
|
|
354
|
+
- [ ] **Findings by Severity** - Critical, High, Medium, Low/Informational
|
|
355
|
+
- [ ] **Checklist Status Table** - Passed/Failed/Manual counts per domain
|
|
356
|
+
- [ ] **Verdict** - SECURE, WARNINGS, or ISSUES_FOUND
|
|
357
|
+
- [ ] **GitHub Comment** - Security review posted to issue
|
|
358
|
+
|
|
359
|
+
**DO NOT respond until all items are verified.**
|
|
@@ -151,8 +151,8 @@ if (user.role !== 'admin') throw new ForbiddenError()
|
|
|
151
151
|
|
|
152
152
|
**Bad:**
|
|
153
153
|
```typescript
|
|
154
|
-
const
|
|
155
|
-
// Missing: .
|
|
154
|
+
const item = await db.items.findUnique({ where: { id: itemId } })
|
|
155
|
+
// Missing: ownership verification (e.g., where: { id: itemId, owner_id: user.id })
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
### AUTHZ-4: Horizontal Privilege Escalation
|
|
@@ -174,12 +174,12 @@ const shop = await db.shops.findUnique({ where: { id: shopId } })
|
|
|
174
174
|
|
|
175
175
|
**How to Verify:**
|
|
176
176
|
```bash
|
|
177
|
-
grep -r "audit\|logAction\|
|
|
177
|
+
grep -r "audit\|logAction\|createAuditLog" lib/ app/admin/
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
**Good:**
|
|
181
181
|
```typescript
|
|
182
|
-
await logAuditEvent({ action: '
|
|
182
|
+
await logAuditEvent({ action: 'approve_item', actor: userId, target: itemId })
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
---
|
|
@@ -217,18 +217,20 @@ const { name } = req.body // No validation
|
|
|
217
217
|
|
|
218
218
|
**How to Verify:**
|
|
219
219
|
```bash
|
|
220
|
-
grep -r "\.from\(" lib/ app/ | grep -v "supabase"
|
|
221
220
|
grep -r "raw\|execute\|query" lib/ app/
|
|
222
221
|
```
|
|
223
222
|
|
|
224
223
|
**Good:**
|
|
225
224
|
```typescript
|
|
226
|
-
|
|
225
|
+
// Using ORM with parameterized queries
|
|
226
|
+
db.items.findUnique({ where: { id: itemId } })
|
|
227
|
+
// Or query builder with parameters
|
|
228
|
+
db.from('items').select('*').eq('id', itemId)
|
|
227
229
|
```
|
|
228
230
|
|
|
229
231
|
**Bad:**
|
|
230
232
|
```typescript
|
|
231
|
-
db.query(`SELECT * FROM
|
|
233
|
+
db.query(`SELECT * FROM items WHERE id = ${itemId}`)
|
|
232
234
|
```
|
|
233
235
|
|
|
234
236
|
### API-4: Rate Limiting
|
|
@@ -290,7 +292,7 @@ if (file.size > 5 * 1024 * 1024) throw Error
|
|
|
290
292
|
**Requirement:** Sensitive data must be encrypted in database.
|
|
291
293
|
|
|
292
294
|
**How to Verify:**
|
|
293
|
-
-
|
|
295
|
+
- Verify database uses encryption at rest (most cloud providers enable by default)
|
|
294
296
|
- Check for additional encryption on highly sensitive fields
|
|
295
297
|
|
|
296
298
|
### DATA-2: Encryption in Transit
|