Jimmy's Workflow v2.1
Jimmy’s Workflow is a validation-gate system that prevents AI hallucination and ensures robust implementation through mandatory checkpoints. Version 2.1 adds a PRE-FLIGHT check that prevents starting implementation without sufficient context.
The problem it solves
Section titled “The problem it solves”- AI says “done” but it’s not actually done
- Tests pass but the implementation is wrong
- AI writes tests that validate its own assumptions (circular validation)
- AI starts implementing before realising it’s missing dependencies
The four phases
Section titled “The four phases”PRE-FLIGHT → IMPLEMENT → VALIDATE → CHECKPOINTPRE-FLIGHT (v2.1 addition)
Section titled “PRE-FLIGHT (v2.1 addition)”Verify sufficient context exists before any code is written.
PRE-FLIGHT:
## Context Inventory
### Requirements Clarity- [ ] Is the task clearly defined?- [ ] Are success criteria explicit and measurable?- [ ] Are edge cases identified?
### Files Needed| File | Status | Notes ||------|--------|-------|| file1.ts | Have | In context || file2.ts | Need | Must request |
### Dependencies- [ ] Are all imported modules available?- [ ] Are external APIs documented?- [ ] Are environment variables defined?
## Pre-flight Decision**Status**: CLEAR | GAPS | BLOCKEDDecision tree:
- CLEAR → Proceed to IMPLEMENT
- GAPS → Document what’s missing, request it
- BLOCKED → Stop. Do NOT proceed until resolved.
IMPLEMENT
Section titled “IMPLEMENT”Write code, build features, make changes. Only starts after PRE-FLIGHT is CLEAR.
IMPLEMENT:
Pre-flight: CLEARTask: [What's being built]Files: [Files to modify]Expected Outcome: [What success looks like]Complexity: Simple | Moderate | ComplexVALIDATE
Section titled “VALIDATE”Prove the implementation works with documented reasoning. This is where Jimmy’s Workflow differs from “just run the tests” — it requires you to document WHY the validation proves correctness.
VALIDATE:
## Automated Checks| Check | Command | Result | Proves ||-------|---------|--------|--------|| Tests | npm test | 24/24 pass | Unit logic correct || Build | npm run build | Exit 0 | No compile errors |
## Validation Reasoning**Confidence**: HIGH | MEDIUM | LOW
**Why this proves correctness**:1. [Connects test to requirement]2. [Explains coverage]
**Weaknesses acknowledged**:- This does NOT verify: [Gap]- Assumption: [What we're assuming]CHECKPOINT
Section titled “CHECKPOINT”Mark the task complete with confidence level and validity conditions.
CHECKPOINT:
## Summary- Task: [What was done]- Confidence: HIGH- All tests passing: Yes- Validity conditions: [When this checkpoint becomes stale]
## Rollback- Undo: git revert [hash]- Files changed: [list]Confidence levels
Section titled “Confidence levels”| Level | Meaning | Action |
|---|---|---|
| HIGH | Automated tests + manual verification + edge cases covered | Proceed automatically |
| MEDIUM | Tests pass but some scenarios untested | Human spot-check recommended |
| LOW | Minimal validation, significant gaps | Human MUST validate before proceeding |
Conflict of interest disclosure
Section titled “Conflict of interest disclosure”When AI validates AI-generated code, there’s a built-in conflict of interest. The same system that wrote the code is judging whether it works. Jimmy’s Workflow addresses this through:
- Explicit COI flag: Document when AI is validating its own code
- Reasoning requirement: Forces the AI to explain WHY tests prove correctness
- Weakness acknowledgment: Forces admission of what validation doesn’t cover
- Defense in depth: When confidence is less than HIGH, layer multiple validation approaches
Worked example: “Add JWT auth to an Express API”
Section titled “Worked example: “Add JWT auth to an Express API””Here’s what a complete cycle looks like on a real task, filled in — not the blank template, but the texture of how it actually reads.
PRE-FLIGHT
Section titled “PRE-FLIGHT”PRE-FLIGHT:
## Context Inventory
### Requirements Clarity- [x] Is the task clearly defined? → Add JWT auth middleware to Express API- [x] Are success criteria explicit? → Protected routes return 401 without token, 200 with valid token- [x] Are edge cases identified? → Expired tokens, malformed tokens, missing header
### Files Needed| File | Status | Notes ||------|--------|-------|| src/server.ts | Have | Main Express app || src/routes/api.ts | Have | Routes to protect || src/middleware/ | Have | Directory exists, empty || .env | Have | Need to add JWT_SECRET |
### Dependencies- [x] jsonwebtoken package → Not installed, need to add- [x] Express types available → Yes, @types/express in devDeps- [ ] Token refresh endpoint spec → Not defined yet
## Pre-flight Decision**Status**: GAPS — Missing token refresh spec and jsonwebtoken package**Action**: Install jsonwebtoken, proceed with basic auth (refresh is separate task)IMPLEMENT
Section titled “IMPLEMENT”IMPLEMENT:
Pre-flight: CLEAR (gaps resolved — jwt installed, refresh deferred)Task: JWT auth middleware + protected route wrapperFiles: src/middleware/auth.ts (new), src/routes/api.ts (modify), .env (add JWT_SECRET)Expected Outcome: GET /api/protected returns 401 without token, 200 with valid tokenComplexity: ModerateVALIDATE
Section titled “VALIDATE”VALIDATE:
## Automated Checks| Check | Command | Result | Proves ||-------|---------|--------|--------|| Unit tests | npm test -- auth | 6/6 pass | Token verification logic correct || Integration | npm test -- routes | 4/4 pass | Middleware blocks/allows correctly || Build | npm run build | Exit 0 | Types are correct || Lint | npm run lint | 0 warnings | Code style clean |
## Validation Reasoning**Confidence**: HIGH
**Why this proves correctness**:1. Unit tests cover valid token, expired token, malformed token, and missing header2. Integration test confirms middleware wired into route correctly3. Tested with both HS256 algorithm and invalid algorithm to catch signing issues
**Weaknesses acknowledged**:- This does NOT verify: Token refresh flow (deferred, separate task)- This does NOT verify: Performance under load (no load test)- Assumption: JWT_SECRET is set in production environment- COI flag: AI wrote both the code and the tests — recommend human review of test assertionsCHECKPOINT
Section titled “CHECKPOINT”CHECKPOINT:
## Summary- Task: JWT auth middleware for Express API- Confidence: HIGH- All tests passing: Yes (10/10)- Files changed: 3 new, 1 modified- Validity conditions: Stale if auth requirements change or token refresh is added
## Rollback- Undo: git revert abc1234- Files changed: src/middleware/auth.ts, src/routes/api.ts, .env, package.jsonNotice the COI flag in VALIDATE — the AI called out that it wrote both the code and the tests. That’s principle in action, not just template.
How to invoke
Section titled “How to invoke”Tell your AI assistant:
“Let’s use Jimmy’s Workflow to execute this plan”
The AI will then follow the four-phase cycle. You can also invoke individual phases:
“Run PRE-FLIGHT for this task” “What’s your confidence level on this validation?”
Version history
Section titled “Version history”| Version | Date | Changes |
|---|---|---|
| v2.1 | January 2026 | Added PRE-FLIGHT check |
| v2.0 | — | Added confidence levels, reasoning docs, COI disclosure |
| v1.0 | — | Original Red/Green checkpoint system |
Full reference
Section titled “Full reference”The complete Jimmy’s Workflow document (870+ lines with examples, decision trees, and templates) is included in the repo at JIMMYS-WORKFLOW.md. Copy it to your project root and reference it from AGENTS.md.