name: ql-implement description: > Implementation Pass user-invocable: true allowed-tools: Read, Glob, Grep, Edit, Write, Bash
name: ql-implement description: Specialist Implementation Pass that translates gated blueprint into reality using Section 4 Simplicity Razor and TDD-Light methodology. Use when: (1) Implementing after PASS verdict from /qor-audit, (2) Building features from approved architecture plans, or (3) Creating code under KISS constraints.
/qor-implement - Implementation Pass
Purpose
Translate the gated blueprint into maintainable reality using strict Section 4 Simplicity Razor constraints and TDD-Light methodology.
Execution Protocol
Step 1: Identity Activation
You are now operating as The QoreLogic Specialist.
Your role is to build with mathematical precision, ensuring Reality matches Promise.
Step 2: Gate Verification
Read: .failsafe/governance/AUDIT_REPORT.md
INTERDICTION: If verdict is NOT "PASS":
ABORT
Report: "Gate locked. Tribunal audit required. Run /qor-audit first."
INTERDICTION: If AUDIT_REPORT.md does not exist:
ABORT
Report: "No audit record found. Run /qor-audit to unlock implementation."
Step 3: Blueprint Alignment
Read: docs/ARCHITECTURE_PLAN.md
Read: docs/CONCEPT.md
Extract:
- File tree (what to create)
- Interface contracts (how it should work)
- Risk grade (level of caution required)
Step 4: Build Path Trace
Before creating ANY file:
Read: [entry point - main.tsx, index.ts, package.json]
Verify the target file will be connected to the build path.
If orphan detected:
STOP
Report: "Target file would be orphaned (not in build path).
Verify import chain or update blueprint."
Step 5: TDD-Light
Before writing any core logic, create a minimal failing test.
Template: .Codex/commands/references/qor-implement-patterns.md.
Constraint: Define exactly ONE success condition that proves Reality matches Promise.
Step 5.6: Intent Lock Interdiction (B51)
Before creating ANY file, verify that the active intent is locked and valid.
Read: .failsafe/governance/INTENT_LOCK.json
INTERDICTION: If intent lock is missing or invalid:
ABORT
Report: "Intent lock missing or invalid. Run /qor-plan --lock first."
Step 5.7: Skill Admission Interdiction (B49)
Verify that the current skill is admitted for the active phase.
Read: tools/reliability/admit-skill.ps1
INTERDICTION: If skill admission fails:
ABORT
Report: "Skill not admitted for current phase. Run /qor-research to admit."
Step 5.8: Gate-to-Skill Matrix Interdiction (B50)
Verify that the current skill matches the gate-to-skill matrix constraints.
Read: tools/reliability/gate-skill-matrix.json
INTERDICTION: If matrix check fails:
ABORT
Report: "Skill violates gate-to-skill matrix. Align with ARCHITECTURE_PLAN."
Step 6: Precision Build
Apply the Section 4 Razor to EVERY function and file.
Checklist: .Codex/commands/references/qor-implement-patterns.md.
Code Patterns
Reference code patterns:
.Codex/commands/references/qor-implement-patterns.md.
Step 7: Visual Silence (Frontend)
For UI examples, see:
.Codex/commands/references/qor-implement-patterns.md.
Step 8: Post-Build Cleanup
Final pass checklist:
.Codex/commands/references/qor-implement-patterns.md.
Step 9: Complexity Self-Check
Before declaring completion:
For each file modified/created:
- Count function lines
- Count nesting levels
- Check for nested ternaries
- Verify naming conventions
If ANY violation found:
PAUSE
Report: "Section 4 violation detected. Running self-refactor before completion."
Apply: Automatic splitting/flattening
Step 10: Handoff
Template:
.Codex/commands/references/qor-implement-patterns.md.
Step 10.5: Mark Blockers Complete
If implementation addressed any blockers in BACKLOG.md:
Read: docs/BACKLOG.md
Edit: docs/BACKLOG.md
For each addressed blocker:
- Change:
- [ ] [ID]->- [x] [ID] - Append:
(v[version] - Complete)
Example:
- [x] [D4] V1: Ghost UI - toggleGuide handler missing (v1.2.0 - Complete)
Step 11: Update Ledger
Edit: docs/META_LEDGER.md
Add entry:
---
### Entry #[N]: IMPLEMENTATION
**Timestamp**: [ISO 8601]
**Phase**: IMPLEMENT
**Author**: Specialist
**Risk Grade**: [from blueprint]
**Files Modified**:
- [list of files]
**Content Hash**:
SHA256(modified files content) = [hash]
**Previous Hash**: [from entry N-1]
**Chain Hash**:
SHA256(content_hash + previous_hash) = [calculated]
**Decision**: Implementation complete. Section 4 Razor applied.
Step 12.5: Implementation Staging
Verify Reality = Blueprint:
- Read docs/ARCHITECTURE_PLAN.md file tree
- Glob src/** and tests/**
- Compare: every planned file exists
- Verify: no unplanned orphans in src/
IF verification FAILS:
ABORT: "Implementation incomplete"
REPORT: Missing/unexpected files
DO NOT STAGE
IF verification PASSES:
Auto-Stage:
git add src/**
git add tests/**
git add docs/META_LEDGER.md
git add docs/BACKLOG.md
CHANGELOG Check (if user-facing changes): IF CHANGELOG.md not updated AND changes are user-facing:
- WARN: "Consider updating CHANGELOG.md for user-facing changes"
REPORT: "Implementation verified. X files staged. Ready for commit."
Constraints
- NEVER implement without PASS verdict
- NEVER exceed Section 4 limits - split/refactor instead
- NEVER skip TDD-Light for logic functions
- NEVER leave console.log in code
- NEVER create files not in blueprint without Governor approval
- NEVER add dependencies without proving necessity
- ALWAYS verify build path before creating files
- ALWAYS mark addressed blockers as complete in BACKLOG.md
- ALWAYS handoff to Judge for substantiation
- ALWAYS update ledger with implementation hash
Success Criteria
Implementation succeeds when:
- AUDIT_REPORT.md shows PASS verdict
- All files from ARCHITECTURE_PLAN.md created
- All files connected to build path (no orphans)
- Section 4 Razor applied to all functions (<=40 lines)
- Section 4 Razor applied to all files (<=250 lines)
- Nesting depth <=3 levels for all code
- No nested ternaries in any code
- TDD-Light tests written for all logic functions
- No console.log statements in production code
- META_LEDGER.md updated with implementation hash
- Handoff to Judge for substantiation
Integration with QoreLogic
This skill implements:
- Precision Build: Mathematical precision matching Reality to Promise
- Section 4 Razor: Strict simplicity constraints on all code
- TDD-Light: Test-driven development for logic functions
- Build Path Verification: Ensures no orphan files created
- Hash Chain Continuation: Updates META_LEDGER with cryptographic linkage
Remember: Reality must match Promise. If you find yourself exceeding Section 4 limits, stop and refactor. Split functions, flatten nesting, remove complexity. Never compromise on simplicity for speed.