inject-docs
Skill8 starsChanged 48 days agoMITView on GitHub
Inject compressed framework-specific best practices and docs into
- Pipes a download into a shell
- Installs packages
In this repository53 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- anything-to-skillSkill
- ci-generateSkill
- ci-localSkill
- clotho-researchSkill
- codex-imagegenSkill
- create-ruleSkill
- create-skillSkill
- db-migrateSkill
- docker-initSkill
- docs-adrSkill
- docs-checkSkill
- docs-diagramSkill
- docs-initSkill
- docs-rfcSkill
- docs-updateSkill
- env-setupSkill
- find-skillsSkill
- fix-bugSkill
- git-commitSkill
- git-create-prSkill
- gitflowSkill
- git-releaseSkill
- git-syncSkill
- i18n-checkSkill
- implement-featureSkill
- improve-skillSkill
- jira-cliSkill
- motion-studioSkill
- optimize-ai-setupSkill
- orchestrateSkill
- oss-launchSkill
- prd-to-issuesSkill
- product-design-specSkill
- product-design-tokensSkill
- product-prdSkill
- project-illustratorSkill
- project-plannerSkill
- refactorSkill
- renderSkill
- review-codeSkill
- review-depsSkill
- review-designSkill
- review-perfSkill
- review-planSkill
- review-securitySkill
- shipSkill
- stopslopSkill
- test-suiteSkill
- vrt-checkSkill
- wtfSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Auto-detect the framework: before running anything - check project files to identify the framework
- Very specific: line 35
Do NOT assume tools are available: - verify Node.js/Python tooling exists based on framework
- Distinctive: line 43
Before running anything, auto-detect the framework and verify prerequisites:
- Very specific: line 46
Check for package.json with next dependency → Next.js project
- Very specific: line 47
Check for pyproject.toml with fastapi dependency → FastAPI project
- Very specific: line 48
Check for requirements.txt containing fastapi → FastAPI project
- Distinctive: line 49
If multiple frameworks detected, prioritize based on arguments or ask user
- Very specific: line 50
If no framework detected, STOP and inform the user: "Could not detect a supported framework (Next.js or FastAPI)."
- Distinctive: line 58
Check if CLAUDE.md exists in the project root - use CLAUDE.md
- Distinctive: line 60
If neither exists, default to CLAUDE.md (Claude Code's native format)
- Very specific: line 107
Confirm the target file was updated: - read it back and check it contains the injected framework content (pipe-delimited Next.js index, or …
- Distinctive: line 109
Do not report success on command exit code alone: verify the content actually landed.
≈ “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
Framework Documentation Injector
Inject compressed framework-specific best practices and documentation into the current project's CLAUDE.md or AGENTS.md file. This gives AI coding agents passive access to framework knowledge without requiring tool calls or skills.
Supported Frameworks
| Framework | Detection Method | Documentation Source |
| Next.js | next in package.json | Vercel's agents-md codemod (version-aware) |
| FastAPI | fastapi in requirements.txt/pyproject.toml | zhanymkanov/fastapi-best-practices |
Anti-hallucination guidelines
CRITICAL:
- Auto-detect the framework before running anything - check project files to identify the framework
- Do NOT assume tools are available - verify Node.js/Python tooling exists based on framework
- Do NOT claim success until verifying the target file exists and contains actual content
- Read actual output - report what the commands say, not what is expected
Implementation Workflow
Phase 0: Framework Detection & Validation (REQUIRED)
Before running anything, auto-detect the framework and verify prerequisites:
- Detect the framework:
- Check for
package.jsonwithnextdependency → Next.js project - Check for
pyproject.tomlwithfastapidependency → FastAPI project - Check for
requirements.txtcontainingfastapi→ FastAPI project - If multiple frameworks detected, prioritize based on arguments or ask user
- If no framework detected, STOP and inform the user: "Could not detect a supported framework (Next.js or FastAPI)."
- Check for
- Detect framework version (if applicable):
- For Next.js: extract version from
package.json - For FastAPI: extract version from
pyproject.tomlorrequirements.txt - Report the detected version to the user
- For Next.js: extract version from
- Detect target file:
- Check if
CLAUDE.mdexists in the project root - useCLAUDE.md - Else check if
AGENTS.mdexists - useAGENTS.md - If neither exists, default to
CLAUDE.md(Claude Code's native format) - Inform the user which file will be updated
- Check if
Phase 1: Run framework-specific injection
Option A: Next.js Projects
Execute the Vercel codemod with the --output flag, in the project root. Requires Node.js (npx ships with it; install via fnm install --lts or brew install node):
npx @next/codemod@canary agents-md --output <TARGET_FILE>Where <TARGET_FILE> is the file detected in Phase 0 (e.g., CLAUDE.md or AGENTS.md).
What this does:
- Auto-detects the Next.js version from package.json
- Downloads version-matching documentation from Vercel's servers
- Injects a compressed pipe-delimited index into the target file
- Downloads full docs to
.next-docs/and adds it to.gitignore - Non-interactive mode (no prompts, thanks to
--output)
Important:
- Requires network access
- Non-destructive: injects/updates the index section without overwriting existing content
- Compresses ~40KB of docs into ~8KB (Vercel's agent evals showed 100% pass rate vs 53% baseline)
- Target file priority: CLAUDE.md (if exists) → AGENTS.md (if exists) → CLAUDE.md (default)
Option B: FastAPI Projects
Requires uv (curl -LsSf https://astral.sh/uv/install.sh | sh or brew install uv). Run the bundled injection script using this skill's own absolute directory path, not $(dirname "$0"). That trick resolves against the shell's path when run through the Bash tool, not this SKILL.md's location, so it silently points at the wrong (or a nonexistent) script. Use the directory this SKILL.md was loaded from instead:
uv run <absolute-path-to-this-skill-dir>/scripts/inject_fastapi_docs.pyThe script:
- Detects whether
CLAUDE.mdorAGENTS.mdexists and targets the right file - Checks if a "FastAPI Best Practices" section already exists (updates it if so, appends if not)
- Injects compressed best practices covering: domain-driven structure, async patterns, Pydantic validation, dependency injection, SQLAlchemy integration, error handling, testing, and Ruff code quality
See references/fastapi-best-practices.md for the exact content injected.
Phase 2: Verify Results
After Phase 1 completes:
- Confirm the target file was updated - read it back and check it contains the injected framework content (pipe-delimited Next.js index, or the
## FastAPI Best Practicessection) - Check size - note the approximate size before/after (Next.js codemod prints this; for FastAPI, compare file sizes yourself)
- Do not report success on command exit code alone: verify the content actually landed.
Phase 3: Report
Summarize for the user:
- Framework and version detected
- Which file was updated (CLAUDE.md or AGENTS.md), created vs. updated
- Confirmation that framework docs were injected, with approximate size
- Suggest reviewing the diff and committing
Examples
Next.js project with existing CLAUDE.md
> inject Next.js docs
Detected Next.js 15.2.3 in package.json
Found existing CLAUDE.md - will inject documentation there
Running: npx @next/codemod@canary agents-md --output CLAUDE.md
Updated CLAUDE.md (2.1 KB -> 10.3 KB)
Added .next-docs to .gitignore
Review the changes and commit when ready:
git add CLAUDE.md .gitignore && git commit -m "docs: add Next.js agents-md framework reference"FastAPI project with no existing docs file
> inject FastAPI best practices
Detected FastAPI 0.115.0 in pyproject.toml
No CLAUDE.md or AGENTS.md found - creating CLAUDE.md
Ran scripts/inject_fastapi_docs.py
Created CLAUDE.md (0 B -> 6.8 KB) with "FastAPI Best Practices" section
Review the changes and commit when ready:
git add CLAUDE.md && git commit -m "docs: add FastAPI best-practices reference"Unsupported framework
> inject docs for this Django app
Checked package.json, pyproject.toml, requirements.txt - no `next` or
`fastapi` dependency found.
Could not detect a supported framework (Next.js or FastAPI). This skill
only injects docs for those two. No files were changed.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.

