@laitszkin/apollo-toolkit 3.10.0 → 3.11.1
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 +37 -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 +117 -125
- package/init-project-html/agents/openai.yaml +18 -9
- package/init-project-html/lib/atlas/assets/architecture.css +161 -0
- package/init-project-html/lib/atlas/assets/viewer.client.js +136 -0
- package/init-project-html/lib/atlas/cli.js +1023 -0
- package/init-project-html/lib/atlas/layout.js +330 -0
- package/init-project-html/lib/atlas/render.js +583 -0
- package/init-project-html/lib/atlas/schema.js +347 -0
- package/init-project-html/lib/atlas/state.js +402 -0
- package/init-project-html/references/TEMPLATE_SPEC.md +140 -83
- package/init-project-html/sample-demo/resources/project-architecture/assets/architecture.css +160 -1058
- package/init-project-html/sample-demo/resources/project-architecture/assets/viewer.client.js +136 -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 +172 -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 +64 -163
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/invite-issuance-service.html +102 -196
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/postgresql.html +82 -163
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/public-api.html +88 -150
- package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/web-get-invite-ui.html +83 -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 +84 -159
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/public-api.html +81 -143
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/registration-service.html +98 -188
- package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/web-register-ui.html +83 -138
- package/init-project-html/sample-demo/resources/project-architecture/index.html +256 -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 +74 -67
- package/spec-to-project-html/agents/openai.yaml +14 -8
- package/spec-to-project-html/references/TEMPLATE_SPEC.md +98 -83
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
|
@@ -1,46 +1,51 @@
|
|
|
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 — macro SVG and per-sub-module internal-dataflow diagrams stay zoomable just like the base atlas — so `apltk architecture diff` can pair before/after by path. Preserve the two-layer rule and the responsibility split: when subagents are available, each subagent reads ONE affected feature and declares EVERY intra-feature change itself (sub-modules, function / variable / dataflow / error rows, intra-feature edges including error and rollback flows); the main agent only aggregates outbound-boundary summaries and declares cross-feature edges. Without subagents, process features sequentially with the same split. 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
|
-
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
|
|
35
|
-
- **Without subagents** — process features one at a time: read one affected feature, **immediately** patch its `features/<slug>/` tree plus the macro cluster/nodes/edges (mark edges pointing at unread affected features with `data-edge-target-pending`). Drop function-level details from memory before reading the next feature. After all features are patched, resolve every pending edge in a final pass.
|
|
36
|
-
- **Forbidden**: loading every affected feature's source into the main agent's context before patching — early details get pushed out and macro/sub-module pages contradict each other.
|
|
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".
|
|
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 — **subagents own intra-feature overlay changes; the main agent owns cross-feature seams**:
|
|
31
|
+
- **With subagents (preferred)** — main agent lists affected features first, then dispatches **one write-capable subagent per affected feature**. Each subagent deep-reads its feature and applies every intra-feature overlay mutation itself via `apltk architecture ... --spec <spec_dir> --feature <slug>` (add/remove sub-modules, function / variable / dataflow / error deltas, intra-feature edges — including error / rollback edges and ordered dataflow steps that capture variable state transitions). It returns ONLY a structured change summary of outbound boundaries (cross-feature edges added / changed / removed, with direction and proposed labels) plus its sub-module change list. The main agent never re-reads the feature source; it batches **only cross-feature** `edge add|remove` verbs from the aggregated summaries, then runs `apltk architecture render --spec ...` and `apltk architecture validate --spec ...`.
|
|
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.
|
|
42
|
+
|
|
43
|
+
## Acceptance criteria (mirrors `init-project-html`)
|
|
44
|
+
|
|
45
|
+
Open the proposed-after viewer (`apltk architecture diff`) and verify both criteria on the overlay pages before reporting completion:
|
|
46
|
+
|
|
47
|
+
1. **The macro overlay clearly shows the proposed-after feature × sub-module relationships**, including data flow (`--kind data-row`), interaction logic (`--kind call` + `--kind return`), error handling and rollback (`--kind failure`). Any new / changed / removed cross-boundary path the spec implies MUST exist as an edge mutation in the overlay — not as sub-module prose.
|
|
48
|
+
2. **Each touched sub-module's internal overlay diagram clearly shows the function-level interactions inside it**, including function-to-function flow (`dataflow add --fn <declared-fn>`), variable state transitions (`--reads` / `--writes` referencing declared variables), and the resulting local data flow. If the spec introduces a new function or variable that participates in the flow, declare it via `function add` / `variable add` first, then reference it from the new `dataflow` step so `validate --spec` passes.
|
|
44
49
|
|
|
45
50
|
## Workflow
|
|
46
51
|
|
|
@@ -50,67 +55,69 @@ User-pointed path wins; otherwise use the batch `coordination.md` or `recover-mi
|
|
|
50
55
|
|
|
51
56
|
### 2) List the affected feature modules (no function bodies yet)
|
|
52
57
|
|
|
53
|
-
Derive from the spec/design diff which feature modules change: new
|
|
54
|
-
|
|
55
|
-
### 3) Read the current HTML atlas (scoped to affected features)
|
|
58
|
+
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.
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
### 3) Branch the deep-read + declare by environment (mirrors `init-project-html` Rule 3)
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
#### 3A) With subagents (preferred) — workers patch their feature; main agent patches only cross-feature edges
|
|
60
63
|
|
|
61
|
-
|
|
64
|
+
Dispatch one **write-capable subagent per affected feature**, plus the main agent for the macro seams. Each subagent owns every intra-feature overlay write and reports outbound boundaries upward:
|
|
62
65
|
|
|
63
|
-
|
|
66
|
+
> **Feature `<slug>` subagent contract (overlay)**
|
|
67
|
+
> - Read this feature's affected sub-modules and the cited spec passages / requirement IDs.
|
|
68
|
+
> - Apply every intra-feature overlay mutation via `apltk architecture ... --spec <spec_dir>`:
|
|
69
|
+
> - `submodule add|set|remove` for added / renamed / retired / kind-or-role-changed sub-modules.
|
|
70
|
+
> - `function add|remove`, `variable add|remove`, `dataflow add|remove|reorder`, `error add|remove` for per-sub-module deltas. Order `dataflow` steps so the **variable state transitions** through the new path are visible end-to-end.
|
|
71
|
+
> - Intra-feature `edge add|remove` for every changed function-call / return / data-row / failure / rollback edge between the feature's own sub-modules.
|
|
72
|
+
> - Run `apltk architecture validate --spec <spec_dir>` (scoped check) before returning.
|
|
73
|
+
> - **Return ONLY**: (i) the sub-module change list (slug + change-kind + new kind/role when relevant), (ii) outbound boundary changes (cross-feature edges added / changed / removed, with the other-end `feature/sub` and the suggested `--kind` / `--label`), (iii) any `planned` / `gap` flags so the main agent can mirror them in `meta.summary` if needed.
|
|
64
74
|
|
|
65
|
-
|
|
66
|
-
> - 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 (additions / removals / renames), internal flow, errors raised.
|
|
69
|
-
> - Boundary changes: new / changed / removed call edges and data-row edges (name the other-end feature / sub-module).
|
|
70
|
-
> - Spec items the code does not yet scaffold: mark as `planned` / `gap`.
|
|
75
|
+
Main agent — after every subagent returns — declares **only** the cross-feature seams and renders once:
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
```bash
|
|
78
|
+
# one verb per cross-feature edge reported by the subagents
|
|
79
|
+
apltk architecture edge add --spec <spec_dir> --from <featA>/<subA> --to <featB>/<subB> --kind call|return|data-row|failure --label "..." --no-render
|
|
80
|
+
apltk architecture edge remove --spec <spec_dir> --id <stable_id> --no-render
|
|
81
|
+
apltk architecture render --spec <spec_dir>
|
|
82
|
+
apltk architecture validate --spec <spec_dir>
|
|
83
|
+
```
|
|
73
84
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
3. Update `<nav class="atlas-submodule-index">`: link new pages; remove retired pages.
|
|
85
|
+
- **Pause →** Do every `planned` / `gap` declaration appear consistently across affected sub-modules (e.g. role text + variable purpose strings)? Inconsistency would mislead reviewers.
|
|
86
|
+
- The main agent **MUST NOT** re-declare a subagent's intra-feature components, and **MUST NOT** open source files for any feature it delegated.
|
|
77
87
|
|
|
78
|
-
|
|
88
|
+
#### 3B) Without subagents — feature-by-feature read-declare loop
|
|
79
89
|
|
|
80
|
-
|
|
90
|
+
Process the step-2 list one feature at a time. Per feature:
|
|
81
91
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- Each affected sub-module page:
|
|
88
|
-
- Function I/O table updated (additions / renames / signature changes).
|
|
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.
|
|
92
|
+
1. **Deep-read** this feature's affected sub-modules.
|
|
93
|
+
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`.
|
|
94
|
+
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.
|
|
95
|
+
4. **Drop function-level memory** of this feature; keep only cluster id + edge notes.
|
|
96
|
+
5. Move to the next feature.
|
|
96
97
|
|
|
97
98
|
Final pass after every feature is patched:
|
|
98
99
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
100
|
+
- `apltk architecture render --spec <spec_dir>` (if you used `--no-render`).
|
|
101
|
+
- `apltk architecture validate --spec <spec_dir>`.
|
|
101
102
|
|
|
102
|
-
- **Pause →**
|
|
103
|
+
- **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
104
|
|
|
104
|
-
###
|
|
105
|
+
### 4) Traceability (suggested)
|
|
105
106
|
|
|
106
|
-
Use `feature-trace` to map spec IDs to implementation status: `met` / `partial` / `planned` / `gap`.
|
|
107
|
+
Use `feature-trace` (or in `meta.summary` for spec-only changes) to map spec IDs to implementation status: `met` / `partial` / `planned` / `gap`.
|
|
107
108
|
|
|
108
|
-
###
|
|
109
|
+
### 5) Report
|
|
109
110
|
|
|
110
|
-
List touched files,
|
|
111
|
+
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
112
|
|
|
112
113
|
## Sample hints
|
|
113
114
|
|
|
114
|
-
- **Batch merge**: when one domain has multiple specs,
|
|
115
|
-
- **Spec shrinks scope**:
|
|
116
|
-
- **Design-only change**: still
|
|
115
|
+
- **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.
|
|
116
|
+
- **Spec shrinks scope**: prefer `submodule set --role "deprecated: ..."` so reviewers see the planned retirement before issuing `submodule remove`.
|
|
117
|
+
- **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.
|
|
118
|
+
|
|
119
|
+
## References
|
|
120
|
+
|
|
121
|
+
- `init-project-html/SKILL.md` — authoritative verb-by-verb rulebook.
|
|
122
|
+
- `init-project-html/references/TEMPLATE_SPEC.md` — component schema cheat sheet (also linked from this skill's `references/TEMPLATE_SPEC.md`).
|
|
123
|
+
- `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/`. The macro SVG and every sub-module's internal-dataflow diagram in the overlay output stay zoomable, just like the base atlas. 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 AND to enforce a hard responsibility split). 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 write-capable subagent per affected feature. Each subagent deep-reads its own feature and applies every intra-feature overlay mutation itself via `apltk architecture ... --spec <spec_dir> --feature <slug>`: `submodule add|set|remove`, `function add|remove`, `variable add|remove`, `dataflow add|remove|reorder` (order the steps so the variable state transitions through the new path are visible end-to-end), `error add|remove`, and EVERY intra-feature `edge add|remove` (including failure / rollback edges between the feature's own sub-modules). The subagent returns ONLY a structured CHANGE summary of (i) sub-module changes (slug + change-kind + new kind/role when relevant), (ii) outbound boundary changes (cross-feature edges added / changed / removed with the other-end `feature/sub` and suggested `--kind` / `--label`), and (iii) any `planned` / `gap` flags. The main agent never re-reads source for a delegated feature and never re-declares its intra-feature components — it batches ONLY cross-feature `edge add|remove` from the aggregated summaries, then runs a single `apltk architecture render --spec <spec_dir>` and `apltk architecture validate --spec <spec_dir>`.
|
|
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 "..." [--fn <declared-fn>] [--reads "v1,v2"] [--writes "v3,v4"] [--at N]` (or `--from i --to j` for reorder; every `--fn` / `--reads` / `--writes` value MUST reference a function/variable declared in the merged state for the same sub-module or `validate --spec` fails),
|
|
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 an 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,113 @@
|
|
|
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
|
+
`dataflow` steps accept the same structured fields in overlay mode — `--fn` must reference a function declared in this overlay (or inherited from base) for the same sub-module; `--reads` / `--writes` must reference variables declared there. `validate --spec <spec_dir>` enforces these references against the **merged** state, so adding a step that names a function/variable the spec also introduces is fine as long as both land in the same overlay.
|
|
76
|
+
|
|
77
|
+
### `edge`
|
|
78
|
+
|
|
79
|
+
| Field | Type | Required | Notes |
|
|
80
|
+
| ----- | ---- | -------- | ----- |
|
|
81
|
+
| id | kebab-case | recommended | Pass `--id <stable>` when adding or removing so the CLI matches unambiguously. |
|
|
82
|
+
| from | `feature/submodule` or (intra-feature) `submodule` | yes | |
|
|
83
|
+
| to | same shape | yes | |
|
|
84
|
+
| kind | enum `call` `return` `data-row` `failure` | yes | |
|
|
85
|
+
| label | string | no | |
|
|
86
|
+
|
|
87
|
+
CLI: `apltk architecture edge add|remove --spec <spec_dir> --from <feature>[/sub] --to <feature>[/sub] --kind ... --label "..."`
|
|
88
|
+
|
|
89
|
+
## Diff classification (how `apltk architecture diff` pairs pages)
|
|
90
|
+
|
|
91
|
+
`apltk architecture diff` scans every `docs/plans/**/architecture_diff/**/*.html` (skipping `assets/` and `atlas/`) and pairs by path against `resources/project-architecture/`:
|
|
92
|
+
|
|
93
|
+
| Base exists? | Overlay HTML exists? | Listed in `_removed.txt`? | Classification |
|
|
94
|
+
| ------------ | -------------------- | ------------------------- | -------------- |
|
|
95
|
+
| yes | yes | no | **modified** (split before/after view) |
|
|
96
|
+
| no | yes | no | **added** (single after view) |
|
|
97
|
+
| yes | no | yes | **removed** (single before view) |
|
|
98
|
+
|
|
99
|
+
The renderer writes `_removed.txt` automatically from `_removed.yaml`; agents only set the YAML through `feature remove` / `submodule remove`.
|
|
100
|
+
|
|
101
|
+
## Quick example: add a 2FA sub-module to an existing feature
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
apltk architecture --spec docs/plans/2026-05-11/add-2fa \
|
|
105
|
+
submodule add --feature register --slug 2fa --kind service \
|
|
106
|
+
--role "TOTP verification (planned: not yet implemented)"
|
|
107
|
+
apltk architecture --spec docs/plans/2026-05-11/add-2fa \
|
|
108
|
+
edge add --from register/api --to register/2fa --kind call --label "verify TOTP" --id e-api-2fa
|
|
109
|
+
apltk architecture --spec docs/plans/2026-05-11/add-2fa validate
|
|
110
|
+
apltk architecture diff
|
|
111
|
+
```
|
|
97
112
|
|
|
98
|
-
|
|
113
|
+
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.
|