Slash Command125 repo starsupdated 1mo ago
claudikins-kernel:verify
Post-execution verification gate. Tests, lint, type-check, then see it working.
Install in Claude Code
Copymkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/elb-pr/claudikins-kernel/HEAD/commands/verify.md -o ~/.claude/commands/claudikins-kernel-verify.mdThen start a new Claude Code session; the slash command loads automatically.
Definition
verify.md
# claudikins-kernel:verify Command
You are orchestrating a verification workflow that ensures code actually works before shipping.
## Flags
| Flag | Effect |
| ----------------- | ------------------------------------------ |
| `--branch NAME` | Verify specific branch (default: current) |
| `--scope SCOPE` | test\|lint\|types\|all (default: all) |
| `--skip-simplify` | Skip cynic polish pass |
| `--fix-lint` | Auto-apply lint fixes |
| `--fast-mode` | 60-second iteration cycles |
| `--session-id ID` | Resume previous session by ID |
| `--timing` | Show phase durations for velocity tracking |
| `--list-sessions` | Show available sessions for resume |
| `--resume` | Resume from last checkpoint |
| `--status` | Show current verification status |
## Merge Strategy
JQ merge - verification outputs are combined with `jq -s 'add'`.
## Philosophy
> "Evidence before assertions. Always." - Verification philosophy
- Verification is the gate between claudikins-kernel:execute and claudikins-kernel:ship
- Claude MUST see its code working (not just tests passing)
- Human checkpoint with comprehensive report
- Exit code 2 blocks claudikins-kernel:ship until verification passes
- All Opus models for agents (no compromises on judgement)
## State Management
State file: `.claude/verify-state.json`
```json
{
"session_id": "verify-YYYY-MM-DD-HHMM",
"execute_session_id": "exec-YYYY-MM-DD-HHMM",
"branch": "execute/task-1-feature",
"started_at": "ISO timestamp",
"status": "initialising|verifying|completed|failed",
"phases": {
"test_suite": { "status": "pending|PASS|FAIL" },
"lint": { "status": "pending|PASS|FAIL" },
"type_check": { "status": "pending|PASS|FAIL" },
"output_verification": { "status": "pending|PASS|FAIL" },
"code_simplification": { "status": "pending|PASS|FAIL|skipped" }
},
"all_checks_passed": false,
"human_checkpoint": {
"prompted_at": null,
"decision": null,
"caveats": []
},
"unlock_ship": false
}
```
## Phase 0: Initialisation
### Flag Handling
Check for flags first:
```
--status → Display current verification status, exit
--resume → Load checkpoint, resume from saved state
--list-sessions → Show available sessions, exit
```
### Prerequisite Check (via verify-init.sh hook)
The SessionStart hook validates:
1. execute-state.json exists (C-14 cross-command gate)
2. Execute status is "completed"
3. Creates initial verify-state.json
4. Links to execute session for traceability
**On validation failure:**
```
ERROR: claudikins-kernel:execute has not been run
You must run claudikins-kernel:execute before claudikins-kernel:verify.
The verification command requires completed execution state.
Run: claudikins-kernel:execute [plan-file]
```
### Project Type Detection
Detect project type automatically:
```
if package.json exists:
PROJECT_TYPE = "node"
TEST_CMD = "npm test"
LINT_CMD = "npm run lint"
TYPE_CMD = "npm run typecheck" (if typescript)
elif pyproject.toml or setup.py:
PROJECT_TYPE = "python"
TEST_CMD = "pytest"
LINT_CMD = "ruff check ."
TYPE_CMD = "mypy ."
elif Cargo.toml:
PROJECT_TYPE = "rust"
TEST_CMD = "cargo test"
LINT_CMD = "cargo clippy"
TYPE_CMD = "cargo check"
elif go.mod:
PROJECT_TYPE = "go"
TEST_CMD = "go test ./..."
LINT_CMD = "golangci-lint run"
TYPE_CMD = "go build ./..."
else:
PROJECT_TYPE = "unknown"
Ask user for commands
```
## Phase 1: Automated Quality Checks
Run in sequence. STOP on any failure.
### Stage 1: Test Suite
```bash
# Run tests with timeout
timeout 300 ${TEST_CMD}
```
**On failure:**
```
Tests failed.
[Show test output]
[Fix tests] [Re-run (flaky?)] [Skip tests] [Abort]
```
**Flaky test detection (C-12):**
If tests fail, offer re-run:
```
Test failure detected. Could be flaky.
[Re-run tests] [Accept failure] [Abort]
```
If re-run passes:
```
Tests passed on retry. Likely flaky.
[Accept with flakiness caveat] [Fix tests] [Abort]
```
### Stage 2: Linting
```bash
${LINT_CMD}
```
**On failure with --fix-lint:**
```
Lint issues found. Auto-fix available.
[Apply fixes] [Show issues] [Skip lint] [Abort]
```
**After auto-fix, re-run lint to confirm:**
```bash
${LINT_CMD}
```
If still failing after fix:
```
Auto-fix did not resolve all issues.
Remaining issues:
[Show remaining issues]
[Fix manually] [Skip lint] [Abort]
```
### Stage 3: Type Check
```bash
${TYPE_CMD}
```
**On failure:**
```
Type errors found.
[Show errors]
[Fix errors] [Skip type check] [Abort]
```
### Phase 1 Checkpoint
```
Automated checks complete.
Tests: ${TEST_STATUS}
Lint: ${LINT_STATUS}
Types: ${TYPE_STATUS}
[Continue to Output Verification] [Re-run checks] [Abort]
```
## Phase 2: Output Verification (catastrophiser)
> "Give Claude a tool to see the output of the code." - Boris
This is the feedback loop that makes Claude's code actually work.
### Spawn catastrophiser
```typescript
Task(catastrophiser, {
prompt: `
Verify the implementation WORKS by SEEING its output.
Project type: ${PROJECT_TYPE}
Branch: ${BRANCH}
Use the appropriate verification method:
- Web: Start server, screenshot key pages
- API: Curl endpoints, verify responses
- CLI: Run commands, check output
- Library: Run examples, verify results
Capture evidence. Report any issues clearly.
Output JSON with status and evidence.
`,
context: "fork",
model: "opus",
});
```
### Verification Method Fallback (A-3)
```
1. Try primary method (screenshot/curl/run)
└─ If fails → Try secondary method
2. Try tests-only verification
└─ If fails → Try CLI verification
3. Try code review only
└─ If fails → Report inability to verify
```
### Phase 2 Checkpoint
```
Output verification complete.
Agent: catastrophiser
Status: ${VERIFICATION_STATUS}
Evidence: