code-inventory
Skill4 starsChanged 6 days agoMITView on GitHub
Inventories a code folder in any language used for economic models: languages, files, call graph, data in and out, packages, risky constructs, entry points and translation order.
In this repository210 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/ai-ml-code.mdcCursor rule
- .cursor/rules/code-translation.mdcCursor rule
- .cursor/rules/data-pipelines.mdcCursor rule
- .cursor/rules/documentation.mdcCursor rule
- .cursor/rules/dsge-code.mdcCursor rule
- .cursor/rules/econometrics-code.mdcCursor rule
- .cursor/rules/eviews-code.mdcCursor rule
- .cursor/rules/forecasts.mdcCursor rule
- .cursor/rules/gempack-code.mdcCursor rule
- .cursor/rules/lego-manifests.mdcCursor rule
- .cursor/rules/llm-code.mdcCursor rule
- .cursor/rules/model-code.mdcCursor rule
- .cursor/rules/notebooks-and-scripts.mdcCursor rule
- .cursor/rules/r-code.mdcCursor rule
- .cursor/rules/restricted-data.mdcCursor rule
- .cursor/rules/rl-code.mdcCursor rule
- .cursor/rules/sectoral-trade-climate-code.mdcCursor rule
- .cursor/rules/semi-structural-code.mdcCursor rule
- .cursor/rules/stata-code.mdcCursor rule
- .cursor/rules/tests.mdcCursor rule
- .cursor/rules/validation.mdcCursor rule
- adoptSkill
- ai-auditSkill
- backtestSkill
- build-abmSkill
- build-causal-mlSkill
- build-cgeSkill
- build-climate-macroSkill
- build-deep-forecasterSkill
- build-drl-policySkill
- build-dsgeSkill
- build-financial-programmingSkill
- build-fpasSkill
- build-game-modelSkill
- build-hankSkill
- build-io-samSkill
- build-llm-agentsSkill
- build-llm-pipelineSkill
- build-multicountrySkill
- build-neural-solverSkill
- build-rag-kbSkill
- build-semi-structuralSkill
- build-sfcSkill
- build-trade-modelSkill
- calibrate-modelSkill
- calibration-planSkill
- carbon-pricing-analysisSkill
- chart-packSkill
- climate-scenarioSkill
- code-reviewSkill
- country-typologySkill
- create-exerciseSkill
- data-requirementsSkill
- debt-decompositionSkill
- debt-sustainabilitySkill
- design-trainingSkill
- distributional-analysisSkill
- equivalence-testSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Very specific: line 25
If it is ABSENT, ask for it.
- Very specific: line 27
Collaboration: Follow .claude/docs/collaboration-protocol.md: ask questions first, present options, get approval before writing files, and …
- Very specific: line 36
Run python tools/translate.py inventory <source-folder> (add --out <folder> to save inventory.md and inventory.json).
- Very specific: line 37
Read the entry points and follow the calls.
- Distinctive: line 43
After the scan: confirm the entry points and the outputs that matter
- Distinctive: line 56
Every file classified (code by language, data, other)
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
<!-- Generated from .claude/skills/code-inventory/SKILL.md by tools/sync_agents.py. Edit the source, then run the script. -->/code-inventory — Code Inventory
Category: Code Translation · Primary agent: source-code-analyst
Inventories a code folder in any language used for economic models: languages, files, call graph, data in and out, packages, risky constructs, entry points and translation order.
Arguments: whatever the user wrote after the command name.
Purpose
Find out what a code folder contains before anyone translates, adopts or validates it. The automatic scan (python tools/translate.py inventory) detects the language of each file (including shared extensions such as .m, .mod, .prg, .src, .inp), lines of code, the files each one calls, data files it reads and writes, packages, constructs that often change results when code moves (missing-value rules, unstable sorts, implicit typing, packed decimals, global state, random draws, absolute paths), entry points and an order in which called files come first. The analyst then reads the code to confirm and complete it.
Use it when you receive code you did not write, before /translate-code or /adopt, or to size a migration.
Do not use it when the full translation is wanted now; /translate-code runs the inventory as its first step.
Before you start
- Check required inputs. For each input below record
FOUNDorABSENT(never 'assumed'):- Source folder (a path, or an uploaded folder copied to
translations/incoming/<name>/) If it isABSENT, ask for it.
- Source folder (a path, or an uploaded folder copied to
- Check confidentiality. Identify the classification of the code and any data in the folder (
.claude/docs/confidentiality-and-ai-use.md). The scan reads files locally; restricted content is not quoted into prompts or external services. - Collaboration. Follow
.claude/docs/collaboration-protocol.md: ask questions first, present options, get approval before writing files, and updateproduction/session-state/active.mdafter each approved section.
Agents
source-code-analyst— primary agent; runs and confirms the inventorycode-translation-architect— Sizes the work and suggests targets if a translation follows
Each agent is defined in .claude/agents/<name>.md. If your tool runs subagents, run these agents as subagents, in parallel where the steps are independent; otherwise read each agent's file and apply its instructions in turn. Subagents only write to the paths named in your instructions.
Workflow
- Run
python tools/translate.py inventory <source-folder>(add--out <folder>to saveinventory.mdandinventory.json). - Read the entry points and follow the calls; add dependencies the scan cannot see (macros,
eval, file names in variables, ado-files, toolboxes, libraries, copybooks, Excel links). - For spreadsheets, list the formulas behind calculation sheets with
python tools/intake.py formulas <file> --sheet <name>. - Mark dead code, one-off scripts and tests; list missing inputs.
- Summarize: languages and size, what the code produces, external dependencies, risky constructs, and the effort to translate to the likely targets.
Checkpoints with the user
- After the scan: confirm the entry points and the outputs that matter
Common pitfalls
- Treating the automatic call graph as complete
- Missing data or code the folder expects but does not contain
- Reading comments as facts about behavior
Output
translations/<name>-inventory/inventory.md (or inside the translation workspace when part of /translate-code)
The inventory lists languages, files in translation order, calls, data in and out, packages, constructs to check, entry points, data files and missing pieces.
Gate / verdict
- Every file classified (code by language, data, other)
- Entry points and key outputs confirmed by reading the code
Suggested next steps
/translation-plan/translate-code/adopt
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.

