@laitszkin/apollo-toolkit 3.1.6 → 3.1.8

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 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.8] - 2026-04-23
11
+
12
+ ### Changed
13
+ - Refine `iterative-code-quality` so module deep reads must scan each module through the available job lenses before choosing which refactors land, preventing scan phases from degrading into generic reading or low-value micro-fixes.
14
+
15
+ ## [v3.1.7] - 2026-04-23
16
+
17
+ ### Changed
18
+ - Enhance `iterative-code-quality` with module inventory and coverage-ledger guidance so agents start from the easiest useful modules, deeply read each in-scope module before completion, and return to scanning whenever unvisited modules remain.
19
+
10
20
  ## [v3.1.6] - 2026-04-23
11
21
 
12
22
  ### Changed
@@ -7,6 +7,9 @@ Improve an existing repository through a strict three-step loop of full-codebase
7
7
  - Runs a repository-wide scan before every refactor round and refreshes a concrete quality backlog.
8
8
  - Uses a strict three-step loop: scan the codebase, choose this round's jobs and refactor, then update docs/constraints only when no actionable gap remains.
9
9
  - Keeps job execution guidance in focused reference documents instead of embedding every job as a workflow step in the main skill.
10
+ - Builds a module inventory and coverage ledger so every in-scope module receives a deep-read iteration before completion.
11
+ - Defines deep-read as a job-oriented scan across naming, simplification, module boundaries, logging, testing, and staged unlock opportunities instead of generic reading.
12
+ - Starts from the easiest useful modules first, while preserving the rule that unvisited modules cannot be skipped before completion.
10
13
  - Clarifies ambiguous variable, parameter, field, helper, and test-data names.
11
14
  - Simplifies complex functions and extracts reusable helpers only when they centralize real behavior.
12
15
  - Splits mixed-responsibility code into narrower modules without changing macro architecture.
@@ -20,6 +23,7 @@ Improve an existing repository through a strict three-step loop of full-codebase
20
23
  - Uses explicit next-job selection conditions from references so the agent can decide more concretely whether naming, simplification, modularization, logging, testing, or unlock work should happen next.
21
24
  - Runs a stage-gate full-codebase decision after every iteration to decide whether more rounds are still required.
22
25
  - 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.
26
+ - Forbids completion while any in-scope module remains unvisited, even if already-read modules look clean.
23
27
  - Targets as many inherited repository quality problems as can be solved safely, and expects the guarded test surface to remain green after the refactor.
24
28
  - Synchronizes project docs and `AGENTS.md` through `align-project-documents` and `maintain-project-constraints` after implementation.
25
29
 
@@ -27,7 +31,7 @@ Improve an existing repository through a strict three-step loop of full-codebase
27
31
 
28
32
  - `SKILL.md`: Main three-step loop, dependencies, guardrails, and output contract.
29
33
  - `agents/openai.yaml`: Agent interface metadata and default prompt.
30
- - `references/`: Focused guides for scanning, job selection, naming, simplification, module boundaries, logging, testing, unlock work, and iteration gates.
34
+ - `references/`: Focused guides for scanning, module coverage, job selection, naming, simplification, module boundaries, logging, testing, unlock work, and iteration gates.
31
35
 
32
36
  ## Typical usage
33
37
 
@@ -2,11 +2,12 @@
2
2
  name: iterative-code-quality
3
3
  description: >-
4
4
  Improve an existing codebase through repeated evidence-based repository-wide
5
- scans and behavior-safe refactors until no known in-scope actionable quality
6
- issue remains: clarify poor names, simplify or extract reusable functions,
7
- split mixed-responsibility code, repair stale or missing logs, and add
8
- high-value tests where guardrails are missing, while preserving intended
9
- business behavior and the system's macro architecture. Use when users ask for
5
+ scans, module-by-module deep-read coverage, and behavior-safe refactors until
6
+ no known in-scope actionable quality issue or unvisited in-scope module
7
+ remains: clarify poor names, simplify or extract reusable functions, split
8
+ mixed-responsibility code, repair stale or missing logs, and add high-value
9
+ tests where guardrails are missing, while preserving intended business
10
+ behavior and the system's macro architecture. Use when users ask for
10
11
  comprehensive refactoring, code cleanup, maintainability hardening, naming
11
12
  cleanup, log alignment, or test coverage improvement across a repository.
12
13
  ---
@@ -23,9 +24,9 @@ description: >-
23
24
  ## Standards
24
25
 
25
26
  - Evidence: Read repository docs, project constraints, source, tests, logs, build scripts, entrypoints, and nearby abstractions before editing; every refactor and every new test must be justified by code context.
26
- - Execution: Run a continuous three-step loop of full-codebase scan → choose this round's jobs and refactor → if and only if the latest full-codebase scan is clear, update docs and constraints; otherwise return to scanning immediately. Do not treat jobs as workflow steps. Do not produce a completion report while any known in-scope actionable issue remains.
27
+ - Execution: Run a continuous three-step loop of full-codebase scan → choose this round's jobs and refactor → 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 job-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 issue or unvisited in-scope module remains.
27
28
  - Quality: Resolve as many inherited quality problems as safely possible without changing intended behavior or the system's macro architecture. Do not require pre-existing tests before every safe refactor; if an area is high-risk and weakly guarded, add the missing guardrails as part of the work instead of treating the area as untouchable.
28
- - Output: Return iteration-by-iteration decisions, selected jobs, changed files, behavior-preservation evidence, tests and guardrails added, validation results, and docs/constraint sync status only after the latest scan shows no remaining known actionable in-scope issue.
29
+ - Output: Return iteration-by-iteration decisions, selected jobs, module coverage status, changed files, behavior-preservation evidence, tests and guardrails added, validation results, and docs/constraint sync status only after the latest scan shows no remaining known actionable in-scope issue and no unvisited in-scope module.
29
30
 
30
31
  ## Mission
31
32
 
@@ -41,23 +42,29 @@ For this skill, `macro architecture` means the system's top-level runtime shape
41
42
  - Map runtime entrypoints, domain modules, external integrations, logging utilities, and current test surfaces.
42
43
  - Exclude generated, vendored, lock, build-output, fixture, or snapshot files unless evidence shows they are human-maintained source.
43
44
  - Build or refresh a concrete repository-wide backlog of known actionable quality issues.
45
+ - Build or refresh a module inventory and coverage ledger; every in-scope module starts as unvisited until it has received a job-oriented deep-read iteration with callers, callees, tests, logs, relevant contracts, and each available job lens inspected.
44
46
  - Re-scan the full codebase after every landed iteration, not only the files just changed.
45
47
  - Load `references/repository-scan.md` for the scan checklist and backlog shaping rules.
48
+ - Load `references/module-coverage.md` for module inventory, job-oriented deep-read coverage, easy-first ordering, and completion rules.
46
49
 
47
50
  ### 2) Choose this round's jobs and refactor
48
51
 
49
52
  - Choose jobs only after the latest full-codebase scan. Jobs are optional execution directions, not ordered workflow steps.
50
- - Select the smallest set of jobs that can safely improve the repository right now under current guardrails.
53
+ - Treat module scanning and job choice as one linked activity: inspect the selected module through every available job lens before deciding which jobs actually land in this round.
54
+ - Select the smallest set of jobs that can safely improve the currently selected module or module cluster under current guardrails.
55
+ - Prefer easy-first module ordering: start from low-risk, high-confidence modules when doing so builds context, tests, naming clarity, or seams that make harder modules safer later.
56
+ - Do not keep revisiting familiar modules while other in-scope modules remain unvisited unless the familiar module blocks the next unvisited module's safe deep read.
51
57
  - Prefer smaller, high-confidence refactors that reduce risk and prepare the ground for deeper later cleanup.
52
58
  - If a desired refactor is high-risk and weakly guarded, make guardrail-building part of this round instead of stopping.
53
59
  - If a file feels too coupled, too central, or too risky for a direct rewrite, do staged unlock work rather than declaring the area blocked.
54
60
  - Read all directly affected callers, tests, interfaces, and logs before editing.
55
61
  - Validate from narrow to broad after each bounded round, then perform a full-codebase stage-gate decision:
56
- - if any known in-scope actionable issue still remains, return to Step 1;
62
+ - if any known in-scope actionable issue still remains or any in-scope module has not received a deep-read iteration, return to Step 1;
57
63
  - only continue to Step 3 when the latest scan is clear.
58
64
 
59
65
  Load references for this step only as needed:
60
66
 
67
+ - `references/module-coverage.md` for choosing the next module and proving every in-scope module has been deeply read through the available-job lenses.
61
68
  - `references/job-selection.md` for next-job choice conditions and tie-breakers.
62
69
  - `references/naming-and-simplification.md` for naming cleanup and function simplification/extraction.
63
70
  - `references/module-boundaries.md` for single-responsibility module cleanup.
@@ -68,7 +75,7 @@ Load references for this step only as needed:
68
75
 
69
76
  ### 3) Update project documents and constraints
70
77
 
71
- Only enter this step when the latest full-codebase scan confirms there is no remaining known actionable in-scope quality issue except items explicitly classified as blocked, unsafe, speculative, low-value, or approval-dependent.
78
+ Only enter this step when the latest full-codebase scan confirms there is no remaining known actionable in-scope quality issue and every in-scope module has received a deep-read iteration, except items explicitly classified as blocked, unsafe, speculative, low-value, excluded, or approval-dependent.
72
79
 
73
80
  - Run `align-project-documents` when README, architecture notes, setup docs, debugging docs, or test guidance may have drifted.
74
81
  - Run `maintain-project-constraints` to verify `AGENTS.md` still matches the repository's real architecture, business flow, commands, and conventions.
@@ -80,21 +87,23 @@ Only enter this step when the latest full-codebase scan confirms there is no rem
80
87
  - Do not change the system's macro architecture unless the user explicitly expands scope.
81
88
  - Do not use one-off scripts to rewrite product code.
82
89
  - Do not stop early just because a file is large, central, or historically fragile; if a safe unlock step exists, that is the next job.
90
+ - 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.
83
91
  - Do not weaken tests to make a refactor pass; fix the real defect or update stale expectations to stable invariants.
84
92
  - Do not add style-only churn that does not improve naming, modularity, observability, reuse, or guardrail strength.
85
93
  - Do not add unreliable E2E coverage when a controlled integration or characterization test can prove the same risk more safely.
86
94
 
87
95
  ## Completion Report
88
96
 
89
- Only report completion after Step 3 is done and the latest Step 1 scan is clear.
97
+ 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.
90
98
 
91
99
  Return:
92
100
 
93
101
  1. Iterations completed and the jobs selected in each iteration.
94
102
  2. Stage-gate verdict after each full-codebase re-scan.
95
- 3. Key files changed and the quality issue each change resolved.
96
- 4. Business behavior preservation evidence.
97
- 5. Tests or other guardrails added or updated, including property/integration/E2E `N/A` reasons where relevant.
98
- 6. Validation commands and results.
99
- 7. Documentation and `AGENTS.md` synchronization status.
100
- 8. Remaining blocked or approval-dependent items, if any.
103
+ 3. Module coverage ledger summary: modules deep-read, improved, validated-clear, deferred, or excluded.
104
+ 4. Key files changed and the quality issue each change resolved.
105
+ 5. Business behavior preservation evidence.
106
+ 6. Tests or other guardrails added or updated, including property/integration/E2E `N/A` reasons where relevant.
107
+ 7. Validation commands and results.
108
+ 8. Documentation and `AGENTS.md` synchronization status.
109
+ 9. Remaining blocked or approval-dependent items, if any.
@@ -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 as a strict three-step loop. Step 1: scan the full repository and refresh the actionable quality backlog. Step 2: choose this round's jobs from the reference documents and land the highest-value safe refactors now; jobs are selectable directions, not workflow steps, and if a high-risk area is weakly guarded add the missing tests or other guardrails instead of stopping. If a file is too coupled or too central for direct cleanup, switch to staged unlock work and keep progressing. After validation, run a full-codebase stage-gate; if any known in-scope actionable issue still remains, go back to Step 1 immediately. Step 3: only when the latest full-codebase scan is clear, run $align-project-documents and $maintain-project-constraints to synchronize docs and AGENTS.md. Preserve intended business behavior and the system's macro architecture, keep the guarded test surface green, and do not write a completion report while actionable gaps still exist."
4
+ default_prompt: "Use $iterative-code-quality as a strict three-step loop. Step 1: scan the full repository, refresh the actionable quality backlog, and maintain a module inventory plus coverage ledger. Step 2: choose this round's module or bounded module cluster, scan it through every available job lens, and only then decide which jobs actually land now; start from the easiest useful unvisited modules, jobs are selectable directions rather than workflow steps, and if a high-risk area is weakly guarded add the missing tests or other guardrails instead of stopping. If a file is too coupled or too central for direct cleanup, switch to staged unlock work and keep progressing. After validation, run a full-codebase stage-gate; if any known in-scope actionable issue remains or any in-scope module has not received a job-oriented deep-read iteration, go back to Step 1 immediately. Step 3: only when the latest full-codebase 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. Preserve intended business behavior and the system's macro architecture, keep the guarded test surface green, and do not write a completion report while actionable gaps or unvisited modules still exist."
@@ -4,7 +4,9 @@
4
4
 
5
5
  Each iteration must have:
6
6
 
7
+ - a selected module or bounded module cluster,
7
8
  - a concrete quality target,
9
+ - an explicit record of which job lenses were checked during the deep read,
8
10
  - a bounded file/symbol scope,
9
11
  - one or more selected execution directions,
10
12
  - expected behavior-neutral outcome,
@@ -15,6 +17,8 @@ An iteration is not "one work type", and it also does not need to include every
15
17
 
16
18
  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.
17
19
 
20
+ Do not stop after a validated iteration if any in-scope module remains unvisited in the module coverage ledger.
21
+
18
22
  ## Validation cadence
19
23
 
20
24
  Run validation from narrow to broad:
@@ -39,6 +43,8 @@ The final stopping condition also requires the relevant guarded test surface to
39
43
 
40
44
  Inspect the full known quality backlog for:
41
45
 
46
+ - modules that are still unvisited or only shallowly read,
47
+ - modules that were read but not yet checked against every available job lens,
42
48
  - new naming drift from moved or extracted concepts,
43
49
  - duplicated logic that remains after extraction,
44
50
  - module boundaries that are still mixed,
@@ -59,10 +65,11 @@ Use `references/job-selection.md` to convert those priorities into a concrete ne
59
65
  After every validated iteration, run a deliberate full-codebase decision pass:
60
66
 
61
67
  1. Re-scan the repository and refresh the known quality backlog.
62
- 2. Ask whether any known in-scope actionable issue still remains.
63
- 3. If yes, decide whether it should be addressed in the very next iteration or whether first-step unlock work is needed.
64
- 4. If the obstacle is a large, coupled, or central file, do not stop there; switch to staged unlock work and continue.
65
- 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.
68
+ 2. Refresh the module coverage ledger and identify unvisited in-scope modules.
69
+ 3. Ask whether any known in-scope actionable issue still remains.
70
+ 4. If yes, decide whether it should be addressed in the very next iteration or whether first-step unlock work is needed.
71
+ 5. If the obstacle is a large, coupled, or central file, do not stop there; switch to staged unlock work and continue.
72
+ 6. Only declare the repository iteration-complete when the re-scan shows no remaining actionable in-scope issue and no unvisited in-scope module except items that are explicitly deferred or excluded under the allowed stop categories.
66
73
 
67
74
  This stage-gate is mandatory. A validated local change does not by itself mean the repository is done.
68
75
 
@@ -71,6 +78,7 @@ This stage-gate is mandatory. A validated local change does not by itself mean t
71
78
  Repeat the cycle when:
72
79
 
73
80
  - any known in-scope actionable quality issue remains unresolved,
81
+ - any in-scope module remains unvisited,
74
82
  - high-impact unclear names remain,
75
83
  - duplicated or hard-coded workflows still have safe extraction paths,
76
84
  - a module still mixes distinct responsibilities and can be split locally,
@@ -95,12 +103,17 @@ Stop only when there are no unresolved known in-scope actionable issues. Any rem
95
103
 
96
104
  If a remaining candidate cannot be placed in one of these categories, it is still an actionable gap and the agent must continue iterating rather than complete the task.
97
105
 
106
+ If an in-scope module has not received a deep-read iteration, it is still an actionable coverage gap even when the already-read modules look clean.
107
+
98
108
  ## Completion evidence
99
109
 
100
110
  The final report should make the stopping point auditable:
101
111
 
102
112
  - passes completed,
103
113
  - execution directions selected per iteration,
114
+ - module or module cluster covered per iteration,
115
+ - job lenses checked per iteration,
116
+ - final module coverage ledger,
104
117
  - stage-gate verdict after each full-codebase re-scan,
105
118
  - validation commands and outcomes,
106
119
  - confirmation that the guarded test surface is green after the refactor,
@@ -6,7 +6,9 @@ Help the agent choose the next execution direction after each full-codebase re-s
6
6
 
7
7
  These are job-selection rules for Step 2 of the main skill loop. They are not workflow steps.
8
8
 
9
- The goal is not to force one permanent order. The goal is to choose the next job that most safely improves the codebase and unlocks later work.
9
+ The goal is not to force one permanent order. The goal is to choose the next job that most safely improves the selected module or module cluster and unlocks later work.
10
+
11
+ Before choosing, the agent should first scan the selected module through every available job lens. Job selection happens after that scan; it is not a substitute for that scan.
10
12
 
11
13
  ## Available jobs
12
14
 
@@ -63,8 +65,11 @@ If multiple jobs are plausible, prefer the one that:
63
65
  1. increases safety for the next iteration,
64
66
  2. reduces cognitive load fastest,
65
67
  3. removes the strongest blocker to a deeper future refactor,
66
- 4. preserves behavior with the clearest available guardrails.
68
+ 4. helps an unvisited module reach deep-read coverage,
69
+ 5. preserves behavior with the clearest available guardrails.
67
70
 
68
71
  ## Hard rule
69
72
 
70
73
  If a high-risk area lacks enough guardrails, `test addition` or another guardrail-building job should usually win before a deeper structural refactor.
74
+
75
+ If any in-scope module remains unvisited, choose jobs that help the next easiest useful unvisited module become deeply read, improved, or validated-clear before spending another round on already-familiar areas.
@@ -0,0 +1,126 @@
1
+ # Module Coverage And Deep-Read Iterations
2
+
3
+ ## Purpose
4
+
5
+ Prevent the agent from repeatedly improving only familiar or easy files while untouched modules remain unexamined.
6
+
7
+ Use this reference in Step 1 to build the module inventory and in Step 2 to choose which module or module cluster receives the next deep-read iteration.
8
+
9
+ Deep-read here does not mean generic reading. It means scanning the module through each available job lens so the agent can identify whether naming cleanup, simplification, module-boundary cleanup, logging alignment, test addition, or staged unlock work is justified.
10
+
11
+ ## Module inventory
12
+
13
+ List every meaningful in-scope module before completion. A module may be:
14
+
15
+ - a package, app, service, route group, command group, worker, or library,
16
+ - a domain folder with a clear responsibility,
17
+ - a runtime entrypoint plus its owned helpers,
18
+ - a testable subsystem with stable callers and contracts.
19
+
20
+ Record each module with:
21
+
22
+ - module name and path roots,
23
+ - primary responsibility,
24
+ - entrypoints and public interfaces,
25
+ - key callers and callees,
26
+ - tests and guardrails,
27
+ - logging or telemetry surfaces,
28
+ - risk level and estimated ease,
29
+ - current coverage status.
30
+
31
+ Exclude generated, vendored, lock, build-output, snapshot, fixture-only, or explicitly out-of-scope areas only with evidence.
32
+
33
+ ## Coverage ledger statuses
34
+
35
+ Use simple statuses so stopping conditions are auditable:
36
+
37
+ - `unvisited`: inventoried but not deeply read yet.
38
+ - `deep-read`: callers, callees, tests, logs, contracts, core files, and all available job lenses were inspected with enough context to judge quality.
39
+ - `refactored`: at least one behavior-neutral improvement landed for this module.
40
+ - `validated-clear`: deep read found no actionable in-scope quality issue worth changing now.
41
+ - `deferred`: an issue exists but is blocked, unsafe, speculative, approval-dependent, or requires macro-architecture/product scope.
42
+ - `excluded`: not human-maintained source or outside the user's requested scope.
43
+
44
+ Completion is not allowed while any in-scope module remains `unvisited`.
45
+
46
+ ## Easy-first module ordering
47
+
48
+ Start with the easiest useful modules when that reduces risk:
49
+
50
+ - small surface area,
51
+ - clear ownership,
52
+ - local tests or cheap guardrails,
53
+ - limited side effects,
54
+ - low public API or persistence risk,
55
+ - likely to clarify names, tests, boundaries, or seams used by harder modules.
56
+
57
+ Do not confuse easy-first with low-value churn. The chosen module should either resolve real quality issues or create context/guardrails that make later modules safer.
58
+
59
+ If multiple modules are equally easy, prefer the one that unlocks harder modules by improving shared naming, helpers, tests, logging, or dependency seams.
60
+
61
+ ## Deep-read requirements
62
+
63
+ A module iteration is not deep-read until the agent inspects:
64
+
65
+ - module entrypoints and public interfaces,
66
+ - internal core files and responsibility boundaries,
67
+ - key callers and downstream callees,
68
+ - tests, fixtures, mocks, and validation commands,
69
+ - logs, metrics, tracing, and error messages,
70
+ - configuration, persistence, and external-service contracts when relevant,
71
+ - known TODOs, comments, or docs that describe current behavior.
72
+
73
+ It also must inspect the module through each available job lens:
74
+
75
+ - `naming cleanup`: are names hiding ownership, units, state, lifecycle, or intent?
76
+ - `function simplification / extraction`: are there duplicated flows, hard-coded orchestration paths, or overly mixed functions?
77
+ - `module-boundary cleanup`: are responsibilities mixed in ways that can be split safely?
78
+ - `logging alignment`: are logs stale, misleading, or missing at important branch/outcome points?
79
+ - `test addition`: are important behaviors, edges, or invariants weakly guarded?
80
+ - `staged unlock work`: if the module is too coupled for direct cleanup, what is the next smaller unlock step?
81
+
82
+ Do not mark a module `validated-clear` from a shallow file skim.
83
+ Do not mark a module `validated-clear` until every available job lens has been checked and classified as one of: actionable now, unlock-first, deferred, excluded, or no meaningful issue found.
84
+
85
+ ## Choosing the next module
86
+
87
+ After every iteration:
88
+
89
+ 1. Re-scan the module ledger.
90
+ 2. Prefer an `unvisited` module unless a just-touched module must be stabilized before moving on.
91
+ 3. Choose the easiest useful `unvisited` module that can be deeply read and improved or validated now.
92
+ 4. Scan that module through every available job lens before deciding what "this round" means.
93
+ 5. If the next unvisited module is high-risk and under-guarded, choose guardrail-building jobs first.
94
+ 6. If the next unvisited module is too coupled for direct cleanup, choose staged unlock work rather than skipping it.
95
+ 7. Return to the full-codebase scan after validation and update the ledger.
96
+
97
+ Revisiting a familiar module is valid only when:
98
+
99
+ - it blocks safe deep reading of an unvisited module,
100
+ - a previous refactor created follow-up drift that must be stabilized,
101
+ - validation exposed a real defect or stale contract,
102
+ - cross-module cleanup requires touching it together with the next module.
103
+
104
+ ## Module cluster iterations
105
+
106
+ One iteration may cover a small cluster of modules when they share one boundary or invariant, such as:
107
+
108
+ - a command and its parser,
109
+ - a route and its service,
110
+ - a domain module and its test helpers,
111
+ - an integration wrapper and its local fake.
112
+
113
+ Keep clusters bounded. Do not use clustering to claim full-repository coverage without deep context.
114
+
115
+ ## Stage-gate questions
116
+
117
+ At the end of each iteration, answer:
118
+
119
+ - Which module or module cluster was deeply read?
120
+ - Which job lenses were checked, and which jobs were selected and why?
121
+ - What quality issue was fixed, or why is the module validated-clear?
122
+ - Which guardrails prove behavior was preserved?
123
+ - Which modules remain `unvisited`?
124
+ - Which module is the next easiest useful target?
125
+
126
+ If any in-scope module remains `unvisited`, the correct action is to return to Step 1, not to finish.
@@ -2,13 +2,15 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Build a factual map before changing code, then choose the highest-value quality improvements.
5
+ Build a factual map before changing code, then choose the highest-value quality improvements while tracking module-by-module job-oriented deep-read coverage.
6
6
 
7
7
  ## Required scan
8
8
 
9
9
  - Read `AGENTS.md`, `README*`, project docs, manifests, task runners, CI configs, and test setup.
10
10
  - List entrypoints: CLI commands, servers, workers, jobs, frontend routes, scripts, libraries, or public packages.
11
11
  - Identify core domain modules, external integrations, persistence boundaries, logging utilities, and test helpers.
12
+ - Create a module inventory and coverage ledger using `references/module-coverage.md`.
13
+ - For each module, scan through the available job lenses instead of treating scan as generic code reading.
12
14
  - Inspect current git state before editing so unrelated user changes are not overwritten.
13
15
  - Identify generated, vendored, lock, snapshot, build-output, and fixture files; exclude them from refactoring unless they are human-maintained source.
14
16
 
@@ -29,6 +31,8 @@ Prioritize files or functions with:
29
31
  For each candidate record:
30
32
 
31
33
  - file path and symbol name,
34
+ - owning module or module cluster,
35
+ - job lens that exposed the issue,
32
36
  - observed quality problem,
33
37
  - why it matters to maintainability or correctness confidence,
34
38
  - expected behavior-neutral change,
@@ -57,3 +61,5 @@ Score each candidate by:
57
61
  4. **Blast radius**: number of modules, public contracts, and migrations affected.
58
62
 
59
63
  Start with high-impact, high-confidence, low-blast-radius items. Escalate broad changes only when smaller passes cannot resolve the root problem.
64
+
65
+ Do not finish from backlog scoring alone. Completion also requires the module coverage ledger to show that every in-scope module has been deeply read and either improved, validated-clear, deferred, or excluded with evidence.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",