Chinese → README.zh-CN.md Guardrails, not a workflow. Quiet on routine work; firm when a named failure mode is at risk. AI coding agents tend to fail in two expensive ways: They drift off-goal.
FAQ
coding-discipline is a Claude Code plugin with 8 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes brainstorming, code-review, context-hygiene. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
> /plugin marketplace add chipfighter/coding-discipline> /plugin install coding-discipline@coding-discipline
Repo: chipfighter/coding-discipline
Chinese → README.zh-CN.md
Guardrails, not a workflow. Quiet on routine work; firm when a named failure mode is at risk.
AI coding agents tend to fail in two expensive ways:
coding-discipline is a lightweight, workflow-agnostic plugin that addresses
both:
It does not replace Plan mode, launch subagents, orchestrate worktrees, choose models, or force every task through a spec workflow. Small changes stay small. When a risk trigger matches, the corresponding skill stays firm.
8 skills + 2 hooks. Install once, apply globally. Supports Claude Code and Codex.
Superpowers proved that engineering discipline can live in agent skills — this plugin even reuses its cross-platform hook pattern (see Credits). But Superpowers is a complete workflow: its bootstrap asks the agent to route every response, even a clarifying question, through the skill system first.
coding-discipline starts from the opposite default. Skills stay dormant until a named failure mode is at risk; routine work runs untouched. The fixed context injected per session is ~1.2k tokens and cannot silently grow — a CI test fails the build when it does. The cost that actually differs between plugins is how often one inserts itself, and what it spawns when it does.
On top of the guardrails, this project adds a piece of its own: the spec layer. spec-sync writes confirmed goals, non-goals, hard constraints, and acceptance criteria back into the docs the project already has — no proposal → approve → archive lifecycle, no new artifacts — so the next session does not rebuild a target you already rejected.
Use it when you want more discipline than a bare coding agent, but do not want another orchestration layer.
codex plugin marketplace add chipfighter/coding-discipline
codex plugin add coding-discipline@coding-discipline
Open a new task after installation. The first time a hook is enabled, and
whenever it changes, Codex asks you to review it. Use /hooks to inspect and
trust it.
To test a local checkout, replace the first command with:
codex plugin marketplace add .
/plugin marketplace add chipfighter/coding-discipline
/plugin install coding-discipline@coding-discipline
The first command adds this repository as a self-hosted plugin source; the second installs the plugin. Open a new session after installation. To test a local checkout, replace the repository name in the first command with a local path.
The eight skills are plain SKILL.md files that conform to the
agentskills.io spec — conformant name, a
description within the 1024-character limit, and a license on every file so a
copied skill still carries its terms. A CI test enforces those limits, because
Claude Code is lenient about all three and a violation would fail silently
wherever else the directory is copied.
Codex supports SKILL.md directly:
mkdir -p ~/.agents/skills
cp -r plugins/coding-discipline/skills/* ~/.agents/skills/
Windows PowerShell:
Copy-Item -Recurse "plugins\coding-discipline\skills\*" "$HOME\.agents\skills\"
This route omits SessionStart injection, usage counting, and guide-doc seeding.
If you want the global discipline primer, review
plugins/coding-discipline/hooks/skill-discipline.md and merge it into
~/.codex/AGENTS.md once.
Each skill description defines both its trigger and its exclusions. The full instructions load only when the skill is selected.
| skill | when it triggers |
|---|---|
spec-sync | confirmed goals, non-goals, constraints, or acceptance criteria must survive across sessions, but the current source of truth is stale or missing |
brainstorming | requirements have multiple reasonable interpretations, design tradeoffs matter, or a wrong change would be expensive |
tdd | new or changed behavior can be verified with an automated regression test |
systematic-debugging | a bug, failure, or unexpected behavior has no established root cause |
code-review | changes affect coordination across modules, cross a high-risk boundary, or the user requests a review |
verify-before-done | before any claim that work is complete, fixed, tested, or ready |
git-flow | branching, worktrees, commits, tags, or branch wrap-up |
context-hygiene | entering a project, reading project history, or resolving conflicting documentation |
The skills are intentionally short. They keep only the hard judgment rules that models routinely skip; the harness remains responsible for ordinary planning and execution.
hookSpecificOutput.additionalContext for
Claude Code and Codex, additional_context for Cursor, top-level
additionalContext for Copilot — and appends only the host's own invocation
note. Tests cover all four envelope shapes; Claude Code and Codex are the two
used daily, so treat Cursor and Copilot as conformant-but-unproven until you
have run them yourself.~/.coding-discipline/usage.jsonl. Claude Code also exposes per-skill
invocations. Nothing is sent over the network.View the local summary:
bash plugins/coding-discipline/hooks/skills-count.sh
Disable counting:
CD_USAGE_ENABLED=0
Disable the primer by itself, leaving counting and guide seeding in place:
CD_PRIMER=0
The primer is fixed cost paid on every session, and whether it earns that cost is a question about your workload rather than a claim this project can settle for you. This switch is what makes it answerable: run the same tasks with it on and off, and compare.
On the first session inside a Git repository, the plugin creates an empty guide skeleton when the target file does not already exist:
CLAUDE.mdAGENTS.mdThe guide is seeded only at the repository root, including when the session
starts in a nested directory or worktree. It never overwrites an existing file.
Set CD_SEED_AGENT_DOC=0 to disable it.
The English skeleton is intentionally sparse. Add only confirmed project facts that cannot be inferred from the code. Agents still answer in the user's language. The guide is shared project context, not a machine-local cache: commit confirmed rules when the team and future sessions need them, and never store secrets, tokens, or personal data in it.
Skills are prompt-level discipline, not a deterministic policy engine. They reduce failure probability; they cannot guarantee perfect routing or compliance.
For stronger enforcement:
CLAUDE.md or
AGENTS.md;Report false triggers and missed triggers with the repository's routing feedback issue template. Regression cases grow from real failures rather than a synthetic release suite.
A skill is executable context: whatever it says enters an agent that already holds your credentials and your file system. Public skill catalogues scanned in 2026 turned out to carry prompt injection and credential exfiltration in a large minority of entries, so this plugin treats "our skills are clean" as a claim that has to be checked rather than promised.
tests/test-skill-safety.py scans every shipped file for the known attack
classes — network egress, credential and private-key paths, piping into a
shell, decoded or indirect execution, and invisible or bidirectional Unicode
that hides instructions from a human reading the diff. Each rule carries a
sample it must still match, so a pattern that quietly stops working fails the
build instead of reporting success forever. CI runs it on Ubuntu and Windows.
The plugin makes no network calls and sends no telemetry. Its only write
outside your repository is the local usage log at
~/.coding-discipline/usage.jsonl, and the test fails if that sink ever moves
without this claim being re-checked.
python tests/test-skill-safety.py
run-hook.cmd locates
Git Bash without selecting WSL's bash.exe.jq — JSON escaping and local usage records use pure bash.python tests/test-plugin-metadata.py
python tests/test-skill-safety.py
bash tests/test-hooks.sh
On Windows:
powershell -NoProfile -ExecutionPolicy Bypass -File tests/test-windows-hook.ps1
The metadata test freezes the English fixed-context baseline at 4580 characters (4944 at v0.8.0, re-frozen after a dedup trim): the SessionStart primer plus all eight skill descriptions may not grow unless text is removed elsewhere. GitHub Actions runs the same validation on Ubuntu and Windows.
The discipline philosophy and cross-platform hook foundation — including the
polyglot run-hook.cmd, SessionStart injection, and pure-bash JSON escaping —
come from Superpowers by Jesse Vincent
(MIT). This project narrows that foundation into a workflow-agnostic guardrail
layer and adds spec synchronization, risk-triggered routing, and
Windows/Git-Bash support.
MIT — see LICENSE.
.agents/
plugins/
marketplace.json
.claude-plugin/
marketplace.json
.gitattributes
.github/
ISSUE_TEMPLATE/
routing-feedback.md
workflows/
test.yml
.gitignore
LICENSE
plugins/
coding-discipline/
.claude-plugin/
plugin.json
.codex-plugin/
plugin.json
hooks/
hooks-codex.json
hooks.json
log-usage
run-hook.cmd
session-start-skills
skill-discipline.md
skills-count.sh
usage-lib.sh
skills/
brainstorming/
SKILL.md
code-review/
SKILL.md
context-hygiene/
SKILL.md
git-flow/
SKILL.md
spec-sync/
SKILL.md
systematic-debugging/
SKILL.md
tdd/
SKILL.md
verify-before-done/
SKILL.md
templates/
agent-doc.seed.md
README.md
README.zh-CN.md
tests/
test-hooks.sh
test-plugin-metadata.py
test-skill-safety.py
test-windows-hook.ps1© 2026 Flowy · Free and open source
Built for Claude Code · Not affiliated with Anthropic