@laitszkin/apollo-toolkit 3.9.6 → 3.10.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.
Files changed (46) hide show
  1. package/AGENTS.md +2 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +6 -0
  4. package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
  5. package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
  6. package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
  7. package/cjk-pdf/agents/openai.yaml +5 -0
  8. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  9. package/generate-spec/SKILL.md +24 -4
  10. package/generate-spec/agents/openai.yaml +1 -0
  11. package/generate-spec/references/TEMPLATE_SPEC.md +98 -0
  12. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  13. package/init-project-html/SKILL.md +181 -0
  14. package/init-project-html/agents/openai.yaml +13 -0
  15. package/init-project-html/references/TEMPLATE_SPEC.md +98 -0
  16. package/init-project-html/references/architecture-page.template.html +35 -0
  17. package/init-project-html/references/architecture.css +1059 -0
  18. package/init-project-html/sample-demo/resources/project-architecture/assets/architecture.css +1059 -0
  19. package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/index.html +54 -0
  20. package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/invite-code-generator.html +165 -0
  21. package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/invite-issuance-service.html +198 -0
  22. package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/postgresql.html +165 -0
  23. package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/public-api.html +152 -0
  24. package/init-project-html/sample-demo/resources/project-architecture/features/get-invite-codes/web-get-invite-ui.html +140 -0
  25. package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/index.html +53 -0
  26. package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/postgresql.html +161 -0
  27. package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/public-api.html +145 -0
  28. package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/registration-service.html +190 -0
  29. package/init-project-html/sample-demo/resources/project-architecture/features/invite-code-registration/web-register-ui.html +140 -0
  30. package/init-project-html/sample-demo/resources/project-architecture/index.html +337 -0
  31. package/init-project-html/scripts/architecture.js +496 -0
  32. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  33. package/lib/cli.js +2 -0
  34. package/lib/tool-runner.js +7 -0
  35. package/merge-changes-from-local-branches/SKILL.md +75 -128
  36. package/merge-changes-from-local-branches/agents/openai.yaml +1 -1
  37. package/merge-conflict-resolver/agents/openai.yaml +5 -0
  38. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  39. package/package.json +1 -1
  40. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  41. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  42. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  43. package/spec-to-project-html/SKILL.md +116 -0
  44. package/spec-to-project-html/agents/openai.yaml +12 -0
  45. package/spec-to-project-html/references/TEMPLATE_SPEC.md +98 -0
  46. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
@@ -1,167 +1,114 @@
1
1
  ---
2
2
  name: merge-changes-from-local-branches
3
3
  description: >-
4
- Read changes from local branches identified by branch name and merge them back
5
- into the current local branch. When conflicts arise, auto-resolve them by
6
- keeping correct functionality (preferring the more recent change on the same
7
- line, or the change that preserves working behavior). After merge verification,
8
- run `archive-specs` so completed plan sets are archived and durable project
9
- docs are synchronized, then hand the current branch state to `commit-and-push`
10
- so the final submit workflow commits and pushes on that same local branch.
11
- Use when the user asks to consolidate local branch work, merge named branches
12
- into the current branch, or prepare the current branch for integration.
4
+ Read changes from local branches identified by branch name and merge them back into the current local branch. Resolve conflicts by composing correct behavior (prefer the more recent change on the same line or the variant that preserves working behavior), using **`merge-conflict-resolver`** when needed. Verify after merges; remove successfully merged source branches and detached worktrees only after merge + verification succeed. Finalize through **`commit-and-push`** for submission-readiness gates and the **final local commit** on the same branch—**do not** push unless the user explicitly requested remote update in this thread (**`commit-and-push`** step 7). **Does not** run **`archive-specs`** as part of this skill.
5
+ Use when consolidating named local branch work into the current branch or preparing integration on that branch.
13
6
  ---
14
7
 
15
8
  # Merge Changes from Local Branches
16
9
 
17
10
  ## Dependencies
18
11
 
19
- - Required: `archive-specs` to archive completed plan sets and synchronize durable project docs after merge verification, and `commit-and-push` for the final current-branch submission flow.
20
- - Conditional: `merge-conflict-resolver` to resolve merge conflicts deterministically when conflicts arise.
12
+ - Required: **`commit-and-push`** for submission-readiness, mandated reviews, and the **final** commit on the original current branch (push **only** when the user explicitly asked for remote update in this thread—otherwise stop after commit).
13
+ - Conditional: **`merge-conflict-resolver`** when merge conflicts require deterministic resolution.
21
14
  - Optional: none.
22
- - Fallback: If git operations fail, stop and report the error.
15
+ - Fallback: If **`commit-and-push`** is unavailable, **MUST** stop and report—**MUST NOT** improvise readiness or use a bare `git commit` shortcut. If git merge operations fail irreparably, stop and report.
23
16
 
24
- ## Standards
17
+ ## Non-negotiables
25
18
 
26
- - Evidence: Inspect the original current branch, local branches, branch-name matches provided by the user or active spec names, actual conflicting files, and any active batch-spec `coordination.md` merge-order guidance before deciding what to merge.
27
- - Execution: Merge only the relevant named branches back into the original current branch, read any active batch-spec `coordination.md` and honor its documented merge order when present, resolve conflicts by reading both sides and editing the merged result to preserve shipped behavior, verify the merged state, delete each successfully merged source branch and its detached worktree only after the merged result is confirmed, run `archive-specs` after merge verification so completed plan sets are archived and durable docs are synchronized, then hand the final current-branch state to `commit-and-push` so changelog/readiness/commit/push work happens through the shared submission workflow on the same branch.
28
- - Quality: Never use blanket timestamp rules or default `-X ours/theirs` conflict resolution as the primary merge strategy, never infer in-scope branches from ancestry heuristics when branch names already define the target set, and do not declare success until the final current-branch state has been checked, verified, and cleared for post-merge archival/doc-sync work.
29
- - Output: Produce a clean current branch with all relevant named-branch changes integrated and ready for the shared submit workflow.
19
+ - **MUST** treat the branch that was current at workflow start as the **authoritative merge target** for the whole workflow; **MUST NOT** silently switch the destination to **`main`** or another branch unless the user explicitly rescopes.
20
+ - **MUST** determine in-scope branches from **explicit branch names** the user gives **or** from unambiguous mappings from active spec / `coordination.md` context—**MUST NOT** infer the merge set from ancestry heuristics alone when names already define intent.
21
+ - **MUST** read active batch **`coordination.md`** when present and honor a documented **`Merge order` / landing order**; if multiple batches conflict or branch-to-spec mapping is ambiguous, **MUST** stop and report instead of guessing order.
22
+ - **MUST** resolve conflicts by reading both sides and editing merged results that preserve shipped behavior—**MUST NOT** rely on blanket **`-X ours` / `-X theirs`** or timestamp guesses as the primary strategy.
23
+ - **`archive-specs`**: **MUST NOT** invoke **`archive-specs`** from this skill. Any archival or doc-sync routing belongs to **`commit-and-push`** (via **`submission-readiness-check`**) when that workflow’s gates require it—not a separate mandated step immediately after merges here.
24
+ - **MUST** verify the merged tree (targeted checks after conflictful merges; broader **`npm test` / equivalent** when the repo provides a standard command) before deleting source branches or handing off to **`commit-and-push`**.
25
+ - **MUST NOT** **`git push`**, tag, or release **from this skill**; **`commit-and-push`** owns push **only** when the user explicitly requested remote publication in this thread (**same rule as **`commit-and-push`** step 7**).
26
+ - **MUST** finalize through **`commit-and-push`** after staging the post-merge intent—**MUST NOT** bypass **`submission-readiness-check`** / mandated gates with a stray local commit path.
27
+ - **MUST NOT** force-delete merged branches (**`-D`**) when **`-d`** refuses; **MUST** stop and report branches that are not actually merged into the target.
30
28
 
31
- ## Goal
29
+ ## Standards (summary)
32
30
 
33
- Consolidate the intended named local branches back into the original current branch with automatic conflict resolution that preserves correct functionality.
31
+ - **Evidence**: `git branch`, `git log` / diff stats vs current branch, conflict file contents, `coordination.md` merge order when present.
32
+ - **Execution**: Inventory → clean target branch → sequential merges → verify → prune merged branches/worktrees → **`commit-and-push`** through local commit (push only if user asked).
33
+ - **Quality**: Scope strictly to named / mapped branches; no unrelated branch sweeps; no push-by-default from this workflow.
34
+ - **Output**: Integrated current branch ready for **`commit-and-push`**; concise report of merged/skipped branches, conflicts resolved, verification commands.
34
35
 
35
36
  ## Workflow
36
37
 
38
+ **Chain-of-thought:** Before each numbered step, answer the **`Pause →`** prompts. Validator or verification red **blocks** advancing to pruning or **`commit-and-push`**.
39
+
37
40
  ### 1) Inventory the current branch and in-scope named branches
38
41
 
39
- - Run `git branch` to list all local branches.
40
- - Check the current branch with `git branch --show-current` and capture `git status -sb`.
41
- - Inspect active planning artifacts under `docs/plans/` and look for batch roots that still contain live spec sets plus a `coordination.md`.
42
- - When an active batch is present, read its `coordination.md` before deciding merge order.
43
- - Treat the original current branch as the authoritative merge target for the whole workflow; do not silently switch that target to `main`.
44
- - Determine the in-scope branches directly from branch names:
45
- - prefer the exact branch names the user provided
46
- - otherwise map active spec-set names or documented merge-order entries to branch names
47
- - otherwise stop and report the missing branch-name target instead of inferring from ancestry
48
- - Accept a branch as in scope only when its branch name can be matched unambiguously to the requested merge set; skip unrelated local branches.
49
- - Compare each in-scope candidate branch against the current branch with `git log --oneline <current-branch>..<candidate>`, `git diff --stat <current-branch>...<candidate>`, or equivalent evidence so empty or already-merged branches are skipped.
50
- - For each branch, note:
51
- - Branch name
52
- - How the branch name was matched to the requested merge set
53
- - Commits ahead of the current branch
54
- - Last commit message (via `git log -1 --oneline`)
42
+ - Run `git branch`; capture `git branch --show-current` and `git status -sb`.
43
+ - Inspect `docs/plans/` for active batch roots that include **`coordination.md`**; read merge-order guidance **before** choosing sequence.
44
+ - Build the merge set from **user branch names**, else from unambiguous spec-name / **`coordination.md`** mappings—if a required name cannot be matched, stop and report.
45
+ - For each candidate: `git log --oneline <current>..<candidate>` and `git diff --stat <current>...<candidate>` (or equivalent); skip empty / already-up-to-date branches and record why.
46
+ - Per branch, note: name, match rationale, commits ahead, `git log -1 --oneline`.
47
+ - **Pause →** Is every in-scope branch matched **unambiguously**, not by “probably related” ancestry?
48
+ - **Pause →** If **`coordination.md`** gives a merge order, does my sequence match it literally?
55
49
 
56
50
  ### 1.5) Resolve merge order from active batch specs
57
51
 
58
- - Treat active batch specs as authoritative merge-order guidance when they include a concrete `Merge order / landing order` entry in `coordination.md`.
59
- - Map branch names to the corresponding spec sets or worktrees using the batch folder names, spec-set names, and documented merge-order entries; do not guess when the mapping is ambiguous.
60
- - Merge only the in-scope named branches in the documented order when that order is explicit.
61
- - If multiple active batches exist, reconcile their merge-order guidance before merging; if the orders conflict or the branch-to-spec mapping is unclear, stop and report the ambiguity instead of choosing an arbitrary sequence.
62
- - If no active batch spec provides an explicit merge order, fall back to the requested branch-name list and merge the relevant branches sequentially in that explicit name order.
52
+ - When **`coordination.md`** defines **`Merge order` / landing order**, merge **only** in that order after mapping branch names to specs/worktrees without guessing.
53
+ - When multiple active batches disagree or mapping is unclear, stop and report.
54
+ - When no explicit order exists, use the user’s branch list order sequentially.
55
+ - **Pause →** Would merging in a different order violate a written batch plan?
63
56
 
64
57
  ### 2) Ensure clean state on the original current branch
65
58
 
66
- - Check `git status` on the original current branch.
67
- - If the current branch has uncommitted changes that are unrelated to the merge request, stop and report them instead of stashing automatically.
68
- - Never change the authoritative target branch unless the user explicitly asks for a different destination.
69
- - Only proceed once you can state which branch or branches actually need to be merged.
59
+ - Inspect `git status`. If unrelated uncommitted changes block a safe merge, stop and report—**MUST NOT** stash or discard without user direction.
60
+ - **Pause →** Am I still on the **same** authoritative target branch I started with?
70
61
 
71
62
  ### 3) Merge branches sequentially in the resolved order
72
63
 
73
- For each in-scope named branch:
64
+ For each in-scope branch:
65
+
66
+ 1. `git checkout <current-branch>`
67
+ 2. `git merge <branch-name> --no-ff -m "Merge branch '<branch-name>' into <current-branch>"`
68
+ 3. On conflicts: use **`merge-conflict-resolver`**; then `git add` resolved paths.
69
+ 4. If resolution is ambiguous, prefer behavior that preserves tests, documented intent, and minimal semantic drift.
70
+ 5. Complete the merge commit if Git did not auto-complete.
74
71
 
75
- 1. Check out the original current branch:
76
- ```bash
77
- git checkout <current-branch>
78
- ```
72
+ ### 4) Verify merged state
79
73
 
80
- 2. Merge the branch:
81
- ```bash
82
- git merge <branch-name> --no-ff -m "Merge branch '<branch-name>' into <current-branch>"
83
- ```
74
+ - After conflictful merges, run the most relevant targeted tests or builds for touched areas.
75
+ - After all merges, run the repo’s usual validation (`npm test`, `cargo test`, etc.) when applicable.
76
+ - **Pause →** Did verification fail? **MUST** fix on the current branch before pruning or **`commit-and-push`**—**do not** hide red tests behind a merge report.
84
77
 
85
- 3. If conflicts occur, use $merge-conflict-resolver to resolve them deterministically.
78
+ ### 5) Prune merged sources (after verified success only)
86
79
 
87
- After resolving files:
88
- ```bash
89
- git add <resolved-files>
90
- ```
80
+ - `git worktree list`; remove worktrees for successfully merged branches when safe.
81
+ - `git branch -d <branch-name>` only for verified merges; refuse **`-D`** when **`-d`** fails—report instead.
82
+ - **Never** delete the original target branch, the checked-out branch, or branches that failed / were skipped.
91
83
 
92
- 4. If auto-resolution is ambiguous, prefer the change that:
93
- - Does not break existing tests
94
- - Preserves the documented feature intent
95
- - Aligns with the code currently shipped on the source branch
96
- - Minimizes hidden semantic drift between the merged modules
84
+ ### 6) Submit via **`commit-and-push`** (local commit; push optional)
97
85
 
98
- 5. Complete the merge:
99
- ```bash
100
- git commit -m "Merge branch '<branch-name>' into <current-branch>"
101
- ```
86
+ - Stage the post-merge / fix-up intent per user scope.
87
+ - Run **`commit-and-push`** through **commit**: inspect, classify gates, mandated reviews where applicable, **`submission-readiness-check`**, then commit with conventional message—**omit push** unless the user explicitly requested remote update in this thread ( **`commit-and-push`** step **7**).
88
+ - **MUST NOT** reintroduce **`archive-specs`** as a sibling step controlled by **this** skill; if **`submission-readiness-check`** routes archival work, **`commit-and-push`** owns that decision.
89
+ - **Pause →** Am I about to push without an explicit user request for remote publication?
90
+ - **Pause →** Does `git diff --cached` match intended merge scope—no stray unrelated paths?
102
91
 
103
- ### 4) Verify merged state
92
+ ### 7) Report
104
93
 
105
- - After each conflictful merge, run the most relevant targeted tests or build checks for the files that changed.
106
- - After all merges complete, run the repository's broader validation command when one exists:
107
- ```bash
108
- npm test # or yarn test, cargo test, etc.
109
- ```
110
- - If verification fails, fix the merged state on the current branch before proceeding.
111
-
112
- ### 5) Archive completed specs and sync durable project docs
113
-
114
- - After all in-scope merges succeed and the current-branch state has been verified, invoke `archive-specs`.
115
- - Let `archive-specs` convert and archive any completed `docs/plans/...` spec sets that now reflect the delivered outcome.
116
- - Let `archive-specs` synchronize durable project docs and `AGENTS.md/CLAUDE.md` when the merged result changed operator workflows, repository guidance, or user-visible behavior.
117
- - Do not proceed to the final submission commit while required archival or documentation updates remain unfinished.
118
- - If no completed spec sets or project-doc drift are present, record that evidence explicitly before moving on.
119
-
120
- ### 6) Hand off the merged result for shared submission handling
121
-
122
- - After a source branch has been merged successfully and the merged current-branch state has been verified, remove the source branch worktree if one exists:
123
- ```bash
124
- git worktree list
125
- git worktree remove <worktree-path>
126
- ```
127
- - Delete only branches that were merged successfully:
128
- ```bash
129
- git branch -d <branch-name>
130
- ```
131
- - If a branch still has an attached worktree, remove the worktree before deleting the branch.
132
- - Never delete:
133
- - the original current branch
134
- - the currently checked-out branch
135
- - branches that were skipped, failed to merge, or still need manual follow-up
136
- - If `git branch -d` refuses deletion because the branch is not actually merged, stop and report the branch instead of forcing deletion with `-D`.
137
- - Once merge verification and archival/doc synchronization pass, invoke `commit-and-push` for the original current branch so the final submission flow owns:
138
- - `CHANGELOG.md` readiness
139
- - the final commit creation on the original current branch
140
- - the user-requested push on that same branch
141
- - Do not duplicate commit-message or changelog-readiness logic inside this skill; post-merge archival must flow through `archive-specs`.
142
- - If a follow-up fix is required after verification or archival/doc sync, make that fix on the original current branch before handing off to `commit-and-push`.
143
-
144
- ### 7) Report completion
145
-
146
- - List all named branches that were merged.
147
- - List any branches intentionally skipped because they were already merged, empty, or out of scope.
148
- - Confirm the original current branch is updated with all merged changes.
149
- - Note any conflicts that were resolved and the rationale.
150
- - Report the verification commands that were run.
151
- - Report whether `archive-specs` updated durable docs or found no archival/doc-sync work to do.
152
- - Confirm whether the workflow stopped at the local commit boundary or continued into a remote push because the user explicitly requested it.
94
+ - List merged vs skipped branches and why.
95
+ - Current branch name; confirmation merges landed on original target.
96
+ - Conflicts resolved and brief rationale.
97
+ - Verification commands executed.
98
+ - State whether completion stopped at **local HEAD** (**no push**) or included push per explicit user ask.
99
+
100
+ ## Sample hints
101
+
102
+ - **Skip**: candidate shows no commits ahead of current—record “already merged / empty”.
103
+ - **`coordination.md`**: landing order **`api-layer`** then **`cli-wrapper`** merge matching branches in that sequence even if creation dates differ.
104
+ - **`commit-and-push` without push**: user said “merge and commit locally”—run **`commit-and-push`** gates and commit; report `HEAD` hash; **no** **`git push`**.
153
105
 
154
106
  ## Working Rules
155
107
 
156
- - Never force-push; use only merge or rebase with merge.
157
- - Prefer preserving functionality over keeping either branch's exact changes.
158
- - Do not push to remote from this skill directly; let `commit-and-push` own any later publish step only when the user explicitly requests it.
159
- - Never merge unrelated or ambiguously matched branches into the current branch; merge only branches whose names are explicitly requested or can be matched unambiguously from the active spec context.
160
- - If a branch contains no meaningful changes (empty merge), skip it.
161
- - Keep the current branch history clean and readable.
162
- - If a branch's merge breaks tests, resolve the conflict differently before committing.
163
- - Do not stash or discard unrelated work automatically; stop when the working tree state makes the merge ambiguous.
164
- - Delete merged source branches and their detached worktrees only after the merge commit and verification both succeed.
165
- - When active batch specs provide merge-order guidance for in-scope named branches, follow that order unless new evidence proves the plan is stale or inapplicable; if so, stop and report the mismatch instead of silently overriding the batch plan.
166
-
167
- Resolve conflicts using $merge-conflict-resolver.
108
+ - Never force-push from this workflow.
109
+ - Preserve functionality over winning either branchs raw diff verbatim.
110
+ - Do not merge ambiguously matched or unrelated branches.
111
+ - Do not delete merged sources until merge commit **and** verification succeed.
112
+ - When batch merge-order documentation applies, follow it unless you stop with evidence it is stale.
113
+
114
+ Resolve conflicts using **`merge-conflict-resolver`**.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Merge Changes from Local Branches"
3
3
  short_description: "Merge named local branches back into the current branch with checked conflict resolution"
4
- default_prompt: "Use $merge-changes-from-local-branches to inventory the current branch plus the named local branches that should be merged, inspect active batch-spec `coordination.md` files under `docs/plans/` and follow their documented merge order when present, match the merge scope by branch name instead of branch ancestry, merge only those in-scope branches back into the same current branch, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, run `archive-specs` so completed plan sets are archived and durable docs are synchronized before the final submit step, delete successfully merged source branches and detached worktrees only after verification succeeds, and leave remote publication to `commit-and-push`."
4
+ default_prompt: "Use $merge-changes-from-local-branches to inventory the current branch plus the named local branches that should be merged, inspect active batch-spec `coordination.md` files under `docs/plans/` and follow their documented merge order when present, match the merge scope by branch name instead of branch ancestry, merge only those in-scope branches back into the same current branch, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, delete successfully merged source branches and detached worktrees only after verification succeeds, then run $commit-and-push for submission-readiness and the final local commit on that branch without pushing unless the user explicitly requested remote update in the same thread. Do not invoke $archive-specs from this skill."
@@ -0,0 +1,5 @@
1
+ interface:
2
+ display_name: "merge-conflict-resolver"
3
+ short_description: "Resolve git merge conflicts with deterministic, evidence-based rules"
4
+ default_prompt: >-
5
+ Use $merge-conflict-resolver to read both sides of conflict markers, apply scenario-specific resolution rules that preserve intended behavior, verify with the project’s tests or checks, and when the user needs persistence, hand off to $commit-and-push instead of ad-hoc git commands.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "3.9.6",
3
+ "version": "3.10.0",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: spec-to-project-html
3
+ description: >-
4
+ Sync HTML architecture pages to active planning specs. **MUST** preserve the two-layer rule: macro `index.html` stays ONE SVG showing both feature-module and sub-module interactions (multi-edge, producer/consumer loops, cross-feature data-row); each sub-module page stays self-only (function I/O + variables-with-business-purpose + internal data flow + local errors). Feature `index.html` stays lightweight (story + submodule-nav). Read strategy mirrors `init-project-html`: list affected feature modules first; with subagents, dispatch one read-only subagent per affected feature to return summaries before patching; without subagents, patch one feature's pages plus its macro slice before moving to the next — never load every affected feature's code into the main context at once. Ground in repo evidence; mark `TBD` when code is missing.
5
+ ---
6
+
7
+ # Spec To Project HTML
8
+
9
+ ## Dependencies
10
+
11
+ - Required: **`init-project-html`** — its `SKILL.md` is the binding rulebook for page contracts (Rules 1–7), and its `references/architecture.css` is the shared asset to copy. Local cheat sheet (same vocabulary + class hooks + DOM snippets) lives in this skill's own `references/TEMPLATE_SPEC.md`.
12
+ - Conditional: **`recover-missing-plan`** if a spec pointer is missing.
13
+ - Conditional: **`generate-spec`** / **`implement-specs*`** terminology for requirement IDs.
14
+ - Optional: **`review-spec-related-changes`** when verifying diagram updates against specs.
15
+ - Fallback: spec demands components that are absent from code → label **planned / gap** in macro summary and on affected nodes; **MUST NOT** mark them as implemented.
16
+
17
+ ## Non-negotiables
18
+
19
+ - **MUST** read specs in order unless the user directs otherwise: `spec.md` → `design.md` → `contract.md` → coordination notes.
20
+ - **MUST** open and parse the existing macro `index.html`, every `features/<slug>/index.html`, **and every sub-module HTML** before editing — preserve `data-feature-id` / `data-submodule-id` / `data-edge-id` unless a rename is explicit and propagated everywhere (including the macro SVG nav and the macro manifest).
21
+ - **MUST** obey `init-project-html/SKILL.md` Rules 1–7 (page contracts, naming, assets, accessibility, forbidden shortcuts). Two reminders that this skill violates most often:
22
+ - **Rule 1** — cross-submodule interactions live only in the macro SVG (multi-edge, producer/consumer, cross-feature data-row); the macro **MUST** index every sub-module page.
23
+ - **Rule 2** — sub-module pages contain only `sub-io` + `sub-vars` (variables-with-business-purpose) + `sub-dataflow` + `sub-errors`; no cross-boundary narrative.
24
+ - **MUST** reconcile new requirements and design deltas:
25
+ - In the macro SVG, add/remove/relabel sub-module nodes and edges; every new node also gets a sub-module HTML and a manifest row.
26
+ - On sub-module pages, add/remove/update function I/O and internal data flow; **never** describe cross-boundary interactions here — update the macro edges instead.
27
+ - **MUST** migrate any leftover legacy structure during the same edit pass:
28
+ - feature index `flow-chart--submodules` / `flow-edge-manifest` / `flow-return-row` → move to the macro; feature index reverts to lightweight.
29
+ - sub-module page `submodule-role` cross-boundary prose or cross-boundary manifests → delete or compress into a single "see macro" link.
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.
33
+ - **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 patch the macro and pages in one pass.
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.
37
+
38
+ ## Standards (summary)
39
+
40
+ - **Evidence**: cite the spec passage (design subsystem entry) alongside the code path.
41
+ - **Execution**: locate the plan set → read the existing HTML tree → list affected feature modules → branch by environment (subagent fan-out OR sequential read-patch-write; resolve macro pending edges last) → link check.
42
+ - **Quality**: the macro SVG keeps "≥2 edges on one node pair", "at least one producer/consumer loop", and "at least one cross-feature data-row" (when the spec still requires it); sub-module pages stay self-only; CSS paths correct; no pending edges left.
43
+ - **Output**: touches only `resources/project-architecture/**`. If files are missing, scaffold via `init-project-html` first, then merge spec deltas.
44
+
45
+ ## Workflow
46
+
47
+ ### 1) Resolve spec inputs
48
+
49
+ User-pointed path wins; otherwise use the batch `coordination.md` or `recover-missing-plan` to find the most recent plan; collect `R…` / `INT-…` IDs for traceability.
50
+
51
+ ### 2) List the affected feature modules (no function bodies yet)
52
+
53
+ Derive from the spec/design diff which feature modules change: new nodes, edge changes, variable changes, error changes, retired sub-modules… **Also** include any feature that owns 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
+
55
+ ### 3) Read the current HTML atlas (scoped to affected features)
56
+
57
+ Load the macro `index.html` + every affected feature directory + that directory's sub-module pages; list existing node/edge IDs; lock the IDs to preserve (so steps 4/5 do not silently rename).
58
+
59
+ ### 4) Branch the deep-read + patch by environment (mirrors `init-project-html` Rule 3)
60
+
61
+ #### 4A) With subagents (preferred)
62
+
63
+ Dispatch one **read-only subagent per affected feature**, requiring this summary:
64
+
65
+ > **Feature `<slug>` change summary**
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`.
71
+
72
+ Main agent collects summaries and patches in one pass:
73
+
74
+ 1. Patch the macro `index.html`: add/change/remove `<a><g class="m-sub">` nodes; add/change/remove `<path class="m-edge ...">`; mirror in `flow-edge-manifest--macro`; preserve multi-edge, call/return pairs, cross-feature data-row.
75
+ 2. Patch each affected `features/<slug>/index.html` (still lightweight) and each affected sub-module page (self-only: `sub-io`, `sub-vars`, `sub-dataflow`, `sub-errors` all in sync).
76
+ 3. Update `<nav class="atlas-submodule-index">`: link new pages; remove retired pages.
77
+
78
+ - **Pause →** Do `planned` / `gap` nodes appear consistently in both the macro and `atlas-summary` as "not yet implemented"? Inconsistency would mislead readers.
79
+
80
+ #### 4B) Without subagents — feature-by-feature read-patch-write
81
+
82
+ Process the step-2 list one feature at a time. Per feature, run the full inner loop:
83
+
84
+ 1. **Deep-read** this feature's affected sub-modules (functions, variables, boundaries).
85
+ 2. **Patch immediately**:
86
+ - `features/<slug>/index.html` (refresh user story; add/remove rows in `submodule-nav`; do NOT re-introduce a cross-submodule flowchart).
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.
96
+
97
+ Final pass after every feature is patched:
98
+
99
+ - Resolve every macro `pending` edge; none may remain.
100
+ - Verify `<nav class="atlas-submodule-index">` matches the final set of sub-module pages.
101
+
102
+ - **Pause →** Pending edges left? Step 2 missed an affected feature — re-read and patch.
103
+
104
+ ### 5) Traceability (suggested)
105
+
106
+ Use `feature-trace` to map spec IDs to implementation status: `met` / `partial` / `planned` / `gap`.
107
+
108
+ ### 6) Report
109
+
110
+ List touched files, new edges / nodes, the read strategy used (4A or 4B), unresolved spec-vs-code gaps, and any follow-ups.
111
+
112
+ ## Sample hints
113
+
114
+ - **Batch merge**: when one domain has multiple specs, decide first whether sub-modules merge; keep node IDs unique.
115
+ - **Spec shrinks scope**: soften or remove nodes, but keep a `figcaption` footnote in the macro explaining the retired requirement.
116
+ - **Design-only change**: still re-review macro edges — interaction order shifts even when no module is added.
@@ -0,0 +1,12 @@
1
+ interface:
2
+ display_name: "spec-to-project-html"
3
+ short_description: "Sync HTML architecture pages with active planning specs"
4
+ default_prompt: >-
5
+ Use $spec-to-project-html to read docs/plans (spec.md → design.md → contract.md), diff against `resources/project-architecture/` produced by $init-project-html, and patch HTML per `init-project-html/SKILL.md` Rules 1–7 (the authoritative rulebook). Local vocabulary + class-hook + DOM cheat sheet lives in this skill's own `references/TEMPLATE_SPEC.md`. Preserve the two-layer rule throughout.
6
+ The macro `index.html` stays ONE SVG with feature-module clusters AND every sub-module node drawn together, including many-to-many edges, producer/consumer loops, and cross-feature `m-edge--cross` data-row edges; the macro `flow-edge-manifest--macro` mirrors every SVG edge.
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.
8
+ STEP 2: branch by environment.
9
+ (4A, 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 patches the macro and pages in one pass.
10
+ (4B, no subagents) handle affected features ONE AT A TIME — deep-read feature A, IMMEDIATELY patch `features/A/index.html` + affected sub-module pages, incrementally patch the macro for A's cluster / nodes / edges (mark edges pointing at unread affected features with `data-edge-target-pending="<future-slug>"`), drop A's function-level details from memory, then move on. After every affected feature is patched, resolve every pending placeholder in a final macro pass. NEVER load every affected feature's source into the main agent context at once.
11
+ Each `features/<slug>/<sub-module>.html` stays self-only: update `sub-io` function table + `sub-vars` variables-with-business-purpose table (sync every renamed / added / removed parameter, local state, struct field, DB column, config knob, counter, or time anchor that influences a business branch, using scope chips `sub-vars__scope--call|tx|persist|instance|loop`) + `sub-dataflow` internal value flow + `sub-errors`. FORBIDDEN on sub-module pages: cross-submodule narrative, `flow-return-row`, or cross-boundary `flow-edge-manifest`.
12
+ Feature `index.html` stays lightweight (story + submodule-nav). Migrate legacy `arch-diagram` or feature-level cross-submodule flowcharts onto the macro when you touch them; keep CSS paths (`assets/` for root, `../../assets/` under features); scaffold via $init-project-html if files are missing. Report which read strategy (4A or 4B) was actually used.
@@ -0,0 +1,98 @@
1
+ # HTML architecture atlas — reference cheat sheet (spec-to-project-html copy)
2
+
3
+ > Reference material only. The **binding rules** (page contracts, naming, assets, accessibility, forbidden shortcuts) live in `init-project-html/SKILL.md` (the atlas authority). `spec-to-project-html/SKILL.md` follows those same Rules 1–7 when patching pages to match active specs. This file is a local glossary + class-hook table + DOM snippets so this skill can stay self-contained when installed alone.
4
+
5
+ ## Vocabulary
6
+
7
+ - **Feature module** — one **user-visible end-to-end capability** (e.g. "invite-code registration", "get-invite-codes"). One directory `features/<feature-slug>/`. It is **not** a single web layer or a single database.
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`.
9
+
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
+ ```
22
+
23
+ ## Macro SVG — CSS class hooks
24
+
25
+ | Element | class |
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>
55
+ ```
56
+
57
+ ### `sub-vars` variables-with-business-purpose table
58
+
59
+ ```html
60
+ <section class="sub-vars">
61
+ <h2>Variables &amp; 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>
77
+ ```
78
+
79
+ Scope chip vocabulary: `sub-vars__scope--call` (single call), `--tx` (transaction-bound), `--persist` (persisted), `--instance` (fixed at construction; lifetime-shared), `--loop` (retry/loop).
80
+
81
+ ### `sub-dataflow` small SVG sizing
82
+
83
+ - Node class: `d-node`; edge class: `d-edge` (side-effect edges use `d-edge--side`).
84
+ - Recommended viewBox: height ≤ 240, width ≤ 720.
85
+ - Nodes are this sub-module's internal variables/functions only.
86
+
87
+ ## Edge-kind vocabulary (for macro `flow-edge-manifest`)
88
+
89
+ | `data-edge-kind` | meaning | typical visual |
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 |
95
+
96
+ ## Typography hint
97
+
98
+ Pair a recognisable display face (e.g. `Fraunces`) with `Plus Jakarta Sans`. Avoid the "AI-default purple gradient" and Inter look-alike. Detailed rules live in `init-project-html/SKILL.md` § Rule 6.