juicesharp/rpiv-mono/annotate-inline
Claude Code and agent skill by juicesharp/rpiv-mono
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Generate CLAUDE.md files placed inline next to source code across a project, documenting architecture and patterns for AI assistants. Use when the user wants to onboard Claude to a codebase via inline CLAUDE.md files, generate per-directory guidance, document architecture in-place, or asks to "annotate inline". Prefer this over annotate-guidance when CLAUDE.md should live alongside the code rather than in a shadow tree.
Install
npx vskill@latest install juicesharp/rpiv-mono/annotate-inlineSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as juicesharp/rpiv-mono/annotate-inline.
Annotate Inline
You are tasked with generating CLAUDE.md files across a brownfield project. You will map the project structure, auto-detect its architecture, analyze each architectural layer, and batch-write compact CLAUDE.md files at the root and relevant subdirectories.
Input
$ARGUMENTS — optional target directory. Defaults to the current working directory.
Steps to follow:
- Read any directly mentioned files first:
- If the user mentions specific files (existing CLAUDE.md, architecture docs, READMEs), read them FULLY first
- IMPORTANT: Use the Read tool WITHOUT limit/offset parameters to read entire files
- CRITICAL: Read these files yourself in the main context before invoking any skills
- This ensures you have full context before decomposing the work
- Pass 1 — Map the project (parallel agents):
- Spawn the following agents in parallel using the Agent tool:
Agent A — Project tree mapping:
- subagent_type:
codebase-locator - Prompt: "Map the full project tree structure for {target directory}. List all directories and their contents, respecting .gitignore. Focus on source code directories, configuration files, and build artifacts. Return a complete tree view."
Agent B — Architecture and conventions:
- subagent_type:
codebase-locator - Prompt: "Identify the architectural layout of {target directory} from path shape and manifest files — NO content analysis. Detect: (1) Architecture pattern inferred from folder shape — clean-arch via Domain/Application/Infrastructure dirs; MVC via Controllers/Models/Views; monorepo via packages/ + workspaces; microservices via services/ with individual manifests; hexagonal via ports/adapters. (2) Main layers/modules — top-level source directories + their names. (3) Frameworks and languages from manifest files (package.json dependencies, *.csproj TargetFramework, pyproject.toml, go.mod, Cargo.toml) and file extensions. (4) Build system from build-config filenames (vite/webpack/tsup/esbuild configs, Makefile, nx.json, turbo.json, dotnet .sln). For each main layer/module, check sub-directory composition. If sub-directories with distinct names/roles exist, flag each as a CLAUDE.md target candidate with: (a) path, (b) role inferred from folder name (controllers/, services/, entities/, components/, stores/, etc.), (c) file count via ls, (d) how its sub-directory composition differs from sibling layers. Use grep/find/ls only. Do not read file contents. Pass 2 runs codebase-analyzer + codebase-pattern-finder per target folder for deep analysis."
- While agents run, read .gitignore yourself to understand exclusion rules
- Wait for Pass 1 and determine CLAUDE.md targets:
- IMPORTANT: Wait for ALL agents from Pass 1 to complete before proceeding
- Synthesize the tree structure and architecture findings
- Auto-detect the architecture pattern (clean architecture, MVC, monorepo, microservices, etc.)
- Determine CLAUDE.md targets using a two-pass process:
Initial pass — identify top-level targets:
- Apply the CLAUDE.md Depth Rules (see below) to top-level architectural layers
- This produces the initial target list (one per distinct layer/project)
Decomposition pass — expand composite targets (ADD, never REPLACE):
- For EACH initial target, review Agent B's sub-layer candidates
- If Agent B flagged sub-layers with distinct roles and file counts >10, ADD them as separate CLAUDE.md targets alongside the parent — the parent stays in the list as an overview, sub-layers are added beneath it
- NEVER remove the parent when promoting sub-layers — decomposition expands the target list, it does not substitute entries
- Do NOT apply a blanket "sub-folders same as parent" skip — evaluate each sub-layer Agent B flagged individually against the Depth Rules
- Common decompositions: Angular/React/Vue apps → components/, services/, shared/; monorepo packages → per-package; large shared libraries → per-concern
- Present the proposed CLAUDE.md locations to the user:
``` ## Proposed CLAUDE.md Locations
Architecture detected: {pattern name}
### Will create CLAUDE.md in:
/(root) — Project overview (compact)/src/core/— Core domain layer/src/services/— Service layer- {etc.}
### Will skip:
/src/core/entities/— Entity grouping, same pattern as parent- {etc.}
Does this look right? Should I add or remove any locations? ```
- Use the
ask_user_questiontool with the following question: "{N} CLAUDE.md targets across {M} layers. Proceed with analysis?". Options: "Proceed (Recommended)" (Analyze all proposed folders and write CLAUDE.md files); "Add folders" (I want to add more folders to the target list); "Remove folders" (Some proposed folders should be skipped). - Adjust the target list based on user feedback
- Pass 2 — Analyze each layer (parallel analyzer agents):
- For each confirmed target folder, spawn agents in parallel using the Agent tool:
For each target folder, spawn TWO agents:
Analyzer agent:
- subagent_type:
codebase-analyzer - Prompt: "Analyze {folder path} in detail. Determine: 1) What is this layer's responsibility? 2) What are its dependencies (what does it import/use)? 3) Who consumes it (what imports/uses it)? 4) What are the key architectural boundaries and constraints? 5) What is the module structure — list DIRECTORIES with their roles, base types, and naming conventions. Use architectural annotations (e.g., 'one repo per entity', 'one controller per resource') instead of listing individual filenames. The structure should remain valid when non-architectural files are added. 6) What naming conventions are used (prefixes, suffixes, base classes)?"
Pattern finder agent:
- subagent_type:
codebase-pattern-finder - Prompt: "Find all distinct code patterns used in {folder path}. For each pattern found: 1) Name the pattern with a descriptive heading (e.g., 'Repository Boundary (CRITICAL: Plain Types, NOT Result<T>)'). 2) Provide an IDIOMATIC code example — a generalized, representative version that shows the pattern's essential shape (constructor, key method signatures, return types, error handling). Do NOT copy-paste a single file verbatim; instead synthesize the typical usage across the layer. 3) Add inline comments highlighting important conventions (e.g., '// DB int → boolean', '// throws on error — service wraps in Result'). 4) If the pattern involves a boundary between layers, show both sides. 5) Identify any repeatable workflows for adding new elements to this layer — backend entities (repositories, services, controllers) AND frontend elements (components, services, pages/routes, directives). For example: creating a new repository requires extending BaseRepository + registering in factory; adding a new Angular component requires extending BaseComponent + adding to routes + creating the template. Return these as step-by-step checklists. Return patterns with full code block examples."
- Emit 1 analyzer + 1 pattern finder per folder as separate
Agent(...)calls in the same tool-use batch - For the root CLAUDE.md, use findings from ALL folders to create the overview
- Wait for Pass 2 and synthesize:
- IMPORTANT: Wait for ALL agents from Pass 2 to complete before proceeding
- Compile all agent findings per folder
- Do NOT draft CLAUDE.md content yet — proceed to developer checkpoint first (Step 6)
- Developer checkpoint — validate findings before drafting:
Present a per-folder findings summary, then ask grounded questions. This pulls domain knowledge that agents can't discover from code alone — deprecated patterns, undocumented conventions, migration-in-progress situations, or cross-layer rules that only the developer knows.
Findings summary — one block per target folder, 2-3 lines each: ``` ## Findings Summary
### src/core/ Patterns: Repository base class, Entity base with soft-delete, Value Objects Dependencies: Database layer (outbound), Services layer (inbound) Workflows detected: "Add new entity" (5 steps), "Add new value object" (2 steps)
### src/services/ Patterns: Result<T> wrapping, Transaction scope per operation Dependencies: Core (outbound), Controllers (inbound) Workflows detected: "Add new service" (4 steps)
{etc.} ```
Then ask grounded questions — one at a time, waiting for the developer's answer before asking the next. Ask as many as the findings warrant — one per significant ambiguity or discovery gap. Use a ❓ Question: prefix. Each question must reference real findings and pull NEW information from the developer — not confirm what you already found, and not ask about cosmetic issues (typos, formatting) or absences the developer can't add context to.
Only ask questions whose answer would change what gets written in a CLAUDE.md file. Focus on:
- Competing patterns that need a canonical vs. legacy designation (which style should new code follow?)
- Cross-layer dependencies that look like violations but might be design decisions
- Undocumented architectural constraints not visible in code (ordering, idempotency, invariants)
Example grounded questions:
- "Found two different mapping approaches in
src/services/: manual mapping inOrderServiceand AutoMapper inUserService. Which is the current convention, or is there a migration in progress I should document?" - "The analyzer found no event/message patterns in
src/core/. Is domain event publishing handled elsewhere, or is it not used in this project?" - "Detected 3 different error-handling styles across layers. Is there a canonical approach, or are these intentional per-layer differences?"
CRITICAL: Ask ONE question at a time. Wait for the answer before asking the next. Lead with your most significant finding. The developer will redirect you if needed.
Choosing question format:
- `ask_user_question` tool — use
ask_user_questionwith 2-4 concrete hypotheses. State observed behavior,file:lineevidence, impact, and the decision; the automaticType something.row accepts unexpected detail.
Batching: When you have 2-4 independent questions (answers don't depend on each other), you MAY batch them in a single ask_user_question call. Keep dependent questions sequential.
Incorporate developer input:
Corrections ("that pattern is deprecated", "wrong — we use X"):
- Update synthesis. If the correction reveals a pattern that needs fresh analysis, re-prompt a targeted codebase-analyzer or codebase-pattern-finder (max 2 agents).
Missing conventions ("you missed the soft-delete convention", "all handlers must be idempotent"):
- Add directly to synthesis for the relevant folder.
Migration context ("we're moving from X to Y", "old pattern in these files, new pattern in those"):
- Record both old and new approaches in synthesis — CLAUDE.md should document the canonical (new) way with a note about the legacy approach still present in specific areas.
Scope adjustments ("skip that layer, it's being rewritten", "add src/shared/"):
- Update target list. For new targets, run a targeted Pass 2 (analyzer + pattern-finder, max 2 agents), then fold results into synthesis.
Confirmations ("looks right", "yes that's correct"):
- Proceed to drafting.
After incorporating all input, proceed to Step 7.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/rpiv-pi/skills/annotate-inline/SKILL.md
Popularity
- Repository stars
- 658
- Repository forks
- 121
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/juicesharp/rpiv-mono/annotate-inline)