sequant 1.0.0 → 1.1.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/README.md +12 -8
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +70 -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 +209 -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 +69 -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 +195 -0
- package/dist/src/commands/init.test.js.map +1 -0
- 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/package.json +4 -3
- 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 +16 -16
- package/templates/skills/clean/SKILL.md +2 -2
- package/templates/skills/docs/SKILL.md +32 -34
- package/templates/skills/exec/SKILL.md +17 -25
- package/templates/skills/fullsolve/SKILL.md +18 -16
- package/templates/skills/loop/SKILL.md +8 -5
- package/templates/skills/qa/SKILL.md +22 -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 +4 -2
- package/templates/skills/reflect/references/documentation-tiers.md +3 -3
- package/templates/skills/security-review/references/security-checklists.md +10 -8
- package/templates/skills/solve/SKILL.md +109 -155
- package/templates/skills/spec/SKILL.md +2 -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 +6 -5
- package/templates/skills/testgen/SKILL.md +0 -1
- package/templates/skills/verify/SKILL.md +5 -5
- package/templates/skills/reflect/scripts/workflow-queries.ts +0 -165
|
@@ -294,18 +294,18 @@ RECOMMENDATION: Gather more information
|
|
|
294
294
|
Provide relevant context to help the next command:
|
|
295
295
|
|
|
296
296
|
**Key Files to Review:**
|
|
297
|
-
-
|
|
298
|
-
-
|
|
299
|
-
-
|
|
297
|
+
- List the main components/files involved
|
|
298
|
+
- Point to relevant data layer code
|
|
299
|
+
- Reference architecture documentation if exists
|
|
300
300
|
|
|
301
301
|
**Similar Patterns:**
|
|
302
|
-
-
|
|
303
|
-
-
|
|
302
|
+
- Reference similar features in the codebase
|
|
303
|
+
- Point to reusable patterns
|
|
304
304
|
|
|
305
305
|
**Potential Risks:**
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
306
|
+
- Identify any error handling gaps
|
|
307
|
+
- Note external integrations not yet tested
|
|
308
|
+
- Flag potential database migrations needed
|
|
309
309
|
|
|
310
310
|
## Examples
|
|
311
311
|
|
|
@@ -343,22 +343,22 @@ RECOMMENDATION: Run `/spec 147`
|
|
|
343
343
|
|
|
344
344
|
```
|
|
345
345
|
Issue Summary
|
|
346
|
-
- Issue: #145 - Fix
|
|
346
|
+
- Issue: #145 - Fix data validation edge cases
|
|
347
347
|
- Status: Open | in-progress, bug
|
|
348
348
|
- Last Activity: 10 days ago
|
|
349
349
|
- Phase: Implementation (Stale)
|
|
350
350
|
|
|
351
351
|
Acceptance Criteria
|
|
352
|
-
- AC-1:
|
|
353
|
-
- AC-2: Handle edge cases (
|
|
354
|
-
- AC-3:
|
|
352
|
+
- AC-1: Handle basic validation - MET
|
|
353
|
+
- AC-2: Handle edge cases (empty, null, special chars) - IN_PROGRESS
|
|
354
|
+
- AC-3: Add validation tests - NOT_STARTED
|
|
355
355
|
Coverage: 1/3 complete
|
|
356
356
|
|
|
357
357
|
Artifacts Found
|
|
358
358
|
Implementation:
|
|
359
|
-
- [x] Branch: feature/145-
|
|
360
|
-
- [x] Worktree: ../worktrees/feature/145-
|
|
361
|
-
- [x] Modified: lib/utils/
|
|
359
|
+
- [x] Branch: feature/145-validation-fixes (3 commits)
|
|
360
|
+
- [x] Worktree: ../worktrees/feature/145-validation-fixes/
|
|
361
|
+
- [x] Modified: lib/utils/validation.ts
|
|
362
362
|
- [ ] Tests not found
|
|
363
363
|
|
|
364
364
|
Blockers & Issues
|
|
@@ -370,7 +370,7 @@ Recommendation
|
|
|
370
370
|
RECOMMENDATION: Resume `/exec 145`
|
|
371
371
|
- Implementation is 1/3 complete but stale
|
|
372
372
|
- Worktree still exists, resume work there
|
|
373
|
-
- Focus on AC-2 (edge cases) and AC-3 (
|
|
373
|
+
- Focus on AC-2 (edge cases) and AC-3 (tests)
|
|
374
374
|
- Add tests before considering complete
|
|
375
375
|
```
|
|
376
376
|
|
|
@@ -59,7 +59,7 @@ These files are always safe to archive - they're historical artifacts:
|
|
|
59
59
|
### Category 2: Review Before Archiving
|
|
60
60
|
|
|
61
61
|
These need a quick check - might still be referenced:
|
|
62
|
-
- Files in `migrations/` (check if applied to
|
|
62
|
+
- Files in `migrations/` (check if applied to database)
|
|
63
63
|
- `context/` directory contents
|
|
64
64
|
- Any `APPLY_*.md` or `apply-*.sh` files
|
|
65
65
|
|
|
@@ -78,7 +78,7 @@ Never archive these:
|
|
|
78
78
|
```
|
|
79
79
|
scripts/archive/
|
|
80
80
|
├── one-off-migrations/ # Shell scripts for one-time tasks
|
|
81
|
-
├── adhoc-migrations/ # SQL files applied manually (not via
|
|
81
|
+
├── adhoc-migrations/ # SQL files applied manually (not via migrations tool)
|
|
82
82
|
└── deprecated/ # Old/replaced scripts
|
|
83
83
|
|
|
84
84
|
docs/archive/
|
|
@@ -124,7 +124,7 @@ Generate documentation using this template:
|
|
|
124
124
|
|
|
125
125
|
## Common Workflows
|
|
126
126
|
|
|
127
|
-
### [Workflow 1: e.g., "Review and Approve
|
|
127
|
+
### [Workflow 1: e.g., "Review and Approve Items"]
|
|
128
128
|
|
|
129
129
|
1. [Step 1]
|
|
130
130
|
2. [Step 2]
|
|
@@ -158,15 +158,15 @@ Generate documentation using this template:
|
|
|
158
158
|
|
|
159
159
|
**Focus on operational usage, not technical implementation:**
|
|
160
160
|
|
|
161
|
-
- "Click the 'Approve' button to publish the
|
|
162
|
-
- NOT: "The `
|
|
161
|
+
- "Click the 'Approve' button to publish the item"
|
|
162
|
+
- NOT: "The `approveItem` function updates the database"
|
|
163
163
|
|
|
164
164
|
- "Wait for the green success message"
|
|
165
165
|
- NOT: "The API returns a 200 status code"
|
|
166
166
|
|
|
167
167
|
**Be specific and actionable:**
|
|
168
168
|
|
|
169
|
-
- "Navigate to Admin →
|
|
169
|
+
- "Navigate to Admin → Items → Review Queue"
|
|
170
170
|
- NOT: "Go to the review page"
|
|
171
171
|
|
|
172
172
|
**Include visual cues when relevant:**
|
|
@@ -176,8 +176,8 @@ Generate documentation using this template:
|
|
|
176
176
|
|
|
177
177
|
**Document common workflows end-to-end:**
|
|
178
178
|
|
|
179
|
-
- "To approve
|
|
180
|
-
- NOT: "Use the approve button
|
|
179
|
+
- "To approve an item: 1. Open Review Queue, 2. Click item name, 3. Review details, 4. Click Approve"
|
|
180
|
+
- NOT: "Use the approve button"
|
|
181
181
|
|
|
182
182
|
### 5. File Naming Convention
|
|
183
183
|
|
|
@@ -187,10 +187,10 @@ Generate filename from feature name:
|
|
|
187
187
|
- Match the primary feature purpose
|
|
188
188
|
|
|
189
189
|
Examples:
|
|
190
|
-
- `
|
|
190
|
+
- `review-queue.md` - For review admin page
|
|
191
191
|
- `bulk-edit-operations.md` - For bulk editing feature
|
|
192
|
-
- `
|
|
193
|
-
- `feature-gallery.md` - For
|
|
192
|
+
- `settings-configuration.md` - For settings admin
|
|
193
|
+
- `feature-gallery.md` - For gallery feature
|
|
194
194
|
|
|
195
195
|
### 6. Output and Summary
|
|
196
196
|
|
|
@@ -272,22 +272,21 @@ For Issue #180 (City Configuration UI):
|
|
|
272
272
|
|
|
273
273
|
## Usage
|
|
274
274
|
|
|
275
|
-
### Adding a New
|
|
275
|
+
### Adding a New Item
|
|
276
276
|
|
|
277
|
-
1. Navigate to Admin →
|
|
278
|
-
2. Click the "Add
|
|
279
|
-
3. Complete the
|
|
280
|
-
- **
|
|
281
|
-
- **
|
|
282
|
-
- **
|
|
283
|
-
|
|
284
|
-
4. Click "Create City" to save
|
|
277
|
+
1. Navigate to Admin → Items
|
|
278
|
+
2. Click the "Add Item" button (top right)
|
|
279
|
+
3. Complete the form:
|
|
280
|
+
- **Basic Info:** Enter name, description, and select status
|
|
281
|
+
- **Settings:** Configure item-specific options
|
|
282
|
+
- **Review:** Confirm all settings
|
|
283
|
+
4. Click "Create" to save
|
|
285
284
|
|
|
286
|
-
### Editing an Existing
|
|
285
|
+
### Editing an Existing Item
|
|
287
286
|
|
|
288
|
-
1. Navigate to Admin →
|
|
289
|
-
2. Click on the
|
|
290
|
-
3. Click "Edit" in the
|
|
287
|
+
1. Navigate to Admin → Items
|
|
288
|
+
2. Click on the item to open details
|
|
289
|
+
3. Click "Edit" in the details panel
|
|
291
290
|
4. Update settings as needed
|
|
292
291
|
5. Click "Save Changes"
|
|
293
292
|
|
|
@@ -295,27 +294,26 @@ For Issue #180 (City Configuration UI):
|
|
|
295
294
|
|
|
296
295
|
| Option | Description | Default |
|
|
297
296
|
|--------|-------------|---------|
|
|
298
|
-
| Status |
|
|
299
|
-
|
|
|
300
|
-
|
|
|
297
|
+
| Status | Item visibility (active, draft, archived) | draft |
|
|
298
|
+
| Category | Item categorization | None |
|
|
299
|
+
| Priority | Display order priority | Normal |
|
|
301
300
|
|
|
302
301
|
## Common Workflows
|
|
303
302
|
|
|
304
|
-
###
|
|
303
|
+
### Publish an Item
|
|
305
304
|
|
|
306
|
-
1. Add
|
|
307
|
-
2.
|
|
308
|
-
3.
|
|
309
|
-
4.
|
|
310
|
-
5. City appears on homepage
|
|
305
|
+
1. Add item via form (status: draft)
|
|
306
|
+
2. Review and approve in Review Queue
|
|
307
|
+
3. Change status to "active"
|
|
308
|
+
4. Item appears on public pages
|
|
311
309
|
|
|
312
310
|
## Troubleshooting
|
|
313
311
|
|
|
314
|
-
###
|
|
312
|
+
### Item doesn't appear on page
|
|
315
313
|
|
|
316
|
-
**Symptoms:**
|
|
314
|
+
**Symptoms:** Item was added but doesn't show
|
|
317
315
|
|
|
318
|
-
**Solution:** Check
|
|
316
|
+
**Solution:** Check item status is set to "active" in Admin → Items → [Item] → Settings
|
|
319
317
|
|
|
320
318
|
---
|
|
321
319
|
|
|
@@ -33,12 +33,8 @@ allowed-tools:
|
|
|
33
33
|
- Bash(gh issue edit:*)
|
|
34
34
|
- Bash(gh pr create:*)
|
|
35
35
|
- Bash(gh pr view:*)
|
|
36
|
-
# MCP tools
|
|
37
|
-
-
|
|
38
|
-
- mcp__supabase__execute_sql
|
|
39
|
-
- mcp__supabase__apply_migration
|
|
40
|
-
- mcp__context7__resolve-library-id
|
|
41
|
-
- mcp__context7__query-docs
|
|
36
|
+
# Optional MCP tools (enhanced functionality if available)
|
|
37
|
+
# - mcp__context7__* (library documentation lookup)
|
|
42
38
|
# Task management
|
|
43
39
|
- Task
|
|
44
40
|
- TodoWrite
|
|
@@ -122,7 +118,7 @@ Invocation:
|
|
|
122
118
|
- Create branch: `feature/<issue-number>-<issue-title-slug>`
|
|
123
119
|
- Create worktree in: `../worktrees/feature/<branch-name>/`
|
|
124
120
|
- Install dependencies
|
|
125
|
-
- Copy
|
|
121
|
+
- Copy environment files if they exist
|
|
126
122
|
- Navigate to the worktree directory: `cd ../worktrees/feature/<branch-name>/`
|
|
127
123
|
|
|
128
124
|
3. **Work in the worktree:**
|
|
@@ -151,32 +147,28 @@ Invocation:
|
|
|
151
147
|
- If it needs modification, extend it rather than creating a new one
|
|
152
148
|
- Document why existing utilities don't meet requirements before creating new ones
|
|
153
149
|
|
|
154
|
-
### Using
|
|
150
|
+
### Using Optional MCP Tools
|
|
155
151
|
|
|
156
|
-
|
|
152
|
+
If available, these MCP tools can enhance implementation:
|
|
157
153
|
|
|
158
|
-
**
|
|
154
|
+
**Context7** (mcp__context7__*) - For understanding external libraries:
|
|
155
|
+
- Learning unfamiliar npm package APIs
|
|
156
|
+
- Understanding third-party library patterns
|
|
157
|
+
- Resolving library-specific type issues
|
|
158
|
+
- **NOT for:** Project's own codebase (use Glob/Grep instead)
|
|
159
|
+
|
|
160
|
+
**Sequential Thinking** (mcp__sequential-thinking__*) - For complex reasoning:
|
|
159
161
|
- Novel algorithms or data structures
|
|
160
162
|
- Ambiguous requirements needing exploration
|
|
161
163
|
- Complex business logic with multiple edge cases
|
|
162
|
-
-
|
|
163
|
-
- **NOT for:** Standard CRUD operations, UI implementation following existing patterns, straightforward feature additions
|
|
164
|
-
|
|
165
|
-
**Context7** - For understanding external libraries and packages:
|
|
166
|
-
- Learning unfamiliar npm package APIs (react-query, zod, framer-motion, etc.)
|
|
167
|
-
- Understanding third-party library patterns
|
|
168
|
-
- Resolving library-specific type issues
|
|
169
|
-
- **NOT for:** Project's own codebase (use Glob/Grep instead), Next.js patterns (documented in CLAUDE.md)
|
|
164
|
+
- **NOT for:** Standard CRUD operations, straightforward feature additions
|
|
170
165
|
|
|
171
|
-
**
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
- Check RLS policies before data access code
|
|
175
|
-
- Understand table relationships
|
|
166
|
+
**Database MCP tools** - If your project uses a database MCP:
|
|
167
|
+
- Verify table schemas before writing queries
|
|
168
|
+
- Check access policies before data access code
|
|
176
169
|
- Validate data models match TypeScript types
|
|
177
|
-
- **USE for:** Every feature touching `content_updates`, `shops`, `pending_shops`, etc.
|
|
178
170
|
|
|
179
|
-
**General Rule:** If
|
|
171
|
+
**General Rule:** If implementing a feature similar to an existing one, use Glob/Grep to find patterns in the codebase first.
|
|
180
172
|
|
|
181
173
|
### 3. Checks-first Mindset
|
|
182
174
|
|
|
@@ -14,10 +14,10 @@ allowed-tools:
|
|
|
14
14
|
- Bash
|
|
15
15
|
- TodoWrite
|
|
16
16
|
- Task
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
- mcp__sequential-
|
|
20
|
-
- mcp__context7__*
|
|
17
|
+
# Optional MCP tools (enhanced functionality if available)
|
|
18
|
+
# - mcp__chrome-devtools__* (browser testing)
|
|
19
|
+
# - mcp__sequential-thinking__* (complex reasoning)
|
|
20
|
+
# - mcp__context7__* (library documentation)
|
|
21
21
|
- Bash(gh issue view:*)
|
|
22
22
|
- Bash(gh issue comment:*)
|
|
23
23
|
- Bash(gh issue edit:*)
|
|
@@ -290,20 +290,19 @@ Post completion comment to issue with:
|
|
|
290
290
|
|
|
291
291
|
### 5.3 Merge Workflow (Correct Order)
|
|
292
292
|
|
|
293
|
-
**IMPORTANT:**
|
|
293
|
+
**IMPORTANT:** Merge the PR first, then clean up the worktree.
|
|
294
294
|
|
|
295
295
|
```bash
|
|
296
|
-
# 1.
|
|
297
|
-
./scripts/dev/cleanup-worktree.sh feature/<issue-number>-*
|
|
298
|
-
|
|
299
|
-
# 2. THEN merge (--delete-branch now works since local branch is gone)
|
|
296
|
+
# 1. Merge PR (--delete-branch deletes remote; local deletion will fail but that's OK)
|
|
300
297
|
gh pr merge <N> --squash --delete-branch
|
|
301
298
|
|
|
302
|
-
#
|
|
303
|
-
|
|
299
|
+
# 2. Clean up worktree (removes local worktree + branch)
|
|
300
|
+
./scripts/dev/cleanup-worktree.sh feature/<issue-number>-*
|
|
301
|
+
|
|
302
|
+
# 3. Issue auto-closes if commit message contains "Fixes #N"
|
|
304
303
|
```
|
|
305
304
|
|
|
306
|
-
**Why this order matters:**
|
|
305
|
+
**Why this order matters:** The cleanup script checks if the PR is merged before proceeding. The `--delete-branch` flag will fail to delete the local branch (worktree conflict) but successfully deletes the remote branch. The cleanup script then handles the local branch removal.
|
|
307
306
|
|
|
308
307
|
## Iteration Tracking
|
|
309
308
|
|
|
@@ -468,12 +467,15 @@ npx tsx scripts/dev/analyze-hook-logs.ts --tests
|
|
|
468
467
|
/fullsolve 218 --max-iterations 5
|
|
469
468
|
```
|
|
470
469
|
|
|
471
|
-
##
|
|
470
|
+
## Batch Processing
|
|
472
471
|
|
|
473
|
-
For
|
|
472
|
+
For multiple issues, run `/fullsolve` on each sequentially:
|
|
474
473
|
|
|
475
474
|
```bash
|
|
476
|
-
|
|
475
|
+
# Process multiple issues one at a time
|
|
476
|
+
/fullsolve 218
|
|
477
|
+
/fullsolve 219
|
|
478
|
+
/fullsolve 220
|
|
477
479
|
```
|
|
478
480
|
|
|
479
|
-
|
|
481
|
+
Each issue gets its own worktree, PR, and quality validation.
|
|
@@ -13,8 +13,8 @@ allowed-tools:
|
|
|
13
13
|
- Grep
|
|
14
14
|
- Bash
|
|
15
15
|
- TodoWrite
|
|
16
|
-
|
|
17
|
-
-
|
|
16
|
+
# Optional MCP tools (enhanced functionality if available)
|
|
17
|
+
# - mcp__chrome-devtools__* (browser testing)
|
|
18
18
|
- Bash(gh issue view:*)
|
|
19
19
|
- Bash(gh issue comment:*)
|
|
20
20
|
- Bash(npm test:*)
|
|
@@ -212,10 +212,13 @@ For each iteration, output:
|
|
|
212
212
|
/qa 218 # Final QA - READY_FOR_MERGE
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
**Automated
|
|
215
|
+
**Automated workflow:**
|
|
216
216
|
```bash
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
/spec 218 # Plan
|
|
218
|
+
/exec 218 # Implement
|
|
219
|
+
/test 218 # Test - finds issues
|
|
220
|
+
/loop 218 # Fix issues, re-test
|
|
221
|
+
/qa 218 # Final QA
|
|
219
222
|
```
|
|
220
223
|
|
|
221
224
|
## Example Log Parsing
|
|
@@ -41,6 +41,25 @@ Invocation:
|
|
|
41
41
|
- `/qa 123`: Treat `123` as the GitHub issue/PR identifier in context.
|
|
42
42
|
- `/qa <freeform description>`: Treat the text as context about the change to review.
|
|
43
43
|
|
|
44
|
+
### Pre-flight Sync Check
|
|
45
|
+
|
|
46
|
+
Before starting QA, verify the local branch is in sync with remote:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git fetch origin 2>/dev/null || echo "Network unavailable - proceeding with local state"
|
|
50
|
+
git status -sb | head -1 # Shows ahead/behind status
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Status interpretation:**
|
|
54
|
+
- `[ahead N]` - Local has commits not on remote (OK to proceed)
|
|
55
|
+
- `[behind N]` - Remote has commits not pulled locally (recommend sync first)
|
|
56
|
+
- `[ahead N, behind M]` - Branches diverged (recommend sync before QA)
|
|
57
|
+
|
|
58
|
+
If diverged, recommend:
|
|
59
|
+
```bash
|
|
60
|
+
git pull origin main # Or merge origin/main if pull fails
|
|
61
|
+
```
|
|
62
|
+
|
|
44
63
|
### Feature Worktree Workflow
|
|
45
64
|
|
|
46
65
|
**QA Phase:** Review code in the feature worktree.
|
|
@@ -119,11 +138,10 @@ admin_modified=$(git diff main...HEAD --name-only | grep -E "^app/admin/" | head
|
|
|
119
138
|
|
|
120
139
|
See [quality-gates.md](references/quality-gates.md) for detailed verdict synthesis.
|
|
121
140
|
|
|
122
|
-
### Using MCP Tools
|
|
141
|
+
### Using MCP Tools (Optional)
|
|
123
142
|
|
|
124
143
|
- **Sequential Thinking:** For complex multi-step analysis
|
|
125
|
-
- **Context7:** For broader pattern context
|
|
126
|
-
- **Supabase MCP:** For database-related code verification
|
|
144
|
+
- **Context7:** For broader pattern context and library documentation
|
|
127
145
|
|
|
128
146
|
### 1. Context and AC Alignment
|
|
129
147
|
|
|
@@ -252,7 +270,7 @@ fi
|
|
|
252
270
|
# QA detects scripts/ changes
|
|
253
271
|
# -> Prompt: "Run /verify before READY_FOR_MERGE"
|
|
254
272
|
|
|
255
|
-
/verify 558 --command "npx tsx scripts/
|
|
273
|
+
/verify 558 --command "npx tsx scripts/migrate.ts --dry-run"
|
|
256
274
|
|
|
257
275
|
# Human confirms output looks correct
|
|
258
276
|
# -> /verify posts evidence to issue
|
|
@@ -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
|
|
|
@@ -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/)
|