
Learn
Analyze an existing codebase and generate Claude Code project rules in .claude/rules/ so the agent follows your real conventions.
Overview
Learn is an agent skill most often used in Build (also Operate) that analyzes your codebase and writes Claude Code project rules in .claude/rules/.
Install
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill learnWhat is this skill?
- Orchestrator coordinates context gathering, user approval, and file writes
- Delegates deep forensic analysis to a learn-analyst sub-agent
- Discovers conventions, architecture patterns, and coding standards from the tree
- Filters and ranks findings before persisting to .claude/rules/
- Supports explicit triggers like learn from project and extract project rules
- Two-agent architecture: orchestrator plus learn-analyst sub-agent
Adoption & trust: 736 installs on skills.sh; 271 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your coding agent keeps inventing patterns that do not match how this repository actually works.
Who is it for?
Solo builders adopting Claude Code on an existing repo who want auto-generated rules from real code rather than generic prompts.
Skip if: Greenfield projects with no code to analyze yet, or teams that already maintain complete rule packs they will not reconcile with agent proposals.
When should I use this skill?
When the user asks to learn from project, extract project rules, analyze codebase conventions, discover project patterns, or auto-generate Claude Code rules.
What do I get? / Deliverables
You get reviewed, persisted `.claude/rules/` files encoding discovered conventions so later agent sessions follow project-specific standards.
- Filtered, ranked convention findings for user approval
- Persisted rule files under .claude/rules/
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
First canonical shelf is Build/agent-tooling because the primary deliverable is durable agent configuration derived from the repo. Agent-tooling is where procedural rules and orchestrator/sub-agent workflows for Claude Code live.
Where it fits
Generate .claude/rules/ before the agent implements features in a mature monorepo.
Capture undocumented architectural decisions as machine-readable rules for future PRs.
Re-learn conventions after a large migration so agents stop using deprecated patterns.
Clarify how the codebase is actually structured before committing to a prototype direction.
How it compares
Use instead of manually authoring every .claude/rules/ file from scratch; it is a discovery workflow, not a one-shot code generator.
Common Questions / FAQ
Who is learn for?
Solo and indie developers using Claude Code who want the agent to inherit architecture, naming, and workflow conventions extracted from their current repository.
When should I use learn?
Use when you ask to learn from the project, extract project rules, discover patterns, or auto-generate rules—typically at Build onboarding, after major refactors, or during Operate iteration when standards drift.
Is learn safe to install?
Check the Security Audits panel on this page; the skill uses Read, Write, Edit, Bash, Glob, Grep, and Task tooling to scan and write rules—review proposed files before accepting persistence.
SKILL.md
READMESKILL.md - Learn
# Learn Autonomously analyzes a project's codebase to discover development patterns, conventions, and architectural decisions, then generates project rule files in `.claude/rules/` for Claude Code to follow. ## Overview This skill acts as the **Orchestrator** in a two-agent architecture. It coordinates the overall workflow: gathering project context, delegating deep analysis to the `learn-analyst` sub-agent, filtering and ranking results, presenting findings to the user, and persisting approved rules to `.claude/rules/`. The separation of concerns ensures the analyst operates with a focused forensic prompt while the orchestrator manages user interaction and file persistence. ## When to Use Use this skill when: - User asks to "learn from this project" or "understand project conventions" - User wants to auto-generate `.claude/rules/` files from the existing codebase - User asks to "extract project rules" or "discover patterns" - User wants Claude Code to learn the project's coding standards - After joining a new project and wanting to codify existing conventions - Before starting a large feature to ensure Claude follows project patterns **Trigger phrases:** "learn from project", "extract rules", "analyze conventions", "discover patterns", "generate project rules", "learn codebase", "auto-generate rules" ## Instructions ### Phase 1: Project Context Assessment Before delegating to the analyst, gather high-level project context: 1. **Verify project root**: Confirm the current working directory is a project root (has `package.json`, `pom.xml`, `pyproject.toml`, `go.mod`, `.git/`, or similar markers) 2. **Check existing rules**: Scan for pre-existing rule files to understand what is already documented: ```bash # Check for existing rules ls -la .claude/rules/ 2>/dev/null || echo "No .claude/rules/ directory found" cat CLAUDE.md 2>/dev/null || echo "No CLAUDE.md found" cat AGENTS.md 2>/dev/null || echo "No AGENTS.md found" ls -la .cursorrules 2>/dev/null || echo "No .cursorrules found" ``` 3. **Assess project size**: Get a quick overview of the project scope: ```bash # Quick project overview find . -maxdepth 1 -type f -name "*.json" -o -name "*.toml" -o -name "*.xml" -o -name "*.gradle*" -o -name "Makefile" -o -name "*.yaml" -o -name "*.yml" | head -20 find . -type f -name "*.ts" -o -name "*.js" -o -name "*.java" -o -name "*.py" -o -name "*.go" -o -name "*.php" | wc -l ``` 4. **Inform the user**: Briefly tell the user what you found and that you are about to start analysis: - "I found a [TypeScript/NestJS] project with [N] source files and [M] existing rules. Starting deep analysis..." ### Phase 2: Delegate to Analyst Sub-Agent Invoke the `learn-analyst` sub-agent to perform the deep codebase analysis. Use the **Task tool** to delegate analysis to the `learn-analyst` agent: - **Agent**: `learn-analyst` - **Prompt**: "Analyze the codebase in the current working directory. Follow your full process: discovery, pattern extraction, classification, and prioritization. Return your findings as a JSON report." - **Mode**: Run synchronously to receive the JSON report directly The analyst will return a structured JSON report with classified findings. ### Phase 3: Review and Filter Results Process the analyst's report: 1. **Parse the JSON report** returned by the analyst 2. **Validate findings**: Ensure each finding has: - A clear title - Evidence from at least 2 files - Impact score ≥ 4 (discard low-impact