rules-create-global

Generates a lean root CLAUDE.md or AGENTS.md from architecture specs or a primed codebase.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/az9713/claude-code-hooks-tutorial --skill rules-create-global-az9713
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rules-create-global
Source: https://github.com/az9713/claude-code-hooks-tutorial/tree/main/skills/.claude/skills/rules-create-global
Command: npx skills add https://github.com/az9713/claude-code-hooks-tutorial --skill rules-create-global-az9713

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? New and existing projects often lack a well-structured global rules file, leaving AI coding agents without an always-on map of the codebase, ground rules, and working principles, or with a bloated generic /init output the agent ignores. ## Core Features & Use Cases - Greenfield derivation: Reads a PRD and/or architecture spec passed as arguments and derives rules from the settled technical decisions, treating the PRD only as product context. - Brownfield derivation: Derives rules from a primed codebase (via /prime-codebase) or a passed codebase-analysis document, requiring every rule to be traceable to a real file. - Lean composition workflow: Sorts content into always-on rules, on-demand .claude/references/ stubs, task plans, or deletions, and elicits working principles from the user rather than inventing them. - Use Case: After settling your stack and conventions with an architecture doc, run this skill with the spec path to produce a CLAUDE.md containing an architecture map, ground rules, commands, and agent-steering principles. ## Quick Start Ask the AI to run the rules-create-global skill with the path to your architecture spec to generate the project's root CLAUDE.md.

Frequently Asked Questions about rules-create-global

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a CLAUDE.md file for my project?▼

Run this skill after settling your architecture decisions. For greenfield projects pass your PRD and architecture spec paths; for brownfield projects run /prime-codebase first, then invoke the skill with no arguments to derive rules from the loaded codebase.

What should go into a CLAUDE.md or AGENTS.md file?▼

Include four things: a map of the important directories and files, specific ground rules and conventions, the real lint/test/type-check commands the agent should run, and working principles describing how the agent should operate. Everything else loads on demand.

Should I use CLAUDE.md or AGENTS.md for my project rules?▼

Use CLAUDE.md for Claude-Code-only projects and AGENTS.md when the team uses multiple AI tools, since AGENTS.md is an open cross-tool standard. If both exist, keep shared content in AGENTS.md and make CLAUDE.md a single @AGENTS.md import line.

Can I generate rules from an existing codebase without a spec?▼

Yes, that is the brownfield lane. Run /prime-codebase first so the code structure is loaded into the conversation, or pass a codebase-analysis document for large repos. Every derived rule must be traceable to an actual file.

Will this skill overwrite my existing CLAUDE.md?▼

It can, so the skill instructs you to back up any existing rules file first, for example by renaming it to CLAUDE.md.bak. Better, feed the existing file in as input so the derivation builds on what you already wrote.

Why should rules not be derived from a PRD?▼

A PRD captures product intent, the what and why, not technical decisions. Global rules encode technical truth, so they derive from the architecture spec in greenfield work or from observed code in brownfield work, with the PRD used only as context.