# Rules Generator

> Auto-generates .claude/rules/ documentation for any codebase

- **Type:** Skill
- **Install:** `agentstack add skill-drag88-claude-dev-framework-rules-generator`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [drag88](https://agentstack.voostack.com/s/drag88)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [drag88](https://github.com/drag88)
- **Source:** https://github.com/drag88/claude-dev-framework/tree/main/skills/rules-generator

## Install

```sh
agentstack add skill-drag88-claude-dev-framework-rules-generator
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Rules Generator Skill

Auto-generate `.claude/rules/` documentation for any codebase.

## When to Activate

- No `.claude/rules/` directory exists in the current project
- User asks about codebase structure or architecture
- User asks "what does this project do"
- Starting work on an unfamiliar codebase
- User explicitly asks to generate rules

## Actions

0. **Load rulebook**: Read `rules-templates/claudemd-4-7-rulebook.md` (vendored into CDF) as the authoritative reference for rule framing (positive imperatives, explicit scope, why-statements, neutral tone). Falls back to the embedded principles in this file only if the rulebook is missing.

1. **Explore codebase** using the Explore agent to understand:
   - Directory structure and key files
   - Tech stack (languages, frameworks, libraries)
   - Architectural patterns and conventions
   - Build/test/run commands

2. **Generate `.claude/rules/` files** with YAML frontmatter on every file:
   - `architecture.md` — Directory structure, key files, component relationships, data flow. Frontmatter: `description:` only (loads broadly).
   - `tech-stack.md` — Languages, frameworks, libraries with purposes. Frontmatter: `description:` only.
   - `patterns.md` — Architectural patterns, code conventions, error handling. Frontmatter: `description:` + `paths:` scoped to source dirs (e.g. `["src/**", "lib/**"]`).
   - `commands.md` — Setup, build, test, lint, run commands. Frontmatter: `description:` only.
   - Project-type files (`api-conventions.md`, `component-conventions.md`, etc.) — Always include `paths:` scoped to the relevant directory glob so they only load when matching files are touched.

3. **Frame rules as positive imperatives**, with explicit scope and the why where non-obvious. Example: "Apply to every API route, including admin routes. Reason: centralized auth check." Avoid CAPS, MUST, CRITICAL, "ANY", "ALWAYS".

4. **Confirm completion** with a summary listing each generated file, its line count, and whether it is path-scoped or always-loaded.

## File Format

Every rule file uses YAML frontmatter:

```markdown
---
description: One-line summary of what this file covers
paths: ["src/api/**/*.py", "src/middleware/**"]   # optional — omit to always-load
---
# API Route Rules

- Every endpoint validates input via the `@validate_input` decorator. Reason: centralized request schema enforcement.
- API errors return the standard `{error, code, details}` shape. Reason: client-side error parser depends on it.
```

Rules without `paths:` load every session. Use `paths:` for any topic that only applies when specific files are touched — this saves context across sessions that do not touch those files.

## Related Commands

- `/cdf:rules generate` - Manually refresh all rules
- `/cdf:docs plan` - Create task documentation structure

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [drag88](https://github.com/drag88)
- **Source:** [drag88/claude-dev-framework](https://github.com/drag88/claude-dev-framework)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-drag88-claude-dev-framework-rules-generator
- Seller: https://agentstack.voostack.com/s/drag88
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
