plugins/developer-kit-core/skills/learn/SKILL.md
Provides autonomous project pattern learning by analyzing the codebase to discover development conventions, architectural patterns, and coding standards, then generates project rule files in .claude/rules/. Use when user asks to "learn from project", "extract project rules", "analyze codebase conventions", "discover project patterns", or wants to auto-generate Claude Code rules for the current project.
npx skillsauth add giuseppe-trisciuoglio/developer-kit learnInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
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.
Use this skill when:
.claude/rules/ files from the existing codebaseTrigger phrases: "learn from project", "extract rules", "analyze conventions", "discover patterns", "generate project rules", "learn codebase", "auto-generate rules"
Before delegating to the analyst, gather high-level project context:
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)
Check existing rules: Scan for pre-existing rule files to understand what is already documented:
# 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"
# 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
Invoke the learn-analyst sub-agent to perform the deep codebase analysis.
Use the Task tool to delegate analysis to the learn-analyst agent:
learn-analystThe analyst will return a structured JSON report with classified findings.
Process the analyst's report:
.claude/rules/ files. Skip findings that duplicate existing rules.Present the filtered findings to the user in a clear, structured format:
I analyzed your codebase and found N patterns worth documenting as project rules:
1. **[RULE]** <Title> (Impact: X/10)
<One-line explanation>
2. **[RULE]** <Title> (Impact: X/10)
<One-line explanation>
3. **[RULE]** <Title> (Impact: X/10)
<One-line explanation>
Then ask the user for confirmation using AskUserQuestion:
For each approved rule:
mkdir -p .claude/rules
Generate the file name: Use the finding's title field converted to kebab-case:
"API Response Envelope Convention" → api-response-envelope-convention.mdrule-1.md or learned-pattern.mdCheck for conflicts: Before writing, check if a file with the same name already exists:
Write the rule file: Create the file in .claude/rules/ with the analyst's pre-formatted content
Confirm to user: After saving, list all created files:
✅ Rules saved successfully:
.claude/rules/api-response-envelope-convention.md
.claude/rules/feature-based-module-organization.md
.claude/rules/test-factory-pattern.md
These rules will be automatically applied by Claude Code in future sessions.
.claude/rules/ files are project-specific and should be version-controlled so the whole team benefits.claude/rules/ in the current project directory, never to global paths.claude/rules/, the skill may find few or no new patterns. This is expected.User request: "Learn from this project"
Phase 1 — Context assessment:
Found: TypeScript/NestJS project with 142 source files
Existing rules: 0 files in .claude/rules/
Starting deep analysis...
Phase 4 — Presentation:
I analyzed your codebase and found 3 patterns worth documenting as project rules:
1. **[RULE]** Feature-Based Module Organization (Impact: 9/10)
All modules follow src/modules/<feature>/ with controller, service, dto, entity subdirectories.
2. **[RULE]** DTO Validation Convention (Impact: 8/10)
All DTOs use class-validator decorators and follow Create/Update naming pattern.
3. **[RULE]** Error Response Envelope (Impact: 7/10)
All API errors return { statusCode, message, error } consistent envelope format.
Save all 3 rules? [Save all / Let me choose / Cancel]
Phase 5 — Persistence:
✅ Rules saved successfully:
.claude/rules/feature-based-module-organization.md
.claude/rules/dto-validation-convention.md
.claude/rules/error-response-envelope.md
These rules will be automatically applied by Claude Code in future sessions.
User request: "Discover project patterns"
Phase 1 — Context assessment:
Found: Java/Spring Boot project with 87 source files
Existing rules: 4 files in .claude/rules/
Starting deep analysis...
Phase 3 — After filtering:
The analyst found 6 patterns, but 4 overlap with your existing rules.
After deduplication, 2 new patterns remain:
1. **[RULE]** Repository Method Naming (Impact: 7/10)
All custom repository methods use findBy/existsBy/countBy prefix convention.
2. **[RULE]** Integration Test Database Strategy (Impact: 6/10)
Integration tests use @Testcontainers with PostgreSQL and @Sql for fixtures.
Save these 2 rules? [Save all / Let me choose / Cancel]
development
Provides security review capability for TypeScript/Node.js applications, validates code against XSS, injection, CSRF, JWT/OAuth2 flaws, dependency CVEs, and secrets exposure. Use when performing security audits, before deployment, reviewing authentication/authorization implementations, or ensuring OWASP compliance for Express, NestJS, and Next.js. Triggers on "security review", "check for security issues", "TypeScript security audit".
development
Provides final code cleanup after task review approval. Removes debug logs, temporary comments, dead code, optimizes imports, and improves readability. Use when asked to clean up code, polish, finalize, tidy up, remove technical debt, or prepare code for completion after review. Not for refactoring logic or fixing bugs—focused solely on cosmetic and hygiene cleanup.
tools
Ralph Wiggum-inspired automation loop for specification-driven development. Orchestrates task implementation, review, cleanup, and synchronization using a Python script. Use when: user runs /loop command, user asks to automate task implementation, user wants to iterate through spec tasks step-by-step, or user wants to run development workflow automation with context window management. One step per invocation. State machine: init → choose_task → implementation → review → fix → cleanup → sync → update_done. Supports --from-task and --to-task for task range filtering. State persisted in fix_plan.json.
testing
Creates, updates, validates, and displays the architectural DNA of a project through two shared documents: docs/specs/architecture.md (technology stack, architectural rules, security constraints, AI guardrails) and docs/specs/ontology.md (domain glossary / Ubiquitous Language). Use BEFORE brainstorm as a project setup step, or at any point in the SDD lifecycle to validate specs/tasks against architecture principles. Triggers on 'create constitution', 'update constitution', 'constitution check', 'validate against constitution', 'project principles', 'architectural guardrails', 'setup project architecture', 'define ontology'.