@laitszkin/apollo-toolkit 3.11.1 → 3.11.3
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 +30 -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 +18 -16
- package/generate-spec/agents/openai.yaml +4 -1
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/init-project-html/SKILL.md +68 -89
- package/init-project-html/agents/openai.yaml +7 -18
- package/init-project-html/lib/atlas/assets/architecture.css +695 -107
- package/init-project-html/lib/atlas/assets/viewer.client.js +10 -2
- package/init-project-html/lib/atlas/cli.js +17 -12
- package/init-project-html/lib/atlas/render.js +44 -3
- package/init-project-html/scripts/architecture-bootstrap-render.js +16 -0
- package/init-project-html/scripts/architecture.js +22 -12
- 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 +1 -1
- 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 +38 -58
- package/spec-to-project-html/agents/openai.yaml +7 -14
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,36 @@ All notable changes to this repository are documented in this file.
|
|
|
10
10
|
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
## [v3.11.3] - 2026-05-11
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- New shipped font stack for every rendered atlas page (Fraunces display serif, Geist UI sans, JetBrains Mono technical accents) loaded via Google Fonts preconnect + stylesheet in `<head>`.
|
|
18
|
+
- Tests: shipped CSS viewport `clamp()` + svg `height:100%`; `viewer.client.js` wheel handler always prevents default; `preserveAspectRatio` on macro SVG; Google Fonts links in rendered `<head>`; full `renderAll` orphan sweep (scoped renders do not sweep).
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Atlas visual system redesigned end-to-end: dark "blueprint × editorial" theme with a faint vellum grid behind every diagram, sectioned canvases with corner labels (`MACRO DIAGRAM`, `INTERNAL FLOW`), refined toolbar buttons, sharper edge color hierarchy, hover glow on sub-module nodes, and serif story / role typography. All existing class hooks (`.atlas-svg`, `.m-cluster`, `.m-node`, `.sub-dataflow__*`, etc.) are preserved so spec overlays and tests continue to work.
|
|
23
|
+
- Macro and sub-dataflow SVGs render with `preserveAspectRatio="xMidYMid meet"` and fill 100% of a fixed-height viewport (`clamp(480px, 68vh, 760px)` for macro; `clamp(480px, 64vh, 720px)` for sub-dataflow), so horizontally-biased atlases no longer collapse to a thin strip while leaving empty space inside the canvas block.
|
|
24
|
+
- Skills + OpenAI agent prompts (`init-project-html`, `spec-to-project-html`, `generate-spec`): agents **MUST** use `apltk architecture --help` as the authoritative command tree; SKILL prose carries semantic guidance and constraints only (avoids doc/CLI drift). **Subagent-only** read/declare workflow; orchestrator **MUST** wait until all feature subagents finish before cross-feature `edge` or stitching `meta`/`actor`. `generate-spec` §3.5 and frontmatter describe overlay layout, `validate --spec`, and the paginated **`apltk architecture diff`** viewer across `docs/plans/**/architecture_diff/`.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- `viewer.client.js`: the wheel gesture inside any diagram viewport now unconditionally calls `preventDefault()` + `stopPropagation()`, so scrolling/zooming the atlas no longer scrolls the surrounding page. Removed the `ctrlKey`/`metaKey` gate that previously let small wheel deltas bubble up.
|
|
29
|
+
- `apltk architecture render` (full base mode, no `--spec`) now sweeps orphan feature directories and stale sub-module HTML files left over from previous renders, so re-running `render` is a true refresh — old pages from renamed / removed features no longer linger with the previous styling. Scoped renders (overlay mode) intentionally do **not** sweep.
|
|
30
|
+
|
|
31
|
+
## [v3.11.2] - 2026-05-11
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- `apltk architecture` / `resolveProjectRoot`: auto-create `resources/project-architecture/` on every command; when no atlas marker is found walking parent directories, use the current working directory as the project root (explicit `--project` still wins). `open` renders a fresh `index.html` when the file is missing so an empty tree bootstraps in one step.
|
|
36
|
+
- Legacy `init-project-html/scripts/architecture.js` `open` / `diff`: same directory creation and one-shot `render` bootstrap via `architecture-bootstrap-render.js` when `index.html` is absent.
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- `init-project-html/scripts/architecture-bootstrap-render.js` helper invoked by the legacy sync `open` path.
|
|
41
|
+
- Tests: `test/atlas-cli.test.js` covers `--project` on a bare directory (layout + `index.html`); `test/architecture-script.test.js` expects legacy `open` to exit 0 when `index.html` is missing after bootstrap.
|
|
42
|
+
|
|
13
43
|
## [v3.11.1] - 2026-05-11
|
|
14
44
|
|
|
15
45
|
### Added
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/generate-spec/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: generate-spec
|
|
3
3
|
description: >-
|
|
4
4
|
Author docs/plans trees: run `apltk create-specs`, hydrate `spec/tasks/checklist/contract/design` (+ `coordination.md`/`preparation.md` when parallel/prep dictates), cite official docs for external deps, plan tests via **`test-case-strategy`**, block code edits until explicit user approval.
|
|
5
|
-
Architecture
|
|
5
|
+
Architecture deltas use `apltk architecture --spec <spec_dir> …` (**flags: `apltk architecture --help`**) → overlay under `<spec_dir>/architecture_diff/`; **`apltk architecture diff`** pages every `docs/plans/**/architecture_diff/` vs the base atlas — never hand-edit `architecture_diff/`.
|
|
6
6
|
Use when drafting/refreshing specs or restructuring batches — not when executing approved plans (use **`implement-specs*`** instead).
|
|
7
7
|
Reject vague `tasks.md` missing file/mutation/verifier; SPLIT >3-module scope; never overwrite a neighbor `{change}`.
|
|
8
8
|
Bad: `- [ ] Add tests`… OK: `- [ ] src/auth/scope.rs — deny unknown scopes — Verify: cargo test scope::defaults`…
|
|
@@ -27,7 +27,7 @@ description: >-
|
|
|
27
27
|
- **`tasks.md` checklist items**: **every** `- [ ]` **MUST** specify (a) concrete file/function target, (b) specific modification and expected outcome, (c) a verification hook—**no** vague rows (`Implement integration`, `Add tests`). Forbidden vague items **MUST** be rewritten before approval.
|
|
28
28
|
- **MUST** use `test-case-strategy` when planning non-trivial logic tests and checklist mapping (test IDs, drift checks). Every **non-trivial** `tasks.md` implementation item **MUST** name a focused unit drift check, another concrete verification hook, or **`N/A`** with a concrete reason.
|
|
29
29
|
- **MUST NOT** modify implementation code before **explicit user approval** of the spec set. Clarifications **MUST** sync across affected files and **MUST** re-trigger approval. If scope becomes a **different issue**, **MUST** stop editing the old set and create a **new** `change_name`.
|
|
30
|
-
- **MUST** when the proposed change touches the architecture surface (feature / sub-module add / rename / remove, edge add / remove,
|
|
30
|
+
- **MUST** when the proposed change touches the architecture surface (feature / sub-module add / rename / remove, edge add / remove, variable rows, function I/O rows, internal dataflow / error deltas), declare the proposed-after state **only** through `apltk architecture --spec <spec_dir> …` using the exact verbs, subverbs, and flags from **`apltk architecture --help`** (this file must not be treated as the command list). The CLI writes overlay YAML to `<spec_dir>/architecture_diff/atlas/` and renders only the affected proposed-after HTML pages under `<spec_dir>/architecture_diff/`. **`apltk architecture diff`** then builds a paginated **before/after viewer**: it walks every `docs/plans/**/architecture_diff/` tree, pairs each overlay HTML path with the matching file under `resources/project-architecture/` when it exists, and labels pages **modified**, **added**, or **removed** (via `_removed.txt` / removal manifests) so reviewers can scroll the whole architecture delta without opening files by hand. **MUST NOT** hand-author anything under `architecture_diff/**` — the renderer owns layout, DOM, CSS, ARIA, and pan/zoom. For batch specs the overlay lives in **each member spec’s own directory** only — **MUST NOT** duplicate overlay at the batch root. Use this skill’s `references/TEMPLATE_SPEC.md` for field/enum schema; use `init-project-html/SKILL.md` for semantic rules (**subagent gate** + edge kinds + dataflow integrity). When using subagents to draft atlas overlay, the authoring agent **MUST** wait until **all** feature subagents finish before declaring cross-feature **`edge`** (or overlay **`meta`** / **`actor`** that only exists to stitch features), matching `init-project-html` / `spec-to-project-html`.
|
|
31
31
|
- Write prose in the **user’s language** by default; keep requirement/task/test IDs traceable across `spec.md`, `tasks.md`, and `checklist.md`.
|
|
32
32
|
- **MUST** use **kebab-case** `change_name`; **MUST NOT** use spaces or arbitrary special characters in names.
|
|
33
33
|
|
|
@@ -81,25 +81,27 @@ Always materialize: `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `desig
|
|
|
81
81
|
- **Pause →** Do **`design.md` / `contract.md`** stay **coarser than `tasks.md`** (no mirrored checkbox choreography / file paths)—yet still constrain ordering and forbidden hallucinations?
|
|
82
82
|
- **Pause →** For parallel batches, does `design.md` **avoid** duplicating batch ownership grids already locked in **`coordination.md`**?
|
|
83
83
|
|
|
84
|
-
### 3.5) Architecture diff (only when the proposal touches the architecture surface)
|
|
84
|
+
### 3.5) Architecture overlay + diff viewer (only when the proposal touches the architecture surface)
|
|
85
85
|
|
|
86
|
-
When the spec changes a feature module, sub-module, edge, variable,
|
|
86
|
+
When the spec changes a feature module, sub-module, edge, variable row, function I/O row, internal dataflow, or error row:
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
apltk architecture --spec
|
|
91
|
-
apltk architecture --spec
|
|
92
|
-
apltk architecture
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
1. **Discover commands:** run **`apltk architecture --help`** in the target workspace; use that output for every `add` / `set` / `remove` / `reorder` spelling and required flag. Do not copy long command tables from skills — they go stale.
|
|
89
|
+
2. **Declare proposed-after state** with `apltk architecture --spec <spec_dir> …` for each mutation (pass `--no-render` while batching if you prefer a single render at the end).
|
|
90
|
+
3. **`apltk architecture render --spec <spec_dir>`** — emits/updates only the HTML files touched by this overlay plus assets.
|
|
91
|
+
4. **`apltk architecture validate --spec <spec_dir>`** — **MUST** return OK before the spec is approval-ready (resolve dangling edges, unknown enums, bad dataflow references).
|
|
92
|
+
5. **`apltk architecture diff`** — **MUST** run before hand-off when atlas changed; confirm the paginated viewer shows sensible **modified** / **added** / **removed** counts and that each interesting path pairs correctly (base `resources/project-architecture/…` vs `<spec_dir>/architecture_diff/…`). A page appearing as **remove + add** instead of **modified** usually means a **slug rename** was split wrong — fix with intentional remove+add or a single coherent mutation sequence.
|
|
93
|
+
|
|
94
|
+
**Where files land:** overlay YAML under `<spec_dir>/architecture_diff/atlas/`; rendered proposed-after HTML under `<spec_dir>/architecture_diff/`. Cross-feature edges whose far endpoint exists only in the **base** atlas still resolve when merged — but you **must** `validate` to catch mistakes.
|
|
95
|
+
|
|
96
|
+
**Batch specs:** each `<spec_dir>` is one member directory under `docs/plans/...`; **never** duplicate overlay at the batch root.
|
|
97
|
+
|
|
98
|
+
**Subagent coordination:** if multiple features are drafted in parallel, **do not** declare cross-feature **`edge`** (or overlay **`meta` / `actor`** used only to stitch features) until **all** feature workers report done — see `init-project-html/SKILL.md` Rule 3 and `spec-to-project-html`.
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
**Do not hand-edit** any file under `architecture_diff/`.
|
|
99
101
|
|
|
100
102
|
- **Pause →** Did I touch any file under `architecture_diff/` by hand? Revert and re-run the CLI verb instead.
|
|
101
|
-
- **Pause →** Does `apltk architecture --spec
|
|
102
|
-
- **Pause →** Does `apltk architecture diff` pair the spec
|
|
103
|
+
- **Pause →** Does `apltk architecture validate --spec <spec_dir>` return OK?
|
|
104
|
+
- **Pause →** Does `apltk architecture diff` pair the spec’s pages correctly?
|
|
103
105
|
|
|
104
106
|
### 4) Clarifications and approval
|
|
105
107
|
|
|
@@ -4,4 +4,7 @@ interface:
|
|
|
4
4
|
default_prompt: >-
|
|
5
5
|
Use $generate-spec to create or update single-spec plans under docs/plans/<date>/<change_name>/ or parallel batches under docs/plans/<date>/<batch_name>/<change_name>/ with shared coordination.md and, only when specs cannot be parallel-safe without prior shared work, minimal non-business preparation.md; treat references/templates/*.md as binding format; member specs assume preparation finished—do not duplicate preparation tasks; surface collisions early and resolve ownership via coordination.md; fill BDD in spec.md; integrate $test-case-strategy into tasks/checklists.
|
|
6
6
|
**Critical layering:** design.md + contract.md are higher-level guiding context only (architecture + cite-backed external truth; coarse INT-### / EXT-### anchors). tasks.md MUST be the ONLY enumerated runnable queue with path-level edits and verification hooks—derive tasks FROM spec + design + contract WITHOUT mirroring checklist rows into design/contract; optionally cite INT/EXT on task lines for traceability—never duplicate task choreography inside design.md or contract.md.
|
|
7
|
-
**Architecture diff:** When the spec touches
|
|
7
|
+
**Architecture overlay + diff:** When the spec touches atlas surface (feature/sub-module, edges, function/variable rows, dataflow, errors), declare proposed-after state ONLY via `apltk architecture --spec <spec_dir> …`. **Exact verbs/flags: ALWAYS `apltk architecture --help`.** CLI writes `<spec_dir>/architecture_diff/atlas/` + renders affected HTML under `<spec_dir>/architecture_diff/`. NEVER hand-author `architecture_diff/**`.
|
|
8
|
+
After mutations: `render --spec`, `validate --spec` (must be OK pre-approval). **`apltk architecture diff`** opens the paginated before/after viewer over all `docs/plans/**/architecture_diff/` vs base `resources/project-architecture/` — run it when atlas changed; verify modified/added/removed pairing.
|
|
9
|
+
Batch specs: one overlay per member directory—never at batch root. If subagents draft multiple features: **wait until ALL finish** before cross-feature `edge` / stitching `meta` / `actor` (same gate as $init-project-html / $spec-to-project-html).
|
|
10
|
+
Field/enums: this skill's references/TEMPLATE_SPEC.md. Semantics: $init-project-html SKILL.md.
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-project-html
|
|
3
3
|
description: >-
|
|
4
|
-
Declare the project HTML architecture atlas through `apltk architecture`
|
|
4
|
+
Declare the project HTML architecture atlas through `apltk architecture` instead of hand-writing SVG/HTML. Two acceptance criteria gate completion: (1) the macro diagram clearly shows feature × sub-module relationships — data flow, call/return interaction logic, error handling, rollback — all expressed as cross-sub-module edges with kinds `call`, `return`, `data-row`, and `failure`; (2) each sub-module’s internal diagram shows function-level flow (`dataflow` steps may reference a declared function plus `reads`/`writes` of declared variables). The tool owns layout, CSS, pan/zoom, and validation. **Subagents only:** one write-capable subagent per feature declares every intra-feature change; the main agent **waits until all subagents finish**, then wires **only** cross-feature seams. **Exact CLI spelling:** always `apltk architecture --help` — never treat prose in this file as the command list. Anchor every declaration to repo evidence.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Init Project HTML
|
|
@@ -11,54 +11,56 @@ description: >-
|
|
|
11
11
|
- Required: none (the CLI ships its own layout engine, CSS, and pan/zoom client; `apltk architecture` is installed with this toolkit).
|
|
12
12
|
- Conditional: `spec-to-project-html` when the same atlas needs spec-driven refresh — that skill uses the same CLI with `--spec`.
|
|
13
13
|
- Optional: `align-project-documents` when `docs/features` already names the user-visible capabilities.
|
|
14
|
-
- Fallback: codebase too large for one pass → use the subagent strategy below
|
|
14
|
+
- Fallback: codebase too large for one pass → use the **subagent** strategy below; document scanned roots and explicit omissions in `meta.summary`. **MUST NOT** declare components for code paths that were never read.
|
|
15
15
|
|
|
16
16
|
## Non-negotiables
|
|
17
17
|
|
|
18
18
|
### Rule 1 — Use the CLI; never hand-author atlas HTML
|
|
19
19
|
|
|
20
|
-
The atlas state lives in `resources/project-architecture/atlas/` (`atlas.index.yaml` + per-feature YAMLs). Every change goes through
|
|
20
|
+
The atlas state lives in `resources/project-architecture/atlas/` (`atlas.index.yaml` + per-feature YAMLs). Every change goes through the CLI (exact verbs/flags: **`apltk architecture --help`**). After any mutation, the CLI re-renders `resources/project-architecture/**/*.html` with the correct layout, CSS, pan/zoom, and ARIA — agents **MUST NOT** edit those HTML files by hand or invent additional ones.
|
|
21
21
|
|
|
22
22
|
### Rule 2 — Sub-module pages describe only themselves; the internal-dataflow diagram is zoomable and structurally typed
|
|
23
23
|
|
|
24
|
-
What the CLI emits on each sub-module page is fixed:
|
|
24
|
+
What the CLI emits on each sub-module page is fixed in *role* (not in exact flag names — those live in `--help`):
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
26
|
+
- **Function I/O table** — one row per declared function/side-effect entry point.
|
|
27
|
+
- **Variables table** — business-purpose identifiers (`scope` enum and `purpose` text).
|
|
28
|
+
- **Internal dataflow** — ordered steps inside a pan/zoom viewport (+/−/Fit), same interaction model as the macro SVG. Steps may attach a declared function name and comma-separated read/write variable names; the renderer shows them as a function pill and read/write chips so **function-to-function flow** and **variable state** are visible in one diagram.
|
|
29
|
+
- **Local errors** — symbolic error rows (`when` / `means`).
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
**Structural constraints** (enforced by `validate`):
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
33
|
+
- Any function name referenced from a dataflow step must already exist on **that** sub-module (`function` row).
|
|
34
|
+
- Any variable name in reads/writes must already exist on **that** sub-module (`variable` row).
|
|
35
|
+
- Purely descriptive steps without fn/reads/writes are allowed, but non-trivial sub-modules **MUST** fill the structure so the diagram is not hollow.
|
|
36
36
|
|
|
37
|
-
Cross-boundary narratives (
|
|
37
|
+
Cross-boundary narratives (“I call X”, “Y calls me”) **MUST** be **edges** between `feature/submodule` endpoints with a `kind` of `call`, `return`, `data-row`, or `failure` — never as extra prose on a sub-module page. There is no CLI path to smuggle cross-boundary text onto sub-module pages.
|
|
38
38
|
|
|
39
|
-
### Rule 3 — Read order:
|
|
39
|
+
### Rule 3 — Read order: subagents only; wait for all workers before cross-feature wiring
|
|
40
40
|
|
|
41
|
-
Real production codebases dwarf the main agent
|
|
41
|
+
Real production codebases dwarf the main agent’s context. **MUST** use this pattern only:
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
1. Enumerate the **feature-module list** (slug + entry + boundary resources only) — **no** function-body deep reads at this stage.
|
|
44
|
+
2. Dispatch **one write-capable subagent per feature** (every feature in scope that needs atlas work). Each subagent:
|
|
45
|
+
- deep-reads **only** its feature;
|
|
46
|
+
- declares **everything intra-feature** via `apltk architecture` scoped with `--feature <slug>` where the CLI allows (exact scoping flags: **`--help`**): sub-modules, per-sub-module functions / variables / ordered dataflow / errors, and **every intra-feature edge** (calls, returns, data-rows, failures, rollback/compensation **between sub-modules of the same feature**);
|
|
47
|
+
- returns **ONLY** a structured summary of (i) sub-module list (slug + kind + one-line role) and (ii) **outbound boundaries** the orchestrator must wire later (calls / data-rows / failures **to other features’** sub-modules — direction, endpoints, suggested kind/label).
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
- **Without subagents:** process features **one at a time** — read feature A end-to-end, declare its sub-modules, functions, variables, internal dataflow, errors, and intra-feature edges via the CLI, then move on. For cross-feature edges that point at not-yet-declared features, declare the placeholder feature with `feature add --slug <future> --title <future>` first, then add the edge; subsequent passes set the real title/story. Drop A's function-level details from working memory before reading feature B.
|
|
49
|
+
3. **Gate — all subagents complete:** The main agent **MUST NOT** declare any **cross-feature** `edge`, shared `meta` that encodes multi-feature narrative, nor any `actor` that exists only to stitch features together, **until every dispatched subagent has finished** (success **or** an explicit failure report). Partial summaries are for note-taking only — **not** for mutating cross-feature atlas state.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
4. After the gate: the main agent aggregates outbound boundary notes, declares **only** cross-feature edges (and optional shared `meta` / `actor` if needed), then runs **`apltk architecture render`** (if batched with `--no-render`) and **`apltk architecture validate`**.
|
|
52
|
+
|
|
53
|
+
The main agent **MUST NOT** re-read source for a delegated feature and **MUST NOT** re-declare intra-feature components a subagent already owns.
|
|
52
54
|
|
|
53
55
|
### Rule 4 — Evidence over invention
|
|
54
56
|
|
|
55
|
-
- **MUST** anchor every declared feature, sub-module, function, variable, dataflow step, and edge to a concrete path / symbol / SQL / config; record scanned roots and any deliberate omissions in `meta.summary` via
|
|
56
|
-
- **MUST NOT** invent modules, integrations, or sub-modules just because the diagram
|
|
57
|
+
- **MUST** anchor every declared feature, sub-module, function, variable, dataflow step, and edge to a concrete path / symbol / SQL / config; record scanned roots and any deliberate omissions in `meta.summary` via the CLI (`meta` verbs — flags: **`--help`**).
|
|
58
|
+
- **MUST NOT** invent modules, integrations, or sub-modules just because the diagram “looks balanced”. Empty rows are valid; lies are not.
|
|
57
59
|
|
|
58
60
|
## Standards (summary)
|
|
59
61
|
|
|
60
62
|
- **Evidence**: every CLI declaration traces to a path/symbol/SQL/config; uncertain areas surface as `TBD` strings or are omitted with a recorded reason.
|
|
61
|
-
- **Execution**: feature-module list
|
|
63
|
+
- **Execution**: shallow feature-module list → subagent fan-out per feature → **wait for all** → cross-feature edges / meta → `validate` → handover.
|
|
62
64
|
- **Quality**: macro SVG carries every cross-feature data-row edge that exists in the system; sub-module declarations are self-only; pan/zoom + Fit work in the rendered HTML; `apltk architecture validate` returns OK.
|
|
63
65
|
- **Output**: `resources/project-architecture/atlas/` (YAML state) + `resources/project-architecture/**/*.html` (renderer output) — both managed by the CLI.
|
|
64
66
|
|
|
@@ -67,40 +69,34 @@ Both paths share one invariant: at any moment the agent doing the deep read only
|
|
|
67
69
|
The atlas is only complete when both of the following are demonstrably true on the rendered HTML (open `resources/project-architecture/index.html` and one representative sub-module page to verify):
|
|
68
70
|
|
|
69
71
|
1. **Macro diagram clearly shows the relationships between features and sub-modules**, including:
|
|
70
|
-
- **Data flow** — every cross-feature DB row, queue topic, or cache key hand-off is a
|
|
71
|
-
- **Interaction logic** — synchronous request/response paths
|
|
72
|
-
- **Error handling and rollback** — every failure / compensation / retry path that crosses a sub-module boundary is a
|
|
73
|
-
- No interaction
|
|
74
|
-
2. **Each sub-module
|
|
75
|
-
- **Function-to-function flow** —
|
|
76
|
-
- **Variable state transitions
|
|
77
|
-
- **Local data flow** —
|
|
72
|
+
- **Data flow** — every cross-feature DB row, queue topic, or cache key hand-off is a `data-row` **edge** between producing and consuming sub-modules (not free-form prose).
|
|
73
|
+
- **Interaction logic** — synchronous request/response paths use paired **`call`** (outbound) and **`return`** edges with a label that names the call site or response shape.
|
|
74
|
+
- **Error handling and rollback** — every failure / compensation / retry path that crosses a sub-module boundary is a **`failure`** edge with a label that names what is rolled back or compensated.
|
|
75
|
+
- No cross-boundary interaction exists **only** in sub-module page prose — it **MUST** appear as an edge on the macro SVG.
|
|
76
|
+
2. **Each sub-module’s internal diagram clearly shows the function-level interactions inside the sub-module**, including:
|
|
77
|
+
- **Function-to-function flow** — non-trivial steps reference a declared function on that sub-module.
|
|
78
|
+
- **Variable state transitions** — variables read or written by a step are declared first, then referenced on the step; reading top-to-bottom traces lifecycle.
|
|
79
|
+
- **Local data flow** — ordered steps read as a directed flowchart to the sub-module boundary.
|
|
78
80
|
|
|
79
|
-
`apltk architecture validate` MUST return OK before reporting completion
|
|
81
|
+
`apltk architecture validate` **MUST** return OK before reporting completion.
|
|
80
82
|
|
|
81
83
|
## How to use `apltk architecture`
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
|
90
|
-
|
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
| `apltk architecture feature\|submodule set ...` | Update fields (e.g. retitle a feature, change a sub-module's role) without re-adding. |
|
|
99
|
-
| `apltk architecture render` | Force-regenerate HTML from current YAML state (useful after editing YAML directly, though hand-editing is discouraged). |
|
|
100
|
-
| `apltk architecture validate` | Schema + referential integrity check; fails on dangling edges, unknown enums, duplicate slugs. |
|
|
101
|
-
| `apltk architecture undo` | Revert the most recent mutation (single-level snapshot). |
|
|
102
|
-
| `apltk architecture open` | Open the rendered macro `index.html` in a browser. |
|
|
103
|
-
| `apltk architecture diff` | Render the paginated before/after viewer for every active spec under `docs/plans/**/architecture_diff/`. |
|
|
85
|
+
**Authoritative command tree:** run **`apltk architecture --help`** (same output as `apltk architecture help`). **MUST** use that output for every verb, subverb (`add` / `set` / `remove` / `reorder`), and required flag. This skill describes **semantics and constraints** only so documentation does not drift when the CLI adds flags or synonyms.
|
|
86
|
+
|
|
87
|
+
**Typical global flags** (confirm in `--help`): `--project <root>`, `--spec <spec_dir>` (overlay under `<spec_dir>/architecture_diff/` — see `spec-to-project-html`), `--no-render`, `--no-open`, `--out` (for `diff`). Pass `--no-render` while batching mutations, then **`render`** once before `validate` if you batched.
|
|
88
|
+
|
|
89
|
+
**Groupings — what each family is for:**
|
|
90
|
+
|
|
91
|
+
| Family | Purpose | Key constraints |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| **`open` / `diff` / `render` / `validate` / `undo` / `help`** | View, regenerate, check, revert, discover verbs | **`validate`** before “done”. **`diff`** after spec overlays to compare base vs proposed-after under `docs/plans/**/architecture_diff/`. |
|
|
94
|
+
| **`meta` / `actor`** | Macro title, summary, optional top-level actors | Summary is the right place for scanned roots and omissions. |
|
|
95
|
+
| **`feature` / `submodule`** | Feature modules and their sub-modules | **Remove** cascades references; in spec overlay mode, rename is usually **remove + add** so `diff` classifies correctly. |
|
|
96
|
+
| **`function` / `variable` / `dataflow` / `error`** | Tables + ordered internal flow + local errors | Declare symbols **before** referencing them from `dataflow`. Use **`remove`** (see `--help`) to delete mistaken rows or steps. |
|
|
97
|
+
| **`edge`** | Cross- **or** intra-feature seams | **`kind`** ∈ `call` \| `return` \| `data-row` \| `failure`. Intra-feature endpoints land in the feature file; cross-feature endpoints land in the index. Prefer stable **`--id`** on edges you may remove later in spec mode. |
|
|
98
|
+
|
|
99
|
+
**Cross-feature work timing:** only after **all** feature subagents have returned (Rule 3).
|
|
104
100
|
|
|
105
101
|
## Workflow
|
|
106
102
|
|
|
@@ -111,21 +107,19 @@ Scan the shipped source for **user-visible capabilities** (each one = one featur
|
|
|
111
107
|
- **Pause →** Is the list actually complete? Note skipped roots with reason; no silent skips.
|
|
112
108
|
- **Pause →** Did I dive into function bodies here? Roll back — keep only structural notes.
|
|
113
109
|
|
|
114
|
-
### 2)
|
|
115
|
-
|
|
116
|
-
#### 2A) With subagents (preferred) — workers own their feature; main agent owns the macro seams
|
|
110
|
+
### 2) Subagent fan-out — workers own features; orchestrator owns cross-feature seams **after** all workers finish
|
|
117
111
|
|
|
118
|
-
Dispatch one **write-capable** subagent per feature
|
|
112
|
+
Dispatch one **write-capable** subagent per feature. Hand each subagent: its feature slug, the feature-module list from step 1 (so it knows other features’ slugs for outbound edges), and **`apltk architecture --help`** as the flag reference.
|
|
119
113
|
|
|
120
114
|
> **Feature `<slug>` subagent contract**
|
|
121
115
|
> - Read every sub-module of this feature.
|
|
122
|
-
> -
|
|
123
|
-
> - For every sub-module:
|
|
124
|
-
> - For every intra-feature interaction between sub-modules
|
|
125
|
-
> - Run
|
|
126
|
-
> - **Return ONLY**: (i) sub-module list (slug + kind + one-line role), (ii) outbound boundaries to *other* features
|
|
116
|
+
> - Declare the feature and its sub-modules (`feature` / `submodule` — exact flags: **`--help`**).
|
|
117
|
+
> - For every sub-module: add **function**, **variable**, ordered **dataflow**, and **error** rows as needed.
|
|
118
|
+
> - For every intra-feature interaction between sub-modules, add an **edge** whose endpoints stay **inside** this feature.
|
|
119
|
+
> - Run **`apltk architecture validate`** before returning (same project root; use **`--help`** for project/spec flags).
|
|
120
|
+
> - **Return ONLY**: (i) sub-module list (slug + kind + one-line role), (ii) outbound boundaries to *other* features’ sub-modules (direction + edge kind + suggested label). No source dumps.
|
|
127
121
|
|
|
128
|
-
|
|
122
|
+
**Orchestrator — after every subagent has completed:**
|
|
129
123
|
|
|
130
124
|
```bash
|
|
131
125
|
apltk architecture meta set --title "..." --summary "..." --no-render
|
|
@@ -137,37 +131,22 @@ apltk architecture render
|
|
|
137
131
|
apltk architecture validate
|
|
138
132
|
```
|
|
139
133
|
|
|
140
|
-
The main agent **MUST NOT** re-declare a subagent
|
|
141
|
-
|
|
142
|
-
#### 2B) Without subagents — feature-by-feature read-declare loop
|
|
143
|
-
|
|
144
|
-
Process the list from step 1 one feature at a time (topological hint: read-from data sources and pure helpers first, user-facing entries last). Per feature:
|
|
145
|
-
|
|
146
|
-
1. **Deep-read** every sub-module of this feature.
|
|
147
|
-
2. **Declare immediately** via the CLI (`feature add`, then `submodule add` × N, then `function`/`variable`/`dataflow`/`error` rows, then intra-feature `edge add`).
|
|
148
|
-
3. **Cross-feature edges**: if the target feature has not been declared yet, declare a placeholder with `feature add --slug <future> --title <future>`, add the edge, then refine the placeholder on a later pass.
|
|
149
|
-
4. **Drop function-level details from working memory** before moving to the next feature.
|
|
150
|
-
|
|
151
|
-
After the last feature:
|
|
152
|
-
|
|
153
|
-
- Refine any placeholder features that were used to carry cross-feature edges.
|
|
154
|
-
- Run `apltk architecture validate` — must return OK.
|
|
134
|
+
The main agent **MUST NOT** re-declare a subagent’s intra-feature components, and **MUST NOT** open source files for any feature it delegated.
|
|
155
135
|
|
|
156
136
|
### 3) Handover report
|
|
157
137
|
|
|
158
|
-
Report: feature count, sub-module count, macro edge counts (call / return / data-row / failure), uncovered paths + reasons,
|
|
138
|
+
Report: feature count, sub-module count, macro edge counts (call / return / data-row / failure), uncovered paths + reasons, confirmation that **all subagents completed before cross-feature wiring**, and the location of the rendered atlas (`resources/project-architecture/index.html`).
|
|
159
139
|
|
|
160
140
|
## Sample hints
|
|
161
141
|
|
|
162
|
-
- Multiple SQL paths on `service ↔ db` →
|
|
163
|
-
- Retry loops between `service ↔ generator(pure)` → call/return pair
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
- Third-party systems → declare as `--kind external` sub-modules; the trust boundary becomes visible because the renderer styles them differently.
|
|
142
|
+
- Multiple SQL paths on `service ↔ db` → one **`edge`** per SQL path so the macro shows distinct strokes.
|
|
143
|
+
- Retry loops between `service ↔ generator(pure)` → **`call` / `return`** pair on the macro plus ordered **`dataflow`** steps on the service that show retry budget and persistence.
|
|
144
|
+
- Cross-feature DB hand-off (A writes, B reads) → both sides declare DB-oriented functions, then a **`data-row`** edge from producer to consumer.
|
|
145
|
+
- Rollback / compensation across sub-modules → **`failure`** edge with an explicit label; cleanup *inside* a single sub-module belongs in ordered **`dataflow`** steps.
|
|
146
|
+
- Third-party systems → **`external`** kind sub-modules so the trust boundary is visible in styling.
|
|
168
147
|
|
|
169
148
|
## References
|
|
170
149
|
|
|
171
|
-
- `lib/atlas/schema.js` —
|
|
172
|
-
- `lib/atlas/cli.js` —
|
|
150
|
+
- `lib/atlas/schema.js` — fields, enums, validation. `references/TEMPLATE_SPEC.md` mirrors the schema as a cheat sheet (not a substitute for **`apltk architecture --help`**).
|
|
151
|
+
- `lib/atlas/cli.js` — implementation of dispatch (`apltk architecture --help` prints usage).
|
|
173
152
|
- `init-project-html/sample-demo/` — end-to-end YAML + rendered HTML for two features.
|
|
@@ -2,21 +2,10 @@ interface:
|
|
|
2
2
|
display_name: "init-project-html"
|
|
3
3
|
short_description: "Declare the project HTML architecture atlas through `apltk architecture` CLI verbs"
|
|
4
4
|
default_prompt: >-
|
|
5
|
-
Use $init-project-html.
|
|
6
|
-
NEVER hand-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`apltk architecture meta set --title "..." --summary "..."`,
|
|
13
|
-
`apltk architecture actor add --id <kebab> --label "..."`,
|
|
14
|
-
`apltk architecture feature add --slug <kebab> --title "..." --story "..." [--depends-on a,b]`,
|
|
15
|
-
`apltk architecture submodule add --feature X --slug Y --kind ui|api|service|db|pure-fn|queue|external --role "..."`,
|
|
16
|
-
`apltk architecture function add --feature X --submodule Y --name fn --in "T1, T2" --out "R | ErrX" --side pure|io|write|tx|lock|network --purpose "..."`,
|
|
17
|
-
`apltk architecture variable add --feature X --submodule Y --name v --type T --scope call|tx|persist|instance|loop --purpose "..."`,
|
|
18
|
-
`apltk architecture dataflow add --feature X --submodule Y --step "..." [--fn <declared-fn>] [--reads "v1,v2"] [--writes "v3,v4"] [--at N]` (use `--fn` to surface function-to-function flow inside the sub-module; use `--reads` / `--writes` to surface variable state transitions — every name MUST match a `function`/`variable` already declared in the SAME sub-module or `validate` fails),
|
|
19
|
-
`apltk architecture error add --feature X --submodule Y --name ErrCode --when "..." --means "..."`,
|
|
20
|
-
`apltk architecture edge add --from <feature>[/sub] --to <feature>[/sub] --kind call|return|data-row|failure --label "..." [--id <stable>]`.
|
|
21
|
-
Intra-feature edges (both endpoints in the same feature with sub-modules) land in the feature YAML; cross-feature edges land in `atlas.index.yaml`. After the last mutation run `apltk architecture validate` — must return OK; resolve every reported error before reporting completion.
|
|
22
|
-
Each sub-module page describes ONLY itself (`sub-io` function I/O + `sub-vars` variables-with-business-purpose + `sub-dataflow` zoomable internal flow with fn pill + reads/writes chips + `sub-errors` local errors) — express any cross-boundary interaction as an edge, never as sub-module page prose. Two acceptance criteria gate completion: (1) the macro diagram clearly shows feature×sub-module relationships — data flow, call/return interaction logic, error handling, rollback — all as `--kind call|return|data-row|failure` edges (no cross-boundary path expressed only as prose); (2) every non-trivial sub-module's internal diagram clearly shows function-level interactions — `dataflow add --fn <declared-fn>` for function-to-function flow + `--reads` / `--writes` for variable state transitions through the run. Anchor every declaration to a concrete path / symbol / SQL / config; mark TBD when evidence is missing; record scanned roots and deliberate omissions in `meta.summary`. Report which read strategy (2A or 2B) was actually used and the location of the rendered atlas (`resources/project-architecture/index.html`).
|
|
5
|
+
Use $init-project-html. Semantic rules + acceptance criteria live in its SKILL.md; field/enum cheat sheet in references/TEMPLATE_SPEC.md; **exact verb/subverb/flag spelling MUST come from `apltk architecture --help`** — never memorize commands from prose.
|
|
6
|
+
NEVER hand-edit `resources/project-architecture/**/*.html`. State is YAML under `resources/project-architecture/atlas/`; every mutation goes through the CLI; renderer owns layout, CSS, ARIA, pan/zoom on macro + sub-module dataflow SVGs.
|
|
7
|
+
**Subagents only:** STEP 1 — shallow feature-module list (slug, entry, boundaries), no function-body reads. STEP 2 — dispatch ONE write-capable subagent per feature; each declares ALL intra-feature state (sub-modules, function/variable/dataflow/error rows, intra-feature edges) via `apltk architecture` (flags: `--help`). Each returns ONLY (i) sub-module list and (ii) outbound boundary notes for OTHER features.
|
|
8
|
+
**HARD GATE:** the main agent MUST wait until EVERY dispatched subagent has finished (success or explicit failure report) before declaring ANY cross-feature `edge`, shared `meta` that stitches multiple features, or `actor` that exists only for cross-feature context.
|
|
9
|
+
After the gate: batch cross-feature `edge` (+ optional `meta`/`actor`), then `apltk architecture render` (if you used `--no-render`) and `apltk architecture validate`. The orchestrator MUST NOT re-read delegated features or re-declare intra-feature components.
|
|
10
|
+
Sub-module pages are self-only — cross-boundary behavior is ALWAYS `edge` with kind call|return|data-row|failure. Internal `dataflow` steps may reference a declared function plus reads/writes of declared variables in the SAME sub-module or validate fails.
|
|
11
|
+
Anchor every declaration to repo evidence; use `meta.summary` for scanned roots/omissions. Report completion only after validate is OK; point reviewers to `resources/project-architecture/index.html`.
|