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
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workflow Analytics SQL Queries
|
|
3
|
-
*
|
|
4
|
-
* Use with Supabase MCP's execute_sql for /reflect workflow analysis.
|
|
5
|
-
* The workflow_runs table stores phase completion data with duration, verdict, and errors.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const WORKFLOW_QUERIES = {
|
|
9
|
-
/**
|
|
10
|
-
* Success rate by phase (last 30 days)
|
|
11
|
-
*/
|
|
12
|
-
successRateByPhase: `
|
|
13
|
-
SELECT
|
|
14
|
-
phase,
|
|
15
|
-
COUNT(*) as total_runs,
|
|
16
|
-
COUNT(*) FILTER (WHERE status = 'completed' AND verdict IN ('pass', 'pass_with_notes')) as successful,
|
|
17
|
-
ROUND(COUNT(*) FILTER (WHERE status = 'completed' AND verdict IN ('pass', 'pass_with_notes')) * 100.0 / NULLIF(COUNT(*), 0), 1) as success_rate,
|
|
18
|
-
ROUND(AVG(duration_seconds) FILTER (WHERE status = 'completed'), 0) as avg_duration_sec
|
|
19
|
-
FROM workflow_runs
|
|
20
|
-
WHERE started_at > now() - INTERVAL '30 days'
|
|
21
|
-
GROUP BY phase
|
|
22
|
-
ORDER BY phase;
|
|
23
|
-
`,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Most common error categories
|
|
27
|
-
*/
|
|
28
|
-
errorCategories: `
|
|
29
|
-
SELECT
|
|
30
|
-
error_category,
|
|
31
|
-
COUNT(*) as occurrences,
|
|
32
|
-
ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM workflow_runs WHERE error_category IS NOT NULL), 1) as percentage
|
|
33
|
-
FROM workflow_runs
|
|
34
|
-
WHERE error_category IS NOT NULL
|
|
35
|
-
AND started_at > now() - INTERVAL '30 days'
|
|
36
|
-
GROUP BY error_category
|
|
37
|
-
ORDER BY occurrences DESC
|
|
38
|
-
LIMIT 10;
|
|
39
|
-
`,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Issues requiring most loop iterations
|
|
43
|
-
*/
|
|
44
|
-
highIterationIssues: `
|
|
45
|
-
SELECT
|
|
46
|
-
issue_number,
|
|
47
|
-
COUNT(*) as total_loop_runs,
|
|
48
|
-
MAX(iteration_number) as max_iterations_used,
|
|
49
|
-
COUNT(*) FILTER (WHERE verdict = 'pass') as eventually_passed
|
|
50
|
-
FROM workflow_runs
|
|
51
|
-
WHERE retry_type = 'loop'
|
|
52
|
-
AND started_at > now() - INTERVAL '30 days'
|
|
53
|
-
GROUP BY issue_number
|
|
54
|
-
ORDER BY total_loop_runs DESC
|
|
55
|
-
LIMIT 10;
|
|
56
|
-
`,
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* /exec verification failure rate
|
|
60
|
-
*/
|
|
61
|
-
execVerificationRate: `
|
|
62
|
-
SELECT
|
|
63
|
-
verification_result,
|
|
64
|
-
COUNT(*) as occurrences,
|
|
65
|
-
ROUND(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM workflow_runs WHERE phase = 'exec' AND verification_result IS NOT NULL), 1) as percentage
|
|
66
|
-
FROM workflow_runs
|
|
67
|
-
WHERE phase = 'exec'
|
|
68
|
-
AND verification_result IS NOT NULL
|
|
69
|
-
AND started_at > now() - INTERVAL '30 days'
|
|
70
|
-
GROUP BY verification_result
|
|
71
|
-
ORDER BY occurrences DESC;
|
|
72
|
-
`,
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Average time to completion by issue labels
|
|
76
|
-
*/
|
|
77
|
-
durationByLabel: `
|
|
78
|
-
SELECT
|
|
79
|
-
unnest(labels) as label,
|
|
80
|
-
COUNT(*) as issues_with_label,
|
|
81
|
-
ROUND(AVG(duration_seconds) FILTER (WHERE status = 'completed'), 0) as avg_duration_sec
|
|
82
|
-
FROM workflow_runs
|
|
83
|
-
WHERE phase = 'exec'
|
|
84
|
-
AND status = 'completed'
|
|
85
|
-
AND labels IS NOT NULL
|
|
86
|
-
AND started_at > now() - INTERVAL '30 days'
|
|
87
|
-
GROUP BY label
|
|
88
|
-
HAVING COUNT(*) > 2
|
|
89
|
-
ORDER BY avg_duration_sec DESC;
|
|
90
|
-
`,
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Daily workflow volume (trend analysis)
|
|
94
|
-
*/
|
|
95
|
-
dailyVolume: `
|
|
96
|
-
SELECT
|
|
97
|
-
DATE(started_at) as date,
|
|
98
|
-
COUNT(*) as total_runs,
|
|
99
|
-
COUNT(*) FILTER (WHERE verdict IN ('pass', 'pass_with_notes')) as passed,
|
|
100
|
-
COUNT(*) FILTER (WHERE verdict = 'fail') as failed
|
|
101
|
-
FROM workflow_runs
|
|
102
|
-
WHERE started_at > now() - INTERVAL '14 days'
|
|
103
|
-
GROUP BY DATE(started_at)
|
|
104
|
-
ORDER BY date DESC;
|
|
105
|
-
`,
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Example usage in /reflect workflow:
|
|
110
|
-
*
|
|
111
|
-
* 1. Run the analysis script (preferred):
|
|
112
|
-
* npx tsx --env-file=.env.local scripts/dev/analyze-workflow-patterns.ts --days 7 --skip-issue-creation
|
|
113
|
-
*
|
|
114
|
-
* 2. Or run queries individually via Supabase MCP:
|
|
115
|
-
* mcp__supabase__execute_sql({ query: WORKFLOW_QUERIES.successRateByPhase })
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
export function formatWorkflowReport(results: {
|
|
119
|
-
successRates: Array<{
|
|
120
|
-
phase: string;
|
|
121
|
-
success_rate: number;
|
|
122
|
-
total_runs: number;
|
|
123
|
-
}>;
|
|
124
|
-
errorCategories: Array<{ error_category: string; occurrences: number }>;
|
|
125
|
-
highIterationIssues: Array<{
|
|
126
|
-
issue_number: number;
|
|
127
|
-
total_loop_runs: number;
|
|
128
|
-
eventually_passed: number;
|
|
129
|
-
}>;
|
|
130
|
-
}): string {
|
|
131
|
-
const lines: string[] = [];
|
|
132
|
-
|
|
133
|
-
lines.push("📊 Workflow Analysis (Last 7 days)");
|
|
134
|
-
lines.push("");
|
|
135
|
-
lines.push("Success Rates:");
|
|
136
|
-
|
|
137
|
-
for (const row of results.successRates) {
|
|
138
|
-
const passCount = Math.round((row.total_runs * row.success_rate) / 100);
|
|
139
|
-
lines.push(
|
|
140
|
-
` /${row.phase}: ${row.success_rate}% (${passCount}/${row.total_runs})`,
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
lines.push("");
|
|
145
|
-
lines.push("Top Failure Categories:");
|
|
146
|
-
|
|
147
|
-
for (let i = 0; i < Math.min(results.errorCategories.length, 5); i++) {
|
|
148
|
-
const row = results.errorCategories[i];
|
|
149
|
-
lines.push(
|
|
150
|
-
` ${i + 1}. ${row.error_category} (${row.occurrences} occurrences)`,
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
lines.push("");
|
|
155
|
-
lines.push("Issues Requiring Most Retries:");
|
|
156
|
-
|
|
157
|
-
for (const row of results.highIterationIssues.slice(0, 5)) {
|
|
158
|
-
const status = row.eventually_passed > 0 ? "passed" : "failed";
|
|
159
|
-
lines.push(
|
|
160
|
-
` #${row.issue_number} - ${row.total_loop_runs} iterations (${status})`,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
return lines.join("\n");
|
|
165
|
-
}
|