@laitszkin/apollo-toolkit 3.8.2 → 3.8.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 +13 -0
- package/align-project-documents/SKILL.md +136 -130
- package/align-project-documents/agents/openai.yaml +2 -2
- package/align-project-documents/references/templates/standardized-docs-template.md +119 -0
- 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/README.md +12 -25
- package/archive-specs/SKILL.md +24 -47
- package/archive-specs/agents/openai.yaml +2 -2
- package/archive-specs/references/templates/architecture.md +13 -21
- package/archive-specs/references/templates/docs-index.md +24 -24
- package/archive-specs/references/templates/features.md +18 -18
- package/archive-specs/references/templates/principles.md +28 -0
- package/archive-specs/references/templates/readme.md +4 -13
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/generate-spec/SKILL.md +10 -12
- package/generate-spec/references/templates/checklist.md +33 -88
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/maintain-project-constraints/SKILL.md +90 -88
- package/maintain-project-constraints/agents/openai.yaml +2 -2
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/package.json +1 -1
- package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
- package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
- package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/align-project-documents/references/templates/category-based-project-docs-template.md +0 -170
- package/archive-specs/references/templates/configuration.md +0 -29
- package/archive-specs/references/templates/developer-guide.md +0 -33
- package/archive-specs/references/templates/getting-started.md +0 -38
package/CHANGELOG.md
CHANGED
|
@@ -22,11 +22,24 @@ All notable changes to this repository are documented in this file.
|
|
|
22
22
|
### Changed
|
|
23
23
|
- Simplify `generate-spec` coordination.md to three sections (Business Goals, Design Principles, Spec Boundaries) and restructure preparation.md to follow tasks.md-style compact format
|
|
24
24
|
|
|
25
|
+
## [v3.8.3] - 2026-05-03
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Refactor `align-project-documents` to generate standardized `docs/features/` (BDD user-facing scenarios), `docs/architecture/` (macro-level design principles), and `docs/principles/` (code conventions and development constraints) instead of flexible Diataxis-based classification
|
|
29
|
+
- Simplify `maintain-project-constraints` to produce `AGENTS.md`/`CLAUDE.md` with exactly three sections: Common Development Commands, Project Business Goals, and Project Documentation Index
|
|
30
|
+
- Update `archive-specs` to delegate documentation generation to the refactored `align-project-documents` and constraint-file refresh to `maintain-project-constraints`; replace flat-category reference templates with the new three-category structure
|
|
31
|
+
|
|
25
32
|
## [Unreleased]
|
|
26
33
|
|
|
27
34
|
### Added
|
|
28
35
|
- (None yet)
|
|
29
36
|
|
|
37
|
+
## [v3.8.4] - 2026-05-04
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- Simplify `generate-spec` checklist template from 108 lines to 53 lines: consolidate multi-field behavior-to-test items into single-line checkboxes, flatten hardening records, and streamline E2E/integration decisions and completion records
|
|
41
|
+
- Emphasize official documentation lookup as mandatory step in `generate-spec` workflow
|
|
42
|
+
|
|
30
43
|
## [v3.8.0] - 2026-04-30
|
|
31
44
|
|
|
32
45
|
### Added
|
|
@@ -1,152 +1,158 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: align-project-documents
|
|
3
|
-
description: Read
|
|
3
|
+
description: Read the entire codebase, then generate standardized project documentation under docs/features/, docs/architecture/, and docs/principles/ from code evidence. Remove old documentation that does not conform to the template structure, then refresh AGENTS.md/CLAUDE.md via maintain-project-constraints.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Align Project Documents
|
|
7
7
|
|
|
8
|
+
## Dependencies
|
|
9
|
+
|
|
10
|
+
- Required: `maintain-project-constraints` to refresh `AGENTS.md/CLAUDE.md` after documentation changes.
|
|
11
|
+
- Conditional: none.
|
|
12
|
+
- Optional: none.
|
|
13
|
+
- Fallback: not applicable.
|
|
14
|
+
|
|
8
15
|
## Standards
|
|
9
16
|
|
|
10
|
-
- Evidence: Treat source code, configuration, scripts, and tests as the source of truth.
|
|
11
|
-
- Execution:
|
|
12
|
-
- Quality:
|
|
13
|
-
- Output:
|
|
17
|
+
- Evidence: Treat source code, configuration, scripts, and tests as the sole source of truth.
|
|
18
|
+
- Execution: Read the entire codebase before writing any documentation; ground every claim in concrete file paths.
|
|
19
|
+
- Quality: Remove outdated documentation that does not conform to the template structure; never leave mixed documentation formats in place.
|
|
20
|
+
- Output: Produce standardized, maintainable documentation organized into three categories: features, architecture, and principles.
|
|
14
21
|
|
|
15
22
|
## Goal
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
Generate a complete, code-grounded project documentation set under `docs/` that describes what the system does from a user perspective (features), how it is designed (architecture), and what conventions govern its code (principles).
|
|
25
|
+
|
|
26
|
+
## Target Documentation Structure
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
docs/
|
|
30
|
+
├── features/ — BDD-described user-facing capabilities, categorized by functional area
|
|
31
|
+
├── architecture/ — macro-level design principles, organized by module or layer
|
|
32
|
+
└── principles/ — code style, naming conventions, dependency management, and development constraints
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### docs/features/
|
|
36
|
+
|
|
37
|
+
- Describe what the system does from a user's perspective.
|
|
38
|
+
- Never reference specific code paths, file names, or implementation details.
|
|
39
|
+
- Use BDD (Behavior-Driven Development) phrasing: "Given ... When ... Then ...".
|
|
40
|
+
- Group features by functional category; each category gets its own markdown file.
|
|
41
|
+
- File titles must clearly convey which functional area or module they cover.
|
|
42
|
+
|
|
43
|
+
Example feature description:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
# 用戶認證與授權
|
|
47
|
+
|
|
48
|
+
## 登入
|
|
49
|
+
|
|
50
|
+
- **Given** 用戶擁有有效的帳號密碼
|
|
51
|
+
- **When** 用戶提交登入表單
|
|
52
|
+
- **Then** 系統驗證憑證並返回存取令牌,用戶進入主頁面
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### docs/architecture/
|
|
56
|
+
|
|
57
|
+
- Extract macro-level design principles from the codebase.
|
|
58
|
+
- Group principles by module or architectural layer; each module gets its own markdown file.
|
|
59
|
+
- Every principle must be sufficiently abstract to avoid becoming stale after minor code changes.
|
|
60
|
+
- Focus on module responsibilities, boundary rules, data flow direction, and integration contracts — not on specific implementation details.
|
|
61
|
+
|
|
62
|
+
Example architecture principle:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
# API 層設計原則
|
|
66
|
+
|
|
67
|
+
## 路由與處理器分離
|
|
68
|
+
|
|
69
|
+
路由定義與請求處理邏輯存放在不同模組中。路由層只負責 URL 映射與中介軟體綁定,
|
|
70
|
+
處理器層負責請求解析、業務邏輯調用與回應組裝。
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### docs/principles/
|
|
74
|
+
|
|
75
|
+
- Extract code style, naming conventions, and development constraints from the codebase.
|
|
76
|
+
- Categorize into separate markdown files (e.g., naming conventions, dependency management, error handling patterns).
|
|
77
|
+
- Each principle must be traceable to concrete examples in the codebase.
|
|
78
|
+
|
|
79
|
+
Example principle:
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
# 命名約定
|
|
83
|
+
|
|
84
|
+
## 檔案命名
|
|
85
|
+
|
|
86
|
+
- TypeScript 模組檔案使用 kebab-case:`user-service.ts`
|
|
87
|
+
- React 元件檔案使用 PascalCase:`UserProfile.tsx`
|
|
88
|
+
- 測試檔案與被測檔案同名,加上 `.test` 後綴:`user-service.test.ts`
|
|
89
|
+
```
|
|
18
90
|
|
|
19
91
|
## Workflow
|
|
20
92
|
|
|
21
|
-
### 1)
|
|
22
|
-
|
|
23
|
-
- Read key files before writing: `README*`, `package.json`/`pyproject.toml`/`go.mod`, lock files, CI configs, entrypoints, and test setup.
|
|
24
|
-
- Inspect main runtime paths (API/server, worker, frontend, CLI, jobs) and dependency boundaries.
|
|
25
|
-
- Build a factual map: startup commands, environment variables, request/data flow, major modules, external integrations, and observability points.
|
|
26
|
-
- Record concrete evidence with file paths for every important claim.
|
|
27
|
-
- Identify likely readers and their knowledge gaps: new developer, operator, support teammate, product stakeholder, or mixed audience.
|
|
28
|
-
- Identify the actual reader tasks: understand the project, run locally, configure credentials, operate a workflow, debug failures, or change code safely.
|
|
29
|
-
|
|
30
|
-
### 2) Classify documentation by content, not by fixed headings
|
|
31
|
-
|
|
32
|
-
- Start from the repository's real content and the readers' jobs to be done.
|
|
33
|
-
- Choose only the categories that are supported by evidence and useful to the target audience.
|
|
34
|
-
- Use open source documentation conventions as the classification baseline instead of inventing project-local categories first.
|
|
35
|
-
- Prefer the Diataxis content families for content classification: tutorial, how-to, reference, and explanation.
|
|
36
|
-
- Map those content families onto common open source document types when appropriate: `README`, `CONTRIBUTING`, `SECURITY`, `CODE_OF_CONDUCT`, troubleshooting guides, glossary, and release/change documents.
|
|
37
|
-
- Prefer descriptive, task-led headings such as `本地啟動 API 服務`, `設定 GitHub OAuth 憑證`, or `匯入任務卡住時如何排查`.
|
|
38
|
-
- Do not force a fixed chapter list when the project does not need it.
|
|
39
|
-
- Use `references/templates/category-based-project-docs-template.md` as the primary selection guide.
|
|
40
|
-
|
|
41
|
-
Useful content categories include:
|
|
42
|
-
|
|
43
|
-
- README or docs index for orientation
|
|
44
|
-
- tutorial or getting-started guide for first success
|
|
45
|
-
- how-to or runbook guides for real tasks
|
|
46
|
-
- reference docs for configuration, commands, endpoints, and limits
|
|
47
|
-
- explanation docs for architecture, concepts, and tradeoffs
|
|
48
|
-
- CONTRIBUTING for contribution workflow
|
|
49
|
-
- SECURITY for vulnerability reporting and support policy
|
|
50
|
-
- CODE_OF_CONDUCT for community expectations
|
|
51
|
-
- glossary, FAQ, decisions, or release notes when repository evidence shows they are needed
|
|
52
|
-
|
|
53
|
-
### 3) Decide documentation mode
|
|
54
|
-
|
|
55
|
-
- **Generate mode**: no usable docs exist, or user asks to create docs from scratch.
|
|
56
|
-
- **Align mode**: existing docs exist and must be checked against implementation.
|
|
57
|
-
|
|
58
|
-
### 4) Generate mode output
|
|
59
|
-
|
|
60
|
-
Create or update a minimal document set chosen from the content categories above. Do not require every project to have the same headings or files.
|
|
61
|
-
|
|
62
|
-
At minimum, ensure the final output answers the questions that matter for the repository's real readers:
|
|
63
|
-
|
|
64
|
-
1. What is this project for?
|
|
65
|
-
2. Who usually needs this document?
|
|
66
|
-
3. How do I complete the most common task safely?
|
|
67
|
-
4. What must I prepare before I start?
|
|
68
|
-
5. What result should I expect if things are working?
|
|
69
|
-
6. What usually goes wrong and how do I verify it?
|
|
70
|
-
7. Where in the repository is the source of truth?
|
|
71
|
-
|
|
72
|
-
Recommended output pattern:
|
|
73
|
-
|
|
74
|
-
- A short root `README.md` or equivalent entry document for orientation.
|
|
75
|
-
- One or more focused documents grouped by standard documentation type.
|
|
76
|
-
- Optional runbooks for task-heavy or failure-heavy workflows.
|
|
77
|
-
- Optional glossary/FAQ material only when the project actually contains domain complexity or repeated team confusion.
|
|
78
|
-
- Separate contributor or community-governance docs only when the repository exposes those collaboration workflows.
|
|
79
|
-
|
|
80
|
-
Writing rules:
|
|
81
|
-
|
|
82
|
-
- Write what is true now, not what should be true.
|
|
83
|
-
- Use concrete commands and paths from the repository.
|
|
84
|
-
- Keep examples executable when possible.
|
|
85
|
-
- Call out unknowns explicitly instead of guessing.
|
|
86
|
-
- Explain why a file, service, command, or environment matters before telling the reader to use it.
|
|
87
|
-
- Assume the reader may not understand local jargon, deployment assumptions, or the project's business terms.
|
|
88
|
-
- Prefer task-oriented section titles over generic labels.
|
|
89
|
-
- Keep different documentation intents separate: tutorials teach, how-to guides solve tasks, reference catalogs facts, and explanation pages provide understanding.
|
|
90
|
-
|
|
91
|
-
### 5) Align mode output
|
|
92
|
-
|
|
93
|
-
When docs already exist:
|
|
94
|
-
|
|
95
|
-
1. Enumerate existing docs and their scope.
|
|
96
|
-
2. Compare each claim against current code and scripts.
|
|
97
|
-
3. Classify findings:
|
|
98
|
-
- **Accurate**
|
|
99
|
-
- **Outdated**
|
|
100
|
-
- **Missing**
|
|
101
|
-
- **Ambiguous**
|
|
102
|
-
4. Update docs to match real behavior.
|
|
103
|
-
5. Add a short "Documentation Delta" summary listing major corrections.
|
|
104
|
-
6. Rewrite headings that are too generic or template-like so they reflect the real task or concept being documented.
|
|
105
|
-
|
|
106
|
-
Alignment checklist:
|
|
107
|
-
|
|
108
|
-
- Startup/install commands still work.
|
|
109
|
-
- Directory/module names match current tree.
|
|
110
|
-
- API/routes/events/messages match implementation.
|
|
111
|
-
- Config keys and env vars match code usage.
|
|
112
|
-
- Debug instructions reference real logs, metrics, and breakpoints.
|
|
113
|
-
- Test commands and expected outputs are current.
|
|
114
|
-
- Headings match actual content categories instead of forcing one universal structure.
|
|
115
|
-
- Newcomers can infer what each document is for before reading the full content.
|
|
116
|
-
- Document placement follows recognizable open source conventions whenever the repository scope justifies them.
|
|
117
|
-
|
|
118
|
-
### 6) Newcomer-readability rules
|
|
119
|
-
|
|
120
|
-
- Start each document by making the reader's situation explicit: who this is for, what they are trying to do, and when they should use this document.
|
|
121
|
-
- When describing a task, include prerequisites, exact steps, expected signals, and common failure recovery.
|
|
122
|
-
- When describing architecture, explain responsibilities and boundaries in plain language before diving into paths or modules.
|
|
123
|
-
- When describing configuration or credentials, explain why each key or service exists and what breaks if it is missing.
|
|
124
|
-
- When describing debugging, structure content around observable symptoms and verification paths, not abstract subsystem names.
|
|
125
|
-
- If the repository contains specialist domain language, add a glossary or inline definitions instead of assuming prior knowledge.
|
|
93
|
+
### 1) Read the entire codebase
|
|
126
94
|
|
|
127
|
-
|
|
95
|
+
- Read every source file in the repository to build a complete mental model.
|
|
96
|
+
- Pay special attention to:
|
|
97
|
+
- Entry points (CLI commands, server startup, job runners)
|
|
98
|
+
- Public-facing interfaces (API routes, CLI commands, UI pages)
|
|
99
|
+
- Module boundaries and dependency directions
|
|
100
|
+
- Configuration files, environment variables, and external service integrations
|
|
101
|
+
- Test files that document expected behavior
|
|
102
|
+
- Record concrete file paths as evidence for every claim that will appear in documentation.
|
|
128
103
|
|
|
129
|
-
|
|
130
|
-
- Ensure usage and debug steps are reproducible from current code.
|
|
131
|
-
- Ensure architecture description reflects actual module boundaries.
|
|
132
|
-
- Ensure outdated statements are removed, not only appended.
|
|
133
|
-
- Ensure document categories and headings are chosen because they fit the content, not because the template listed them.
|
|
134
|
-
- Ensure a newcomer can identify the correct next step from the document without already knowing the codebase.
|
|
135
|
-
- Ensure the chosen document types align with common open source practice so contributors can find information where they expect it.
|
|
104
|
+
### 2) Read existing project documentation as reference
|
|
136
105
|
|
|
137
|
-
|
|
106
|
+
- Enumerate all existing documentation files (`README.md`, `docs/**`, `CONTRIBUTING.md`, etc.).
|
|
107
|
+
- Extract factual claims that can be cross-referenced with the codebase.
|
|
108
|
+
- Note gaps where documentation is missing or outdated.
|
|
109
|
+
- Treat existing docs as secondary sources; code is always the primary source of truth.
|
|
138
110
|
|
|
139
|
-
|
|
140
|
-
- Use headings, short bullets, tables, and runnable command snippets when they improve scanning.
|
|
141
|
-
- Prefer direct language and avoid speculative wording.
|
|
142
|
-
- Make headings descriptive enough that a reader can skim the table of contents and know which page or section to open.
|
|
111
|
+
### 3) Generate new documentation following the template structure
|
|
143
112
|
|
|
144
|
-
|
|
113
|
+
- Create `docs/features/`, `docs/architecture/`, and `docs/principles/` directories if they do not exist.
|
|
114
|
+
- For each category, classify findings from the codebase and write focused markdown files.
|
|
115
|
+
- Titles must be descriptive and immediately tell the reader what the file covers.
|
|
116
|
+
- Write in the user's language unless the repository clearly uses a different documentation language.
|
|
117
|
+
|
|
118
|
+
**Features generation checklist:**
|
|
119
|
+
- Identify all user-facing capabilities from routes, CLI commands, UI pages, and job outputs.
|
|
120
|
+
- Group into functional categories (e.g., authentication, data export, notifications).
|
|
121
|
+
- Write BDD scenarios for each feature using Given/When/Then.
|
|
122
|
+
- Each file covers one functional category.
|
|
123
|
+
|
|
124
|
+
**Architecture generation checklist:**
|
|
125
|
+
- Identify major modules or layers from the codebase directory structure and import graph.
|
|
126
|
+
- For each module, extract the design principles that govern its structure and boundaries.
|
|
127
|
+
- Keep principles at the macro level; avoid principles that would need updating for minor code changes.
|
|
128
|
+
- Each file covers one module or architectural layer.
|
|
145
129
|
|
|
146
|
-
|
|
130
|
+
**Principles generation checklist:**
|
|
131
|
+
- Identify recurring patterns in code style, naming, error handling, dependency management, and testing.
|
|
132
|
+
- Categorize patterns into separate files (e.g., `coding-style.md`, `naming-conventions.md`, `dependency-management.md`).
|
|
133
|
+
- Support each principle with a brief rationale traceable to the codebase.
|
|
147
134
|
|
|
148
|
-
|
|
135
|
+
### 4) Remove old documentation that does not conform
|
|
136
|
+
|
|
137
|
+
- Scan `docs/` and the repository root for documentation files that do not fit the new structure.
|
|
138
|
+
- Remove any documentation file whose content has been fully migrated into the new structure.
|
|
139
|
+
- Keep only files that belong to the new structure or have not yet been migrated.
|
|
140
|
+
- When in doubt, preserve the file and note it as a candidate for later migration.
|
|
141
|
+
|
|
142
|
+
### 5) Update AGENTS.md/CLAUDE.md via maintain-project-constraints
|
|
143
|
+
|
|
144
|
+
- After the new documentation is complete, invoke `maintain-project-constraints` to refresh `AGENTS.md/CLAUDE.md`.
|
|
145
|
+
- `maintain-project-constraints` will read the codebase (or the newly generated docs), extract macro business goals, write them to `AGENTS.md`/`CLAUDE.md`, and maintain the project document index.
|
|
146
|
+
|
|
147
|
+
## Quality Gate (must pass before finishing)
|
|
148
|
+
|
|
149
|
+
- Every feature description is written from a user perspective with no code references.
|
|
150
|
+
- Every architecture principle is macro-level and resilient to minor code changes.
|
|
151
|
+
- Every code principle is traceable to concrete examples in the codebase.
|
|
152
|
+
- All generated files have descriptive, scannable titles.
|
|
153
|
+
- No stale documentation remains that duplicates or contradicts the new structure.
|
|
154
|
+
- `maintain-project-constraints` has been run and `AGENTS.md`/`CLAUDE.md` is up to date.
|
|
155
|
+
|
|
156
|
+
## Reference Template
|
|
149
157
|
|
|
150
|
-
-
|
|
151
|
-
- The Good Docs Project: use common open source template types such as README, quickstart, tutorial, how-to, troubleshooting, glossary, and style-oriented guidance as practical packaging patterns.
|
|
152
|
-
- GitHub open source guidance: treat `README`, `CONTRIBUTING`, license, code of conduct, and security policy as common repository-level documents when the project has contributor-facing community workflows.
|
|
158
|
+
- `references/templates/standardized-docs-template.md`: describes the three-category documentation structure, writing rules, and quality checklist for each category.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Align Project Documents"
|
|
3
|
-
short_description: "Generate
|
|
4
|
-
default_prompt: "Use $align-project-documents to
|
|
3
|
+
short_description: "Generate standardized project docs under docs/features/, docs/architecture/, and docs/principles/ from code evidence"
|
|
4
|
+
default_prompt: "Use $align-project-documents to read the entire codebase first, ground every claim in code/config/test evidence, then generate standardized project documentation in three categories: features (BDD-described, user perspective), architecture (macro-level design principles by module), and principles (code style, naming conventions, development constraints). Remove old non-conforming docs and refresh AGENTS.md/CLAUDE.md via maintain-project-constraints."
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Standardized Project Documentation Template
|
|
2
|
+
|
|
3
|
+
Use this template as the target structure when generating or aligning project documentation. Every document must be grounded in codebase evidence, not assumptions.
|
|
4
|
+
|
|
5
|
+
## 1. Category Selection Rules
|
|
6
|
+
|
|
7
|
+
| Category | Purpose | Writing rule | Output path |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| Features | What the system does for its users | BDD (Given/When/Then), user perspective, no code references | `docs/features/<category>.md` |
|
|
10
|
+
| Architecture | How the system is designed at a macro level | Design principles, module responsibilities, boundary rules | `docs/architecture/<module>.md` |
|
|
11
|
+
| Principles | How code is written and organized | Recurring patterns, naming conventions, development constraints | `docs/principles/<topic>.md` |
|
|
12
|
+
|
|
13
|
+
## 2. Features Template (`docs/features/<category>.md`)
|
|
14
|
+
|
|
15
|
+
Every feature file must:
|
|
16
|
+
|
|
17
|
+
- Use a descriptive title that names the functional area.
|
|
18
|
+
- Describe only user-visible behavior; never mention file paths, function names, or database tables.
|
|
19
|
+
- Use BDD phrasing: **Given** (precondition) → **When** (action) → **Then** (outcome).
|
|
20
|
+
- Group related features under subheadings within the file.
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
# <功能類別名稱>
|
|
24
|
+
|
|
25
|
+
## <功能名稱>
|
|
26
|
+
|
|
27
|
+
- **Given** <前置條件>
|
|
28
|
+
- **When** <使用者操作>
|
|
29
|
+
- **Then** <預期結果>
|
|
30
|
+
|
|
31
|
+
## <功能名稱>
|
|
32
|
+
|
|
33
|
+
- **Given** <前置條件>
|
|
34
|
+
- **When** <使用者操作>
|
|
35
|
+
- **Then** <預期結果>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Feature classification guide
|
|
39
|
+
|
|
40
|
+
To identify feature categories from the codebase:
|
|
41
|
+
|
|
42
|
+
1. List every user-facing entry point: CLI commands, API routes, UI pages, scheduled jobs, webhook handlers.
|
|
43
|
+
2. Group entries by the user goal they serve, not by the module that implements them.
|
|
44
|
+
3. Name each group with a term that a user (not a developer) would recognize.
|
|
45
|
+
|
|
46
|
+
## 3. Architecture Template (`docs/architecture/<module>.md`)
|
|
47
|
+
|
|
48
|
+
Every architecture file must:
|
|
49
|
+
|
|
50
|
+
- Use a descriptive title that names the module or layer.
|
|
51
|
+
- State design principles, not implementation details.
|
|
52
|
+
- Keep each principle macro-level so it survives minor code changes.
|
|
53
|
+
- Focus on: module boundaries, data flow direction, integration contracts, and responsibility allocation.
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
# <模組/層名稱> 設計原則
|
|
57
|
+
|
|
58
|
+
## <原則標題>
|
|
59
|
+
|
|
60
|
+
<原則描述:這條原則規範什麼、為什麼這樣設計、適用範圍>
|
|
61
|
+
|
|
62
|
+
## <原則標題>
|
|
63
|
+
|
|
64
|
+
<原則描述>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Architecture principle test
|
|
68
|
+
|
|
69
|
+
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. Rewrite it at a higher level.
|
|
70
|
+
|
|
71
|
+
## 4. Principles Template (`docs/principles/<topic>.md`)
|
|
72
|
+
|
|
73
|
+
Every principles file must:
|
|
74
|
+
|
|
75
|
+
- Use a descriptive title that names the convention area.
|
|
76
|
+
- State the convention clearly.
|
|
77
|
+
- Provide rationale traceable to the codebase.
|
|
78
|
+
- Include a brief example from the codebase (not invented).
|
|
79
|
+
|
|
80
|
+
```markdown
|
|
81
|
+
# <慣例類別>
|
|
82
|
+
|
|
83
|
+
## <慣例名稱>
|
|
84
|
+
|
|
85
|
+
<慣例描述>
|
|
86
|
+
|
|
87
|
+
**理由**: <為什麼採用此慣例>
|
|
88
|
+
|
|
89
|
+
**範例**: <從代碼庫提取的具體範例>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Principles classification guide
|
|
93
|
+
|
|
94
|
+
Common principle categories to scan for:
|
|
95
|
+
|
|
96
|
+
- **命名約定** (`naming-conventions.md`): file naming, variable naming, function naming, type naming
|
|
97
|
+
- **程式碼風格** (`coding-style.md`): formatting, import ordering, export conventions, comment usage
|
|
98
|
+
- **依賴管理** (`dependency-management.md`): how dependencies are declared, versioning strategy, internal dependency rules
|
|
99
|
+
- **錯誤處理** (`error-handling.md`): error creation, propagation, and logging patterns
|
|
100
|
+
- **測試慣例** (`testing-conventions.md`): test file placement, naming, mock/stub usage, coverage expectations
|
|
101
|
+
|
|
102
|
+
## 5. Evidence Checklist
|
|
103
|
+
|
|
104
|
+
Before finishing any document, confirm:
|
|
105
|
+
|
|
106
|
+
- [ ] Every feature claim maps to a user-visible entry point found in the codebase.
|
|
107
|
+
- [ ] Every architecture principle maps to a real module boundary or design decision visible in the code.
|
|
108
|
+
- [ ] Every code principle is supported by at least one concrete example from the codebase.
|
|
109
|
+
- [ ] No removed documentation content has been lost without being replaced in the new structure.
|
|
110
|
+
- [ ] File titles are descriptive enough to be understood in the table of contents.
|
|
111
|
+
|
|
112
|
+
## 6. Removal Rules for Old Documentation
|
|
113
|
+
|
|
114
|
+
When old documentation exists:
|
|
115
|
+
|
|
116
|
+
1. If its content has been fully migrated into the new `docs/features/`, `docs/architecture/`, or `docs/principles/` structure, remove it.
|
|
117
|
+
2. If it contains content not yet covered by the new structure, migrate that content first, then remove it.
|
|
118
|
+
3. If it serves a purpose outside the three categories (e.g., `CONTRIBUTING.md`, `SECURITY.md`, `CHANGELOG.md`), keep it unless it is stale.
|
|
119
|
+
4. Never leave both old and new documentation covering the same topic in place.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/archive-specs/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# archive-specs
|
|
2
2
|
|
|
3
|
-
A documentation skill that converts completed spec files and batch-level coordination files into standardized project
|
|
3
|
+
A documentation skill that converts completed spec files and batch-level coordination files into the standardized project documentation structure and archives the consumed planning files. It delegates documentation generation to `align-project-documents` and constraint file refresh to `maintain-project-constraints`.
|
|
4
4
|
|
|
5
5
|
## Core capabilities
|
|
6
6
|
|
|
7
7
|
- Scans `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and batch-level `coordination.md` collections as documentation input.
|
|
8
8
|
- Reconciles spec claims against code, config, scripts, and deployment files.
|
|
9
|
-
-
|
|
10
|
-
-
|
|
9
|
+
- Delegates to `align-project-documents` to generate standardized docs under `docs/features/` (BDD user-facing features), `docs/architecture/` (macro-level design principles), and `docs/principles/` (code conventions and constraints).
|
|
10
|
+
- Delegates to `maintain-project-constraints` to refresh `AGENTS.md`/`CLAUDE.md` with business goals, common commands, and the project documentation index.
|
|
11
11
|
- Archives superseded spec source files after a successful conversion, and deletes them only when the repository clearly does not need historical retention.
|
|
12
12
|
- Preserves active batch coordination files until no remaining spec set still depends on their shared preparation or replacement direction.
|
|
13
13
|
- Keeps unknown or unverifiable details explicit instead of guessing.
|
|
@@ -25,34 +25,21 @@ A documentation skill that converts completed spec files and batch-level coordin
|
|
|
25
25
|
└── templates/
|
|
26
26
|
├── readme.md
|
|
27
27
|
├── docs-index.md
|
|
28
|
-
├── getting-started.md
|
|
29
|
-
├── configuration.md
|
|
30
|
-
├── architecture.md
|
|
31
28
|
├── features.md
|
|
32
|
-
|
|
29
|
+
├── architecture.md
|
|
30
|
+
└── principles.md
|
|
33
31
|
```
|
|
34
32
|
|
|
35
33
|
## Default outputs
|
|
36
34
|
|
|
37
|
-
- `
|
|
38
|
-
- `docs/
|
|
39
|
-
- `docs/
|
|
40
|
-
- `
|
|
41
|
-
- `
|
|
42
|
-
- `docs/features.md`
|
|
43
|
-
- `docs/developer-guide.md`
|
|
44
|
-
|
|
45
|
-
## Required doc coverage
|
|
46
|
-
|
|
47
|
-
- Installation and deployment
|
|
48
|
-
- Configuration and environment variables
|
|
49
|
-
- External services and API key acquisition/setup steps when applicable
|
|
50
|
-
- Project architecture
|
|
51
|
-
- Project feature introductions
|
|
52
|
-
- Information developers should understand before changing the project
|
|
35
|
+
- `docs/features/<category>.md` — BDD-described user-facing capabilities by functional category
|
|
36
|
+
- `docs/architecture/<module>.md` — macro-level design principles by module
|
|
37
|
+
- `docs/principles/<topic>.md` — code conventions and development constraints
|
|
38
|
+
- `README.md` — concise project overview (kept short, links to docs/)
|
|
39
|
+
- `AGENTS.md`/`CLAUDE.md` — business goals, common commands, and doc index (maintained by `maintain-project-constraints`)
|
|
53
40
|
|
|
54
41
|
## Notes
|
|
55
42
|
|
|
56
43
|
- Prefer code, config, and deployment files over stale spec text when they disagree.
|
|
57
|
-
- If the repository already has docs, rewrite them into the
|
|
58
|
-
- Keep `README.md` short
|
|
44
|
+
- If the repository already has docs, delegate to `align-project-documents` to rewrite them into the standardized structure.
|
|
45
|
+
- Keep `README.md` short; the documentation index lives in `AGENTS.md`/`CLAUDE.md`.
|
package/archive-specs/SKILL.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archive-specs
|
|
3
|
-
description: Convert completed project plan sets into maintainable project documentation and archive the consumed planning files. Use when users want to consolidate `spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md` and any batch-level `coordination.md` into
|
|
3
|
+
description: Convert completed project plan sets into maintainable project documentation and archive the consumed planning files. Use when users want to consolidate `spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md` and any batch-level `coordination.md` into the standardized docs/features/, docs/architecture/, docs/principles/ structure, then refresh AGENTS.md/CLAUDE.md via maintain-project-constraints.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Archive Specs
|
|
7
7
|
|
|
8
8
|
## Dependencies
|
|
9
9
|
|
|
10
|
-
- Required: `align-project-documents` to align
|
|
10
|
+
- Required: `align-project-documents` to generate and align the standardized project documentation under `docs/features/`, `docs/architecture/`, and `docs/principles/`, and `maintain-project-constraints` to refresh `AGENTS.md`/`CLAUDE.md` with the updated business goals and documentation index after the doc update.
|
|
11
11
|
- Conditional: none.
|
|
12
12
|
|
|
13
13
|
## Standards
|
|
14
14
|
|
|
15
15
|
- Evidence: Treat code, config, deployment files, and current spec files as evidence sources; never guess when a detail is missing.
|
|
16
|
-
- Execution: Inventory all relevant specs first, reconcile them with the current repository,
|
|
17
|
-
- Quality: Prefer source-of-truth behavior over stale plan text, align existing docs to the
|
|
18
|
-
- Output: Produce synchronized
|
|
16
|
+
- Execution: Inventory all relevant specs first, reconcile them with the current repository, delegate documentation generation to `align-project-documents`, delegate `AGENTS.md`/`CLAUDE.md` refresh to `maintain-project-constraints`, then archive only the truly consumed planning artifacts.
|
|
17
|
+
- Quality: Prefer source-of-truth behavior over stale plan text, align existing docs to the standardized three-category structure, and call out unknowns explicitly instead of inventing missing setup details.
|
|
18
|
+
- Output: Produce synchronized standardized docs under `docs/features/`, `docs/architecture/`, and `docs/principles/`, a concise `README.md` when appropriate, and an up-to-date `AGENTS.md`/`CLAUDE.md`, then archive or remove superseded spec files after conversion is complete.
|
|
19
19
|
|
|
20
20
|
## Goal
|
|
21
21
|
|
|
22
|
-
Convert completed planning artifacts into
|
|
22
|
+
Convert completed planning artifacts into the standardized project documentation structure, refresh the project constraint files, then archive the consumed specs so active planning files stay separate from durable project docs.
|
|
23
23
|
|
|
24
24
|
## Workflow
|
|
25
25
|
|
|
26
26
|
### 1) Inventory documentation sources
|
|
27
27
|
|
|
28
28
|
- Find all relevant planning files such as `docs/plans/**/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and any batch-level `coordination.md`.
|
|
29
|
-
- Read existing `README*`, deployment scripts, manifests, env examples, infra files, CI configs, and representative source modules.
|
|
30
|
-
- Build a source map for
|
|
29
|
+
- Read existing `README*`, `docs/**`, deployment scripts, manifests, env examples, infra files, CI configs, and representative source modules.
|
|
30
|
+
- Build a source map for implemented features, module boundaries, external services, and configuration details.
|
|
31
31
|
|
|
32
32
|
### 2) Reconcile spec claims with the current repository
|
|
33
33
|
|
|
@@ -41,42 +41,22 @@ Convert completed planning artifacts into stable, standardized project documenta
|
|
|
41
41
|
- Use `coordination.md` to understand shared preparation, ownership boundaries, legacy cutover direction, and which old features or paths were intentionally replaced across multiple spec sets.
|
|
42
42
|
- Distinguish between completed scope that should become durable docs and still-active scope that remains planning material for follow-up work.
|
|
43
43
|
|
|
44
|
-
### 3)
|
|
45
|
-
|
|
46
|
-
- Hand the documentation rewrite/alignment work to `align-project-documents
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- `docs/configuration.md`
|
|
56
|
-
- `docs/architecture.md`
|
|
57
|
-
- `docs/features.md`
|
|
58
|
-
- `docs/developer-guide.md`
|
|
59
|
-
- Ensure the categorized docs cover: installation and deployment, configuration, external services with required credentials and API key acquisition tutorials when applicable, architecture and module boundaries, feature introductions, and developer onboarding context.
|
|
60
|
-
- If the repository already uses different doc paths, preserve the established locations only when the resulting documents still match the same categorized sections and remain easy to maintain.
|
|
61
|
-
|
|
62
|
-
### 4) Write the configuration and external-service guidance carefully
|
|
63
|
-
|
|
64
|
-
- List each env var, config file, or secret only when supported by repository evidence.
|
|
65
|
-
- For every external service, document:
|
|
66
|
-
- why the service is needed
|
|
67
|
-
- which local config or env vars are required
|
|
68
|
-
- how to create or locate the credential
|
|
69
|
-
- where to place the credential locally or in deployment
|
|
70
|
-
- any safe-development notes such as sandbox/test-mode usage
|
|
71
|
-
- If the repository does not show how to obtain a credential, say so explicitly and point to the service's official setup page rather than guessing steps.
|
|
44
|
+
### 3) Delegate documentation generation to align-project-documents
|
|
45
|
+
|
|
46
|
+
- Hand the full documentation rewrite/alignment work to `align-project-documents`.
|
|
47
|
+
- `align-project-documents` will read the entire codebase, generate standardized documentation under `docs/features/` (BDD-described user-facing capabilities), `docs/architecture/` (macro-level design principles by module), and `docs/principles/` (code style, naming conventions, development constraints), and remove old non-conforming documentation.
|
|
48
|
+
- Provide `align-project-documents` with the reconciled spec findings from step 2 as supplementary context.
|
|
49
|
+
|
|
50
|
+
### 4) Refresh AGENTS.md/CLAUDE.md via maintain-project-constraints
|
|
51
|
+
|
|
52
|
+
- After `align-project-documents` has completed the documentation update, invoke `maintain-project-constraints`.
|
|
53
|
+
- `maintain-project-constraints` will read the updated `docs/` structure, extract macro business goals, inventory common development commands, build the project documentation index, and write or update `AGENTS.md`/`CLAUDE.md` with exactly three sections: Common Development Commands, Project Business Goals, and Project Documentation Index.
|
|
54
|
+
- If both `AGENTS.md` and `CLAUDE.md` exist, `maintain-project-constraints` will keep their content consistent.
|
|
72
55
|
|
|
73
56
|
### 5) Keep README short and the doc set navigable
|
|
74
57
|
|
|
75
|
-
- `README.md`
|
|
76
|
-
-
|
|
77
|
-
- Each category doc should stay focused on one topic instead of acting like another monolithic handbook.
|
|
78
|
-
- Remove template placeholders and stale planning language before finishing.
|
|
79
|
-
- After the docs are aligned, run `maintain-project-constraints` whenever the documentation changes imply `AGENTS.md/CLAUDE.md` needs to reflect updated workflows, commands, or repository capabilities.
|
|
58
|
+
- If `README.md` does not exist or is outdated, create or update it as a short project overview with a link to the documentation index in `AGENTS.md`/`CLAUDE.md`.
|
|
59
|
+
- Do not duplicate content that belongs in `docs/`.
|
|
80
60
|
|
|
81
61
|
### 6) Archive superseded spec files after successful conversion
|
|
82
62
|
|
|
@@ -91,7 +71,6 @@ Convert completed planning artifacts into stable, standardized project documenta
|
|
|
91
71
|
## Working Rules
|
|
92
72
|
|
|
93
73
|
- Prefer the user's language unless the repository clearly uses another documentation language.
|
|
94
|
-
- Keep examples executable and commands copyable.
|
|
95
74
|
- Do not copy speculative roadmap items from specs into the main docs as if they already exist.
|
|
96
75
|
- When a section cannot be completed from evidence, keep an explicit `Unknown` or `TBD (missing repository evidence)` marker.
|
|
97
76
|
- The final repository state should not keep both standardized docs and redundant active spec files for the same completed scope.
|
|
@@ -102,8 +81,6 @@ Convert completed planning artifacts into stable, standardized project documenta
|
|
|
102
81
|
|
|
103
82
|
- `references/templates/readme.md`: concise project overview template.
|
|
104
83
|
- `references/templates/docs-index.md`: categorized project-doc index and reference list template.
|
|
105
|
-
- `references/templates/
|
|
106
|
-
- `references/templates/
|
|
107
|
-
- `references/templates/
|
|
108
|
-
- `references/templates/features.md`: feature guide template.
|
|
109
|
-
- `references/templates/developer-guide.md`: development onboarding template.
|
|
84
|
+
- `references/templates/features.md`: template for `docs/features/` BDD-described feature documentation.
|
|
85
|
+
- `references/templates/architecture.md`: template for `docs/architecture/` macro-level design principles.
|
|
86
|
+
- `references/templates/principles.md`: template for `docs/principles/` code conventions and development constraints.
|