ClaudeForge / skill
CLAUDE.md429 starsChanged 11 months agoMITView on GitHub
Parent context: see the root CLAUDE.md for project-wide guidelines and behavioural rules. Chained import: @../CLAUDE.md Guidelines for the claudeforge-skill Python modules and the karpathy-guidelines skill. Five modules live under skill/: Every generated CLAUDE.md must contain: calculate_quality_score() breakdown: skill/workflow.py → _detect_tech_stack() reads these signals: Add new detectors there, not in the template selector. skill/karpathy-guidelines/SKILL.md is the standalone skill installed at ~/.claude/skills/karpathy-guidelines/. Adapted with attribution from the MIT-licensed [forrestchang/andrej-karpathy-skills](https://github.com/forrestchan
In this repository5 other files it gives its agents.
- agent/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- command/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- claude-md-enhancerSkill
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Every generated CLAUDE.md must contain:
- Very specific: line 49
Run the smoke test (see docs/CLAUDE.md → Testing & Validation).
- Very specific: line 51
Test slash command: /enhance-claude-md.
- Very specific: line 57
Add a new file under skill/examples/.
- Distinctive: line 58
Follow the native format (project structure, setup, architecture, tech guidelines).
- Very specific: line 61
Add a scenario to skill/sample_input.json.
- Distinctive: line 81
Add new detectors there, not in the template selector.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md 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
Parent context: see the root CLAUDE.md for project-wide guidelines and behavioural rules. Chained import:
@../CLAUDE.md
Skill Development
Guidelines for the claudeforge-skill Python modules and the karpathy-guidelines skill.
Component Interaction Flow
User Project
↓
/enhance-claude-md (Slash Command) → Explore subagent (deep scan)
↓
[Discovery] → [Analysis] → [Task]
↓
claude-md-guardian (Agent) OR Direct Skill Invocation
↓
claudeforge-skill (Python Modules)
↓
workflow.py → analyzer.py → validator.py → template_selector.py → generator.py
↓
CLAUDE.md ≤ 150 lines, chained via `@path` importsPython Module Architecture
Five modules live under skill/:
workflow.py—InitializationWorkflow: orchestrates interactive setup, detects project type / tech stack / team size / phase / workflows, returns a context dict.analyzer.py—CLAUDEMDAnalyzer: analyses existing files; quality scoring (0–100) across length, completeness, formatting, specificity, modularity.validator.py—BestPracticesValidator: checks file length (hard cap 150, warning at 120), required sections, formatting, anti-patterns.template_selector.py—TemplateSelector: maps project type + team size to a template; all team-size targets are ≤ 150 lines.generator.py—ContentGenerator: writes root + context files, emits@pathchain imports, prepends sub-file back-links, idempotentmerge_with_existing. Also exposesgenerate_rules_file(name, description, paths, body)for path-scoped.claude/rules/*.mdfiles (loaded lazily by Claude when accessed files match thepaths:globs) and prepends@AGENTS.md-style imports whenproject_context['existing_instruction_files']lists sibling instruction files.
Required Output Sections
Every generated CLAUDE.md must contain:
- Project structure (ASCII tree, for projects that need it)
- Setup & installation
- Architecture (for non-trivial projects)
## Behavioral Guidelines(Karpathy summary — inserted automatically)- Cross-check against reference examples in
skill/examples/
Modifying Python Modules
- Edit files in
skill/. - Run the smoke test (see
docs/CLAUDE.md→ Testing & Validation). - Re-install for live testing:
./install.sh(project-level scope). - Test slash command:
/enhance-claude-md. - Validate output against
skill/examples/. - Update
CHANGELOG.md.
Adding Reference Templates
- Add a new file under
skill/examples/. - Follow the native format (project structure, setup, architecture, tech guidelines).
- Update
skill/examples/README.md. - Teach
template_selector.pyhow to detect the new template. - Add a scenario to
skill/sample_input.json.
Quality Scoring (analyzer.py)
calculate_quality_score() breakdown:
- length_appropriateness: 25 pts (50–150 lines ideal; the 150-line hard cap is enforced here)
- section_completeness: 25 pts (required sections present)
- formatting_quality: 20 pts (markdown, heading hierarchy, code blocks)
- content_specificity: 15 pts (project-specific, not generic)
- modular_organization: 15 pts (chained sub-files when needed)
Tech Stack Detection
skill/workflow.py → _detect_tech_stack() reads these signals:
- Frontend — React/Vue/Angular via
package.json; Angular viaangular.json; TypeScript viatsconfig.json. - Backend — Node (
package.json), Python (requirements.txt/pyproject.toml/setup.py), Go (go.mod), Java (pom.xml/build.gradle), Rust (Cargo.toml). - Database — Postgres (
pg/psycopg2), MongoDB (mongoose/pymongo), Redis (redis/ioredis).
Add new detectors there, not in the template selector.
Karpathy Guidelines Skill
skill/karpathy-guidelines/SKILL.md is the standalone skill installed at ~/.claude/skills/karpathy-guidelines/. Adapted with attribution from the MIT-licensed forrestchang/andrej-karpathy-skills repo. The four principles are inserted automatically into every generated CLAUDE.md via template_selector._generate_karpathy_guidelines() and generator._generate_karpathy_guidelines(). Do not strip the embedded section during enhancement.
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.

