archidocs 1.4.0-beta.3 → 1.4.0-beta.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.
package/README.md CHANGED
@@ -163,7 +163,7 @@ The terms (Workspace, Project, Element, Relationship, Team, Environment, Deploym
163
163
  | `archidocs export <view-id>` | Render a View to SVG or PNG, styled like the viewer; `--all-saved` renders every Saved View, `--theme dark` draws it in the viewer's dark palette and `--label <text>` replaces the source line. |
164
164
  | `archidocs diff <from> [<to>]` | Show what changed in the Model between two refs. |
165
165
  | `archidocs mcp` | Run the MCP server over a Workspace checkout or a published Bundle. |
166
- | `archidocs guide [topic]` | Print the authoring guide for agents. |
166
+ | `archidocs guide [topic] [--skill <id>]` | Print an agent skill's guide; `--skill` defaults to `authoring`. |
167
167
  | `archidocs version` | Print the CLI and Bundle schema versions. |
168
168
 
169
169
  ## Publishing
@@ -123,26 +123,36 @@ export declare const commands: {
123
123
  };
124
124
  readonly guide: {
125
125
  readonly name: "guide";
126
- readonly synopsis: readonly ["guide [topic]"];
127
- readonly description: "Print the authoring guide for agents, or one of its task topics.";
126
+ readonly synopsis: readonly ["guide [topic] [--skill <id>]"];
127
+ readonly description: "Print an agent skill's full guide, or one of its task topics. With no `--skill`, the authoring guide.";
128
128
  readonly arguments: readonly [{
129
129
  readonly name: "[topic]";
130
- readonly description: "A task topic; with none, the guide and the list of topics.";
130
+ readonly description: "A task topic of the skill; with none, the guide and its list of topics.";
131
131
  }];
132
- readonly flags: {};
132
+ readonly flags: {
133
+ readonly skill: {
134
+ readonly type: "string";
135
+ readonly value: "<id>";
136
+ readonly default: "authoring";
137
+ readonly description: "The skill whose guide to print. `authoring` is the one there is today.";
138
+ };
139
+ };
133
140
  readonly examples: readonly [{
134
141
  readonly command: "archidocs guide";
135
- readonly description: "Print the guide: the Model in brief, the edit loop and the list of task topics.";
142
+ readonly description: "Print the authoring guide: the Model in brief, the edit loop and the list of task topics.";
136
143
  }, {
137
144
  readonly command: "archidocs guide add-service";
138
145
  readonly description: "Print one task topic, here how to add a Service.";
146
+ }, {
147
+ readonly command: "archidocs guide --skill authoring";
148
+ readonly description: "Name the skill, as a skill's stub does: the same as `archidocs guide`.";
139
149
  }];
140
150
  readonly exitCodes: readonly [{
141
151
  readonly code: 0;
142
152
  readonly meaning: "The guide or the topic was printed.";
143
153
  }, {
144
154
  readonly code: 2;
145
- readonly meaning: "It could not run: an unknown topic (the message lists the topics there are), more than one topic, or any flag, since it takes none.";
155
+ readonly meaning: "It could not run: an unknown skill or topic (the message names the closest one and lists them all), a topic on a skill without topics, more than one topic, or an unknown flag.";
146
156
  }];
147
157
  };
148
158
  readonly check: {
@@ -187,6 +197,49 @@ export declare const commands: {
187
197
  readonly meaning: "It could not run: an unknown flag, a flag missing its value, an unknown format, or no Workspace found.";
188
198
  }];
189
199
  };
200
+ readonly gaps: {
201
+ readonly name: "gaps";
202
+ readonly synopsis: readonly ["gaps [--project <id>] [--owner <team>] [--json]"];
203
+ readonly description: "List what the Model leaves empty, grouped by Project and Owner Team: the gaps an agent's fill-gaps interview works through.";
204
+ readonly arguments: readonly [];
205
+ readonly flags: {
206
+ readonly project: {
207
+ readonly type: "string";
208
+ readonly value: "<id>";
209
+ readonly description: "Only this Project's gaps.";
210
+ };
211
+ readonly owner: {
212
+ readonly type: "string";
213
+ readonly value: "<team>";
214
+ readonly description: "Only the gaps of items this Team owns.";
215
+ };
216
+ readonly json: {
217
+ readonly type: "boolean";
218
+ readonly default: false;
219
+ readonly description: "Print the gaps as JSON, in the shape the `list_gaps` MCP tool returns, instead of Markdown.";
220
+ };
221
+ };
222
+ readonly examples: readonly [{
223
+ readonly command: "archidocs gaps";
224
+ readonly description: "Print every gap as Markdown: a heading per Project and Owner Team, then a line per Element, Relationship or Deployment naming its empty fields.";
225
+ }, {
226
+ readonly command: "archidocs gaps --owner payments-team";
227
+ readonly description: "Print only the gaps of what one Team owns, as a backlog to hand to that Team.";
228
+ }, {
229
+ readonly command: "archidocs gaps --project shop --json";
230
+ readonly description: "Print one Project's gaps as JSON, for a script.";
231
+ }];
232
+ readonly exitCodes: readonly [{
233
+ readonly code: 0;
234
+ readonly meaning: "The gaps were printed, or none were found. It exits 0 either way: a gap is incompleteness, not an error, and `check` never reports one.";
235
+ }, {
236
+ readonly code: 1;
237
+ readonly meaning: "The Workspace has errors. They are printed as `check` prints them, and no gaps are listed.";
238
+ }, {
239
+ readonly code: 2;
240
+ readonly meaning: "It could not run: an unknown flag, a flag missing its value, an unknown Project or Team, or no Workspace found.";
241
+ }];
242
+ };
190
243
  readonly build: {
191
244
  readonly name: "build";
192
245
  readonly synopsis: readonly ["build [--out <dir>] [--bundle-only] [--keep <n|all>]", "build --preview [--base <branch>] [--out <dir>]"];
@@ -54,17 +54,20 @@ export const commands = {
54
54
  },
55
55
  guide: {
56
56
  name: "guide",
57
- synopsis: ["guide [topic]"],
58
- description: "Print the authoring guide for agents, or one of its task topics.",
59
- arguments: [{ name: "[topic]", description: "A task topic; with none, the guide and the list of topics." }],
60
- flags: {},
57
+ synopsis: ["guide [topic] [--skill <id>]"],
58
+ description: "Print an agent skill's full guide, or one of its task topics. With no `--skill`, the authoring guide.",
59
+ arguments: [{ name: "[topic]", description: "A task topic of the skill; with none, the guide and its list of topics." }],
60
+ flags: {
61
+ skill: { type: "string", value: "<id>", default: "authoring", description: "The skill whose guide to print. `authoring` is the one there is today." },
62
+ },
61
63
  examples: [
62
- { command: "archidocs guide", description: "Print the guide: the Model in brief, the edit loop and the list of task topics." },
64
+ { command: "archidocs guide", description: "Print the authoring guide: the Model in brief, the edit loop and the list of task topics." },
63
65
  { command: "archidocs guide add-service", description: "Print one task topic, here how to add a Service." },
66
+ { command: "archidocs guide --skill authoring", description: "Name the skill, as a skill's stub does: the same as `archidocs guide`." },
64
67
  ],
65
68
  exitCodes: [
66
69
  { code: EXIT.ok, meaning: "The guide or the topic was printed." },
67
- { code: EXIT.couldNotRun, meaning: "It could not run: an unknown topic (the message lists the topics there are), more than one topic, or any flag, since it takes none." },
70
+ { code: EXIT.couldNotRun, meaning: "It could not run: an unknown skill or topic (the message names the closest one and lists them all), a topic on a skill without topics, more than one topic, or an unknown flag." },
68
71
  ],
69
72
  },
70
73
  check: {
@@ -88,6 +91,27 @@ export const commands = {
88
91
  { code: EXIT.couldNotRun, meaning: `It could not run: ${USAGE_ERROR}, an unknown format, or no Workspace found.` },
89
92
  ],
90
93
  },
94
+ gaps: {
95
+ name: "gaps",
96
+ synopsis: ["gaps [--project <id>] [--owner <team>] [--json]"],
97
+ description: "List what the Model leaves empty, grouped by Project and Owner Team: the gaps an agent's fill-gaps interview works through.",
98
+ arguments: [],
99
+ flags: {
100
+ project: { type: "string", value: "<id>", description: "Only this Project's gaps." },
101
+ owner: { type: "string", value: "<team>", description: "Only the gaps of items this Team owns." },
102
+ json: { type: "boolean", default: false, description: "Print the gaps as JSON, in the shape the `list_gaps` MCP tool returns, instead of Markdown." },
103
+ },
104
+ examples: [
105
+ { command: "archidocs gaps", description: "Print every gap as Markdown: a heading per Project and Owner Team, then a line per Element, Relationship or Deployment naming its empty fields." },
106
+ { command: "archidocs gaps --owner payments-team", description: "Print only the gaps of what one Team owns, as a backlog to hand to that Team." },
107
+ { command: "archidocs gaps --project shop --json", description: "Print one Project's gaps as JSON, for a script." },
108
+ ],
109
+ exitCodes: [
110
+ { code: EXIT.ok, meaning: "The gaps were printed, or none were found. It exits 0 either way: a gap is incompleteness, not an error, and `check` never reports one." },
111
+ { code: EXIT.foundErrors, meaning: "The Workspace has errors. They are printed as `check` prints them, and no gaps are listed." },
112
+ { code: EXIT.couldNotRun, meaning: `It could not run: ${USAGE_ERROR}, an unknown Project or Team, or no Workspace found.` },
113
+ ],
114
+ },
91
115
  build: {
92
116
  name: "build",
93
117
  synopsis: ["build [--out <dir>] [--bundle-only] [--keep <n|all>]", "build --preview [--base <branch>] [--out <dir>]"],
package/dist/cli/init.js CHANGED
@@ -46,7 +46,7 @@ async function listsArchidocs(path) {
46
46
  export async function init({ repoRoot, cwd, skillOnly, workspace, env, version }) {
47
47
  const out = [];
48
48
  const runner = await archidocsCommand(repoRoot, env, version);
49
- const stub = skillStub(runner);
49
+ const stub = skillStub("authoring", runner);
50
50
  const wrote = (path, what) => out.push(`${what} ${posix(relative(repoRoot, path))}`);
51
51
  let workspaceDir;
52
52
  if (!skillOnly) {
package/dist/cli/run.js CHANGED
@@ -7,14 +7,16 @@ import { themes } from "../render/tokens.js";
7
7
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
8
8
  import { gitTopLevel } from "../git.js";
9
9
  import { findCheckout } from "../workspace/index.js";
10
- import { build, buildHistory, check, diff, exportViews } from "../commands/index.js";
10
+ import { build, buildHistory, check, diff, exportViews, gaps } from "../commands/index.js";
11
11
  import { bundleSource, checkoutSource, checkServer, createServer, DEFAULT_PORT, serveHttp, startupLine } from "../mcp/index.js";
12
- import { authoringGuide } from "../guide/index.js";
12
+ import { guide as skillGuide } from "../guide/index.js";
13
13
  import { EXIT, NO_WORKSPACE, parseCommand, usageText } from "./commands.js";
14
14
  import { init } from "./init.js";
15
15
  import { DEFAULT_DEV_PORT, serveDev } from "./dev.js";
16
16
  import { exitCodeFor, formatIssues, formats, formatText } from "./format.js";
17
17
  import { DEFAULT_KEEP, pointMessage } from "../history/index.js";
18
+ import { formatGaps } from "../core/index.js";
19
+ import { didYouMean } from "../core/suggest.js";
18
20
  import { LATEST_BUNDLE_PATH } from "../revisions/index.js";
19
21
  import { SCHEMA_VERSION } from "../schema/bundle.js";
20
22
  import { diffFormats, formatDiff } from "./diff-format.js";
@@ -72,10 +74,10 @@ async function main(argv, io) {
72
74
  return OK;
73
75
  }
74
76
  if (command === "guide") {
75
- const { positionals } = parseCommand("guide", rest);
77
+ const { positionals, values } = parseCommand("guide", rest);
76
78
  if (positionals.length > 1)
77
79
  throw new UsageError(`Give one topic at a time; got ${positionals.join(", ")}.`);
78
- const guide = await authoringGuide(positionals[0]);
80
+ const guide = await skillGuide(values.skill, positionals[0]);
79
81
  if (!guide.ok)
80
82
  throw new UsageError(guide.message);
81
83
  io.stdout.write(guide.text);
@@ -90,6 +92,27 @@ async function main(argv, io) {
90
92
  io.stdout.write(formatIssues(issues, format, { color: useColor(io) }));
91
93
  return exitCodeFor(issues, { strict: values.strict });
92
94
  }
95
+ if (command === "gaps") {
96
+ const { values } = parseCommand("gaps", rest);
97
+ const result = await gaps(await checkoutFrom(io.cwd), {
98
+ ...(values.project === undefined ? {} : { project: values.project }),
99
+ ...(values.owner === undefined ? {} : { owner: values.owner }),
100
+ });
101
+ switch (result.kind) {
102
+ case "errors":
103
+ io.stdout.write(formatText(result.issues, { color: useColor(io) }));
104
+ io.stderr.write("Not listing gaps: the Workspace has errors.\n");
105
+ return FOUND_ERRORS;
106
+ case "unknown":
107
+ throw new UsageError(`Unknown ${result.what} "${result.id}"${didYouMean(result.id, result.known) || "."}`);
108
+ case "gaps":
109
+ if (values.json)
110
+ io.stdout.write(JSON.stringify({ total: result.gaps.length, gaps: result.gaps }, null, 2) + "\n");
111
+ else
112
+ io.stdout.write(result.gaps.length ? formatGaps(result.gaps, result.bundle) : "No gaps.\n");
113
+ return OK;
114
+ }
115
+ }
93
116
  if (command === "build") {
94
117
  const { values } = parseCommand("build", rest);
95
118
  if (values.preview && values.keep !== undefined)
@@ -0,0 +1,24 @@
1
+ import { type Gap, type GapFilter, type Issue } from "../core/index.ts";
2
+ import type { Bundle } from "../schema/bundle.ts";
3
+ import type { Checkout } from "../workspace/index.ts";
4
+ export type GapsResult =
5
+ /** The Workspace has errors, so it has no Bundle to scan. */
6
+ {
7
+ kind: "errors";
8
+ issues: Issue[];
9
+ }
10
+ /** The filter names a Project or Team the Workspace doesn't have. */
11
+ | {
12
+ kind: "unknown";
13
+ what: "Project" | "Team";
14
+ id: string;
15
+ known: string[];
16
+ }
17
+ /** The gaps, possibly none, with the Bundle they were found in. */
18
+ | {
19
+ kind: "gaps";
20
+ gaps: Gap[];
21
+ bundle: Bundle;
22
+ };
23
+ /** What the Workspace's Model leaves empty, optionally for one Project or Owner Team. */
24
+ export declare function gaps(checkout: Checkout, filter?: GapFilter): Promise<GapsResult>;
@@ -0,0 +1,14 @@
1
+ import { listGaps } from "../core/index.js";
2
+ /** What the Workspace's Model leaves empty, optionally for one Project or Owner Team. */
3
+ export async function gaps(checkout, filter = {}) {
4
+ const { bundle, issues } = await checkout.load();
5
+ if (issues.some((i) => i.severity === "error"))
6
+ return { kind: "errors", issues };
7
+ const projects = bundle.projects.map((p) => p.id);
8
+ if (filter.project !== undefined && !projects.includes(filter.project))
9
+ return { kind: "unknown", what: "Project", id: filter.project, known: projects };
10
+ const teams = bundle.teams.map((t) => t.id);
11
+ if (filter.owner !== undefined && !teams.includes(filter.owner))
12
+ return { kind: "unknown", what: "Team", id: filter.owner, known: teams };
13
+ return { kind: "gaps", gaps: listGaps(bundle, filter), bundle };
14
+ }
@@ -9,3 +9,4 @@ export { build, type BuildOptions, type BuildResult } from "./build.ts";
9
9
  export { exportViews, type ExportOptions, type ExportResult, type ExportedFile } from "./export.ts";
10
10
  export { diff, type DiffResult, type DiffSide } from "./diff.ts";
11
11
  export { buildHistory, type BuildHistoryOptions, type BuildHistoryResult } from "./history.ts";
12
+ export { gaps, type GapsResult } from "./gaps.ts";
@@ -9,3 +9,4 @@ export { build } from "./build.js";
9
9
  export { exportViews } from "./export.js";
10
10
  export { diff } from "./diff.js";
11
11
  export { buildHistory } from "./history.js";
12
+ export { gaps } from "./gaps.js";
@@ -0,0 +1,53 @@
1
+ import type { Bundle } from "../schema/bundle.ts";
2
+ /** The fields a gap can name. `api-docs` and `deployments` are not fields but what the Model lacks. */
3
+ export declare const gapNames: readonly ["description", "technology", "repository", "deployments", "api-docs", "channel", "url"];
4
+ export type GapName = (typeof gapNames)[number];
5
+ export type GapItemKind = "element" | "relationship" | "deployment";
6
+ /**
7
+ * One item the Model leaves incomplete. `item.id` is the Element's id, a
8
+ * Relationship as `<from> -> <to>`, or a Deployment as
9
+ * `<service> in <environment> on <target>`.
10
+ */
11
+ export interface Gap {
12
+ project: string;
13
+ owner: string;
14
+ item: {
15
+ kind: GapItemKind;
16
+ id: string;
17
+ };
18
+ missing: GapName[];
19
+ }
20
+ export interface GapFilter {
21
+ /** Only this Project's gaps. */
22
+ project?: string;
23
+ /** Only the gaps of items this Team owns. */
24
+ owner?: string;
25
+ }
26
+ /**
27
+ * Every gap in the Model: the fields a reader would expect filled and finds
28
+ * empty, as the table under "What counts as a gap" in the fill-gaps guide
29
+ * sets them out.
30
+ *
31
+ * - Every Element: `description`.
32
+ * - A Service or Component: `technology`.
33
+ * - A Service you run (`type: app`, not External): `repository`.
34
+ * - A Service not External: `deployments` when it has none.
35
+ * - A Service you run that a non-Person calls: `api-docs` when no `links`
36
+ * label and no Deployment `endpoints` name matches api, openapi or swagger.
37
+ * - A Relationship: `description`, `technology`; an async one also `channel`.
38
+ * - A Deployment of a Service you run: `url`.
39
+ *
40
+ * Ordered by Project, then Owner Team; within a Team, Elements, then
41
+ * Relationships, then Deployments, each in Bundle order. A Gap names its
42
+ * Project by the item's id (a Relationship by its consumer's, a Deployment by
43
+ * its Service's) and its Owner as the item's effective Owner. Gaps are never
44
+ * part of `check`: a gap is incompleteness, not an error.
45
+ */
46
+ export declare function listGaps(bundle: Bundle, filter?: GapFilter): Gap[];
47
+ /**
48
+ * Gaps as Markdown: a `##` heading per Project, a `###` heading per Owner
49
+ * Team, and one line per item naming its empty fields. An Element is named
50
+ * by its kind and id, `service shop:web`, so `bundle` is the one the gaps
51
+ * came from. No gaps print nothing.
52
+ */
53
+ export declare function formatGaps(gaps: Gap[], bundle: Pick<Bundle, "elements">): string;
@@ -0,0 +1,96 @@
1
+ import { cmp } from "./query.js";
2
+ /** The fields a gap can name. `api-docs` and `deployments` are not fields but what the Model lacks. */
3
+ export const gapNames = ["description", "technology", "repository", "deployments", "api-docs", "channel", "url"];
4
+ const API_DOCS = /api|openapi|swagger/i;
5
+ const projectOf = (id) => id.split(":")[0];
6
+ /** A Service the organization runs: not External, and an application rather than a datastore or broker. */
7
+ const isApp = (e) => e?.kind === "service" && !e.external && e.type === "app";
8
+ /** Empty: unset, or set to nothing. */
9
+ const empty = (value) => value === null || value === undefined || value === "";
10
+ /**
11
+ * Every gap in the Model: the fields a reader would expect filled and finds
12
+ * empty, as the table under "What counts as a gap" in the fill-gaps guide
13
+ * sets them out.
14
+ *
15
+ * - Every Element: `description`.
16
+ * - A Service or Component: `technology`.
17
+ * - A Service you run (`type: app`, not External): `repository`.
18
+ * - A Service not External: `deployments` when it has none.
19
+ * - A Service you run that a non-Person calls: `api-docs` when no `links`
20
+ * label and no Deployment `endpoints` name matches api, openapi or swagger.
21
+ * - A Relationship: `description`, `technology`; an async one also `channel`.
22
+ * - A Deployment of a Service you run: `url`.
23
+ *
24
+ * Ordered by Project, then Owner Team; within a Team, Elements, then
25
+ * Relationships, then Deployments, each in Bundle order. A Gap names its
26
+ * Project by the item's id (a Relationship by its consumer's, a Deployment by
27
+ * its Service's) and its Owner as the item's effective Owner. Gaps are never
28
+ * part of `check`: a gap is incompleteness, not an error.
29
+ */
30
+ export function listGaps(bundle, filter = {}) {
31
+ const byId = new Map(bundle.elements.map((e) => [e.id, e]));
32
+ const deploymentsOf = new Map();
33
+ for (const d of bundle.deployments)
34
+ deploymentsOf.set(d.service, [...(deploymentsOf.get(d.service) ?? []), d]);
35
+ const called = new Set(bundle.relationships.filter((r) => byId.get(r.from)?.kind !== "person").map((r) => r.to));
36
+ const gaps = [];
37
+ const add = (project, owner, kind, id, missing) => {
38
+ const names = missing.filter((m) => m !== false);
39
+ if (names.length)
40
+ gaps.push({ project, owner, item: { kind, id }, missing: names });
41
+ };
42
+ for (const e of bundle.elements) {
43
+ const runs = deploymentsOf.get(e.id) ?? [];
44
+ const app = isApp(e);
45
+ const documented = () => [...e.links.map((l) => l.label), ...runs.flatMap((d) => d.endpoints.map((p) => p.name))].some((name) => API_DOCS.test(name));
46
+ add(projectOf(e.id), e.owner, "element", e.id, [
47
+ empty(e.description) && "description",
48
+ (e.kind === "service" || e.kind === "component") && empty(e.technology) && "technology",
49
+ app && e.kind === "service" && empty(e.repository) && "repository",
50
+ e.kind === "service" && !e.external && runs.length === 0 && "deployments",
51
+ app && called.has(e.id) && !documented() && "api-docs",
52
+ ]);
53
+ }
54
+ for (const r of bundle.relationships) {
55
+ add(projectOf(r.from), byId.get(r.from)?.owner ?? "", "relationship", `${r.from} -> ${r.to}`, [
56
+ empty(r.description) && "description",
57
+ empty(r.technology) && "technology",
58
+ r.interaction === "async" && empty(r.channel) && "channel",
59
+ ]);
60
+ }
61
+ for (const d of bundle.deployments) {
62
+ if (!isApp(byId.get(d.service)))
63
+ continue;
64
+ add(projectOf(d.service), d.owner, "deployment", `${d.service} in ${d.environment} on ${d.target}`, [empty(d.url) && "url"]);
65
+ }
66
+ // A stable sort keeps each Team's items in the order above.
67
+ return gaps
68
+ .filter((g) => (filter.project === undefined || g.project === filter.project) && (filter.owner === undefined || g.owner === filter.owner))
69
+ .sort((a, b) => cmp(a.project, b.project) || cmp(a.owner, b.owner));
70
+ }
71
+ /**
72
+ * Gaps as Markdown: a `##` heading per Project, a `###` heading per Owner
73
+ * Team, and one line per item naming its empty fields. An Element is named
74
+ * by its kind and id, `service shop:web`, so `bundle` is the one the gaps
75
+ * came from. No gaps print nothing.
76
+ */
77
+ export function formatGaps(gaps, bundle) {
78
+ const kindOf = new Map(bundle.elements.map((e) => [e.id, e.kind]));
79
+ const lines = [];
80
+ let project;
81
+ let owner;
82
+ for (const g of gaps) {
83
+ if (g.project !== project) {
84
+ lines.push(`## ${g.project}`);
85
+ project = g.project;
86
+ owner = undefined;
87
+ }
88
+ if (g.owner !== owner) {
89
+ lines.push(`### ${g.owner}`);
90
+ owner = g.owner;
91
+ }
92
+ const name = g.item.kind === "element" ? `${kindOf.get(g.item.id) ?? "element"} ${g.item.id}` : `${g.item.kind} ${g.item.id}`;
93
+ lines.push(`- ${name}: ${g.missing.join(", ")}`);
94
+ }
95
+ return lines.length ? lines.join("\n") + "\n" : "";
96
+ }
@@ -15,3 +15,4 @@ export { listAdrs, adrsFor, type ListAdrsOptions, type ListedAdr } from "./adrs.
15
15
  export { diff, countChanges, changedIds, changeKinds, type Change, type ChangeKind, type ChangeType, type ChangeItem, type ChangeCounts } from "./diff.ts";
16
16
  export { unionBundle } from "./compare.ts";
17
17
  export { resolveScope, scopeMatcher, filterChanges, type HistoryScope, type ScopeResolution } from "./history-scope.ts";
18
+ export { listGaps, formatGaps, gapNames, type Gap, type GapName, type GapItemKind, type GapFilter } from "./gaps.ts";
@@ -13,3 +13,4 @@ export { listAdrs, adrsFor } from "./adrs.js";
13
13
  export { diff, countChanges, changedIds, changeKinds } from "./diff.js";
14
14
  export { unionBundle } from "./compare.js";
15
15
  export { resolveScope, scopeMatcher, filterChanges } from "./history-scope.js";
16
+ export { listGaps, formatGaps, gapNames } from "./gaps.js";
@@ -1,6 +1,4 @@
1
- /** The skill's name, as its stub and the full SKILL.md both declare it. */
2
- export declare const SKILL_NAME = "archidocs-authoring";
3
- /** The guide's topics, in the order they are listed. `rules` is generated from the rule registry. */
1
+ /** The authoring guide's topics, in the order they are listed. `rules` is generated from the rule registry. */
4
2
  export declare const topics: readonly [{
5
3
  readonly id: "bootstrap";
6
4
  readonly summary: "Declare an existing codebase's Services, Relationships and Deployments in one pass, from an approved inventory.";
@@ -33,9 +31,67 @@ export declare const topics: readonly [{
33
31
  readonly summary: "Every `check` rule id: what it means, a failing example and the fix.";
34
32
  }];
35
33
  export type TopicId = (typeof topics)[number]["id"];
34
+ /** A skill's topic: a reference file under its guide folder's `topics/`, or a generated one. */
35
+ export interface Topic {
36
+ readonly id: string;
37
+ readonly summary: string;
38
+ }
39
+ /** One agent skill: the stub `init` installs, and the guide `get_guide` serves. */
40
+ export interface Skill {
41
+ readonly id: string;
42
+ /** The stub's frontmatter `name`: `archidocs-<id>`, since `.agents/skills/` has no namespace. */
43
+ readonly name: string;
44
+ /** The stub's frontmatter `description`, which decides when the skill fires. */
45
+ readonly description: string;
46
+ /** The folder under `guide/` that holds its SKILL.md (and `topics/`), with a trailing slash; `""` for authoring. */
47
+ readonly dir: string;
48
+ readonly topics?: readonly Topic[];
49
+ }
50
+ /** Every skill, authoring first. */
51
+ export declare const skills: readonly [{
52
+ readonly id: "authoring";
53
+ readonly name: "archidocs-authoring";
54
+ readonly description: "Edit the Archidocs architecture Model. Use when bootstrapping a Project from code, adding or changing Services, Relationships, Deployments or Views, proposing an ADR, or finding and filling documentation gaps.";
55
+ readonly dir: "";
56
+ readonly topics: readonly [{
57
+ readonly id: "bootstrap";
58
+ readonly summary: "Declare an existing codebase's Services, Relationships and Deployments in one pass, from an approved inventory.";
59
+ }, {
60
+ readonly id: "add-service";
61
+ readonly summary: "Add one Service with its Components, Relationships and Deployments.";
62
+ }, {
63
+ readonly id: "relationships";
64
+ readonly summary: "Declare a dependency, including async ones through a broker (`via`, `channel`) and cross-Project ones.";
65
+ }, {
66
+ readonly id: "deployments";
67
+ readonly summary: "Add Deployment Targets and Deployments, with their URLs, per Environment.";
68
+ }, {
69
+ readonly id: "dynamic-view";
70
+ readonly summary: "Draft a scenario as Steps over existing Relationships, adding missing ones.";
71
+ }, {
72
+ readonly id: "saved-view";
73
+ readonly summary: "Save a structural or Deployment View with selectors and a Lens.";
74
+ }, {
75
+ readonly id: "propose-adr";
76
+ readonly summary: "Propose an ADR linked to the Elements and Views it affects.";
77
+ }, {
78
+ readonly id: "fill-gaps";
79
+ readonly summary: "Interview the user about the fields the Model leaves empty, proposing each value from evidence in the code and writing it as it is confirmed.";
80
+ }, {
81
+ readonly id: "change";
82
+ readonly summary: "Rename, move or remove, working through refused removals by their references.";
83
+ }, {
84
+ readonly id: "rules";
85
+ readonly summary: "Every `check` rule id: what it means, a failing example and the fix.";
86
+ }];
87
+ }];
88
+ export type SkillId = (typeof skills)[number]["id"];
89
+ /** The authoring skill's name, as its stub and the full SKILL.md both declare it. */
90
+ export declare const SKILL_NAME: "archidocs-authoring";
36
91
  export type GuideResult = {
37
92
  ok: true;
38
- topic: TopicId | null;
93
+ skill: string;
94
+ topic: string | null;
39
95
  text: string;
40
96
  } | {
41
97
  ok: false;
@@ -43,15 +99,19 @@ export type GuideResult = {
43
99
  suggestion?: string;
44
100
  };
45
101
  /**
46
- * The guide as `get_authoring_guide` and `archidocs guide` serve it: with no
47
- * topic, SKILL.md followed by the list of topics; with one, that topic's
48
- * reference file.
102
+ * A skill's guide as `get_guide` and `archidocs guide --skill` serve it: with
103
+ * no topic, its SKILL.md, followed by its list of topics if it has any; with
104
+ * one, that topic's reference file. An unknown skill names the closest one.
49
105
  */
50
- export declare function authoringGuide(topic?: string): Promise<GuideResult>;
106
+ export declare function guide(skill: string, topic?: string): Promise<GuideResult>;
107
+ /** One skill's guide, for `guide` once the skill is found. */
108
+ export declare function skillGuide(skill: Skill, topic?: string): Promise<GuideResult>;
109
+ /** The authoring guide, as `get_authoring_guide` and `archidocs guide` without `--skill` serve it. */
110
+ export declare const authoringGuide: (topic?: string) => Promise<GuideResult>;
51
111
  /**
52
- * The thin SKILL.md that `archidocs init` installs in a repo, naming the
53
- * command that runs archidocs there (`runner`, such as `npx archidocs`). It
54
- * only points at the served guide, so it never goes stale, and uses only the
55
- * portable frontmatter fields.
112
+ * The thin SKILL.md that `archidocs init` installs in a repo for one skill,
113
+ * naming the command that runs archidocs there (`runner`, such as `npx
114
+ * archidocs`). It only points at the served guide, so it never goes stale, and
115
+ * uses only the portable frontmatter fields.
56
116
  */
57
- export declare const skillStub: (runner: string) => string;
117
+ export declare function skillStub(id: SkillId, runner: string): string;
@@ -2,14 +2,12 @@ import { readFile } from "node:fs/promises";
2
2
  import { ruleCatalogue } from "../core/catalogue.js";
3
3
  import { suggest } from "../core/suggest.js";
4
4
  /**
5
- * The authoring guide's Markdown, shipped beside the code in `guide/`. The
5
+ * The skills' guides, as Markdown shipped beside the code in `guide/`. The
6
6
  * module runs from dist/guide/ when installed and from src/guide/ in this
7
7
  * repo; both sit two levels below the package root.
8
8
  */
9
9
  const GUIDE_DIR = new URL("../../guide/", import.meta.url);
10
- /** The skill's name, as its stub and the full SKILL.md both declare it. */
11
- export const SKILL_NAME = "archidocs-authoring";
12
- /** The guide's topics, in the order they are listed. `rules` is generated from the rule registry. */
10
+ /** The authoring guide's topics, in the order they are listed. `rules` is generated from the rule registry. */
13
11
  export const topics = [
14
12
  { id: "bootstrap", summary: "Declare an existing codebase's Services, Relationships and Deployments in one pass, from an approved inventory." },
15
13
  { id: "add-service", summary: "Add one Service with its Components, Relationships and Deployments." },
@@ -22,38 +20,73 @@ export const topics = [
22
20
  { id: "change", summary: "Rename, move or remove, working through refused removals by their references." },
23
21
  { id: "rules", summary: "Every `check` rule id: what it means, a failing example and the fix." },
24
22
  ];
23
+ /** Every skill, authoring first. */
24
+ export const skills = [
25
+ {
26
+ id: "authoring",
27
+ name: "archidocs-authoring",
28
+ description: "Edit the Archidocs architecture Model. Use when bootstrapping a Project from code, adding or changing Services, Relationships, Deployments or Views, proposing an ADR, or finding and filling documentation gaps.",
29
+ dir: "",
30
+ topics,
31
+ },
32
+ ];
33
+ /** The authoring skill's name, as its stub and the full SKILL.md both declare it. */
34
+ export const SKILL_NAME = skills[0].name;
25
35
  /**
26
- * The guide as `get_authoring_guide` and `archidocs guide` serve it: with no
27
- * topic, SKILL.md followed by the list of topics; with one, that topic's
28
- * reference file.
36
+ * A skill's guide as `get_guide` and `archidocs guide --skill` serve it: with
37
+ * no topic, its SKILL.md, followed by its list of topics if it has any; with
38
+ * one, that topic's reference file. An unknown skill names the closest one.
29
39
  */
30
- export async function authoringGuide(topic) {
40
+ export async function guide(skill, topic) {
41
+ const found = skills.find((s) => s.id === skill);
42
+ if (!found) {
43
+ const ids = skills.map((s) => s.id);
44
+ const suggestion = suggest(skill, ids);
45
+ return { ok: false, message: `Unknown skill "${skill}"${suggestion ? `; did you mean "${suggestion}"?` : ""} Skills: ${ids.join(", ")}.`, ...(suggestion ? { suggestion } : {}) };
46
+ }
47
+ return skillGuide(found, topic);
48
+ }
49
+ /** One skill's guide, for `guide` once the skill is found. */
50
+ export async function skillGuide(skill, topic) {
51
+ const own = skill.topics ?? [];
31
52
  if (topic === undefined) {
32
- const skill = await readFile(new URL("SKILL.md", GUIDE_DIR), "utf8");
33
- const list = ["## Topics", "", ...topics.map((t) => `- \`${t.id}\`: ${t.summary}`)];
34
- return { ok: true, topic: null, text: `${skill.trimEnd()}\n\n${list.join("\n")}\n` };
53
+ const text = (await readFile(new URL(`${skill.dir}SKILL.md`, GUIDE_DIR), "utf8")).trimEnd();
54
+ const list = own.length ? ["", "", "## Topics", "", ...own.map((t) => `- \`${t.id}\`: ${t.summary}`)].join("\n") : "";
55
+ return { ok: true, skill: skill.id, topic: null, text: `${text}${list}\n` };
35
56
  }
36
- const found = topics.find((t) => t.id === topic);
57
+ if (!own.length)
58
+ return { ok: false, message: `The skill "${skill.id}" has no topics; load it with no topic.` };
59
+ const found = own.find((t) => t.id === topic);
37
60
  if (!found) {
38
- const suggestion = suggest(topic, topics.map((t) => t.id));
39
- return { ok: false, message: `Unknown topic "${topic}"${suggestion ? `; did you mean "${suggestion}"?` : ""} Topics: ${topics.map((t) => t.id).join(", ")}.`, ...(suggestion ? { suggestion } : {}) };
61
+ const suggestion = suggest(topic, own.map((t) => t.id));
62
+ return { ok: false, message: `Unknown topic "${topic}"${suggestion ? `; did you mean "${suggestion}"?` : ""} Topics: ${own.map((t) => t.id).join(", ")}.`, ...(suggestion ? { suggestion } : {}) };
40
63
  }
41
- if (found.id === "rules")
42
- return { ok: true, topic: found.id, text: ruleCatalogue() };
43
- return { ok: true, topic: found.id, text: await readFile(new URL(`topics/${found.id}.md`, GUIDE_DIR), "utf8") };
64
+ if (skill.id === "authoring" && found.id === "rules")
65
+ return { ok: true, skill: skill.id, topic: found.id, text: ruleCatalogue() };
66
+ return { ok: true, skill: skill.id, topic: found.id, text: await readFile(new URL(`${skill.dir}topics/${found.id}.md`, GUIDE_DIR), "utf8") };
44
67
  }
68
+ /** The authoring guide, as `get_authoring_guide` and `archidocs guide` without `--skill` serve it. */
69
+ export const authoringGuide = (topic) => guide("authoring", topic);
70
+ const titleOf = (id) => `Archidocs ${id.replaceAll("-", " ")}`;
45
71
  /**
46
- * The thin SKILL.md that `archidocs init` installs in a repo, naming the
47
- * command that runs archidocs there (`runner`, such as `npx archidocs`). It
48
- * only points at the served guide, so it never goes stale, and uses only the
49
- * portable frontmatter fields.
72
+ * The thin SKILL.md that `archidocs init` installs in a repo for one skill,
73
+ * naming the command that runs archidocs there (`runner`, such as `npx
74
+ * archidocs`). It only points at the served guide, so it never goes stale, and
75
+ * uses only the portable frontmatter fields.
50
76
  */
51
- export const skillStub = (runner) => `---
52
- name: ${SKILL_NAME}
53
- description: Edit the Archidocs architecture Model. Use when bootstrapping a Project from code, adding or changing Services, Relationships, Deployments or Views, proposing an ADR, or finding and filling documentation gaps.
77
+ export function skillStub(id, runner) {
78
+ const skill = skills.find((s) => s.id === id);
79
+ const cli = (args) => `\`${runner} guide ${args}\``;
80
+ const load = skill.id === "authoring"
81
+ ? `Before editing the Model, load the full guide: call \`get_guide("authoring")\` on the Archidocs MCP server (\`get_authoring_guide\` on a server older than \`get_guide\`), or run ${cli("--skill authoring")} when no Archidocs MCP server is connected. It lists the topics; load the one for the task with \`get_guide("authoring", topic)\` or ${cli("<topic> --skill authoring")}, and follow it.`
82
+ : `Before you start, load the full guide: call \`get_guide("${skill.id}")\` on the Archidocs MCP server, or run ${cli(`--skill ${skill.id}`)} when no Archidocs MCP server is connected, and follow it.`;
83
+ return `---
84
+ name: ${skill.name}
85
+ description: ${skill.description}
54
86
  ---
55
87
 
56
- # Archidocs authoring
88
+ # ${titleOf(skill.id)}
57
89
 
58
- Before editing the Model, load the full guide: call the \`get_authoring_guide\` tool of the Archidocs MCP server, or run \`${runner} guide\` when no Archidocs MCP server is connected. It lists the topics; load the one for the task with \`get_authoring_guide(topic)\` or \`${runner} guide <topic>\`, and follow it.${runner === "archidocs" ? "" : ` In this repo, run every \`archidocs\` command as \`${runner}\`.`}
90
+ ${load}${runner === "archidocs" ? "" : ` In this repo, run every \`archidocs\` command as \`${runner}\`.`}
59
91
  `;
92
+ }
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  import { getDeployments } from "../core/deployments.js";
4
4
  import { withDocs } from "../core/rules.js";
5
5
  import { search } from "../core/search.js";
6
- import { changeKinds, countChanges, deriveEdges, diff, filterChanges, findPaths, getImpact, levelOf, listOwned, resolveScope, scopeMatcher, } from "../core/index.js";
6
+ import { changeKinds, countChanges, deriveEdges, diff, filterChanges, findPaths, formatGaps, gapNames, getImpact, listGaps, levelOf, listOwned, resolveScope, scopeMatcher, } from "../core/index.js";
7
7
  import { suggest } from "../core/suggest.js";
8
8
  import { describeLens, isScaled, listViews, resolveView } from "../core/views/index.js";
9
9
  import { listAdrs } from "../core/adrs.js";
@@ -13,7 +13,7 @@ import { POINT_GRAMMAR, touching } from "../revisions/index.js";
13
13
  import { pastOf } from "./history.js";
14
14
  import { registerWriteTools } from "./writes.js";
15
15
  import { callLine } from "./announce.js";
16
- import { authoringGuide, topics } from "../guide/index.js";
16
+ import { authoringGuide, guide as skillGuide, skills, topics } from "../guide/index.js";
17
17
  const ok = (data, text) => ({ ok: true, data, text });
18
18
  const fail = (code, message, suggestions) => ({ ok: false, code, message, ...(suggestions ? { suggestions } : {}) });
19
19
  /**
@@ -421,6 +421,30 @@ export function createServer(options) {
421
421
  ]),
422
422
  ].join("\n"));
423
423
  });
424
+ tool("list_gaps", {
425
+ title: "List gaps",
426
+ description: "What the Model leaves empty, grouped by Project and Owner Team: an Element's `description`; a Service's or Component's `technology`; for a Service you run (`type: app`, not external) its `repository`, its `deployments` when it has none (any non-external Service), and `api-docs` when a non-Person calls it and no `links` label or Deployment `endpoints` name mentions api, openapi or swagger; a Relationship's `description` and `technology`, and an async one's `channel`; a Deployment `url` of a Service you run. Tags, links, metadata and Owners are never gaps. Use it to find what to fill.",
427
+ input: z.object({
428
+ project: z.string().min(1).optional().describe("Only this Project's gaps"),
429
+ owner: z.string().min(1).optional().describe("Only the gaps of items this Team owns"),
430
+ }),
431
+ output: z.object({
432
+ total: z.number(),
433
+ gaps: z.array(z.object({
434
+ project: z.string(),
435
+ owner: z.string(),
436
+ item: z.object({ kind: z.enum(["element", "relationship", "deployment"]), id: z.string() }),
437
+ missing: z.array(z.enum(gapNames)),
438
+ })),
439
+ }),
440
+ }, ({ project, owner }, { bundle }) => {
441
+ if (project !== undefined && !bundle.projects.some((p) => p.id === project))
442
+ return notFound("Project", project, bundle.projects.map((p) => p.id));
443
+ if (owner !== undefined && !bundle.teams.some((t) => t.id === owner))
444
+ return notFound("Team", owner, bundle.teams.map((t) => t.id));
445
+ const gaps = listGaps(bundle, { ...(project === undefined ? {} : { project }), ...(owner === undefined ? {} : { owner }) });
446
+ return ok({ total: gaps.length, gaps }, gaps.length ? `${count(gaps.length, "item")} with gaps.\n${formatGaps(gaps, bundle)}` : "No gaps.");
447
+ });
424
448
  tool("list_owned", {
425
449
  title: "List owned",
426
450
  description: "The Elements and Deployment Targets a Team owns, grouped by kind, each with counts of the other Teams upstream (depending on it) and downstream (it depends on). An Element is listed under its own Owner, whoever owns its parent.",
@@ -636,27 +660,46 @@ export function createServer(options) {
636
660
  ...issues.map((i) => `- ${i.file}:${i.line} ${i.severity} ${i.rule}: ${i.message}`),
637
661
  ].join("\n"));
638
662
  });
639
- const GuideInput = z.object({
640
- topic: z.string().min(1).optional().describe(`One topic's reference file: ${topics.map((t) => t.id).join(", ")}`),
641
- // Taken like every read tool's, but the guide ships with this Archidocs, so it is the same at every point.
663
+ // Taken like every read tool's, but the guides ship with this Archidocs, so they are the same at every point.
664
+ const topicArg = (of) => z.string().min(1).optional().describe(`One topic's reference file${of}`);
665
+ const GuideOutput = z.object({ topic: z.string().nullable(), topics: z.array(z.object({ id: z.string(), summary: z.string() })), text: z.string() });
666
+ /** A guide as a tool result: the ids of what was served, the skill's topics and the text. */
667
+ const guideResult = (served, extra) => {
668
+ if (!served.ok)
669
+ return toResult(fail("not_found", served.message, served.suggestion ? [served.suggestion] : undefined));
670
+ return toResult(ok({ ...extra(served), topic: served.topic, topics: [...(skills.find((s) => s.id === served.skill)?.topics ?? [])].map((t) => ({ ...t })), text: served.text }, served.text));
671
+ };
672
+ const GetGuideInput = z.object({
673
+ skill: z.string().min(1).describe(`The skill: ${skills.map((s) => s.id).join(", ")}`),
674
+ topic: topicArg(`, for a skill that has topics; authoring's are ${topics.map((t) => t.id).join(", ")}`),
642
675
  at: At.optional(),
643
676
  });
644
- server.registerTool("get_authoring_guide", {
645
- title: "Authoring guide",
646
- description: "How to edit the Model with the write tools. With no topic: the archidocs-authoring skill (the Model, the edit loop) and its list of topics. With a topic: that flow's reference file; `rules` is the catalog of every check rule. Load it before writing.",
647
- inputSchema: advertise(GuideInput),
648
- outputSchema: z.object({ topic: z.string().nullable(), topics: z.array(z.object({ id: z.string(), summary: z.string() })), text: z.string() }),
677
+ server.registerTool("get_guide", {
678
+ title: "Skill guide",
679
+ description: "Load an Archidocs agent skill's full guide, from this version. With no topic: the skill's SKILL.md, and for `authoring` (the Model, the edit loop) its list of topics. With a topic: that flow's reference file; authoring's `rules` is the catalog of every check rule. Load `authoring` before writing.",
680
+ inputSchema: advertise(GetGuideInput),
681
+ outputSchema: GuideOutput.extend({ skill: z.string() }),
649
682
  annotations: { readOnlyHint: true, openWorldHint: false },
650
683
  },
651
- // The guide ships with this version, so it answers whatever the state of the source.
684
+ // The guides ship with this version, so they answer whatever the state of the source.
652
685
  async (raw) => {
686
+ const args = GetGuideInput.safeParse(raw ?? {});
687
+ if (!args.success)
688
+ return toResult(fail("invalid_input", z.prettifyError(args.error)));
689
+ return guideResult(await skillGuide(args.data.skill, args.data.topic), (g) => ({ skill: g.skill }));
690
+ });
691
+ const GuideInput = z.object({ topic: topicArg(`: ${topics.map((t) => t.id).join(", ")}`), at: At.optional() });
692
+ server.registerTool("get_authoring_guide", {
693
+ title: "Authoring guide (deprecated)",
694
+ description: "Deprecated in favour of `get_guide`, which serves every skill: this returns the same as `get_guide(\"authoring\", topic)`. With no topic: the archidocs-authoring skill (the Model, the edit loop) and its list of topics. With a topic: that flow's reference file; `rules` is the catalog of every check rule.",
695
+ inputSchema: advertise(GuideInput),
696
+ outputSchema: GuideOutput,
697
+ annotations: { readOnlyHint: true, openWorldHint: false },
698
+ }, async (raw) => {
653
699
  const args = GuideInput.safeParse(raw ?? {});
654
700
  if (!args.success)
655
701
  return toResult(fail("invalid_input", z.prettifyError(args.error)));
656
- const guide = await authoringGuide(args.data.topic);
657
- if (!guide.ok)
658
- return toResult(fail("not_found", guide.message, guide.suggestion ? [guide.suggestion] : undefined));
659
- return toResult(ok({ topic: guide.topic, topics: topics.map((t) => ({ ...t })), text: guide.text }, guide.text));
702
+ return guideResult(await authoringGuide(args.data.topic), () => ({}));
660
703
  });
661
704
  registerWriteTools(server, source, writesAllowed ? undefined : readOnlyReason, logged);
662
705
  return server;
package/guide/SKILL.md CHANGED
@@ -7,7 +7,7 @@ description: Edit the Archidocs architecture Model. Use when bootstrapping a Pro
7
7
 
8
8
  The Model is YAML in a Workspace: `workspace.yaml` defines Teams and Environments, and each Project folder (marked by `project.yaml`) declares its Elements, Relationships, Deployment Targets, Deployments and Saved Views. You need two things: code you can read, and a writable Workspace checkout served by `archidocs mcp --workspace <path>`.
9
9
 
10
- Load the topic for the task before you write: `get_authoring_guide(topic)`, or `archidocs guide <topic>` without MCP.
10
+ Load the topic for the task before you write: `get_guide("authoring", topic)`, or `archidocs guide <topic>` without MCP.
11
11
 
12
12
  The CLI commands in this guide, such as `archidocs check`, assume a global install. When there is none, run them the way the repo's AGENTS.md says, such as `npx archidocs check`.
13
13
 
@@ -34,6 +34,30 @@ services:
34
34
 
35
35
  Impact and path queries count the broker as a hop and as a dependency of both sides. An async Relationship with no broker (a webhook, a callback) leaves out `via`.
36
36
 
37
+ ## Gateways and proxies
38
+
39
+ An API gateway or reverse proxy (Apigee, Kong, nginx) is a Service in the path by default, `technology` naming the product and `owner` the Team that runs it. The consumer points `to` the gateway, and the gateway `to` the API:
40
+
41
+ ```yaml
42
+ # web, in the shop Project
43
+ relationships:
44
+ - to: platform:apigee
45
+ description: Places orders through
46
+ technology: HTTPS
47
+
48
+ # apigee, in the platform Project
49
+ apigee:
50
+ name: API Gateway
51
+ technology: Apigee
52
+ owner: platform-team
53
+ relationships:
54
+ - to: shop:api
55
+ description: Routes order requests to
56
+ technology: HTTPS
57
+ ```
58
+
59
+ When the gateway is shared infrastructure nobody needs to see, leave it out: `web` points `to` the API directly with `technology: HTTPS via Apigee`. Impact and paths then skip the hop. Either way, the gateway's URL is the API's consumer-facing Deployment `url`. See ADR 0005.
60
+
37
61
  ## Cross-Project
38
62
 
39
63
  Declare only this Project's outbound Relationships. When the provider isn't in the Model, leave the Relationship out and tell the user it is a gap for the provider's Team; create Elements only in this Project. A provider outside the organization may be added here as an External Service.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archidocs",
3
- "version": "1.4.0-beta.3",
3
+ "version": "1.4.0-beta.4",
4
4
  "description": "Git-native architecture as code: check and bundle a Workspace of Projects.",
5
5
  "type": "module",
6
6
  "license": "MIT",