# 05 Rule Generate

> Generate a coding rule that governs editor and agent behavior across the host AI tools. Use when the user wants to write, add, or refactor a rule, convention, or coding standard. Not for other artifacts like skills, agents, or hooks.

- Skill: `ai-driven-dev/05-rule-generate` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add ai-driven-dev/05-rule-generate`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ai-driven-dev/05-rule-generate/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: ai-driven-dev (https://skillmd.com/u/ai-driven-dev)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/ai-driven-dev/05-rule-generate

---


# Rule Generate

Write one canonical rule from intent and render it per confirmed host tool that supports rules, or once as a plugin source.

## Actions

| #   | Action         | Role                                      | Input        |
| --- | -------------- | ----------------------------------------- | ------------ |
| 01  | `capture-rule` | Capture the topic, pick category and slug | user request |
| 02  | `write-rule`   | Write the rule file per supported tool    | the topic    |
| 03  | `validate`     | Check each rule file                      | the files    |

Run the actions in order, `01 → 03`, and run each action's `## Test` before the next.
Before running an action, read its file in `actions/`, not only the table or assets.

## References

- `references/rule-authoring.md`: the contract (taxonomy, naming, frontmatter, content).
- `references/tool-paths.md`: per-tool rules path, frontmatter, unsupported tools, the gate.

## Assets

- `assets/rule-template.md`: rule file scaffold.

