archrip 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,9 +20,16 @@ Analyze the current codebase and generate `.archrip/architecture.json`.
20
20
 
21
21
  ## Phase 2: Documentation Discovery
22
22
  Read existing documentation to understand architecture context:
23
- 1. Check for: README.md, CLAUDE.md, docs/, doc/, wiki/, ARCHITECTURE.md, CONTRIBUTING.md
24
- 2. Extract: system overview, component descriptions, external service integrations, design decisions
25
- 3. Use this knowledge to inform the analysis — documentation often reveals architectural intent that code alone does not show (use cases, business context, external dependencies)
23
+ 1. Check for: README.md, CLAUDE.md, docs/, doc/, wiki/, ARCHITECTURE.md, CONTRIBUTING.md, ADR/
24
+ 2. For each document, extract and take notes on:
25
+ - **Business context**: What problem does this system solve? Who are the users?
26
+ - **Component responsibilities**: What each module/service does and why it exists
27
+ - **Design decisions & constraints**: Why certain patterns/libraries were chosen, known limitations
28
+ - **Data flow**: How data moves through the system (request lifecycle, event flow, etc.)
29
+ - **External integrations**: What external services are used, why, and how
30
+ - **Non-functional requirements**: SLAs, performance targets, security policies
31
+ - **Deployment & infrastructure**: Hosting, CI/CD, environment details
32
+ 3. Keep these notes — you will use them in Phase 4 to write rich node/edge descriptions and metadata
26
33
 
27
34
  ## Phase 3: Layer Identification
28
35
  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).**
@@ -58,6 +65,21 @@ For each layer, read representative files to extract:
58
65
  - Public methods/routes
59
66
  - Database schemas (from migrations or model definitions)
60
67
 
68
+ **Enrich descriptions from documentation:** Cross-reference code with your Phase 2 notes.
69
+ For each component, compose a `description` (1-3 sentences) that covers:
70
+ - **What**: Its responsibility (from code analysis)
71
+ - **Why**: Business context or design rationale (from docs)
72
+ - **How**: Key implementation details, constraints, or patterns worth noting
73
+
74
+ A good description tells the reader something they cannot see from the label alone.
75
+ - BAD: "User service" (just echoes the label)
76
+ - GOOD: "Handles user registration, login, and profile management. Uses JWT for session tokens with 24h expiry. Password hashing via bcrypt (cost=12)."
77
+
78
+ Also identify metadata candidates:
79
+ - SLA/performance notes → `metadata` with `type: "list"`
80
+ - Related doc links → `metadata` with `type: "link"`
81
+ - Infrastructure details (Lambda ARN, DB engine, etc.) → `metadata` with `type: "code"` or `"text"`
82
+
61
83
  **Do NOT read every file.** Focus on entry points, core logic, interfaces, and data models.
62
84
 
63
85
  ## Phase 5: Map Relationships
@@ -133,6 +155,7 @@ After writing the file:
133
155
  - `layer`: non-negative integer. **Higher = closer to domain core / more stable. Lower = closer to external world / more volatile.** Dagre (TB) places higher layers lower on screen; concentric places them at center. Use as many layers as the architecture requires (typically 3-6). Example for DDD: 0=external, 1=adapters, 2=controllers, 3=app services, 4=ports, 5=domain entities. Example for MVC: 0=external, 1=controllers, 2=services, 3=models.
134
156
  - `category`: one of controller, service, port, adapter, model, database, external, job, dto (or custom). Use `model` for domain entities/value objects (core business logic). Use `database` for DB tables, migrations, ORMs, and infrastructure persistence.
135
157
  - `label`: display name for the node
158
+ - `description`: 1-3 sentences explaining responsibility + business context. Do NOT just echo the label. Cross-reference documentation for richer context (see Description Guidelines below)
136
159
  - `filePath`: relative from project root
137
160
  - `depth` (optional): 0=overview, 1=structure, 2=detail. Auto-inferred from `layer` if omitted: with 3+ unique layers, lowest → 0, middle → 1, highest → 2. With 1-2 layers, all nodes get depth 0 (always visible).
138
161
  - `useCases`: array of use case IDs this node participates in
@@ -158,6 +181,31 @@ After writing the file:
158
181
  - DDD / Clean Architecture / Hexagonal / Onion Architecture → add `"layout": "concentric"` to `project`
159
182
  - MVC / standard layered → `"layout": "dagre"` (default, can be omitted)
160
183
 
184
+ ### Description Guidelines
185
+
186
+ #### Node `description`
187
+ Write 1-3 sentences that explain responsibility AND business context.
188
+ Cross-reference project documentation (README, CLAUDE.md, docs/) for richer context.
189
+ - BAD: "User service" (just echoes the label)
190
+ - BAD: "Handles users" (too vague)
191
+ - GOOD: "Handles user registration, authentication, and profile management. Uses JWT for session tokens; password hashing via bcrypt. Rate-limited to 10 req/s per IP."
192
+
193
+ #### Edge `description`
194
+ Explain WHY the dependency exists, not just THAT it exists.
195
+ - BAD: "calls" / "depends on"
196
+ - GOOD: "Delegates payment processing via Stripe SDK; retries on timeout (3x with exponential backoff)"
197
+
198
+ #### `metadata` for supplementary details
199
+ Use `metadata` to capture information from docs that doesn't fit in `description`:
200
+ ```json
201
+ "metadata": [
202
+ { "label": "SLA", "value": ["99.9% uptime", "p95 < 200ms"], "type": "list" },
203
+ { "label": "Design Doc", "value": "https://...", "type": "link" },
204
+ { "label": "Infrastructure", "value": "Lambda + DynamoDB (on-demand)", "type": "text" },
205
+ { "label": "Rate Limit", "value": "10 req/s per IP", "type": "text" }
206
+ ]
207
+ ```
208
+
161
209
  ### Schema Rules
162
210
  - Include table schema only when migration files or model annotations are available
163
211
  - Reference from node data using schema key name
@@ -20,9 +20,16 @@ Analyze the current codebase and generate `.archrip/architecture.json`.
20
20
 
21
21
  ## Phase 2: Documentation Discovery
22
22
  Read existing documentation to understand architecture context:
23
- 1. Check for: README.md, CLAUDE.md, docs/, doc/, wiki/, ARCHITECTURE.md, CONTRIBUTING.md
24
- 2. Extract: system overview, component descriptions, external service integrations, design decisions
25
- 3. Use this knowledge to inform the analysis — documentation often reveals architectural intent that code alone does not show (use cases, business context, external dependencies)
23
+ 1. Check for: README.md, CLAUDE.md, docs/, doc/, wiki/, ARCHITECTURE.md, CONTRIBUTING.md, ADR/
24
+ 2. For each document, extract and take notes on:
25
+ - **Business context**: What problem does this system solve? Who are the users?
26
+ - **Component responsibilities**: What each module/service does and why it exists
27
+ - **Design decisions & constraints**: Why certain patterns/libraries were chosen, known limitations
28
+ - **Data flow**: How data moves through the system (request lifecycle, event flow, etc.)
29
+ - **External integrations**: What external services are used, why, and how
30
+ - **Non-functional requirements**: SLAs, performance targets, security policies
31
+ - **Deployment & infrastructure**: Hosting, CI/CD, environment details
32
+ 3. Keep these notes — you will use them in Phase 4 to write rich node/edge descriptions and metadata
26
33
 
27
34
  ## Phase 3: Layer Identification
28
35
  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).**
@@ -58,6 +65,21 @@ For each layer, read representative files to extract:
58
65
  - Public methods/routes
59
66
  - Database schemas (from migrations or model definitions)
60
67
 
68
+ **Enrich descriptions from documentation:** Cross-reference code with your Phase 2 notes.
69
+ For each component, compose a `description` (1-3 sentences) that covers:
70
+ - **What**: Its responsibility (from code analysis)
71
+ - **Why**: Business context or design rationale (from docs)
72
+ - **How**: Key implementation details, constraints, or patterns worth noting
73
+
74
+ A good description tells the reader something they cannot see from the label alone.
75
+ - BAD: "User service" (just echoes the label)
76
+ - GOOD: "Handles user registration, login, and profile management. Uses JWT for session tokens with 24h expiry. Password hashing via bcrypt (cost=12)."
77
+
78
+ Also identify metadata candidates:
79
+ - SLA/performance notes → `metadata` with `type: "list"`
80
+ - Related doc links → `metadata` with `type: "link"`
81
+ - Infrastructure details (Lambda ARN, DB engine, etc.) → `metadata` with `type: "code"` or `"text"`
82
+
61
83
  **Do NOT read every file.** Focus on entry points, core logic, interfaces, and data models.
62
84
 
63
85
  ## Phase 5: Map Relationships
@@ -133,6 +155,7 @@ After writing the file:
133
155
  - `layer`: non-negative integer. **Higher = closer to domain core / more stable. Lower = closer to external world / more volatile.** Dagre (TB) places higher layers lower on screen; concentric places them at center. Use as many layers as the architecture requires (typically 3-6). Example for DDD: 0=external, 1=adapters, 2=controllers, 3=app services, 4=ports, 5=domain entities. Example for MVC: 0=external, 1=controllers, 2=services, 3=models.
134
156
  - `category`: one of controller, service, port, adapter, model, database, external, job, dto (or custom). Use `model` for domain entities/value objects (core business logic). Use `database` for DB tables, migrations, ORMs, and infrastructure persistence.
135
157
  - `label`: display name for the node
158
+ - `description`: 1-3 sentences explaining responsibility + business context. Do NOT just echo the label. Cross-reference documentation for richer context (see Description Guidelines below)
136
159
  - `filePath`: relative from project root
137
160
  - `depth` (optional): 0=overview, 1=structure, 2=detail. Auto-inferred from `layer` if omitted: with 3+ unique layers, lowest → 0, middle → 1, highest → 2. With 1-2 layers, all nodes get depth 0 (always visible).
138
161
  - `useCases`: array of use case IDs this node participates in
@@ -158,6 +181,31 @@ After writing the file:
158
181
  - DDD / Clean Architecture / Hexagonal / Onion Architecture → add `"layout": "concentric"` to `project`
159
182
  - MVC / standard layered → `"layout": "dagre"` (default, can be omitted)
160
183
 
184
+ ### Description Guidelines
185
+
186
+ #### Node `description`
187
+ Write 1-3 sentences that explain responsibility AND business context.
188
+ Cross-reference project documentation (README, CLAUDE.md, docs/) for richer context.
189
+ - BAD: "User service" (just echoes the label)
190
+ - BAD: "Handles users" (too vague)
191
+ - GOOD: "Handles user registration, authentication, and profile management. Uses JWT for session tokens; password hashing via bcrypt. Rate-limited to 10 req/s per IP."
192
+
193
+ #### Edge `description`
194
+ Explain WHY the dependency exists, not just THAT it exists.
195
+ - BAD: "calls" / "depends on"
196
+ - GOOD: "Delegates payment processing via Stripe SDK; retries on timeout (3x with exponential backoff)"
197
+
198
+ #### `metadata` for supplementary details
199
+ Use `metadata` to capture information from docs that doesn't fit in `description`:
200
+ ```json
201
+ "metadata": [
202
+ { "label": "SLA", "value": ["99.9% uptime", "p95 < 200ms"], "type": "list" },
203
+ { "label": "Design Doc", "value": "https://...", "type": "link" },
204
+ { "label": "Infrastructure", "value": "Lambda + DynamoDB (on-demand)", "type": "text" },
205
+ { "label": "Rate Limit", "value": "10 req/s per IP", "type": "text" }
206
+ ]
207
+ ```
208
+
161
209
  ### Schema Rules
162
210
  - Include table schema only when migration files or model annotations are available
163
211
  - Reference from node data using schema key name
@@ -20,9 +20,16 @@ Analyze the current codebase and generate `.archrip/architecture.json`.
20
20
 
21
21
  ## Phase 2: Documentation Discovery
22
22
  Read existing documentation to understand architecture context:
23
- 1. Check for: README.md, CLAUDE.md, docs/, doc/, wiki/, ARCHITECTURE.md, CONTRIBUTING.md
24
- 2. Extract: system overview, component descriptions, external service integrations, design decisions
25
- 3. Use this knowledge to inform the analysis — documentation often reveals architectural intent that code alone does not show (use cases, business context, external dependencies)
23
+ 1. Check for: README.md, CLAUDE.md, docs/, doc/, wiki/, ARCHITECTURE.md, CONTRIBUTING.md, ADR/
24
+ 2. For each document, extract and take notes on:
25
+ - **Business context**: What problem does this system solve? Who are the users?
26
+ - **Component responsibilities**: What each module/service does and why it exists
27
+ - **Design decisions & constraints**: Why certain patterns/libraries were chosen, known limitations
28
+ - **Data flow**: How data moves through the system (request lifecycle, event flow, etc.)
29
+ - **External integrations**: What external services are used, why, and how
30
+ - **Non-functional requirements**: SLAs, performance targets, security policies
31
+ - **Deployment & infrastructure**: Hosting, CI/CD, environment details
32
+ 3. Keep these notes — you will use them in Phase 4 to write rich node/edge descriptions and metadata
26
33
 
27
34
  ## Phase 3: Layer Identification
28
35
  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).**
@@ -58,6 +65,21 @@ For each layer, read representative files to extract:
58
65
  - Public methods/routes
59
66
  - Database schemas (from migrations or model definitions)
60
67
 
68
+ **Enrich descriptions from documentation:** Cross-reference code with your Phase 2 notes.
69
+ For each component, compose a `description` (1-3 sentences) that covers:
70
+ - **What**: Its responsibility (from code analysis)
71
+ - **Why**: Business context or design rationale (from docs)
72
+ - **How**: Key implementation details, constraints, or patterns worth noting
73
+
74
+ A good description tells the reader something they cannot see from the label alone.
75
+ - BAD: "User service" (just echoes the label)
76
+ - GOOD: "Handles user registration, login, and profile management. Uses JWT for session tokens with 24h expiry. Password hashing via bcrypt (cost=12)."
77
+
78
+ Also identify metadata candidates:
79
+ - SLA/performance notes → `metadata` with `type: "list"`
80
+ - Related doc links → `metadata` with `type: "link"`
81
+ - Infrastructure details (Lambda ARN, DB engine, etc.) → `metadata` with `type: "code"` or `"text"`
82
+
61
83
  **Do NOT read every file.** Focus on entry points, core logic, interfaces, and data models.
62
84
 
63
85
  ## Phase 5: Map Relationships
@@ -133,6 +155,7 @@ After writing the file:
133
155
  - `layer`: non-negative integer. **Higher = closer to domain core / more stable. Lower = closer to external world / more volatile.** Dagre (TB) places higher layers lower on screen; concentric places them at center. Use as many layers as the architecture requires (typically 3-6). Example for DDD: 0=external, 1=adapters, 2=controllers, 3=app services, 4=ports, 5=domain entities. Example for MVC: 0=external, 1=controllers, 2=services, 3=models.
134
156
  - `category`: one of controller, service, port, adapter, model, database, external, job, dto (or custom). Use `model` for domain entities/value objects (core business logic). Use `database` for DB tables, migrations, ORMs, and infrastructure persistence.
135
157
  - `label`: display name for the node
158
+ - `description`: 1-3 sentences explaining responsibility + business context. Do NOT just echo the label. Cross-reference documentation for richer context (see Description Guidelines below)
136
159
  - `filePath`: relative from project root
137
160
  - `depth` (optional): 0=overview, 1=structure, 2=detail. Auto-inferred from `layer` if omitted: with 3+ unique layers, lowest → 0, middle → 1, highest → 2. With 1-2 layers, all nodes get depth 0 (always visible).
138
161
  - `useCases`: array of use case IDs this node participates in
@@ -158,6 +181,31 @@ After writing the file:
158
181
  - DDD / Clean Architecture / Hexagonal / Onion Architecture → add `"layout": "concentric"` to `project`
159
182
  - MVC / standard layered → `"layout": "dagre"` (default, can be omitted)
160
183
 
184
+ ### Description Guidelines
185
+
186
+ #### Node `description`
187
+ Write 1-3 sentences that explain responsibility AND business context.
188
+ Cross-reference project documentation (README, CLAUDE.md, docs/) for richer context.
189
+ - BAD: "User service" (just echoes the label)
190
+ - BAD: "Handles users" (too vague)
191
+ - GOOD: "Handles user registration, authentication, and profile management. Uses JWT for session tokens; password hashing via bcrypt. Rate-limited to 10 req/s per IP."
192
+
193
+ #### Edge `description`
194
+ Explain WHY the dependency exists, not just THAT it exists.
195
+ - BAD: "calls" / "depends on"
196
+ - GOOD: "Delegates payment processing via Stripe SDK; retries on timeout (3x with exponential backoff)"
197
+
198
+ #### `metadata` for supplementary details
199
+ Use `metadata` to capture information from docs that doesn't fit in `description`:
200
+ ```json
201
+ "metadata": [
202
+ { "label": "SLA", "value": ["99.9% uptime", "p95 < 200ms"], "type": "list" },
203
+ { "label": "Design Doc", "value": "https://...", "type": "link" },
204
+ { "label": "Infrastructure", "value": "Lambda + DynamoDB (on-demand)", "type": "text" },
205
+ { "label": "Rate Limit", "value": "10 req/s per IP", "type": "text" }
206
+ ]
207
+ ```
208
+
161
209
  ### Schema Rules
162
210
  - Include table schema only when migration files or model annotations are available
163
211
  - Reference from node data using schema key name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archrip",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Generate interactive architecture diagrams from your codebase using AI agents",
5
5
  "type": "module",
6
6
  "bin": {