@laitszkin/apollo-toolkit 3.12.1 → 3.13.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.
- package/CHANGELOG.md +14 -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/SKILL.md +0 -6
- package/commit-and-push/SKILL.md +3 -9
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/generate-spec/SKILL.md +27 -9
- package/generate-spec/references/definition.md +12 -0
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/init-project-html/SKILL.md +18 -22
- package/init-project-html/references/definition.md +12 -0
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/maintain-project-constraints/SKILL.md +11 -19
- package/merge-changes-from-local-branches/SKILL.md +11 -24
- 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/solve-issues-found-during-review/SKILL.md +1 -1
- package/systematic-debug/SKILL.md +11 -38
- package/test-case-strategy/SKILL.md +10 -37
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/update-project-html/SKILL.md +19 -24
- package/update-project-html/references/definition.md +12 -0
- package/version-release/SKILL.md +16 -37
- package/iterative-code-performance/LICENSE +0 -21
- package/iterative-code-performance/README.md +0 -34
- package/iterative-code-performance/SKILL.md +0 -116
- package/iterative-code-performance/agents/openai.yaml +0 -4
- package/iterative-code-performance/references/algorithmic-complexity.md +0 -58
- package/iterative-code-performance/references/allocation-and-hot-loops.md +0 -53
- package/iterative-code-performance/references/caching-and-memoization.md +0 -64
- package/iterative-code-performance/references/concurrency-and-pipelines.md +0 -61
- package/iterative-code-performance/references/coupled-hot-path-strategy.md +0 -78
- package/iterative-code-performance/references/io-batching-and-queries.md +0 -55
- package/iterative-code-performance/references/iteration-gates.md +0 -133
- package/iterative-code-performance/references/job-selection.md +0 -92
- package/iterative-code-performance/references/measurement-and-benchmarking.md +0 -78
- package/iterative-code-performance/references/module-coverage.md +0 -133
- package/iterative-code-performance/references/repository-scan.md +0 -69
- package/iterative-code-quality/LICENSE +0 -21
- package/iterative-code-quality/README.md +0 -45
- package/iterative-code-quality/SKILL.md +0 -112
- package/iterative-code-quality/agents/openai.yaml +0 -4
- package/iterative-code-quality/references/coupled-core-file-strategy.md +0 -73
- package/iterative-code-quality/references/iteration-gates.md +0 -127
- package/iterative-code-quality/references/job-selection.md +0 -78
- package/iterative-code-quality/references/logging-alignment.md +0 -67
- package/iterative-code-quality/references/module-boundaries.md +0 -83
- package/iterative-code-quality/references/module-coverage.md +0 -126
- package/iterative-code-quality/references/naming-and-simplification.md +0 -73
- package/iterative-code-quality/references/repository-scan.md +0 -65
- package/iterative-code-quality/references/testing-strategy.md +0 -95
- package/merge-conflict-resolver/SKILL.md +0 -46
- package/merge-conflict-resolver/agents/openai.yaml +0 -5
- package/spec-to-project-html/SKILL.md +0 -42
- package/spec-to-project-html/agents/openai.yaml +0 -11
- package/spec-to-project-html/references/TEMPLATE_SPEC.md +0 -113
- package/submission-readiness-check/SKILL.md +0 -39
- package/submission-readiness-check/agents/openai.yaml +0 -4
package/version-release/SKILL.md
CHANGED
|
@@ -1,53 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: version-release
|
|
3
|
-
description:
|
|
4
|
-
用於明確的 semver 發版流程。必須先完成 `commit-and-push` 共用 gate 與
|
|
5
|
-
`submission-readiness-check`,再決定版本、更新 changelog、建立 tag、推送並發布 GitHub Release。
|
|
3
|
+
description: 當你需要協助用戶完成版本發佈時,使用這個技能。
|
|
6
4
|
---
|
|
7
5
|
|
|
8
|
-
# 版本發佈
|
|
9
|
-
|
|
10
|
-
## Dependencies
|
|
11
|
-
|
|
12
|
-
- Required: `commit-and-push`、`submission-readiness-check`
|
|
13
|
-
- Conditional: `archive-specs`
|
|
14
|
-
- Optional: 無
|
|
15
|
-
- Fallback: 缺少必需技能時必須停止,不能憑印象手動補一個發版流程
|
|
16
|
-
|
|
17
|
-
## Standards
|
|
18
|
-
|
|
19
|
-
- Evidence: 以版本檔、`CHANGELOG.md`、本地/remote tag、既有 GitHub Release 與使用者明確的 bump 意圖作為依據
|
|
20
|
-
- Execution: 先確認這真的是 release 請求,再完成所有 gate,之後才更新版本、切 changelog、打 tag、推送與發布 Release
|
|
21
|
-
- Quality: 不猜版本、不重複發版、不用原始 diff 臨時拼 release notes;所有版本入口必須同步一致
|
|
22
|
-
- Output: 交付可驗證的版本發佈結果,包含版本號、tag、remote驗證與 GitHub Release URL
|
|
23
|
-
|
|
24
6
|
## 技能目標
|
|
25
7
|
|
|
26
|
-
|
|
8
|
+
幫用戶完成自動化版本發佈流程
|
|
27
9
|
|
|
28
10
|
## 驗收條件
|
|
29
11
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- `submission-readiness-check` 與必要的 `archive-specs` 都已完成,且 `CHANGELOG.md` 的 `Unreleased` 內容足以支撐本次發版
|
|
33
|
-
- 最終已同步版本檔、發布說明、commit、tag、remote refs 與 GitHub Release;若使用者明確要求不發布 Release,需在結果中清楚註明
|
|
12
|
+
- `CHANGELOG.md`, `docs/` 下所有項目文檔已經被同步到最新狀態
|
|
13
|
+
- Github release, Github version tag 被完成創建
|
|
34
14
|
|
|
35
15
|
## 工作流程
|
|
36
16
|
|
|
37
|
-
1.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
17
|
+
### 1. 檢查並確認 repo 狀態
|
|
18
|
+
|
|
19
|
+
閱讀目前的 repo 狀態。查看是否依然存在未提交變更。如有,使用 `commit-and-push` 技能將目前為提交的變更暫存並提交。推送到 remote。
|
|
20
|
+
|
|
21
|
+
### 2. 更新項目文檔狀態
|
|
22
|
+
|
|
23
|
+
完整閱讀上一次發佈版本至今的所有變更,並檢查文檔之中的表述是否存在錯誤或遺漏。如有,使用 `align-project-documents`, `maintain-project-constraints` 這兩個技能將所有項目文檔同步到最新狀態。
|
|
24
|
+
如果外部環境允許使用 subagents,建議通過調度subagents完成變更的逐行深度閱讀。
|
|
45
25
|
|
|
46
|
-
|
|
26
|
+
### 3. 發佈版本
|
|
47
27
|
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
28
|
+
確認所有文檔都已經被更新之後,更新 repo 的版本文件(如 pyproject.toml, cargo.toml)。
|
|
29
|
+
使用 `commit-and-push` 技能將所有變更提交並推送到 remote。
|
|
30
|
+
最後,將用戶要求的版本所對應的 version tag 推送到 remote 並建立 github release。
|
|
51
31
|
|
|
52
32
|
## 參考資料索引
|
|
53
33
|
|
|
@@ -56,4 +36,3 @@ description: >-
|
|
|
56
36
|
- `references/branch-naming.md`:分支命名慣例
|
|
57
37
|
- `references/changelog-writing.md`:`CHANGELOG.md` 與 `Unreleased` 維護規則
|
|
58
38
|
- `references/readme-writing.md`:README 只在必要時同步更新
|
|
59
|
-
- `commit-and-push`:共享的 git 檢查、提交與推送 discipline
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 LaiTszKin
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# iterative-code-performance
|
|
2
|
-
|
|
3
|
-
Improve an existing repository through a strict three-step loop of full-codebase performance scan, module-scoped optimization, and final documentation/constraint sync while preserving intended business behavior and the system's top-level macro architecture.
|
|
4
|
-
|
|
5
|
-
## Core capabilities
|
|
6
|
-
|
|
7
|
-
- Runs a repository-wide performance scan before every optimization round and refreshes a concrete bottleneck backlog.
|
|
8
|
-
- Uses a strict three-step loop: scan the codebase, choose this round's jobs and optimize, then update docs/constraints only when no actionable gap remains.
|
|
9
|
-
- Builds a module inventory and coverage ledger so every in-scope module receives a performance-oriented deep-read iteration before completion.
|
|
10
|
-
- Defines deep-read as a job-oriented scan across measurement, algorithmic complexity, repeated work, IO, batching, query behavior, caching, allocation churn, hot loops, concurrency, and staged unlock opportunities.
|
|
11
|
-
- Prioritizes measured or clearly complexity-backed bottlenecks over speculative micro-optimizations.
|
|
12
|
-
- Adds or updates benchmark, characterization, regression, load, or integration guardrails when optimization risk requires them.
|
|
13
|
-
- Requires confidence decisions to combine the agent's self-assessed ability, task complexity, guardrail strength, rollback or repair paths, and whether strong tests or benchmarks can safely drive broken optimizations back to green.
|
|
14
|
-
- Reduces avoidable repeated computation, unnecessary serialization/parsing, allocation churn, IO round trips, inefficient query patterns, and unbounded concurrency.
|
|
15
|
-
- Introduces caching or memoization only when ownership, invalidation, size bounds, and failure behavior are clear.
|
|
16
|
-
- Treats large coupled hot paths as staged unlock problems, not as automatic stop signals.
|
|
17
|
-
- Re-scans the full repository after every iteration and repeats while any known in-scope actionable performance issue or unvisited in-scope module remains.
|
|
18
|
-
- Synchronizes project docs and `AGENTS.md/CLAUDE.md` through `align-project-documents` and `maintain-project-constraints` after implementation.
|
|
19
|
-
|
|
20
|
-
## Repository structure
|
|
21
|
-
|
|
22
|
-
- `SKILL.md`: Main three-step loop, dependencies, guardrails, and output contract.
|
|
23
|
-
- `agents/openai.yaml`: Agent interface metadata and default prompt.
|
|
24
|
-
- `references/`: Focused guides for scanning, module coverage, job selection, measurement, algorithmic complexity, IO, caching, hot loops, concurrency, unlock work, and iteration gates.
|
|
25
|
-
|
|
26
|
-
## Typical usage
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
Use $iterative-code-performance to improve this repository's speed end to end without changing business behavior or macro architecture.
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## License
|
|
33
|
-
|
|
34
|
-
MIT. See `LICENSE`.
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: iterative-code-performance
|
|
3
|
-
description: >-
|
|
4
|
-
Improve an existing codebase through repeated evidence-based repository-wide
|
|
5
|
-
performance scans, module-by-module deep-read coverage, and behavior-safe
|
|
6
|
-
speed optimizations until no known in-scope actionable bottleneck or unvisited
|
|
7
|
-
in-scope module remains: measure hot paths, reduce algorithmic complexity,
|
|
8
|
-
remove avoidable repeated work, optimize IO and batching, control allocation
|
|
9
|
-
churn, improve caching only where invalidation is clear, and add benchmark or
|
|
10
|
-
regression guardrails while preserving intended business behavior and the
|
|
11
|
-
system's macro architecture. Use when users ask for comprehensive speed,
|
|
12
|
-
latency, throughput, CPU, memory-allocation, query, batching, or hot-path
|
|
13
|
-
optimization across a repository.
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# Iterative Code Performance
|
|
17
|
-
|
|
18
|
-
## Dependencies
|
|
19
|
-
|
|
20
|
-
- Required: `align-project-documents` and `maintain-project-constraints` after the repository is truly iteration-complete.
|
|
21
|
-
- Conditional: `systematic-debug` when a performance test, benchmark, load run, or production trace exposes a real business-logic defect that must be fixed at the true owner; `improve-observability` when profiling signals are missing or measurement requires durable logs, metrics, or traces.
|
|
22
|
-
- Optional: `improve-observability` for profiling signals or durable metrics needed during optimization.
|
|
23
|
-
- Fallback: If required completion dependencies are unavailable, finish performance work and validation first, then report exactly which documentation, constraint-sync, or observability action could not run.
|
|
24
|
-
|
|
25
|
-
## Standards
|
|
26
|
-
|
|
27
|
-
- Evidence: Read repository docs, project constraints, source, tests, logs, benchmarks, profiler output, build scripts, entrypoints, and nearby abstractions before editing; every optimization must be justified by measured evidence or clear complexity analysis tied to a plausible hot path.
|
|
28
|
-
- Execution: Run a continuous three-step loop of full-codebase performance scan → choose this round's jobs and optimize → if and only if the latest full-codebase scan is clear, update docs and constraints; otherwise return to scanning immediately. Maintain a module inventory and coverage ledger so every in-scope module receives a performance-oriented deep-read iteration before completion. Do not treat jobs as workflow steps. Do not produce a completion report while any known in-scope actionable bottleneck or unvisited in-scope module remains.
|
|
29
|
-
- Quality: Resolve as many inherited performance problems as safely possible without changing intended behavior or the system's macro architecture. Do not optimize by guessing, weakening correctness, adding stale caches, hiding failures, or moving cost to another critical path without evidence.
|
|
30
|
-
- Output: Return iteration-by-iteration decisions, selected jobs, module coverage status, changed files, speedup or complexity evidence, behavior-preservation evidence, benchmark and regression guardrails, validation results, and docs/constraint sync status only after the latest scan shows no remaining known actionable in-scope bottleneck and no unvisited in-scope module.
|
|
31
|
-
|
|
32
|
-
## Mission
|
|
33
|
-
|
|
34
|
-
Leave the repository materially faster by continuously scanning the whole codebase, landing the highest-value safe performance optimizations available at each moment, and repeating until there is no known in-scope actionable performance gap left to fix.
|
|
35
|
-
|
|
36
|
-
For this skill, `macro architecture` means the system's top-level runtime shape and overall operating logic: major subsystems, top-level execution model, deployment/runtime boundaries, persistence model, service boundaries, and the end-to-end way the whole system works. Ordinary module interactions, helper extraction, local data-structure changes, internal batching, query shaping, memoization inside an owner, and local hot-path decomposition do not count as macro-architecture changes by themselves.
|
|
37
|
-
|
|
38
|
-
## Three-Step Loop
|
|
39
|
-
|
|
40
|
-
### 1) Scan the repository
|
|
41
|
-
|
|
42
|
-
- Read root guidance first: `AGENTS.md/CLAUDE.md`, `README*`, package manifests, task runners, CI/test config, benchmark tooling, profiler setup, and major project docs.
|
|
43
|
-
- Map runtime entrypoints, domain modules, external integrations, persistence/query boundaries, queue or job workers, request paths, hot loops, and current performance guardrails.
|
|
44
|
-
- Exclude generated, vendored, lock, build-output, fixture, snapshot, or minified files unless evidence shows they are human-maintained source.
|
|
45
|
-
- Build or refresh a concrete repository-wide backlog of known actionable performance issues.
|
|
46
|
-
- Build or refresh a module inventory and coverage ledger; every in-scope module starts as unvisited until it has received a performance-oriented deep-read iteration with callers, callees, tests, logs, benchmarks, relevant contracts, and each available job lens inspected.
|
|
47
|
-
- Re-scan the full codebase after every landed iteration, not only the files just changed.
|
|
48
|
-
- Load `references/repository-scan.md` for the scan checklist and performance-backlog shaping rules.
|
|
49
|
-
- Load `references/module-coverage.md` for module inventory, performance deep-read coverage, easy-first ordering, and completion rules.
|
|
50
|
-
|
|
51
|
-
### 2) Choose this round's jobs and optimize
|
|
52
|
-
|
|
53
|
-
- Choose jobs only after the latest full-codebase performance scan. Jobs are optional execution directions, not ordered workflow steps.
|
|
54
|
-
- Treat module scanning and job choice as one linked activity: inspect the selected module through every available performance job lens before deciding which jobs actually land in this round.
|
|
55
|
-
- Select the smallest set of jobs that can safely improve the currently selected module or module cluster under current correctness and measurement guardrails.
|
|
56
|
-
- Before choosing or deferring an optimization, explicitly assess implementation confidence as a combination of the agent's own ability to understand and complete the change, the objective safety net from tests, benchmarks, and other guardrails, the clarity of rollback or repair paths, and the task's inherent difficulty. Do not treat difficulty alone as low confidence; when strong tests and benchmarks guard the behavior, use them to support bolder changes because failures can be driven back to green.
|
|
57
|
-
- Prefer evidence-first ordering: start with bottlenecks that are measured, user-visible, high-frequency, or have clear algorithmic waste; use easy-first module ordering when it builds profiling context, tests, benchmarks, or seams that make harder hot paths safer later.
|
|
58
|
-
- Do not keep revisiting familiar modules while other in-scope modules remain unvisited unless the familiar module blocks the next unvisited module's safe performance deep read.
|
|
59
|
-
- Prefer smaller, high-confidence optimizations that reduce latency, CPU, memory churn, IO round trips, or repeated work without broad behavior risk.
|
|
60
|
-
- If a desired optimization is high-risk and weakly guarded, make benchmark, characterization, or regression guardrail-building part of this round instead of stopping.
|
|
61
|
-
- If a file feels too coupled, too central, or too risky for a direct hot-path rewrite, do staged unlock work rather than declaring the area blocked.
|
|
62
|
-
- Read all directly affected callers, tests, interfaces, logs, persistence/query contracts, cache invalidation rules, and concurrency assumptions before editing.
|
|
63
|
-
- Validate from narrow to broad after each bounded round, then perform a full-codebase stage-gate decision:
|
|
64
|
-
- if any known in-scope actionable bottleneck still remains or any in-scope module has not received a deep-read iteration, return to Step 1;
|
|
65
|
-
- only continue to Step 3 when the latest scan is clear.
|
|
66
|
-
|
|
67
|
-
Load references for this step only as needed:
|
|
68
|
-
|
|
69
|
-
- `references/module-coverage.md` for choosing the next module and proving every in-scope module has been deeply read through the available performance-job lenses.
|
|
70
|
-
- `references/job-selection.md` for next-job choice conditions and tie-breakers.
|
|
71
|
-
- `references/measurement-and-benchmarking.md` for profiling, benchmark, baseline, and before/after comparison rules.
|
|
72
|
-
- `references/algorithmic-complexity.md` for complexity, data-structure, and repeated-work optimization.
|
|
73
|
-
- `references/io-batching-and-queries.md` for database, network, filesystem, external API, and batching optimization.
|
|
74
|
-
- `references/caching-and-memoization.md` for safe cache introduction, cache removal, and invalidation rules.
|
|
75
|
-
- `references/allocation-and-hot-loops.md` for CPU loops, allocation churn, serialization, parsing, and memory-pressure cleanup.
|
|
76
|
-
- `references/concurrency-and-pipelines.md` for bounded parallelism, async pipelines, backpressure, and queue throughput.
|
|
77
|
-
- `references/coupled-hot-path-strategy.md` for staged unlock work on large coupled or apparently core hot-path files.
|
|
78
|
-
- `references/iteration-gates.md` for validation cadence, stage-gate rules, and stop criteria.
|
|
79
|
-
|
|
80
|
-
### 3) Update project documents and constraints
|
|
81
|
-
|
|
82
|
-
Only enter this step when the latest full-codebase scan confirms there is no remaining known actionable in-scope performance issue and every in-scope module has received a deep-read iteration, except items explicitly classified as blocked, unsafe, speculative, low-value, excluded, approval-dependent, or requiring production-only measurement that is unavailable.
|
|
83
|
-
|
|
84
|
-
- Run `align-project-documents` when README, architecture notes, setup docs, benchmark docs, performance budgets, operational docs, or test guidance may have drifted.
|
|
85
|
-
- Run `maintain-project-constraints` to verify `AGENTS.md/CLAUDE.md` still matches the repository's real architecture, business flow, commands, and conventions.
|
|
86
|
-
- Update only the documentation and constraints that changed in reality because of the optimization.
|
|
87
|
-
|
|
88
|
-
## Hard Guardrails
|
|
89
|
-
|
|
90
|
-
- Do not change intended business logic while optimizing, except to fix a real defect exposed by tests and verified at the true owner.
|
|
91
|
-
- Do not change the system's macro architecture unless the user explicitly expands scope.
|
|
92
|
-
- Do not optimize from vibes alone; require measurement, traces, logs, benchmark baselines, complexity analysis, or repeatable workload evidence.
|
|
93
|
-
- Do not add caches without explicit ownership, invalidation, size bounds, failure behavior, and tests or equivalent validation.
|
|
94
|
-
- Do not improve one metric by silently worsening a more important user-visible path, correctness invariant, memory ceiling, or operator workflow.
|
|
95
|
-
- Do not use one-off scripts to rewrite product code.
|
|
96
|
-
- Do not stop early just because a hot path is large, central, or historically fragile; if a safe unlock step exists, that is the next job.
|
|
97
|
-
- Do not stop before every in-scope module has been inventoried, deeply read, and either improved, validated as clear, or explicitly deferred/excluded with evidence.
|
|
98
|
-
- Do not weaken tests, benchmarks, timeouts, or assertions to make an optimization pass; fix the real defect, stabilize the benchmark, or update stale expectations to stable invariants.
|
|
99
|
-
- Do not add micro-optimizations that make code harder to maintain unless evidence shows the path is hot enough to justify the tradeoff.
|
|
100
|
-
|
|
101
|
-
## Completion Report
|
|
102
|
-
|
|
103
|
-
Only report completion after Step 3 is done, the latest Step 1 scan is clear, and the module coverage ledger has no unvisited in-scope module.
|
|
104
|
-
|
|
105
|
-
Return:
|
|
106
|
-
|
|
107
|
-
1. Iterations completed and the jobs selected in each iteration.
|
|
108
|
-
2. Stage-gate verdict after each full-codebase re-scan.
|
|
109
|
-
3. Module coverage ledger summary: modules deep-read, improved, validated-clear, deferred, or excluded.
|
|
110
|
-
4. Key files changed and the performance issue each change resolved.
|
|
111
|
-
5. Speedup evidence, complexity change, or bottleneck-removal evidence, including baseline and after measurements where available.
|
|
112
|
-
6. Business behavior preservation evidence.
|
|
113
|
-
7. Benchmarks, regression tests, or other guardrails added or updated, including property/integration/E2E/load-test `N/A` reasons where relevant.
|
|
114
|
-
8. Validation commands and results.
|
|
115
|
-
9. Documentation and `AGENTS.md/CLAUDE.md` synchronization status.
|
|
116
|
-
10. Remaining blocked, production-measurement-only, or approval-dependent items, if any.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Iterative Code Performance"
|
|
3
|
-
short_description: "Optimize latency, throughput, CPU, IO, caching, and hot paths in repeated safe passes"
|
|
4
|
-
default_prompt: "Use $iterative-code-performance as a strict three-step loop. Step 1: scan the full repository for performance evidence, refresh the actionable bottleneck backlog, and maintain a module inventory plus performance coverage ledger. Step 2: choose this round's module or bounded module cluster, scan it through every available performance job lens, and only then decide which jobs actually land now; prioritize measured or clearly complexity-backed hot paths, jobs are selectable directions rather than workflow steps, and assess optimization confidence from your own ability to understand and complete the change, task complexity, guardrail strength, rollback or repair paths, and whether tests or benchmarks can drive accidental breakage back to green. If a high-risk hot path is weakly guarded add benchmarks, characterization tests, or other guardrails instead of stopping; if strong tests and benchmarks guard the behavior, use them to justify bolder safe optimizations rather than avoiding the work. If a file is too coupled or too central for direct optimization, switch to staged unlock work and keep progressing. After validation, run a full-codebase stage-gate; if any known in-scope actionable bottleneck remains or any in-scope module has not received a performance-oriented deep-read iteration, go back to Step 1 immediately. Step 3: only when the latest full-codebase performance scan is clear and every in-scope module is deeply read through the available-job lenses, run $align-project-documents and $maintain-project-constraints to synchronize docs and AGENTS.md/CLAUDE.md. Preserve intended business behavior and the system's macro architecture, keep correctness guardrails green, and do not write a completion report while actionable bottlenecks or unvisited modules still exist."
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Algorithmic Complexity And Repeated Work
|
|
2
|
-
|
|
3
|
-
## Signals
|
|
4
|
-
|
|
5
|
-
Look for:
|
|
6
|
-
|
|
7
|
-
- nested loops over growing inputs,
|
|
8
|
-
- repeated full scans to answer point lookups,
|
|
9
|
-
- repeated sorting when one sort or heap would do,
|
|
10
|
-
- filtering or mapping the same collection in many branches,
|
|
11
|
-
- recomputing derived values inside loops,
|
|
12
|
-
- repeated parsing, validation, normalization, or conversion of identical inputs,
|
|
13
|
-
- linear membership checks where sets or maps fit the domain,
|
|
14
|
-
- duplicated business-rule computation across callers.
|
|
15
|
-
|
|
16
|
-
## Safe optimization moves
|
|
17
|
-
|
|
18
|
-
- Precompute lookup maps or sets at the smallest correct ownership boundary.
|
|
19
|
-
- Move invariant computations out of loops.
|
|
20
|
-
- Replace repeated scans with grouped data structures.
|
|
21
|
-
- Sort once and reuse the ordering when the ordering contract is stable.
|
|
22
|
-
- Convert repeated validation or normalization into a named helper with tests.
|
|
23
|
-
- Preserve stable ordering when callers rely on it.
|
|
24
|
-
- Keep data structures local unless shared ownership and invalidation are clear.
|
|
25
|
-
|
|
26
|
-
## Complexity evidence
|
|
27
|
-
|
|
28
|
-
Record:
|
|
29
|
-
|
|
30
|
-
- current complexity and after complexity,
|
|
31
|
-
- input sizes where the improvement matters,
|
|
32
|
-
- any ordering, deduplication, or equality semantics,
|
|
33
|
-
- memory tradeoff,
|
|
34
|
-
- correctness guardrails.
|
|
35
|
-
|
|
36
|
-
Do not claim a complexity improvement when the change only moves cost to another equally hot path.
|
|
37
|
-
|
|
38
|
-
## Tradeoffs
|
|
39
|
-
|
|
40
|
-
Prefer readability-preserving optimizations first. More complex data structures are justified when:
|
|
41
|
-
|
|
42
|
-
- workload size is large enough,
|
|
43
|
-
- call frequency is high enough,
|
|
44
|
-
- the old implementation is measurably slow or asymptotically unsafe,
|
|
45
|
-
- tests or invariants prove equivalence.
|
|
46
|
-
|
|
47
|
-
Avoid clever micro-optimizations when the path is cold or the complexity cost is not material.
|
|
48
|
-
|
|
49
|
-
## Correctness checklist
|
|
50
|
-
|
|
51
|
-
Before and after complexity changes, verify:
|
|
52
|
-
|
|
53
|
-
- duplicates are handled the same way,
|
|
54
|
-
- stable ordering remains stable when required,
|
|
55
|
-
- null, empty, malformed, and boundary inputs behave the same,
|
|
56
|
-
- floating point, currency, timestamp, and locale semantics are unchanged,
|
|
57
|
-
- errors and side effects occur in the same order when order matters,
|
|
58
|
-
- public API and persistence contracts remain stable.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Allocation And Hot-Loop Cleanup
|
|
2
|
-
|
|
3
|
-
## Signals
|
|
4
|
-
|
|
5
|
-
Look for hot paths that:
|
|
6
|
-
|
|
7
|
-
- allocate new arrays, maps, regexes, formatters, buffers, or closures repeatedly,
|
|
8
|
-
- clone, copy, or stringify large objects unnecessarily,
|
|
9
|
-
- parse the same payload or date repeatedly,
|
|
10
|
-
- build strings through repeated concatenation in loops,
|
|
11
|
-
- perform expensive logging or serialization even when logs are disabled,
|
|
12
|
-
- retain large intermediate objects longer than needed,
|
|
13
|
-
- create short-lived promises or tasks in very tight loops.
|
|
14
|
-
|
|
15
|
-
## Safe cleanup moves
|
|
16
|
-
|
|
17
|
-
- Hoist invariant allocations out of loops.
|
|
18
|
-
- Reuse existing parsed or normalized values.
|
|
19
|
-
- Stream or chunk large data when repository patterns support it.
|
|
20
|
-
- Avoid building debug payloads unless the log level or trace is enabled.
|
|
21
|
-
- Replace repeated string concatenation with the project's idiomatic builder or join pattern.
|
|
22
|
-
- Keep object reuse local and simple; avoid shared mutable pooling unless the codebase already uses it safely.
|
|
23
|
-
|
|
24
|
-
## Memory tradeoffs
|
|
25
|
-
|
|
26
|
-
Some optimizations reduce CPU by using more memory. Record:
|
|
27
|
-
|
|
28
|
-
- maximum expected input size,
|
|
29
|
-
- retained memory lifetime,
|
|
30
|
-
- whether data is tenant/user/request scoped,
|
|
31
|
-
- cleanup or eviction behavior,
|
|
32
|
-
- effect on tail latency or garbage collection.
|
|
33
|
-
|
|
34
|
-
Do not retain large data globally without a clear lifecycle.
|
|
35
|
-
|
|
36
|
-
## Readability threshold
|
|
37
|
-
|
|
38
|
-
Allocation cleanup may make code less direct. Accept that tradeoff only when:
|
|
39
|
-
|
|
40
|
-
- profiler or benchmark evidence shows the path is hot,
|
|
41
|
-
- the new code remains understandable,
|
|
42
|
-
- comments or helper names explain non-obvious constraints,
|
|
43
|
-
- tests preserve the behavior being optimized.
|
|
44
|
-
|
|
45
|
-
## Validation
|
|
46
|
-
|
|
47
|
-
Use:
|
|
48
|
-
|
|
49
|
-
- allocation or memory benchmarks where available,
|
|
50
|
-
- profiler allocation samples,
|
|
51
|
-
- operation-count tests for avoidable repeated work,
|
|
52
|
-
- regression tests for empty, large, duplicate, and malformed inputs,
|
|
53
|
-
- end-to-end command/request checks when the hot loop affects public output.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# Caching And Memoization
|
|
2
|
-
|
|
3
|
-
## Use caching only when
|
|
4
|
-
|
|
5
|
-
- the same expensive computation or read repeats,
|
|
6
|
-
- the cached value has a clear owner,
|
|
7
|
-
- invalidation or expiration rules are explicit,
|
|
8
|
-
- stale data cannot violate business rules,
|
|
9
|
-
- memory growth is bounded,
|
|
10
|
-
- errors and partial results are handled deliberately,
|
|
11
|
-
- benchmark or profiling evidence shows caching is worthwhile.
|
|
12
|
-
|
|
13
|
-
## Prefer simpler fixes first
|
|
14
|
-
|
|
15
|
-
Before adding a cache, ask:
|
|
16
|
-
|
|
17
|
-
- Can repeated work be removed by computing once in the caller?
|
|
18
|
-
- Can the data structure be reshaped locally?
|
|
19
|
-
- Can the query or API call fetch all needed data in one pass?
|
|
20
|
-
- Can a pure helper accept precomputed inputs?
|
|
21
|
-
|
|
22
|
-
If yes, prefer the simpler change.
|
|
23
|
-
|
|
24
|
-
## Cache design checklist
|
|
25
|
-
|
|
26
|
-
Define:
|
|
27
|
-
|
|
28
|
-
- key shape and equality semantics,
|
|
29
|
-
- value ownership,
|
|
30
|
-
- lifecycle and invalidation trigger,
|
|
31
|
-
- maximum size or eviction policy,
|
|
32
|
-
- concurrency behavior,
|
|
33
|
-
- error caching policy,
|
|
34
|
-
- observability for hit, miss, eviction, or stale detection when useful,
|
|
35
|
-
- tests or benchmarks proving both correctness and value.
|
|
36
|
-
|
|
37
|
-
## Memoization boundaries
|
|
38
|
-
|
|
39
|
-
Good boundaries:
|
|
40
|
-
|
|
41
|
-
- within one request, command, job, or transaction,
|
|
42
|
-
- inside a pure helper for repeated identical inputs,
|
|
43
|
-
- around immutable configuration or static metadata with reload semantics,
|
|
44
|
-
- inside an owner module that already controls lifecycle.
|
|
45
|
-
|
|
46
|
-
Risky boundaries:
|
|
47
|
-
|
|
48
|
-
- global mutable caches with no invalidation,
|
|
49
|
-
- cross-tenant or cross-user caches,
|
|
50
|
-
- caches keyed by partial authorization context,
|
|
51
|
-
- caches around time-sensitive, money, inventory, permission, or security decisions,
|
|
52
|
-
- caches that hide external-service failures.
|
|
53
|
-
|
|
54
|
-
## Cache removal
|
|
55
|
-
|
|
56
|
-
Removing or narrowing a stale cache is a performance improvement when it:
|
|
57
|
-
|
|
58
|
-
- prevents memory leaks,
|
|
59
|
-
- avoids stale correctness risk,
|
|
60
|
-
- reduces invalidation overhead,
|
|
61
|
-
- improves tail latency by removing lock contention,
|
|
62
|
-
- simplifies a path where hit rate is low.
|
|
63
|
-
|
|
64
|
-
Validate both speed and correctness after removal.
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Concurrency And Pipeline Tuning
|
|
2
|
-
|
|
3
|
-
## Signals
|
|
4
|
-
|
|
5
|
-
Look for:
|
|
6
|
-
|
|
7
|
-
- independent work performed serially on a critical path,
|
|
8
|
-
- unbounded `Promise.all`, goroutines, tasks, threads, workers, or queue dispatch,
|
|
9
|
-
- missing backpressure between producer and consumer,
|
|
10
|
-
- retries that amplify overload,
|
|
11
|
-
- locks, mutexes, transactions, or global caches causing contention,
|
|
12
|
-
- long-running jobs that hold resources while waiting on slow IO,
|
|
13
|
-
- pipeline stages with mismatched throughput.
|
|
14
|
-
|
|
15
|
-
## Safe concurrency moves
|
|
16
|
-
|
|
17
|
-
- Add bounded concurrency with existing project primitives.
|
|
18
|
-
- Batch independent work while preserving ordering where required.
|
|
19
|
-
- Push slow side effects behind existing queues only when delivery semantics remain the same.
|
|
20
|
-
- Add cancellation, timeout, or backpressure only when consistent with current contracts.
|
|
21
|
-
- Reduce lock scope or shared mutable state when the owner is clear.
|
|
22
|
-
- Avoid parallelizing code that depends on side-effect ordering.
|
|
23
|
-
|
|
24
|
-
## Backpressure and limits
|
|
25
|
-
|
|
26
|
-
Define:
|
|
27
|
-
|
|
28
|
-
- maximum concurrency,
|
|
29
|
-
- queue size or batch size,
|
|
30
|
-
- retry and timeout behavior,
|
|
31
|
-
- downstream rate limits,
|
|
32
|
-
- partial-failure handling,
|
|
33
|
-
- ordering guarantees,
|
|
34
|
-
- cancellation behavior.
|
|
35
|
-
|
|
36
|
-
Do not introduce unbounded work in the name of throughput.
|
|
37
|
-
|
|
38
|
-
## Correctness risks
|
|
39
|
-
|
|
40
|
-
Concurrency changes can alter:
|
|
41
|
-
|
|
42
|
-
- result ordering,
|
|
43
|
-
- duplicate handling,
|
|
44
|
-
- idempotency,
|
|
45
|
-
- transaction boundaries,
|
|
46
|
-
- retry timing,
|
|
47
|
-
- log order,
|
|
48
|
-
- shared test state,
|
|
49
|
-
- resource cleanup.
|
|
50
|
-
|
|
51
|
-
Add tests or controlled integration runs for the specific risk.
|
|
52
|
-
|
|
53
|
-
## Validation
|
|
54
|
-
|
|
55
|
-
Prefer:
|
|
56
|
-
|
|
57
|
-
- deterministic unit tests for limiters and schedulers,
|
|
58
|
-
- integration tests with fake slow dependencies,
|
|
59
|
-
- operation-count or max-in-flight assertions,
|
|
60
|
-
- load tests only when throughput or backpressure is the core claim,
|
|
61
|
-
- logs or metrics that prove bounded behavior without leaking sensitive data.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Staged Strategy For Large Coupled Hot Paths
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Teach the agent how to keep making progress when a performance-sensitive file feels too central, too coupled, or too risky to optimize directly.
|
|
6
|
-
|
|
7
|
-
The correct response is usually not "stop". The correct response is "find the next unlock step".
|
|
8
|
-
|
|
9
|
-
## Core rule
|
|
10
|
-
|
|
11
|
-
A large coupled hot path is a **decomposition and measurement signal**, not a **completion blocker**.
|
|
12
|
-
|
|
13
|
-
If a safe, behavior-preserving unlock step exists under current guardrails, take that step now instead of deferring the whole area.
|
|
14
|
-
|
|
15
|
-
If measurement or correctness guardrails are too weak for direct optimization, strengthening them is itself the next unlock step.
|
|
16
|
-
|
|
17
|
-
## First questions to ask
|
|
18
|
-
|
|
19
|
-
When a hot path feels untouchable, ask:
|
|
20
|
-
|
|
21
|
-
- Which part is actually slow, and how do we know?
|
|
22
|
-
- Which work is pure computation, IO, allocation, synchronization, or side effect?
|
|
23
|
-
- Which workload shape, input size, or data distribution matters?
|
|
24
|
-
- Which behavior can be locked down with characterization tests?
|
|
25
|
-
- Which benchmark or profiler hook would isolate the bottleneck?
|
|
26
|
-
- Which dependency seam can be introduced without changing behavior?
|
|
27
|
-
- Which optimization would most reduce the cost of the next optimization?
|
|
28
|
-
|
|
29
|
-
## Typical unlock sequence
|
|
30
|
-
|
|
31
|
-
Pick one or more of these, in the order justified by current evidence:
|
|
32
|
-
|
|
33
|
-
1. Add timing, profiling, benchmark, or characterization guardrails around current behavior.
|
|
34
|
-
2. Extract pure transformations or workload-shape calculations.
|
|
35
|
-
3. Name and isolate expensive repeated work.
|
|
36
|
-
4. Separate query/IO preparation from pure decision logic.
|
|
37
|
-
5. Introduce a narrow batching, lookup, or data-structure seam.
|
|
38
|
-
6. Isolate cache ownership and invalidation decisions.
|
|
39
|
-
7. Separate concurrency control from per-item business logic.
|
|
40
|
-
8. Re-scan and decide whether a deeper optimization is now safer.
|
|
41
|
-
|
|
42
|
-
## What not to do
|
|
43
|
-
|
|
44
|
-
Avoid these anti-patterns:
|
|
45
|
-
|
|
46
|
-
- declaring the area blocked just because it is important,
|
|
47
|
-
- attempting a full hot-path rewrite before guardrails exist,
|
|
48
|
-
- adding a cache because measurement is missing,
|
|
49
|
-
- removing correctness checks to make the benchmark faster,
|
|
50
|
-
- parallelizing side effects without proving ordering and idempotency,
|
|
51
|
-
- escalating ordinary internal optimization into a fake macro-architecture concern,
|
|
52
|
-
- mixing unlock work with unrelated style churn.
|
|
53
|
-
|
|
54
|
-
## Choosing the next step
|
|
55
|
-
|
|
56
|
-
Prefer the next step that maximizes:
|
|
57
|
-
|
|
58
|
-
1. combined confidence from the agent's own ability, workload understanding, existing tests, benchmarks, or quickly addable guardrails,
|
|
59
|
-
2. quality of performance evidence,
|
|
60
|
-
3. leverage for future deeper optimization,
|
|
61
|
-
4. reduction in repeated work, IO, allocation, or contention,
|
|
62
|
-
5. low risk to current business behavior.
|
|
63
|
-
|
|
64
|
-
If two steps are both safe, choose the one that makes the next iteration easier to measure or validate.
|
|
65
|
-
|
|
66
|
-
If the file is high-risk and under-tested, prefer adding the smallest useful characterization or benchmark guardrails before attempting deeper edits. If the file is high-risk but well-guarded, do not stop only because the change is difficult; use the guardrails to validate the agent's work and repair any accidental breakage.
|
|
67
|
-
|
|
68
|
-
## Completion rule for coupled hot paths
|
|
69
|
-
|
|
70
|
-
Do not ask "Can I solve the whole file now?"
|
|
71
|
-
|
|
72
|
-
Ask:
|
|
73
|
-
|
|
74
|
-
- "Can I measure this path more accurately in the next iteration?"
|
|
75
|
-
- "Can I make this path meaningfully cheaper in the next iteration?"
|
|
76
|
-
- "Can I reduce repeated work, IO, allocation, contention, or cache risk right now?"
|
|
77
|
-
|
|
78
|
-
If the answer is yes, continue iterating.
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# IO Batching And Query Optimization
|
|
2
|
-
|
|
3
|
-
## IO signals
|
|
4
|
-
|
|
5
|
-
Look for:
|
|
6
|
-
|
|
7
|
-
- N+1 database, network, filesystem, or external API calls,
|
|
8
|
-
- repeated reads of the same file, config, secret, or remote resource,
|
|
9
|
-
- chatty persistence writes that can be safely combined,
|
|
10
|
-
- missing projection or over-fetching large records,
|
|
11
|
-
- queries that load broad datasets then filter in memory,
|
|
12
|
-
- serial external calls that are independent and can be bounded or batched,
|
|
13
|
-
- retry loops that multiply downstream load.
|
|
14
|
-
|
|
15
|
-
## Safe batching moves
|
|
16
|
-
|
|
17
|
-
- Batch by the natural owner boundary and preserve per-item error reporting.
|
|
18
|
-
- Use existing repository query builders, clients, and retry conventions.
|
|
19
|
-
- Fetch only required fields when the API supports projection.
|
|
20
|
-
- Push filtering, pagination, aggregation, or joins to the datastore only when semantics match.
|
|
21
|
-
- Add bounded concurrency instead of unbounded fan-out.
|
|
22
|
-
- Preserve idempotency, ordering guarantees, and partial-failure behavior.
|
|
23
|
-
|
|
24
|
-
## Query shaping
|
|
25
|
-
|
|
26
|
-
Before changing a query, identify:
|
|
27
|
-
|
|
28
|
-
- source of truth and owner module,
|
|
29
|
-
- expected row or document counts,
|
|
30
|
-
- indexes or access patterns already documented,
|
|
31
|
-
- transaction and consistency requirements,
|
|
32
|
-
- pagination and sorting contract,
|
|
33
|
-
- caller expectations around missing or duplicate records.
|
|
34
|
-
|
|
35
|
-
Do not add indexes, migrations, or datastore-level changes unless the user scope and repository conventions support them.
|
|
36
|
-
|
|
37
|
-
## External services
|
|
38
|
-
|
|
39
|
-
For network and API paths:
|
|
40
|
-
|
|
41
|
-
- respect provider rate limits and retry guidance,
|
|
42
|
-
- avoid batching that exceeds request-size limits,
|
|
43
|
-
- preserve timeout and cancellation behavior,
|
|
44
|
-
- keep request IDs and correlation fields in logs,
|
|
45
|
-
- use mocks, fakes, or recorded fixtures for tests when real services are not under test.
|
|
46
|
-
|
|
47
|
-
## Validation
|
|
48
|
-
|
|
49
|
-
Prefer guardrails that verify:
|
|
50
|
-
|
|
51
|
-
- query or request count decreases,
|
|
52
|
-
- result set and ordering are unchanged,
|
|
53
|
-
- partial failures are reported the same way,
|
|
54
|
-
- retries and timeouts still follow existing policy,
|
|
55
|
-
- batching preserves per-item authorization and validation.
|