{
  "markdown": "# DietCode\n\n**Lazy senior dev mode for AI coding agents.** The best code is the code you never wrote.\n\nDietCode makes your agent climb a ladder before writing anything: does this even need to exist (YAGNI)? Does the standard library do it? A native platform feature? An already-installed dependency? Can it be one line? Only then write the minimum that works. Less code, less cost, fewer 3am pages.\n\n## Before / after\n\n**Without DietCode** — \"add email validation\":\n\n```js\nclass EmailValidator {\n  constructor(rules = DEFAULT_RULES) { this.rules = rules; }\n  validate(email) { /* 30 lines of regex + TLD list + options */ }\n}\n```\n\n**With DietCode:**\n\n```js\nconst isEmail = (s) => s.includes(\"@\") && s.includes(\".\");\n// dietcode: format check only; the real validation is the confirmation email.\n```\n\n→ skipped: RFC-5322 regex, TLD list. Add when you actually parse addresses, not just gate signups.\n\n## Install\n\n### Claude Code\n\n```\n/plugin marketplace add kendrekaran/dietcode\n/plugin install dietcode\n```\n\n### Codex\n\nAdd the plugin directory (ships `.codex-plugin/plugin.json` + `hooks/claude-codex-hooks.json`). Invoke skills with `@dietcode`, `@dietcode-review`, `@dietcode-help`.\n\n### Copilot CLI\n\nPoint Copilot at this repo's `.github/plugin/` (commands, skills, and `hooks/copilot-hooks.json`).\n\n### Cursor\n\nCopy `.cursor/rules/dietcode.mdc` from [github.com/kendrekaran/dietcode](https://github.com/kendrekaran/dietcode) into your project's `.cursor/rules/`, or run `dietcode init cursor` (see [CLI](#cli)). The rule is `alwaysApply: true`.\n\n### Windsurf / Cline / Kiro / generic agents\n\nCopy the matching rule file from [github.com/kendrekaran/dietcode](https://github.com/kendrekaran/dietcode) into your project:\n\n- Windsurf → `.windsurf/rules/dietcode.md`\n- Cline → `.clinerules/dietcode.md`\n- Kiro → `.kiro/steering/dietcode.md`\n- Any AGENTS.md-aware agent → `AGENTS.md`\n\n### OpenCode\n\n```json\n{ \"plugin\": [\"./.opencode/plugins/dietcode.mjs\"] }\n```\n\n### Gemini\n\nShips `gemini-extension.json` with `contextFileName: AGENTS.md`.\n\n## Modes\n\n| Mode | Behavior |\n|------|----------|\n| `lite` | Build what's asked; name the lazier alternative in one line. |\n| `full` | The ladder enforced. Stdlib and native first. **Default.** |\n| `ultra` | YAGNI extremist. Deletion before addition. Challenges the requirement. |\n| `off` | Disabled. |\n\nSwitch with `/dietcode lite|full|ultra|off`, or say \"stop dietcode\" / \"normal mode\".\n\nSet the default with the `DIETCODE_DEFAULT_MODE` env var or `~/.config/dietcode/config.json` (`{ \"defaultMode\": \"lite\" }`). Resolution: env var > config file > `full`.\n\n## Commands\n\n| Command | What it does |\n|---------|--------------|\n| `/dietcode [lite\\|full\\|ultra\\|off]` | Switch intensity. |\n| `/dietcode-review` | Review the current diff for over-engineering. |\n| `/dietcode-audit` | Audit the whole repo for over-engineering. |\n| `/dietcode-debt` | Harvest `dietcode:` shortcut comments into a ledger. |\n| `/dietcode-gain` | Show the measured-impact scoreboard. |\n| `/dietcode-help` | Command reference. |\n\n## Safety floor\n\nDietCode is never lazy about: input validation at trust boundaries, error handling that prevents data loss, security, accessibility, hardware calibration, and anything you explicitly request.\n\n## CLI\n\nThe optional [`@diet-code/cli`](./cli/) automates the manual install steps above and manages modes.\n\n```bash\nnpm install -g @diet-code/cli\n\ndietcode init cursor      # copy the Cursor rule into this project\ndietcode init agents      # copy AGENTS.md into this project\ndietcode mode full        # set the default mode (lite/full are free)\ndietcode doctor           # verify node, config, rule files, hooks\n```\n\nConfig lives in `~/.config/dietcode/`. See [`docs/configuration.md`](./docs/configuration.md).\n\n## Benchmarks\n\nSee [`benchmarks/`](./benchmarks/) for the harness and `benchmarks/results/` for published numbers. Headline medians: 80–94% less code, 47–77% less cost, 3–6× faster across 5 everyday tasks and 3 models.\n\n<!-- Pricing section, on hold for the free launch — everything above is free for now.\n## Pricing\n\nFree tier covers `AGENTS.md` + Cursor rule + lite/full modes. Pro ($12/mo) adds `ultra`, the full plugin + hooks bundle, and the `dietcode-review` skill. See [`docs/pricing.md`](./docs/pricing.md).\n-->\n\n## Development\n\n```bash\nnpm test                              # node --test\nnode scripts/check-rule-copies.js     # rule sync invariant\nnode scripts/build-openclaw-skills.js # regenerate OpenClaw skills\n```\n\nMIT licensed.\n",
  "bytes": 4511,
  "sha": "0d6e9d12ca35f5bb90ab2483b5a5fadd55eda77b8d5f755866729d43cba0761f",
  "repo_slug": "kendrekaran/dietcode",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_kendrekaran_dietcode_1eb2958e/readme"
}