@laitszkin/apollo-toolkit 3.10.0 → 3.11.0
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 +20 -0
- 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/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/generate-spec/SKILL.md +17 -15
- package/generate-spec/agents/openai.yaml +1 -1
- package/generate-spec/references/TEMPLATE_SPEC.md +103 -84
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/init-project-html/SKILL.md +82 -126
- package/init-project-html/agents/openai.yaml +17 -8
- package/init-project-html/lib/atlas/assets/architecture.css +140 -0
- package/init-project-html/lib/atlas/assets/viewer.client.js +93 -0
- package/init-project-html/lib/atlas/cli.js +995 -0
- package/init-project-html/lib/atlas/layout.js +229 -0
- package/init-project-html/lib/atlas/render.js +485 -0
- package/init-project-html/lib/atlas/schema.js +310 -0
- package/init-project-html/lib/atlas/state.js +402 -0
- package/init-project-html/references/TEMPLATE_SPEC.md +123 -84
- package/init-project-html/sample-demo/resources/project-architecture/assets/architecture.css +139 -1058
- package/init-project-html/sample-demo/resources/project-architecture/assets/viewer.client.js +93 -0
- package/init-project-html/sample-demo/resources/project-architecture/atlas/atlas.index.yaml +34 -0
- package/init-project-html/sample-demo/resources/project-architecture/atlas/features/get-invite-codes.yaml +159 -0
- package/init-project-html/sample-demo/resources/project-architecture/atlas/features/invite-code-registration.yaml +160 -0
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/index.html +67 -52
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/invite-code-generator.html +48 -163
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/invite-issuance-service.html +70 -196
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/postgresql.html +64 -163
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/public-api.html +68 -150
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/web-get-invite-ui.html +65 -138
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/index.html +61 -51
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/postgresql.html +66 -159
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/public-api.html +63 -143
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/registration-service.html +77 -188
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/web-register-ui.html +65 -138
- package/init-project-html/sample-demo/resources/project-architecture/index.html +232 -335
- package/init-project-html/scripts/architecture.js +65 -247
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/package.json +6 -2
- 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/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
- package/spec-to-project-html/SKILL.md +61 -63
- package/spec-to-project-html/agents/openai.yaml +14 -8
- package/spec-to-project-html/references/TEMPLATE_SPEC.md +96 -83
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: spec-to-project-html
|
|
3
3
|
description: >-
|
|
4
|
-
Sync HTML architecture
|
|
4
|
+
Sync the project HTML architecture atlas to active planning specs by driving `apltk architecture --spec <spec_dir>`. The CLI writes overlay YAML under `<spec_dir>/architecture_diff/atlas/` and re-renders only the affected proposed-after HTML pages, so `apltk architecture diff` can pair before/after by path. Preserve the two-layer rule: macro `index.html` keeps feature clusters with every sub-module visible together; each sub-module page stays self-only (function I/O + variables-with-business-purpose + internal data flow + local errors); feature pages stay lightweight. Read strategy mirrors `init-project-html`: list affected features first, then either dispatch one read-only subagent per affected feature or process them sequentially — never load every affected feature's source into the main agent context at once. Ground every declaration in repo evidence; mark `TBD` when code is missing.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Spec To Project HTML
|
|
8
8
|
|
|
9
9
|
## Dependencies
|
|
10
10
|
|
|
11
|
-
- Required: **`init-project-html`** — its `SKILL.md` is the
|
|
11
|
+
- Required: **`init-project-html`** — its `SKILL.md` is the rulebook for what each component declaration means and which verbs to call. Reuse the same CLI here with `--spec`.
|
|
12
12
|
- Conditional: **`recover-missing-plan`** if a spec pointer is missing.
|
|
13
13
|
- Conditional: **`generate-spec`** / **`implement-specs*`** terminology for requirement IDs.
|
|
14
14
|
- Optional: **`review-spec-related-changes`** when verifying diagram updates against specs.
|
|
15
|
-
- Fallback: spec demands components that are absent from code →
|
|
15
|
+
- Fallback: spec demands components that are absent from code → declare them but use `TBD` strings or a `gap` token in the role/purpose/dataflow fields; **MUST NOT** mark them as implemented.
|
|
16
16
|
|
|
17
17
|
## Non-negotiables
|
|
18
18
|
|
|
19
19
|
- **MUST** read specs in order unless the user directs otherwise: `spec.md` → `design.md` → `contract.md` → coordination notes.
|
|
20
|
-
- **MUST**
|
|
21
|
-
- **MUST** obey `init-project-html/SKILL.md
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- **MUST** reconcile new requirements and design deltas:
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
- legacy single-file `features/<slug>.html` → migrate to the directory layout.
|
|
31
|
-
- **MUST NOT** shrink the macro into prose-only or feature-only diagrams: the multi-edge + sub-module layer must remain visible in the SVG.
|
|
32
|
-
- **MUST NOT** drop modules that are still present in code just because the spec omits them — keep them, or annotate as "out of spec scope" with a reason.
|
|
20
|
+
- **MUST** declare every change through the CLI with `--spec <spec_dir>`. The CLI writes overlay YAML to `<spec_dir>/architecture_diff/atlas/` and re-renders only the affected proposed-after HTML pages there. **MUST NOT** hand-edit `architecture_diff/**/*.html` — the renderer owns those files.
|
|
21
|
+
- **MUST** obey the semantic rules from `init-project-html/SKILL.md`:
|
|
22
|
+
- Sub-module pages stay self-only — express cross-boundary interactions via `edge add` (cross-feature) or intra-feature `edge add`, never as sub-module page prose.
|
|
23
|
+
- Feature pages stay lightweight — declare cross-submodule choreography through edges, not through sub-module-internal `dataflow` steps that wander outside the sub-module.
|
|
24
|
+
- **MUST** reconcile new requirements and design deltas through CLI verbs:
|
|
25
|
+
- Add a sub-module → `submodule add --spec ...`. Removing → `submodule remove --spec ...` (the CLI lists the removed page in `_removed.txt` automatically).
|
|
26
|
+
- Rename a sub-module → `submodule remove` then `submodule add` with the new slug; the CLI emits both the removal entry and the new HTML page so `apltk architecture diff` classifies it as remove + add.
|
|
27
|
+
- Function / variable / dataflow / error deltas → corresponding `add` or `remove` verbs scoped to the sub-module.
|
|
28
|
+
- Edge changes → `edge add` or `edge remove` (use the stable `--id` when available to make the remove unambiguous).
|
|
29
|
+
- **MUST NOT** drop modules that are still present in code just because the spec omits them — keep them, or rewrite their role/purpose strings to flag "out of spec scope".
|
|
33
30
|
- **MUST** scope reads to the **affected feature modules** identified from the spec/design diff (plus any feature owning a cross-feature edge into an affected one). Apply the same context-safe read strategy as `init-project-html` Rule 3:
|
|
34
|
-
- **With subagents** — main agent lists affected features first, then dispatches **one read-only subagent per affected feature** to deep-read and return a structured change summary (affected sub-modules, variable / I/O / boundary deltas). Main agent **only** receives summaries, and only after every subagent reports does it
|
|
35
|
-
- **Without subagents** — process features one at a time: read one affected feature, **immediately**
|
|
36
|
-
- **Forbidden**: loading every affected feature's source into the main agent's context before
|
|
31
|
+
- **With subagents** — main agent lists affected features first, then dispatches **one read-only subagent per affected feature** to deep-read and return a structured change summary (affected sub-modules, variable / I/O / boundary deltas, edges added/removed). Main agent **only** receives summaries, and only after every subagent reports does it run the CLI verbs in one batched pass (use `--no-render` per verb and a single `apltk architecture render --spec ...` at the end).
|
|
32
|
+
- **Without subagents** — process features one at a time: read one affected feature, **immediately** drive the CLI verbs for that feature (with `--spec ...`). Drop function-level details from memory before reading the next feature.
|
|
33
|
+
- **Forbidden**: loading every affected feature's source into the main agent's context before declaring — early details get pushed out and overlay declarations contradict each other.
|
|
34
|
+
- **MUST** run `apltk architecture validate --spec <spec_dir>` after the final mutation. Resolve every reported error before reporting completion.
|
|
37
35
|
|
|
38
36
|
## Standards (summary)
|
|
39
37
|
|
|
40
|
-
- **Evidence**: cite the spec passage (design subsystem entry) alongside the code path.
|
|
41
|
-
- **Execution**: locate the plan set →
|
|
42
|
-
- **Quality**:
|
|
43
|
-
- **Output**: touches only
|
|
38
|
+
- **Evidence**: cite the spec passage (design subsystem entry) alongside the code path; record the citation in `meta.summary` or in sub-module purposes when relevant.
|
|
39
|
+
- **Execution**: locate the plan set → list affected feature modules → branch by environment (subagent fan-out OR sequential read-declare) → `apltk architecture validate --spec ...` → handover.
|
|
40
|
+
- **Quality**: macro overlay still shows every cross-feature data-row the spec requires; sub-module declarations stay self-only; `apltk architecture diff` opens cleanly with no orphan pages; no dangling edges.
|
|
41
|
+
- **Output**: touches only `<spec_dir>/architecture_diff/atlas/**` (overlay state) and `<spec_dir>/architecture_diff/**/*.html` (renderer output). Base `resources/project-architecture/` is **NEVER** mutated.
|
|
44
42
|
|
|
45
43
|
## Workflow
|
|
46
44
|
|
|
@@ -50,67 +48,67 @@ User-pointed path wins; otherwise use the batch `coordination.md` or `recover-mi
|
|
|
50
48
|
|
|
51
49
|
### 2) List the affected feature modules (no function bodies yet)
|
|
52
50
|
|
|
53
|
-
Derive from the spec/design diff which feature modules change: new
|
|
51
|
+
Derive from the spec/design diff which feature modules change: new sub-modules, edge changes, variable changes, error changes, retired sub-modules… **Also** include any feature owning the other end of a cross-feature edge that is being changed (even if that feature's own spec is untouched). Record only `slug + change-kind`; do not enter function bodies yet.
|
|
54
52
|
|
|
55
|
-
### 3)
|
|
53
|
+
### 3) Branch the deep-read + declare by environment (mirrors `init-project-html` Rule 3)
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### 4) Branch the deep-read + patch by environment (mirrors `init-project-html` Rule 3)
|
|
60
|
-
|
|
61
|
-
#### 4A) With subagents (preferred)
|
|
55
|
+
#### 3A) With subagents (preferred)
|
|
62
56
|
|
|
63
57
|
Dispatch one **read-only subagent per affected feature**, requiring this summary:
|
|
64
58
|
|
|
65
59
|
> **Feature `<slug>` change summary**
|
|
66
60
|
> - Matching spec passages / requirement IDs.
|
|
67
|
-
> - Affected sub-modules (added / renamed / retired / I/O changed).
|
|
68
|
-
> - Per sub-module: function I/O, variables-with-business-purpose (
|
|
69
|
-
> - Boundary changes: new / changed / removed call
|
|
70
|
-
> - Spec items the code does not yet scaffold: mark as `planned` / `gap
|
|
61
|
+
> - Affected sub-modules (added / renamed / retired / I/O changed; new kind/role if changed).
|
|
62
|
+
> - Per sub-module: function I/O deltas, variables-with-business-purpose deltas (added/removed/renamed), internal dataflow deltas, errors raised.
|
|
63
|
+
> - Boundary changes: new / changed / removed `edge`s (call / return / data-row / failure) with the other-end feature/sub-module slugs.
|
|
64
|
+
> - Spec items the code does not yet scaffold: mark as `planned` / `gap` and propose how to surface them (e.g. `--role "planned: ..."`).
|
|
71
65
|
|
|
72
|
-
Main agent collects summaries and
|
|
66
|
+
Main agent collects summaries and runs the CLI in one batched pass:
|
|
73
67
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
```bash
|
|
69
|
+
# add --no-render to every mutation, then render once at the end
|
|
70
|
+
apltk architecture submodule add --spec <spec_dir> --feature X --slug Y --kind ... --role "..." --no-render
|
|
71
|
+
apltk architecture function add --spec <spec_dir> ... --no-render
|
|
72
|
+
apltk architecture edge add --spec <spec_dir> --from X/sub --to Y/sub --kind data-row --label "..." --no-render
|
|
73
|
+
apltk architecture render --spec <spec_dir>
|
|
74
|
+
apltk architecture validate --spec <spec_dir>
|
|
75
|
+
```
|
|
77
76
|
|
|
78
|
-
- **Pause →** Do `planned` / `gap`
|
|
77
|
+
- **Pause →** Do every `planned` / `gap` declaration appear consistently across affected sub-modules (e.g. role text + variable purpose strings)? Inconsistency would mislead reviewers.
|
|
79
78
|
|
|
80
|
-
####
|
|
79
|
+
#### 3B) Without subagents — feature-by-feature read-declare loop
|
|
81
80
|
|
|
82
|
-
Process the step-2 list one feature at a time. Per feature
|
|
81
|
+
Process the step-2 list one feature at a time. Per feature:
|
|
83
82
|
|
|
84
|
-
1. **Deep-read** this feature's affected sub-modules
|
|
85
|
-
2. **
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- `sub-vars`: add, remove, or rename variables (including DB columns, config knobs, counters, time anchors) introduced by the spec/design; rewrite the business-purpose column to match the new branches.
|
|
90
|
-
- `sub-dataflow` steps + small SVG refreshed.
|
|
91
|
-
- `sub-errors` updated with any new error types.
|
|
92
|
-
- Any leftover "who I talk to" text → move into a macro edge, or delete.
|
|
93
|
-
3. **Incremental macro patch**: sync this feature's nodes/edges/manifest rows; mark edges pointing at **unread** affected features as `data-edge-target-pending="<future-slug>"`.
|
|
94
|
-
4. **Drop function-level memory** of this feature; keep only cluster id and pending-edge notes.
|
|
95
|
-
5. Return to step 1 for the next feature.
|
|
83
|
+
1. **Deep-read** this feature's affected sub-modules.
|
|
84
|
+
2. **Run CLI verbs immediately** with `--spec ...`: `submodule add|set|remove`, `function add|remove`, `variable add|remove`, `dataflow add|remove|reorder`, `error add|remove`, intra-feature `edge add|remove`.
|
|
85
|
+
3. **Cross-feature edges**: if the target feature has not been overlaid yet, add the edge anyway — the CLI accepts edges into features that exist in the base atlas without re-declaring them in the overlay.
|
|
86
|
+
4. **Drop function-level memory** of this feature; keep only cluster id + edge notes.
|
|
87
|
+
5. Move to the next feature.
|
|
96
88
|
|
|
97
89
|
Final pass after every feature is patched:
|
|
98
90
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
91
|
+
- `apltk architecture render --spec <spec_dir>` (if you used `--no-render`).
|
|
92
|
+
- `apltk architecture validate --spec <spec_dir>`.
|
|
101
93
|
|
|
102
|
-
- **Pause →**
|
|
94
|
+
- **Pause →** Did `apltk architecture diff` pair every changed page correctly? If a page shows up as add + remove instead of modified, you renamed a slug somewhere. Re-check.
|
|
103
95
|
|
|
104
|
-
###
|
|
96
|
+
### 4) Traceability (suggested)
|
|
105
97
|
|
|
106
|
-
Use `feature-trace` to map spec IDs to implementation status: `met` / `partial` / `planned` / `gap`.
|
|
98
|
+
Use `feature-trace` (or in `meta.summary` for spec-only changes) to map spec IDs to implementation status: `met` / `partial` / `planned` / `gap`.
|
|
107
99
|
|
|
108
|
-
###
|
|
100
|
+
### 5) Report
|
|
109
101
|
|
|
110
|
-
List touched files,
|
|
102
|
+
List touched verbs (or the generated YAML files), the resulting diff counts (modified / added / removed) from `apltk architecture diff`, the read strategy used (3A or 3B), unresolved spec-vs-code gaps, and any follow-ups.
|
|
111
103
|
|
|
112
104
|
## Sample hints
|
|
113
105
|
|
|
114
|
-
- **Batch merge**: when one domain has multiple specs,
|
|
115
|
-
- **Spec shrinks scope**:
|
|
116
|
-
- **Design-only change**: still
|
|
106
|
+
- **Batch merge**: when one domain has multiple specs, each member's `--spec <member_dir>` writes its own overlay; `apltk architecture diff` shows them as separate sections in the paginated viewer.
|
|
107
|
+
- **Spec shrinks scope**: prefer `submodule set --role "deprecated: ..."` so reviewers see the planned retirement before issuing `submodule remove`.
|
|
108
|
+
- **Design-only change**: still review edges — interaction order shifts even when no sub-module is added; verify with `apltk architecture validate` to surface dangling references.
|
|
109
|
+
|
|
110
|
+
## References
|
|
111
|
+
|
|
112
|
+
- `init-project-html/SKILL.md` — authoritative verb-by-verb rulebook.
|
|
113
|
+
- `init-project-html/references/TEMPLATE_SPEC.md` — component schema cheat sheet (also linked from this skill's `references/TEMPLATE_SPEC.md`).
|
|
114
|
+
- `apltk architecture --help` — live CLI reference.
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "spec-to-project-html"
|
|
3
|
-
short_description: "Sync HTML architecture
|
|
3
|
+
short_description: "Sync the project HTML architecture atlas with active planning specs via `apltk architecture --spec`"
|
|
4
4
|
default_prompt: >-
|
|
5
|
-
Use $spec-to-project-html to read docs/plans (spec.md → design.md → contract.md),
|
|
6
|
-
|
|
7
|
-
Read strategy (mirrors $init-project-html Rule 3 to avoid context loss). STEP 1: list AFFECTED feature modules from the spec/design diff, plus any feature owning a cross-feature edge into an affected one — without diving into function bodies.
|
|
5
|
+
Use $spec-to-project-html to read `docs/plans` (spec.md → design.md → contract.md), translate the spec/design delta into `apltk architecture --spec <spec_dir>` CLI verbs, and let the CLI write the overlay YAML under `<spec_dir>/architecture_diff/atlas/` plus the affected proposed-after HTML under `<spec_dir>/architecture_diff/`. NEVER hand-edit files under `architecture_diff/**` — the renderer (owned by $init-project-html) is the only writer. The base atlas under `resources/project-architecture/` is read-only in spec mode.
|
|
6
|
+
Read strategy (mirrors $init-project-html Rule 3 to avoid context loss). STEP 1: list AFFECTED feature modules from the spec/design diff (plus any feature owning a cross-feature edge into an affected one) — without diving into function bodies.
|
|
8
7
|
STEP 2: branch by environment.
|
|
9
|
-
(
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
(3A, preferred) with subagents, dispatch ONE read-only subagent per affected feature; each returns a structured CHANGE summary (added / renamed / retired sub-modules, function I/O deltas, variables-with-business-purpose deltas, error deltas, outbound edge changes, `planned` / `gap` markers). The main agent collects every summary first, then runs the CLI in one batched pass (`--no-render` per verb plus a single `apltk architecture render --spec <spec_dir>` at the end).
|
|
9
|
+
(3B, no subagents) handle affected features ONE AT A TIME — deep-read feature A, IMMEDIATELY drive the CLI verbs for A with `--spec ...`, drop A's function-level details from memory before moving on.
|
|
10
|
+
CLI verbs (always pass `--spec <spec_dir>`; kebab-case slugs):
|
|
11
|
+
`submodule add|set|remove --feature X --slug Y --kind ui|api|service|db|pure-fn|queue|external --role "..."`,
|
|
12
|
+
`function add|remove --feature X --submodule Y --name fn --in "..." --out "..." --side pure|io|write|tx|lock|network --purpose "..."`,
|
|
13
|
+
`variable add|remove --feature X --submodule Y --name v --type T --scope call|tx|persist|instance|loop --purpose "..."`,
|
|
14
|
+
`dataflow add|remove|reorder --feature X --submodule Y --step "..." [--at N]` (or `--from i --to j` for reorder),
|
|
15
|
+
`error add|remove --feature X --submodule Y --name ErrCode --when "..." --means "..."`,
|
|
16
|
+
`edge add|remove --from <feature>[/sub] --to <feature>[/sub] --kind call|return|data-row|failure --label "..." [--id <stable>]`.
|
|
17
|
+
Removals: `submodule remove` / `feature remove` writes `_removed.yaml`; the renderer emits `_removed.txt` and `apltk architecture diff` classifies the missing pages as `removed`. Rename = remove old slug + add new slug. After the final mutation run `apltk architecture validate --spec <spec_dir>` (must return OK) and `apltk architecture diff` to verify pairing.
|
|
18
|
+
Each sub-module page stays self-only — express any cross-boundary interaction as a macro edge via `edge add`, NEVER as sub-module page prose. For `planned` / `gap` items the spec mandates but code does not yet implement, surface the marker in the relevant field (e.g. `--role "planned: TOTP service"`, `--purpose "gap: not wired"`). Anchor every declaration to a concrete spec passage + code path. Report the read strategy used (3A or 3B), the resulting diff counts (`modified` / `added` / `removed`), and any unresolved spec-vs-code gaps.
|
|
@@ -1,98 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Atlas component schema — reference cheat sheet (spec-to-project-html copy)
|
|
2
2
|
|
|
3
|
-
> Reference material only. The
|
|
3
|
+
> Reference material only. The binding rules (read strategy, evidence requirements, what each verb means) live in `init-project-html/SKILL.md` (atlas authority) and this skill's `SKILL.md` (spec-overlay variant). This file lists the exact fields and enum values that `apltk architecture --spec <spec_dir>` accepts; the renderer produces consistent DOM/CSS/ARIA hooks under `<spec_dir>/architecture_diff/` so agents never need to touch HTML.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## State files on disk
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Sub-module** — an implementation boundary inside that capability (front-end page, public API, domain service, PostgreSQL, pure helpers, message queues…). One HTML page per sub-module, sibling to the feature's `index.html`.
|
|
7
|
+
Base atlas (read-only from this skill's perspective):
|
|
9
8
|
|
|
10
|
-
## Directory layout (target output)
|
|
11
|
-
|
|
12
|
-
```text
|
|
13
|
-
resources/project-architecture/
|
|
14
|
-
index.html # macro: feature × sub-module in one SVG with multi-edge + data-row flow
|
|
15
|
-
assets/
|
|
16
|
-
architecture.css
|
|
17
|
-
features/
|
|
18
|
-
<feature-slug>/ # one feature module = one directory
|
|
19
|
-
index.html # lightweight overview (story + submodule nav)
|
|
20
|
-
<sub-module-slug>.html # one HTML per sub-module (own I/O + internal flow)
|
|
21
9
|
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
| Actor block | `m-actor` |
|
|
28
|
-
| Feature cluster frame | `m-cluster` / `m-cluster__rect` / `m-cluster__title` |
|
|
29
|
-
| Sub-module node | `m-sub` (add `m-sub--db` for databases) |
|
|
30
|
-
| Edge | `m-edge` + modifier `m-edge--call` / `m-edge--return` / `m-edge--cross` |
|
|
31
|
-
| Edge label | `m-edge__label` (cross-feature labels add `m-edge__label--cross`) |
|
|
32
|
-
|
|
33
|
-
## DOM snippets
|
|
34
|
-
|
|
35
|
-
### `sub-io` function I/O table
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<section class="sub-io">
|
|
39
|
-
<h2>Function I/O</h2>
|
|
40
|
-
<table>
|
|
41
|
-
<thead><tr><th>Function</th><th>Signature</th><th>Side effects</th><th>Purpose</th></tr></thead>
|
|
42
|
-
<tbody>
|
|
43
|
-
<tr>
|
|
44
|
-
<td><code>FunctionName</code></td>
|
|
45
|
-
<td class="sub-io__signature">
|
|
46
|
-
<strong>in:</strong> <code>T1</code>, <code>T2</code><br>
|
|
47
|
-
<strong>out:</strong> <code>R</code> | <code>ErrX</code>
|
|
48
|
-
</td>
|
|
49
|
-
<td><span class="sub-io__side sub-io__side--pure">pure</span></td>
|
|
50
|
-
<td>One-line purpose.</td>
|
|
51
|
-
</tr>
|
|
52
|
-
</tbody>
|
|
53
|
-
</table>
|
|
54
|
-
</section>
|
|
10
|
+
<project>/resources/project-architecture/atlas/
|
|
11
|
+
├── atlas.index.yaml
|
|
12
|
+
├── features/<slug>.yaml
|
|
13
|
+
├── atlas.history.log
|
|
14
|
+
└── atlas.history.undo.json
|
|
55
15
|
```
|
|
56
16
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```html
|
|
60
|
-
<section class="sub-vars">
|
|
61
|
-
<h2>Variables & business purpose</h2>
|
|
62
|
-
<p class="sub-vars__intro">Identifiers this sub-module holds or threads through. Types align readers; business purpose comes first.</p>
|
|
63
|
-
<table>
|
|
64
|
-
<thead>
|
|
65
|
-
<tr><th>Variable</th><th>Type</th><th>Scope</th><th>Business purpose</th></tr>
|
|
66
|
-
</thead>
|
|
67
|
-
<tbody>
|
|
68
|
-
<tr>
|
|
69
|
-
<td class="sub-vars__name">someVar</td>
|
|
70
|
-
<td class="sub-vars__type">SomeType</td>
|
|
71
|
-
<td><span class="sub-vars__scope sub-vars__scope--call">call</span></td>
|
|
72
|
-
<td>One line: this value decides branch X; without it Y breaks.</td>
|
|
73
|
-
</tr>
|
|
74
|
-
</tbody>
|
|
75
|
-
</table>
|
|
76
|
-
</section>
|
|
17
|
+
Overlay (where this skill writes via `--spec`):
|
|
18
|
+
|
|
77
19
|
```
|
|
20
|
+
<spec_dir>/architecture_diff/
|
|
21
|
+
├── atlas/
|
|
22
|
+
│ ├── atlas.index.yaml # optional partial override (meta / actors / cross-feature edges / feature order)
|
|
23
|
+
│ ├── features/<slug>.yaml # full proposed state of any changed feature
|
|
24
|
+
│ ├── _removed.yaml # {features: [...], submodules: [{feature, submodule}]}
|
|
25
|
+
│ ├── atlas.history.log
|
|
26
|
+
│ └── atlas.history.undo.json
|
|
27
|
+
├── index.html # rendered (re-emit only when macro visibly changes)
|
|
28
|
+
├── features/<slug>/index.html # rendered (re-emit when the feature page would visibly change)
|
|
29
|
+
├── features/<slug>/<sub>.html # rendered (re-emit when the sub-module's tables/dataflow change)
|
|
30
|
+
├── _removed.txt # auto-written by the renderer; lists removed HTML paths
|
|
31
|
+
└── assets/ # architecture.css + viewer.client.js (copied by the renderer)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Components (mirrors `init-project-html/references/TEMPLATE_SPEC.md`)
|
|
35
|
+
|
|
36
|
+
### `meta`
|
|
37
|
+
|
|
38
|
+
| Field | Type | Required | Notes |
|
|
39
|
+
| ------- | ------ | -------- | ----- |
|
|
40
|
+
| title | string | yes | Macro page H1; the spec overlay typically keeps the base title. |
|
|
41
|
+
| summary | string | no | Update if the spec changes scanned roots or known omissions. |
|
|
42
|
+
|
|
43
|
+
CLI: `apltk architecture meta set --spec <spec_dir> --title "..." --summary "..."`
|
|
44
|
+
|
|
45
|
+
### `actor`
|
|
46
|
+
|
|
47
|
+
| Field | Type | Required | Notes |
|
|
48
|
+
| ----- | ---- | -------- | ----- |
|
|
49
|
+
| id | kebab-case | yes | Stable identity. |
|
|
50
|
+
| label | string | yes | Display name. |
|
|
51
|
+
|
|
52
|
+
CLI: `apltk architecture actor add --spec <spec_dir> --id ... --label "..."`
|
|
53
|
+
|
|
54
|
+
### `feature`
|
|
78
55
|
|
|
79
|
-
|
|
56
|
+
Same shape as base mode (`slug`, `title`, `story`, `dependsOn`, `submodules`, `edges`). `submodule add|remove`, `function add|remove`, etc. mutate the feature's full overlay snapshot under the hood — declare what you would have declared in base mode, but pass `--spec <spec_dir>`.
|
|
80
57
|
|
|
81
|
-
|
|
58
|
+
CLI: `apltk architecture feature add --spec <spec_dir> --slug <kebab> --title "..." --story "..."`
|
|
82
59
|
|
|
83
|
-
|
|
84
|
-
- Recommended viewBox: height ≤ 240, width ≤ 720.
|
|
85
|
-
- Nodes are this sub-module's internal variables/functions only.
|
|
60
|
+
### `submodule`
|
|
86
61
|
|
|
87
|
-
|
|
62
|
+
| Field | Type | Required | Notes |
|
|
63
|
+
| ----- | ---- | -------- | ----- |
|
|
64
|
+
| slug | kebab-case | yes | The HTML filename. |
|
|
65
|
+
| kind | enum `ui` `api` `service` `db` `pure-fn` `queue` `external` | yes | Drives node colour + chip. |
|
|
66
|
+
| role | string | no | Own responsibility in one sentence. Use `planned: ...` or `gap: ...` to mark spec items the code does not yet implement. |
|
|
67
|
+
| functions / variables / dataflow / errors | arrays | no | Edited through their own CLI verbs. |
|
|
88
68
|
|
|
89
|
-
|
|
90
|
-
|---|---|---|
|
|
91
|
-
| `call` | function call / HTTP request | solid arrow |
|
|
92
|
-
| `return` | return value / response | thin dashed arrow |
|
|
93
|
-
| `data-row` | cross-feature hand-off via data rows (not a function call) | warm-tone heavy dashed |
|
|
94
|
-
| `failure` | failure branch | red solid arrow with `failure` chip in the manifest row |
|
|
69
|
+
CLI: `apltk architecture submodule add|set|remove --spec <spec_dir> --feature X --slug Y --kind ... --role "..."`
|
|
95
70
|
|
|
96
|
-
|
|
71
|
+
### `function`, `variable`, `dataflow`, `error`
|
|
72
|
+
|
|
73
|
+
Each row uses the same fields documented in `init-project-html/references/TEMPLATE_SPEC.md`. Always pass `--spec <spec_dir>` so the write lands in the overlay.
|
|
74
|
+
|
|
75
|
+
### `edge`
|
|
76
|
+
|
|
77
|
+
| Field | Type | Required | Notes |
|
|
78
|
+
| ----- | ---- | -------- | ----- |
|
|
79
|
+
| id | kebab-case | recommended | Pass `--id <stable>` when adding or removing so the CLI matches unambiguously. |
|
|
80
|
+
| from | `feature/submodule` or (intra-feature) `submodule` | yes | |
|
|
81
|
+
| to | same shape | yes | |
|
|
82
|
+
| kind | enum `call` `return` `data-row` `failure` | yes | |
|
|
83
|
+
| label | string | no | |
|
|
84
|
+
|
|
85
|
+
CLI: `apltk architecture edge add|remove --spec <spec_dir> --from <feature>[/sub] --to <feature>[/sub] --kind ... --label "..."`
|
|
86
|
+
|
|
87
|
+
## Diff classification (how `apltk architecture diff` pairs pages)
|
|
88
|
+
|
|
89
|
+
`apltk architecture diff` scans every `docs/plans/**/architecture_diff/**/*.html` (skipping `assets/` and `atlas/`) and pairs by path against `resources/project-architecture/`:
|
|
90
|
+
|
|
91
|
+
| Base exists? | Overlay HTML exists? | Listed in `_removed.txt`? | Classification |
|
|
92
|
+
| ------------ | -------------------- | ------------------------- | -------------- |
|
|
93
|
+
| yes | yes | no | **modified** (split before/after view) |
|
|
94
|
+
| no | yes | no | **added** (single after view) |
|
|
95
|
+
| yes | no | yes | **removed** (single before view) |
|
|
96
|
+
|
|
97
|
+
The renderer writes `_removed.txt` automatically from `_removed.yaml`; agents only set the YAML through `feature remove` / `submodule remove`.
|
|
98
|
+
|
|
99
|
+
## Quick example: add a 2FA sub-module to an existing feature
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
apltk architecture --spec docs/plans/2026-05-11/add-2fa \
|
|
103
|
+
submodule add --feature register --slug 2fa --kind service \
|
|
104
|
+
--role "TOTP verification (planned: not yet implemented)"
|
|
105
|
+
apltk architecture --spec docs/plans/2026-05-11/add-2fa \
|
|
106
|
+
edge add --from register/api --to register/2fa --kind call --label "verify TOTP" --id e-api-2fa
|
|
107
|
+
apltk architecture --spec docs/plans/2026-05-11/add-2fa validate
|
|
108
|
+
apltk architecture diff
|
|
109
|
+
```
|
|
97
110
|
|
|
98
|
-
|
|
111
|
+
The CLI writes only the affected HTML pages (`features/register/2fa.html` plus any page whose visible state changed) into `architecture_diff/`, and the diff viewer pairs them with the base atlas.
|