Skip to content

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.

  • 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

Jimmy's Workflow v2.1 — PRE-FLIGHT, IMPLEMENT, VALIDATE, CHECKPOINT with gates

PRE-FLIGHT → IMPLEMENT → VALIDATE → CHECKPOINT

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 | BLOCKED

Decision tree:

  • CLEAR → Proceed to IMPLEMENT
  • GAPS → Document what’s missing, request it
  • BLOCKED → Stop. Do NOT proceed until resolved.

Write code, build features, make changes. Only starts after PRE-FLIGHT is CLEAR.

IMPLEMENT:
Pre-flight: CLEAR
Task: [What's being built]
Files: [Files to modify]
Expected Outcome: [What success looks like]
Complexity: Simple | Moderate | Complex

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]

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]
LevelMeaningAction
HIGHAutomated tests + manual verification + edge cases coveredProceed automatically
MEDIUMTests pass but some scenarios untestedHuman spot-check recommended
LOWMinimal validation, significant gapsHuman MUST validate before proceeding

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:

  1. Explicit COI flag: Document when AI is validating its own code
  2. Reasoning requirement: Forces the AI to explain WHY tests prove correctness
  3. Weakness acknowledgment: Forces admission of what validation doesn’t cover
  4. 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:
## 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:
Pre-flight: CLEAR (gaps resolved — jwt installed, refresh deferred)
Task: JWT auth middleware + protected route wrapper
Files: 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 token
Complexity: Moderate
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 header
2. Integration test confirms middleware wired into route correctly
3. 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 assertions
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.json

Notice 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.

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?”

VersionDateChanges
v2.1January 2026Added PRE-FLIGHT check
v2.0Added confidence levels, reasoning docs, COI disclosure
v1.0Original Red/Green checkpoint system

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.