# clanker-discipline

This skill prevents AI coding agents from bloating application state. It guides reviews of state models, optional fields, and mutation patterns.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 7500 installs · ★ 22
- Author: gbasin
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/gbasin/clanker-discipline/tree/HEAD/SKILL.md
- Updated: 2026-03-23
- HTML: https://affpapa.org/en/nevibecode/skills/clanker-discipline

## What it does

Coding assistants often handle edge cases by adding boolean flags and optional fields. This habit quickly breaks architecture. The clanker-discipline skill instructs the agent to derive values from existing event logs rather than managing duplicate state variables.

When state cannot be rederived, the rules confine it to a closure. Data structures must rely on discriminated unions instead of dozens of optional properties. Identical primitive strings like entity IDs receive branded types to prevent accidental swapping. Unused type variants get deleted immediately.

Code cleanliness takes precedence over small diffs. A large rewrite during review is better than layering workarounds. The skill also enforces clear boundaries between pure semantic functions and effectful orchestrators, which makes automated tests straightforward.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add gbasin/clanker-discipline --skill clanker-discipline -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/clanker-discipline/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/clanker-discipline/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add gbasin/clanker-discipline --skill clanker-discipline -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/clanker-discipline/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add gbasin/clanker-discipline --skill clanker-discipline -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/clanker-discipline/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install gbasin/clanker-discipline clanker-discipline
```

2. **Manually: put the files in place**
- File: `.github/skills/clanker-discipline/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add gbasin/clanker-discipline --skill clanker-discipline -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/gbasin/clanker-discipline
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/clanker-discipline/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add gbasin/clanker-discipline --skill clanker-discipline -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/gbasin/clanker-discipline/tree/HEAD/SKILL.md

## When to use it
- eliminate redundant boolean flags by deriving state from event streams
- replace grab-bag optional fields with discriminated unions
- differentiate primitive identifier strings using branded types
- isolate side effects away from pure semantic calculations

## Example prompts
- Review this state model and eliminate redundant flags using clanker-discipline rules.
- Convert this interface of optional fields into a discriminated union.
- Extract side effects from this function into a separate orchestrator.

## Similar
- [fork-discipline](https://affpapa.org/en/nevibecode/skills/fork-discipline.md) — skill · 889 installs
- [refactor](https://affpapa.org/en/nevibecode/skills/tartinerlabs-refactor.md) — skill · 376 installs
- [principle-type-system-discipline](https://affpapa.org/en/nevibecode/skills/principle-type-system-discipline.md) — skill · 5300 installs
- [narrow-react-prop-types](https://affpapa.org/en/nevibecode/skills/narrow-react-prop-types.md) — skill · 1300 installs
- [ddd-validate](https://affpapa.org/en/nevibecode/skills/ddd-validate.md) — skill · 736 installs
- [finding-duplicate-functions](https://affpapa.org/en/nevibecode/skills/finding-duplicate-functions.md) — skill · 634 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
