@laitszkin/apollo-toolkit 3.11.6 → 3.11.8

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 (37) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +1 -2
  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/docs-to-voice/SKILL.md +3 -30
  8. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  9. package/generate-spec/SKILL.md +51 -130
  10. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  11. package/init-project-html/SKILL.md +3 -25
  12. package/init-project-html/lib/atlas/cli.js +897 -43
  13. package/init-project-html/scripts/architecture.js +4 -25
  14. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  15. package/lib/cli.js +166 -20
  16. package/lib/tool-runner.js +418 -2
  17. package/open-github-issue/SKILL.md +7 -98
  18. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  19. package/optimise-skill/SKILL.md +36 -0
  20. package/optimise-skill/agents/openai.yaml +4 -0
  21. package/optimise-skill/references/definition.md +38 -0
  22. package/optimise-skill/references/example_skill.md +36 -0
  23. package/package.json +1 -1
  24. package/read-github-issue/SKILL.md +6 -46
  25. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  26. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  27. package/resolve-review-comments/SKILL.md +4 -26
  28. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  29. package/scripts/validate_openai_agent_config.py +16 -1
  30. package/scripts/validate_skill_frontmatter.py +16 -1
  31. package/spec-to-project-html/SKILL.md +2 -14
  32. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
  33. package/update-project-html/SKILL.md +3 -19
  34. package/weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift +32 -4
  35. package/maintain-skill-catalog/README.md +0 -18
  36. package/maintain-skill-catalog/SKILL.md +0 -72
  37. package/maintain-skill-catalog/agents/openai.yaml +0 -4
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: optimise-skill
3
+ description: Use prompt engineering to optimise agent skill. Use it when you need to optimise a `SKILL.md`
4
+ ---
5
+
6
+ ## 目標
7
+ 在不影響被優化技能整體流程前提下,利用提示詞工程,對技能進行優化,減少冗余表達,增強agent對技能的理解能力以及實際工作中的使用效率。
8
+
9
+ ## 驗收條件
10
+ - 被優化技能的最終交付產物不受影響
11
+ - 被優化技能有顯著冗余削減,且具備精確提示能力,盡最大可能釋放LLM的性能
12
+
13
+ ## 工作流程
14
+
15
+ 1. 識別交付物
16
+ 完整閱讀整個技能的 `SKILL.md` 文檔,以及其引用的所有額檔案,包括但不限於 `references/` , `scripts/` 。基於獲取到的技能上下文資訊,總結出該技能的最終交付產物。
17
+
18
+ 2. 制定驗收條件
19
+ 制定驗收條件,從而確保LLM能夠穩定、可復現地按照驗收條件產出符合要求高質量最終交付物
20
+
21
+ 3. 重寫技能
22
+ 將整個技能的 `SKILL.md` 重寫。重寫後的技能應該只包含以下幾個關鍵組成部分:
23
+ - 技能目標
24
+ - 技能驗收條件
25
+ - 技能工作流程
26
+ - 技能使用範例
27
+ - 技能參考資料索引
28
+ 對於技能有幫助的內但不符合上述技能架構規範,則應該被分類放置在 `references/` 下的markdown檔案。
29
+
30
+ ## 範例
31
+ - "一個專注在提示LLM agent進行自我迭代,並為代碼庫帶來性能優化的技能需要被優化" -> "定義驗收條件為優化後性能相較優化前至少提升X個百分比,並且項目之中不存在任何O(n^2)級別時間複雜度的函式和邏輯,並按照標準架構重寫技能。"
32
+ - "一個有大量前端開發範例被包含在 `SKILL.md` 之中的前端開發技能需要被優化" -> "定義驗收條件為前端頁面 `reference` 之中提供的大量建議範例重寫且不包含任何建議示例之中明確拒絕的設計,然後按照技能優化流程對技能進行全面的重寫。"
33
+
34
+ ## 參考資料
35
+ - `references/example_skill.md` - 優化後的技能範例,在進行技能優化時必須閱讀並嚴格遵照當中格式 **(必讀)**
36
+ - `references/definition.md` - 技能之中各個區塊的定義 **(必讀)**
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Optimise Skill"
3
+ short_description: "Rewrite a SKILL.md into a leaner, higher-signal prompt"
4
+ default_prompt: "Use $optimise-skill to read the target skill and its supporting files, derive the intended deliverable plus acceptance criteria, then rewrite the skill into a tighter goal / acceptance criteria / workflow / examples / references structure without changing the final outcome."
@@ -0,0 +1,38 @@
1
+ ## 驗收條件
2
+ 驗收條件是一個技能的**宏觀目標**。其描述的必須是agent完成所有任務之後,交付產物的狀態,如:
3
+
4
+ **建議實踐**:
5
+ - "嚴格遵守風格規範的前端頁面"
6
+ - "嚴格遵從模板生成的規格文檔"
7
+ - "代碼審查的完整報告總結及改進建議"
8
+
9
+ **錯誤實踐**:
10
+ - "完成所有規格文檔的閱讀,並理解用戶需求。" - 規格的閱讀是執行步驟,而不是最終的交付產物。
11
+ - "所有風格規範已經被閱讀。" - 同上
12
+ - "所有代碼已經被仔細審查" - 這看似是驗收條件,但實際上因為不可量化,並不是一個好的驗收條件。代碼審查的報告和改進建議是能夠被直觀衡量的交付產物。
13
+
14
+ ## 工作流程
15
+ 工作流程是一個技能核心要素。需要專注在告訴agent **「做什麼」**,而不是 **「如何去做」**。
16
+
17
+ **建議實踐**:
18
+ - "按照本次變更的實際內容,創建符合通用開發規範的git分支並在分支上提交變更。"
19
+ - "在結束任務之前閱讀並確認所有檢查項目是否被勾選為完成。"
20
+ - "閱讀規格文檔之中的 `spec.md` 來完整理解用戶需求"
21
+
22
+ **錯誤實踐**:
23
+ - "使用 `git diff --stat` 閱讀目前變更。然後使用 `git branch -b <branch_name>` 來創建專屬分支。最後通過 `git commit -m "<commit_message>"` 完成提交。"
24
+ - "在結束任務之前,使用 `cd completion-criteria/` 進入檢查項目所處目錄,通過 `cat checklist.md` 來閱讀整個檢查項目清單,並確認當中的markdown checkboxes是否被勾選為完成。"
25
+ - "使用 `ls` 找到規格文檔目錄,並使用 `cd spec/` 進入規格文檔所出目錄。然後使用 `cat spec.md` 來理解用戶的需求。"
26
+
27
+ ## 範例
28
+ 範例是一個技能之中讓效果達到預期的重要基礎。其本質上是通過**對比交付產物在執行工作流程前及執行工作流程後的狀態**,讓agent在調用工作流程自行工作的時候對目標有著清晰的認知,從而避免在執行時成為無頭蒼蠅並在上下文之中迷失。
29
+
30
+ **建議實踐**:
31
+ 用一個用於優化提示詞技能的技能作為示例:
32
+ - "一個專注在提示LLM agent進行自我迭代,並為代碼庫帶來性能優化的技能需要被優化" -> "定義驗收條件為優化後性能相較優化前至少提升X個百分比,並且項目之中不存在任何O(n^2)級別時間複雜度的函式和邏輯,並按照標準架構重寫技能。"
33
+ - "一個有大量前端開發範例被包含在 `SKILL.md` 之中的前端開發技能需要被優化" -> "定義驗收條件為前端頁面 `reference` 之中提供的大量建議範例重寫且不包含任何建議示例之中明確拒絕的設計,然後按照技能優化流程對技能進行全面的重寫。"
34
+
35
+ **錯誤實踐**:
36
+ 用一個專門用於前端開發的提示詞技能作為示例:
37
+ - "前端頁面非常混亂。" -> "找到前端頁面所出目錄,列出所有前端頁面檔案,並對前端頁面進行整理" - 前面的找到目錄、列出檔案,這些都是隱含前提,不需要額外列出。我們需要關注並對比的是執行工作流程前後交付物的狀態。
38
+ - "測試覆蓋率低。" -> "執行工作流程補全測試" - 這裏沒有描述好最終的狀態,應該是 `補齊低測試覆蓋率模塊的高價值測試,確保業務邏輯正確無誤。` ,這樣能夠更清晰展現輸入輸出之間的對應關係。
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: optimise-skill
3
+ description: Use prompt engineering to optimise agent skill. Use it when you need to optimise a `SKILL.md`
4
+ ---
5
+
6
+ ## 目標
7
+ 在不影響被優化技能整體流程前提下,利用提示詞工程,對技能進行優化,減少冗余表達,增強agent對技能的理解能力以及實際工作中的使用效率。
8
+
9
+ ## 驗收條件
10
+ - 被優化技能的最終交付產物不受影響
11
+ - 被優化技能有顯著冗余削減,且具備精確提示能力,盡最大可能釋放LLM的性能
12
+
13
+ ## 工作流程
14
+
15
+ 1. 識別交付物
16
+ 完整閱讀整個技能的 `SKILL.md` 文檔,以及其引用的所有額檔案,包括但不限於 `references/` , `scripts/` 。基於獲取到的技能上下文資訊,總結出該技能的最終交付產物。
17
+
18
+ 2. 制定驗收條件
19
+ 制定驗收條件,從而確保LLM能夠穩定、可復現地按照驗收條件產出符合要求高質量最終交付物
20
+
21
+ 3. 重寫技能
22
+ 將整個技能的 `SKILL.md` 重寫。重寫後的技能應該只包含以下幾個關鍵組成部分:
23
+ - 技能目標
24
+ - 技能驗收條件
25
+ - 技能工作流程
26
+ - 技能使用範例
27
+ - 技能參考資料索引
28
+ 對於技能有幫助的內但不符合上述技能架構規範,則應該被分類放置在 `references/` 下的markdown檔案。
29
+
30
+ ## 範例
31
+ - "一個專注在提示LLM agent進行自我迭代,並為代碼庫帶來性能優化的技能需要被優化" -> "定義驗收條件為優化後性能相較優化前至少提升X個百分比,並且項目之中不存在任何O(n^2)級別時間複雜度的函式和邏輯,並按照標準架構重寫技能。"
32
+ - "一個有大量前端開發範例被包含在 `SKILL.md` 之中的前端開發技能需要被優化" -> "定義驗收條件為前端頁面 `reference` 之中提供的大量建議範例重寫且不包含任何建議示例之中明確拒絕的設計,然後按照技能優化流程對技能進行全面的重寫。"
33
+
34
+ ## 參考資料
35
+ - `references/example_skill.md` - 優化後的技能範例,在進行技能優化時必須閱讀並嚴格遵照當中格式 **(必讀)**
36
+ - `references/definition.md` - 技能之中各個區塊的定義 **(必讀)**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "3.11.6",
3
+ "version": "3.11.8",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",
@@ -33,44 +33,16 @@ description: Read and search remote GitHub issues via GitHub CLI (`gh`). Use whe
33
33
 
34
34
  ### 2) Find candidate issues with the bundled CLI
35
35
 
36
- - Preferred command:
37
-
38
- ```bash
39
- apltk find-github-issues --limit 50 --state open
40
- ```
41
-
42
- - Optional filters:
43
- - `--repo owner/name`
44
- - `--label bug`
45
- - `--search "panic in parser"`
36
+ - Use `apltk find-github-issues --help` as the live command reference for filters, output modes, and examples.
46
37
  - Raw `gh` fallback when the script is missing or broken:
47
-
48
- ```bash
49
- gh issue list --limit 50 --state open
50
- ```
51
-
52
- - Add `--repo <owner>/<repo>`, `--label <label>`, or `--search "<text>"` as needed.
38
+ - `gh issue list --limit 50 --state open`
53
39
  - If the issue target is still unclear, present top candidates and ask which issue number or URL should be inspected next.
54
40
 
55
41
  ### 3) Read a specific issue in detail
56
42
 
57
- - Preferred command:
58
-
59
- ```bash
60
- apltk read-github-issue 123 --comments
61
- ```
62
-
63
- - Optional flags:
64
- - `--repo owner/name`
65
- - `--json`
66
- - `--comments`
43
+ - Use `apltk read-github-issue --help` as the live command reference for issue selection, comments, JSON output, and examples.
67
44
  - Raw `gh` fallback when the script is missing or broken:
68
-
69
- ```bash
70
- gh issue view 123 --comments
71
- ```
72
-
73
- - Use `--repo <owner>/<repo>` when targeting a different repository.
45
+ - `gh issue view 123 --comments`
74
46
  - Use the returned title, body, labels, assignees, state, timestamps, and comments to summarize the issue precisely.
75
47
 
76
48
  ### 4) Summarize gaps before any follow-up action
@@ -78,18 +50,6 @@ gh issue view 123 --comments
78
50
  - Identify missing acceptance criteria, repro details, affected components, or environment context.
79
51
  - If issue text and comments are insufficient, state exactly what is missing instead of inventing a fix plan.
80
52
 
81
- ## Included CLI
82
-
83
- ### `apltk find-github-issues`
84
-
85
- - Purpose: consistent remote issue listing via `gh issue list`.
86
- - Outputs a readable table by default, or JSON with `--output json`.
87
- - Uses only GitHub CLI so it reflects remote GitHub state.
88
- - Treat it as a convenience wrapper, not a hard dependency.
89
-
90
- ### `apltk read-github-issue`
53
+ ## CLI reference
91
54
 
92
- - Purpose: deterministic issue detail retrieval via `gh issue view`.
93
- - Outputs either a human-readable summary or full JSON for downstream automation.
94
- - Can include issue comments so the agent can read the latest discussion before taking any other step.
95
- - Treat it as a convenience wrapper, not a hard dependency.
55
+ Use `apltk find-github-issues --help` and `apltk read-github-issue --help` as the authoritative command references. This skill keeps the retrieval workflow and fallback rules, not the flag catalog.
@@ -40,21 +40,12 @@ description: Read GitHub pull request review comments, analyze each thread, deci
40
40
 
41
41
  - If user provides PR number, use it directly.
42
42
  - If user does not provide PR number, infer from current branch context.
43
-
44
- ```bash
45
- apltk review-threads list --repo <owner>/<repo> --pr <number>
46
- apltk review-threads list
47
- ```
43
+ - Use `apltk review-threads --help` as the live command reference for PR inference and explicit repo selection.
48
44
 
49
45
  ## 2) Read unresolved review threads
50
46
 
51
47
  Use table view for quick scan, then JSON when you need full details.
52
48
 
53
- ```bash
54
- apltk review-threads list --pr <number> --state unresolved --output table
55
- apltk review-threads list --pr <number> --state unresolved --output json > /tmp/pr_threads.json
56
- ```
57
-
58
49
  The JSON output contains `thread_id`, `path`, `line`, and comment bodies for decision and resolution.
59
50
 
60
51
  ## 3) Decide adopt vs reject
@@ -91,16 +82,7 @@ Track adopted thread IDs in a JSON file:
91
82
  ## 7) Resolve addressed threads
92
83
 
93
84
  Resolve only threads you actually addressed in code.
94
-
95
- ```bash
96
- apltk review-threads resolve --pr <number> --thread-id-file adopted_threads.json
97
- ```
98
-
99
- Optional preview without mutating GitHub state:
100
-
101
- ```bash
102
- apltk review-threads resolve --pr <number> --thread-id-file adopted_threads.json --dry-run
103
- ```
85
+ - Use `apltk review-threads --help` as the live command reference for listing, resolving, dry-run behavior, and thread-id file input.
104
86
 
105
87
  ## 8) Handle non-adopted comments
106
88
 
@@ -108,10 +90,6 @@ apltk review-threads resolve --pr <number> --thread-id-file adopted_threads.json
108
90
  - Reply with a concise technical reason and, if needed, a proposed follow-up.
109
91
  - Never resolve rejected or unhandled feedback threads.
110
92
 
111
- ## CLI
112
-
113
- ### `apltk review-threads`
93
+ ## CLI reference
114
94
 
115
- - `list`: fetch PR review threads via GitHub GraphQL (`gh api graphql`), supports repo/PR inference.
116
- - `resolve`: resolve selected review threads by thread IDs.
117
- - Supports thread IDs from flags, JSON files, or `--all-unresolved`.
95
+ Use `apltk review-threads --help` as the authoritative command reference. This skill preserves the adopt/reject workflow and submission rules, not the flag catalog.
@@ -3,6 +3,7 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
+ import argparse
6
7
  import re
7
8
  import sys
8
9
  from pathlib import Path
@@ -21,6 +22,11 @@ INTERFACE_ALLOWED_KEYS = {
21
22
  }
22
23
  HEX_COLOR_PATTERN = re.compile(r"^#[0-9A-Fa-f]{6}$")
23
24
 
25
+ HELP_EPILOG = """Examples:
26
+ apltk validate-openai-agent-config
27
+ Result: prints either a pass summary or one error per invalid agents/openai.yaml file.
28
+ """
29
+
24
30
 
25
31
  def repo_root() -> Path:
26
32
  return Path(__file__).resolve().parent.parent
@@ -169,7 +175,16 @@ def validate_skill(skill_dir: Path) -> list[str]:
169
175
  return errors
170
176
 
171
177
 
172
- def main() -> int:
178
+ def build_parser() -> argparse.ArgumentParser:
179
+ return argparse.ArgumentParser(
180
+ description="Validate agents/openai.yaml for all top-level skills.",
181
+ epilog=HELP_EPILOG,
182
+ formatter_class=argparse.RawDescriptionHelpFormatter,
183
+ )
184
+
185
+
186
+ def main(argv: list[str] | None = None) -> int:
187
+ build_parser().parse_args(argv)
173
188
  root = repo_root()
174
189
  skill_dirs = iter_skill_dirs(root)
175
190
  if not skill_dirs:
@@ -3,6 +3,7 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
+ import argparse
6
7
  import re
7
8
  import sys
8
9
  from pathlib import Path
@@ -13,6 +14,11 @@ NAME_PATTERN = re.compile(r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
13
14
  REQUIRED_KEYS = {"name", "description"}
14
15
  MAX_DESCRIPTION_LENGTH = 1024
15
16
 
17
+ HELP_EPILOG = """Examples:
18
+ apltk validate-skill-frontmatter
19
+ Result: prints either a pass summary or one error per invalid top-level SKILL.md frontmatter file.
20
+ """
21
+
16
22
 
17
23
  def repo_root() -> Path:
18
24
  return Path(__file__).resolve().parent.parent
@@ -91,7 +97,16 @@ def validate_skill(skill_dir: Path) -> list[str]:
91
97
  return errors
92
98
 
93
99
 
94
- def main() -> int:
100
+ def build_parser() -> argparse.ArgumentParser:
101
+ return argparse.ArgumentParser(
102
+ description="Validate SKILL.md frontmatter for all top-level skills.",
103
+ epilog=HELP_EPILOG,
104
+ formatter_class=argparse.RawDescriptionHelpFormatter,
105
+ )
106
+
107
+
108
+ def main(argv: list[str] | None = None) -> int:
109
+ build_parser().parse_args(argv)
95
110
  root = repo_root()
96
111
  skill_dirs = iter_skill_dirs(root)
97
112
  if not skill_dirs:
@@ -21,11 +21,7 @@ description: >-
21
21
  - **MUST** obey the semantic rules from `init-project-html/SKILL.md`:
22
22
  - Sub-module pages stay self-only — express cross-boundary interactions via **edges** (cross-feature or intra-feature), never as sub-module page prose.
23
23
  - Feature pages stay lightweight — cross-sub-module choreography belongs in **edges**, not in `dataflow` prose that pretends to cross features.
24
- - **MUST** reconcile deltas through the CLI families described in **`--help`**:
25
- - Structural changes → `feature` / `submodule` (**add** / **set** / **remove** as appropriate).
26
- - Per-sub-module rows → `function`, `variable`, `dataflow`, `error` (**add** / **remove** / **reorder** for dataflow where supported).
27
- - Seams → `edge` **add** / **remove** (prefer stable **`--id`** when you may remove the same edge later).
28
- - **`submodule remove`** / **`feature remove`** in spec mode populate removal manifests so `diff` can show **removed** pages; renames are usually **remove old slug + add new slug** so the viewer shows remove + add rather than a silent overwrite.
24
+ - **MUST** reconcile deltas through the CLI families described in **`apltk architecture --help`**. Keep the meaning in this skill, but take the exact verbs, subverbs, and flags from the CLI itself.
29
25
  - **MUST NOT** drop modules that are still present in code just because the spec omits them — keep them, or rewrite role/purpose to flag “out of spec scope”.
30
26
  - **MUST** scope reads to the **affected feature modules** from the spec/design diff (plus any feature owning the other end of a cross-feature edge into an affected one). **Subagents own intra-feature overlay writes; the main agent owns cross-feature seams — after all subagents finish:**
31
27
  - Dispatch **one write-capable subagent per affected feature**. Each applies every intra-feature overlay mutation via `apltk architecture ... --spec <spec_dir>` (exact flags: **`--help`**). Each returns **ONLY** a structured summary: sub-module change list, outbound boundary changes (cross-feature edges to add/change/remove), and any `planned` / `gap` markers.
@@ -67,15 +63,7 @@ Dispatch one **write-capable subagent per affected feature**. Each subagent owns
67
63
  > - Run `apltk architecture validate --spec <spec_dir>` before returning.
68
64
  > - **Return ONLY**: (i) sub-module change list, (ii) outbound boundary changes (cross-feature edges add/change/remove with endpoints and suggested kind/label), (iii) any `planned` / `gap` flags for `meta.summary`.
69
65
 
70
- **After every subagent has completed**, the main agent declares **only** cross-feature seams, then renders and validates:
71
-
72
- ```bash
73
- # exact flags per edge: see --help
74
- apltk architecture edge add --spec <spec_dir> --from <featA>/<subA> --to <featB>/<subB> --kind call|return|data-row|failure --label "..." --no-render
75
- apltk architecture edge remove --spec <spec_dir> --id <stable_id> --no-render
76
- apltk architecture render --spec <spec_dir>
77
- apltk architecture validate --spec <spec_dir>
78
- ```
66
+ **After every subagent has completed**, the main agent declares **only** the cross-feature seams through `apltk architecture ... --spec <spec_dir>`, then renders and validates the overlay.
79
67
 
80
68
  - **Pause →** Do `planned` / `gap` markers read consistently across affected sub-modules?
81
69
  - The main agent **MUST NOT** re-declare a subagent’s intra-feature components, and **MUST NOT** open source files for any feature it delegated.
@@ -44,15 +44,9 @@ The atlas update is only complete when **all** of the following hold:
44
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
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**.
46
46
 
47
- ## How to use `apltk architecture`
47
+ ## CLI reference
48
48
 
49
- **Authoritative command tree:** run **`apltk architecture --help`** (same output as `apltk architecture help`). Same families as `init-project-html`:
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.
49
+ Use `apltk architecture --help` and deeper `apltk architecture <verb> [subverb] --help` pages as the authoritative command references. This skill keeps the diff-filtering rules, subagent ownership rules, and base-atlas-only scope; it does not duplicate the flag catalog.
56
50
 
57
51
  This skill **never** uses `--spec`. If the user wants overlay diagrams for a planning doc, redirect to **`spec-to-project-html`**.
58
52
 
@@ -90,17 +84,7 @@ Dispatch one **write-capable** subagent per affected feature. Hand each subagent
90
84
  > - Run **`apltk architecture validate`** before returning.
91
85
  > - **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
86
 
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
- ```
87
+ **Orchestrator — after every subagent has completed:** apply only the cross-feature `apltk architecture` mutations that the subagents reported, then render and validate the base atlas.
104
88
 
105
89
  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
90
  - **Pause →** Did every subagent return — or am I about to wire cross-feature edges from partial summaries?
@@ -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
- func parseArguments() throws -> Arguments {
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
- let arguments = try parseArguments()
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,18 +0,0 @@
1
- # maintain-skill-catalog
2
-
3
- Maintain a repository of installable skills by auditing skill definitions, dependency declarations, shared conventions, and catalog validation.
4
-
5
- ## Core capabilities
6
-
7
- - Scans top-level skills before adding or splitting new ones to avoid duplicate scope.
8
- - Audits standardized `## Dependencies` sections and separates vendored, local-only, external, and alias dependencies.
9
- - Syncs catalog docs such as `README.md` and `AGENTS.md/CLAUDE.md` with actual skill capabilities.
10
- - Catches catalog-wide validation issues like missing `agents/openai.yaml` files or stale prompt references.
11
- - Encodes user corrections into durable catalog rules so the same classification mistakes do not repeat.
12
-
13
- ## Typical triggers
14
-
15
- - Standardize all skills to one dependency format.
16
- - Check which skills rely on external skills and document how to install them.
17
- - Split repeated workflow steps into a new shared skill.
18
- - Fix skill-catalog CI failures caused by missing metadata or agent config files.
@@ -1,72 +0,0 @@
1
- ---
2
- name: maintain-skill-catalog
3
- description: >-
4
- Maintain this SKILL catalog repo: reconcile `SKILL.md` frontmatter/`Dependencies`, `agents/openai.yaml`, README inventory, classify vendored vs external vs unpublished-local aliases, prefer extracting shared workflows over duplicating long prose, and always rerun `apltk validate-skill-frontmatter` plus `apltk validate-openai-agent-config` before finishing—never invent package names or installers for unverified deps.
5
- Use when CI metadata breaks, users ask to “sync skills”, or dependency docs drift. Do not use for random application repos that are not this catalog layout.
6
- Bad: marketing a `~/.claude` draft as an npm dependency… Good: label it “local optional” and link once in README instead of pasting the blurb into five skills…
7
- ---
8
-
9
- # Maintain Skill Catalog
10
-
11
- ## Dependencies
12
-
13
- - Required: none.
14
- - Conditional: `find-skills` when a dependency is external and the installation source is unknown.
15
- - Optional: `skill-creator` when extracting a repeated workflow into a new shared skill or heavily reshaping a skill.
16
- - Fallback: If an external dependency cannot be verified, **MUST** document unknowns honestly—**MUST NOT** invent package names, install commands, or skill aliases.
17
-
18
- ## Non-negotiables
19
-
20
- - **MUST** read actual skill directories, validator scripts (`scripts/validate_*.py`, CI), `README.md`, and `agents/openai.yaml` patterns **before** reclassifying dependencies or rewriting catalog prose.
21
- - **MUST** treat each skill’s `## Dependencies` block as authoritative for skill-to-skill references; reconcile docs to match folders, not the reverse by guess.
22
- - **MUST** classify each dependency edge as: vendored-in-repo · local unpublished (not advertised as external) · external-with-install-guidance · alias-only (explain, don’t duplicate as separate dep).
23
- - **MUST NOT** duplicate skills or paste long prose into README without verifying whether a narrower edit or extraction fixes the repetition.
24
- - **MUST NOT** advertise a colleague’s unpublished `~/.codex/skills/...` name as if it were an npm-installable artifact unless verified.
25
- - After metadata or agent-config edits, **MUST** run **`apltk validate-skill-frontmatter`** and **`apltk validate-openai-agent-config`** (or fail the session with explanation if CLI unavailable)—**MUST NOT** declare the catalog consistent while validators fail.
26
- - If validator failures reveal a **systemic** gap, **MUST** prefer tightening the validator/CI in the **same** change set when appropriate, not only patching one skill ad hoc.
27
-
28
- ## Standards (summary)
29
-
30
- - **Evidence**: Folders + scripts + frontmatter reality; optional `~/.codex/skills` spot-check for external names.
31
- - **Execution**: Inventory → classify → minimal focused edits → validate → report.
32
- - **Quality**: One skill one purpose; naming matches folder; agent configs synchronized.
33
- - **Output**: Updated lists/docs + green validators + explicit unknowns.
34
-
35
- ## Workflow
36
-
37
- **Chain-of-thought:** Answer **`Pause →`** before moving to the next subsection; validator red **MUST** block “done.”
38
-
39
- ### 1) Inventory
40
-
41
- - Enumerate top-level skill dirs (`SKILL.md` present); read touched `SKILL.md` files before inventing merges or new skills.
42
- - Read `README.md`, `AGENTS.md`/`CLAUDE.md`, and existing dependency notes.
43
- - **Pause →** Is the requested change already satisfied by renaming or merging **existing** skill text instead of adding a sibling skill?
44
- - **Pause →** Which validator script actually enforces description length and keys—did I open its source?
45
-
46
- ### 2) Audit dependencies and conventions
47
-
48
- - Align `## Dependencies` across skills with shared vocabulary (`Required` / `Conditional` / `Optional` / `Fallback`).
49
- - Exact external strings only—verify spelling/plural vs installed tree.
50
- - Repeated workflows ⇒ prefer **extract** to new skill (`skill-creator`) over copy-paste.
51
- - **Pause →** Would classifying dep X as “external” confuse installers—could it actually be repo-vendored or optional?
52
-
53
- ### 3) Apply catalog edits
54
-
55
- - Minimal diffs; update `README` skill lists and external-dep sections **only when** inventory changed facts.
56
- - New shared skill: kebab-case folder = frontmatter `name`; add `agents/openai.yaml` following neighbors.
57
- - **Pause →** Did I treat a **template** path under `references/` as a runtime skill—classification error?
58
-
59
- ### 4) Validate
60
-
61
- - Run `apltk validate-skill-frontmatter` and `apltk validate-openai-agent-config`. If installer/discovery scripts changed behavior, smoke the paths they document.
62
- - **Pause →** Any skill missing `agents/openai.yaml` or stale tool names—still acceptable for this repo’s rules?
63
-
64
- ### 5) Report
65
-
66
- - Skills touched, conventions updated, external deps verified vs unknown; encode user-stated repo rules into skill or README so regressions recur less.
67
-
68
- ## Sample hints
69
-
70
- - **Classification**: Skill A says `Conditional: Foo` but `Foo` lives only under `~/.claude/` unpublished → document as **local optional**, not “install Foo from npm.”
71
- - **Validator**: frontmatter `description` 1100 chars → expect **fail** if limit 1024—fix text, don’t disable check.
72
- - **Anti-pattern**: “We should mention skill X everywhere” → add **once** to README index + Dependencies of callers, not five duplicate paragraphs.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "maintain-skill-catalog"
3
- short_description: "Audit and keep a skill repository consistent"
4
- default_prompt: "Use $maintain-skill-catalog to audit top-level skills, classify internal versus external dependencies, sync catalog docs, extract repeated workflows into shared skills when justified, and run repository validators before finishing."