Skip to content

ryanthedev/code-foundations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

243 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Foundations

AI that codes like a senior engineer. Checklists, quality gates, and verification built into every workflow.

Experimental - This plugin is under active development. We are fine-tuning subagent orchestration to ensure reliable skill loading and phase execution. We will add GitHub releases once the plugin stabilizes.


Pick Your Workflow

Command Purpose When to Use
/code-foundations:research Clarify what you want through facilitated conversation Exploring ideas
/code-foundations:plan Create implementation-ready plans Feature planning
/code-foundations:building Execute plans with quality gates Implementing approved plans
/code-foundations:debug Scientific debugging with task tracking Bug hunting

Why this exists: LLMs write code fast. Fast code without engineering discipline creates debt. This plugin loads proven checklists and mental models so Claude applies them automatically.


Planning and Execution: Research to Building

Three commands work together: Research clarifies intent, Plan creates the plan, Building executes it.

/code-foundations:research "add notification system"
     ↓
.local/state/code-foundations/research/2026-01-30-notifications.md
     ↓
/code-foundations:plan .local/state/code-foundations/research/2026-01-30-notifications.md
     ↓
.local/state/code-foundations/plans/2026-01-30-notifications.md
     ↓
/code-foundations:building .local/state/code-foundations/plans/2026-01-30-notifications.md

/code-foundations:research - Clarify What You Want

Facilitated conversation to extract and document requirements.

User: "/code-foundations:research add user notifications"

  → Facilitated conversation
  → Progressive narrowing: purpose, actors, context, boundaries, needs, risks
  → Save confirmed requirements to .local/state/code-foundations/research/

/code-foundations:plan — Create the Plan

Researches your codebase, audits available skills, then asks targeted questions.

User: "/code-foundations:plan add user notifications"

  DISCOVER
  ├─ Search codebase for existing patterns
  ├─ Audit ALL available skills (from every installed plugin)
  │   → "React Native project detected → react-native-foundations:coding"
  │   → "Frontend UI work → design-for-ai:a11y-audit"
  ├─ Ask targeted questions (one at a time)
  └─ Produce problem statement

  EXPLORE (Medium/Complex)
  ├─ 2-3 structurally different approaches
  └─ Pre-mortem (Complex)

  DETAIL → SAVE → CHECK → CONFIRM → HANDOFF
  ├─ Phase specs with Skills field per phase
  ├─ Save plan to .local/state/code-foundations/plans/
  ├─ Subagent reviews plan with fresh eyes
  ├─ User confirms + corrections
  └─ Handoff to /code-foundations:building

Skills loaded: aposd-designing-deep-modules, aposd-reviewing-module-design

Task tracking: Creates progress tasks at startup so you can see where plan is in its flow.

/code-foundations:building - Execute the Plan

Gated execution with subagents. Each phase has mandatory quality checks.

User: "/code-foundations:building .local/state/code-foundations/plans/2026-01-30-notifications.md"

  BRANCH GATE
  └─ On main? → STOP. Create feature branch first.

  FOR EACH PHASE:
  ┌────────────────────────────────────────────────────────────┐
  │  BUILD        Build-agent: discovery + design + TDD       │
  │       ⛔ Loads pre-gate + implement standards              │
  ├────────────────────────────────────────────────────────────┤
  │  REVIEW       Post-gate-agent checks quality (Full gate)   │
  │       ⛔ Cannot commit until reviewer returns PASS         │
  ├────────────────────────────────────────────────────────────┤
  │  COMMIT       Orchestrator commits after gates pass        │
  └────────────────────────────────────────────────────────────┘

Quality Gates per Phase

Phase Standards Loaded What Gets Enforced
BUILD references/pre-gate-standards.md + references/implement-standards.md Design-before-code, interface depth, control flow, naming, complexity
REVIEW references/post-gate-standards.md Correctness, quality, module design, error handling
VERIFY performance-optimization, cc-refactoring-guidance Performance regressions, refactoring opportunities, build + tests + lint

Gate policy is adaptive: Full (BUILD + REVIEW), Standard (BUILD + tests), Minimal (BUILD only). Skills assigned per phase during plan's SAVE step.

The system saves every artifact to .local/state/code-foundations/building/. Per-phase commits enable rollback.


Getting Stuff Done: Debug

/code-foundations:debug - Scientific Debugging

Predict, log, run, resolve. Task list keeps you on track.

/code-foundations:debug login fails 20% of the time

  TASK #1: Investigate login failure
  ├─ PREDICT: "All tokens should be valid"
  ├─ LOG: Add at validateToken entry
  ├─ RUN: 2 of 10 fail, tokens valid
  └─ RESOLVE: Problem is downstream → narrow

  TASK #2: Narrow: validateToken result
  ├─ PREDICT: "Cache should HIT on second call"
  ├─ LOG: Add at cache check
  ├─ RUN: Two MISS within 10ms
  └─ RESOLVE: Race condition found → fix

  TASK #3: Fix: request deduplication
  └─ RESOLVE: Fix applied → verify

  TASK #4: Verify: parallel logins succeed
  └─ RUN: 100 parallel → 0 failures → Done!

Skill loaded: cc-debugging (scientific debugging method)

The task list prevents rabbit holes, missed verifications, and lost context.

When to Use Each

Situation Command
Vague idea, unclear requirements /code-foundations:research
Need full feature planning /code-foundations:plan
Have approved plan, ready to implement /code-foundations:building
Bug hunting, need structured approach /code-foundations:debug

Installation

# Add marketplace
/plugin marketplace add ryanthedev/rtd-claude-inn

# Install
/plugin install code-foundations@rtd

# Update
/plugin update code-foundations@rtd

Credits

Based on Code Complete, 2nd Edition by Steve McConnell and A Philosophy of Software Design by John Ousterhout.

License

MIT

About

Code Foundations: software engineering skills for AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors