How this skill is triggered — by the user, by Claude, or both
Slash command
/archrip:archrip-scan [directory or instructions][directory or instructions]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze the current codebase and generate `.archrip/architecture.json`.
Analyze the current codebase and generate .archrip/architecture.json.
Language rule: Respond in the same language as the user's message or $ARGUMENTS. If no user text is available, detect the project's primary language from README/docs and match it. The architecture.json fields (labels, descriptions) should also use that language.
sourceUrl: Run git remote get-url origin and convert to browse URL:
[email protected]:org/repo.git → https://github.com/org/repo/blob/main/{filePath}https://github.com/org/repo.git → https://github.com/org/repo/blob/main/{filePath}[email protected]:org/repo.git → https://gitlab.com/org/repo/-/blob/main/{filePath}Read existing documentation to understand architecture context:
Assign each component a layer integer. The rule: higher layer = closer to domain core (more stable, fewer external dependencies). Lower layer = closer to external world (more volatile, I/O-bound).
Reference mappings (layer numbers in parentheses — adapt to actual project structure):
MVC / Layered:
DDD / Clean Architecture / Hexagonal (use "layout": "concentric"):
CQRS / Event-Driven:
Serverless / Microservices:
Modular Monolith:
For unlisted frameworks: group by directory responsibility and apply the abstract rule above.
For each layer, read representative files to extract:
Granularity: one node per real component. Resist the urge to bundle siblings into umbrella nodes (e.g. a single domain-shared-models covering 9 entities, or one adpt-shared-repos for every repository implementation). Each Controller, UseCase, abstract Repository, Repository implementation, and Domain Entity is normally its own node. See schema-reference.md → Node Granularity for the exact rule of thumb.
Repository → Port pattern: in DDD/Hexagonal projects, every abstract Repository in domains/ becomes a port node (layer = application core), and every concrete implementation in infrastructures/ becomes an adapter node (outer layer). The use case depends on the port; the adapter implements the port. See schema-reference.md → Repository → Port pattern for the canonical shape.
Enrich descriptions from documentation: Cross-reference code with your Phase 2 notes.
For each component, compose a description (1-3 sentences) that covers:
A good description tells the reader something they cannot see from the label alone.
Also identify metadata candidates:
metadata with type: "list"metadata with type: "link"metadata with type: "code" or "text"metadata with type: "code" or "list" (see Phase 5)Do NOT read every file. Focus on entry points, core logic, interfaces, and data models.
For each component, identify:
Edge type matters. dependency / implements / relation are not interchangeable. In particular, implements edges always flow adapter → port — never adapter → entity, adapter → adapter, or adapter → database. If you cannot point an implements edge at a port node, the abstraction is missing from the diagram and should be added. See schema-reference.md → Edge type semantics.
Connectivity check: After mapping, verify every node has at least one edge. If a node is orphaned:
Edge enrichment — SQL / query details: For edges connecting a service/adapter/repository to a database or entity node, include query information:
description: summarize what data operation this edge performs (e.g., "Queries active users by email with JOIN on roles")metadata: include representative SQL or ORM queries found in the source codeExample:
{
"source": "adpt-user-repo",
"target": "db-users",
"type": "dependency",
"description": "CRUD operations on users table; filters by email and status with role JOIN",
"metadata": [
{ "label": "Queries", "value": ["SELECT u.*, r.name FROM users u JOIN roles r ON u.role_id = r.id WHERE u.email = ?", "INSERT INTO users (name, email, role_id) VALUES (?, ?, ?)"], "type": "list" },
{ "label": "ORM", "value": "User::with('role')->where('email', $email)->first()", "type": "code" }
]
}
Guidelines:
type: "code" with the ORM syntaxtype: "list" with individual queries? or :param placeholders, not literals)Group related components into user-facing features.
IMPORTANT: Do NOT proceed to Phase 8 until the developer responds. You MUST stop here and wait for input.
Present a summary of what you found:
Then ask:
sourceUrl auto-detected as: <detected-url> — correct? (If not detected, ask for the sourceUrl template, e.g., https://github.com/org/repo/blob/main/{filePath})End your message with: "Please review and reply with corrections, or type 'go' to generate."
Do NOT write architecture.json yet. Wait for the developer to respond.
If the developer replies with corrections, apply them and present the updated summary. Repeat until they say "go" / "ok" / "skip".
Only run this phase AFTER the developer has approved the draft in Phase 7.
Create .archrip/ directory if it doesn't exist, then write the complete .archrip/architecture.json following the schema, incorporating developer feedback.
For the complete schema specification (field names, node/edge rules, layout selection), see schema-reference.md.
After writing the file:
npx archrip serve in the terminal (auto-builds if needed, opens browser)/archrip-update to make further adjustments (add/remove nodes, fix relationships, etc.)$ARGUMENTS
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub yida29/archrip --plugin archrip