@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.
Files changed (62) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +0 -2
  3. package/align-project-documents/SKILL.md +20 -69
  4. package/align-project-documents/references/templates/standardized-docs-template.md +1 -1
  5. package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
  6. package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
  7. package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
  8. package/archive-specs/SKILL.md +18 -70
  9. package/commit-and-push/SKILL.md +24 -52
  10. package/develop-new-features/SKILL.md +15 -60
  11. package/discover-edge-cases/SKILL.md +16 -75
  12. package/discover-security-issues/SKILL.md +49 -83
  13. package/docs-to-voice/SKILL.md +3 -30
  14. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  15. package/enhance-existing-features/SKILL.md +36 -57
  16. package/generate-spec/SKILL.md +51 -130
  17. package/generate-spec/references/templates/coordination.md +0 -1
  18. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  19. package/implement-specs/SKILL.md +27 -62
  20. package/implement-specs-with-subagents/SKILL.md +28 -71
  21. package/implement-specs-with-worktree/SKILL.md +38 -62
  22. package/init-project-html/SKILL.md +27 -137
  23. package/init-project-html/lib/atlas/cli.js +897 -43
  24. package/init-project-html/scripts/architecture.js +4 -25
  25. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  26. package/lib/cli.js +166 -20
  27. package/lib/tool-runner.js +418 -2
  28. package/maintain-project-constraints/SKILL.md +24 -78
  29. package/maintain-project-constraints/references/constraint-file-reference.md +58 -0
  30. package/merge-changes-from-local-branches/SKILL.md +36 -99
  31. package/open-github-issue/SKILL.md +7 -98
  32. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  33. package/optimise-skill/SKILL.md +7 -6
  34. package/optimise-skill/references/definition.md +38 -0
  35. package/optimise-skill/references/example_skill.md +7 -6
  36. package/package.json +1 -1
  37. package/read-github-issue/SKILL.md +6 -46
  38. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  39. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  40. package/resolve-review-comments/SKILL.md +4 -26
  41. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  42. package/review-change-set/SKILL.md +41 -91
  43. package/review-codebases/SKILL.md +42 -99
  44. package/review-spec-related-changes/SKILL.md +42 -77
  45. package/scripts/validate_openai_agent_config.py +16 -1
  46. package/scripts/validate_skill_frontmatter.py +16 -1
  47. package/solve-issues-found-during-review/SKILL.md +38 -66
  48. package/spec-to-project-html/SKILL.md +27 -88
  49. package/submission-readiness-check/SKILL.md +35 -55
  50. package/systematic-debug/SKILL.md +37 -53
  51. package/test-case-strategy/SKILL.md +38 -85
  52. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
  53. package/update-project-html/SKILL.md +25 -110
  54. package/version-release/SKILL.md +39 -74
  55. package/weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift +32 -4
  56. package/archive-specs/references/templates/architecture.md +0 -21
  57. package/archive-specs/references/templates/docs-index.md +0 -39
  58. package/archive-specs/references/templates/features.md +0 -25
  59. package/archive-specs/references/templates/principles.md +0 -28
  60. package/maintain-skill-catalog/README.md +0 -18
  61. package/maintain-skill-catalog/SKILL.md +0 -72
  62. package/maintain-skill-catalog/agents/openai.yaml +0 -4
@@ -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.
@@ -1,96 +1,46 @@
1
1
  ---
2
2
  name: review-change-set
3
3
  description: >-
4
- Unbiased **git diff** review: architecture (boundaries, duplication, ownership) then simplification (real deletes/flattening, not churn)—discard conversation bias. For diffs spanning multiple files/modules, **prefer dispatching one read-only subagent per scope cluster** (each owns its files end-to-end), then aggregate confirmed findings on the main agent without re-reading delegated files.
5
- Use for pre-commit/pre-PR review, refactor/abstraction second opinion, “review my branch” **STOP** greenfield feature design from scratch—use planning skills… BAD style-only nits… GOOD evidence + named abstraction target…
4
+ 面向當前 `git diff` 的只讀審查技能。先從架構與模組邊界切入,再檢查是否存在真正能降低複雜度的簡化機會;忽略對話偏見,不做 style-only 評論。當變更跨多個檔案或模組時,優先按 scope cluster 派發只讀 subagent,各自讀完整個責任區後回傳結構化發現,由主代理統一去重與彙總。
6
5
  ---
7
6
 
8
- # Review Change Set
9
-
10
- ## Dependencies
11
-
12
- - Required: none.
13
- - Conditional: none.
14
- - Optional: none.
15
- - Fallback: If a downstream consumer (e.g. `commit-and-push`) needs additional safety checks (security, edge cases), invoke those skills explicitly there — this skill no longer chains them automatically.
16
-
17
- ## Non-negotiables
18
-
19
- - Read the **full** active change set (staged **and** unstaged when both exist—label which finding hits which).
20
- - **MUST** discard authorship bias; burden of proof on the code.
21
- - Prefer **architecture** and **maintainability** over style-only.
22
- - Abstraction only when it cuts duplication, clarifies ownership, or stabilizes boundaries.
23
- - Simplification only when behavior-preserving and genuinely simpler—**MUST NOT** shuffle complexity.
24
- - For non-trivial diffs (multiple files, multiple modules, or large per-file changes), **SHOULD** dispatch **read-only subagents** — one per coherent scope cluster (e.g. one feature/package, one layer, or one logical concern). Each subagent reads its assigned files end-to-end and returns ONLY structured findings (architecture + simplification with `path:line` evidence). The main agent **MUST NOT** re-read delegated files; it aggregates confirmed findings, deduplicates cross-cluster overlaps, and writes the final report. Tiny one-file diffs may be reviewed inline without subagents.
25
- - **MUST NOT** fabricate findings the diff does not actually contain; subagent reports stay confined to architecture and simplification.
26
-
27
- ## Standards (summary)
28
-
29
- - **Evidence**: Full diff + minimum context reads to understand behavior; subagent reports cite `path:line` per finding.
30
- - **Execution**: Git state → baseline → (subagent fan-out for multi-cluster diffs OR inline read for tiny diffs) → architecture → simplification → aggregate → report.
31
- - **Quality**: Actionable, outsider perspective; subagent fan-out keeps each context window small; no duplicated findings across clusters.
32
- - **Output**: Scope, architecture findings, simplification findings, residual uncertainty.
33
-
34
- ## Workflow
35
-
36
- **Chain-of-thought:** **`Pause →`** after each block—no verdicts from partial file reads.
37
-
38
- ### 1) Inspect git state
39
-
40
- - `git status -sb`, `git diff --stat`, `git diff --cached --stat`; cover staged vs unstaged explicitly.
41
- - No diff `No active git change set to review` and stop.
42
- - **Pause →** Am I about to review **only** unstaged while staged also ships?
43
-
44
- ### 2) Plan the read pattern
45
-
46
- - **Tiny diff** (one file or a handful of small hunks in one module) → read inline; skip subagents.
47
- - **Multi-file or multi-module diff** → cluster the changed files into coherent scopes (one feature/package, one layer, one logical concern). Dispatch **one read-only subagent per cluster**. Hand each subagent: the cluster file list, its slice of `git diff`/`git diff --cached`, and the structured-report contract below. The main agent **MUST NOT** read the delegated files itself.
48
-
49
- > **Cluster `<scope>` subagent contract**
50
- > - Read every file in this cluster E2E plus the minimum callers/callees/config needed to interpret behavior.
51
- > - Discard authorship bias; behavior comes from code/tests/config, not chat memory.
52
- > - Return ONLY a structured findings block:
53
- > - `Architecture`: list of `{ title, evidence (path:line), abstraction target, why current shape is weaker }`.
54
- > - `Simplification`: list of `{ title, evidence (path:line), candidate change, behavior-preserving benefit }`.
55
- > - `Outbound concerns`: any boundary issue that touches another cluster (so the orchestrator can deduplicate).
56
- > - No source dumps, no opinions about tasks outside this cluster, no security/edge-case fabrication.
57
-
58
- - **Pause →** Did I cluster correctly so that one subagent owns each coherent boundary, or am I about to split a duplicated helper across two subagents and miss the dedup signal?
59
-
60
- ### 3) Baseline (inline path) or aggregate (subagent path)
61
-
62
- - Inline: read every changed file E2E; pull in minimal callers/callees/config to interpret moves and interfaces.
63
- - Subagent: wait for **every** cluster subagent to return. Aggregate their findings, then deduplicate any architecture finding two clusters reported via their `Outbound concerns` block.
64
- - Behavior from **code, tests, config, execution**—not from chat memory.
65
- - **Pause →** Can I quote **one concrete behavior** change this diff introduces—not intent?
66
-
67
- ### 4) Architecture first
68
-
69
- Flag only if evidence-backed: duplicated workflows, cross-layer leakage, wrong helper ownership, repeated condition trees, unstable interfaces.
70
- Each finding **MUST** name abstraction target **and** why current shape is weaker.
71
- - **Pause →** Is this “different style” or a real **boundary** problem?
72
-
73
- ### 5) Simplification second
74
-
75
- Redundant branches/wrappers, deep nesting, duplicated validation, oversize functions, dead compat—**only** if it truly reduces complexity.
76
- - **Pause →** Would this refactor just **move** lines between files?
77
-
78
- ### 6) Report
79
-
80
- 1. **Scope** — staged/unstaged; extra context paths read; cluster list when subagents were used.
81
- 2. **Architecture** — title, evidence (`path:line`), candidate, why weaker.
82
- 3. **Simplification** — title, evidence, candidate, benefit.
83
- 4. **Residual uncertainty** — hypotheses / follow-up checks.
84
-
85
- If nothing actionable: `No actionable abstraction or simplification finding identified`.
86
-
87
- ## Sample hints
88
-
89
- - **Staged only**: User ran `git add -p` → findings tagged **staged** vs **unstaged** separately.
90
- - **Rename-heavy**: Read old→new path mapping before calling “duplication.”
91
- - **Tiny diff**: One-file guard clause → architecture section may be empty; reviewed inline without subagents.
92
- - **Wide refactor across packages**: cluster by package; one read-only subagent per package; dedupe duplicated-helper findings on the main agent.
93
-
94
- ## References
95
-
96
- - Downstream consumers (e.g. `commit-and-push`, `version-release`, `review-spec-related-changes`) decide independently when to add security or edge-case passes; this skill no longer wires them.
7
+ ## 目標
8
+ 輸出一份針對活躍變更集的審查報告,聚焦真正有價值的架構問題與可維護性簡化機會,而不是風格雜訊。報告需要標明審查範圍、staged/unstaged 狀態、已確認的架構問題、已確認的簡化建議,以及剩餘不確定性。
9
+
10
+ ## 驗收條件
11
+ - 已完整覆蓋本次活躍變更集;若 staged 與 unstaged 同時存在,必須明確區分哪些發現命中哪一部分。
12
+ - 每個發現都基於完整 diff 與最小必要上下文,並附帶 `path:line` 證據;不得只靠對話記憶、作者意圖或主觀風格偏好下結論。
13
+ - 架構與責任邊界問題優先於 style-only 建議;抽象必須能消除重複、釐清歸屬或穩定邊界。
14
+ - 簡化建議必須是行為等價且真正降低複雜度的改動,不能只是把複雜度搬到別處。
15
+ - 對於跨多檔、多模組或大變更,應按 coherent scope cluster 使用只讀 subagent;主代理只負責聚合、去重與整理,不重讀已委派檔案。
16
+ - 若沒有可操作發現,最終需明確輸出 `No actionable abstraction or simplification finding identified`。
17
+
18
+ ## 工作流程
19
+ 1. 檢查 git 狀態。
20
+ - 先確認 `git status`、staged diff unstaged diff,避免只審其中一半。
21
+ - 若目前沒有活躍變更集,直接輸出 `No active git change set to review`。
22
+ 2. 決定閱讀策略。
23
+ - 單檔或很小的同模組變更可直接 inline 審查。
24
+ - 多檔、多模組或跨層變更需先按功能、套件、層級或邏輯關切點切成 scope cluster,並優先以一個只讀 subagent 對應一個 cluster。
25
+ 3. 建立基線並收斂上下文。
26
+ - Inline 路徑下,讀完整個變更檔案與最小必要的 caller、callee、配置。
27
+ - Subagent 路徑下,等待所有 cluster 結果返回,再根據共享邊界與 outbound concerns 做去重。
28
+ - 所有判斷都必須回到代碼、測試、配置與可觀察行為本身。
29
+ 4. 先做架構審查。
30
+ - 只報告有明確證據支撐的問題,例如跨層洩漏、重複工作流、錯誤 helper 歸屬、重複條件樹、脆弱介面或責任模糊。
31
+ - 每條架構發現都要指出候選抽象或責任落點,以及當前寫法為何更弱。
32
+ 5. 再做簡化審查。
33
+ - 只在確定不改變行為的前提下,指出多餘分支、包裝層、深巢狀、重複驗證、過大函式或歷史相容殘骸。
34
+ - 若建議只是把複雜度移位,則不應作為有效簡化發現。
35
+ 6. 輸出報告。
36
+ - 先交代審查範圍、staged/unstaged 區分、補讀的上下文與 cluster 情況。
37
+ - 再依序輸出架構發現、簡化發現與剩餘不確定性。
38
+
39
+ ## 使用範例
40
+ - 「幫我 review 這次 branch 的變更」-> 先完整覆蓋 staged unstaged diff,再按架構問題與簡化機會輸出報告。
41
+ - 「我想知道這次重構有沒有真正變簡單」-> 聚焦行為等價的簡化空間,而不是風格偏好。
42
+ - 「這次改動跨很多 package,請不要漏看邊界」-> 先按 package 或邏輯責任分 cluster,用只讀 subagent 分治後再由主代理去重彙總。
43
+ - 「如果沒有值得改的地方,直接講沒有」-> 若無可操作發現,明確輸出 `No actionable abstraction or simplification finding identified`。
44
+
45
+ ## 參考資料索引
46
+ - 下游工作流如 `commit-and-push`、`version-release`、`review-spec-related-changes` 會自行決定是否追加安全或邊界情況審查;本技能只負責變更集的架構與簡化分析。
@@ -1,103 +1,46 @@
1
1
  ---
2
2
  name: review-codebases
3
- description: Repository-wide code review workflow that requires reading the full codebase before judging, prioritizes architecture findings over implementation details, and publishes one GitHub issue per confirmed finding through open-github-issue. Use when users ask for a code review, repository audit, architecture review, maintainability review, or complete codebase inspection.
3
+ description: >-
4
+ 面向整個倉庫的只讀代碼審查技能。要求先讀完整個人類編寫的repo,再按「架構 → 代碼品質 → 邊界情況」的優先順序做判斷;一旦在更高層級發現已確認問題,就停止下探。若需要對外追蹤,為每個已確認且非重複的發現建立 GitHub issue,否則至少輸出可直接發布的草稿內容。
4
5
  ---
5
6
 
6
- # Review Codebases
7
-
8
- ## Dependencies
9
-
10
- - Required: none.
11
- - Conditional: `read-github-issue` when issue publication requires duplicate checks; `open-github-issue` when confirmed findings should be tracked as GitHub issues.
12
- - Optional: none.
13
- - Fallback: If publication is needed and `open-github-issue` is unavailable, return draft issue bodies instead of inventing another publisher.
14
-
15
- ## Standards
16
-
17
- - Evidence: Read the full human-authored repository before judging and cite concrete files for every finding.
18
- - Execution: Review architecture first, code quality second, and edge cases last, stopping when a higher-priority tier has confirmed findings.
19
- - Quality: Prefer root-cause findings over scattered symptoms, merge duplicates, and keep hypotheses out of published results.
20
- - Output: Return coverage, review tier reached, confirmed findings, publication status, and deferred lower-tier follow-up.
21
-
22
- ## Core rules
23
-
24
- - Read the full repository before judging any design or implementation choice.
25
- - Inspect every human-authored file that affects behavior: source code, tests, build scripts, configuration, migrations, and key docs.
26
- - For generated, vendored, or snapshot files, verify what they are first; exclude them from deep review only when that status is clear, and list those exclusions explicitly.
27
- - Do not speculate. Every finding must cite concrete files and causal reasoning.
28
- - Prefer root-cause findings over scattered symptoms or style nits.
29
- - Merge duplicate symptoms into one finding when they come from the same underlying issue.
30
-
31
- ## Workflow
32
-
33
- 1. Map the repository
34
- - List top-level directories and identify entrypoints, domain modules, test suites, configuration, scripts, and generated/vendor areas.
35
- - Record any files or folders excluded from deep review and why.
36
- 2. Read the whole codebase
37
- - Read all relevant human-authored files end to end.
38
- - Build a repository-wide model of boundaries, data flow, ownership, invariants, and failure handling.
39
- 3. Review architecture first
40
- - Check module boundaries, layering, hidden coupling, circular dependencies, duplicated workflows, leaky abstractions, ownership confusion, and inconsistent domain models.
41
- - If any confirmed architecture findings exist, stop the lower-level review and report only architecture findings.
42
- 4. Review code quality second
43
- - Run this step only when there are no architecture findings.
44
- - Check readability, duplication, dead code, error handling, unsafe state changes, unclear contracts, missing tests around critical logic, and maintainability risks.
45
- - If any confirmed code-quality findings exist, stop before edge-case review and report only these findings.
46
- 5. Review edge cases last
47
- - Run this step only when there are no architecture or code-quality findings.
48
- - Check null or empty inputs, boundary values, partial failures, retries, concurrency, ordering assumptions, idempotency, and invalid state transitions.
49
- 6. Check for duplicate issues before publication
50
- - When findings will be published, use `read-github-issue` to search the target repository for open and recently closed issues that match the same module, failure mode, or architectural boundary.
51
- - Treat an existing issue as a duplicate when the underlying root cause, affected boundary, and requested outcome materially overlap, even if the wording differs.
52
- - If a duplicate exists, cite it in the final report and do not publish a new issue for that finding.
53
- 7. Publish each confirmed non-duplicate finding
54
- - Invoke `open-github-issue` once per finding.
55
- - Use a tier-specific title prefix:
56
- - `[Architecture] <short finding>`
57
- - `[Code Quality] <short finding>`
58
- - `[Edge Case] <short finding>`
59
- - Pass these fields to the dependency skill:
60
- - `title`
61
- - `problem-description`: symptom, impact, and repository evidence
62
- - `suspected-cause`: file references, causal chain, and confidence
63
- - `reproduction`: concrete trigger or conditions when known; otherwise leave empty
64
- - `repo`: target repository in `owner/repo` format when known
65
- - If invoking the publisher CLI directly, pass finding details through `apltk open-github-issue --payload-file <json>` or `@file` inputs rather than inline shell arguments so code snippets and backticks survive unchanged.
66
-
67
- ## Evidence standard
68
-
69
- Each finding must include:
70
-
71
- - affected files or modules
72
- - why the current design or code is problematic
73
- - impact on correctness, maintenance, performance, or future change safety
74
- - confidence level with a short reason
75
-
76
- If evidence is incomplete, keep it as a hypothesis and do not publish a GitHub issue for it.
77
-
78
- ## Output format
79
-
80
- Use this structure in responses:
81
-
82
- 1. Codebase coverage
83
- - reviewed areas
84
- - explicit exclusions
85
- 2. Review tier reached
86
- - architecture / code quality / edge cases
87
- - why lower tiers were skipped, if applicable
88
- 3. Confirmed findings
89
- - title
90
- - affected files
91
- - evidence and reasoning
92
- - impact
93
- - confidence
94
- 4. GitHub issue publication status
95
- - duplicate-check status and any matching existing issue URLs
96
- - publication mode (`gh-cli` / `github-token` / `draft-only`)
97
- - created issue URL or draft output per finding
98
- 5. Deferred follow-up
99
- - list lower-tier checks that were intentionally not performed because a higher-tier issue already exists
100
-
101
- ## Resources
102
-
103
- - Dependency skill: `open-github-issue` for deterministic GitHub issue publication with auth fallback and README language detection.
7
+ ## 目標
8
+ 輸出一份面向整個倉庫的審查報告,先交付最有價值的根因級問題,而不是零散表象。報告需要說明覆蓋範圍、實際審查到的層級、已確認發現、是否已檢查重複 issue、是否已發布 issue,以及因高優先級問題而延後的後續檢查。
9
+
10
+ ## 驗收條件
11
+ - 在做任何設計或實作判斷前,已完整閱讀所有會影響行為的人類編寫檔案,包括原始碼、測試、配置、建置腳本、遷移與關鍵文檔。
12
+ - 對生成檔、vendor 檔與 snapshot 檔先確認其性質;只有在性質明確時才可排除深讀,且必須在報告中明確列出排除項與原因。
13
+ - 每個發現都附帶具體檔案與因果說明,不做無證據推測;同一根因導致的多個症狀必須合併成一條發現。
14
+ - 審查順序固定為「架構 代碼品質 邊界情況」;若在較高層級已確認問題,必須停止更低層級審查並在報告中說明原因。
15
+ - 若需要發布 issue,必須先做重複檢查;每個已確認且非重複的發現都要有發布結果,若無法發布則提供可直接使用的草稿內容。
16
+ - 最終交付物必須包含覆蓋範圍、審查層級、已確認發現、issue 發布狀態與延後檢查項。
17
+
18
+ ## 工作流程
19
+ 1. 映射倉庫。
20
+ - 先識別頂層目錄、入口點、核心模組、測試區、配置、腳本與疑似生成/vendor 區域。
21
+ - 同時記錄哪些內容會被排除深讀,以及排除理由。
22
+ 2. 完整閱讀repo。
23
+ - 逐個讀完所有相關的人類編寫檔案。
24
+ - 建立全倉視角的模組邊界、資料流、責任歸屬、不變式與失敗處理模型。
25
+ 3. 先做架構審查。
26
+ - 優先尋找模組邊界錯位、跨層洩漏、循環依賴、重複工作流、抽象滲漏、責任混亂與領域模型不一致。
27
+ - 若已確認任何架構問題,直接停止後續較低層級審查,專注輸出架構發現。
28
+ 4. 若架構層沒有問題,再做代碼品質審查。
29
+ - 檢查可讀性、重複代碼、死碼、錯誤處理、危險狀態變更、契約不清與關鍵邏輯缺少測試保護等問題。
30
+ - 若已確認任何代碼品質問題,停止邊界情況審查。
31
+ 5. 僅在前兩層都沒有問題時,才審查邊界情況。
32
+ - 檢查空值、邊界值、部分失敗、重試、併發、順序假設、冪等性與非法狀態轉移。
33
+ 6. 需要發布時,先做重複檢查再逐條發布。
34
+ - 使用 `read-github-issue` 檢查是否已有相同根因、相同邊界或相同結果導向的 open / recently closed issue。
35
+ - 對每個已確認且非重複的發現,使用 `open-github-issue` 發布;若發布依賴不可用,改為返回對應 issue 草稿。
36
+ - issue 標題前綴遵循審查層級,例如 `[Architecture]`、`[Code Quality]`、`[Edge Case]`。
37
+
38
+ ## 使用範例
39
+ - 「幫我做一次整倉 code review」-> 先讀完整個人類編寫的repo,再按架構、代碼品質、邊界情況的順序輸出審查報告。
40
+ - 「幫我做 maintainability audit,找到最值得開 issue 的問題」-> 聚焦根因級問題,必要時先做 duplicate check,再為每個非重複發現準備或發布 issue。
41
+ - 「請做 architecture review,不要陷入 style nit」-> 先完成全倉閱讀,只報告有明確邊界與責任證據的架構問題。
42
+ - 「如果 issue 發布不了,也要把內容整理好」-> 仍然完成重複檢查,並輸出可直接發布的 issue 草稿,而不是臨時改用其他未定義發佈方式。
43
+
44
+ ## 參考資料索引
45
+ - `read-github-issue`:在發布前檢查目標倉庫中是否已存在相同根因的 issue,避免重複建單。
46
+ - `open-github-issue`:為每個已確認且非重複的發現建立 GitHub issue;若不可用,則返回 issue 草稿內容。
@@ -1,82 +1,47 @@
1
1
  ---
2
2
  name: review-spec-related-changes
3
3
  description: >-
4
- Read-only spec compliance vs governing docs/plans: score every business requirement Met/Partial/Not-met from code/tests/commands—checked `tasks.md` boxes never count; ambiguity between two plan roots halts execution; on code-bearing diffs run **`review-change-set`**, **`discover-edge-cases`**, **`discover-security-issues`** on the same scope afterward — **prefer one read-only subagent per secondary skill in parallel** so the main agent aggregates without re-reading. Independent requirement clusters may also be scored by parallel read-only subagents.
5
- Use for “does this PR satisfy coordination.md + spec.md R2?” or a user-pinned `{change}` folder.
6
- Do not mutate repos, bury missing goals, skip the tertiary bundle on code-bearing diffs, or rest on intent without evidence; FORBIDDEN to lead with refactor comments while R1 is failing. GOOD: pair every Not-met cite with a `spec.md` ref + concrete path:test gap.
4
+ 面向spec合規性的只讀審查技能。先唯一確定本次變更受哪一套 `docs/plans/...` 規劃文件約束,再按業務目標逐條判定 `Met`、`Partially met`、`Not met` `Deferred/N/A`;`tasks.md` 的勾選不算證據。若範圍涉及代碼實作,完成業務結論後還必須對同一範圍追加 `review-change-set`、`discover-edge-cases` 與 `discover-security-issues`,並保持固定報告順序。
7
5
  ---
8
6
 
9
- # Review Spec Related Changes
10
-
11
- ## Dependencies
12
-
13
- - Required: `review-change-set`, `discover-edge-cases`, and `discover-security-issues` whenever the scope includes **code-affecting** implementation to assess.
14
- - Conditional: none.
15
- - Optional: none.
16
- - Fallback: If any required dependency is unavailable for a **code-affecting** review, **MUST** stop and report the gap. **MUST NOT** emit a “full pass” verdict without those three passes when code is in scope.
17
-
18
- ## Non-negotiables
19
-
20
- - **MUST NOT** edit implementation code, tests, or planning docs during this skill (read-only review).
21
- - **MUST NOT** archive specs, commit, push, tag, or release from this skill.
22
- - **MUST** resolve which spec set governs the change **before** concluding; if multiple candidates fit equally and cannot be disambiguated from repo evidence, **MUST** stop and report ambiguity—**MUST NOT** guess.
23
- - **MUST** classify each business goal / acceptance item as `Met`, `Partially met`, `Not met`, or `Deferred/N/A` **only** using verifiable evidence (code, tests, commands, traces)—checked boxes in `tasks.md` are **not** proof by themselves.
24
- - **MUST** treat **unmet or partially met required business goals** as **highest severity**. **MUST NOT** let edge-case, security, or style findings **outrank** those gaps in the reported order or implied priority.
25
- - **MUST** finish the business-goal verdict **before** invoking secondary skills; **MUST** still run `review-change-set`, `discover-edge-cases`, and `discover-security-issues` on the **same** implementation scope when code is involved (after step 1 verdict is written).
26
- - **SHOULD** parallelize the secondary reviews when code is involved by dispatching **one read-only subagent per secondary skill** (one for `review-change-set`, one for `discover-edge-cases`, one for `discover-security-issues`). Each subagent receives the same diff scope, follows that skill’s own SKILL.md, and returns ONLY its structured findings; the main agent aggregates them in the fixed report order without re-running the underlying analysis. Single-file or trivial diffs may be reviewed inline without subagents.
27
- - For business-goal scoring itself, **MAY** parallelize by dispatching one read-only subagent per **independent requirement cluster** (requirements that share no owned paths and no shared spec section), each returning Met/Partial/Not-met with cited evidence. The main agent owns final ordering, severity, and any cross-requirement reconciliation. Tightly coupled requirements stay on the main agent.
28
- - **MUST NOT** rest conclusions on author intent, branch names, or chat memory unless **repository evidence** agrees.
29
- - **MUST NOT** let subagents mutate repositories, archive specs, or commit — every dispatched subagent runs in **read-only** mode.
30
- - Prefer **fewer confirmed findings** over broad speculation; unproven items belong under **Residual uncertainty**, not as faux defects.
31
-
32
- ## Standards (summary)
33
-
34
- - **Evidence**: Full read of governing docs + minimal code/diff context + spec-named verification commands when safe to run.
35
- - **Execution**: Scope resolution → business compliance (optionally fanned out by independent requirement cluster) → parallel secondary reviews via per-skill read-only subagents → aggregated ordered report.
36
- - **Quality**: Business-first severity; secondary findings separated unless they also block an acceptance criterion; subagent reports stay strictly within their assigned skill’s scope.
37
- - **Output**: Ordered list: business gaps → edge cases → security → code review → passing summary → residual uncertainty.
38
-
39
- ## Scope resolution
40
-
41
- **Chain-of-thought:** Before **`Workflow`**, answer **`Pause →`** for the governing spec you will use; equally plausible paths without disambiguation ⇒ **stop**.
42
-
43
- **User-named path** — Read `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and batch `coordination.md` when present unless the user narrowed the list. Treat as authoritative unless the user pointed at a **newer** superseding plan. Map implementation via tasks, owned paths, diff, branch, commits.
44
- - **Pause →** Did the user give a **filesystem path** or only a nickname that could map to multiple `docs/plans/...` trees?
45
- - **Pause →** For each major business verdict later, what **exact** spec heading or requirement ID will I cite?
46
-
47
- **User did not name a spec** — Inspect `git status -sb`, `git diff --name-only`, `git diff --cached --name-only`; search `docs/plans/`, `docs/archive/plans/`, or repo-documented plan dirs. If no plan file moved, infer from recent commits and plausible plan dirs; **if still ambiguous, stop** (see Non-negotiables).
48
- - **Pause →** What **three** independent clues tie this implementation to **one** plan—not chat memory alone?
49
- - **Pause →** If I withheld the conversation transcript, could another reviewer replicate my chosen spec folder from repo evidence?
50
-
51
- ## Workflow
52
-
53
- **Chain-of-thought:** Answer **`Pause →`** after **each** step before moving down the list or calling dependent skills.
54
-
55
- 1. **Spec baseline** — Read governing docs end-to-end. Extract goals, acceptance criteria, non-goals, deferrals, required verifications. Build a compact claim list provable from repo evidence. Keep “what the product must do” separate from “how clean the code is.”
56
- - **Pause →** Which items are **mandatory** acceptance vs explicitly **out of scope** or deferred?
57
- - **Pause →** What observable failure would make me change a `Met` to `Not met` for the top risk requirement?
58
-
59
- 2. **Implementation evidence** — Read the relevant diff/staged/commits/files. Trace the minimum code path to validate claims. Run spec-named checks when available and safe. When the spec contains **independent requirement clusters** (disjoint owned paths, disjoint spec sections), **MAY** dispatch one read-only subagent per cluster to score Met/Partial/Not-met with cited evidence; the main agent reconciles cross-requirement effects and owns the final verdict ordering. Tightly coupled requirements stay on the main agent.
60
- - **Pause →** What is the **smallest** code path I have not yet read that could still falsify a `Met`?
61
- - **Pause →** Am I about to score `Met` from **intent** or from **tests/commands** I actually ran or inspected?
62
- - **Pause →** If I clustered, is every cluster genuinely disjoint, or am I about to lose a cross-requirement contradiction by running them in isolation?
63
-
64
- 3. **Business-goal verdict first** — Emit every `Not met` / `Partially met` **before** secondary findings, with **exact** spec cites and code/test evidence. While required goals stay failed, **MUST NOT** frame archival, release, or “done” narratives that imply compliance.
65
- - **Pause →** If I sorted findings by “interesting” instead of business impact, which line would unfairly rise above a missing goal?
66
- - **Pause →** For each `Partially met`, what single **missing proof** (test, wire-up, error path) am I naming explicitly?
67
-
68
- 4. **Secondary reviews (code-affecting)** — On the same scope: `review-change-set` (architecture/simplification), `discover-edge-cases` (reproducible edge/observability risks), `discover-security-issues` (reproducible security). **Prefer dispatching one read-only subagent per skill in parallel** so each runs in its own context with the full SKILL.md it owns; hand each subagent the same diff scope and the structured-report contract from that skill. The main agent waits for every subagent to return, then keeps outputs labeled so they do not read as business-goal substitutions. Trivial single-file diffs may run inline without subagents. The main agent **MUST NOT** re-run a secondary skill it already delegated, and subagents **MUST NOT** mutate the repository.
69
- - **Pause →** Does this secondary finding **force** a business re-score—if yes, did I revise step 3 before publishing?
70
- - **Pause →** Is the diff scope identical to what I used for business mapping (no silent file creep)?
71
- - **Pause →** Did every dispatched secondary subagent return — or am I about to publish from partial summaries?
72
-
73
- 5. **Final report (fixed order)** — (1) Business-goal failures (always top severity for required gaps). (2) Edge-case. (3) Security. (4) Code-review / maintainability. (5) Passing evidence for goals confirmed `Met`. (6) Residual uncertainty (skipped commands, unmapped spec text, unverifiable externals). If nothing actionable: state that explicitly **and** still cite docs and evidence reviewed.
74
- - **Pause →** What commands or spec paragraphs remain **unverified**—are they all listed under residual uncertainty?
75
-
76
- ## Sample hints
77
-
78
- - **Business claim record**:
79
- - `R3.2 refresh token rotation` → `Not met` — spec `spec.md` §3.2 requires one-time use; `src/auth/refresh.rs:40` still accepts same jti on replay; test `refresh_replay` not present.
80
- - **Wrong ordering** — starting with “nice simplification in `foo.ts`” while `R1.0` is unmet: **wrong**; lead with the `R1.0` gap.
81
- - **Tasks checked but behavior missing** — `tasks.md` shows `[x] implement rate limit` but no call site in `src/api/*` and no test: verdict stays **`Not met` / `Partially met`**, not `Met`.
82
- - **Ambiguous scope** — two directories `docs/plans/2026-05-01/foo/` and `…/batch-a/foo/` both plausible; **stop** with “need user to name path” instead of picking one.
7
+ ## 目標
8
+ 輸出一份只讀的spec合規審查報告,先回答「這次變更是否真的滿足規劃中的業務要求」,再補充邊界、安全與代碼審查發現。報告需要對每條關鍵需求給出可追溯的狀態判定、證據來源、缺口說明、通過證據與剩餘不確定性;本技能不負責修改代碼或更新規劃文件。
9
+
10
+ ## 驗收條件
11
+ - 在給出任何合規結論前,已唯一確定 governing spec;若存在兩個同樣合理的規劃根目錄且無法由倉庫證據消歧,必須停止並報告歧義,不能猜測。
12
+ - 每條業務目標或驗收項只能根據可驗證證據判定為 `Met`、`Partially met`、`Not met` 或 `Deferred/N/A`;證據可來自代碼、測試、命令、日誌或追蹤,`tasks.md` 勾選本身不算證據。
13
+ - 未滿足或部分滿足的必選業務要求永遠是最高嚴重度,報告排序中不得被安全、邊界或可維護性意見壓過。
14
+ - 若範圍涉及代碼實作,完成業務結論後必須在同一範圍追加 `review-change-set`、`discover-edge-cases` `discover-security-issues`;任一依賴不可用時,不得輸出「完整通過」結論。
15
+ - 全流程保持只讀:不得修改實作、測試、spec、archive、commit、push、tag 或 release。
16
+ - 最終交付物固定按以下順序輸出:業務缺口 → 邊界情況 → 安全問題 → 代碼審查問題 → 已滿足要求的通過證據 → 剩餘不確定性。
17
+
18
+ ## 工作流程
19
+ 1. 確定 governing spec。
20
+ - 若使用者已指定具體路徑,直接以該規劃目錄為準,閱讀 `spec.md`、`tasks.md`、`checklist.md`、`contract.md`、`design.md`,以及存在時的 `coordination.md`。
21
+ - 若使用者未指定,需根據 `git status`、diff、相關路徑、近期提交與計劃目錄證據回推出唯一 spec;若仍有歧義,立即停止。
22
+ 2. 建立spec基線。
23
+ - governing spec 中抽取業務目標、驗收條件、非目標、已明示的延期項與要求執行的驗證。
24
+ - 將「產品必須做到什麼」和「代碼寫得是否漂亮」明確分開。
25
+ 3. 蒐集實作證據並先做業務判定。
26
+ - 閱讀最小必要代碼路徑、相關 diff、提交與測試,必要時執行 spec 點名且安全可跑的驗證命令。
27
+ - 對每條需求給出 `Met`、`Partially met`、`Not met` `Deferred/N/A`,並附上精確 spec 引用與代碼/測試證據。
28
+ - spec 中存在完全獨立的需求群組,可用只讀 subagent 並行評分;但最終排序、嚴重度與跨需求衝突整理由主代理負責。
29
+ 4. 對代碼範圍追加次級審查。
30
+ - 若審查對象包含代碼實作,必須在同一範圍追加 `review-change-set`、`discover-edge-cases` 與 `discover-security-issues`。
31
+ - 優先以一個只讀 subagent 對應一個次級技能並行執行,主代理只負責聚合結果,不重跑已委派分析。
32
+ - 若次級審查結果反過來影響某條業務需求的判定,必須先回寫業務結論,再輸出最終報告。
33
+ 5. 生成固定順序的最終報告。
34
+ - 先列出 `Not met` `Partially met` 的業務缺口,再依序列出邊界情況、安全問題、代碼審查問題。
35
+ - 接著補上所有已確認 `Met` 的通過證據。
36
+ - 最後列出未驗證命令、無法映射的 spec 段落、外部依賴不可驗證處與其他剩餘不確定性。
37
+
38
+ ## 使用範例
39
+ - 「這個 PR 有沒有滿足 `coordination.md` `spec.md`?」-> 先唯一確定 governing spec,再按業務要求逐條打分,最後補上同範圍的邊界、安全與變更集審查。
40
+ - 「請檢查 `docs/plans/2026-05-01/foo/` 對應的實作是否完成」-> 直接以指定目錄為準做只讀合規審查,不依賴聊天上下文猜測。
41
+ - 「`tasks.md` 都打勾了,應該算完成吧?」-> 不能直接採信,仍需用代碼、測試、命令或追蹤證據重新驗證每條要求。
42
+ - 「先跟我講哪個 requirement 沒達成,再看程式碼好不好」-> 報告必須先輸出業務缺口,不能先用重構或風格意見掩蓋未滿足的spec要求。
43
+
44
+ ## 參考資料索引
45
+ - `review-change-set`:在相同代碼範圍上補做架構與簡化審查,避免將spec合規與代碼品質混為一談。
46
+ - `discover-edge-cases`:在相同範圍上補做可重現邊界情況審查,補齊失敗路徑、併發與可觀測性風險。
47
+ - `discover-security-issues`:在相同範圍上補做可重現安全審查,補齊攻擊面、授權與資料外洩風險。
@@ -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: