@laitszkin/apollo-toolkit 3.8.3 → 3.9.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 (27) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/align-project-documents/SKILL.md +49 -121
  3. package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
  4. package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
  5. package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
  6. package/commit-and-push/SKILL.md +52 -75
  7. package/develop-new-features/SKILL.md +53 -113
  8. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  9. package/enhance-existing-features/SKILL.md +59 -125
  10. package/generate-spec/SKILL.md +86 -197
  11. package/generate-spec/references/templates/checklist.md +33 -88
  12. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  13. package/implement-specs/SKILL.md +47 -43
  14. package/implement-specs-with-subagents/SKILL.md +69 -165
  15. package/implement-specs-with-worktree/SKILL.md +53 -102
  16. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  17. package/maintain-project-constraints/SKILL.md +53 -105
  18. package/maintain-skill-catalog/SKILL.md +46 -42
  19. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  20. package/package.json +1 -1
  21. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  22. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  23. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  24. package/review-spec-related-changes/SKILL.md +49 -82
  25. package/solve-issues-found-during-review/SKILL.md +46 -106
  26. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
  27. package/version-release/SKILL.md +52 -88
package/CHANGELOG.md CHANGED
@@ -34,6 +34,17 @@ All notable changes to this repository are documented in this file.
34
34
  ### Added
35
35
  - (None yet)
36
36
 
37
+ ## [v3.9.0] - 2026-05-05
38
+
39
+ ### Changed
40
+ - Refine agent-facing descriptions and workflow copy across planning, review, and submission skills (`commit-and-push`, `version-release`, `generate-spec`, `implement-specs*`, `develop-new-features`, `enhance-existing-features`, `review-spec-related-changes`, `solve-issues-found-during-review`, `maintain-skill-catalog`, `align-project-documents`, `maintain-project-constraints`); keep CI-visible contract wording aligned with `test/skill-workflows.test.js`.
41
+
42
+ ## [v3.8.4] - 2026-05-04
43
+
44
+ ### Changed
45
+ - 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
46
+ - Emphasize official documentation lookup as mandatory step in `generate-spec` workflow
47
+
37
48
  ## [v3.8.0] - 2026-04-30
38
49
 
39
50
  ### Added
@@ -1,158 +1,86 @@
1
1
  ---
2
2
  name: align-project-documents
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.
3
+ description: >-
4
+ Regenerate standardized tree `docs/features` (BDD zero code paths), `docs/architecture` (macro layer rules), `docs/principles` (evidence-backed conventions) after reading the ENTIRE production codebase—legacy scattered Markdown must migrate or be removed before finish then invoke **`maintain-project-constraints`** so AGENTS/CLAUDE indexes match disk.
5
+ Use for repo-wide doc realignments (“rebuild project docs from code”)—skip for single-file README nitpicks unless user explicitly requests full regeneration.
6
+ Violation examples: features mentioning `src/foo.ts`… acceptable feature: “Given signed-in user When export Then CSV downloads”… architecture stays stable if module renamed internally…
4
7
  ---
5
8
 
6
9
  # Align Project Documents
7
10
 
8
11
  ## Dependencies
9
12
 
10
- - Required: `maintain-project-constraints` to refresh `AGENTS.md/CLAUDE.md` after documentation changes.
13
+ - Required: `maintain-project-constraints` after `docs/` work to refresh `AGENTS.md`/`CLAUDE.md` and the doc index.
11
14
  - Conditional: none.
12
15
  - Optional: none.
13
- - Fallback: not applicable.
16
+ - Fallback: If `maintain-project-constraints` cannot run, **MUST NOT** pretend the constraints files are refreshed—report the gap.
14
17
 
15
- ## Standards
18
+ ## Non-negotiables
16
19
 
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.
20
+ - **MUST** read the **entire** codebase (all meaningful source/config/test entrypoints—not a single-folder sample) **before** writing category docs; code is sole truth—existing prose is corroborating only.
21
+ - **MUST NOT** ship `docs/features/` bullets that cite file paths, function names, or implementation detail—user-facing **BDD** only (`Given` / `When` / `Then`).
22
+ - **`docs/architecture/`** stays **macro** (layers, boundaries, data-flow direction)—**MUST NOT** document code that will rot on every refactor.
23
+ - **`docs/principles/`** **MUST** remain traceable to **concrete** repo patterns (with examples)—not aspirational platitudes without evidence.
24
+ - **MUST** create or refresh `docs/features/`, `docs/architecture/`, `docs/principles/` with categorized files; **MUST** remove or migrate stale non-conforming docs (**MUST NOT** leave mixed legacy layout alongside new structure indefinitely).
25
+ - **MUST** invoke **`maintain-project-constraints`** after category docs stabilize so `AGENTS.md`/`CLAUDE.md` indexes match disk.
26
+ - Default doc **language**: match user preference or repo’s dominant README/docs language consistently per run.
21
27
 
22
- ## Goal
28
+ ## Standards (summary)
23
29
 
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).
30
+ - **Evidence**: Paths and reads logged while building claims; contradictory old docs flagged, not blindly merged.
31
+ - **Execution**: Whole repo read → ingest old docs → write three pillars → prune → constraints refresh.
32
+ - **Quality**: Features user-only; architecture stable abstractions; principles evidence-backed.
33
+ - **Output**: Standardized tree + synced agent constraint files.
25
34
 
26
- ## Target Documentation Structure
35
+ ## Target structure
27
36
 
28
37
  ```
29
38
  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
39
+ ├── features/ — User-facing capability, BDD only (no code paths)
40
+ ├── architecture/ — Layers/modules, boundaries, integration contracts (macro)
41
+ └── principles/ — Style, tooling, conventions with codebase examples
33
42
  ```
34
43
 
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
- ```
44
+ Extended rules and checklist: `references/templates/standardized-docs-template.md`.
90
45
 
91
46
  ## Workflow
92
47
 
93
- ### 1) Read the entire codebase
94
-
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.
103
-
104
- ### 2) Read existing project documentation as reference
48
+ **Chain-of-thought:** **`Pause →`** after each major phase; ambiguity on “user-visible” vs “internal” ⇒ re-read callers before classifying.
105
49
 
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.
50
+ ### 1) Read entire codebase
110
51
 
111
- ### 3) Generate new documentation following the template structure
52
+ - Cover entrypoints (CLI/server/workers), public surfaces, boundaries, configs, integrations, tests as behavior specs.
53
+ - Keep an **evidence notebook** (paths) for principles and architecture—not for features text.
54
+ - **Pause →** Did I skip generated/vendor/`node_modules`/binary blobs incorrectly included as “must read”?
55
+ - **Pause →** Can I name the **top five** externally visible behaviors from code alone?
112
56
 
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.
57
+ ### 2) Read existing prose
117
58
 
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.
59
+ - List `README.md`, `docs/**`, `CONTRIBUTING.md`, etc.; extract facts that code confirms; flag obsolete sections.
60
+ - **Pause →** Where did I treat Markdown as authoritative over a contradicted implementation?
123
61
 
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.
62
+ ### 3) Generate three pillars
129
63
 
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.
64
+ - **features/**: categories → one markdown per category → BDD scenarios only.
65
+ - **architecture/**: one file per layer/module cluster boundaries and flows, stable wording.
66
+ - **principles/**: split files (`naming-conventions.md`, etc.) → each point ties to observable repo habit.
67
+ - **Pause →** Random feature paragraph: grep for `./src` or `` ` `` — if found, rewrite for user observable outcome only.
134
68
 
135
- ### 4) Remove old documentation that does not conform
69
+ ### 4) Remove non-conforming legacy
136
70
 
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.
71
+ - Delete or migrate files fully superseded; if uncertain, **keep** file list in report as migration backlog — **do not** silently duplicate two competing truths forever.
141
72
 
142
- ### 5) Update AGENTS.md/CLAUDE.md via maintain-project-constraints
73
+ ### 5) Refresh constraints
143
74
 
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.
75
+ - Run **`maintain-project-constraints`** so Commands / Business Goals / Doc Index mirror new files.
146
76
 
147
- ## Quality Gate (must pass before finishing)
77
+ ### 6) Gates before finish
148
78
 
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.
79
+ - No code paths in features; architecture still macro after imagined small refactor; principles cite real examples; index lists every file under the three dirs; constraints skill executed.
155
80
 
156
- ## Reference Template
81
+ ## Sample hints
157
82
 
158
- - `references/templates/standardized-docs-template.md`: describes the three-category documentation structure, writing rules, and quality checklist for each category.
83
+ - **Feature OK**: “Given a signed-in user When they export Then a CSV download starts” — no `handlers/export.rs` references.
84
+ - **Feature bad**: “Call `ExportService.run` …” — violates Non-negotiables (implementation leak).
85
+ - **Architecture OK**: “API layer handles I/O only; domain module owns business rules” — stable across internal renames.
86
+ - **Principle OK**: “TypeScript files use kebab-case — see `src/user-profile/`” — traceable pattern.
@@ -1,94 +1,71 @@
1
1
  ---
2
2
  name: commit-and-push
3
- description: "Guide the agent to submit local changes with commit and push only (no versioning). Use when users ask to commit, submit, or push changes without requesting tag/version/release operations. Depend directly on `archive-specs` when completed plan sets should become durable docs or when project docs need alignment, and let that skill own the downstream documentation synchronization work."
3
+ description: >-
4
+ Commit and push only (no semver): inspect staged vs unstaged, classify scopes, run mandated reviews (`review-change-set`, conditional `discover-edge-cases`/`harden-app-security`), **`submission-readiness-check`** BEFORE final commit honoring `CHANGELOG.md` Unreleased + `archive-specs` redirections, preserve intentional staging splits, forbid UI git stubs, VERIFY remote hashes post-push **`version-release` elsewhere**.
5
+ Use for “please commit”, “submit”, “push branch” lacking explicit semver/tag language **STOP** tagging here… BAD skip readiness red… GOOD staged subset untouched unrelated dirty files changelog mirrors diff… hashes `git rev-parse HEAD` versus upstream… archive specs before commit flagged…
4
6
  ---
5
7
 
6
8
  # Commit and Push
7
9
 
8
10
  ## Dependencies
9
11
 
10
- - Required: `submission-readiness-check` before the final commit.
11
- - Conditional: `archive-specs` when completed plan sets should be converted or repository docs need alignment; `review-change-set` is required for code-affecting changes; `discover-edge-cases` and `harden-app-security` are important review gates that remain conditional, but become required whenever the reviewed scope or risk profile warrants them.
12
+ - Required: **`submission-readiness-check`** immediately before the **final** commit.
13
+ - Conditional: **`archive-specs`** when readiness (or completed specs) requires doc conversion or categorized `docs/` alignment; **`review-change-set`** for every **code-affecting** scope; **`discover-edge-cases`** and **`harden-app-security`** become **required** when classification/risk indicates (same scope)—treat as blocking, not polish.
12
14
  - Optional: none.
13
- - Fallback: If any required dependency is unavailable, stop and report the missing dependency.
15
+ - Fallback: Any **required** dependency unavailable ⇒ **MUST** stop and report—**MUST NOT** “light” commit.
14
16
 
15
- ## Standards
17
+ ## Non-negotiables
16
18
 
17
- - Evidence: Inspect git state and classify the change set before deciding which quality gates apply, then compare the actual pending diff against root `CHANGELOG.md` `Unreleased` before committing, while also distinguishing the staged surface from additional unstaged work before deciding commit scope.
18
- - Execution: Run the required quality-gate skills when applicable, and treat every conditional gate whose scenario is met as blocking before submission; hand the repository to `submission-readiness-check` for readiness classification, invoke `archive-specs` directly whenever completed plan sets should be converted or project docs need alignment, preserve staging intent, honor any explicit user-specified target branch, and when the worktree is already clean inspect local `HEAD`, upstream state, and the most recent relevant commit before deciding the request is a no-op; when worktree-based delivery is involved, verify where the authoritative target branch lives before moving history, re-validate on that target branch after replay or merge, and remove the temporary worktree only after the target branch is safely updated; when the user asks for multiple commits or a narrower staged subset, keep those commit boundaries explicit instead of broadening scope implicitly; then commit and push without release steps; run dependent git mutations sequentially and verify the remote branch actually contains the new local `HEAD` before reporting success, and never treat UI directives such as `::git-stage`, `::git-commit`, or `::git-push` as substitutes for actual git commands or as evidence that submission already happened.
19
- - Quality: Re-run relevant validation for runtime changes, preserve unrelated local work safely when branch switching or post-push local sync is required, do not bypass blocking readiness findings such as missing/stale `Unreleased` bullets or unsynchronized project docs, and never collapse intentionally separated commit scopes just because related unstaged changes are present.
20
- - Output: Produce a concise Conventional Commit, push it to the intended branch, and report any temporary stash/restore, commit-scope separation, or local branch sync that was required.
19
+ - **MUST** use real `git` mutations (`git add`, `git commit`, `git push`, `git stash`, etc.); **MUST NOT** treat UI tokens (`::git-commit`, IDE buttons) as proof of history.
20
+ - **MUST** run **`submission-readiness-check`** before final commit; unresolved readiness (e.g. stale/missing `CHANGELOG.md` **Unreleased**, doc drift) **blocks** commit.
21
+ - Code-affecting: **`review-change-set` MANDATORY**; unresolved confirmed findings **block**. When risk profile matches, **`discover-edge-cases`** / **`harden-app-security`** equally blocking.
22
+ - **`archive-specs`**: when readiness says convert/archive or `docs/` mismatch—**MUST** run **before** final commit, not as a vague follow-up.
23
+ - **MUST** reconcile **staged vs unstaged** with user intent—**MUST NOT** broaden scope by auto-staging unrelated files when user staged a subset.
24
+ - **`CHANGELOG.md` `Unreleased`**: for code-affecting or user-visible docs, **MUST** reflect this change before commit; reopen diff after edits to match commit scope.
25
+ - **MUST** resolve **target branch** per user (or current if explicit) before rewriting history; protect unrelated dirty work (`stash` etc.); **no** force-push unless user explicitly requests.
26
+ - After **push**, **MUST** verify remote tip matches local `HEAD` (`git rev-parse` / `@{u}` / `ls-remote`) before claiming success.
27
+ - **MUST NOT** run version bump, tag, or GitHub release (**use `version-release`**).
28
+ - Clean worktree requests: **MUST** inspect `HEAD`, upstream, last commit—**MUST NOT** fabricate “pushed” when already satisfied or impossible.
21
29
 
22
- ## References
30
+ **Repository regression checks (verbatim requirements):** Treat root `CHANGELOG.md` `Unreleased` coverage as mandatory for code-affecting or user-visible changes. Re-open the final `CHANGELOG.md` diff after readiness updates. **`review-change-set` is required for code-affecting changes**; Run `review-change-set` for every code-affecting change before continuing; treat unresolved review findings as blocking. Any conditional gate whose trigger is confirmed by this classification becomes mandatory before commit. Treat every scenario-matched gate as blocking before commit. **`discover-edge-cases` and `harden-app-security` are important review gates**—when their scenario is met, treat them as blocking review gates, not optional polish.
31
+
32
+ ## Standards (summary)
23
33
 
24
- Load only when needed:
34
+ - **Evidence**: `git status`/`diff`; classification drives gates; changelog diff matches commit.
35
+ - **Execution**: Inspect → classify → (deps) → readiness → commit → push verify.
36
+ - **Quality**: No gate bypass; sequential git ops; preserve intentional commit boundaries.
37
+ - **Output**: Conventional commit message + confirmed remote + note stash/scope if any.
38
+
39
+ ## References
25
40
 
26
41
  - `references/commit-messages.md`
27
42
  - `references/branch-naming.md`
28
43
 
29
44
  ## Workflow
30
45
 
31
- 1. Inspect current state
32
- - Run `git status -sb`, `git diff --stat`, and `git diff --cached --stat`.
33
- - Check staged files with `git diff --cached --name-only`.
34
- - Compare the staged and unstaged surfaces explicitly so you can tell whether the user already prepared a narrower commit than the full worktree diff.
35
- - Inventory repository planning artifacts and project docs, not only staged files, to detect repo specs and non-standard documentation layouts.
36
- - If the worktree is already clean, inspect `git log -1 --stat`, local `HEAD`, and the configured upstream state before concluding there is nothing to submit; use that evidence to determine whether the requested work was already committed and pushed, committed but not pushed, or never landed.
37
- 2. Classify changes
38
- - `code-affecting`: runtime code, tests, build scripts, CI logic, or behavior-changing config.
39
- - `docs-only`: content updates only (for example README, docs, comments).
40
- - `repo-specs-present`: the repository contains live project planning artifacts such as `spec.md`, `tasks.md`, `checklist.md`, or plan directories; exclude reference examples, templates, and archived samples.
41
- - `repo-specs-ready-for-conversion`: the relevant `spec.md`, `tasks.md`, and `checklist.md` have been updated to reflect the actual outcome of the work, and any unchecked task/decision checkbox that is clearly not selected, replaced, deferred, or `N/A` (for example, E2E intentionally not created) does not by itself mean the spec set is unfinished.
42
- - `project-doc-structure-mismatch`: existing `README.md` and project docs do not match the categorized structure required by `archive-specs`.
43
- - Treat a spec set as still active when it documents remaining implementation gaps, follow-up integration work, undecided design work, or deferred tasks that still belong to the same in-flight change.
44
- - Any conditional gate whose trigger is confirmed by this classification becomes mandatory before commit, including review, spec archival, docs synchronization, and changelog updates.
45
- 3. Resolve branch target before mutating history
46
- - Treat an explicit user-specified destination such as `main`, `origin/main`, or another named branch as authoritative over the current branch.
47
- - If the current branch does not match the requested destination, inspect `git status --short` for unrelated local changes before switching branches.
48
- - Preserve unrelated uncommitted work safely before branch operations, for example with `git stash push`, and restore it after the target branch has been updated.
49
- - If the fix was committed on the wrong branch, move it to the requested branch with safe history-preserving operations such as `cherry-pick`, `merge --ff-only`, or a clean replay; do not force-push unless the user explicitly asks for it.
50
- - If the user asks to sync the local target branch after pushing, fast-forward or pull that branch locally and then restore any preserved worktree changes.
51
- - If the implementation lives in a detached or temporary `git worktree`, inspect both the temporary worktree and the main worktree before deciding the replay method.
52
- - When the main worktree already contains staged or partially overlapping copies of the same changes, compare file content and branch tips first; do not create an unnecessary merge commit when a direct replay onto the authoritative target branch is safer.
53
- - When the worktree diff is broader than the requested issue, stop and separate the requested commit scope before replaying anything to the target branch.
54
- 4. Run code-affecting dependency skills (when applicable)
55
- - Run `review-change-set` for every code-affecting change before continuing; treat unresolved review findings as blocking.
56
- - Run `discover-edge-cases` and `harden-app-security` for the same code-affecting scope when the reviewed risk profile or repository context says their coverage is needed; treat them as blocking review gates, not optional polish, whenever that condition is met.
57
- - Consolidate and resolve all confirmed findings before continuing.
58
- - Re-run relevant tests when runtime logic changes.
59
- 5. Run shared submission readiness
60
- - Execute `$submission-readiness-check` after code/doc scans are complete and before the final commit.
61
- - Let it decide whether completed plan sets should be converted, whether project docs need alignment through `archive-specs`, and whether `CHANGELOG.md` is blocking submission.
62
- - Do not continue to commit while `submission-readiness-check` reports unresolved readiness blockers.
63
- - Treat root `CHANGELOG.md` `Unreleased` coverage as mandatory for code-affecting or user-visible changes: if the current work is not reflected there yet, update it before committing instead of merely noting the gap.
64
- - Re-open the final `CHANGELOG.md` diff after readiness updates and confirm the `Unreleased` bullets describe the same scope as the commit you are about to create.
65
- - When readiness indicates doc conversion or project-doc drift, run `archive-specs` before the final commit instead of duplicating documentation alignment work locally.
66
- 6. Commit
67
- - Preserve user staging intent where possible.
68
- - If the user explicitly asks for separate commits, or the staged set is already a deliberate subset of the worktree, keep those scopes separated and do not auto-stage the remaining diff unless the user expands the requested scope.
69
- - If the user later broadens the requested scope, restate the new grouping, verify it against the actual staged/unstaged surfaces, and only then create the additional commit(s).
70
- - Use actual `git add` / `git commit` operations; do not emit UI git directives as a stand-in for repository mutations.
71
- - Write a concise Conventional Commit message using `references/commit-messages.md`.
72
- 7. Push
73
- - Push commit(s) to the intended branch.
74
- - Do not overlap `git commit`, `git push`, branch switching, or post-push sync operations; wait for each mutation to finish before starting the next one.
75
- - After pushing, verify the remote branch tip matches the local `HEAD`, for example by comparing `git rev-parse HEAD` with the target branch hash from `git rev-parse @{u}` or `git ls-remote --heads <remote> <branch>`.
76
- - If the push result is ambiguous, out of order, or the hashes do not match, rerun the missing git step sequentially and re-check before reporting success.
77
- - Confirm the local branch state matches the user's requested destination when post-push synchronization was requested.
78
- - When the user explicitly asks to merge work back from a temporary worktree and delete that worktree, do the final verification on the authoritative target branch first, then remove the temporary worktree and prune stale worktree records before reporting completion.
79
- - Do not claim success based on emitted UI directives or optimistic status text alone; remote-hash verification is the required evidence.
80
-
81
- ## Notes
82
-
83
- - Never run version bump, tag creation, or changelog release steps in this skill.
84
- - Treat every scenario-matched gate as blocking before commit, not as an optional reminder to maybe do later.
85
- - Never skip `review-change-set` for code-affecting changes, and do not continue past review while confirmed findings remain unresolved.
86
- - Never downgrade `discover-edge-cases` or `harden-app-security` to optional follow-up when the change risk says they apply.
87
- - Never claim the repository is ready to commit while root `CHANGELOG.md` `Unreleased` is missing the current change or still describes superseded work.
88
- - Never fabricate a commit/push result when the worktree is already clean; either identify the exact existing commit/upstream state that satisfies the user's request or say that no matching new submission exists.
89
- - Never treat `::git-stage`, `::git-commit`, `::git-push`, or similar UI helpers as proof that repository history was mutated; rely on actual git command results plus local/remote hash checks.
90
- - Never delete a temporary worktree before the target branch has been updated, tested, and verified to contain the intended final content.
91
- - Never auto-stage or auto-merge unrelated unstaged changes into a commit when the user or current index state already defines narrower commit boundaries.
92
- - If release/version/tag work is requested, use `version-release` instead.
93
- - If a new branch is required, follow `references/branch-naming.md`.
94
- - A pushed implementation can still leave an active spec set behind; commit completion and spec archival are separate decisions.
46
+ **Chain-of-thought:** **`Pause →`** guards skipping a gate or mis-sizing scope.
47
+
48
+ 1. **Inspect** — `git status -sb`; `git diff --stat`; `git diff --cached --stat`; `git diff --cached --name-only`. If clean: `git log -1 --stat`, upstream tracking, whether work already pushed.
49
+ - **Pause →** Is the user’s intended commit **exactly** the staged set, or full worktree—I must not mix them silently?
50
+
51
+ 2. **Classify** Tag mentally: `code-affecting` | `docs-only` | `repo-specs-present` | `repo-specs-ready-for-conversion` | `project-doc-structure-mismatch` (per `archive-specs` needs). Active specs with unfinished same-change work stay active.
52
+ - **Pause →** Which conditional skills just became **mandatory**—did I list them explicitly?
53
+
54
+ 3. **Branch target** Honor user branch; if switch needed, protect unrelated changes; cherry-pick/replay off wrong branch safely; worktree cases: identify authoritative target **before** replay.
55
+ - **Pause →** Am I about to merge noise because diff > issue scope—should I stop and narrow first?
56
+
57
+ 4. **Code-affecting gates** — `review-change-set` always; add `discover-edge-cases` / `harden-app-security` when risk/trigger says so; fix or document blockers; re-test material logic.
58
+
59
+ 5. **Readiness** Run **`submission-readiness-check`**; if it routes to **`archive-specs`**, run that **now**; fix `Unreleased` bullets; recheck changelog vs staged intent.
60
+ - **Pause →** Could I commit while readiness still red—**why not**?
61
+
62
+ 6. **Commit** Respect staging; separate commits if user asked; Conventional message per `references/commit-messages.md`.
63
+
64
+ 7. **Push** Sequential; verify remote hash; sync local branch after if user asked; worktree cleanup **only after** target branch verified good.
65
+ - **Pause →** What two hashes prove remote == local?
66
+
67
+ ## Sample hints
68
+
69
+ - **Scope**: Staged `foo.ts` only; unstaged `bar.ts` unrelated commit **must not** pick up `bar.ts` without user scope change.
70
+ - **Changelog**: Code change with no `Unreleased` bullet **blocking** until added.
71
+ - **Push proof**: “Pushed” means e.g. local `abc123` equals `origin/feature` `abc123`, not “command sent.”