@laitszkin/apollo-toolkit 5.0.2 → 5.0.4
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 +25 -0
- package/package.json +2 -2
- package/skills/commit/SKILL.md +6 -1
- package/skills/design/SKILL.md +93 -44
- package/skills/design/assets/templates/CHECKLIST.md +8 -0
- package/skills/design/assets/templates/DESIGN.md +8 -0
- package/skills/design/references/codegraph.md +41 -0
- package/skills/docs-project/SKILL.md +23 -6
- package/skills/fix/SKILL.md +1 -1
- package/skills/implement/SKILL.md +1 -1
- package/skills/init-project-html/SKILL.md +12 -15
- package/skills/init-project-html/references/codegraph.md +41 -0
- package/skills/maintain-project-constraints/SKILL.md +10 -0
- package/skills/maintain-project-constraints/references/constraint-file-reference.md +2 -0
- package/skills/plan/SKILL.md +30 -17
- package/skills/plan/assets/templates/PROMPT.md +22 -51
- package/skills/qa/SKILL.md +55 -15
- package/skills/qa/assets/templates/FIX.md +25 -102
- package/skills/review/SKILL.md +1 -0
- package/skills/review/assets/templates/REPORT.md +7 -0
- package/skills/spec/SKILL.md +40 -25
- package/skills/spec/assets/templates/SPEC.md +4 -2
- package/skills/update-project-html/SKILL.md +18 -7
- package/skills/update-project-html/references/codegraph.md +41 -0
- package/skills/version-release/SKILL.md +22 -5
package/skills/spec/SKILL.md
CHANGED
|
@@ -17,33 +17,46 @@ Execution methodology (task breakdown, coordination routing) belongs to the `pla
|
|
|
17
17
|
|
|
18
18
|
- SPEC.md follows the template format strictly
|
|
19
19
|
- SPEC.md includes: clear business goal, scope (In/Out), BDD behaviors, error and edge cases, clarification questions
|
|
20
|
+
- SPEC.md References section cites key code file paths affected by the requirements
|
|
20
21
|
- High-uncertainty requirements are marked with Uncertainty Level and reflected in Clarification Questions
|
|
21
|
-
- For non-greenfield repos: subagent repo research
|
|
22
|
-
- Single spec generated at `docs/plans/<YYYY-MM-DD>/<spec_name>/SPEC.md` or batch spec generated at `docs/plans/<YYYY-MM-DD>/<batch-name>/<spec_name>/SPEC.md
|
|
22
|
+
- For non-greenfield repos: `apltk codegraph` survey completed, subagent repo research complete, and every requirement's boundary calibrated against the actual code
|
|
23
|
+
- Single spec generated at `docs/plans/<YYYY-MM-DD>/<spec_name>/SPEC.md` or batch spec generated at `docs/plans/<YYYY-MM-DD>/<batch-name>/<spec_name>/SPEC.md`
|
|
23
24
|
|
|
24
25
|
## Workflow
|
|
25
26
|
|
|
26
|
-
### 1.
|
|
27
|
+
### 1. Survey the Repo with CodeGraph
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
Before reading requirements, use `apltk codegraph` to deeply understand the repo.
|
|
30
|
+
|
|
31
|
+
**Greenfield repo (no existing code)**: Skip this step. Proceed to Step 2.
|
|
32
|
+
|
|
33
|
+
**Non-greenfield repo**:
|
|
34
|
+
|
|
35
|
+
1. Run `apltk codegraph survey --json` to get entry points, function clusters, and cross-boundary edges across the project
|
|
36
|
+
2. Use `apltk codegraph list-apis` to review API directory — function names, file paths, callers — in modules potentially affected by the requirements
|
|
37
|
+
3. Use `apltk codegraph explore` or `apltk codegraph search` to dig into specific areas of interest
|
|
29
38
|
|
|
30
|
-
|
|
39
|
+
Consult `references/codegraph.md` for detailed flags.
|
|
40
|
+
|
|
41
|
+
**Purpose of this step**: Establish code-level understanding of module boundaries, existing APIs, and data structures BEFORE reading requirements. This ensures every BDD requirement is scoped correctly against real code.
|
|
42
|
+
|
|
43
|
+
### 2. Read PROPOSAL.md and Understand Requirements
|
|
44
|
+
|
|
45
|
+
Analyze the user's requirements from the PROPOSAL.md.
|
|
31
46
|
|
|
32
|
-
**
|
|
47
|
+
**Bridge from Step 1**: Compare codegraph findings against PROPOSAL.md. If the actual code contradicts or constrains what PROPOSAL.md describes, note these calibrations explicitly — they represent the core value the spec skill adds over simple template filling.
|
|
33
48
|
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- Existing features that overlap or conflict with the requirements
|
|
40
|
-
- Document findings for the next step
|
|
49
|
+
For complex repos, dispatch multiple subagents in parallel to deeply investigate:
|
|
50
|
+
- Affected modules and their responsibility boundaries
|
|
51
|
+
- Existing data structures and persistence patterns
|
|
52
|
+
- Existing API contracts and call relationships
|
|
53
|
+
- Existing features that overlap or conflict with the requirements
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
Document findings for the next step.
|
|
43
56
|
|
|
44
|
-
###
|
|
57
|
+
### 3. Refine, Combine, Split Requirements into BDD
|
|
45
58
|
|
|
46
|
-
Transform requirements into clearly-bounded BDD business requirements (GIVEN/WHEN/THEN). Use your
|
|
59
|
+
Transform requirements into clearly-bounded BDD business requirements (GIVEN/WHEN/THEN). Use your codegraph findings from Step 1 and research from Step 2 to correctly scope each requirement.
|
|
47
60
|
|
|
48
61
|
Process:
|
|
49
62
|
- **Refine**: Convert vague descriptions into precise BDD behavior statements
|
|
@@ -78,7 +91,7 @@ Define:
|
|
|
78
91
|
|
|
79
92
|
If a requirement remains unclear after research and it affects scope definition, record it and wait for the user's answer before proceeding.
|
|
80
93
|
|
|
81
|
-
###
|
|
94
|
+
### 4. Generate SPEC.md
|
|
82
95
|
|
|
83
96
|
Generate SPEC.md using the template at `assets/templates/SPEC.md`.
|
|
84
97
|
|
|
@@ -91,12 +104,12 @@ Generate SPEC.md using the template at `assets/templates/SPEC.md`.
|
|
|
91
104
|
|
|
92
105
|
2. Fill in each section of the generated template:
|
|
93
106
|
- **Goal** → One sentence from the PROPOSAL.md's Problem Statement and your research context. State the business goal, not the implementation.
|
|
94
|
-
- **Scope (In/Out)** → Directly from Step
|
|
95
|
-
- **Functional Behaviors** → One BDD block per requirement from Step
|
|
107
|
+
- **Scope (In/Out)** → Directly from Step 3. Be precise: ambiguous boundaries cause scope creep.
|
|
108
|
+
- **Functional Behaviors** → One BDD block per requirement from Step 3.
|
|
96
109
|
- **Uncertainty Level** → Per requirement, mark Known or Exploratory.
|
|
97
|
-
- **Error and Edge Cases** → List specific cases. Free-form list; no fixed categories needed in the template (the five categories from Step
|
|
110
|
+
- **Error and Edge Cases** → List specific cases. Free-form list; no fixed categories needed in the template (the five categories from Step 3 guide your thinking, not the output format).
|
|
98
111
|
- **Clarification Questions** → List questions for the user. Must be populated when any requirement is Exploratory. Omit only if all requirements are fully clear.
|
|
99
|
-
- **References** →
|
|
112
|
+
- **References** → Cite key code file paths affected by the requirements, plus project context files and official docs. The code file paths serve as traceability anchors linking requirements to actual code.
|
|
100
113
|
|
|
101
114
|
**BDD writing guidelines**:
|
|
102
115
|
- **GIVEN** states the precondition and actor role
|
|
@@ -108,22 +121,24 @@ Generate SPEC.md using the template at `assets/templates/SPEC.md`.
|
|
|
108
121
|
|
|
109
122
|
3. If creating a batch spec, repeat the template-filling process for each group of requirements, producing one SPEC.md per group.
|
|
110
123
|
|
|
111
|
-
###
|
|
124
|
+
### 5. Pre-delivery Verification
|
|
112
125
|
|
|
113
126
|
Before delivering, verify all of the following. Fix any issues found before proceeding.
|
|
114
127
|
|
|
115
128
|
- **BDD verifiability**: Every requirement has a clear verification condition — THEN is observable and specific, not vague or qualitative
|
|
116
129
|
- **Scope clarity**: In Scope and Out of Scope are unambiguous and do not overlap
|
|
117
|
-
- **Error case completeness**: All five categories from Step
|
|
130
|
+
- **Error case completeness**: All five categories from Step 3 are substantively covered (individual cases, not category names)
|
|
118
131
|
- **Uncertainty reflected**: High-uncertainty requirements are marked Exploratory AND mentioned in Clarification Questions
|
|
119
132
|
- **Internal consistency**: No contradictions or overlaps between requirements
|
|
133
|
+
- **Code traceability**: References section cites specific code file paths that each requirement maps to
|
|
134
|
+
- **CodeGraph data used**: Boundary scoping decisions reference codegraph findings (what exists vs what needs to be built)
|
|
120
135
|
|
|
121
136
|
Only deliver SPEC.md to the user after passing self-review.
|
|
122
137
|
|
|
123
138
|
## Examples
|
|
124
139
|
|
|
125
|
-
- "Build a web-based Texas Hold'em game" →
|
|
126
|
-
- "Rewrite the user system: register, login, permissions, password reset, 2FA, session management" →
|
|
140
|
+
- "Build a web-based Texas Hold'em game" → CodeGraph survey to check for existing game engine → 4 BDD items (deal, bet, judge, chips). ≤5, single SPEC.md. → References cite game engine code paths
|
|
141
|
+
- "Rewrite the user system: register, login, permissions, password reset, 2FA, session management" → CodeGraph survey of existing auth modules → 6 BDD items. >5, batch spec: Auth spec (register, login, password reset — 3 items) and Security spec (permissions, 2FA, sessions — 3 items). → References cite auth module code paths
|
|
127
142
|
|
|
128
143
|
## References
|
|
129
144
|
|
|
@@ -44,7 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
## References
|
|
46
46
|
|
|
47
|
+
- **Key code file paths** (affected by this spec):
|
|
48
|
+
- [File path — e.g., `src/auth/login.ts`]
|
|
47
49
|
- Official docs:
|
|
48
50
|
- [Link or document]
|
|
49
|
-
- Related
|
|
50
|
-
- [File path]
|
|
51
|
+
- Related project context files:
|
|
52
|
+
- [File path — e.g., `CLAUDE.md`, `AGENTS.md`]
|
|
@@ -17,14 +17,24 @@ Keep the architecture diagram continuously aligned with the actual codebase.
|
|
|
17
17
|
|
|
18
18
|
## Workflow
|
|
19
19
|
|
|
20
|
-
### 1.
|
|
20
|
+
### 1. Analyze current code with `apltk codegraph survey`
|
|
21
|
+
|
|
22
|
+
**Prerequisite** before measuring drift. The code graph provides the structural baseline for comparison with the atlas.
|
|
23
|
+
|
|
24
|
+
Run `apltk codegraph survey --json` to get a structured view of the current codebase:
|
|
25
|
+
- Entry points, function clusters, and suggested submodule groupings
|
|
26
|
+
- Cross-boundary edges for identifying architectural relationships
|
|
27
|
+
|
|
28
|
+
Consult `references/codegraph.md` for detailed flags.
|
|
29
|
+
|
|
30
|
+
### 2. Review the current atlas
|
|
21
31
|
|
|
22
32
|
Read the existing architecture diagram.
|
|
23
33
|
Capture the relationship between features and submodules.
|
|
24
34
|
|
|
25
35
|
> Read only `atlas.index.yaml` + the YAML files of affected features. Do not read unrelated features or unchanged modules to preserve context economy.
|
|
26
36
|
|
|
27
|
-
###
|
|
37
|
+
### 3. Measure architecture drift
|
|
28
38
|
|
|
29
39
|
Before deciding the update scope, compare the atlas against the current code:
|
|
30
40
|
|
|
@@ -36,7 +46,7 @@ Determine the update strategy based on drift severity:
|
|
|
36
46
|
- **Low drift (< 20%)**: Update only the features affected by the diff
|
|
37
47
|
- **High drift (≥ 20%)**: Flag as significant divergence, notify the user and recommend a full re-initialization via `init-project-html`
|
|
38
48
|
|
|
39
|
-
###
|
|
49
|
+
### 4. Filter diff noise
|
|
40
50
|
|
|
41
51
|
Analyze the diff scope and filter non-architectural changes:
|
|
42
52
|
|
|
@@ -45,11 +55,11 @@ Analyze the diff scope and filter non-architectural changes:
|
|
|
45
55
|
|
|
46
56
|
Map the filtered diff hunks to the affected features.
|
|
47
57
|
|
|
48
|
-
###
|
|
58
|
+
### 5. Cross-reference code with the current atlas
|
|
49
59
|
|
|
50
60
|
Dispatch subagents in parallel to cross-reference the code against the architecture diagram and verify whether the atlas has errors or omissions.
|
|
51
61
|
|
|
52
|
-
###
|
|
62
|
+
### 6. Update the atlas via `apltk` CLI
|
|
53
63
|
|
|
54
64
|
Use `apltk architecture` commands to update the architecture diagram:
|
|
55
65
|
|
|
@@ -67,7 +77,7 @@ apltk architecture function add --feature <slug> --submodule <slug> --name <fn>
|
|
|
67
77
|
|
|
68
78
|
After completing the update, re-measure drift to confirm it has been reduced to an acceptable range.
|
|
69
79
|
|
|
70
|
-
###
|
|
80
|
+
### 7. Self-review
|
|
71
81
|
|
|
72
82
|
Confirm the following before finishing:
|
|
73
83
|
|
|
@@ -79,5 +89,6 @@ Confirm the following before finishing:
|
|
|
79
89
|
|
|
80
90
|
## References
|
|
81
91
|
|
|
82
|
-
- `references/
|
|
92
|
+
- `references/codegraph.md` — `apltk codegraph` CLI reference (consult for subcommand flags).
|
|
93
|
+
- `references/architecture.md` — Full parameter reference for the `apltk architecture` tool (consult when CLI flag details are needed).
|
|
83
94
|
- `references/definition.md` — Detailed definitions of feature and submodule.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# apltk codegraph — Code Intelligence CLI Reference
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Parse source code into a knowledge graph of symbols (functions, classes) and relationships (call edges), backed by a local SQLite database with FTS5 full-text search. Powered by @colbymchenry/codegraph (tree-sitter-backed code knowledge graph engine).
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
```
|
|
8
|
+
apltk codegraph <subcommand> [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Subcommands
|
|
12
|
+
|
|
13
|
+
### Lifecycle
|
|
14
|
+
|
|
15
|
+
| Subcommand | Description | Key Flags |
|
|
16
|
+
|------------|-------------|-----------|
|
|
17
|
+
| `init` | Initialize CodeGraph for the project | `--index` (run initial indexing immediately), `--json` |
|
|
18
|
+
| `sync` | Sync index with current file state (incremental) | `--json` |
|
|
19
|
+
| `status` | Show index statistics (files, nodes, edges, languages) | `--json` |
|
|
20
|
+
|
|
21
|
+
### Discovery
|
|
22
|
+
|
|
23
|
+
| Subcommand | Description | Key Flags |
|
|
24
|
+
|------------|-------------|-----------|
|
|
25
|
+
| `search <query>` | Search code graph for symbols via FTS5 | `--limit N` (default 20, max 100), `--json` |
|
|
26
|
+
| `explore <query>` | Deep-dive on a symbol — callers, callees, source | `--feature <name>`, `--json` |
|
|
27
|
+
| `survey [dir]` | Scan directory, suggest submodule groupings and edges | `--feature <name>`, `--json` |
|
|
28
|
+
| `list-apis [path]` | List public APIs in project or sub-path | `--all` (include internal symbols), `--json` |
|
|
29
|
+
|
|
30
|
+
### Validation
|
|
31
|
+
|
|
32
|
+
| Subcommand | Description | Key Flags |
|
|
33
|
+
|------------|-------------|-----------|
|
|
34
|
+
| `verify --spec <dir>` | Verify a spec overlay against actual code | `--json` |
|
|
35
|
+
|
|
36
|
+
## Common Workflows
|
|
37
|
+
|
|
38
|
+
- **Before atlas work**: `apltk codegraph init --index` (first time), then `apltk codegraph survey --json`
|
|
39
|
+
- **After code changes**: `apltk codegraph sync` to keep index current
|
|
40
|
+
- **Understanding a symbol**: `apltk codegraph explore <name>` to see callers and callees
|
|
41
|
+
- **Searching code**: `apltk codegraph search <query> --json --limit 30`
|
|
@@ -11,20 +11,37 @@ description: 協助完成自動化版本發佈。同步文檔、更新版本號
|
|
|
11
11
|
|
|
12
12
|
- `CHANGELOG.md`, `docs/` 下所有項目文檔已經被同步到最新狀態
|
|
13
13
|
- GitHub release 與 version tag 已被建立
|
|
14
|
+
- 代碼圖索引(codegraph)與實際代碼同步
|
|
15
|
+
- 若不在 default 分支,已完成分支合併流程
|
|
14
16
|
|
|
15
17
|
## 工作流程
|
|
16
18
|
|
|
17
|
-
### 1.
|
|
19
|
+
### 1. 確定發佈分支
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
檢查當前 git 分支是否為 default 分支(main 或 master):
|
|
22
|
+
- 若在 **default 分支**:直接進入步驟 2-5
|
|
23
|
+
- 若在 **非 default 分支**:按照以下流程完成版本發佈
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
#### 非 default 分支發佈流程
|
|
26
|
+
|
|
27
|
+
1. 使用 `commit` 技能提交所有待處理變更。推送到 remote。
|
|
28
|
+
2. 切換到 default 分支。將工作分支合併到 default 分支。
|
|
29
|
+
3. 在 default 分支上,按步驟 2-4 完成發佈。
|
|
30
|
+
4. 發佈完成後,切回原始的 working branch。
|
|
31
|
+
5. 與 remote default branch 同步(`git merge --ff-only origin/<default>`)。
|
|
32
|
+
6. 推送已同步的工作分支。
|
|
33
|
+
|
|
34
|
+
### 2. 同步代碼圖索引
|
|
35
|
+
|
|
36
|
+
若有代碼變更,執行 `apltk codegraph sync` 確保代碼圖與實際代碼同步。
|
|
37
|
+
若 `CLAUDE.md` 或 `AGENTS.md` 缺少 `apltk codegraph` 的引用,必須添加。
|
|
38
|
+
|
|
39
|
+
### 3. 更新項目文檔狀態
|
|
23
40
|
|
|
24
41
|
通過並行調度 subagents 完成變更的逐行深度閱讀,檢查文檔是否存在錯誤或遺漏。
|
|
25
42
|
若有,使用 `docs-project`、`maintain-project-constraints` 將文檔同步到最新。
|
|
26
43
|
|
|
27
|
-
###
|
|
44
|
+
### 4. 發佈版本
|
|
28
45
|
|
|
29
46
|
確認所有文檔已更新。
|
|
30
47
|
更新 repo 的版本文件(如 pyproject.toml)。
|