/SKILL.md
Orchestrates the RLM repo workflow end-to-end with phase gates, locked artifacts, addenda, traceability, and automatic bootstrap/upsert of AGENTS/PLANS scaffolding. Trigger phrases: "Implement requirement <run-id>", "Run RLM Phase <N>", "resume requirement", "lock Phase <N>", "verify locks".
npx skillsauth add doubleuuser/rlm-workflow rlm-workflowInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Implement repository work using the canonical RLM process in .agent/PLANS.md, with invocation conventions from .codex/AGENTS.md. Treat repository artifacts as the source of truth and keep prompts as path-based commands.
Implement requirement '2026-02-24-add-oauth'Run RLM Phase 2 for .codex/rlm/2026-02-24-add-oauth/Resume requirement '2026-02-24-add-oauth' after manual QAVerify locks for .codex/rlm/2026-02-24-add-oauth/Lock Phase 3 for run '2026-02-24-add-oauth'Before doing anything else, ensure the repo scaffolding exists and is up to date:
.codex/AGENTS.md contains the RLM Workflow block (managed upsert block).agent/PLANS.md contains the canonical workflow block from references/plans-canonical.md (managed upsert block).codex/rlm/ existsscripts/install-rlm-workflow.ps1 or scripts/install-rlm-workflow.py) existIf any are missing/outdated, run:
# Windows PowerShell:
powershell -ExecutionPolicy Bypass -File ./scripts/install-rlm-workflow.ps1 -RepoRoot .
# PowerShell 7+ (pwsh):
pwsh -NoProfile -File ./scripts/install-rlm-workflow.ps1 -RepoRoot .
# Python (Windows/macOS/Linux):
python ./scripts/install-rlm-workflow.py --repo-root .
# or:
python3 ./scripts/install-rlm-workflow.py --repo-root .
# Bash wrapper (macOS/Linux):
bash ./scripts/install-rlm-workflow.sh --repo-root .
If script execution isn't possible, perform an equivalent manual bootstrap:
references/plans-canonical.md into .agent/PLANS.md using managed markers.codex/AGENTS.md using managed markersThen continue with the workflow phases.
.codex/AGENTS.md intro sections for local invocation conventions..agent/PLANS.md for canonical phase rules and requirements.Implement requirement '<run-id>'Run RLM Phase 2 for .codex/rlm/<run-id>/Create .codex/rlm/<run-id>/02-to-be-plan.md with Coverage and Approval gatesUpdate tests and lock Phase 4 artifact for this runImplement requirement '<run-id>', resolve run folder and execute phases sequentially.Run RLM Phase N, execute only that phase and write only that phase outputs, but only when all required earlier phases are lock-valid..codex/rlm/<run-id>/.00-requirements.md is missing, stop and ask for it. Do not invent requirements.00-requirements.md exists (user-created starting point). Stop if missing.DRAFT or with failing gates, resume that phase.00-requirements.md as the starting input for the run (it must already exist)..worktrees/<run-id> or configured location.00-worktree.md before proceeding.skills/rlm-worktree/SKILL.md01.5-root-cause.md before Phase 2.skills/rlm-debugging/SKILL.md).05-manual-qa.md with scenarios in DRAFT.N, validate the lock chain for all prior phases (0..N-1) using .agent/PLANS.md.LOCKED, include LockedAt and LockHash, and end with Coverage: PASS and Approval: PASS.LockHash matches SHA-256 of normalized artifact content (LF newlines; LockHash: line removed). Use scripts/verify-locks.py (cross-platform) or scripts/verify-locks.ps1 (PowerShell) for automated validation.05-manual-qa.md is lock-valid.The Iron Law: NEVER WORK ON MAIN/MASTER BRANCH WITHOUT EXPLICIT CONSENT.
When invoked from main/master branch:
If user insists on main branch work:
# Create feature branch worktree
git worktree add .worktrees/<run-id> -b rlm/<run-id>
cd .worktrees/<run-id>
All subsequent phases execute in worktree context.
The Iron Law: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
RED Phase:
GREEN Phase:
REFACTOR Phase:
Every Phase 3 artifact must include:
## TDD Compliance Log
### R1: [description]
**Test:** `path/to/test.ts` - "[name]"
**RED:** [timestamp] - Failed as expected: [output]
**GREEN:** [timestamp] - Minimal implementation: [description]
**REFACTOR:** [timestamp] - Cleanups: [description]
Reference: skills/rlm-tdd/SKILL.md
The Iron Law: NO LOCKING OR PHASE ADVANCEMENT WITH UNCHECKED TODOS.
Every phase artifact MUST include a ## TODO section with:
## TODO
- [ ] Task 1: [description]
- [ ] Task 2: [description]
- [ ] Sub-task 2a: [description]
- [ ] Sub-task 2b: [description]
- [ ] Task 3: [description]
Do NOT lock a phase or proceed to next phase until:
Exception: None. Complete all todos before locking. </HG>
Phase 0 Worktree:
Phase 0 Requirements:
Phase 1 AS-IS:
Phase 1.5 (if used):
Phase 2:
Phase 3:
Phase 3.5 (if used):
Phase 4:
Phase 5:
Before setting Status: LOCKED:
[ ] unchecked boxes[x] checked| Anti-Pattern | Correct Approach | |--------------|------------------| | "Will complete later" | Complete now or create addendum | | Partial checkoff | Check only when fully complete | | Vague items like "Do work" | Specific: "Implement auth handler" | | No TODO section | Required in every phase artifact |
DRAFT at the same time.DRAFT, treat only the earliest DRAFT phase as active; later DRAFT artifacts are invalid parallel prework and must not be continued until the active phase is lock-valid.DRAFT artifacts only when those phases become active..codex/rlm/<run-id>/00-worktree.md (REQUIRED - Phase 0 worktree setup)00-requirements.md01-as-is.md01.5-root-cause.md (optional, for debug mode)02-to-be-plan.md03-implementation-summary.md04-test-summary.md05-manual-qa.mdaddenda/evidence/ (screenshots/logs/perf/traces; referenced from Phase 4/5).codex/DECISIONS.md.codex/STATE.md.worktrees/<run-id>/ (default, project-local, hidden)~/.config/rlm-workflow/worktrees/<project>/<run-id>/ (global)skills/rlm-worktree/SKILL.md - Phase 0 worktree isolationskills/rlm-tdd/SKILL.md - TDD discipline for Phase 3skills/rlm-debugging/SKILL.md - Systematic debugging for Phase 1.5scripts/install-rlm-workflow.py - Cross-platform bootstrap/updatescripts/rlm-init.py - Initialize a new run folder + templates (cross-platform)scripts/rlm-init.ps1 - Initialize a new run folder + templates (PowerShell equivalent)scripts/rlm-status.py - Run status + lock chain summary (cross-platform)scripts/rlm-status.ps1 - Run status + lock chain summary (PowerShell equivalent)scripts/lint-rlm-run.py - Artifact structure + TODO discipline linter (cross-platform)scripts/lint-rlm-run.ps1 - Artifact structure + TODO discipline linter (PowerShell equivalent)scripts/verify-locks.py - Automated lock hash verification (cross-platform)scripts/verify-locks.ps1 - Automated lock hash verification (PowerShell equivalent).agent/PLANS.md.Run, Phase, Status, Inputs, Outputs, Scope noteTraceability section mapping each R# to where it is addressed and evidenced.Coverage Gate and Approval Gate, each concluding with explicit PASS or FAIL.Status: DRAFT until both gates pass.Status: LOCKEDLockedAt (ISO8601)LockHash (SHA-256 of normalized artifact content; see /.agent/PLANS.md / references/plans-canonical.md)Use references/artifact-template.md for exact header and gate scaffolding.
Always enforce these sections from .agent/PLANS.md when applicable:
Large requirements: Implementation sub-phases (required when scope is large or risky)Playwright tagging for RLM runs and implementation sub-phases (required)Testing discipline (TDD + Playwright) sections for Phase 2, 4, and 5RLM TDD Discipline (Phase 3) - RED-GREEN-REFACTOR cycle, The Iron LawRLM Systematic Debugging (Phase 1.5) - When and how to use debug modeRLM single-command orchestration ("Implement requirement '<run-id>'")Run folder resolutionPhase auto-resume and phase selectionPhase transition hard-stop lock chain (required)Strict sequential phase execution (no parallel phase work)Manual QA stop (the only intentional pause)Locking rules for single-command execution<base>.addendum-01.md<current>.upstream-gap.<prior>.addendum-01.mdPhase 0 (00-worktree.md) - Isolation REQUIRED
.worktrees/<run-id>/ (or configured location).skills/rlm-worktree/SKILL.mdPhase 0 Requirements (00-requirements.md)
R1..Rn and OOS1..OOSn.R#.Phase 1 AS-IS (01-as-is.md)
Phase 1.5 (01.5-root-cause.md) - Debug Mode (optional)
skills/rlm-debugging/SKILL.mdPhase 2 (02-to-be-plan.md)
SP1, SP2, ...) when scope/risk is large.Phase 3 (03-implementation-summary.md) - TDD Discipline + Parallelization
skills/rlm-tdd/SKILL.md for TDD, skills/rlm-subagent/SKILL.md for parallelizationPhase 3.5 (03.5-code-review.md) - Code Review (optional)
code-reviewer subagentskills/rlm-subagent/SKILL.mdPhase 4 (04-test-summary.md) - Parallel Testing
03-implementation-summary.md against 00-requirements.md and 02-to-be-plan.md; document mismatches, addenda, or confirmations.Phase 5 (05-manual-qa.md)
Phase 6 and 7
.codex/DECISIONS.md, then .codex/STATE.md.When a requirement involves multiple concerns, use this priority order to determine which skills/phases to apply first:
Debugging (bug fixes) -> Run Phase 1.5 Root Cause Analysis first
skills/rlm-debugging/SKILL.mdDesign/Analysis (new features or changes) -> Run full Phase 1 AS-IS Analysis
Implementation -> Proceed to Phase 2+ after analysis complete
Testing -> Use TDD discipline in Phase 3
skills/rlm-tdd/SKILL.mdReview -> Code review between implementation and final validation
Requirement received
|
v
Is it a bug fix? --YES--> Phase 1.5 (Root Cause Analysis)
| |
NO v
| Phase 2 (incorporate findings)
v v
Phase 1 (AS-IS) -------> Phase 3 (TDD implementation)
| |
v v
Phase 2 (TO-BE) -------> Phase 4 (validation)
| |
v v
Phase 3 (TDD) ---------> Phase 5 (Manual QA)
|
v
Phase 6/7 (global updates)
| Requirement | Priority Applied | Execution Order | Execution Mode | |-------------|------------------|-----------------|----------------| | "Fix login crash" | Debugging first | Phase 0 -> 1 -> 1.5 -> 2 -> 3 -> 4 -> 5... | Sequential or Parallel | | "Add dark mode" | Design first | Phase 0 -> 1 -> 2 -> 3 -> 4 -> 5... | Sequential (single SP) | | "Crash on empty input" | Debugging first | Phase 0 -> 1 -> 1.5 -> 2 -> 3 -> 4... | Sequential or Parallel | | "Implement OAuth" | Design + Review | Phase 0 -> 1 -> 2 -> 3 -> 3.5 -> 4 -> 5... | Parallel (multiple SPs) | | "Multi-domain refactor" | Design + Parallel | Phase 0 -> 1 -> 2 -> 3 -> 3.5 -> 4 -> 5... | Parallel (subagents) |
Execution Mode Legend:
Hard gates are non-negotiable checkpoints that MUST be satisfied before proceeding.
<HG> ### Phase 0 -> 1/2 Hard GateDo NOT proceed to Phase 1 or 2 until:
Exception: None. Phase 0 is REQUIRED for all runs. </HG>
<HG> ### Phase 1 -> 2 Hard GateDo NOT create 02-to-be-plan.md until 01-as-is.md is LOCKED with:
Exception: If Phase 1.5 exists, it must ALSO be locked before Phase 2. </HG>
<HG> ### Phase 1.5 -> 2 Hard Gate (Debug Mode)Do NOT create TO-BE plan until root cause analysis is complete:
Exception: None. Debug mode requires completion before planning. </HG>
<HG> ### Phase 3 TDD Hard GateDo NOT write implementation code until:
Exception: None. The Iron Law has no exceptions. </HG>
<HG> ### Phase 4 -> 5 Hard GateDo NOT proceed to Manual QA until:
00-requirements.md and 02-to-be-plan.md)Do NOT update DECISIONS.md or STATE.md until:
Exception: None. Global updates require QA completion. </HG>
<HG> ### Lock Chain Hard Gate (Applies to ALL transitions)Do NOT start Phase N unless ALL prior phases (0 through N-1) are lock-valid:
Exception: None. The lock chain is absolute. </HG>
RLM supports two execution modes for Phase 3 (Implementation) and Phase 4 (Testing):
Requirements:
Benefits:
Process:
Documentation: Mode and subagent usage recorded in Phase 3 artifact
Trigger:
Characteristics:
Fallback trigger flow:
**Subagent Check:** NOT AVAILABLE
**Reason:** [Tool not found / Platform limitation / User request]
**Action:** Using SEQUENTIAL fallback mode
Automatic detection at start of Phase 3:
Platform-specific detection:
Task toolskill tool capabilitiesUser can explicitly request mode:
"Implement requirement 'X' using parallel subagents"
-> Attempt parallel, fallback if unavailable
"Implement requirement 'X' with sequential execution"
-> Force sequential even if subagents available
| Aspect | Parallel Mode | Sequential Mode | |--------|---------------|-----------------| | Execution | Concurrent subagents | Sequential in main agent | | Speed | 3-5x faster | Linear | | Review | Independent subagent reviewers | Self-review | | Context | Fresh per sub-phase | Accumulates | | Rigor | Two-stage external review | Extended self-review | | Fallback | Automatic if unavailable | Default mode |
Parallel Mode Quality:
Sequential Mode Quality:
Both modes enforce:
Pause only during Phase 5 for explicit user validation/sign-off. Do not pause for approval in other phases when gates can be evaluated mechanically.
testing
Use when starting any RLM requirement to set up an isolated git worktree. REQUIRED before Phase 1 - creates isolated workspace, verifies clean test baseline, and prevents main branch pollution. Trigger phrases: "create worktree", "worktree isolation", "set up worktree", "do not work on main".
development
Use when implementing any code in RLM Phase 3. Enforces strict RED-GREEN-REFACTOR discipline with The Iron Law - no production code without a failing test first. Trigger phrases: "implement this", "add feature", "fix bug", "write a failing test", "TDD".
development
Master skill for parallel subagent-driven execution with automatic fallback to single-agent sequential mode. Use when implementing plans with multiple independent sub-phases (SP1, SP2...) to dispatch parallel subagents, or when requiring code review between implementation and testing. Trigger phrases: "parallelize", "dispatch subagent", "split into sub-phases", "code review subagent", "parallel testing".
development
Use when RLM requirement involves debugging a bug, test failure, or unexpected behavior. Insert Phase 1.5 between Phase 1 and Phase 2 to perform systematic root cause analysis before attempting any fixes. Trigger phrases: "debug", "investigate", "failing tests", "crash", "root cause".