Repository navigation
Description
Problem
Skills like /solve don't consistently follow their instructions. For example, /solve 12 sometimes omits the sequant run CLI command even though it's specified in the skill. This affects user experience and makes skills unreliable for automation.
Goals
- Consistent skill output - Skills always include required sections
- Machine-readable logs -
sequant runoutputs structured data for analysis - Validation without friction - Layers that catch issues without slowing down usage
- Reusable patterns - Standard templates for skill authors
Proposed Solution: Layered Validation
Layer 1: Self-Verification Checklist (All Skills)
Add to every skill's SKILL.md:
## Output Verification
Before responding, verify your output includes:
- [ ] Required section 1
- [ ] Required section 2
- [ ] Required command/format
DO NOT respond until all items are verified.Cost: Zero (prompt only)
Catches: Most omissions
Layer 2: Output Templates (Structured Skills)
For skills with predictable structure, provide literal templates:
## Output Template
You MUST use this exact structure:
### Issue Analysis
| Issue | Title | Labels | Workflow |
|-------|-------|--------|----------|
<!-- FILL: one row per issue -->
### CLI Command
\`\`\`bash
sequant run <ISSUE_NUMBERS>
\`\`\`Cost: Low (prompt only)
Catches: Structural deviations
Layer 3: Post-Skill Hooks (CI/Automation)
Optional hooks that validate output:
# .claude/hooks/post-skill.sh
case "$SKILL_NAME" in
solve)
if ! echo "$OUTPUT" | grep -q "sequant run"; then
echo "⚠️ /solve output missing 'sequant run' command" >&2
fi
;;
spec)
if ! echo "$OUTPUT" | grep -q "Acceptance Criteria"; then
echo "⚠️ /spec output missing Acceptance Criteria" >&2
fi
;;
esacCost: Medium (infrastructure)
Catches: Critical omissions in automation
Layer 4: JSON Schema (Machine-Consumed Output)
For skills that output data consumed by other tools:
// src/lib/schemas/skill-outputs.ts
export const AssessOutputSchema = z.object({
issueNumber: z.number(),
status: z.enum(['ready', 'blocked', 'needs-info', 'in-progress']),
recommendation: z.enum(['spec', 'exec', 'qa', 'close']),
blockers: z.array(z.string()).optional(),
confidence: z.number().min(0).max(1),
});
export const ReflectOutputSchema = z.object({
workflowStats: z.object({
issuesCompleted: z.number(),
avgPhaseDuration: z.record(z.number()),
commonFailures: z.array(z.string()),
}),
recommendations: z.array(z.object({
area: z.string(),
suggestion: z.string(),
priority: z.enum(['high', 'medium', 'low']),
})),
});Cost: High (implementation + maintenance)
Catches: Invalid data for downstream tools
Skill Validation Matrix
| Skill | Checklist | Template | Hook | Schema |
|---|---|---|---|---|
| /solve | ✓ | ✓ | opt | - |
| /spec | ✓ | ✓ | ✓ | - |
| /exec | ✓ | - | - | - |
| /test | ✓ | ✓ | opt | - |
| /qa | ✓ | ✓ | ✓ | - |
| /loop | ✓ | - | - | - |
| /fullsolve | ✓ | - | opt | - |
| /assess | ✓ | - | ✓ | ✓ |
| /reflect | ✓ | - | opt | ✓ |
| /docs | ✓ | ✓ | opt | - |
Sequant Run Log Schema
sequant run should output structured logs for analysis:
Log File Format
// src/lib/schemas/run-log.ts
export const PhaseLogSchema = z.object({
phase: z.enum(['spec', 'exec', 'test', 'qa', 'loop', 'testgen']),
issueNumber: z.number(),
startTime: z.string().datetime(),
endTime: z.string().datetime(),
durationSeconds: z.number(),
status: z.enum(['success', 'failure', 'timeout', 'skipped']),
error: z.string().optional(),
iterations: z.number().optional(), // for loop phase
filesModified: z.array(z.string()).optional(),
testsRun: z.number().optional(),
testsPassed: z.number().optional(),
});
export const RunLogSchema = z.object({
version: z.literal(1),
runId: z.string().uuid(),
startTime: z.string().datetime(),
endTime: z.string().datetime(),
config: z.object({
phases: z.array(z.string()),
sequential: z.boolean(),
qualityLoop: z.boolean(),
maxIterations: z.number(),
}),
issues: z.array(z.object({
issueNumber: z.number(),
title: z.string(),
labels: z.array(z.string()),
status: z.enum(['success', 'failure', 'partial']),
phases: z.array(PhaseLogSchema),
totalDurationSeconds: z.number(),
})),
summary: z.object({
totalIssues: z.number(),
passed: z.number(),
failed: z.number(),
totalDurationSeconds: z.number(),
}),
});Log Output Location
# Default location
~/.sequant/logs/run-<timestamp>-<runId>.json
# Or project-local
.sequant/logs/run-<timestamp>-<runId>.jsonExample Log Output
{
"version": 1,
"runId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"startTime": "2025-01-08T10:30:00Z",
"endTime": "2025-01-08T10:45:32Z",
"config": {
"phases": ["spec", "exec", "qa"],
"sequential": false,
"qualityLoop": false,
"maxIterations": 3
},
"issues": [
{
"issueNumber": 12,
"title": "Clean up matcha maps remnants",
"labels": [],
"status": "success",
"phases": [
{
"phase": "spec",
"issueNumber": 12,
"startTime": "2025-01-08T10:30:00Z",
"endTime": "2025-01-08T10:32:15Z",
"durationSeconds": 135,
"status": "success"
},
{
"phase": "exec",
"issueNumber": 12,
"startTime": "2025-01-08T10:32:15Z",
"endTime": "2025-01-08T10:42:00Z",
"durationSeconds": 585,
"status": "success",
"filesModified": [
"src/lib/workflow/execute-issues.ts",
"templates/skills/exec/SKILL.md"
]
},
{
"phase": "qa",
"issueNumber": 12,
"startTime": "2025-01-08T10:42:00Z",
"endTime": "2025-01-08T10:45:32Z",
"durationSeconds": 212,
"status": "success"
}
],
"totalDurationSeconds": 932
}
],
"summary": {
"totalIssues": 1,
"passed": 1,
"failed": 0,
"totalDurationSeconds": 932
}
}Implementation Tasks
Phase 1: Checklist + Templates (Low Effort)
- Create standard checklist template for skills
- Add checklists to all existing skills
- Add output templates to structured skills (/solve, /spec, /qa)
- Document pattern in skill authoring guide
Phase 2: Post-Hooks (Medium Effort)
- Define hook interface for skill validation
- Implement post-skill hook runner
- Create validation hooks for critical skills
- Add hook configuration to
.claude/settings.json
Phase 3: Structured Logging (Medium Effort)
- Define Zod schemas for run logs
- Implement log writer in
sequant run - Add log location configuration
- Create
sequant logscommand to view/analyze logs
Phase 4: Schema Validation (Higher Effort)
- Define output schemas for /assess, /reflect
- Implement schema validation in skills or post-hooks
- Add
--jsonflag to applicable skills - Document schema usage for automation
Success Criteria
/solvealways includessequant runcommand/specalways includes Acceptance Criteria sectionsequant runproduces queryable JSON logs- Skill authors have clear reliability patterns to follow
- CI can validate skill outputs programmatically
Related
- Add quality loop and batch execution to sequant run CLI #21 - Add quality loop to sequant run CLI
- Clean up matcha maps remnants (Supabase, dead code) #12 - Clean up matcha maps remnants
Priority
Medium-High - Affects reliability of all skills and automation capabilities
Activity
feat(#22): Add skill output verification and structured logging
admarble commentedon Jan 8, 2026
/fullsolve Complete
Issue: #22
Status: READY_FOR_MERGE
Summary
Changes Made
Phase 1 - Skill Reliability:
Phase 2 - Structured Logging:
run-log-schema.ts)log-writer.ts)--log-jsonand--log-pathoptions forsequant runsequant logscommand for viewing/analyzing logsFiles Changed
PR: #23
Ready for human review and merge.
fix(#834): §7 gates must be reachable — lint /qa's own enforcement ch…