code-mode

Enforces a five-gate code-lifecycle discipline with on-disk gate state and session habit scoring.

3|Updated Oct 28, 2020
One-click install
npx skills add https://github.com/k0d3x8its/dotfiles --skill code-mode-k0d3x8its
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-mode
Source: https://github.com/k0d3x8its/dotfiles/tree/main/claude/.claude/skills/code-mode
Command: npx skills add https://github.com/k0d3x8its/dotfiles --skill code-mode-k0d3x8its

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Long coding sessions lose discipline: edits happen without reading files, tests run after implementation instead of before, and verification stops at "it ran". This Skill keeps a structured five-gate workflow (spec, evidence, adversarial review, layered verification, diff-shaped report) anchored in on-disk state so the process survives long contexts. ## Core Features & Use Cases - Five-gate task loop: Routes feature work to test-driven development, bugs to diagnosis, refactors to behavior-preserving fixes, and security changes to threat modeling, with gate state persisted in .work/GATES.md. - Red-green inner loop: Enforces fresh reads before every edit, failing tests before implementation, and full-suite runs after changes. - Habit scorecard: The code-score.py script measures real session logs for discipline habits (read-before-edit, red-first ordering, full-suite verification) and compares models or code-mode ON vs OFF sessions. - Use Case: Activate code mode before fixing a production bug; the Skill reproduces the failure first, delegates an adversarial review of the fix, verifies across test suite and running app, then produces a diff-shaped report separating verified from assumed claims. ## Quick Start Say "code mode" before starting a real coding task so the Skill creates its gate-state files and walks the change through spec, evidence, adversarial review, verification, and reporting.

Frequently Asked Questions about code-mode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce test-driven development in AI coding sessions?▼

Activate code mode before feature work; Gate 1 requires a failing test plus the exact command that runs it before any implementation. The red-green inner loop then keeps each edit tied to an observed test result, and the scorecard verifies red-first ordering from session logs.

How to measure whether an AI coding assistant follows good habits?▼

Run scripts/code-score.py with a model id to parse local Claude Code session logs. It reports rates for read-before-edit, checks after edits, full-suite runs, and failing-test-first ordering, with --split-code comparing code-mode ON versus OFF sessions.

Does code-mode work with existing lint and format hooks?▼

Yes, it checks what is already wired before offering hooks. If code_standard_lint.py and code_formatter.py already fire on Edit, Write, and MultiEdit events, code-mode deliberately avoids duplicating them and only recommends effort-level adjustments.

When should I not use a five-gate coding process?▼

Skip it for trivial work such as one-file edits or simple lookups, where the gates add overhead without value. The Skill itself warns that applying five gates to a two-minute edit is its own failure mode.

Why does code-mode store state on disk instead of in conversation?▼

Conversational state decays as context grows long, so activation and gate progress live in .work/.code-active and .work/GATES.md. A UserPromptSubmit hook re-injects the current gate on transitions or every fifth turn, keeping the anchor available across sessions.