@laitszkin/apollo-toolkit 3.1.3 → 3.1.5
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 +10 -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/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/iterative-code-quality/README.md +7 -1
- package/iterative-code-quality/SKILL.md +43 -19
- package/iterative-code-quality/agents/openai.yaml +1 -1
- package/iterative-code-quality/references/coupled-core-file-strategy.md +69 -0
- package/iterative-code-quality/references/iteration-gates.md +33 -5
- package/iterative-code-quality/references/module-boundaries.md +22 -0
- package/iterative-code-quality/references/testing-strategy.md +2 -0
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- 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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ All notable changes to this repository are documented in this file.
|
|
|
7
7
|
### Changed
|
|
8
8
|
- None yet.
|
|
9
9
|
|
|
10
|
+
## [v3.1.5] - 2026-04-23
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Strengthen `iterative-code-quality` so large coupled or apparently core files trigger staged unlock work instead of passive stopping, and require a full-codebase stage-gate decision after every iteration to determine whether additional rounds are still needed.
|
|
14
|
+
|
|
15
|
+
## [v3.1.4] - 2026-04-23
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Refine `iterative-code-quality` so it now treats naming, abstraction, module boundaries, logging, and tests as selectable execution directions under continuous full-codebase rescans, guiding agents to choose the highest-confidence, highest-leverage gradual refactors that prepare the ground for deeper later cleanup while preserving behavior under green guardrails and a precise system-level definition of macro architecture.
|
|
19
|
+
|
|
10
20
|
## [v3.1.3] - 2026-04-23
|
|
11
21
|
|
|
12
22
|
### Changed
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
# iterative-code-quality
|
|
2
2
|
|
|
3
|
-
Improve an existing repository through repeated, evidence-backed
|
|
3
|
+
Improve an existing repository through repeated, evidence-backed full-iteration refactors while preserving intended business behavior and the system's top-level macro architecture.
|
|
4
4
|
|
|
5
5
|
## Core capabilities
|
|
6
6
|
|
|
7
7
|
- Scans the full codebase and builds a prioritized quality backlog before editing.
|
|
8
|
+
- Treats naming, abstraction, module boundaries, logging, and tests as selectable execution directions rather than a fixed sequence.
|
|
8
9
|
- Clarifies ambiguous variable, parameter, field, helper, and test-data names.
|
|
9
10
|
- Simplifies complex functions and extracts reusable helpers only when they centralize real behavior.
|
|
10
11
|
- Splits mixed-responsibility code into narrower modules without changing macro architecture.
|
|
11
12
|
- Repairs stale or missing logs and adds tests for important observability contracts.
|
|
12
13
|
- Adds high-value unit, property-based, integration, or E2E tests based on risk.
|
|
13
14
|
- Uses those tests and other guardrails to justify more aggressive refactors, instead of leaving known issues in place for subjective confidence reasons.
|
|
15
|
+
- Re-scans the full repository after every iteration and picks the next highest-confidence, highest-leverage directions.
|
|
16
|
+
- Uses small safe refactors to prepare the ground for larger later refactors, progressing gradually from outside to inside.
|
|
17
|
+
- Treats large coupled or apparently core files as staged unlock problems, not as automatic stop signals.
|
|
18
|
+
- Runs a stage-gate full-codebase decision after every iteration to decide whether more rounds are still required.
|
|
14
19
|
- Repeats the pass cycle while any known in-scope actionable quality issue remains, and forbids a completion report until the latest scan is clear or remaining items are explicitly deferred with a valid reason.
|
|
20
|
+
- Targets as many inherited repository quality problems as can be solved safely, and expects the guarded test surface to remain green after the refactor.
|
|
15
21
|
- Synchronizes project docs and `AGENTS.md` through `align-project-documents` and `maintain-project-constraints` after implementation.
|
|
16
22
|
|
|
17
23
|
## Repository structure
|
|
@@ -5,7 +5,7 @@ description: >-
|
|
|
5
5
|
passes: clarify poor variable names, simplify or extract reusable functions,
|
|
6
6
|
split oversized code into single-responsibility modules, repair stale or
|
|
7
7
|
missing logs, and add high-value tests while preserving business behavior and
|
|
8
|
-
macro architecture. Use when users ask for comprehensive refactoring, code
|
|
8
|
+
system-level macro architecture. Use when users ask for comprehensive refactoring, code
|
|
9
9
|
cleanup, maintainability hardening, naming cleanup, log alignment, or test
|
|
10
10
|
coverage improvement across a repository.
|
|
11
11
|
---
|
|
@@ -22,15 +22,17 @@ description: >-
|
|
|
22
22
|
## Standards
|
|
23
23
|
|
|
24
24
|
- Evidence: Read repository docs, project constraints, source, tests, logs, and entrypoints before editing; every rename, extraction, split, log update, or test must be backed by code context.
|
|
25
|
-
- Execution:
|
|
26
|
-
- Quality:
|
|
25
|
+
- Execution: Continuously re-scan the full codebase, treat naming, abstraction, module boundaries, logging, and tests as selectable execution directions rather than a fixed sequence, choose the highest-confidence directions that can safely land now, and use those smaller refactors to prepare the ground for larger future refactors; validate after each iteration, then keep iterating while any known in-scope codebase quality issue remains unresolved; when tests or other reliable guardrails can prove equivalence, prefer taking the refactor instead of deferring it for subjective confidence reasons; do not produce the completion report while the scan still contains actionable gaps.
|
|
26
|
+
- Quality: Solve as many inherited code-quality problems as safely possible without changing intended behavior or the system's macro architecture; avoid style-only churn, compatibility theater, broad rewrites, and unverified "cleanup", but do not reject a worthwhile refactor purely because it feels risky when existing or newly added guardrails can verify it safely.
|
|
27
27
|
- Output: Deliver a concise pass-by-pass summary, changed behavior-neutral surfaces, test coverage added, validation results, and documentation/`AGENTS.md` sync status only after every known in-scope quality issue is resolved or explicitly classified as blocked, unsafe, low-value, speculative, or requiring user approval.
|
|
28
28
|
|
|
29
29
|
## Goal
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Resolve as many inherited repository quality problems as possible without breaking intended behavior, and use tests plus other reliable guardrails to prove that the refactor leaves the project in a fully green state.
|
|
32
32
|
|
|
33
|
-
This skill is intentionally implementation-oriented, not report-only. It should
|
|
33
|
+
This skill is intentionally implementation-oriented, not report-only. It should keep scanning the full codebase, choose the best available refactor directions at each moment, apply as much safe cleanup as the repository can support, add or strengthen tests to guard the refactor, and use incremental cleanup to unlock deeper improvements over time. If a post-iteration scan finds remaining actionable gaps, continue the next iteration instead of writing a completion report.
|
|
34
|
+
|
|
35
|
+
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 responsibility moves, and internal call-boundary cleanup do not count as macro-architecture changes by themselves.
|
|
34
36
|
|
|
35
37
|
## Required Reference Loading
|
|
36
38
|
|
|
@@ -39,6 +41,7 @@ Load references only when they match the active pass:
|
|
|
39
41
|
- `references/repository-scan.md`: scope mapping, generated-file exclusions, and quality backlog selection.
|
|
40
42
|
- `references/naming-and-simplification.md`: variable renames, function simplification, reusable extraction, and behavior-preservation checks.
|
|
41
43
|
- `references/module-boundaries.md`: single-responsibility split heuristics and safe module extraction rules.
|
|
44
|
+
- `references/coupled-core-file-strategy.md`: staged unlock strategy for large, coupled, or apparently core files that should not become stop signals.
|
|
42
45
|
- `references/logging-alignment.md`: stale log detection, missing log criteria, and behavior-neutral observability updates.
|
|
43
46
|
- `references/testing-strategy.md`: risk-based unit, property, integration, and E2E coverage selection.
|
|
44
47
|
- `references/iteration-gates.md`: multi-pass quality gates, stopping criteria, and validation cadence.
|
|
@@ -54,9 +57,11 @@ Load references only when they match the active pass:
|
|
|
54
57
|
- Build an initial quality backlog with concrete file/function/test targets before changing code.
|
|
55
58
|
- Use `references/repository-scan.md` for the scan checklist and backlog scoring.
|
|
56
59
|
|
|
57
|
-
### 2) Execute
|
|
60
|
+
### 2) Execute continuous full scans with selectable directions
|
|
61
|
+
|
|
62
|
+
Do not force one fixed order such as "finish naming first, then abstraction, then modules". Instead, keep re-scanning the whole codebase and select the execution directions that are highest-confidence and highest-leverage right now.
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
Treat these as multi-select execution directions, not mandatory sequential stages:
|
|
60
65
|
|
|
61
66
|
1. Naming clarity for variables, parameters, fields, local helpers, and test data.
|
|
62
67
|
2. Function simplification and reusable extraction for duplicated or hard-coded workflows.
|
|
@@ -64,15 +69,23 @@ Run focused passes in the order that fits the repository evidence. A typical ord
|
|
|
64
69
|
4. Logging alignment for stale, misleading, missing, or low-context diagnostics.
|
|
65
70
|
5. Risk-based test coverage for high-value business logic and boundary cases.
|
|
66
71
|
|
|
67
|
-
|
|
72
|
+
Direction-selection rules:
|
|
73
|
+
|
|
74
|
+
- Prefer the directions with the strongest current evidence and best guardrails.
|
|
75
|
+
- Prefer smaller, higher-confidence refactors that unlock or de-risk larger later refactors.
|
|
76
|
+
- Prefer outside-in progress: stabilize boundaries, callers, naming, logs, and tests around a subsystem before attempting deeper internal rewrites.
|
|
77
|
+
- Re-evaluate the whole backlog after every landed iteration; the next best direction may change because the previous cleanup improved the local safety or clarity.
|
|
78
|
+
- When a file appears too coupled, too central, or too risky for a direct rewrite, treat that as a prompt to switch into staged unlock work rather than a reason to stop. Load `references/coupled-core-file-strategy.md` and choose the next smallest refactor that reduces future risk.
|
|
79
|
+
|
|
80
|
+
For each iteration:
|
|
68
81
|
|
|
69
82
|
- Read all directly affected callers, tests, and public interfaces before editing.
|
|
70
|
-
- Keep the
|
|
83
|
+
- Keep the scope small enough to validate and review, and select whichever directions are most justified for that scope instead of forcing every direction to appear in every iteration.
|
|
71
84
|
- Prefer repository-native abstractions over new parallel frameworks.
|
|
72
85
|
- Preserve public behavior, data contracts, side effects, error classes, and macro architecture.
|
|
73
|
-
- Add or update tests in the same
|
|
86
|
+
- Add or update tests in the same iteration when the change touches non-trivial logic, observability contracts, or extracted helpers.
|
|
74
87
|
- If strong guardrails exist or can be added cheaply, prefer the clearer or more maintainable refactor instead of leaving a known issue in place due to subjective caution alone.
|
|
75
|
-
- Validate the touched scope before starting another
|
|
88
|
+
- Validate the touched scope before starting another iteration.
|
|
76
89
|
|
|
77
90
|
### 3) Rename for clarity without churn
|
|
78
91
|
|
|
@@ -96,10 +109,18 @@ For each pass:
|
|
|
96
109
|
- Split code only when one file/module owns multiple change reasons, domain boundaries, external integrations, or lifecycle stages.
|
|
97
110
|
- Define the new module's responsibility before moving code.
|
|
98
111
|
- Keep interfaces narrow, explicit, and consistent with existing project style.
|
|
99
|
-
- Avoid macro-architecture changes such as new layers, new service boundaries, new persistence strategies, or framework swaps unless the user explicitly expands scope.
|
|
112
|
+
- Avoid macro-architecture changes such as new top-level layers, new service boundaries, new persistence strategies, deployment/runtime model changes, or framework swaps unless the user explicitly expands scope.
|
|
100
113
|
- When module boundaries are currently poor but can be protected by focused tests or other guardrails, choose the cleaner split instead of preserving a mixed-responsibility file out of caution alone.
|
|
101
114
|
- Use `references/module-boundaries.md` for extraction rules and anti-patterns.
|
|
102
115
|
|
|
116
|
+
### 5.1) Handle large coupled or apparently core files through unlock work
|
|
117
|
+
|
|
118
|
+
- Do not treat a large coupled file, a central orchestrator, or a historically fragile module as an automatic stop condition.
|
|
119
|
+
- First ask: what is the next smallest refactor that lowers the risk of changing this area later without changing business behavior now?
|
|
120
|
+
- Prefer unlock steps such as characterization tests, naming cleanup, type extraction, pure-function extraction, side-effect boundary isolation, read/write path separation, dependency seam introduction, and caller grouping.
|
|
121
|
+
- Only stop when no such unlock step can be identified under current guardrails. If an unlock step exists, do it before reconsidering the larger refactor.
|
|
122
|
+
- Use `references/coupled-core-file-strategy.md` whenever the current obstacle is "too coupled", "too central", or "too risky to touch directly".
|
|
123
|
+
|
|
103
124
|
### 6) Repair logging and observability drift
|
|
104
125
|
|
|
105
126
|
- Compare log messages, event names, structured fields, metrics, and trace names against the current code ownership model.
|
|
@@ -118,11 +139,14 @@ For each pass:
|
|
|
118
139
|
- If a new test exposes an existing business-logic bug, invoke `systematic-debug`, fix the true owner, and keep the regression test.
|
|
119
140
|
- Use `references/testing-strategy.md` for coverage selection and required `N/A` reasoning.
|
|
120
141
|
|
|
121
|
-
### 8) Iterate until
|
|
142
|
+
### 8) Iterate gradually from outside to inside until the repository is clear of known actionable issues
|
|
122
143
|
|
|
123
|
-
- After each
|
|
124
|
-
- Re-scan
|
|
125
|
-
-
|
|
144
|
+
- After each iteration, run the narrowest relevant tests first, then broaden validation until the changed scope and final repository state are adequately guarded.
|
|
145
|
+
- Re-scan the full codebase, not only the touched area, because the best next direction may have shifted after the last cleanup.
|
|
146
|
+
- Perform an explicit stage-gate decision after that full-codebase scan: decide whether all known in-scope issues are now resolved, whether remaining issues are only legitimately deferred categories, or whether another iteration is required right now.
|
|
147
|
+
- Re-rank the backlog after every iteration and choose the next highest-confidence, highest-leverage direction set.
|
|
148
|
+
- Use small external or boundary-level cleanups to make later deeper refactors safer; treat that groundwork as progress toward a thorough long-horizon refactor, not as a distraction from it.
|
|
149
|
+
- Repeat the full iteration whenever any known in-scope actionable gap remains and can be fixed safely without changing business behavior or macro architecture.
|
|
126
150
|
- Do not write the completion report, summarize the task as done, or hand back as complete while the latest scan still contains known actionable quality issues.
|
|
127
151
|
- Stop only when every known in-scope issue has been resolved, or each remaining candidate is explicitly classified as low-value, speculative, blocked, unsafe, or requiring product/architecture approval.
|
|
128
152
|
- Use `references/iteration-gates.md` for stopping criteria.
|
|
@@ -138,7 +162,7 @@ After code and tests are complete:
|
|
|
138
162
|
## Hard Guardrails
|
|
139
163
|
|
|
140
164
|
- Do not change intended business logic while refactoring.
|
|
141
|
-
- Do not change macro architecture
|
|
165
|
+
- Do not change the system's macro architecture—its top-level runtime shape, deployment/runtime model, persistence model, major service boundaries, or overall operating logic—unless the user explicitly approves that expanded scope.
|
|
142
166
|
- Do not use one-off scripts to rewrite product code.
|
|
143
167
|
- Do not perform style-only churn that does not improve naming, reuse, modularity, observability, or test confidence.
|
|
144
168
|
- Do not weaken tests to make refactors pass; update tests to stable invariants or fix the implementation defect.
|
|
@@ -146,11 +170,11 @@ After code and tests are complete:
|
|
|
146
170
|
|
|
147
171
|
## Completion Report
|
|
148
172
|
|
|
149
|
-
Only write this report after the latest scan confirms there are no known actionable in-scope quality issues remaining. If any such issue remains, continue iterating instead of reporting completion.
|
|
173
|
+
Only write this report after the latest scan confirms there are no known actionable in-scope quality issues remaining and the relevant test/guardrail suite is green. If any such issue remains, continue iterating instead of reporting completion.
|
|
150
174
|
|
|
151
175
|
Return:
|
|
152
176
|
|
|
153
|
-
1.
|
|
177
|
+
1. Iterations completed, which execution directions were selected in each one, and the stage-gate decision after each full-codebase re-scan.
|
|
154
178
|
2. Key files changed and the quality issue each change resolved.
|
|
155
179
|
3. Business behavior preservation evidence.
|
|
156
180
|
4. Tests added or updated, including property/integration/E2E `N/A` reasons where relevant.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Iterative Code Quality"
|
|
3
3
|
short_description: "Refactor names, functions, modules, logs, and tests in repeated behavior-safe passes"
|
|
4
|
-
default_prompt: "Use $iterative-code-quality to
|
|
4
|
+
default_prompt: "Use $iterative-code-quality to keep scanning the full repository, treat naming, simplification, reusable extraction, module-boundary cleanup, logging alignment, and testing as selectable execution directions rather than a fixed sequence, and choose the highest-confidence, highest-leverage directions available at each moment; use small safe refactors to prepare the ground for larger later refactors, progress gradually from outside to inside, and when a file feels too coupled or too central switch into staged unlock work instead of stopping; use tests or other reliable guardrails to justify aggressive cleanup without breaking intended behavior or the system's top-level runtime architecture, run a full-codebase stage-gate after each iteration to decide whether another round is required, and do not write a completion report while any known in-scope actionable issue remains; only finish after the latest full-codebase scan is clear or remaining items are explicitly classified as blocked, unsafe, low-value, speculative, or approval-dependent, and the guarded test surface is green; then run $align-project-documents and $maintain-project-constraints to synchronize docs and AGENTS.md."
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Staged Strategy For Large Coupled Or Apparently Core Files
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Teach the agent how to keep making progress when a file feels too central, too coupled, or too risky to refactor 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 file is a **decomposition 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
|
+
## First questions to ask
|
|
16
|
+
|
|
17
|
+
When a file feels untouchable, ask:
|
|
18
|
+
|
|
19
|
+
- Which parts are pure logic and which parts are side effects?
|
|
20
|
+
- Which names or local concepts are blocking understanding?
|
|
21
|
+
- Which behavior can be locked down with characterization tests?
|
|
22
|
+
- Which dependency seams can be introduced without changing behavior?
|
|
23
|
+
- Which caller groups or workflow slices can be isolated first?
|
|
24
|
+
- Which refactor would most reduce the cost of the next refactor?
|
|
25
|
+
|
|
26
|
+
## Typical unlock sequence
|
|
27
|
+
|
|
28
|
+
Pick one or more of these, in the order justified by current evidence:
|
|
29
|
+
|
|
30
|
+
1. Add characterization or regression tests around current behavior.
|
|
31
|
+
2. Rename confusing variables, flags, intermediate states, and helper names.
|
|
32
|
+
3. Extract constants, schemas, types, and small pure transformations.
|
|
33
|
+
4. Separate read path from write path, or decision logic from side effects.
|
|
34
|
+
5. Isolate external calls, persistence, and logging behind clearer seams.
|
|
35
|
+
6. Group callers by responsibility and split one slice at a time.
|
|
36
|
+
7. Move one coherent responsibility into a new internal module.
|
|
37
|
+
8. Re-scan and decide whether a deeper split is now safer.
|
|
38
|
+
|
|
39
|
+
## What not to do
|
|
40
|
+
|
|
41
|
+
Avoid these anti-patterns:
|
|
42
|
+
|
|
43
|
+
- declaring the area blocked just because it is important,
|
|
44
|
+
- attempting a full rewrite before guardrails exist,
|
|
45
|
+
- preserving obvious local design debt only because the file is central,
|
|
46
|
+
- escalating ordinary internal decomposition into a fake macro-architecture concern,
|
|
47
|
+
- mixing unlock work with unrelated style churn.
|
|
48
|
+
|
|
49
|
+
## Choosing the next step
|
|
50
|
+
|
|
51
|
+
Prefer the next step that maximizes:
|
|
52
|
+
|
|
53
|
+
1. confidence under existing tests or quickly addable tests,
|
|
54
|
+
2. leverage for future deeper cleanup,
|
|
55
|
+
3. reduction in coupling or cognitive load,
|
|
56
|
+
4. low risk to current business behavior.
|
|
57
|
+
|
|
58
|
+
If two steps are both safe, choose the one that makes the next iteration easier.
|
|
59
|
+
|
|
60
|
+
## Completion rule for coupled files
|
|
61
|
+
|
|
62
|
+
Do not ask "Can I solve the whole file now?"
|
|
63
|
+
|
|
64
|
+
Ask:
|
|
65
|
+
|
|
66
|
+
- "Can I make this file meaningfully easier to change in the next iteration?"
|
|
67
|
+
- "Can I reduce coupling, clarify ownership, or improve guardrails right now?"
|
|
68
|
+
|
|
69
|
+
If the answer is yes, continue iterating.
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Pass discipline
|
|
4
4
|
|
|
5
|
-
Each
|
|
5
|
+
Each iteration must have:
|
|
6
6
|
|
|
7
7
|
- a concrete quality target,
|
|
8
8
|
- a bounded file/symbol scope,
|
|
9
|
+
- one or more selected execution directions,
|
|
9
10
|
- expected behavior-neutral outcome,
|
|
10
11
|
- validation plan,
|
|
11
12
|
- rollback point if evidence contradicts the change.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
An iteration is not "one work type", and it also does not need to include every direction every time. Within the selected scope, choose the subset of directions that has the best current confidence and leverage: naming, simplification, module boundaries, logging, and/or tests.
|
|
15
|
+
|
|
16
|
+
Avoid starting a broad second iteration before validating the first, but do not stop after a validated iteration if known actionable quality issues remain anywhere in the in-scope codebase.
|
|
14
17
|
|
|
15
18
|
## Validation cadence
|
|
16
19
|
|
|
@@ -30,9 +33,11 @@ If validation fails:
|
|
|
30
33
|
|
|
31
34
|
If validation passes and the guardrails meaningfully cover the changed behavior, do not keep a known quality issue in place purely because of subjective confidence concerns.
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
The final stopping condition also requires the relevant guarded test surface to be green; a partially red repository is not a completed refactor outcome.
|
|
37
|
+
|
|
38
|
+
## Re-scan after each iteration
|
|
34
39
|
|
|
35
|
-
Inspect
|
|
40
|
+
Inspect the full known quality backlog for:
|
|
36
41
|
|
|
37
42
|
- new naming drift from moved or extracted concepts,
|
|
38
43
|
- duplicated logic that remains after extraction,
|
|
@@ -41,6 +46,24 @@ Inspect touched areas and the full known quality backlog for:
|
|
|
41
46
|
- tests that cover only the happy path,
|
|
42
47
|
- documentation or `AGENTS.md` drift.
|
|
43
48
|
|
|
49
|
+
Then choose the next execution directions with these priorities:
|
|
50
|
+
|
|
51
|
+
1. highest confidence under current guardrails,
|
|
52
|
+
2. strongest leverage for later deeper cleanup,
|
|
53
|
+
3. lowest business-risk path toward broader system improvement.
|
|
54
|
+
|
|
55
|
+
## Stage-gate after each iteration
|
|
56
|
+
|
|
57
|
+
After every validated iteration, run a deliberate full-codebase decision pass:
|
|
58
|
+
|
|
59
|
+
1. Re-scan the repository and refresh the known quality backlog.
|
|
60
|
+
2. Ask whether any known in-scope actionable issue still remains.
|
|
61
|
+
3. If yes, decide whether it should be addressed in the very next iteration or whether first-step unlock work is needed.
|
|
62
|
+
4. If the obstacle is a large, coupled, or central file, do not stop there; switch to staged unlock work and continue.
|
|
63
|
+
5. Only declare the repository iteration-complete when the re-scan shows no remaining actionable in-scope issue except items that are explicitly deferred under the allowed stop categories.
|
|
64
|
+
|
|
65
|
+
This stage-gate is mandatory. A validated local change does not by itself mean the repository is done.
|
|
66
|
+
|
|
44
67
|
## Continue when
|
|
45
68
|
|
|
46
69
|
Repeat the cycle when:
|
|
@@ -52,7 +75,9 @@ Repeat the cycle when:
|
|
|
52
75
|
- logs are still misleading or missing at critical decisions,
|
|
53
76
|
- high-value business logic remains untested and is testable.
|
|
54
77
|
|
|
55
|
-
Do not produce a final completion report while any item in this section is true. Continue with the next bounded
|
|
78
|
+
Do not produce a final completion report while any item in this section is true. Continue with the next bounded iteration instead.
|
|
79
|
+
|
|
80
|
+
Prefer gradual outside-in progress: boundary cleanup, naming clarity, and guardrail strengthening should often come before deeper internal rewrites because they make the deeper work safer later.
|
|
56
81
|
|
|
57
82
|
## Stop when
|
|
58
83
|
|
|
@@ -73,7 +98,10 @@ If a remaining candidate cannot be placed in one of these categories, it is stil
|
|
|
73
98
|
The final report should make the stopping point auditable:
|
|
74
99
|
|
|
75
100
|
- passes completed,
|
|
101
|
+
- execution directions selected per iteration,
|
|
102
|
+
- stage-gate verdict after each full-codebase re-scan,
|
|
76
103
|
- validation commands and outcomes,
|
|
104
|
+
- confirmation that the guarded test surface is green after the refactor,
|
|
77
105
|
- tests added by risk category,
|
|
78
106
|
- behavior-preservation evidence,
|
|
79
107
|
- docs and constraints sync status,
|
|
@@ -21,6 +21,28 @@ Define:
|
|
|
21
21
|
- which interfaces must remain stable,
|
|
22
22
|
- which tests prove behavior did not change.
|
|
23
23
|
|
|
24
|
+
## Macro architecture boundary
|
|
25
|
+
|
|
26
|
+
For this skill, `macro architecture` means the whole system's runtime shape and operating model, such as:
|
|
27
|
+
|
|
28
|
+
- major subsystems and their top-level responsibilities,
|
|
29
|
+
- deployment/runtime boundaries,
|
|
30
|
+
- persistence model and data ownership model,
|
|
31
|
+
- inter-service or inter-process boundaries,
|
|
32
|
+
- the overall execution logic by which the system operates end to end.
|
|
33
|
+
|
|
34
|
+
The following do **not** count as macro-architecture changes by themselves:
|
|
35
|
+
|
|
36
|
+
- moving logic between ordinary internal modules,
|
|
37
|
+
- extracting helpers,
|
|
38
|
+
- splitting a mixed-responsibility file into narrower local modules,
|
|
39
|
+
- clarifying call boundaries inside one subsystem,
|
|
40
|
+
- replacing duplicated local control flow with a shared internal abstraction.
|
|
41
|
+
|
|
42
|
+
Treat those changes as ordinary refactoring work unless they also alter the top-level system model above.
|
|
43
|
+
|
|
44
|
+
Large coupled or central files should therefore be treated as decomposition problems, not as automatic macro-architecture blockers. If the top-level system model remains intact, prefer staged internal cleanup over stopping.
|
|
45
|
+
|
|
24
46
|
## Safe split patterns
|
|
25
47
|
|
|
26
48
|
- Move pure domain logic into a domain-owned helper module.
|
|
@@ -8,6 +8,8 @@ For every non-trivial pass, ask what could regress silently if the cleanup were
|
|
|
8
8
|
|
|
9
9
|
Use the resulting guardrails aggressively: when tests or equivalent verification can prove behavior preservation, they should unlock bolder refactors rather than merely justify small cosmetic edits.
|
|
10
10
|
|
|
11
|
+
The intended end state is not merely "some tests passed for touched files". The refactor is complete only when the relevant guarded test surface for the repository remains green after the cleanup.
|
|
12
|
+
|
|
11
13
|
## Unit tests
|
|
12
14
|
|
|
13
15
|
Use for:
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|