@laitszkin/apollo-toolkit 3.11.7 → 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 +33 -0
- package/README.md +0 -2
- 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/SKILL.md +3 -30
- 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 +51 -130
- 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 -137
- package/init-project-html/lib/atlas/cli.js +897 -43
- package/init-project-html/scripts/architecture.js +4 -25
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/lib/cli.js +166 -20
- package/lib/tool-runner.js +418 -2
- 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/SKILL.md +7 -98
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/optimise-skill/SKILL.md +7 -6
- package/optimise-skill/references/definition.md +38 -0
- package/optimise-skill/references/example_skill.md +7 -6
- package/package.json +1 -1
- package/read-github-issue/SKILL.md +6 -46
- 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/SKILL.md +4 -26
- 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/scripts/validate_openai_agent_config.py +16 -1
- package/scripts/validate_skill_frontmatter.py +16 -1
- package/solve-issues-found-during-review/SKILL.md +38 -66
- package/spec-to-project-html/SKILL.md +27 -88
- 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 -110
- package/version-release/SKILL.md +39 -74
- package/weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift +32 -4
- 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
- package/maintain-skill-catalog/README.md +0 -18
- package/maintain-skill-catalog/SKILL.md +0 -72
- package/maintain-skill-catalog/agents/openai.yaml +0 -4
|
@@ -1,103 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-case-strategy
|
|
3
|
-
description:
|
|
3
|
+
description: >-
|
|
4
|
+
為實作工作選擇最小且足夠的測試組合。當 spec、功能開發、功能增強、重構或 bug 修復
|
|
5
|
+
需要明確決定單元、回歸、property、integration、E2E、對抗性測試或 drift check 時使用。
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# 測試案例策略
|
|
7
9
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
- Evidence: Base every test decision on changed behavior, requirement IDs, risk class, dependency shape, and existing coverage; do not add tests only because a template lists them.
|
|
11
|
-
- Execution: Choose the smallest test level that can prove the risk, then escalate to broader tests only when lower-level tests cannot observe the behavior or contract.
|
|
12
|
-
- Quality: Each test must have a meaningful oracle derived from the requirement, design, or contract rather than from the implementation just written.
|
|
13
|
-
- Output: Return concrete test case IDs, test level, target unit or flow, oracle, fixture/mock strategy, command or verification hook, and any `N/A` reason.
|
|
14
|
-
|
|
15
|
-
## Goal
|
|
16
|
-
|
|
17
|
-
Provide one shared testing decision workflow for spec generation and implementation skills so agents select useful tests consistently and use fast focused checks to detect implementation drift.
|
|
10
|
+
## Dependencies
|
|
18
11
|
|
|
19
|
-
|
|
12
|
+
- Required: 無
|
|
13
|
+
- Conditional: 無
|
|
14
|
+
- Optional: 無
|
|
15
|
+
- Fallback: 無
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- Identify changed behaviors, requirement IDs, and affected modules.
|
|
24
|
-
- Classify risks before choosing test types:
|
|
25
|
-
- boundary
|
|
26
|
-
- regression
|
|
27
|
-
- authorization or permission denial
|
|
28
|
-
- invalid transition
|
|
29
|
-
- idempotency, replay, or duplicate submission
|
|
30
|
-
- concurrency or race
|
|
31
|
-
- data integrity
|
|
32
|
-
- external failure or inconsistent dependency state
|
|
33
|
-
- partial write, rollback, or compensation
|
|
34
|
-
- adversarial abuse
|
|
35
|
-
- Reuse existing coverage only after naming the exact suite, test case, and risk it already proves.
|
|
36
|
-
|
|
37
|
-
### 2) Choose the narrowest valid test level
|
|
38
|
-
|
|
39
|
-
- Use unit tests for isolated changed logic, boundaries, denials, exact errors, no-side-effect expectations, and fast implementation drift checks.
|
|
40
|
-
- Use regression tests when a bug-prone or historically fragile behavior must not silently return.
|
|
41
|
-
- Use property-based tests for business rules with describable invariants, generated input spaces, valid/invalid state transitions, or external-state matrices that can be mocked.
|
|
42
|
-
- Use integration tests for cross-module chains, repository/service/API/event interactions, configuration wiring, persistence, IO, and controlled external-service scenarios.
|
|
43
|
-
- Use E2E tests only for critical user-visible paths whose risk is not sufficiently proven by lower-level tests; keep them minimal and stable.
|
|
44
|
-
- Use adversarial tests for malformed input, forged identities, invalid transitions, replay, stale/out-of-order events, toxic payload sizes, and risky edge combinations.
|
|
45
|
-
- If E2E is too costly or unstable, replace it with integration coverage for the same risk and record the replacement.
|
|
17
|
+
## Standards
|
|
46
18
|
|
|
47
|
-
|
|
19
|
+
- Evidence: 只根據需求、風險、受影響模組、依賴形態與現有覆蓋情況選擇測試,不為了湊數加測試
|
|
20
|
+
- Execution: 先盤點風險與 oracle,再選最小可證明風險的測試層級,必要時才升級到更重的測試
|
|
21
|
+
- Quality: 每個測試都要有可重現、可驗證的明確 oracle,而不是從新寫出的實作反推
|
|
22
|
+
- Output: 產出可直接執行的測試決策,包含測試 ID、目標、層級、oracle、fixture/mock 策略、驗證命令與 `N/A` 理由
|
|
48
23
|
|
|
49
|
-
|
|
50
|
-
- Never derive the oracle from the new implementation after writing it.
|
|
51
|
-
- Prefer exact assertions:
|
|
52
|
-
- exact output
|
|
53
|
-
- exact error class or denial reason
|
|
54
|
-
- persisted state
|
|
55
|
-
- emitted event
|
|
56
|
-
- retry or compensation accounting
|
|
57
|
-
- intentional absence of writes, notifications, or side effects
|
|
58
|
-
- allowed state transition or rejection
|
|
59
|
-
- Avoid assertion-light smoke tests, snapshot-only tests, and tests that only prove "does not throw" unless that is the real requirement.
|
|
24
|
+
## 技能目標
|
|
60
25
|
|
|
61
|
-
|
|
26
|
+
提供一套統一的測試決策流程,讓spec技能與實作技能都能用一致的方法挑出高價值測試,並用最快、最聚焦的檢查及早發現實作偏移。
|
|
62
27
|
|
|
63
|
-
|
|
64
|
-
- A unit drift check should name:
|
|
65
|
-
- target unit: function, method, module, policy, parser, mapper, validator, or state transition owner
|
|
66
|
-
- input state: minimal fixture, table row, fake dependency state, or boundary value
|
|
67
|
-
- oracle: exact output, error, state change, or no-side-effect assertion
|
|
68
|
-
- command: focused test command or existing test filter to run immediately after the task
|
|
69
|
-
- If no unit drift check is possible, record the smallest replacement check and a concrete reason.
|
|
70
|
-
- Do not allow broad integration or E2E tests to hide missing unit checks for locally owned business logic.
|
|
28
|
+
## 驗收條件
|
|
71
29
|
|
|
72
|
-
|
|
30
|
+
- 每個非平凡變更都已建立風險清單,並明確指出需求或風險來源
|
|
31
|
+
- 每個測試決策都選擇了最小但足以證明風險的測試層級,而不是預設往大測試堆
|
|
32
|
+
- 每個測試都有明確 oracle、fixture 或 mock 策略,以及可執行的驗證方式
|
|
33
|
+
- 若某種測試層級不適用,已留下具體 `N/A` 理由而非含糊跳過
|
|
73
34
|
|
|
74
|
-
|
|
35
|
+
## 工作流程
|
|
75
36
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
Verification hook: command or existing suite
|
|
83
|
-
N/A reason: only when this test level is not suitable
|
|
84
|
-
```
|
|
37
|
+
1. 先盤點變更行為、需求編號、受影響模組與風險,至少涵蓋 boundary、regression、authorization、invalid transition、idempotency、concurrency、data integrity、external failure、partial write 與 adversarial abuse
|
|
38
|
+
2. 先重用現有測試,再決定新增哪些測試;只有在能說出既有 suite、case 與它覆蓋的風險時,才算真的能重用
|
|
39
|
+
3. 依風險選擇最窄的有效測試層級:局部邏輯用 unit 或 regression;可描述不變量的邏輯用 property;跨模組與受控外部狀態用 integration;只有在關鍵使用者流程無法被較低層級證明時才使用 E2E;惡意輸入、重播、偽造、越界與異常組合用 adversarial
|
|
40
|
+
4. 在實作前先定義 oracle,來源只能是 `spec.md`、`design.md`、`contract.md`、官方文件或既有正確行為,不能從新實作反推
|
|
41
|
+
5. 對每個非平凡原子任務補上 unit drift check;若做不到,必須記錄最小替代檢查與具體原因
|
|
42
|
+
6. 用統一格式記錄測試決策,讓後續技能可以直接執行與驗證
|
|
85
43
|
|
|
86
|
-
##
|
|
44
|
+
## 使用範例
|
|
87
45
|
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
- Use mocks/fakes for external services in business logic chains unless the real external contract itself is under test.
|
|
93
|
-
- Keep fixtures reproducible with fixed clocks, seeds, and controlled dependency states.
|
|
94
|
-
- Preserve failing generated examples or seeds as regression coverage.
|
|
95
|
-
- Record `N/A` only with a concrete reason tied to scope, risk, or observability.
|
|
96
|
-
- When a spec exists, map test IDs back to `tasks.md` and `checklist.md`.
|
|
46
|
+
- 「修改驗證器的邊界規則」-> 優先選 unit test,加一個 drift check 驗證邊界值、錯誤類型與無副作用
|
|
47
|
+
- 「新增排序與去重邏輯」-> 使用 property-based tests 驗證單調性、資料保留與重播不變量
|
|
48
|
+
- 「改動 repository、service 與 API handler 的協作」-> 使用 integration tests 驗證跨模組資料流與錯誤處理
|
|
49
|
+
- 「高價值結帳流程可能被權限與狀態機影響」-> 僅在 unit / integration 不足以證明風險時才加最小 E2E
|
|
97
50
|
|
|
98
|
-
##
|
|
51
|
+
## 參考資料索引
|
|
99
52
|
|
|
100
|
-
- `references/unit-tests.md
|
|
101
|
-
- `references/property-based-tests.md
|
|
102
|
-
- `references/integration-tests.md
|
|
103
|
-
- `references/e2e-tests.md
|
|
53
|
+
- `references/unit-tests.md`:單元測試與 drift check 設計
|
|
54
|
+
- `references/property-based-tests.md`:property tests 的選擇與 oracle 設計
|
|
55
|
+
- `references/integration-tests.md`:整合測試與外部狀態場景設計
|
|
56
|
+
- `references/e2e-tests.md`:E2E 決策與替代規則
|
|
Binary file
|
|
@@ -1,125 +1,40 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: update-project-html
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
4
|
+
使用 `apltk architecture` 按真實程式碼 diff 刷新基礎專案 HTML 架構圖譜。先確定 diff 範圍並過濾出真正影響執行時行為的變更,再按受影響功能分派可寫子 agent 處理功能內更新;主 agent 必須等待全部子 agent 完成後,才能補跨功能邊並執行 `render` 與 `validate`。該技能只更新基礎 atlas,不使用 `--spec`。
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# 更新專案 HTML 架構圖
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 技能目標
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Conditional: **`spec-to-project-html`** when the user actually wants an overlay scoped to a `docs/plans/...` spec rather than the base atlas — that skill uses `--spec`.
|
|
13
|
-
- Optional: **`align-project-documents`** when feature names in the atlas no longer match the `docs/features` set after the diff.
|
|
14
|
-
- Fallback: changed code references components that are absent from the atlas → declare new sub-modules / functions / variables before referencing them; if a single feature’s diff is too large for one subagent context, split that feature’s subagent by sub-module folder. **MUST NOT** invent components for code paths that were never read.
|
|
11
|
+
根據目前分支、工作區或指定提交範圍內的真實程式碼變更,增量刷新 `resources/project-architecture/` 下的基礎 atlas 與渲染 HTML,使圖譜持續和實際程式碼保持一致。
|
|
15
12
|
|
|
16
|
-
##
|
|
13
|
+
## 驗收條件
|
|
17
14
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **MUST** use the **subagent fan-out** pattern from `init-project-html` Rule 3:
|
|
24
|
-
1. Enumerate **affected features** from the filtered diff (path → feature mapping using existing atlas YAML + folder layout). No function-body deep reads at this stage.
|
|
25
|
-
2. Dispatch **one write-capable subagent per affected feature**. Each deep-reads only its own changed files (use `git diff` for exact deltas plus the post-change source for context), applies every intra-feature mutation via `apltk architecture` (`function`, `variable`, `dataflow`, `error`, intra-feature `edge` add|set|remove|reorder), and returns ONLY (i) sub-module change summary and (ii) outbound boundary deltas (cross-feature edges to add/change/remove with endpoints + suggested kind/label).
|
|
26
|
-
3. **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.
|
|
27
|
-
- **MUST** run `apltk architecture render` (when subagents batched with `--no-render`) and `apltk architecture validate` after the cross-feature wiring; resolve every reported error before reporting completion.
|
|
28
|
-
- **MUST NOT** re-read source for a delegated feature in the main agent and **MUST NOT** re-declare intra-feature components a subagent already owns.
|
|
29
|
-
- **MUST NOT** generate spec overlay artifacts (`<spec_dir>/architecture_diff/atlas/`) — that is **`spec-to-project-html`**’s job.
|
|
15
|
+
- 只透過 `apltk architecture` 更新基礎 atlas;不得手改 `resources/project-architecture/**/*.html`,也不得寫入任何 `--spec` overlay 產物。
|
|
16
|
+
- 在讀取原始碼前就明確本次 diff 範圍,並在報告中保留所執行的原始命令;過濾掉純文件、靜態資源、鎖檔、生成物和純格式化變更,同時記錄被跳過的類別與原因。
|
|
17
|
+
- 選定範圍內每個真正影響行為的 hunk,都要麼體現在功能內元件更新或跨功能邊變化上,要麼在交付報告中明確標註「對圖譜無影響」及原因。
|
|
18
|
+
- 按「每個受影響功能一個可寫子 agent」執行;主 agent 必須等全部子 agent 完成後,才允許修改跨功能 `edge`、共享 `meta` 或補充跨功能上下文。
|
|
19
|
+
- 更新後的圖譜繼續滿足 `init-project-html` 的語義要求,且 `apltk architecture validate` 通過。
|
|
30
20
|
|
|
31
|
-
##
|
|
21
|
+
## 工作流程
|
|
32
22
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
1. 先確認基礎 atlas 已存在,並執行 `apltk architecture --help` 取得最新 CLI 用法;如果倉庫還沒有 atlas,改用 `init-project-html`;如果需求針對規劃文件 overlay,改用 `spec-to-project-html`。
|
|
24
|
+
2. 在讀取原始碼前先決定 diff 範圍。預設同時檢查未暫存與已暫存改動;若使用者明確指定基線、提交或區間,則按使用者指定範圍執行。
|
|
25
|
+
3. 僅保留真正影響程式碼行為的變更,並把這些路徑映射到受影響功能;此階段只做結構映射,不深讀函式實作。
|
|
26
|
+
4. 為每個受影響功能派發一個可寫子 agent。每個子 agent 只讀取自己負責功能的現有 atlas 與變更檔案,完成全部功能內更新:子模組、函式、變數、資料流、錯誤以及功能內邊,並返回子模組變更摘要與跨功能邊界增量。
|
|
27
|
+
5. 主 agent 不得重讀已委派功能的原始碼,也不得重複宣告子 agent 已處理的功能內元件;只能在全部子 agent 完成後,統一補跨功能邊、必要的共享 `meta`,再執行 `apltk architecture render` 與 `apltk architecture validate`。
|
|
28
|
+
6. 最終報告至少包含:diff 範圍命令、受影響功能列表、各功能更新摘要、跨功能邊變化、被跳過的 diff 類別及原因、驗證結果,以及渲染輸出位置。
|
|
37
29
|
|
|
38
|
-
##
|
|
30
|
+
## 使用範例
|
|
39
31
|
|
|
40
|
-
|
|
32
|
+
- 「把目前分支的程式碼變化同步到基礎架構圖。」 -> 「按分支 diff 識別受影響功能,分別更新功能內宣告,再統一補跨功能連接並重新渲染。」
|
|
33
|
+
- 「刷新這次 PR 的專案 HTML atlas。」 -> 「先鎖定 PR 的 diff 基線,再僅處理有執行時影響的變更,避免無關文件改動污染圖譜。」
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
2. `apltk architecture validate` returns OK.
|
|
44
|
-
3. Macro acceptance criteria from `init-project-html` still hold: cross-boundary interaction expressed as `call`/`return`/`data-row`/`failure` edges (never sub-module page prose); each touched sub-module’s internal diagram has function-to-function flow plus declared variable reads/writes for non-trivial steps.
|
|
45
|
-
4. The handover report cites: chosen diff scope (literal commands), affected feature list, per-feature mutation counts, skipped diff buckets (with reasons), and confirmation that **all subagents completed before cross-feature wiring**.
|
|
35
|
+
## 參考資料索引
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- `feature` / `submodule` — structural mutations (use **`set`** for label/role updates, **`remove`** when code deleted the entry point, **`add`** when the diff introduced a new module).
|
|
52
|
-
- `function` / `variable` / `dataflow` / `error` — per-sub-module rows. Declare new symbols **before** referencing them in `dataflow`. Use the row-level `remove` (see `--help`) to delete obsolete rows the diff dropped.
|
|
53
|
-
- `edge` — intra- or cross-feature seams. Prefer stable **`--id`** when re-applying the same edge after a mutation cycle. `kind` ∈ `call` | `return` | `data-row` | `failure`.
|
|
54
|
-
- `meta` / `actor` — only when the diff actually changed the macro narrative (e.g. summary now needs to record the diff scope or new omissions).
|
|
55
|
-
- `render` (when you batched with `--no-render`) → `validate` → done.
|
|
56
|
-
|
|
57
|
-
This skill **never** uses `--spec`. If the user wants overlay diagrams for a planning doc, redirect to **`spec-to-project-html`**.
|
|
58
|
-
|
|
59
|
-
## Workflow
|
|
60
|
-
|
|
61
|
-
**Chain-of-thought:** Answer **`Pause →`** before moving on. Validator red **MUST** block "done."
|
|
62
|
-
|
|
63
|
-
### 1) Read the current atlas (no source code yet)
|
|
64
|
-
|
|
65
|
-
- Open `resources/project-architecture/index.html` to confirm the atlas exists and renders. If it does not, redirect to **`init-project-html`** — this skill is for refreshes, not bootstraps.
|
|
66
|
-
- List `resources/project-architecture/atlas/atlas.index.yaml` and the per-feature YAMLs to learn the current feature set, sub-modules, and edge ids.
|
|
67
|
-
- **Pause →** Do I actually have a base atlas to update? If not — stop and route to **`init-project-html`**.
|
|
68
|
-
|
|
69
|
-
### 2) Resolve diff scope
|
|
70
|
-
|
|
71
|
-
- Default: **uncommitted** (`git diff --stat`) + **staged** (`git diff --cached --stat`); show both. If the user pointed at a ref/range/commit, use that instead (`git diff --stat <base>..HEAD`, `git diff --stat HEAD~N`, `git show --stat <sha>`, etc.).
|
|
72
|
-
- Print the chosen diff scope as the literal command(s) you ran so the report is reproducible.
|
|
73
|
-
- **Pause →** Is this the diff the user actually meant — or am I about to refresh the atlas against the wrong baseline?
|
|
74
|
-
|
|
75
|
-
### 3) Filter to code-affecting changes
|
|
76
|
-
|
|
77
|
-
- Drop pure docs/markdown/assets/lockfiles/generated/format-only diffs. Keep source files in language directories the project actually treats as code (open the project layout if uncertain).
|
|
78
|
-
- Group remaining files into **affected features** using the per-feature YAML’s declared paths plus folder/package heuristics. Record the path → feature mapping.
|
|
79
|
-
- **Pause →** Did I drop a hunk that actually changes runtime behavior (e.g. a config file the runtime reads)? Re-include if so.
|
|
80
|
-
- **Pause →** Are there changed files I cannot map to any existing feature — do they create a new feature, or do they extend an existing one? Decide explicitly before delegating.
|
|
81
|
-
|
|
82
|
-
### 4) Subagent fan-out — workers own features; orchestrator owns cross-feature seams **after** all workers finish
|
|
83
|
-
|
|
84
|
-
Dispatch one **write-capable** subagent per affected feature. Hand each subagent: its feature slug, the list of changed files in that feature, the diff scope command(s), the existing feature-module list (so it knows other features’ slugs for outbound edges), and **`apltk architecture --help`** as the flag reference.
|
|
85
|
-
|
|
86
|
-
> **Feature `<slug>` subagent contract**
|
|
87
|
-
> - Read the existing per-feature YAML and every changed file in this feature E2E (with `git diff` for the exact delta plus the post-change source for context).
|
|
88
|
-
> - For every behavior change in this feature, apply the matching CLI mutation: structural (`feature` / `submodule`), rows (`function`, `variable`, `dataflow`, `error`), and intra-feature **`edge`** add/set/remove/reorder.
|
|
89
|
-
> - Declare new functions / variables **before** referencing them from `dataflow`.
|
|
90
|
-
> - Run **`apltk architecture validate`** before returning.
|
|
91
|
-
> - **Return ONLY**: (i) sub-module change list (slug + change kind + one-line reason) and (ii) outbound boundary deltas (cross-feature edges to add/change/remove with endpoints + suggested kind/label). No source dumps.
|
|
92
|
-
|
|
93
|
-
**Orchestrator — after every subagent has completed:**
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# only when meta.summary needs to record the diff scope or new omissions
|
|
97
|
-
apltk architecture meta set --summary "..." --no-render
|
|
98
|
-
# one edge mutation per cross-feature interaction reported by the subagents
|
|
99
|
-
apltk architecture edge add --from <featA>/<subA> --to <featB>/<subB> --kind call|return|data-row|failure --label "..." --no-render
|
|
100
|
-
apltk architecture edge remove --id <stable_id> --no-render
|
|
101
|
-
apltk architecture render
|
|
102
|
-
apltk architecture validate
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
The main agent **MUST NOT** re-declare a subagent’s intra-feature components, and **MUST NOT** open source files for any feature it delegated.
|
|
106
|
-
- **Pause →** Did every subagent return — or am I about to wire cross-feature edges from partial summaries?
|
|
107
|
-
|
|
108
|
-
### 5) Handover report
|
|
109
|
-
|
|
110
|
-
Report: chosen diff scope (literal commands), affected features (count), per-feature mutation summary, cross-feature edge deltas (added / removed / changed), skipped diff buckets (with reasons), `validate` outcome, and the location of the rendered atlas (`resources/project-architecture/index.html`).
|
|
111
|
-
|
|
112
|
-
## Sample hints
|
|
113
|
-
|
|
114
|
-
- **Renamed function**: subagent removes the old `function` row, adds the new one, and updates every `dataflow` step that referenced it — do **not** silently leave the old row.
|
|
115
|
-
- **Deleted sub-module**: subagent uses `submodule remove` (see `--help`) and reports the outbound edges to drop; the orchestrator removes the cross-feature edges by stable `--id` after the gate.
|
|
116
|
-
- **New cross-feature data-row**: only one subagent will see the producing side and another only the consumer side — both subagents flag it as an outbound boundary; the orchestrator declares the single `data-row` edge **after** the gate.
|
|
117
|
-
- **Pure formatting diff**: skip entirely; record under "no diagram impact" in the report so future runs do not re-litigate the file.
|
|
118
|
-
- **PR refresh against `main`**: when the user asks to refresh the atlas to reflect "everything on this branch", use `git diff --stat $(git merge-base HEAD origin/main)..HEAD` and state the resolved base SHA in the report.
|
|
119
|
-
|
|
120
|
-
## References
|
|
121
|
-
|
|
122
|
-
- **`init-project-html/SKILL.md`** — semantic rulebook, two-layer rule, acceptance criteria, full subagent contract.
|
|
123
|
-
- **`init-project-html/references/TEMPLATE_SPEC.md`** — schema cheat sheet (fields/enums).
|
|
124
|
-
- **`spec-to-project-html/SKILL.md`** — overlay flow when work is still in spec form.
|
|
125
|
-
- **`apltk architecture --help`** — live CLI reference; trust this over any prose.
|
|
37
|
+
- `init-project-html/SKILL.md`:基礎 atlas 的語義規則、子模組表達約束與總體驗收標準。
|
|
38
|
+
- `spec-to-project-html/SKILL.md`:當需求針對 `docs/plans/...` overlay 而非基礎 atlas 時使用。
|
|
39
|
+
- `README.md`:本技能的簡要用途說明。
|
|
40
|
+
- `apltk architecture --help`:命令、參數和子命令的唯一真源。
|
package/version-release/SKILL.md
CHANGED
|
@@ -1,94 +1,59 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: version-release
|
|
3
3
|
description: >-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
用於明確的 semver 發版流程。必須先完成 `commit-and-push` 共用 gate 與
|
|
5
|
+
`submission-readiness-check`,再決定版本、更新 changelog、建立 tag、推送並發布 GitHub Release。
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# 版本發佈
|
|
9
9
|
|
|
10
10
|
## Dependencies
|
|
11
11
|
|
|
12
|
-
- Required:
|
|
13
|
-
- Conditional:
|
|
14
|
-
- Optional:
|
|
15
|
-
- Fallback:
|
|
12
|
+
- Required: `commit-and-push`、`submission-readiness-check`
|
|
13
|
+
- Conditional: `review-change-set`、`archive-specs`
|
|
14
|
+
- Optional: 無
|
|
15
|
+
- Fallback: 缺少必需技能時必須停止,不能憑印象手動補一個發版流程
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Standards
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **Tag format** (`v1.2.3` vs `1.2.3`) inferred from repo history—not invented per release ad hoc unless user dictates.
|
|
24
|
-
- **GitHub Release**: prefer `gh release create` / repo tooling; **MUST NOT** substitute “opened PR URL” as release completion. Draft vs prerelease vs **latest** follows **explicit** user/repo convention—not tag shape alone.
|
|
25
|
-
- **Prerelease retarget**: same version, **move** tag/release to new SHA when user asks; use force-with-lease **for tag only** as needed; if API rejects SHA for `target_commitish`, use branch identifier per GitHub rules.
|
|
26
|
-
- **MUST** verify **remote** has commit + tag before calling release **done**; **MUST NOT** trust UI git shortcuts.
|
|
27
|
-
- **Done** = version files + changelog section + **pushed** commit + **remote** tag + **published** GitHub release (unless user explicitly skips publication—then say so).
|
|
19
|
+
- Evidence: 以版本檔、`CHANGELOG.md`、本地/remote tag、既有 GitHub Release 與使用者明確的 bump 意圖作為依據
|
|
20
|
+
- Execution: 先確認這真的是 release 請求,再完成所有 gate,之後才更新版本、切 changelog、打 tag、推送與發布 Release
|
|
21
|
+
- Quality: 不猜版本、不重複發版、不用原始 diff 臨時拼 release notes;所有版本入口必須同步一致
|
|
22
|
+
- Output: 交付可驗證的版本發佈結果,包含版本號、tag、remote驗證與 GitHub Release URL
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
## 技能目標
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
把明確的發版需求轉成一條完整、可驗證、可追溯的 semver 流程,確保版本檔、changelog、git tag、remote狀態與 GitHub Release 彼此一致。
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
- **Execution**: Intent → gates (`commit-and-push` pattern) → semver → files → changelog move → commit/tag → push → GH release.
|
|
35
|
-
- **Quality**: No duplicate releases; notes from curated changelog, not raw diff guesswork.
|
|
36
|
-
- **Output**: Announced version, tag URL, release URL, automation status if any.
|
|
28
|
+
## 驗收條件
|
|
37
29
|
|
|
38
|
-
|
|
30
|
+
- 已先確認這是明確的 release / semver 請求;若只是 commit 或 push,必須改走 `commit-and-push`
|
|
31
|
+
- 在修改任何版本相關檔案前,已清楚說出 current -> next 版本與將建立的 tag 字串
|
|
32
|
+
- `submission-readiness-check`、必要的 `review-change-set` 與 `archive-specs` 都已完成,且 `CHANGELOG.md` 的 `Unreleased` 內容足以支撐本次發版
|
|
33
|
+
- 最終已同步版本檔、發布說明、commit、tag、remote refs 與 GitHub Release;若使用者明確要求不發布 Release,需在結果中清楚註明
|
|
39
34
|
|
|
40
|
-
|
|
41
|
-
- `references/commit-messages.md`
|
|
42
|
-
- `references/branch-naming.md`
|
|
43
|
-
- `references/changelog-writing.md`
|
|
44
|
-
- `references/readme-writing.md`
|
|
35
|
+
## 工作流程
|
|
45
36
|
|
|
46
|
-
|
|
37
|
+
1. 先確認使用者是否真的要求 release、publish、tag、patch、minor、major 或其他明確 semver 動作;若沒有,改用 `commit-and-push`
|
|
38
|
+
2. 檢查目前 git 狀態、版本檔、既有 tag、本地與remote是否已有同版本 tag,以及 GitHub 上是否已有同版本 Release,避免重複發版
|
|
39
|
+
3. 對 code-affecting 範圍先完成 `review-change-set`,再執行 `submission-readiness-check`;若它要求 `archive-specs` 或 changelog/文件同步,必須先完成
|
|
40
|
+
4. 根據版本檔、repo 歷史與使用者指示決定 current -> next 版本與 tag 格式;若語意不明,優先選較小 bump 並請使用者確認
|
|
41
|
+
5. 一致更新所有版本入口,並把 `CHANGELOG.md` 的 `Unreleased` 移到新的版本區塊;release notes 只能來自整理過的 changelog 內容
|
|
42
|
+
6. 建立 release commit 與 tag;若是 prerelease retarget,保留版本號不變,只把 tag / Release 移到新的 commit
|
|
43
|
+
7. 推送分支與 tag,並驗證remote commit 與 tag 都已正確存在
|
|
44
|
+
8. 使用 `gh release create` 或 repo 慣用工具建立或更新 GitHub Release,最後回報版本號、tag 與 release URL
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
## 使用範例
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
- 「發 patch release」-> 先確認目前版本與 changelog,再更新到下一個 patch、建立 tag 並發布 Release
|
|
49
|
+
- 「把 prerelease tag 移到最新修正」-> 不增加版本號,只重新對準 tag 與對應 Release
|
|
50
|
+
- 「幫我 commit 然後 push」-> 不使用本技能,改走 `commit-and-push`
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
## 參考資料索引
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- Classify scope; code-affecting ⇒ `review-change-set`; **`submission-readiness-check`** (+ **`archive-specs`** when indicated). All blocking items closed.
|
|
62
|
-
- **Pause →** Am I versioning while `Unreleased`/readiness still wrong?
|
|
63
|
-
|
|
64
|
-
### 4) Decide version & tag
|
|
65
|
-
|
|
66
|
-
- Read files; inspect local/remote tags + existing GH release for collision; prerelease vs stable per user/doc; retarget flow leaves version unchanged.
|
|
67
|
-
- **Pause →** If tag+release already correct on intended SHA—report satisfied, duplicate nothing.
|
|
68
|
-
|
|
69
|
-
### 5) Bump files
|
|
70
|
-
|
|
71
|
-
- Every locator of version bumped consistently.
|
|
72
|
-
|
|
73
|
-
### 6) Release docs
|
|
74
|
-
|
|
75
|
-
- Move **`Unreleased`** → new dated heading; reset `Unreleased` scaffold; **`README`** / **`AGENTS.md`**/`CLAUDE.md` only if behavior/agent workflow changed materially.
|
|
76
|
-
|
|
77
|
-
### 7) Commit & tag
|
|
78
|
-
|
|
79
|
-
- Message e.g. `chore(release): publish X.Y.Z` per repo habit; tag after commit; retarget ⇒ move existing tag deliberately with hash discipline.
|
|
80
|
-
|
|
81
|
-
### 8) Push
|
|
82
|
-
|
|
83
|
-
- Push branch **and** tag; verify remote refs; retarget ⇒ `--force-with-lease` for tag only where appropriate, then verify.
|
|
84
|
-
|
|
85
|
-
### 9) Publish GitHub Release
|
|
86
|
-
|
|
87
|
-
- Create/update matching release body from changelog section; prerelease flag per explicit instruction; confirm non-draft unless automation needs draft—but user asked “publish” ⇒ actually publish.
|
|
88
|
-
- **Pause →** Can I paste **release URL** + prove tag points at **`HEAD`**?
|
|
89
|
-
|
|
90
|
-
## Sample hints
|
|
91
|
-
|
|
92
|
-
- **`Unreleased` empty** ⇒ cannot ship “2.5.0” with honest notes—curate first.
|
|
93
|
-
- **Duplicate**: Tag `v2.5.0` exists on GH → **inspect SHA** before re-creating.
|
|
94
|
-
- **Retarget**: User “move prerelease to latest fix”—**no** semver bump; rewrite tag carefully.
|
|
54
|
+
- `references/semantic-versioning.md`:版本號選擇規則
|
|
55
|
+
- `references/commit-messages.md`:release commit 訊息格式
|
|
56
|
+
- `references/branch-naming.md`:分支命名慣例
|
|
57
|
+
- `references/changelog-writing.md`:`CHANGELOG.md` 與 `Unreleased` 維護規則
|
|
58
|
+
- `references/readme-writing.md`:README 只在必要時同步更新
|
|
59
|
+
- `commit-and-push`:共享的 git 檢查、提交與推送 discipline
|
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
import Foundation
|
|
4
4
|
import PDFKit
|
|
5
5
|
|
|
6
|
+
let helpText = """
|
|
7
|
+
apltk extract-pdf-text-pdfkit — extract PDF text with macOS PDFKit.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
apltk extract-pdf-text-pdfkit /absolute/path/to/source.pdf
|
|
11
|
+
swift weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift /absolute/path/to/source.pdf
|
|
12
|
+
|
|
13
|
+
Use this when:
|
|
14
|
+
- You need a simple macOS PDFKit-based text extraction fallback.
|
|
15
|
+
|
|
16
|
+
Examples:
|
|
17
|
+
apltk extract-pdf-text-pdfkit /absolute/path/to/source.pdf
|
|
18
|
+
Result: prints `PDF_PATH=...`, `PAGE_COUNT=...`, and one `=== PAGE N ===` section per extracted page.
|
|
19
|
+
"""
|
|
20
|
+
|
|
6
21
|
struct Arguments {
|
|
7
22
|
let pdfPath: String
|
|
8
23
|
}
|
|
@@ -15,7 +30,7 @@ enum ExtractionError: Error, CustomStringConvertible {
|
|
|
15
30
|
var description: String {
|
|
16
31
|
switch self {
|
|
17
32
|
case .missingPath:
|
|
18
|
-
return "Usage: swift scripts/extract_pdf_text_pdfkit.swift /absolute/path/to/source.pdf"
|
|
33
|
+
return "Usage: swift scripts/extract_pdf_text_pdfkit.swift /absolute/path/to/source.pdf\nRun with --help for the full command guide."
|
|
19
34
|
case .unsupportedPlatform:
|
|
20
35
|
return "PDFKit extraction is only supported on macOS."
|
|
21
36
|
case .unreadablePDF(let path):
|
|
@@ -24,19 +39,31 @@ enum ExtractionError: Error, CustomStringConvertible {
|
|
|
24
39
|
}
|
|
25
40
|
}
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
enum ParseResult {
|
|
43
|
+
case help
|
|
44
|
+
case arguments(Arguments)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
func parseArguments() throws -> ParseResult {
|
|
28
48
|
let args = Array(CommandLine.arguments.dropFirst())
|
|
49
|
+
if args.contains("--help") || args.contains("-h") {
|
|
50
|
+
return .help
|
|
51
|
+
}
|
|
29
52
|
guard let pdfPath = args.first, !pdfPath.isEmpty else {
|
|
30
53
|
throw ExtractionError.missingPath
|
|
31
54
|
}
|
|
32
|
-
return Arguments(pdfPath: pdfPath)
|
|
55
|
+
return .arguments(Arguments(pdfPath: pdfPath))
|
|
33
56
|
}
|
|
34
57
|
|
|
35
58
|
func main() throws {
|
|
36
59
|
#if !os(macOS)
|
|
37
60
|
throw ExtractionError.unsupportedPlatform
|
|
38
61
|
#else
|
|
39
|
-
|
|
62
|
+
switch try parseArguments() {
|
|
63
|
+
case .help:
|
|
64
|
+
print(helpText)
|
|
65
|
+
return
|
|
66
|
+
case .arguments(let arguments):
|
|
40
67
|
let pdfURL = URL(fileURLWithPath: arguments.pdfPath)
|
|
41
68
|
|
|
42
69
|
guard let document = PDFDocument(url: pdfURL) else {
|
|
@@ -60,6 +87,7 @@ func main() throws {
|
|
|
60
87
|
print(text)
|
|
61
88
|
}
|
|
62
89
|
}
|
|
90
|
+
}
|
|
63
91
|
#endif
|
|
64
92
|
}
|
|
65
93
|
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# <模組/層名稱> 設計原則
|
|
2
|
-
|
|
3
|
-
[One-sentence summary of this module's role in the system.]
|
|
4
|
-
|
|
5
|
-
## <原則標題>
|
|
6
|
-
|
|
7
|
-
<原則描述:這條原則規範什麼、為什麼這樣設計、適用範圍>
|
|
8
|
-
|
|
9
|
-
## <原則標題>
|
|
10
|
-
|
|
11
|
-
<原則描述>
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Writing Rules
|
|
16
|
-
|
|
17
|
-
- State design principles, not implementation details.
|
|
18
|
-
- Keep each principle macro-level so it survives minor code changes.
|
|
19
|
-
- Focus on: module responsibilities, boundary rules, data flow direction, and integration contracts.
|
|
20
|
-
- Each file covers one module or architectural layer.
|
|
21
|
-
- Before writing a principle, ask: "Would a refactor that renames files or extracts a helper violate this principle?" If yes, the principle is too specific.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# [Project Name] Documentation Index
|
|
2
|
-
|
|
3
|
-
## Features (`docs/features/`)
|
|
4
|
-
|
|
5
|
-
User-facing capabilities described with BDD scenarios (Given/When/Then). Each file covers one functional category.
|
|
6
|
-
|
|
7
|
-
| File | Category | Description |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
| `docs/features/[category].md` | [category name] | [One-line description] |
|
|
10
|
-
|
|
11
|
-
## Architecture (`docs/architecture/`)
|
|
12
|
-
|
|
13
|
-
Macro-level design principles organized by module or layer. Each principle is abstract enough to survive minor code changes.
|
|
14
|
-
|
|
15
|
-
| File | Module | Description |
|
|
16
|
-
| --- | --- | --- |
|
|
17
|
-
| `docs/architecture/[module].md` | [module name] | [One-line description] |
|
|
18
|
-
|
|
19
|
-
## Principles (`docs/principles/`)
|
|
20
|
-
|
|
21
|
-
Code style, naming conventions, and development constraints extracted from the codebase.
|
|
22
|
-
|
|
23
|
-
| File | Topic | Description |
|
|
24
|
-
| --- | --- | --- |
|
|
25
|
-
| `docs/principles/[topic].md` | [topic name] | [One-line description] |
|
|
26
|
-
|
|
27
|
-
## Root Documents
|
|
28
|
-
|
|
29
|
-
- `README.md` — project overview and quick start
|
|
30
|
-
- `CONTRIBUTING.md` — contribution workflow (if applicable)
|
|
31
|
-
- `SECURITY.md` — vulnerability reporting (if applicable)
|
|
32
|
-
- `CHANGELOG.md` — release history (if applicable)
|
|
33
|
-
|
|
34
|
-
## Reference List
|
|
35
|
-
|
|
36
|
-
- Source specs reviewed: [list of spec directories/files]
|
|
37
|
-
- Existing docs updated: [paths]
|
|
38
|
-
- Important code/config references: [paths]
|
|
39
|
-
- Remaining unknowns: [list or `None`]
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# <功能類別名稱>
|
|
2
|
-
|
|
3
|
-
[One-sentence summary of this functional category from a user perspective.]
|
|
4
|
-
|
|
5
|
-
## <功能名稱>
|
|
6
|
-
|
|
7
|
-
- **Given** <前置條件>
|
|
8
|
-
- **When** <使用者操作>
|
|
9
|
-
- **Then** <預期結果>
|
|
10
|
-
|
|
11
|
-
## <功能名稱>
|
|
12
|
-
|
|
13
|
-
- **Given** <前置條件>
|
|
14
|
-
- **When** <使用者操作>
|
|
15
|
-
- **Then** <預期結果>
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Writing Rules
|
|
20
|
-
|
|
21
|
-
- Describe behavior from a user's perspective; never mention file paths, function names, or database tables.
|
|
22
|
-
- Use BDD phrasing: **Given** (precondition) → **When** (action) → **Then** (outcome).
|
|
23
|
-
- Each file covers exactly one functional category (e.g., authentication, data export, notifications).
|
|
24
|
-
- Group related features under descriptive subheadings.
|
|
25
|
-
- Title the file with a term users would recognize, not a module name.
|