scan-codebase
Skill16 starsChanged 7 months agoMITView on GitHub
Scans the current project and generates project-specific rules by reading actual code patterns, file structure, and conventions. Run automatically on first Start Session if no code-map exists. Triggers on /scan-codebase or \"scan the codebase\" or \"analyze the project\" or \"generate rules from code\".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Agenta-AI/agentatheir own version, first seen Jul 31, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Agenta-AI/agenta★ 4.9ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- actSkill
- security-checkSkill
- environment-checkSkill
- run-verificationSkill
- refactorSkill
- debug-session-archivedSkill
- generate-guardsSkill
- check-anthropicSkill
- code-reviewerSkill
- code-reviewSkill
- debug-sessionSkill
- end-sessionSkill
- evolve-checkSkill
- evolveSkill
- fix-bugSkill
- forgetSkill
- frontend-designSkill
- guardSkill
- kit-healthSkill
- learnSkill
- map-codebaseSkill
- modeSkill
- parallel-prototypesSkill
- planSkill
- powershell-safeSkill
- product-riskSkill
- progress-reportSkill
- prototype-hypothesisSkill
- recallSkill
- refactoring-uiSkill
- scan-conventionsSkill
- search-firstSkill
- search-memorySkill
- shadow-codeSkill
- skill-creatorSkill
- smart-resumeSkill
- start-sessionSkill
- strategic-compactSkill
- tourSkill
- ux-heuristicsSkill
- verification-loopSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- Distinctive: line 12
Allowed Tools: Read, Glob, Grep, Write, Bash
- Very specific: line 20
Read package/build config (pom.xml, package.json, go.mod, requirements.txt, etc.) for dependencies
- Distinctive: line 41
Document the data flow (request path from entry to database)
- Distinctive: line 44
Document ONLY patterns observed in the actual code -- do not invent conventions
- Distinctive: line 47
If a pattern appears in 3+ files, it is a convention
- Distinctive: line 48
If two conflicting patterns exist, note both and ask which to standardize on
- Distinctive: line 53
Document URL-to-file mapping if applicable (routes, pages)
- Distinctive: line 82
Never invent conventions -- only document what the code actually does
- Distinctive: line 83
If the project is too small (< 5 source files), say so and skip convention extraction
≈ “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
Skill: scan-codebase
Trigger: /scan-codebase or "scan the codebase" or "analyze the project" or "generate rules from code"
Description: Scans the current project and generates project-specific rules by reading actual code patterns, file structure, and conventions. Run automatically on first Start Session if no code-map exists.
Allowed Tools: Read, Glob, Grep, Write, Bash
Steps
1. Discover Project Structure
- Glob for all source files:
**/*.java,**/*.js,**/*.ts,**/*.py,**/*.go,**/*.html,**/*.css,**/*.sql, config files - Read package/build config (
pom.xml,package.json,go.mod,requirements.txt, etc.) for dependencies - Identify entry points, main directories, test directories
- Count files per directory to understand project shape
2. Sample Code Patterns (read 5-10 representative files)
- Pick the largest files (likely core logic)
- Pick files from different directories (coverage)
- For each file, extract:
- Naming conventions (variables, functions, classes, files)
- Import/require patterns
- Error handling patterns
- Comment style and density
- Indentation (tabs vs spaces, width)
- String quote style (single vs double)
- Function length patterns
- Any project-specific patterns that repeat across files
3. Generate .claude/rules/code-map.md
- List all major directories with purpose
- List key files with one-line descriptions
- Map entry points (API routes, main functions, page components)
- Document the data flow (request path from entry to database)
4. Generate .claude/rules/coding-conventions.md
- Document ONLY patterns observed in the actual code -- do not invent conventions
- Include copy-paste examples from real files (with file path references)
- Organize by category: naming, structure, error handling, imports, etc.
- If a pattern appears in 3+ files, it is a convention
- If two conflicting patterns exist, note both and ask which to standardize on
5. Generate .claude/rules/file-paths.md
- Map canonical locations for each file type
- Note any files that live in unexpected places
- Document URL-to-file mapping if applicable (routes, pages)
6. Update .claude/rules/protected-files.md
- Replace generic entries with actual protected files found:
- Config files (env, build config, CI)
- Migration/SQL files
- Lock files
- Generated/minified files
- Files over 1000 lines (likely core, fragile)
- Vendor/library directories
7. Update .claude/memory/decisions.md (or tasks/decisions.md if it exists)
- Replace generic template decisions with actual architectural decisions visible in the code:
- Framework and runtime (from actual imports, not guessing)
- Database (from connection strings, ORM usage)
- Auth pattern (from middleware, session handling)
- API style (from route definitions)
8. Report
- Output: "Scan complete. Generated:
- .claude/rules/code-map.md ([N] directories, [N] key files)
- .claude/rules/coding-conventions.md ([N] conventions observed)
- .claude/rules/file-paths.md ([N] paths mapped)
- .claude/rules/protected-files.md ([N] files protected)
- decisions updated ([N] decisions seeded)"
Notes
- This skill is READ-HEAVY -- it reads many files but only writes rule files
- Never invent conventions -- only document what the code actually does
- If the project is too small (< 5 source files), say so and skip convention extraction
- Re-run anytime with
/scan-codebaseto refresh after major refactors
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.

