@laitszkin/apollo-toolkit 3.11.7 → 3.11.8
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/CHANGELOG.md +18 -0
- package/README.md +0 -2
- package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
- package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
- package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
- package/docs-to-voice/SKILL.md +3 -30
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/generate-spec/SKILL.md +51 -130
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/init-project-html/SKILL.md +3 -25
- package/init-project-html/lib/atlas/cli.js +897 -43
- package/init-project-html/scripts/architecture.js +4 -25
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/lib/cli.js +166 -20
- package/lib/tool-runner.js +418 -2
- package/open-github-issue/SKILL.md +7 -98
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/optimise-skill/SKILL.md +7 -6
- package/optimise-skill/references/definition.md +38 -0
- package/optimise-skill/references/example_skill.md +7 -6
- package/package.json +1 -1
- package/read-github-issue/SKILL.md +6 -46
- package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
- package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
- package/resolve-review-comments/SKILL.md +4 -26
- package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
- package/scripts/validate_openai_agent_config.py +16 -1
- package/scripts/validate_skill_frontmatter.py +16 -1
- package/spec-to-project-html/SKILL.md +2 -14
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/update-project-html/SKILL.md +3 -19
- package/weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift +32 -4
- package/maintain-skill-catalog/README.md +0 -18
- package/maintain-skill-catalog/SKILL.md +0 -72
- package/maintain-skill-catalog/agents/openai.yaml +0 -4
|
@@ -45,46 +45,894 @@ const COORDINATION_FILE = 'coordination.md';
|
|
|
45
45
|
const REMOVED_TXT = '_removed.txt';
|
|
46
46
|
const DEFAULT_DIFF_OUT_REL = path.join('.apollo-toolkit', 'architecture-diff');
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
48
|
+
function buildHelpPage({ title, summary, usageLines, useWhen, requiredFlags, optionalFlags, notes, examples }) {
|
|
49
|
+
const lines = [title];
|
|
50
|
+
|
|
51
|
+
if (summary) {
|
|
52
|
+
lines.push('', summary);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (usageLines?.length) {
|
|
56
|
+
lines.push('', 'Usage:', ...usageLines.map((line) => ` ${line}`));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (useWhen?.length) {
|
|
60
|
+
lines.push('', 'Use this when:', ...useWhen.map((line) => ` - ${line}`));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (requiredFlags?.length) {
|
|
64
|
+
lines.push('', 'Required flags:', ...requiredFlags.map((line) => ` - ${line}`));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (optionalFlags?.length) {
|
|
68
|
+
lines.push('', 'Optional flags:', ...optionalFlags.map((line) => ` - ${line}`));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (notes?.length) {
|
|
72
|
+
lines.push('', 'Notes:', ...notes.map((line) => ` - ${line}`));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (examples?.length) {
|
|
76
|
+
lines.push('', 'Examples:');
|
|
77
|
+
for (const { command, result } of examples) {
|
|
78
|
+
lines.push(` ${command}`, ` Result: ${result}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return lines.join('\n');
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function buildArchitectureHelpPage(verb = null, subverb = null) {
|
|
86
|
+
const mutationFlags = [
|
|
87
|
+
'`--project <root>` to target a specific repository root.',
|
|
88
|
+
'`--spec <spec_dir>` to write into a spec overlay instead of the base atlas.',
|
|
89
|
+
'`--no-render` to batch several mutations before one final render.',
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
const familyPages = {
|
|
93
|
+
feature: buildHelpPage({
|
|
94
|
+
title: 'apltk architecture feature — manage feature modules.',
|
|
95
|
+
summary: 'Add, update, or remove top-level feature records in the atlas state.',
|
|
96
|
+
usageLines: [
|
|
97
|
+
'apltk architecture feature add --slug <feature> [--title "..."] [--story "..."] [--depends-on a,b]',
|
|
98
|
+
'apltk architecture feature set --slug <feature> [--title "..."] [--story "..."] [--depends-on a,b]',
|
|
99
|
+
'apltk architecture feature remove --slug <feature>',
|
|
100
|
+
],
|
|
101
|
+
useWhen: [
|
|
102
|
+
'You need to create or rename the high-level feature inventory before editing its submodules.',
|
|
103
|
+
],
|
|
104
|
+
notes: [
|
|
105
|
+
'Run `apltk architecture feature add --help`, `set --help`, or `remove --help` for action-specific details.',
|
|
106
|
+
],
|
|
107
|
+
examples: [
|
|
108
|
+
{
|
|
109
|
+
command: 'apltk architecture feature add --slug register --title "User registration"',
|
|
110
|
+
result: 'Creates the feature YAML entry and prints `atlas: feature add applied` unless validation fails.',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
}),
|
|
114
|
+
submodule: buildHelpPage({
|
|
115
|
+
title: 'apltk architecture submodule — manage feature sub-modules.',
|
|
116
|
+
summary: 'Add, update, or remove submodules inside a feature.',
|
|
117
|
+
usageLines: [
|
|
118
|
+
'apltk architecture submodule add --feature <feature> --slug <submodule> [--kind service] [--role "..."]',
|
|
119
|
+
'apltk architecture submodule set --feature <feature> --slug <submodule> [--kind service] [--role "..."]',
|
|
120
|
+
'apltk architecture submodule remove --feature <feature> --slug <submodule>',
|
|
121
|
+
],
|
|
122
|
+
useWhen: [
|
|
123
|
+
'You need to model the internal components that belong to one feature.',
|
|
124
|
+
],
|
|
125
|
+
notes: [
|
|
126
|
+
'Run `apltk architecture submodule add --help`, `set --help`, or `remove --help` for action-specific details.',
|
|
127
|
+
],
|
|
128
|
+
examples: [
|
|
129
|
+
{
|
|
130
|
+
command: 'apltk architecture submodule add --feature register --slug api --kind api --role "HTTP endpoint"',
|
|
131
|
+
result: 'Adds the submodule and prints `atlas: submodule add applied` after the atlas state is updated.',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
}),
|
|
135
|
+
function: buildHelpPage({
|
|
136
|
+
title: 'apltk architecture function — manage function rows on one submodule.',
|
|
137
|
+
summary: 'Add or remove function I/O rows that internal dataflow steps can reference.',
|
|
138
|
+
usageLines: [
|
|
139
|
+
'apltk architecture function add --feature <feature> --submodule <submodule> --name <function> [--in "..."] [--out "..."] [--side "..."] [--purpose "..."]',
|
|
140
|
+
'apltk architecture function remove --feature <feature> --submodule <submodule> --name <function>',
|
|
141
|
+
],
|
|
142
|
+
useWhen: [
|
|
143
|
+
'You need declared function names before attaching them to internal dataflow steps.',
|
|
144
|
+
],
|
|
145
|
+
notes: [
|
|
146
|
+
'Run `apltk architecture function add --help` or `remove --help` for action-specific details.',
|
|
147
|
+
],
|
|
148
|
+
examples: [
|
|
149
|
+
{
|
|
150
|
+
command: 'apltk architecture function add --feature register --submodule api --name handlePost --side network',
|
|
151
|
+
result: 'Adds the function row and prints `atlas: function add applied`.',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
}),
|
|
155
|
+
variable: buildHelpPage({
|
|
156
|
+
title: 'apltk architecture variable — manage variable rows on one submodule.',
|
|
157
|
+
summary: 'Add or remove variable rows that dataflow steps can read from or write to.',
|
|
158
|
+
usageLines: [
|
|
159
|
+
'apltk architecture variable add --feature <feature> --submodule <submodule> --name <variable> [--type "..."] [--scope "..."] [--purpose "..."]',
|
|
160
|
+
'apltk architecture variable remove --feature <feature> --submodule <submodule> --name <variable>',
|
|
161
|
+
],
|
|
162
|
+
useWhen: [
|
|
163
|
+
'You need declared variable names before referencing them through `--reads` or `--writes` in dataflow steps.',
|
|
164
|
+
],
|
|
165
|
+
notes: [
|
|
166
|
+
'Run `apltk architecture variable add --help` or `remove --help` for action-specific details.',
|
|
167
|
+
],
|
|
168
|
+
examples: [
|
|
169
|
+
{
|
|
170
|
+
command: 'apltk architecture variable add --feature register --submodule api --name token --type string --scope call',
|
|
171
|
+
result: 'Adds the variable row and prints `atlas: variable add applied`.',
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
}),
|
|
175
|
+
dataflow: buildHelpPage({
|
|
176
|
+
title: 'apltk architecture dataflow — manage ordered internal flow steps.',
|
|
177
|
+
summary: 'Add, remove, or reorder the internal dataflow of one submodule.',
|
|
178
|
+
usageLines: [
|
|
179
|
+
'apltk architecture dataflow add --feature <feature> --submodule <submodule> --step "..." [--at <index>] [--fn <name>] [--reads a,b] [--writes x,y]',
|
|
180
|
+
'apltk architecture dataflow remove --feature <feature> --submodule <submodule> (--step "..." | --at <index>)',
|
|
181
|
+
'apltk architecture dataflow reorder --feature <feature> --submodule <submodule> --from <index> --to <index>',
|
|
182
|
+
],
|
|
183
|
+
useWhen: [
|
|
184
|
+
'You need the submodule page to show its ordered internal execution steps instead of only static tables.',
|
|
185
|
+
],
|
|
186
|
+
notes: [
|
|
187
|
+
'Run `apltk architecture dataflow add --help`, `remove --help`, or `reorder --help` for action-specific details.',
|
|
188
|
+
],
|
|
189
|
+
examples: [
|
|
190
|
+
{
|
|
191
|
+
command: 'apltk architecture dataflow add --feature register --submodule api --step "Validate body" --fn handlePost --reads body --writes token',
|
|
192
|
+
result: 'Adds an annotated dataflow step and prints `atlas: dataflow add applied`.',
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
}),
|
|
196
|
+
error: buildHelpPage({
|
|
197
|
+
title: 'apltk architecture error — manage local error rows.',
|
|
198
|
+
summary: 'Add or remove named error rows for a submodule.',
|
|
199
|
+
usageLines: [
|
|
200
|
+
'apltk architecture error add --feature <feature> --submodule <submodule> --name <error> [--when "..."] [--means "..."]',
|
|
201
|
+
'apltk architecture error remove --feature <feature> --submodule <submodule> --name <error>',
|
|
202
|
+
],
|
|
203
|
+
useWhen: [
|
|
204
|
+
'You need a submodule page to declare local errors that stay within that submodule boundary.',
|
|
205
|
+
],
|
|
206
|
+
notes: [
|
|
207
|
+
'Run `apltk architecture error add --help` or `remove --help` for action-specific details.',
|
|
208
|
+
],
|
|
209
|
+
examples: [
|
|
210
|
+
{
|
|
211
|
+
command: 'apltk architecture error add --feature register --submodule api --name ErrInviteCode --when "invite code missing"',
|
|
212
|
+
result: 'Adds the error row and prints `atlas: error add applied`.',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
}),
|
|
216
|
+
edge: buildHelpPage({
|
|
217
|
+
title: 'apltk architecture edge — manage cross-submodule or cross-feature edges.',
|
|
218
|
+
summary: 'Add or remove `call`, `return`, `data-row`, or `failure` edges between atlas endpoints.',
|
|
219
|
+
usageLines: [
|
|
220
|
+
'apltk architecture edge add --from <feature[/submodule]> --to <feature[/submodule]> [--kind call] [--label "..."] [--id <edge-id>]',
|
|
221
|
+
'apltk architecture edge remove --from <feature[/submodule]> --to <feature[/submodule]> [--id <edge-id>]',
|
|
222
|
+
],
|
|
223
|
+
useWhen: [
|
|
224
|
+
'You need to represent a dependency, response path, data hand-off, or failure path across boundaries.',
|
|
225
|
+
],
|
|
226
|
+
notes: [
|
|
227
|
+
'Run `apltk architecture edge add --help` or `remove --help` for action-specific details.',
|
|
228
|
+
],
|
|
229
|
+
examples: [
|
|
230
|
+
{
|
|
231
|
+
command: 'apltk architecture edge add --from register/ui --to register/api --kind call --label "POST /register"',
|
|
232
|
+
result: 'Adds the edge and prints `atlas: edge add applied`.',
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
}),
|
|
236
|
+
meta: buildHelpPage({
|
|
237
|
+
title: 'apltk architecture meta — edit atlas title and summary.',
|
|
238
|
+
summary: 'Update the top-level `meta.title` and `meta.summary` fields of the atlas state.',
|
|
239
|
+
usageLines: [
|
|
240
|
+
'apltk architecture meta set [--title "..."] [--summary "..."]',
|
|
241
|
+
],
|
|
242
|
+
useWhen: [
|
|
243
|
+
'You need to record scanned roots, omissions, or a clearer title for the rendered atlas.',
|
|
244
|
+
],
|
|
245
|
+
notes: [
|
|
246
|
+
'Run `apltk architecture meta set --help` for action-specific details.',
|
|
247
|
+
],
|
|
248
|
+
examples: [
|
|
249
|
+
{
|
|
250
|
+
command: 'apltk architecture meta set --summary "Scanned src/, jobs/, and db/; skipped legacy/."',
|
|
251
|
+
result: 'Updates atlas metadata and prints `atlas: meta set applied`.',
|
|
252
|
+
},
|
|
253
|
+
],
|
|
254
|
+
}),
|
|
255
|
+
actor: buildHelpPage({
|
|
256
|
+
title: 'apltk architecture actor — manage top-level actor nodes.',
|
|
257
|
+
summary: 'Add or remove actor declarations that appear at the atlas level.',
|
|
258
|
+
usageLines: [
|
|
259
|
+
'apltk architecture actor add --id <actor-id> [--label "..."]',
|
|
260
|
+
'apltk architecture actor remove --id <actor-id>',
|
|
261
|
+
],
|
|
262
|
+
useWhen: [
|
|
263
|
+
'You need a named actor node to represent an external user or system in the macro diagram.',
|
|
264
|
+
],
|
|
265
|
+
notes: [
|
|
266
|
+
'Run `apltk architecture actor add --help` or `remove --help` for action-specific details.',
|
|
267
|
+
],
|
|
268
|
+
examples: [
|
|
269
|
+
{
|
|
270
|
+
command: 'apltk architecture actor add --id customer --label "Customer"',
|
|
271
|
+
result: 'Adds the actor node and prints `atlas: actor add applied`.',
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
}),
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const actionPages = {
|
|
278
|
+
'feature:add': buildHelpPage({
|
|
279
|
+
title: 'apltk architecture feature add — create or replace one feature record.',
|
|
280
|
+
summary: 'Ensure a feature exists, optionally with title, story, and dependency metadata.',
|
|
281
|
+
usageLines: [
|
|
282
|
+
'apltk architecture feature add --slug <feature> [--title "..."] [--story "..."] [--depends-on a,b] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
283
|
+
],
|
|
284
|
+
useWhen: [
|
|
285
|
+
'You need a new feature entry before adding submodules, edges, or feature-local content.',
|
|
286
|
+
],
|
|
287
|
+
requiredFlags: [
|
|
288
|
+
'`--slug <feature>`',
|
|
289
|
+
],
|
|
290
|
+
optionalFlags: [
|
|
291
|
+
'`--title "..."` to set the feature title.',
|
|
292
|
+
'`--story "..."` to store a one-line user story or summary.',
|
|
293
|
+
'`--depends-on a,b` to declare feature dependencies.',
|
|
294
|
+
...mutationFlags,
|
|
295
|
+
],
|
|
296
|
+
notes: [
|
|
297
|
+
'Reusing an existing slug updates that feature record rather than creating a duplicate.',
|
|
298
|
+
],
|
|
299
|
+
examples: [
|
|
300
|
+
{
|
|
301
|
+
command: 'apltk architecture feature add --slug register --title "User registration" --story "New users create an account"',
|
|
302
|
+
result: 'Writes the feature entry, renders unless `--no-render` is set, and prints `atlas: feature add applied`.',
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
}),
|
|
306
|
+
'feature:set': buildHelpPage({
|
|
307
|
+
title: 'apltk architecture feature set — update one existing feature record.',
|
|
308
|
+
summary: 'Apply field updates to a feature while keeping its slug stable.',
|
|
309
|
+
usageLines: [
|
|
310
|
+
'apltk architecture feature set --slug <feature> [--title "..."] [--story "..."] [--depends-on a,b] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
311
|
+
],
|
|
312
|
+
useWhen: [
|
|
313
|
+
'You need to change metadata on a feature that already exists in the atlas.',
|
|
314
|
+
],
|
|
315
|
+
requiredFlags: [
|
|
316
|
+
'`--slug <feature>`',
|
|
317
|
+
],
|
|
318
|
+
optionalFlags: [
|
|
319
|
+
'`--title`, `--story`, and `--depends-on` update the stored metadata fields.',
|
|
320
|
+
...mutationFlags,
|
|
321
|
+
],
|
|
322
|
+
notes: [
|
|
323
|
+
'If the slug does not exist yet, the CLI will still ensure the feature record exists before applying the fields.',
|
|
324
|
+
],
|
|
325
|
+
examples: [
|
|
326
|
+
{
|
|
327
|
+
command: 'apltk architecture feature set --slug register --depends-on auth,billing',
|
|
328
|
+
result: 'Updates the feature metadata and prints `atlas: feature set applied`.',
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
}),
|
|
332
|
+
'feature:remove': buildHelpPage({
|
|
333
|
+
title: 'apltk architecture feature remove — remove one feature and its related edges.',
|
|
334
|
+
summary: 'Delete a feature record from the base atlas or record the removal inside a spec overlay.',
|
|
335
|
+
usageLines: [
|
|
336
|
+
'apltk architecture feature remove --slug <feature> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
337
|
+
],
|
|
338
|
+
useWhen: [
|
|
339
|
+
'You need to retire a feature from the atlas or mark it for removal in a spec overlay.',
|
|
340
|
+
],
|
|
341
|
+
requiredFlags: [
|
|
342
|
+
'`--slug <feature>`',
|
|
343
|
+
],
|
|
344
|
+
optionalFlags: mutationFlags,
|
|
345
|
+
notes: [
|
|
346
|
+
'Removing a feature also removes cross-feature edges that reference that feature.',
|
|
347
|
+
],
|
|
348
|
+
examples: [
|
|
349
|
+
{
|
|
350
|
+
command: 'apltk architecture feature remove --slug legacy-auth --spec docs/plans/2026-05-11/drop-legacy',
|
|
351
|
+
result: 'Records the removal in the spec overlay and prints `atlas: feature remove applied`.',
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
}),
|
|
355
|
+
'submodule:add': buildHelpPage({
|
|
356
|
+
title: 'apltk architecture submodule add — create or replace one submodule record.',
|
|
357
|
+
summary: 'Ensure one submodule exists under a feature, optionally with kind and role metadata.',
|
|
358
|
+
usageLines: [
|
|
359
|
+
'apltk architecture submodule add --feature <feature> --slug <submodule> [--kind service] [--role "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
360
|
+
],
|
|
361
|
+
useWhen: [
|
|
362
|
+
'You need to model a new service, API, UI, worker, or external component inside a feature.',
|
|
363
|
+
],
|
|
364
|
+
requiredFlags: [
|
|
365
|
+
'`--feature <feature>`',
|
|
366
|
+
'`--slug <submodule>`',
|
|
367
|
+
],
|
|
368
|
+
optionalFlags: [
|
|
369
|
+
'`--kind <kind>` to control the rendered submodule style.',
|
|
370
|
+
'`--role "..."` to store a one-line responsibility summary.',
|
|
371
|
+
...mutationFlags,
|
|
372
|
+
],
|
|
373
|
+
examples: [
|
|
374
|
+
{
|
|
375
|
+
command: 'apltk architecture submodule add --feature register --slug api --kind api --role "HTTP endpoint"',
|
|
376
|
+
result: 'Writes the submodule record and prints `atlas: submodule add applied`.',
|
|
377
|
+
},
|
|
378
|
+
],
|
|
379
|
+
}),
|
|
380
|
+
'submodule:set': buildHelpPage({
|
|
381
|
+
title: 'apltk architecture submodule set — update one submodule record.',
|
|
382
|
+
summary: 'Update the metadata of an existing submodule.',
|
|
383
|
+
usageLines: [
|
|
384
|
+
'apltk architecture submodule set --feature <feature> --slug <submodule> [--kind service] [--role "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
385
|
+
],
|
|
386
|
+
useWhen: [
|
|
387
|
+
'You need to refine the kind or role of a submodule that already exists.',
|
|
388
|
+
],
|
|
389
|
+
requiredFlags: [
|
|
390
|
+
'`--feature <feature>`',
|
|
391
|
+
'`--slug <submodule>`',
|
|
392
|
+
],
|
|
393
|
+
optionalFlags: [
|
|
394
|
+
'`--kind <kind>` and `--role "..."` update the stored metadata.',
|
|
395
|
+
...mutationFlags,
|
|
396
|
+
],
|
|
397
|
+
examples: [
|
|
398
|
+
{
|
|
399
|
+
command: 'apltk architecture submodule set --feature register --slug api --role "REST and invitation validation endpoint"',
|
|
400
|
+
result: 'Updates the submodule record and prints `atlas: submodule set applied`.',
|
|
401
|
+
},
|
|
402
|
+
],
|
|
403
|
+
}),
|
|
404
|
+
'submodule:remove': buildHelpPage({
|
|
405
|
+
title: 'apltk architecture submodule remove — remove one submodule and its local edges.',
|
|
406
|
+
summary: 'Delete a submodule from a feature or record that deletion in a spec overlay.',
|
|
407
|
+
usageLines: [
|
|
408
|
+
'apltk architecture submodule remove --feature <feature> --slug <submodule> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
409
|
+
],
|
|
410
|
+
useWhen: [
|
|
411
|
+
'You need to remove a component from a feature while keeping the rest of the feature intact.',
|
|
412
|
+
],
|
|
413
|
+
requiredFlags: [
|
|
414
|
+
'`--feature <feature>`',
|
|
415
|
+
'`--slug <submodule>`',
|
|
416
|
+
],
|
|
417
|
+
optionalFlags: mutationFlags,
|
|
418
|
+
notes: [
|
|
419
|
+
'Removing a submodule also removes feature-local edges that reference it.',
|
|
420
|
+
],
|
|
421
|
+
examples: [
|
|
422
|
+
{
|
|
423
|
+
command: 'apltk architecture submodule remove --feature register --slug legacy-job',
|
|
424
|
+
result: 'Removes the submodule and prints `atlas: submodule remove applied`.',
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
}),
|
|
428
|
+
'function:add': buildHelpPage({
|
|
429
|
+
title: 'apltk architecture function add — declare one function row.',
|
|
430
|
+
summary: 'Add or replace a named function row on a submodule.',
|
|
431
|
+
usageLines: [
|
|
432
|
+
'apltk architecture function add --feature <feature> --submodule <submodule> --name <function> [--in "..."] [--out "..."] [--side "..."] [--purpose "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
433
|
+
],
|
|
434
|
+
useWhen: [
|
|
435
|
+
'You need a dataflow step to reference a real function or side-effect owner.',
|
|
436
|
+
],
|
|
437
|
+
requiredFlags: [
|
|
438
|
+
'`--feature <feature>`',
|
|
439
|
+
'`--submodule <submodule>`',
|
|
440
|
+
'`--name <function>`',
|
|
441
|
+
],
|
|
442
|
+
optionalFlags: [
|
|
443
|
+
'`--in`, `--out`, `--side`, and `--purpose` enrich the rendered function row.',
|
|
444
|
+
...mutationFlags,
|
|
445
|
+
],
|
|
446
|
+
examples: [
|
|
447
|
+
{
|
|
448
|
+
command: 'apltk architecture function add --feature register --submodule api --name handlePost --side network --purpose "Create a new account"',
|
|
449
|
+
result: 'Adds the function row and prints `atlas: function add applied`.',
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
}),
|
|
453
|
+
'function:remove': buildHelpPage({
|
|
454
|
+
title: 'apltk architecture function remove — delete one function row.',
|
|
455
|
+
summary: 'Remove a named function row from a submodule.',
|
|
456
|
+
usageLines: [
|
|
457
|
+
'apltk architecture function remove --feature <feature> --submodule <submodule> --name <function> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
458
|
+
],
|
|
459
|
+
useWhen: [
|
|
460
|
+
'You need to drop a function row that should no longer appear in the submodule page.',
|
|
461
|
+
],
|
|
462
|
+
requiredFlags: [
|
|
463
|
+
'`--feature <feature>`',
|
|
464
|
+
'`--submodule <submodule>`',
|
|
465
|
+
'`--name <function>`',
|
|
466
|
+
],
|
|
467
|
+
optionalFlags: mutationFlags,
|
|
468
|
+
examples: [
|
|
469
|
+
{
|
|
470
|
+
command: 'apltk architecture function remove --feature register --submodule api --name handleLegacyPost',
|
|
471
|
+
result: 'Removes the function row and prints `atlas: function remove applied`.',
|
|
472
|
+
},
|
|
473
|
+
],
|
|
474
|
+
}),
|
|
475
|
+
'variable:add': buildHelpPage({
|
|
476
|
+
title: 'apltk architecture variable add — declare one variable row.',
|
|
477
|
+
summary: 'Add or replace a named variable row on a submodule.',
|
|
478
|
+
usageLines: [
|
|
479
|
+
'apltk architecture variable add --feature <feature> --submodule <submodule> --name <variable> [--type "..."] [--scope "..."] [--purpose "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
480
|
+
],
|
|
481
|
+
useWhen: [
|
|
482
|
+
'You need a declared variable before attaching it through `--reads` or `--writes` in the internal flow.',
|
|
483
|
+
],
|
|
484
|
+
requiredFlags: [
|
|
485
|
+
'`--feature <feature>`',
|
|
486
|
+
'`--submodule <submodule>`',
|
|
487
|
+
'`--name <variable>`',
|
|
488
|
+
],
|
|
489
|
+
optionalFlags: [
|
|
490
|
+
'`--type`, `--scope`, and `--purpose` enrich the rendered variable row.',
|
|
491
|
+
...mutationFlags,
|
|
492
|
+
],
|
|
493
|
+
examples: [
|
|
494
|
+
{
|
|
495
|
+
command: 'apltk architecture variable add --feature register --submodule api --name inviteCode --type string --scope call',
|
|
496
|
+
result: 'Adds the variable row and prints `atlas: variable add applied`.',
|
|
497
|
+
},
|
|
498
|
+
],
|
|
499
|
+
}),
|
|
500
|
+
'variable:remove': buildHelpPage({
|
|
501
|
+
title: 'apltk architecture variable remove — delete one variable row.',
|
|
502
|
+
summary: 'Remove a named variable row from a submodule.',
|
|
503
|
+
usageLines: [
|
|
504
|
+
'apltk architecture variable remove --feature <feature> --submodule <submodule> --name <variable> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
505
|
+
],
|
|
506
|
+
useWhen: [
|
|
507
|
+
'You need to remove a variable that should no longer appear in the submodule page.',
|
|
508
|
+
],
|
|
509
|
+
requiredFlags: [
|
|
510
|
+
'`--feature <feature>`',
|
|
511
|
+
'`--submodule <submodule>`',
|
|
512
|
+
'`--name <variable>`',
|
|
513
|
+
],
|
|
514
|
+
optionalFlags: mutationFlags,
|
|
515
|
+
examples: [
|
|
516
|
+
{
|
|
517
|
+
command: 'apltk architecture variable remove --feature register --submodule api --name legacyToken',
|
|
518
|
+
result: 'Removes the variable row and prints `atlas: variable remove applied`.',
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
}),
|
|
522
|
+
'dataflow:add': buildHelpPage({
|
|
523
|
+
title: 'apltk architecture dataflow add — append or insert one internal flow step.',
|
|
524
|
+
summary: 'Create an ordered dataflow step, optionally annotated with a function reference and variable reads/writes.',
|
|
525
|
+
usageLines: [
|
|
526
|
+
'apltk architecture dataflow add --feature <feature> --submodule <submodule> --step "..." [--at <index>] [--fn <function>] [--reads a,b] [--writes x,y] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
527
|
+
],
|
|
528
|
+
useWhen: [
|
|
529
|
+
'You need to express how a submodule works internally, not just what tables and edges it owns.',
|
|
530
|
+
],
|
|
531
|
+
requiredFlags: [
|
|
532
|
+
'`--feature <feature>`',
|
|
533
|
+
'`--submodule <submodule>`',
|
|
534
|
+
'`--step "..."`',
|
|
535
|
+
],
|
|
536
|
+
optionalFlags: [
|
|
537
|
+
'`--at <index>` inserts the step at a specific position instead of appending.',
|
|
538
|
+
'`--fn <function>`, `--reads a,b`, and `--writes x,y` annotate the step with declared symbols.',
|
|
539
|
+
...mutationFlags,
|
|
540
|
+
],
|
|
541
|
+
notes: [
|
|
542
|
+
'Validation fails later if `--fn`, `--reads`, or `--writes` reference undeclared symbols.',
|
|
543
|
+
],
|
|
544
|
+
examples: [
|
|
545
|
+
{
|
|
546
|
+
command: 'apltk architecture dataflow add --feature register --submodule api --step "Validate body" --fn handlePost --reads body --writes token',
|
|
547
|
+
result: 'Adds the annotated step and prints `atlas: dataflow add applied`.',
|
|
548
|
+
},
|
|
549
|
+
],
|
|
550
|
+
}),
|
|
551
|
+
'dataflow:remove': buildHelpPage({
|
|
552
|
+
title: 'apltk architecture dataflow remove — delete one internal flow step.',
|
|
553
|
+
summary: 'Remove a step either by its text or by its numeric position.',
|
|
554
|
+
usageLines: [
|
|
555
|
+
'apltk architecture dataflow remove --feature <feature> --submodule <submodule> --step "..." [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
556
|
+
'apltk architecture dataflow remove --feature <feature> --submodule <submodule> --at <index> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
557
|
+
],
|
|
558
|
+
useWhen: [
|
|
559
|
+
'You need to delete a stale or incorrect step from one submodule dataflow.',
|
|
560
|
+
],
|
|
561
|
+
requiredFlags: [
|
|
562
|
+
'`--feature <feature>`',
|
|
563
|
+
'`--submodule <submodule>`',
|
|
564
|
+
'Either `--step "..."` or `--at <index>`',
|
|
565
|
+
],
|
|
566
|
+
optionalFlags: mutationFlags,
|
|
567
|
+
examples: [
|
|
568
|
+
{
|
|
569
|
+
command: 'apltk architecture dataflow remove --feature register --submodule api --at 0',
|
|
570
|
+
result: 'Removes the selected step and prints `atlas: dataflow remove applied`.',
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
}),
|
|
574
|
+
'dataflow:reorder': buildHelpPage({
|
|
575
|
+
title: 'apltk architecture dataflow reorder — move one step to a new position.',
|
|
576
|
+
summary: 'Reorder an existing dataflow sequence by moving one index to another index.',
|
|
577
|
+
usageLines: [
|
|
578
|
+
'apltk architecture dataflow reorder --feature <feature> --submodule <submodule> --from <index> --to <index> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
579
|
+
],
|
|
580
|
+
useWhen: [
|
|
581
|
+
'The steps are correct but the displayed execution order is wrong.',
|
|
582
|
+
],
|
|
583
|
+
requiredFlags: [
|
|
584
|
+
'`--feature <feature>`',
|
|
585
|
+
'`--submodule <submodule>`',
|
|
586
|
+
'`--from <index>`',
|
|
587
|
+
'`--to <index>`',
|
|
588
|
+
],
|
|
589
|
+
optionalFlags: mutationFlags,
|
|
590
|
+
notes: [
|
|
591
|
+
'Both indexes must point to existing steps.',
|
|
592
|
+
],
|
|
593
|
+
examples: [
|
|
594
|
+
{
|
|
595
|
+
command: 'apltk architecture dataflow reorder --feature register --submodule api --from 2 --to 0',
|
|
596
|
+
result: 'Moves the selected step and prints `atlas: dataflow reorder applied`.',
|
|
597
|
+
},
|
|
598
|
+
],
|
|
599
|
+
}),
|
|
600
|
+
'error:add': buildHelpPage({
|
|
601
|
+
title: 'apltk architecture error add — declare one local error row.',
|
|
602
|
+
summary: 'Add or replace a named error row on a submodule.',
|
|
603
|
+
usageLines: [
|
|
604
|
+
'apltk architecture error add --feature <feature> --submodule <submodule> --name <error> [--when "..."] [--means "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
605
|
+
],
|
|
606
|
+
useWhen: [
|
|
607
|
+
'You need to describe a local error state that belongs on the submodule page.',
|
|
608
|
+
],
|
|
609
|
+
requiredFlags: [
|
|
610
|
+
'`--feature <feature>`',
|
|
611
|
+
'`--submodule <submodule>`',
|
|
612
|
+
'`--name <error>`',
|
|
613
|
+
],
|
|
614
|
+
optionalFlags: [
|
|
615
|
+
'`--when` and `--means` store the trigger and interpretation.',
|
|
616
|
+
...mutationFlags,
|
|
617
|
+
],
|
|
618
|
+
examples: [
|
|
619
|
+
{
|
|
620
|
+
command: 'apltk architecture error add --feature register --submodule api --name ErrInviteCode --when "invite code missing"',
|
|
621
|
+
result: 'Adds the error row and prints `atlas: error add applied`.',
|
|
622
|
+
},
|
|
623
|
+
],
|
|
624
|
+
}),
|
|
625
|
+
'error:remove': buildHelpPage({
|
|
626
|
+
title: 'apltk architecture error remove — delete one local error row.',
|
|
627
|
+
summary: 'Remove a named error row from a submodule.',
|
|
628
|
+
usageLines: [
|
|
629
|
+
'apltk architecture error remove --feature <feature> --submodule <submodule> --name <error> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
630
|
+
],
|
|
631
|
+
useWhen: [
|
|
632
|
+
'You need to delete an error row that is no longer relevant to the submodule.',
|
|
633
|
+
],
|
|
634
|
+
requiredFlags: [
|
|
635
|
+
'`--feature <feature>`',
|
|
636
|
+
'`--submodule <submodule>`',
|
|
637
|
+
'`--name <error>`',
|
|
638
|
+
],
|
|
639
|
+
optionalFlags: mutationFlags,
|
|
640
|
+
examples: [
|
|
641
|
+
{
|
|
642
|
+
command: 'apltk architecture error remove --feature register --submodule api --name ErrLegacyInvite',
|
|
643
|
+
result: 'Removes the error row and prints `atlas: error remove applied`.',
|
|
644
|
+
},
|
|
645
|
+
],
|
|
646
|
+
}),
|
|
647
|
+
'edge:add': buildHelpPage({
|
|
648
|
+
title: 'apltk architecture edge add — create one edge between atlas endpoints.',
|
|
649
|
+
summary: 'Add a `call`, `return`, `data-row`, or `failure` edge between two feature or feature/submodule endpoints.',
|
|
650
|
+
usageLines: [
|
|
651
|
+
'apltk architecture edge add --from <feature[/submodule]> --to <feature[/submodule]> [--kind call] [--label "..."] [--id <edge-id>] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
652
|
+
],
|
|
653
|
+
useWhen: [
|
|
654
|
+
'You need to represent a dependency, response path, data hand-off, or failure path across boundaries.',
|
|
655
|
+
],
|
|
656
|
+
requiredFlags: [
|
|
657
|
+
'`--from <feature[/submodule]>`',
|
|
658
|
+
'`--to <feature[/submodule]>`',
|
|
659
|
+
],
|
|
660
|
+
optionalFlags: [
|
|
661
|
+
'`--kind` chooses `call`, `return`, `data-row`, or `failure`.',
|
|
662
|
+
'`--label "..."` stores a human-readable edge label.',
|
|
663
|
+
'`--id <edge-id>` gives the edge a stable identifier for future removal.',
|
|
664
|
+
...mutationFlags,
|
|
665
|
+
],
|
|
666
|
+
notes: [
|
|
667
|
+
'If both endpoints stay inside the same feature and include submodules, the edge is stored on that feature rather than the atlas index.',
|
|
668
|
+
],
|
|
669
|
+
examples: [
|
|
670
|
+
{
|
|
671
|
+
command: 'apltk architecture edge add --from register/ui --to register/api --kind call --label "POST /register" --id register-call',
|
|
672
|
+
result: 'Adds the edge and prints `atlas: edge add applied`.',
|
|
673
|
+
},
|
|
674
|
+
],
|
|
675
|
+
}),
|
|
676
|
+
'edge:remove': buildHelpPage({
|
|
677
|
+
title: 'apltk architecture edge remove — delete one edge between atlas endpoints.',
|
|
678
|
+
summary: 'Remove an edge by endpoint pair, optionally narrowed by a stable edge id.',
|
|
679
|
+
usageLines: [
|
|
680
|
+
'apltk architecture edge remove --from <feature[/submodule]> --to <feature[/submodule]> [--id <edge-id>] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
681
|
+
],
|
|
682
|
+
useWhen: [
|
|
683
|
+
'You need to remove a dependency or flow edge that should no longer appear in the atlas.',
|
|
684
|
+
],
|
|
685
|
+
requiredFlags: [
|
|
686
|
+
'`--from <feature[/submodule]>`',
|
|
687
|
+
'`--to <feature[/submodule]>`',
|
|
688
|
+
],
|
|
689
|
+
optionalFlags: [
|
|
690
|
+
'`--id <edge-id>` removes only the matching edge when multiple edges share the same endpoints.',
|
|
691
|
+
...mutationFlags,
|
|
692
|
+
],
|
|
693
|
+
examples: [
|
|
694
|
+
{
|
|
695
|
+
command: 'apltk architecture edge remove --from register/ui --to register/api --id register-call',
|
|
696
|
+
result: 'Removes the edge and prints `atlas: edge remove applied`.',
|
|
697
|
+
},
|
|
698
|
+
],
|
|
699
|
+
}),
|
|
700
|
+
'meta:set': buildHelpPage({
|
|
701
|
+
title: 'apltk architecture meta set — update atlas title or summary.',
|
|
702
|
+
summary: 'Write top-level metadata into the atlas index.',
|
|
703
|
+
usageLines: [
|
|
704
|
+
'apltk architecture meta set [--title "..."] [--summary "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
705
|
+
],
|
|
706
|
+
useWhen: [
|
|
707
|
+
'You need to record what was scanned, what was skipped, or a clearer top-level atlas title.',
|
|
708
|
+
],
|
|
709
|
+
optionalFlags: [
|
|
710
|
+
'`--title "..."` updates `meta.title`.',
|
|
711
|
+
'`--summary "..."` updates `meta.summary`.',
|
|
712
|
+
...mutationFlags,
|
|
713
|
+
],
|
|
714
|
+
notes: [
|
|
715
|
+
'Provide at least one of `--title` or `--summary` for a meaningful change.',
|
|
716
|
+
],
|
|
717
|
+
examples: [
|
|
718
|
+
{
|
|
719
|
+
command: 'apltk architecture meta set --summary "Scanned app/, jobs/, and db/; skipped legacy/."',
|
|
720
|
+
result: 'Updates the metadata and prints `atlas: meta set applied`.',
|
|
721
|
+
},
|
|
722
|
+
],
|
|
723
|
+
}),
|
|
724
|
+
'actor:add': buildHelpPage({
|
|
725
|
+
title: 'apltk architecture actor add — create one top-level actor.',
|
|
726
|
+
summary: 'Add or replace a named actor node on the macro diagram.',
|
|
727
|
+
usageLines: [
|
|
728
|
+
'apltk architecture actor add --id <actor-id> [--label "..."] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
729
|
+
],
|
|
730
|
+
useWhen: [
|
|
731
|
+
'You need to represent an external user or system on the macro diagram.',
|
|
732
|
+
],
|
|
733
|
+
requiredFlags: [
|
|
734
|
+
'`--id <actor-id>`',
|
|
735
|
+
],
|
|
736
|
+
optionalFlags: [
|
|
737
|
+
'`--label "..."` overrides the rendered label while keeping a stable actor id.',
|
|
738
|
+
...mutationFlags,
|
|
739
|
+
],
|
|
740
|
+
examples: [
|
|
741
|
+
{
|
|
742
|
+
command: 'apltk architecture actor add --id customer --label "Customer"',
|
|
743
|
+
result: 'Adds the actor node and prints `atlas: actor add applied`.',
|
|
744
|
+
},
|
|
745
|
+
],
|
|
746
|
+
}),
|
|
747
|
+
'actor:remove': buildHelpPage({
|
|
748
|
+
title: 'apltk architecture actor remove — delete one top-level actor.',
|
|
749
|
+
summary: 'Remove an actor node from the macro diagram.',
|
|
750
|
+
usageLines: [
|
|
751
|
+
'apltk architecture actor remove --id <actor-id> [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
752
|
+
],
|
|
753
|
+
useWhen: [
|
|
754
|
+
'You need to remove a top-level actor that should no longer appear in the atlas.',
|
|
755
|
+
],
|
|
756
|
+
requiredFlags: [
|
|
757
|
+
'`--id <actor-id>`',
|
|
758
|
+
],
|
|
759
|
+
optionalFlags: mutationFlags,
|
|
760
|
+
examples: [
|
|
761
|
+
{
|
|
762
|
+
command: 'apltk architecture actor remove --id customer',
|
|
763
|
+
result: 'Removes the actor node and prints `atlas: actor remove applied`.',
|
|
764
|
+
},
|
|
765
|
+
],
|
|
766
|
+
}),
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
if (!verb) {
|
|
770
|
+
return buildHelpPage({
|
|
771
|
+
title: 'apltk architecture — declarative atlas CLI.',
|
|
772
|
+
summary: 'Inspect, mutate, validate, and diff the project architecture atlas without hand-editing the rendered HTML output.',
|
|
773
|
+
usageLines: [
|
|
774
|
+
'apltk architecture [verb] [options]',
|
|
775
|
+
'apltk architecture help',
|
|
776
|
+
],
|
|
777
|
+
useWhen: [
|
|
778
|
+
'You need to browse or update `resources/project-architecture/` through YAML-backed atlas state.',
|
|
779
|
+
'You need to render or compare spec overlays under `docs/plans/**/architecture_diff/`.',
|
|
780
|
+
],
|
|
781
|
+
optionalFlags: [
|
|
782
|
+
'`--project <root>` targets a specific repository root (otherwise the CLI walks upward from the cwd).',
|
|
783
|
+
'`--spec <spec_dir>` writes to a spec overlay instead of the base atlas.',
|
|
784
|
+
'`--no-render` skips automatic re-render after a mutation so you can batch several commands.',
|
|
785
|
+
'`--no-open` keeps `open` and `diff` from launching a browser window.',
|
|
786
|
+
'`--out <dir>` overrides the output directory for `diff`.',
|
|
787
|
+
],
|
|
788
|
+
notes: [
|
|
789
|
+
'Command families include `feature add|set|remove`, `submodule add|set|remove`, `function add|remove`, `variable add|remove`, `dataflow add|remove|reorder`, `error add|remove`, `edge add|remove`, `meta set`, and `actor add|remove`.',
|
|
790
|
+
'`feature`, `submodule`, `function`, `variable`, `dataflow`, `error`, `edge`, `meta`, and `actor` all support deeper help such as `apltk architecture edge add --help`.',
|
|
791
|
+
'Run `apltk architecture validate` before declaring atlas work done.',
|
|
792
|
+
],
|
|
793
|
+
examples: [
|
|
794
|
+
{
|
|
795
|
+
command: 'apltk architecture',
|
|
796
|
+
result: 'Prints the base atlas HTML path and opens it unless `--no-open` is set.',
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
command: 'apltk architecture feature add --slug register --title "User registration"',
|
|
800
|
+
result: 'Creates or updates the feature entry and prints `atlas: feature add applied`.',
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
command: 'apltk architecture validate',
|
|
804
|
+
result: 'Prints `atlas: OK` when the atlas state passes validation.',
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
command: 'apltk architecture diff',
|
|
808
|
+
result: 'Builds the paginated diff viewer and prints its generated HTML path.',
|
|
809
|
+
},
|
|
810
|
+
],
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
if (actionPages[`${verb}:${subverb}`]) {
|
|
815
|
+
return actionPages[`${verb}:${subverb}`];
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
if (familyPages[verb]) {
|
|
819
|
+
return familyPages[verb];
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
switch (verb) {
|
|
823
|
+
case 'open':
|
|
824
|
+
return buildHelpPage({
|
|
825
|
+
title: 'apltk architecture open — open the base atlas HTML.',
|
|
826
|
+
summary: 'Open the rendered base atlas in a browser, bootstrapping it first if the HTML has not been rendered yet.',
|
|
827
|
+
usageLines: [
|
|
828
|
+
'apltk architecture open [--project <root>] [--no-open]',
|
|
829
|
+
'apltk architecture [--project <root>] [--no-open]',
|
|
830
|
+
],
|
|
831
|
+
useWhen: [
|
|
832
|
+
'You want to inspect the base atlas output under `resources/project-architecture/index.html`.',
|
|
833
|
+
],
|
|
834
|
+
optionalFlags: [
|
|
835
|
+
'`--project <root>` selects the repository root to inspect.',
|
|
836
|
+
'`--no-open` prints the HTML path without opening a browser.',
|
|
837
|
+
],
|
|
838
|
+
examples: [
|
|
839
|
+
{
|
|
840
|
+
command: 'apltk architecture open --project /repo --no-open',
|
|
841
|
+
result: 'Prints `/repo/resources/project-architecture/index.html` after bootstrapping the atlas if needed.',
|
|
842
|
+
},
|
|
843
|
+
],
|
|
844
|
+
});
|
|
845
|
+
case 'diff':
|
|
846
|
+
return buildHelpPage({
|
|
847
|
+
title: 'apltk architecture diff — render the paginated before/after viewer.',
|
|
848
|
+
summary: 'Collect every `architecture_diff/` overlay under `docs/plans/` and build one HTML viewer that pairs base pages with proposed-after pages.',
|
|
849
|
+
usageLines: [
|
|
850
|
+
'apltk architecture diff [--project <root>] [--out <dir>] [--no-open]',
|
|
851
|
+
],
|
|
852
|
+
useWhen: [
|
|
853
|
+
'You need to review architecture overlays from one or more spec directories.',
|
|
854
|
+
],
|
|
855
|
+
optionalFlags: [
|
|
856
|
+
'`--project <root>` selects the repository root to inspect.',
|
|
857
|
+
'`--out <dir>` overrides the generated viewer output directory.',
|
|
858
|
+
'`--no-open` prints the viewer path without opening a browser.',
|
|
859
|
+
],
|
|
860
|
+
examples: [
|
|
861
|
+
{
|
|
862
|
+
command: 'apltk architecture diff --project /repo --no-open',
|
|
863
|
+
result: 'Prints the diff viewer HTML path plus a one-line page-count summary.',
|
|
864
|
+
},
|
|
865
|
+
],
|
|
866
|
+
});
|
|
867
|
+
case 'render':
|
|
868
|
+
return buildHelpPage({
|
|
869
|
+
title: 'apltk architecture render — regenerate atlas HTML from the current state.',
|
|
870
|
+
summary: 'Render the base atlas or the resolved spec overlay HTML from the current YAML state.',
|
|
871
|
+
usageLines: [
|
|
872
|
+
'apltk architecture render [--project <root>] [--spec <spec_dir>]',
|
|
873
|
+
],
|
|
874
|
+
useWhen: [
|
|
875
|
+
'You batched mutations with `--no-render` and now want one explicit render step.',
|
|
876
|
+
],
|
|
877
|
+
optionalFlags: [
|
|
878
|
+
'`--project <root>` selects the repository root to render.',
|
|
879
|
+
'`--spec <spec_dir>` renders the spec overlay output instead of the base atlas.',
|
|
880
|
+
],
|
|
881
|
+
examples: [
|
|
882
|
+
{
|
|
883
|
+
command: 'apltk architecture render --spec docs/plans/2026-05-11/add-2fa',
|
|
884
|
+
result: 'Renders the overlay HTML and prints `atlas: rendered`.',
|
|
885
|
+
},
|
|
886
|
+
],
|
|
887
|
+
});
|
|
888
|
+
case 'validate':
|
|
889
|
+
return buildHelpPage({
|
|
890
|
+
title: 'apltk architecture validate — run schema and referential checks.',
|
|
891
|
+
summary: 'Validate the base atlas or resolved spec overlay and report whether the atlas state is structurally sound.',
|
|
892
|
+
usageLines: [
|
|
893
|
+
'apltk architecture validate [--project <root>] [--spec <spec_dir>]',
|
|
894
|
+
],
|
|
895
|
+
useWhen: [
|
|
896
|
+
'You need to confirm that all referenced functions, variables, and pages are valid before finishing atlas work.',
|
|
897
|
+
],
|
|
898
|
+
optionalFlags: [
|
|
899
|
+
'`--project <root>` selects the repository root to validate.',
|
|
900
|
+
'`--spec <spec_dir>` validates the resolved overlay instead of the base atlas.',
|
|
901
|
+
],
|
|
902
|
+
examples: [
|
|
903
|
+
{
|
|
904
|
+
command: 'apltk architecture validate',
|
|
905
|
+
result: 'Prints `atlas: OK` on success or one validation error per broken reference.',
|
|
906
|
+
},
|
|
907
|
+
],
|
|
908
|
+
});
|
|
909
|
+
case 'undo':
|
|
910
|
+
return buildHelpPage({
|
|
911
|
+
title: 'apltk architecture undo — roll back recent mutations.',
|
|
912
|
+
summary: 'Restore the most recent undo snapshot from the base atlas or the selected spec overlay.',
|
|
913
|
+
usageLines: [
|
|
914
|
+
'apltk architecture undo [--steps <n>] [--project <root>] [--spec <spec_dir>] [--no-render]',
|
|
915
|
+
],
|
|
916
|
+
useWhen: [
|
|
917
|
+
'A recent atlas mutation was wrong and you want to roll it back from the recorded undo history.',
|
|
918
|
+
],
|
|
919
|
+
optionalFlags: [
|
|
920
|
+
'`--steps <n>` rolls back multiple snapshots instead of only the latest one.',
|
|
921
|
+
...mutationFlags,
|
|
922
|
+
],
|
|
923
|
+
examples: [
|
|
924
|
+
{
|
|
925
|
+
command: 'apltk architecture undo --steps 2 --spec docs/plans/2026-05-11/add-2fa',
|
|
926
|
+
result: 'Restores the requested overlay snapshots and prints `atlas: undo applied (2 steps)`.',
|
|
927
|
+
},
|
|
928
|
+
],
|
|
929
|
+
});
|
|
930
|
+
default:
|
|
931
|
+
return null;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
const USAGE = buildArchitectureHelpPage();
|
|
88
936
|
|
|
89
937
|
function openInBrowser(filePath) {
|
|
90
938
|
const platform = process.platform;
|
|
@@ -1071,8 +1919,10 @@ function renderDiffViewer({ changes, projectRoot, outDir }) {
|
|
|
1071
1919
|
async function dispatch(argv, io = { stdout: process.stdout, stderr: process.stderr }) {
|
|
1072
1920
|
const args = [...argv];
|
|
1073
1921
|
let verb = 'open';
|
|
1922
|
+
let explicitVerb = false;
|
|
1074
1923
|
if (args.length > 0 && !args[0].startsWith('-')) {
|
|
1075
1924
|
verb = args.shift();
|
|
1925
|
+
explicitVerb = true;
|
|
1076
1926
|
}
|
|
1077
1927
|
let subverb = null;
|
|
1078
1928
|
const multiVerbs = new Set(['feature', 'submodule', 'function', 'variable', 'dataflow', 'error', 'edge', 'meta', 'actor']);
|
|
@@ -1082,7 +1932,10 @@ async function dispatch(argv, io = { stdout: process.stdout, stderr: process.std
|
|
|
1082
1932
|
const { flags } = parseFlags(args);
|
|
1083
1933
|
|
|
1084
1934
|
if (verb === 'help' || verb === '--help' || verb === '-h' || flags.help) {
|
|
1085
|
-
|
|
1935
|
+
const helpText = explicitVerb && verb !== 'help' && verb !== '--help' && verb !== '-h'
|
|
1936
|
+
? buildArchitectureHelpPage(verb, subverb)
|
|
1937
|
+
: buildArchitectureHelpPage();
|
|
1938
|
+
io.stdout.write(`${helpText || USAGE}\n`);
|
|
1086
1939
|
return 0;
|
|
1087
1940
|
}
|
|
1088
1941
|
|
|
@@ -1090,7 +1943,7 @@ async function dispatch(argv, io = { stdout: process.stdout, stderr: process.std
|
|
|
1090
1943
|
try {
|
|
1091
1944
|
projectRoot = resolveProjectRoot(flags);
|
|
1092
1945
|
} catch (e) {
|
|
1093
|
-
io.stderr.write(`${e.message}\n\n${
|
|
1946
|
+
io.stderr.write(`${e.message}\n\n${buildArchitectureHelpPage()}\n`);
|
|
1094
1947
|
return 1;
|
|
1095
1948
|
}
|
|
1096
1949
|
|
|
@@ -1114,7 +1967,7 @@ async function dispatch(argv, io = { stdout: process.stdout, stderr: process.std
|
|
|
1114
1967
|
case 'meta': await verbMeta(subverb, flags, projectRoot); break;
|
|
1115
1968
|
case 'actor': await verbActor(subverb, flags, projectRoot); break;
|
|
1116
1969
|
default:
|
|
1117
|
-
io.stderr.write(`Unknown verb: ${verb}\n\n${
|
|
1970
|
+
io.stderr.write(`Unknown verb: ${verb}\n\n${buildArchitectureHelpPage()}\n`);
|
|
1118
1971
|
return 1;
|
|
1119
1972
|
}
|
|
1120
1973
|
io.stdout.write(`atlas: ${verb}${subverb ? ` ${subverb}` : ''} applied\n`);
|
|
@@ -1127,6 +1980,7 @@ async function dispatch(argv, io = { stdout: process.stdout, stderr: process.std
|
|
|
1127
1980
|
|
|
1128
1981
|
module.exports = {
|
|
1129
1982
|
USAGE,
|
|
1983
|
+
buildArchitectureHelpPage,
|
|
1130
1984
|
dispatch,
|
|
1131
1985
|
parseFlags,
|
|
1132
1986
|
findProjectRoot,
|