rpa-gen-rules: project rules for agents
rpa-gen-rules
Skill that generates matching project rules for Cursor, Claude Code and Codex built around layered development and BDD
Install
/plugin marketplace add EvilFreelancer/rpa-skills
/plugin install rpa-gen-rules@rpa-skillsInstall from the rpa-skills catalog.
This is third-party code. Review the repository files before installing.
What it does
Using the repository's code, specs and docs, the skill creates or refreshes agent rules: .cursor/rules/*.mdc, CLAUDE.md with .claude/rules and a root AGENTS.md. The rules require building the project in layers, from modules with no internal dependencies upward, and working test-first. Every rule gets a mandatory sync step so a change for one agent lands in all trees in the same commit. For Codex it installs a hook bridge that attaches Cursor rules by glob.
Who it is for. Teams and developers who use several agents in one repository and want the same rules for all of them.
Good fit when
- The project has no agent rules yet and they should be inferred from code
- Cursor, Claude Code and Codex rules have drifted apart and need syncing
- You want the agent to follow layered development and tests before code
Not a fit when
- You use a single agent and are happy with your existing rules
- Your team does not practice test-driven development
Example request
/rpa-gen-rules generate rules for this repositoryLimitations
Generated rules are written in English by default. Testing templates are pytest-oriented. After the Codex bridge is installed you must run /hooks once to trust the hook.
How to disable. Remove the plugin via /plugin in Claude Code or delete the rpa-gen-rules folder from the agent's skills directory.
Security check
- Writes a Python hook for Codex into the project that runs during sessions
README in short
The skill creates agent rules for Cursor, Claude Code and Codex following a layered-cake model and BDD style. No separate user brief is needed; the agent infers rules from the repository. Codex gets a hook bridge that reads .cursor/rules directly. The skill is part of Pavel Rykov's rpa-skills collection and is packaged from the cursor-vibe-prompts prompt set. MIT license.
SKILL.md
--- name: rpa-gen-rules version: 1.3.0 description: > Run when the user invokes /rpa-gen-rules or asks to create or refresh agent project rules (Cursor .mdc, Claude Code CLAUDE.md and .claude/rules, Codex .codex hook bridge). Infers from specs, docs, and code. Rules use a layered-cake model (implement inner layers with no dependencies first, then the next layer) and BDD-style delivery. Generated rules and AGENTS.md are written in English unless the user asks for another language. Generated rules include a mandatory Rules Sync step so changes to one agent's tree are mirrored to every other agent's tree (Cursor <-> Claude <-> Codex <-> AGENTS.md) in the same commit. For Codex the skill installs a hook bridge that auto-attaches Cursor rules by glob, like Cursor and Claude Code do natively. No separate user brief required. --- # RPA generate project rules (layered + BDD, multi-agent) ## Goal Produce or update **versioned** instructions so the agent stays inside architecture, style, and **BDD-style** discipline (behavior specified in tests, tests before new behavior, full suite before calling work done). - **Layered cake** - rules must tell the agent to build **by layers**: first units that depend on nothing inside the project, then layers that depend only on lower layers, and so on. Mirror this in `architecture` and `implementation-order` style files. - **Cursor** - `.cursor/rules/*.mdc` ([MDC](https://github.com/nuxt-content/mdc), `globs`, `alwaysApply`, `@` links). - **Claude Code** - `CLAUDE.md` and `.claude/rules/*.md` with optional YAML `paths:` ([memory](https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/)). - **Codex** - root `AGENTS.md` plus a `.codex/` hook bridge (`hooks.json`, `hooks/attach_rules.py`, `rules.md` index) that injects `.cursor/rules/*.mdc` into Codex sessions: `alwaysApply` rules at `SessionStart`, glob-matched rules on `PreToolUse` - the same behavior Cursor and Claude Code have natively. ## Language of generated files: English by default Everything this skill writes into the target project is **written in English** unless the user explicitly asks for another language: - top-level briefs - `AGENTS.md`, root `CLAUDE.md`, `.claude/CLAUDE.md`, `.github/copilot-instructions.md`; - rule files and their frontmatter - `.cursor/rules/*.mdc`, `.claude/rules/*.md`, and any other agent tree; - headings, bullets, examples, and comments inside generated code snippets.
FAQ
Can the rules be in Russian?
Yes, if you ask explicitly. The language is then applied to every rules tree at once.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything
Up-to-date, version-specific library docs and code examples in your agent's context, via MCP or a CLI plus skill