archidocs 1.4.0-beta.6 → 1.4.0-beta.7
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.
- package/dist/guide/index.d.ts +5 -0
- package/dist/guide/index.js +6 -0
- package/guide/consult/SKILL.md +84 -0
- package/package.json +1 -1
package/dist/guide/index.d.ts
CHANGED
|
@@ -78,6 +78,11 @@ export declare const skills: readonly [{
|
|
|
78
78
|
readonly id: "rules";
|
|
79
79
|
readonly summary: "Every `check` rule id: what it means, a failing example and the fix.";
|
|
80
80
|
}];
|
|
81
|
+
}, {
|
|
82
|
+
readonly id: "consult";
|
|
83
|
+
readonly name: "archidocs-consult";
|
|
84
|
+
readonly description: "Check the Archidocs architecture Model before and after changing code. Use when changing a public API, event or schema, adding or removing a dependency on another Service, datastore or broker, renaming or retiring a Service, changing deployment config, or answering who calls, owns or deploys something.";
|
|
85
|
+
readonly dir: "consult/";
|
|
81
86
|
}, {
|
|
82
87
|
readonly id: "fill-gaps";
|
|
83
88
|
readonly name: "archidocs-fill-gaps";
|
package/dist/guide/index.js
CHANGED
|
@@ -35,6 +35,12 @@ export const skills = [
|
|
|
35
35
|
dir: "",
|
|
36
36
|
topics,
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
id: "consult",
|
|
40
|
+
name: "archidocs-consult",
|
|
41
|
+
description: "Check the Archidocs architecture Model before and after changing code. Use when changing a public API, event or schema, adding or removing a dependency on another Service, datastore or broker, renaming or retiring a Service, changing deployment config, or answering who calls, owns or deploys something.",
|
|
42
|
+
dir: "consult/",
|
|
43
|
+
},
|
|
38
44
|
{
|
|
39
45
|
id: "fill-gaps",
|
|
40
46
|
name: "archidocs-fill-gaps",
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: archidocs-consult
|
|
3
|
+
description: Check the Archidocs architecture Model before and after changing code. Use when changing a public API, event or schema, adding or removing a dependency on another Service, datastore or broker, renaming or retiring a Service, changing deployment config, or answering who calls, owns or deploys something.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Archidocs consult
|
|
7
|
+
|
|
8
|
+
You are changing code in a Service's repo. The Model says who depends on that Service, who owns them, where it runs and what was decided about it. Read it before you edit, report what matters in four lines, and check afterwards that the Model still matches the code.
|
|
9
|
+
|
|
10
|
+
This skill only reads. It never writes the Model: when the Model needs a change, hand off to the authoring skill (load it first with `get_guide("authoring")`, or `archidocs guide --skill authoring` without MCP) and follow its topic.
|
|
11
|
+
|
|
12
|
+
## Before the change
|
|
13
|
+
|
|
14
|
+
Run these read tools, in order:
|
|
15
|
+
|
|
16
|
+
1. **Resolve** the Service: `search_elements` with its name, repo name, or a URL or host from its config. Take the `project:id` of the Element the code implements. If nothing matches, see [Not in the Model](#not-in-the-model).
|
|
17
|
+
2. **Consumers**: `get_impact(id, direction: "upstream", max_depth: 1)` for the Elements that call it directly, each with its Owner and the Relationships that connect them. Call `get_impact(id, direction: "upstream")` once more without `max_depth` and subtract, for the count of indirect consumers.
|
|
18
|
+
3. **Owners**: the Element's own `owner` from step 1, and each direct consumer's Owner from step 2. The Teams to tell are the consumers' Owners other than the Element's own.
|
|
19
|
+
4. **Deployments**: `get_deployments(service: id)` for each Environment, Deployment Target and URL it runs at. Do this when the change touches deployment config, and to name what a change reaches.
|
|
20
|
+
5. **ADRs**: `list_adrs(element: id)`, then `get_adr` for any whose title touches what you are changing. Note each one's status; only `accepted` ones bind.
|
|
21
|
+
|
|
22
|
+
### Report
|
|
23
|
+
|
|
24
|
+
Before editing, tell the user what you found in four lines:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
Consumers: web (storefront), checkout (payments) +4 indirect
|
|
28
|
+
Teams to tell: storefront, payments
|
|
29
|
+
Deployments: prod on eks-main (https://cart.example.com), staging on eks-staging
|
|
30
|
+
ADRs: shop:0003 Cart is the only writer of cart state (accepted)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Write "none" on a line with nothing to report. Then carry on with the change.
|
|
34
|
+
|
|
35
|
+
## When to stop and ask
|
|
36
|
+
|
|
37
|
+
Stop and ask the user before editing in only two cases:
|
|
38
|
+
|
|
39
|
+
- **An Accepted ADR contradicts the change.** Quote the ADR's id, title and the sentence the change goes against. The user decides whether to change course or supersede the ADR (authoring's `propose-adr` topic).
|
|
40
|
+
- **The change breaks a contract another Team's consumer uses.** A removed or renamed endpoint, field, event or channel that a consumer owned by another Team relies on. Name the consumer and its Owner.
|
|
41
|
+
|
|
42
|
+
Otherwise carry on. A consumer on your own Team, a Proposed ADR, or a judgement that the change is risky is something to report, not a reason to stop.
|
|
43
|
+
|
|
44
|
+
## After the change
|
|
45
|
+
|
|
46
|
+
Compare only the dependencies this change touched (a client, SDK call, queue or topic, datastore connection added, removed or pointed elsewhere) with the Element's Relationships, from `get_impact(id, direction: "downstream", max_depth: 1)`. Also check a renamed or retired Service, and a changed URL or Environment against `get_deployments`.
|
|
47
|
+
|
|
48
|
+
When they differ, say so in one line per difference and offer to update the Model. On a yes, load authoring and follow its `relationships` topic for a Relationship, or `add-service` for a new or renamed Service and its Deployments.
|
|
49
|
+
|
|
50
|
+
Drift you notice beyond this change (a Relationship the code no longer has, an empty description) gets one line suggesting the `fill-gaps` skill. Don't fix it here.
|
|
51
|
+
|
|
52
|
+
## Not in the Model
|
|
53
|
+
|
|
54
|
+
When `search_elements` finds nothing, say so in one line ("cart isn't in the Archidocs Model") and carry on with the code change. Afterwards, offer to add it with authoring's `add-service` topic, or `bootstrap` if its Project is missing too.
|
|
55
|
+
|
|
56
|
+
## Answering questions
|
|
57
|
+
|
|
58
|
+
| Question | Tool |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| Who calls it? | `get_impact(id, direction: "upstream")` |
|
|
61
|
+
| What does it call? | `get_impact(id, direction: "downstream")` |
|
|
62
|
+
| How does A reach B? | `find_paths(from, to)` |
|
|
63
|
+
| Who owns it? | the Element's `owner` (from `search_elements` or `get_element`); a Team's Elements with `list_owned` |
|
|
64
|
+
| Where does it run? | `get_deployments(service, environment?)` |
|
|
65
|
+
| What changed? | `get_changes(scope)`, `list_history(scope)` |
|
|
66
|
+
| Why is it like this? | `list_adrs(element)`, then `get_adr(id)` |
|
|
67
|
+
|
|
68
|
+
Give `max_depth: 1` for only the Elements one hop away. Answer from the tool's result, and name the `project:id`s.
|
|
69
|
+
|
|
70
|
+
## Without MCP
|
|
71
|
+
|
|
72
|
+
With no Archidocs MCP server, read the Workspace YAML directly. Each Project folder holds `project.yaml` and the files that declare its Elements, Relationships and Deployments; ADRs are in `<project>/adr/`.
|
|
73
|
+
|
|
74
|
+
- **The Element**: search the Project's YAML for its id or name, or its URL among the `deployments`.
|
|
75
|
+
- **Consumers**: Relationships sit under the consumer and point `to` the provider. For an Element `cart` in Project `shop`, search the Workspace for:
|
|
76
|
+
- `to: cart` in files under `shop/` (a bare id within the Project);
|
|
77
|
+
- `to: shop:cart` anywhere (another Project's reference);
|
|
78
|
+
- `via: cart` under `shop/` and `via: shop:cart` anywhere, when it is a broker: each such Relationship's consumer and its `to` both depend on it.
|
|
79
|
+
|
|
80
|
+
For example: `grep -rnE "(to|via): (shop:)?cart\b" archidocs/` and then drop bare-id matches outside `shop/`. The consumer is the Element the matching Relationship sits under; its Owner is its `owner`, else the Project's.
|
|
81
|
+
- **Deployments**: the `deployments` entries with `service: cart`.
|
|
82
|
+
- **ADRs**: the files in `<project>/adr/` whose `elements` list names the Element; `status` is in the frontmatter.
|
|
83
|
+
|
|
84
|
+
Count only direct consumers this way; write "indirect not counted" in the report.
|