# SkillFoundry v5.15.0 — Coding Discipline Protocol

**Released:** 2026-05-16

---

## What's in This Release

v5.15.0 introduces a framework-wide behavioral guardrail — `agents/_coding-discipline.md` — that activates on every implementation task. Four sections, scoped carefully so they reinforce the existing *Philosophy*, *Mandatory Production Rules*, and *Three-Layer Enforcement* sections rather than override them.

No new code paths. No pipeline changes. No new MCP tools. Behavior and documentation only.

---

## The Protocol

The new `agents/_coding-discipline.md` file applies on every implementation task and skips for trivial edits, read-only investigation, and mechanical housekeeping.

### 1. Think Before Coding

*Don't assume. Don't hide confusion. Surface tradeoffs.*

- State assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them. Don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.

Reinforces *Cold-blooded logic over flattery* — no optimistic guesses, no silent reinterpretation.

### 2. Simplicity First (Scoped)

*Minimum code that solves the problem. Nothing speculative.*

Applies to **new logic you are writing**:

- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- If you write 200 lines and it could be 50, rewrite it.

Does **not** override project-mandated production guards:

- Three-Layer Enforcement (DB → Backend → Frontend) is still required for full-stack features.
- Input validation at system boundaries is still required.
- `[]` default for array fields, no `.method()` on nullable arrays — still required.
- "No error handling for impossible scenarios" means **truly impossible**, not "I don't feel like handling it."

### 3. Surgical Changes

*Touch only what you must. Clean up only your own mess.*

- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it. Don't delete it.
- Remove imports/variables/functions that **your** changes made unused.
- Don't remove pre-existing dead code unless asked.

The test: every changed line should trace directly to the user's request.

### 4. Goal-Driven Execution

*Define success criteria. Loop until verified.*

Transform tasks into verifiable goals:

- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"

For multi-step tasks, state a brief plan with explicit verification steps. Pairs naturally with `/layer-check` for full-stack work — define which layers a change must cross, then verify each.

---

## Why It Lives in `agents/_coding-discipline.md` (Not `CLAUDE.md` or a Skill)

| Option | Why Not Chosen |
|--------|----------------|
| Inline in `CLAUDE.md` | Would bloat the main file and conflict with the existing *Mandatory Production Rules* unless the simplicity rule is carefully scoped. Done as a referenced file instead, matching `_env-preflight-protocol.md`. |
| Standalone skill (`/coding-discipline`) | Would require explicit invocation. Behavioral guardrails need to be always-on, not opt-in. |
| Global `~/.claude/CLAUDE.md` | Would apply to every project. The project-specific scope clauses (Three-Layer Enforcement, array defaults, etc.) are SkillFoundry-specific. |

The referenced-file pattern keeps `CLAUDE.md` focused on framework rules and lets the protocol grow without editing the main file.

---

## Files Changed

| File | Change |
|------|--------|
| `agents/_coding-discipline.md` | **NEW** — four-section behavioral protocol |
| `CLAUDE.md` | One new line in the header, pointing at the protocol file |
| `CHANGELOG.md` | v5.15.0 entry |
| `README.md` | Version badge + "What's New" section |
| `docs/V5.15.0-RELEASE-NOTES.md` | This file |
| `docs/DOCUMENTATION-INDEX.md` | New release-notes entry |
| `.version` | `5.14.0` → `5.15.0` |
| `package.json`, `mcp-server/package.json`, `sf_cli/package.json` | Version bump |
| `mcp-server/src/server.ts`, `mcp-server/src/mcp/handler.ts`, `mcp-server/src/api/routes.ts` | Version constant bump |
| `site/index.html`, `site/pages/resources-changelog.html` | Hero badge, footer version badge, changelog page version |

---

## Stricter-Rule-Wins Clause

The new protocol explicitly states that where it differs from the project's existing rules, **the stricter rule wins**. This means:

- Section 2 ("Simplicity First") **cannot** be used to justify skipping Three-Layer Enforcement, boundary validation, error handling required by *Mandatory Production Rules*, or any of the 171 patterns catalogued in `agents/_known-deviations.md`.
- Section 3 ("Surgical Changes") reinforces — does not weaken — the existing *Never break existing features* and *No retroactive scope expansion* rules.

---

## Upgrade Notes

1. **No code action required.** The protocol activates the next time an agent reads `CLAUDE.md` (which happens at session start).
2. **No npm/build action required.** Documentation-only change.
3. **Restart MCP server** if you want the new `5.15.0` version string reflected in `/api/v1` `/version` responses and the `MCP initialize` handshake.

---

## Version

```
5.14.0 → 5.15.0 (MINOR — additive behavioral protocol, no breaking changes)
```
