generate-ai-rules

generate-ai-rules is a skill for Claude Code from divar-ir/ai-doc-gen. It costs 91 tokens per session (1,109 once invoked), scanned A, original, MIT.

A workflow for creating project instruction files for AI coding assistants, including AGENTS.md, CLAUDE.md, and Cursor rule files. It uses repository analysis or direct code inspection as its source.

In plain words
What is it for?
Use it to create or update AI assistant rules and help coding tools work within an existing repository.
Why use it?
It keeps guidance for different AI coding tools consistent with the project’s actual commands, paths, and conventions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

Part of the ai-doc-gen plugin — 3 skills shipped together

Good fit Use it to create or update AI assistant rules and help coding tools work within an existing repository.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/divar-ir/ai-doc-gen/generate-ai-rules
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add divar-ir/ai-doc-gen --skill generate-ai-rules
Clone the repo
git clone --depth 1 https://github.com/divar-ir/ai-doc-gen

Made for: Claude Code.

Or install ai-doc-gen, the plugin that ships this one along with the rest of its 3 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-ai-rules

README.md
[![agentmods](https://agentmods.dev/badge/skills/divar-ir/ai-doc-gen/generate-ai-rules/github.svg)](https://agentmods.dev/skills/divar-ir/ai-doc-gen/generate-ai-rules)
Your own site
<a href="https://agentmods.dev/skills/divar-ir/ai-doc-gen/generate-ai-rules"><img src="https://agentmods.dev/badge/skills/divar-ir/ai-doc-gen/generate-ai-rules/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-ai-rules

Your own site · 80×15
<a href="https://agentmods.dev/skills/divar-ir/ai-doc-gen/generate-ai-rules"><img src="https://agentmods.dev/badge/skills/divar-ir/ai-doc-gen/generate-ai-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,109 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00091 $0.01109
Opus 5 $0.00046 $0.00554
Sonnet 5 $0.00018 $0.00222
Haiku 4.5 $0.00009 $0.00111

Measured 10d ago against content hash 49db329175da, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

generate-ai-rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/generate-ai-rules/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate AI Rules

Generate configuration files that help AI coding assistants work effectively with a codebase. Three targets, generated from the same analysis so they stay consistent:

  1. AGENTS.md — the cross-tool standard (agents.md), read by most AI coding tools including Claude Code, Cursor, Codex, and Gemini CLI.
  2. CLAUDE.md — Claude Code's project instructions file.
  3. .cursor/rules/*.mdc — Cursor's scoped project rules.

Workflow

1. Determine targets and gather data

  • Generate all three targets by default; the user may skip any (e.g., "skip cursor rules", "keep my existing CLAUDE.md").
  • If a target file already exists and the user didn't say to regenerate it, ask whether to update it or leave it alone.
  • Check <repo>/.ai/docs/ for analysis documents from the analyze-codebase skill. If present, use them as the primary source (spot-check against the code — they may be stale). If absent, offer to run analyze-codebase first, or explore the codebase directly for a quicker pass.

2. Generate the files

Shared principles for all targets:

  • Accuracy: every command, path, and convention must come from the actual project. Test that commands at least look right against the manifest files (e.g., scripts in package.json, tasks in Makefile, uv run vs pip).
  • Actionability: specific, executable instructions beat vague guidance. "Run uv run ruff format src/" beats "format your code".
  • Conciseness: these files are loaded into every AI session — every line costs context. Only include what the AI cannot cheaply discover by reading the code: commands, non-obvious conventions, gotchas, things that have gone wrong before. Do not restate what the code structure makes obvious.
  • Consistency: same terminology and architecture descriptions across all generated files.
AGENTS.md

The primary file — write it first, and write it best. Target well under 150 lines.

  • Project overview (1–2 sentences)
  • Build, test, run, lint commands (in backticks, copy-pasteable)
  • Architecture overview (3–5 bullets)
  • Code style conventions
  • Testing instructions
  • Git workflow (commit format, PR process)
  • Key project-specific conventions and gotchas

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 84 lines · 91 tokens per session scan A 49db329175da

Subscribe to this mod's changes

generate-ai-rules is a skill published in the GitHub repository divar-ir/ai-doc-gen (755 stars, last pushed 1mo ago), licensed MIT. It adds 91 tokens to every session and 1,109 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

terminal

Use Desktop Commander for terminal and command-line work, especially anything that needs a shell whose state persists across turns: Python/Node REPLs, database shells, dev servers and other long-running processes, SSH into remote machines, and Windows PowerShell. Also handles everyday terminal tasks — navigating…

wonderwhy-er/DesktopCommanderMCP · 209 tokens

knowledge-base

Create and maintain a Markdown knowledge base that any AI agent can read, search, and update. Use when the user wants to start a knowledge base, add or update notes, organize docs/notes for an agent or LLM to consume, build an index of notes, or run a cleanup/maintenance pass on an existing MD knowledge base. Triggers…

wonderwhy-er/DesktopCommanderMCP · 112 tokens

obsidian-vault

Organize Obsidian vaults with MOCs, wikilinks, frontmatter/properties, dashboards, orphan-note checks, and cleanup workflows. Use ONLY when the user explicitly refers to Obsidian — by naming "Obsidian", an Obsidian "vault", or an Obsidian-specific feature such as wikilinks ("[[ ]]"), the Dataview or Bases plugins, or…

wonderwhy-er/DesktopCommanderMCP · 171 tokens

wiki_submit

Submit wiki documentation pages to Wegent backend API. Simplifies the HTTP POST process for wiki content submission.

wecode-ai/Wegent · 21 tokens

company-product-context

Compiles comprehensive company product context from PDF documents, web research, and industry knowledge.

lofcz/LLMTornado · 20 tokens

web-research

Use this skill for requests related to web research; it provides a structured approach to conducting comprehensive web research.

shibing624/agentica · 24 tokens