source-command-create-rules
Skill0 starsChanged 6 months agoMITView on GitHub
Generate CLAUDE.md global rules from codebase analysis
In this repository55 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-developmentSkill
- agent-teamsSkill
- ai-sdkSkill
- analyzing-financial-statementsSkill
- cache-componentsSkill
- chrome-devtoolsSkill
- Codex-automation-recommenderSkill
- Codex-md-improverSkill
- code-reviewSkill
- Command DevelopmentSkill
- creating-financial-modelsSkill
- data-visualizationSkill
- debugSkill
- develop-ai-functions-exampleSkill
- evolve-ai-layerSkill
- excalidraw-diagramSkill
- find-skillsSkill
- frontend-designSkill
- Hook DevelopmentSkill
- make-skill-templateSkill
- markdown-to-htmlSkill
- mcp-builderSkill
- MCP IntegrationSkill
- pdfSkill
- playwrightSkill
- Plugin SettingsSkill
- Plugin StructureSkill
- refactorSkill
- researchSkill
- security-best-practicesSkill
- skill-creatorSkill
- Skill DevelopmentSkill
- smithery-ai-cliSkill
- source-command-commit-and-deploySkill
- source-command-commitSkill
- source-command-create-prdSkill
- source-command-empty-redeploySkill
- source-command-evaluateSkill
- source-command-executeSkill
- source-command-handoffSkill
- source-command-plan-featureSkill
- source-command-primeSkill
- source-command-reviewSkill
- source-command-self-healSkill
- source-command-validateSkill
- sql-queriesSkill
- statistical-analysisSkill
- vscode-ext-localizationSkill
- webapp-testingSkill
- web-artifacts-builderSkill
- web-design-guidelinesSkill
- Writing Hookify RulesSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when the user asks to run the migrated source command create-rules.
- Distinctive: line 21
Check for existing documentation:
- Distinctive: line 62
If this is a new project with a PRD but no code yet, spin up sub-agents to research:
- Distinctive: line 70
Write to AGENTS.md in the project root.
- Distinctive: line 72
Use this template as the output structure — fill in every section with real data from the codebase analysis:
- Distinctive: line 84
If the project has distinct subsystems, create on-demand rule files:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
source-command-create-rules
Use this skill when the user asks to run the migrated source command create-rules.
Command Template
Create Global Rules
Analyze the codebase and generate a AGENTS.md file with project-specific constraints and conventions.
Phase 1: Discover
Identify What Exists
Check for existing documentation:
PRD.md,.codex/PRD.md— product specREADME.md— project overviewpackage.json,pyproject.toml,Cargo.toml— dependenciestsconfig.json,vite.config.*,next.config.*— build config- Existing test files and patterns
- CI/CD workflows (
.github/workflows/) - Docker files
Identify Project Type
| Type | Indicators |
| Full-stack web app | Separate client/server, API routes |
| Frontend SPA | React/Vue/Svelte, no server |
| API/Backend | Express/FastAPI/etc, no frontend |
| Library/Package | exports in package.json, publishable |
| CLI Tool | bin in package.json |
| Monorepo | Multiple packages, workspaces |
Map Structure
tree -L 3 -I 'node_modules|__pycache__|.git|dist|build|.next|venv*' 2>/dev/null || find . -maxdepth 3 -type f -not -path '*/node_modules/*' -not -path '*/.git/*' | head -60Phase 2: Analyze
Extract Patterns (use sub-agents for research if needed)
From existing code, identify:
- Naming: files, functions, classes, variables
- Structure: how code is organized within files
- Errors: how errors are created and handled
- Types: how types/interfaces are defined
- Imports: relative vs absolute, named vs namespace
- Testing: framework, structure, patterns
- Logging: strategy and format
Research Best Practices
If this is a new project with a PRD but no code yet, spin up sub-agents to research:
- Testing strategy for the tech stack
- Logging best practices
- Common patterns for the framework
- Component/module organization conventions
Phase 3: Generate AGENTS.md
Write to AGENTS.md in the project root. Keep it under 500 lines.
Use this template as the output structure — fill in every section with real data from the codebase analysis:
@.codex/templates/CLAUDE-template.md
What NOT to include
- Exhaustive API documentation (put in
.codex/docs/) - Framework-specific guides (put in
.codex/rules/) - Full dependency lists (that's what package.json is for)
- Anything that isn't needed every single session
Phase 4: Create On-Demand Context (if patterns identified)
If the project has distinct subsystems, create on-demand rule files:
.codex/rules/
├── frontend.md ← component patterns, styling conventions
├── api.md ← endpoint patterns, middleware, auth
├── database.md ← query patterns, migrations, schema
└── testing.md ← mock patterns, fixtures, test utilitiesEach file should have path-scoped frontmatter:
---
paths:
- "src/frontend/**"
- "src/components/**"
---Output
Confirm:
AGENTS.mdcreated with line count- Any
.codex/rules/files created - Any
.codex/docs/files created - What to review and customize
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

