@laitszkin/apollo-toolkit 3.11.8 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/align-project-documents/SKILL.md +20 -69
- package/align-project-documents/references/templates/standardized-docs-template.md +1 -1
- 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/archive-specs/SKILL.md +18 -70
- package/commit-and-push/SKILL.md +24 -52
- package/develop-new-features/SKILL.md +15 -60
- package/discover-edge-cases/SKILL.md +16 -75
- package/discover-security-issues/SKILL.md +49 -83
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/enhance-existing-features/SKILL.md +36 -57
- package/generate-spec/SKILL.md +14 -14
- package/generate-spec/references/templates/coordination.md +0 -1
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/implement-specs/SKILL.md +27 -62
- package/implement-specs-with-subagents/SKILL.md +28 -71
- package/implement-specs-with-worktree/SKILL.md +38 -62
- package/init-project-html/SKILL.md +27 -115
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/maintain-project-constraints/SKILL.md +24 -78
- package/maintain-project-constraints/references/constraint-file-reference.md +58 -0
- package/merge-changes-from-local-branches/SKILL.md +36 -99
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/optimise-skill/SKILL.md +1 -1
- package/optimise-skill/references/definition.md +5 -5
- package/optimise-skill/references/example_skill.md +1 -1
- 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/review-change-set/SKILL.md +41 -91
- package/review-codebases/SKILL.md +42 -99
- package/review-spec-related-changes/SKILL.md +42 -77
- package/solve-issues-found-during-review/SKILL.md +38 -66
- package/spec-to-project-html/SKILL.md +27 -76
- package/submission-readiness-check/SKILL.md +35 -55
- package/systematic-debug/SKILL.md +37 -53
- package/test-case-strategy/SKILL.md +38 -85
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/update-project-html/SKILL.md +25 -94
- package/version-release/SKILL.md +39 -74
- package/archive-specs/references/templates/architecture.md +0 -21
- package/archive-specs/references/templates/docs-index.md +0 -39
- package/archive-specs/references/templates/features.md +0 -25
- package/archive-specs/references/templates/principles.md +0 -28
|
@@ -1,84 +1,60 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement-specs-with-worktree
|
|
3
|
-
description:
|
|
4
|
-
Like **`implement-specs`** (same read order, full `tasks.md`/`checklist.md`, sequential multi-spec per `coordination.md`) but all writes in a dedicated worktree+feature branch; `pwd` must match `git rev-parse --show-toplevel`; parent checkout read-only for deliverables; honor `preparation.md` and `coordination.md` collision rules. Use when isolation is required; otherwise **`implement-specs`**.
|
|
3
|
+
description: 當你需要在獨立分支和工作樹之中實作spec時,使用這個技能。
|
|
5
4
|
---
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
## 技能目標
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
在獨立分支及工作樹實作用戶指定的spec。確保所有任務都被完成,用戶所有需求都被滿足。
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
- Conditional: `generate-spec` if spec files need clarification or updates.
|
|
13
|
-
- Fallback: If any required dependency skill is unavailable, **MUST** stop and report it.
|
|
10
|
+
## 驗收條件
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
- 在所有被用戶要求實作的spec之中,所有的 `checklist.md`, `tasks.md`, `spec.md` 當中所有非用戶填寫的任務相關checkboxes全部被勾選為完成狀態
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
- **MUST NOT** edit implementation files from the parent checkout except for creating or listing worktrees and read-only inspection; the parent checkout is write-prohibited for this spec’s deliverables.
|
|
19
|
-
- **MUST** follow the **`implement-specs` Workflow** for discovery, implementation, backfill, commit discipline, and completion reporting—**except** that branch/worktree restrictions in `implement-specs` Non-negotiables are replaced by this skill’s worktree rules.
|
|
20
|
-
- **MUST** create the implementation branch from the **same parent branch** the user/session identified as the baseline (often the branch that will receive the merge—not necessarily `main` unless that branch is verified as the base).
|
|
21
|
-
- **MUST** use the spec directory name (`change_name`) as the canonical basename for the worktree path and branch stem; branch **`type`/name** must follow `references/branch-naming.md`.
|
|
22
|
-
- **MUST** use `git show-ref` and `git worktree list --porcelain` (not shell guesses) when checking whether a branch or worktree already exists; if creation fails ambiguously, **MUST** re-query those commands before retrying.
|
|
23
|
-
- When `preparation.md` exists: **MUST** treat it as an already-committed shared baseline for parallel work; **MUST NOT** redo its tasks inside the member spec unless the preparation commit is missing or the document states the prerequisite is still blocked. If baseline assumptions break, **MUST** update `preparation.md` or stop for coordination—**MUST NOT** silently move prerequisite work into the member spec.
|
|
24
|
-
- **`tasks.md` completeness (hard stop)**: **MUST** satisfy the **`implement-specs` Non-negotiable** on **`tasks.md`**: execute **every** actionable line in the in-scope `tasks.md`, with **no** early exit for workload, duration, or breadth; partial task lists are **not** a mergeable or committable state. If a line cannot be met under contracts, **MUST** halt with evidence and resolve the plan through approved planning updates before claiming completion.
|
|
25
|
-
- **`checklist.md` wrap-up / acceptance (hard stop for “spec complete”)**: **MUST** satisfy the **`implement-specs` Non-negotiable** on **`checklist.md`**: the spec is **not** **complete** and **must not** be merged or treated as finished until **all** checklist-defined wrap-up, acceptance, and closing obligations for the change are **done** and honestly recorded—**no** workload exemption.
|
|
26
|
-
- **MUST** complete the same quality bar as `implement-specs`: on top of full `tasks.md` and **complete checklist wrap-up**, relevant tests, honest backfill, no sibling-spec scope creep, revert formatter-only noise outside owned files before commit.
|
|
27
|
-
- **MUST NOT** `git push` **outside** **`commit-and-push`** unless the user explicitly requests remote update through that workflow (or a release/PR skill the user named).
|
|
28
|
-
- For targeted Rust tests: **MUST** pass at most one positional `cargo test` filter per invocation; use separate commands or a broader confirmed filter when multiple selectors are needed.
|
|
14
|
+
## 工作流程
|
|
29
15
|
|
|
30
|
-
|
|
16
|
+
### 1. 定位實作範圍
|
|
31
17
|
|
|
32
|
-
|
|
33
|
-
- **Execution**: Isolated worktree only; branch naming per `references/branch-naming.md`; check sibling worktrees before editing shared boundaries in a parallel batch.
|
|
34
|
-
- **Quality**: Same as `implement-specs` (including **all** `tasks.md` items **and** **all** `checklist.md` wrap-up obligations—no workload excuse), plus collision awareness with sibling worktrees per `coordination.md`.
|
|
35
|
-
- **Output**: Clean local branch in the worktree with intended commits only; parent working tree unchanged by this implementation.
|
|
18
|
+
閱讀用戶指定的spec:
|
|
36
19
|
|
|
37
|
-
|
|
20
|
+
- `spec.md` 定義了用戶的需求
|
|
21
|
+
- `tasks.md` 定義了詳細的實作任務
|
|
22
|
+
- `checklist.md` 定義了任務的完成和驗收條件
|
|
23
|
+
- `contract.md` 定義了spec的外部依賴
|
|
24
|
+
- `design.md` 定義了相關業務鏈路的架構設計
|
|
25
|
+
- `coordination.md`(如有)定義了batch spec之中各份spec各自的實作邊界
|
|
26
|
+
- `preparation.md`(如有)定義了實作batch spec之前各spec的共用準備工作
|
|
38
27
|
|
|
39
|
-
|
|
28
|
+
按照以上文件,閱讀repo,理解本次spec的實作範圍。
|
|
40
29
|
|
|
41
|
-
###
|
|
30
|
+
### 2. 創建子分支及worktree
|
|
42
31
|
|
|
43
|
-
|
|
44
|
-
- Read `preparation.md` when present; apply the Non-negotiable baseline rule above.
|
|
45
|
-
- **Pause →** Where will authoritative plan text live **for this session**—parent tree, worktree after sync—and have I opened that copy end-to-end?
|
|
46
|
-
- **Pause →** Does `coordination.md` / `preparation.md` imply **anything** I must not redo or must assume stable before coding?
|
|
32
|
+
從當前分支創建子分支及worktree。分支以規格文檔的實際變更命名,並且需要符合通用開發規範(e.g. feat/event-bus-backend)
|
|
47
33
|
|
|
48
|
-
###
|
|
34
|
+
### 3. 實作spec任務
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- Derive `change_name`; branch pattern `<type>/<spec-name>` per `references/branch-naming.md`; worktree directory `../<spec-name>` (or an equivalent path the user approves).
|
|
53
|
-
- `git branch <branch-name> <parent-branch>` then `git worktree add <path> <branch-name>`; `cd` into it; verify `pwd` vs `git rev-parse --show-toplevel`.
|
|
54
|
-
- Before editing shared modules in a batch, check `git worktree list --porcelain` and `coordination.md` for sibling ownership; read sibling diffs when the same file is touched.
|
|
55
|
-
- **Pause →** Why is **`parent-branch`** definitely the correct baseline—not an unexamined assumption that `main` is default?
|
|
56
|
-
- **Pause →** Could this work duplicate an **already-merged** implementation; what **evidence** (`git log`, tests, code search) did I use to rule that in or out?
|
|
57
|
-
- **Pause →** After `cd`, do `pwd` and `git rev-parse --show-toplevel` **match**; if not, why am I not stopping before any write?
|
|
58
|
-
- **Pause →** Which sibling worktree might already own the shared file I am about to touch, and did I inspect their diff?
|
|
36
|
+
嚴格按照 `tasks.md` 之中定義的任務,逐項完成實作。如果有多份 `tasks.md` 存在於多份spec之中,則依照 `coordination.md` 之中建議的merge順序進行實作。
|
|
37
|
+
在確認完成所有任務之後,將 `tasks.md` 之中的所有checkboxes勾選為完成。
|
|
59
38
|
|
|
60
|
-
|
|
39
|
+
如果實作的spec是batch spec,且有 `preparation.md`,在開始實作之前需要先完成 `preparation.md` 之中所規定的任務內容,並在驗收條件滿足之後回填 `preparation.md`。
|
|
61
40
|
|
|
62
|
-
|
|
63
|
-
- In the report, **MUST** include branch name, worktree path, commit hash, tests run, backfilled docs, and an explicit statement that the parent checkout was not modified for implementation files.
|
|
64
|
-
- **Pause →** Am I honoring **implement-specs** step 3–6 **constraints** literally while respecting that all writes happen **only** under this worktree root?
|
|
65
|
-
- **Pause →** If I used Rust `cargo test` filters, did I violate the **single positional filter** rule; how would I split the commands?
|
|
41
|
+
### 4. 驗證實作
|
|
66
42
|
|
|
67
|
-
|
|
43
|
+
按照 `checklist.md` 之中定義的驗收標準,逐項驗收並檢查任務是否完成。對於未達到驗收標準的任務,必須重新實作及重新驗收,並在完成驗收之後將所有 `checklist.md` 之中的checkboxes勾選為完成。
|
|
68
44
|
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
pwd && git rev-parse --show-toplevel
|
|
72
|
-
```
|
|
73
|
-
- **Skeleton commands** (`change_name` `oauth-scope`, parent `feature/x`, type `feat`):
|
|
74
|
-
```bash
|
|
75
|
-
git branch feat/oauth-scope feature/x
|
|
76
|
-
git worktree add ../oauth-scope feat/oauth-scope
|
|
77
|
-
cd ../oauth-scope
|
|
78
|
-
```
|
|
79
|
-
- **Cargo** (two filters ⇒ two commands): run `cargo test parser::` **and separately** `cargo test cache::`, not `cargo test parser:: cache::`.
|
|
45
|
+
### 5. 回填spec
|
|
80
46
|
|
|
81
|
-
|
|
47
|
+
確保所有實作任務完成並通過驗收之後,更新 `spec.md` 之中的需求checkboxes反應實際代碼實作狀態。
|
|
82
48
|
|
|
83
|
-
|
|
84
|
-
|
|
49
|
+
### 6. 提交變更
|
|
50
|
+
|
|
51
|
+
使用 `commit-and-push` 將變更提交到子分支上。不需要將變更推送到remote。
|
|
52
|
+
|
|
53
|
+
## 範例
|
|
54
|
+
|
|
55
|
+
- "用戶指定了一份有四份spec的batch spec並要求實作這份batch spec。同時,`coordination.md` 之中建議merge順序是 spec 1 -> spec 2 -> spec 3 -> spec 4。" -> "創建子分支及工作樹;從spec 1開始進行完整的實作流程,並在完成回填spec之後再開始實作spec 2,直至4份spec都被完成"
|
|
56
|
+
- "用戶指定了一份有2份spec的batch spec並要求實作這份batch spec。同時,`coordination.md` 之中的建議merge順序是spec 2 -> spec 1,並且 `preparation.md` 存在於該batch spec之中。" -> "創建子分支及工作樹;先實作 `preparation.md` 之中要求的任務並按照當中的驗收標準進行驗收。確定完成之後,從spec 2開始完整的實作流程。並在完成spec 2之後再實作 spec 1。"
|
|
57
|
+
|
|
58
|
+
## 參考資料
|
|
59
|
+
|
|
60
|
+
- `references/branch-naming.md` - 建議分支命名方式
|
|
@@ -1,130 +1,42 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-project-html
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
4
|
+
使用 `apltk architecture` 初始化專案 HTML 架構圖譜,生成基礎 atlas YAML 與渲染後的 HTML 頁面。所有宣告必須基於倉庫證據,跨模組關係只能用 `call`、`return`、`data-row`、`failure` 邊表達;每個功能模組由一個可寫子 agent 負責,主 agent 必須等待全部子 agent 完成後,才能補跨功能連接並執行 `render` 與 `validate`。
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# 初始化專案 HTML 架構圖
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 技能目標
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Conditional: `spec-to-project-html` when the same atlas needs spec-driven refresh — that skill uses the same CLI with `--spec`.
|
|
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; document scanned roots and explicit omissions in `meta.summary`. **MUST NOT** declare components for code paths that were never read.
|
|
11
|
+
透過 `apltk architecture` 為目前倉庫建立基礎專案架構圖譜,產出受 CLI 管理的 `resources/project-architecture/atlas/` 狀態檔與對應 HTML 頁面,而不是手寫 SVG 或 HTML。
|
|
15
12
|
|
|
16
|
-
##
|
|
13
|
+
## 驗收條件
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
- 只透過 `apltk architecture` 修改圖譜;不得手改 `resources/project-architecture/**/*.html`。
|
|
16
|
+
- 渲染後的宏觀圖完整表達功能與子模組關係;所有跨邊界互動都必須落在 `call`、`return`、`data-row`、`failure` 邊上,不能藏在子模組頁面文案裡。
|
|
17
|
+
- 每個非平凡子模組都具備足夠的內部結構:已宣告的 `function`、`variable`、有序 `dataflow`、必要時的 `error`,且 `dataflow` 中的函式與讀寫變數引用可被校驗通過。
|
|
18
|
+
- 所有宣告都能追溯到真實程式碼、設定、SQL 或外部邊界;無法確認的部分用 `TBD` 或在 `meta.summary` 中明確記錄遺漏原因。
|
|
19
|
+
- 採用「每個功能一個可寫子 agent」的分工;主 agent 必須等所有子 agent 完成後,才允許補跨功能邊並執行 `apltk architecture validate`,且驗證結果為通過。
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
## 工作流程
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
1. 先執行 `apltk architecture --help`,把 CLI 說明當作唯一命令真源;本技能只定義語義規則,不重複維護參數細節。
|
|
24
|
+
2. 先做整倉淺層盤點,只列出功能模組的 `slug`、使用者視角職責、入口點與主要邊界資源;此階段不要深讀函式實作。
|
|
25
|
+
3. 為每個待建圖功能派發一個可寫子 agent。每個子 agent 只深讀自己負責的功能,並負責宣告該功能內的全部子模組、函式、變數、資料流、本地錯誤,以及所有功能內邊。
|
|
26
|
+
4. 子 agent 返回的內容只能是:子模組摘要,以及需要由主 agent 稍後補上的跨功能邊界資訊;主 agent 不得回頭重讀已委派功能原始碼,也不得重複宣告子 agent 已擁有的功能內元件。
|
|
27
|
+
5. 等全部子 agent 完成後,主 agent 統一補齊跨功能 `edge`,必要時補共享 `meta` 或 `actor`,隨後執行 `apltk architecture render` 與 `apltk architecture validate`。
|
|
28
|
+
6. 打開渲染結果進行抽查,確認宏觀圖和至少一個代表性子模組頁都滿足驗收條件,並在彙報中記錄功能數、子模組數、邊數量、未覆蓋路徑與原因。
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
## 使用範例
|
|
25
31
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
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`).
|
|
32
|
+
- 「替這個倉庫首次生成 HTML 架構圖。」 -> 「先梳理功能模組,再按功能分派子 agent,最後彙總跨功能邊,生成基礎 atlas 與渲染頁面。」
|
|
33
|
+
- 「把系統的資料流、呼叫關係和回滾路徑視覺化。」 -> 「使用 `call` / `return` / `data-row` / `failure` 邊表達跨邊界關係,並為每個關鍵子模組補齊內部 `dataflow`。」
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
## 參考資料索引
|
|
32
36
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
### Rule 3 — Read order: subagents only; wait for all workers before cross-feature wiring
|
|
40
|
-
|
|
41
|
-
Real production codebases dwarf the main agent’s context. **MUST** use this pattern only:
|
|
42
|
-
|
|
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).
|
|
48
|
-
|
|
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
|
-
|
|
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.
|
|
54
|
-
|
|
55
|
-
### Rule 4 — Evidence over invention
|
|
56
|
-
|
|
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.
|
|
59
|
-
|
|
60
|
-
## Standards (summary)
|
|
61
|
-
|
|
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.
|
|
63
|
-
- **Execution**: shallow feature-module list → subagent fan-out per feature → **wait for all** → cross-feature edges / meta → `validate` → handover.
|
|
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.
|
|
65
|
-
- **Output**: `resources/project-architecture/atlas/` (YAML state) + `resources/project-architecture/**/*.html` (renderer output) — both managed by the CLI.
|
|
66
|
-
|
|
67
|
-
## Acceptance criteria
|
|
68
|
-
|
|
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):
|
|
70
|
-
|
|
71
|
-
1. **Macro diagram clearly shows the relationships between features and sub-modules**, including:
|
|
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.
|
|
80
|
-
|
|
81
|
-
`apltk architecture validate` **MUST** return OK before reporting completion.
|
|
82
|
-
|
|
83
|
-
## CLI reference
|
|
84
|
-
|
|
85
|
-
Run **`apltk architecture --help`** and the deeper `apltk architecture <verb> [subverb] --help` pages for the authoritative command tree, required flags, examples, and expected results. This skill keeps only the semantic rules, acceptance criteria, and subagent coordination rules so the documentation does not drift when the CLI evolves.
|
|
86
|
-
|
|
87
|
-
**Cross-feature work timing:** only after **all** feature subagents have returned (Rule 3).
|
|
88
|
-
|
|
89
|
-
## Workflow
|
|
90
|
-
|
|
91
|
-
### 1) Whole-repo inventory — list feature modules, not function bodies
|
|
92
|
-
|
|
93
|
-
Scan the shipped source for **user-visible capabilities** (each one = one feature module): entry routes, CLI commands, UI pages, cron jobs, runners, event handlers, CDC streams. Record only kebab-case slug + one-line user story + boundary points (entry symbol, outbound DB tables / queue topics / external services).
|
|
94
|
-
|
|
95
|
-
- **Pause →** Is the list actually complete? Note skipped roots with reason; no silent skips.
|
|
96
|
-
- **Pause →** Did I dive into function bodies here? Roll back — keep only structural notes.
|
|
97
|
-
|
|
98
|
-
### 2) Subagent fan-out — workers own features; orchestrator owns cross-feature seams **after** all workers finish
|
|
99
|
-
|
|
100
|
-
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.
|
|
101
|
-
|
|
102
|
-
> **Feature `<slug>` subagent contract**
|
|
103
|
-
> - Read every sub-module of this feature.
|
|
104
|
-
> - Declare the feature and its sub-modules (`feature` / `submodule` — exact flags: **`--help`**).
|
|
105
|
-
> - For every sub-module: add **function**, **variable**, ordered **dataflow**, and **error** rows as needed.
|
|
106
|
-
> - For every intra-feature interaction between sub-modules, add an **edge** whose endpoints stay **inside** this feature.
|
|
107
|
-
> - Run **`apltk architecture validate`** before returning (same project root; use **`--help`** for project/spec flags).
|
|
108
|
-
> - **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.
|
|
109
|
-
|
|
110
|
-
**Orchestrator — after every subagent has completed:** declare only the cross-feature `apltk architecture` mutations reported by the workers, then render and validate once.
|
|
111
|
-
|
|
112
|
-
The main agent **MUST NOT** re-declare a subagent’s intra-feature components, and **MUST NOT** open source files for any feature it delegated.
|
|
113
|
-
|
|
114
|
-
### 3) Handover report
|
|
115
|
-
|
|
116
|
-
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`).
|
|
117
|
-
|
|
118
|
-
## Sample hints
|
|
119
|
-
|
|
120
|
-
- Multiple SQL paths on `service ↔ db` → one **`edge`** per SQL path so the macro shows distinct strokes.
|
|
121
|
-
- 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.
|
|
122
|
-
- Cross-feature DB hand-off (A writes, B reads) → both sides declare DB-oriented functions, then a **`data-row`** edge from producer to consumer.
|
|
123
|
-
- Rollback / compensation across sub-modules → **`failure`** edge with an explicit label; cleanup *inside* a single sub-module belongs in ordered **`dataflow`** steps.
|
|
124
|
-
- Third-party systems → **`external`** kind sub-modules so the trust boundary is visible in styling.
|
|
125
|
-
|
|
126
|
-
## References
|
|
127
|
-
|
|
128
|
-
- `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`**).
|
|
129
|
-
- `lib/atlas/cli.js` — implementation of dispatch (`apltk architecture --help` prints usage).
|
|
130
|
-
- `init-project-html/sample-demo/` — end-to-end YAML + rendered HTML for two features.
|
|
37
|
+
- `references/TEMPLATE_SPEC.md`:atlas 欄位、列舉和 CLI 寫入形狀速查表。
|
|
38
|
+
- `lib/atlas/cli.js`:`apltk architecture` 的實作入口。
|
|
39
|
+
- `lib/atlas/schema.js`:圖譜資料結構與校驗規則。
|
|
40
|
+
- `sample-demo/`:完整示例輸出,可用於理解基礎 atlas 的最終形態。
|
|
41
|
+
- `spec-to-project-html/SKILL.md`:面向規劃文件的 overlay 版本。
|
|
42
|
+
- `update-project-html/SKILL.md`:面向已存在基礎 atlas 的增量刷新版本。
|
|
Binary file
|
|
@@ -1,93 +1,39 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: maintain-project-constraints
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
依據倉庫現況刷新根目錄 `AGENTS.md` / `CLAUDE.md`,只保留
|
|
5
|
+
`Common Development Commands`、`Project Business Goals`、
|
|
6
|
+
`Project Documentation Index` 三個可追溯區塊。
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# 維護專案約束文件
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 技能目標
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
- Conditional: none.
|
|
15
|
-
- Optional: none.
|
|
16
|
-
- Fallback: not applicable.
|
|
13
|
+
基於當前倉庫證據,產出或刷新根目錄 `AGENTS.md` 與 `CLAUDE.md`,使其準確反映開發命令、專案商業目標與文件索引,且不捏造任何內容。
|
|
17
14
|
|
|
18
|
-
##
|
|
15
|
+
## 技能驗收條件
|
|
19
16
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
- If **both** `AGENTS.md` and `CLAUDE.md` exist, the three sections **MUST** be **identical** between them unless the repo documents an intentional divergence (otherwise keep parity).
|
|
27
|
-
- **Project Business Goals** = macro **why/for whom/outcome**—**MUST NOT** duplicate the feature inventory (index already points there).
|
|
17
|
+
- 最終交付為根目錄 `AGENTS.md` / `CLAUDE.md`,正文只包含以下三個區塊,且順序固定:`Common Development Commands`、`Project Business Goals`、`Project Documentation Index`。
|
|
18
|
+
- `Common Development Commands` 中的每條命令都可追溯到倉庫中的真實入口,例如 `package.json`、`Makefile`、`bin/`、`scripts/` 或其他現存執行點。
|
|
19
|
+
- `Project Business Goals` 只描述專案層級的目的、服務對象與交付結果,不展開為功能清單。
|
|
20
|
+
- `Project Documentation Index` 覆蓋現存的 `docs/features/`、`docs/architecture/`、`docs/principles/` 與重要根目錄文件,且每項索引都對應真實路徑。
|
|
21
|
+
- 過時路徑、虛構命令與多餘區塊已被移除。
|
|
22
|
+
- 若 `AGENTS.md` 與 `CLAUDE.md` 同時存在且未聲明故意分歧,兩者的三個區塊內容保持一致。
|
|
28
23
|
|
|
29
|
-
##
|
|
24
|
+
## 技能工作流程
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
1. 先從倉庫現況收集可驗證的命令入口、專案目的與現有文件清單,不以舊約束文件作為唯一真相。
|
|
27
|
+
2. 根據證據生成三個必需區塊,讓命令、商業目標與文件索引都能被直接追溯。
|
|
28
|
+
3. 按專案慣例更新或補齊 `AGENTS.md` / `CLAUDE.md`,並將正文限制在三個規定區塊內。
|
|
29
|
+
4. 完成前逐項校驗命令來源、文件路徑與雙文件一致性,清除所有陳舊或多餘內容。
|
|
35
30
|
|
|
36
|
-
##
|
|
31
|
+
## 技能使用範例
|
|
37
32
|
|
|
38
|
-
-
|
|
33
|
+
- "重建 `docs/` 後,請同步刷新 `AGENTS.md` 和 `CLAUDE.md`。" -> "根據當前腳本、入口與文件樹重寫兩個根目錄約束文件,只保留三個規定區塊並確保索引完整。"
|
|
34
|
+
- "這個專案的 `CLAUDE.md` 已經過時,請補一份對應的 `AGENTS.md`。" -> "依據現有命令與文件結構建立缺失文件,並讓兩份約束文件在預期一致時保持同構。"
|
|
35
|
+
- "請清理根目錄約束文件裡的舊命令與失效路徑。" -> "驗證每條命令與每個索引路徑是否仍然成立,只保留仍可被倉庫證據支持的內容。"
|
|
39
36
|
|
|
40
|
-
##
|
|
37
|
+
## 技能參考資料索引
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### 1) Inventory
|
|
45
|
-
|
|
46
|
-
- Parse command surfaces (`package.json` scripts, `Makefile`, CI, CLIs).
|
|
47
|
-
- Enumerate `docs/features/`, `docs/architecture/`, `docs/principles/`; note root docs.
|
|
48
|
-
- **Pause →** Can I cite the **source line** (script name, target) for every command I plan to list?
|
|
49
|
-
|
|
50
|
-
### 2) Business goals
|
|
51
|
-
|
|
52
|
-
- Prefer `README` + `docs/features/` tone; else infer from user-facing entrypoints—still **product-level sentences**, not file lists.
|
|
53
|
-
|
|
54
|
-
### 3) Write / update files
|
|
55
|
-
|
|
56
|
-
- Create or overwrite **only** the three sections per file conventions (create missing file among `AGENTS.md`/`CLAUDE.md` per repo habit).
|
|
57
|
-
- **Pause →** Did any stray `## Installation` creep in—must delete if not part of repo’s mandated format?
|
|
58
|
-
|
|
59
|
-
### 4) Documentation index
|
|
60
|
-
|
|
61
|
-
- One line per file: `path — short purpose`. Mirror reality; drop deleted; add new.
|
|
62
|
-
|
|
63
|
-
### 5) Verification
|
|
64
|
-
|
|
65
|
-
- Each command reproducible from declared config; every indexed path exists; both files match if both present; strip extra sections.
|
|
66
|
-
|
|
67
|
-
## Sample hints
|
|
68
|
-
|
|
69
|
-
- **Command bad**: “`npm run magic` — deploy” when no script `magic` in `package.json`.
|
|
70
|
-
- **Command OK**: `` `npm test` — runs Node test suite (see `package.json`) ``.
|
|
71
|
-
- **Goals bad**: Listing ten micro-features → belongs in features index + separate files.
|
|
72
|
-
- **Goals OK**: “This repo ships X for Y operators; primary outcome Z.”
|
|
73
|
-
- **Index**: If `docs/features/auth.md` deleted, **remove** line same run.
|
|
74
|
-
|
|
75
|
-
## Template sketch
|
|
76
|
-
|
|
77
|
-
```markdown
|
|
78
|
-
## Common Development Commands
|
|
79
|
-
- `…` — …
|
|
80
|
-
|
|
81
|
-
## Project Business Goals
|
|
82
|
-
…
|
|
83
|
-
|
|
84
|
-
## Project Documentation Index
|
|
85
|
-
### Features (`docs/features/`)
|
|
86
|
-
- `…` — …
|
|
87
|
-
### Architecture (`docs/architecture/`)
|
|
88
|
-
- …
|
|
89
|
-
### Principles (`docs/principles/`)
|
|
90
|
-
- …
|
|
91
|
-
### Root Documents
|
|
92
|
-
- `README.md` — …
|
|
93
|
-
```
|
|
39
|
+
- `references/constraint-file-reference.md` - 三區塊契約、撰寫規則、核對清單與輸出模板。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 約束文件參考
|
|
2
|
+
|
|
3
|
+
## 三區塊契約
|
|
4
|
+
|
|
5
|
+
根目錄 `AGENTS.md` 與 `CLAUDE.md` 的正文只應包含以下三個區塊,且順序固定:
|
|
6
|
+
|
|
7
|
+
1. `Common Development Commands`
|
|
8
|
+
2. `Project Business Goals`
|
|
9
|
+
3. `Project Documentation Index`
|
|
10
|
+
|
|
11
|
+
若專案未明確說明兩者應有差異,這三個區塊的內容應保持一致。
|
|
12
|
+
|
|
13
|
+
## 撰寫規則
|
|
14
|
+
|
|
15
|
+
### `Common Development Commands`
|
|
16
|
+
|
|
17
|
+
- 只收錄能被當前倉庫驗證的命令。
|
|
18
|
+
- 優先從 `package.json`、`Makefile`、`bin/`、`scripts/`、CI 設定或其他真實入口提取。
|
|
19
|
+
- 每條命令附上一句簡短用途說明,避免捏造不存在的工作流。
|
|
20
|
+
|
|
21
|
+
### `Project Business Goals`
|
|
22
|
+
|
|
23
|
+
- 只描述專案層級的目的、服務對象與最終價值。
|
|
24
|
+
- 保持宏觀,不展開成細碎功能列表。
|
|
25
|
+
- 若存在產品說明文件,僅在能被當前倉庫內容支撐時採納。
|
|
26
|
+
|
|
27
|
+
### `Project Documentation Index`
|
|
28
|
+
|
|
29
|
+
- 覆蓋現存 `docs/features/`、`docs/architecture/`、`docs/principles/` 下的所有文件。
|
|
30
|
+
- 補充重要且實際存在的根目錄文件,例如 `README.md`、`CONTRIBUTING.md`、`SECURITY.md`。
|
|
31
|
+
- 每個條目都應包含檔案路徑與一句用途說明。
|
|
32
|
+
|
|
33
|
+
## 核對清單
|
|
34
|
+
|
|
35
|
+
- [ ] 只保留三個規定區塊,且順序正確。
|
|
36
|
+
- [ ] 每條命令都能回溯到真實入口。
|
|
37
|
+
- [ ] 商業目標沒有退化成功能清單。
|
|
38
|
+
- [ ] 文件索引覆蓋所有現存標準化文檔。
|
|
39
|
+
- [ ] 已刪除失效路徑、舊命令與額外區塊。
|
|
40
|
+
- [ ] 若 `AGENTS.md` 與 `CLAUDE.md` 都存在,已確認它們在預期情況下保持一致。
|
|
41
|
+
|
|
42
|
+
## 輸出模板
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# <專案名稱或標題>
|
|
46
|
+
|
|
47
|
+
## Common Development Commands
|
|
48
|
+
|
|
49
|
+
- `<command>` - <用途說明>
|
|
50
|
+
|
|
51
|
+
## Project Business Goals
|
|
52
|
+
|
|
53
|
+
- <專案存在的原因、服務對象與交付結果>
|
|
54
|
+
|
|
55
|
+
## Project Documentation Index
|
|
56
|
+
|
|
57
|
+
- `<path>` - <文件用途說明>
|
|
58
|
+
```
|