{"id":"40235de2-c864-4f9a-9834-88307be242de","slug":"rulesmith","kind":"skill","name":"rulesmith","summary":"Write AI coding rules once; generate CLAUDE.md, AGENTS.md, .cursorrules, .clinerules and CONVENTIONS.md, and fail CI on drift.","owner":"iskra-astudillo","repoUrl":"https://github.com/iskra-astudillo/rulesmith","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-11-04T19:04:07.000Z","addedAt":"2026-11-05T20:06:09.094Z","logoUrl":"https://avatars.githubusercontent.com/u/272599622?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["developer-tools"],"tags":["ai-coding","aider","claude-code","cli","cline","coding-standards","cursor","python"],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-11-05T20:08:38.635Z","sample":false,"url":"https://conduits.dev/tools/rulesmith","language":"Python","transports":["stdio"],"install":{"pypi":"rulesmith-cli"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# rulesmith\n\n**Write your team's AI coding rules once. Generate `CLAUDE.md`, `AGENTS.md`, `.cursorrules`, `.clinerules` and Aider's `CONVENTIONS.md` from that one source.**\n\nEvery coding agent reads its own rules file. Teams that use more than one agent end up with five copies of the same standards, edited by hand, drifting apart. `rulesmith` keeps one spec (`rulesmith.json`), composes it from tested rule blocks, renders each agent's native file, and fails CI when a generated file has drifted.\n\nPure Python standard library. No network calls, no API keys.\n\n```console\n$ rulesmith init --team \"Acme Platform\" --stack python,react --sector saas --compliance soc2\nwrote rulesmith.json\n$ rulesmith render\nwrote ./.clinerules\nwrote ./CLAUDE.md\nwrote ./.cursorrules\nwrote ./AGENTS.md\nwrote ./CONVENTIONS.md\n$ rulesmith check\nok: generated files match rulesmith.json\n```\n\nSee [`examples/`](examples/) for the exact output of that run.\n\n## Install\n\n```bash\npipx install git+https://github.com/iskra-astudillo/rulesmith\n# or, from a clone:\npython -m rulesmith_cli list\n```\n\nPython 3.8 or newer. No dependencies. The command is `rulesmith`; the package name is `rulesmith-cli`.\n\n## Commands\n\n| Command | What it does |\n|---|---|\n| `rulesmith init` | Writes `rulesmith.json` from `--team`, `--stack`, `--sector`, `--compliance`. |\n| `rulesmith render` | Writes the agent files next to the spec (or `--out DIR`). `--agent claude` limits it to one. |\n| `rulesmith check` | Exits 1 if any generated file is missing or differs from the spec. Use it in CI. |\n| `rulesmith list` | Shows the supported stacks, sectors, compliance sets and agents. |\n\n## Rule blocks\n\n- **Safety baseline** (on by default): no destructive operations without human approval, no inline secrets, safety gates fail closed, money math carries units, changes are revertable.\n- **Code quality**: validate external data against a schema, re-read rotated secrets, fix a whole class of issue rather than the first instance, verify before claiming done.\n- **Stacks**: go, node, python, rails, react, sql, typescript.\n- **Industries**: ai-agent, ecommerce, fintech, healthcare, saas.\n- **Compliance**: gdpr, hipaa, pci, soc2.\n- **Team rules**: anything in `extra_rules` is appended verbatim.\n\n```json\n{\n  \"team\": \"Acme Platform\",\n  \"sector\": \"saas\",\n  \"stacks\": [\"python\", \"react\"],\n  \"compliance\": \"soc2\",\n  \"include_baseline\": true,\n  \"extra_rules\": [\"All public endpoints are documented in openapi.yaml.\"]\n}\n```\n\n## CI\n\n```yaml\n- run: pipx run --spec git+https://github.com/iskra-astudillo/rulesmith rulesmith check\n```\n\nThe check compares each file byte for byte with a fresh render, so a hand edit to `CLAUDE.md` fails the build and the fix is to change the spec.\n\n## Agent skill\n\n[`SKILL.md`](SKILL.md) lets Claude Code, Codex or Cursor maintain the spec themselves: edit `rulesmith.json`, render, check, commit both together.\n\n## Why the safety baseline looks like this\n\nThe baseline rules come from the failure modes that recur in AI-written code: a gate that fails open when its flag is missing, a secret pasted inline, a destructive command run without approval, a fix applied to the first instance of a bug and not the rest. The companion tool [bugclass-detectors](https://github.com/iskra-astudillo/bugclass-detectors) detects several of these in Python code.\n\n## Hosted version\n\n[RuleSmith](https://rulesmith.eliteaiempire.com) generates the same files in the browser.\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n"}