@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
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: iterative-code-quality
|
|
3
|
-
description: >-
|
|
4
|
-
Improve an existing codebase through repeated evidence-based repository-wide
|
|
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
|
|
11
|
-
comprehensive refactoring, code cleanup, maintainability hardening, naming
|
|
12
|
-
cleanup, log alignment, or test coverage improvement across a repository.
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Iterative Code Quality
|
|
16
|
-
|
|
17
|
-
## Dependencies
|
|
18
|
-
|
|
19
|
-
- Required: `align-project-documents` and `maintain-project-constraints` after the repository is truly iteration-complete.
|
|
20
|
-
- Conditional: `systematic-debug` when a newly added or existing test exposes a real business-logic defect that must be fixed at the true owner.
|
|
21
|
-
- Optional: `improve-observability` for non-trivial telemetry design.
|
|
22
|
-
- Fallback: If required completion dependencies are unavailable, finish code and validation first, then report exactly which documentation or constraint-sync action could not run.
|
|
23
|
-
|
|
24
|
-
## Standards
|
|
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.
|
|
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, unless the remaining surface is explicitly classified with evidence as blocked, unsafe, user-owned active work, speculative, low-value, or approval-dependent.
|
|
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.
|
|
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.
|
|
30
|
-
|
|
31
|
-
## Mission
|
|
32
|
-
|
|
33
|
-
Leave the repository materially cleaner by continuously scanning the whole codebase, landing the highest-value safe refactors available at each moment, and repeating until there is no known in-scope actionable quality gap left to fix.
|
|
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, internal call-boundary cleanup, and local module splits do not count as macro-architecture changes by themselves.
|
|
36
|
-
|
|
37
|
-
## Three-Step Loop
|
|
38
|
-
|
|
39
|
-
### 1) Scan the repository
|
|
40
|
-
|
|
41
|
-
- Read root guidance first: `AGENTS.md/CLAUDE.md`, `README*`, package manifests, task runners, CI/test config, and major project docs.
|
|
42
|
-
- Map runtime entrypoints, domain modules, external integrations, logging utilities, and current test surfaces.
|
|
43
|
-
- Exclude generated, vendored, lock, build-output, fixture, or snapshot files unless evidence shows they are human-maintained source.
|
|
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.
|
|
46
|
-
- Re-scan the full codebase after every landed iteration, not only the files just changed.
|
|
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.
|
|
49
|
-
|
|
50
|
-
### 2) Choose this round's jobs and refactor
|
|
51
|
-
|
|
52
|
-
- Choose jobs only after the latest full-codebase scan. Jobs are optional execution directions, not ordered workflow steps.
|
|
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
|
-
- If the user has clearly indicated that a touched area is their active in-progress change, treat that area as blocked for this skill, record the evidence, and continue with other in-scope modules instead of modifying or debugging it.
|
|
56
|
-
- Before choosing or deferring a refactor, explicitly assess refactor confidence as a combination of the agent's own ability to understand and complete the task, the objective safety net from tests 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 guard the behavior, use them to support bolder changes because failures can be driven back to green.
|
|
57
|
-
- 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.
|
|
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 deep read.
|
|
59
|
-
- Prefer smaller, high-confidence refactors that reduce risk and prepare the ground for deeper later cleanup.
|
|
60
|
-
- If a desired refactor is high-risk and weakly guarded, make guardrail-building part of this round instead of stopping.
|
|
61
|
-
- 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.
|
|
62
|
-
- Read all directly affected callers, tests, interfaces, and logs 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 issue 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-job lenses.
|
|
70
|
-
- `references/job-selection.md` for next-job choice conditions and tie-breakers.
|
|
71
|
-
- `references/naming-and-simplification.md` for naming cleanup and function simplification/extraction.
|
|
72
|
-
- `references/module-boundaries.md` for single-responsibility module cleanup.
|
|
73
|
-
- `references/logging-alignment.md` for stale or missing log repair.
|
|
74
|
-
- `references/testing-strategy.md` for unit, property, integration, and E2E test strategy.
|
|
75
|
-
- `references/coupled-core-file-strategy.md` for staged unlock work on large coupled or apparently core files.
|
|
76
|
-
- `references/iteration-gates.md` for validation cadence, stage-gate rules, and stop criteria.
|
|
77
|
-
|
|
78
|
-
### 3) Update project documents and constraints
|
|
79
|
-
|
|
80
|
-
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.
|
|
81
|
-
|
|
82
|
-
- Run `align-project-documents` when README, architecture notes, setup docs, debugging docs, or test guidance may have drifted.
|
|
83
|
-
- Run `maintain-project-constraints` to verify `AGENTS.md/CLAUDE.md` still matches the repository's real architecture, business flow, commands, and conventions.
|
|
84
|
-
- Update only the documentation and constraints that changed in reality because of the refactor.
|
|
85
|
-
|
|
86
|
-
## Hard Guardrails
|
|
87
|
-
|
|
88
|
-
- Do not change intended business logic while refactoring, except to fix a real defect exposed by tests and verified at the true owner.
|
|
89
|
-
- Do not change the system's macro architecture unless the user explicitly expands scope.
|
|
90
|
-
- Do not use one-off scripts to rewrite product code.
|
|
91
|
-
- 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.
|
|
92
|
-
- 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.
|
|
93
|
-
- Do not touch user-owned active edits; classify them as blocked with evidence and continue elsewhere.
|
|
94
|
-
- Do not weaken tests to make a refactor pass; fix the real defect or update stale expectations to stable invariants.
|
|
95
|
-
- Do not add style-only churn that does not improve naming, modularity, observability, reuse, or guardrail strength.
|
|
96
|
-
- Do not add unreliable E2E coverage when a controlled integration or characterization test can prove the same risk more safely.
|
|
97
|
-
|
|
98
|
-
## Completion Report
|
|
99
|
-
|
|
100
|
-
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.
|
|
101
|
-
|
|
102
|
-
Return:
|
|
103
|
-
|
|
104
|
-
1. Iterations completed and the jobs selected in each iteration.
|
|
105
|
-
2. Stage-gate verdict after each full-codebase re-scan.
|
|
106
|
-
3. Module coverage ledger summary: modules deep-read, improved, validated-clear, deferred, or excluded.
|
|
107
|
-
4. Key files changed and the quality issue each change resolved.
|
|
108
|
-
5. Business behavior preservation evidence.
|
|
109
|
-
6. Tests or other guardrails added or updated, including property/integration/E2E `N/A` reasons where relevant.
|
|
110
|
-
7. Validation commands and results.
|
|
111
|
-
8. Documentation and `AGENTS.md/CLAUDE.md` synchronization status.
|
|
112
|
-
9. Remaining blocked or approval-dependent items, if any.
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Iterative Code Quality"
|
|
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, 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 assess refactor confidence from your own ability to understand and complete the change, task complexity, guardrail strength, rollback or repair paths, and whether tests can drive accidental breakage back to green. If a high-risk area is weakly guarded add the missing tests or other guardrails instead of stopping; if strong tests guard the behavior, use them to justify bolder safe refactors rather than avoiding the work. 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/CLAUDE.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."
|
|
@@ -1,73 +0,0 @@
|
|
|
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
|
-
If guardrails are too weak for direct cleanup, strengthening them is itself the next unlock step.
|
|
16
|
-
|
|
17
|
-
## First questions to ask
|
|
18
|
-
|
|
19
|
-
When a file feels untouchable, ask:
|
|
20
|
-
|
|
21
|
-
- Which parts are pure logic and which parts are side effects?
|
|
22
|
-
- Which names or local concepts are blocking understanding?
|
|
23
|
-
- Which behavior can be locked down with characterization tests?
|
|
24
|
-
- Which dependency seams can be introduced without changing behavior?
|
|
25
|
-
- Which caller groups or workflow slices can be isolated first?
|
|
26
|
-
- Which refactor would most reduce the cost of the next refactor?
|
|
27
|
-
|
|
28
|
-
## Typical unlock sequence
|
|
29
|
-
|
|
30
|
-
Pick one or more of these, in the order justified by current evidence:
|
|
31
|
-
|
|
32
|
-
1. Add characterization or regression tests around current behavior.
|
|
33
|
-
2. Rename confusing variables, flags, intermediate states, and helper names.
|
|
34
|
-
3. Extract constants, schemas, types, and small pure transformations.
|
|
35
|
-
4. Separate read path from write path, or decision logic from side effects.
|
|
36
|
-
5. Isolate external calls, persistence, and logging behind clearer seams.
|
|
37
|
-
6. Group callers by responsibility and split one slice at a time.
|
|
38
|
-
7. Move one coherent responsibility into a new internal module.
|
|
39
|
-
8. Re-scan and decide whether a deeper split is now safer.
|
|
40
|
-
|
|
41
|
-
## What not to do
|
|
42
|
-
|
|
43
|
-
Avoid these anti-patterns:
|
|
44
|
-
|
|
45
|
-
- declaring the area blocked just because it is important,
|
|
46
|
-
- attempting a full rewrite before guardrails exist,
|
|
47
|
-
- preserving obvious local design debt only because the file is central,
|
|
48
|
-
- escalating ordinary internal decomposition into a fake macro-architecture concern,
|
|
49
|
-
- mixing unlock work with unrelated style churn.
|
|
50
|
-
|
|
51
|
-
## Choosing the next step
|
|
52
|
-
|
|
53
|
-
Prefer the next step that maximizes:
|
|
54
|
-
|
|
55
|
-
1. combined confidence from the agent's own ability, code understanding, existing tests, or quickly addable tests,
|
|
56
|
-
2. leverage for future deeper cleanup,
|
|
57
|
-
3. reduction in coupling or cognitive load,
|
|
58
|
-
4. low risk to current business behavior.
|
|
59
|
-
|
|
60
|
-
If two steps are both safe, choose the one that makes the next iteration easier.
|
|
61
|
-
|
|
62
|
-
If the file is high-risk and under-tested, prefer adding the smallest useful characterization tests before attempting deeper structural 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.
|
|
63
|
-
|
|
64
|
-
## Completion rule for coupled files
|
|
65
|
-
|
|
66
|
-
Do not ask "Can I solve the whole file now?"
|
|
67
|
-
|
|
68
|
-
Ask:
|
|
69
|
-
|
|
70
|
-
- "Can I make this file meaningfully easier to change in the next iteration?"
|
|
71
|
-
- "Can I reduce coupling, clarify ownership, or improve guardrails right now?"
|
|
72
|
-
|
|
73
|
-
If the answer is yes, continue iterating.
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Iteration Gates And Stopping Criteria
|
|
2
|
-
|
|
3
|
-
## Pass discipline
|
|
4
|
-
|
|
5
|
-
Each iteration must have:
|
|
6
|
-
|
|
7
|
-
- a selected module or bounded module cluster,
|
|
8
|
-
- a concrete quality target,
|
|
9
|
-
- an explicit record of which job lenses were checked during the deep read,
|
|
10
|
-
- a bounded file/symbol scope,
|
|
11
|
-
- one or more selected execution directions,
|
|
12
|
-
- a confidence assessment covering the agent's own ability to complete the refactor, the task's inherent difficulty, objective guardrail strength, and rollback or repair paths,
|
|
13
|
-
- expected behavior-neutral outcome,
|
|
14
|
-
- validation plan,
|
|
15
|
-
- rollback point if evidence contradicts the change.
|
|
16
|
-
|
|
17
|
-
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.
|
|
18
|
-
|
|
19
|
-
Confidence is not a synonym for "easy". Assess whether the agent has enough understanding, skill, local context, tests, validation commands, and recovery path to complete the refactor safely. A hard task can still be high-confidence when strong tests, characterization coverage, and clear rollback let the agent repair mistakes by making the guarded behavior green again.
|
|
20
|
-
|
|
21
|
-
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.
|
|
22
|
-
|
|
23
|
-
Do not stop after a validated iteration if any in-scope module remains unvisited in the module coverage ledger.
|
|
24
|
-
|
|
25
|
-
## Validation cadence
|
|
26
|
-
|
|
27
|
-
Run validation from narrow to broad:
|
|
28
|
-
|
|
29
|
-
1. Formatter or type check for touched files when available.
|
|
30
|
-
2. Unit tests for touched helpers and modules.
|
|
31
|
-
3. Integration tests for affected chains.
|
|
32
|
-
4. Broader suite or build once multiple passes interact.
|
|
33
|
-
|
|
34
|
-
If validation fails:
|
|
35
|
-
|
|
36
|
-
- determine whether the failure is pre-existing, stale test expectation, test isolation issue, or real product bug,
|
|
37
|
-
- fix the true owner,
|
|
38
|
-
- keep regression coverage for real defects,
|
|
39
|
-
- do not mask failures by weakening assertions.
|
|
40
|
-
|
|
41
|
-
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. Reassess whether the agent has enough capability and objective support to proceed; if yes, continue, and if no, choose the smallest guardrail or unlock step that would make the next refactor credible.
|
|
42
|
-
|
|
43
|
-
The final stopping condition also requires the relevant guarded test surface to be green; a partially red repository is not a completed refactor outcome.
|
|
44
|
-
|
|
45
|
-
## Re-scan after each iteration
|
|
46
|
-
|
|
47
|
-
Inspect the full known quality backlog for:
|
|
48
|
-
|
|
49
|
-
- modules that are still unvisited or only shallowly read,
|
|
50
|
-
- modules that were read but not yet checked against every available job lens,
|
|
51
|
-
- new naming drift from moved or extracted concepts,
|
|
52
|
-
- duplicated logic that remains after extraction,
|
|
53
|
-
- module boundaries that are still mixed,
|
|
54
|
-
- logs that now use stale names,
|
|
55
|
-
- tests that cover only the happy path,
|
|
56
|
-
- documentation or `AGENTS.md/CLAUDE.md` drift.
|
|
57
|
-
|
|
58
|
-
Then choose the next execution directions with these priorities:
|
|
59
|
-
|
|
60
|
-
1. highest combined confidence from agent capability, code understanding, guardrails, and recovery path,
|
|
61
|
-
2. strongest leverage for later deeper cleanup,
|
|
62
|
-
3. lowest business-risk path toward broader system improvement.
|
|
63
|
-
|
|
64
|
-
Use `references/job-selection.md` to convert those priorities into a concrete next-job choice.
|
|
65
|
-
|
|
66
|
-
## Stage-gate after each iteration
|
|
67
|
-
|
|
68
|
-
After every validated iteration, run a deliberate full-codebase decision pass:
|
|
69
|
-
|
|
70
|
-
1. Re-scan the repository and refresh the known quality backlog.
|
|
71
|
-
2. Refresh the module coverage ledger and identify unvisited in-scope modules.
|
|
72
|
-
3. Ask whether any known in-scope actionable issue still remains.
|
|
73
|
-
4. If yes, decide whether it should be addressed in the very next iteration or whether first-step unlock work is needed.
|
|
74
|
-
5. If the obstacle is a large, coupled, or central file, do not stop there; switch to staged unlock work and continue.
|
|
75
|
-
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.
|
|
76
|
-
|
|
77
|
-
This stage-gate is mandatory. A validated local change does not by itself mean the repository is done.
|
|
78
|
-
|
|
79
|
-
## Continue when
|
|
80
|
-
|
|
81
|
-
Repeat the cycle when:
|
|
82
|
-
|
|
83
|
-
- any known in-scope actionable quality issue remains unresolved,
|
|
84
|
-
- any in-scope module remains unvisited,
|
|
85
|
-
- high-impact unclear names remain,
|
|
86
|
-
- duplicated or hard-coded workflows still have safe extraction paths,
|
|
87
|
-
- a module still mixes distinct responsibilities and can be split locally,
|
|
88
|
-
- logs are still misleading or missing at critical decisions,
|
|
89
|
-
- high-value business logic remains untested and is testable.
|
|
90
|
-
|
|
91
|
-
Do not produce a final completion report while any item in this section is true. Continue with the next bounded iteration instead.
|
|
92
|
-
|
|
93
|
-
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.
|
|
94
|
-
|
|
95
|
-
## Stop when
|
|
96
|
-
|
|
97
|
-
Stop only when there are no unresolved known in-scope actionable issues. Any remaining candidates must be explicitly classified as one of:
|
|
98
|
-
|
|
99
|
-
- low-value style preference,
|
|
100
|
-
- speculative without concrete evidence,
|
|
101
|
-
- public contract migrations,
|
|
102
|
-
- macro-architecture changes,
|
|
103
|
-
- product behavior changes needing user approval,
|
|
104
|
-
- blocked by unavailable credentials, unstable external systems, or missing documentation,
|
|
105
|
-
- untestable with the current repository tooling and too risky to change safely.
|
|
106
|
-
|
|
107
|
-
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.
|
|
108
|
-
|
|
109
|
-
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.
|
|
110
|
-
|
|
111
|
-
## Completion evidence
|
|
112
|
-
|
|
113
|
-
The final report should make the stopping point auditable:
|
|
114
|
-
|
|
115
|
-
- passes completed,
|
|
116
|
-
- execution directions selected per iteration,
|
|
117
|
-
- module or module cluster covered per iteration,
|
|
118
|
-
- job lenses checked per iteration,
|
|
119
|
-
- final module coverage ledger,
|
|
120
|
-
- stage-gate verdict after each full-codebase re-scan,
|
|
121
|
-
- validation commands and outcomes,
|
|
122
|
-
- confirmation that the guarded test surface is green after the refactor,
|
|
123
|
-
- tests added by risk category,
|
|
124
|
-
- behavior-preservation evidence,
|
|
125
|
-
- docs and constraints sync status,
|
|
126
|
-
- proof that the latest scan found no known actionable in-scope quality issues,
|
|
127
|
-
- deferred items with reason and required approval, dependency, or safety constraint.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Job Selection Guide
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Help the agent choose the next execution direction after each full-codebase re-scan.
|
|
6
|
-
|
|
7
|
-
These are job-selection rules for Step 2 of the main skill loop. They are not workflow steps.
|
|
8
|
-
|
|
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.
|
|
12
|
-
|
|
13
|
-
## Available jobs
|
|
14
|
-
|
|
15
|
-
- naming cleanup
|
|
16
|
-
- function simplification / extraction
|
|
17
|
-
- module-boundary cleanup
|
|
18
|
-
- logging alignment
|
|
19
|
-
- test addition
|
|
20
|
-
- staged unlock work
|
|
21
|
-
|
|
22
|
-
## Choose `naming cleanup` when
|
|
23
|
-
|
|
24
|
-
- confusing names are the main thing blocking understanding,
|
|
25
|
-
- flags, units, lifecycle states, or ownership terms are misleading,
|
|
26
|
-
- better naming would clearly reduce the risk of a later deeper refactor.
|
|
27
|
-
|
|
28
|
-
## Choose `function simplification / extraction` when
|
|
29
|
-
|
|
30
|
-
- duplicated logic exists across multiple call sites,
|
|
31
|
-
- one function mixes too many concerns,
|
|
32
|
-
- control flow is currently the main complexity bottleneck,
|
|
33
|
-
- extracting a helper would make the next test or split easier.
|
|
34
|
-
|
|
35
|
-
## Choose `module-boundary cleanup` when
|
|
36
|
-
|
|
37
|
-
- one file or module clearly has multiple reasons to change,
|
|
38
|
-
- local responsibilities are already visible enough to separate,
|
|
39
|
-
- a safe split would reduce repeated touching of unrelated concerns.
|
|
40
|
-
|
|
41
|
-
## Choose `logging alignment` when
|
|
42
|
-
|
|
43
|
-
- stale or missing diagnostics are the main blocker to safe validation,
|
|
44
|
-
- later refactors would be safer if branch decisions and outcomes were easier to observe,
|
|
45
|
-
- observability drift is currently hiding the real ownership model.
|
|
46
|
-
|
|
47
|
-
## Choose `test addition` when
|
|
48
|
-
|
|
49
|
-
- the target area is high-risk and weakly guarded,
|
|
50
|
-
- desired cleanup is blocked mainly by missing behavior locks,
|
|
51
|
-
- coupling spans multiple modules and needs characterization before change,
|
|
52
|
-
- regression risk is too high to justify deeper refactors without stronger coverage.
|
|
53
|
-
|
|
54
|
-
## Choose `staged unlock work` when
|
|
55
|
-
|
|
56
|
-
- the file feels too central or too coupled for direct cleanup,
|
|
57
|
-
- no safe full refactor exists yet, but a preparatory step does,
|
|
58
|
-
- you can reduce risk through naming, seam extraction, type extraction, side-effect isolation, or caller grouping,
|
|
59
|
-
- the best next move is to make a future refactor cheaper rather than solve the whole area now.
|
|
60
|
-
|
|
61
|
-
## Tie-breakers
|
|
62
|
-
|
|
63
|
-
If multiple jobs are plausible, prefer the one that:
|
|
64
|
-
|
|
65
|
-
1. increases safety for the next iteration,
|
|
66
|
-
2. reduces cognitive load fastest,
|
|
67
|
-
3. removes the strongest blocker to a deeper future refactor,
|
|
68
|
-
4. helps an unvisited module reach deep-read coverage,
|
|
69
|
-
5. matches the agent's self-assessed ability to understand, execute, and repair the change under current evidence,
|
|
70
|
-
6. preserves behavior with the clearest available guardrails.
|
|
71
|
-
|
|
72
|
-
## Hard rule
|
|
73
|
-
|
|
74
|
-
If a high-risk area lacks enough guardrails, `test addition` or another guardrail-building job should usually win before a deeper structural refactor.
|
|
75
|
-
|
|
76
|
-
If the area is difficult but the agent can explain the behavior, affected contracts, rollback path, and available tests clearly, do not downgrade confidence just because the refactor is non-trivial. Strong guardrails mean accidental breakage should be repaired by returning the test suite to green, not avoided by leaving an actionable quality issue in place.
|
|
77
|
-
|
|
78
|
-
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.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# Logging Alignment And Missing Observability
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Keep logs and diagnostics synchronized with the real code path while preserving behavior.
|
|
6
|
-
|
|
7
|
-
## Stale log signals
|
|
8
|
-
|
|
9
|
-
Update logs when they:
|
|
10
|
-
|
|
11
|
-
- mention retired owners, lifecycle stages, resource names, or field names,
|
|
12
|
-
- describe a branch that no longer matches the condition,
|
|
13
|
-
- use generic text like `failed` without the operation or reason,
|
|
14
|
-
- report aggregate success without identifiers that let operators reconcile details,
|
|
15
|
-
- keep compatibility-era names after code has moved to a new canonical model,
|
|
16
|
-
- conflict with structured field names or metrics in the same path.
|
|
17
|
-
|
|
18
|
-
## Missing log criteria
|
|
19
|
-
|
|
20
|
-
Add logs only where they answer a concrete debugging question.
|
|
21
|
-
|
|
22
|
-
High-value locations:
|
|
23
|
-
|
|
24
|
-
- workflow start and final outcome for long-running jobs,
|
|
25
|
-
- branch selection or skipped work with reason code,
|
|
26
|
-
- validation rejection with safe context,
|
|
27
|
-
- external dependency outcome including status class, retry count, request id, and latency when available,
|
|
28
|
-
- persistence side effect or emitted command,
|
|
29
|
-
- rollback, compensation, idempotency, duplicate, or replay decisions.
|
|
30
|
-
|
|
31
|
-
Low-value locations:
|
|
32
|
-
|
|
33
|
-
- every line of a tight loop,
|
|
34
|
-
- logs that only restate the function name,
|
|
35
|
-
- dumping raw payloads,
|
|
36
|
-
- duplicating an exception already logged with equal context,
|
|
37
|
-
- noisy success logs in hot paths without operational value.
|
|
38
|
-
|
|
39
|
-
## Structured field rules
|
|
40
|
-
|
|
41
|
-
- Reuse the project's existing logger, field naming, metric naming, and trace conventions.
|
|
42
|
-
- Prefer stable identifiers, counts, reason codes, status classes, and lifecycle stages.
|
|
43
|
-
- Keep field names aligned with canonical owners, not stale compatibility projections.
|
|
44
|
-
- Do not log secrets, tokens, private keys, passwords, raw personal data, or full sensitive payloads.
|
|
45
|
-
- Avoid high-cardinality values unless they are necessary identifiers already used by the project.
|
|
46
|
-
|
|
47
|
-
## Behavior-neutral updates
|
|
48
|
-
|
|
49
|
-
Logging changes must not:
|
|
50
|
-
|
|
51
|
-
- alter retry, error, persistence, or branch behavior,
|
|
52
|
-
- swallow exceptions,
|
|
53
|
-
- add blocking network calls,
|
|
54
|
-
- create expensive serialization in hot paths,
|
|
55
|
-
- change public output unless logs are the product output.
|
|
56
|
-
|
|
57
|
-
## Tests
|
|
58
|
-
|
|
59
|
-
Add or update tests when:
|
|
60
|
-
|
|
61
|
-
- the project already captures logs in tests,
|
|
62
|
-
- branch-specific reason codes matter,
|
|
63
|
-
- stale field names were renamed,
|
|
64
|
-
- extracted helpers need observability contracts,
|
|
65
|
-
- aggregate and detail telemetry must stay reconcilable.
|
|
66
|
-
|
|
67
|
-
Assert stable fields and event names, not timestamps or full formatted strings.
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# Module Boundary And Single Responsibility Refactoring
|
|
2
|
-
|
|
3
|
-
## When to split a module
|
|
4
|
-
|
|
5
|
-
Split only when the module has multiple independent reasons to change, such as:
|
|
6
|
-
|
|
7
|
-
- domain rules mixed with IO, formatting, CLI parsing, or external service calls,
|
|
8
|
-
- unrelated workflows sharing one file because of history, not ownership,
|
|
9
|
-
- test setup forced to instantiate unrelated dependencies,
|
|
10
|
-
- large files where local changes frequently touch distant concepts,
|
|
11
|
-
- circular or awkward imports caused by unclear ownership,
|
|
12
|
-
- logging, validation, persistence, and presentation all living in one function or class.
|
|
13
|
-
|
|
14
|
-
## Before splitting
|
|
15
|
-
|
|
16
|
-
Define:
|
|
17
|
-
|
|
18
|
-
- the current module's actual responsibilities,
|
|
19
|
-
- the target responsibility of each new module,
|
|
20
|
-
- which module owns the canonical business rule,
|
|
21
|
-
- which interfaces must remain stable,
|
|
22
|
-
- which tests prove behavior did not change.
|
|
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
|
-
|
|
46
|
-
## Safe split patterns
|
|
47
|
-
|
|
48
|
-
- Move pure domain logic into a domain-owned helper module.
|
|
49
|
-
- Move external adapter code into an integration or infrastructure-adjacent module if the repository already uses that boundary.
|
|
50
|
-
- Move formatting/reporting away from computation.
|
|
51
|
-
- Move test helpers into existing test utility locations rather than production modules.
|
|
52
|
-
- Keep orchestration modules thin: validate inputs, call owners, handle outcomes.
|
|
53
|
-
|
|
54
|
-
## Interface design
|
|
55
|
-
|
|
56
|
-
Use narrow interfaces:
|
|
57
|
-
|
|
58
|
-
- pass only data the callee needs,
|
|
59
|
-
- return explicit result objects or existing domain types,
|
|
60
|
-
- avoid leaking framework/request/database objects into pure domain modules,
|
|
61
|
-
- preserve existing error taxonomy,
|
|
62
|
-
- keep naming aligned with current project vocabulary.
|
|
63
|
-
|
|
64
|
-
## Anti-patterns
|
|
65
|
-
|
|
66
|
-
Avoid:
|
|
67
|
-
|
|
68
|
-
- creating a generic `utils` dumping ground,
|
|
69
|
-
- moving code only to reduce file length,
|
|
70
|
-
- adding new layers that duplicate existing architecture,
|
|
71
|
-
- introducing dependency injection frameworks or service locators without explicit approval,
|
|
72
|
-
- splitting tightly coupled state machines before defining the state owner,
|
|
73
|
-
- changing public boundaries during a cleanup pass.
|
|
74
|
-
|
|
75
|
-
## Validation checklist
|
|
76
|
-
|
|
77
|
-
After a split:
|
|
78
|
-
|
|
79
|
-
- imports remain acyclic or no worse than before,
|
|
80
|
-
- public entrypoints still call the same behavior,
|
|
81
|
-
- tests cover moved logic and orchestration glue,
|
|
82
|
-
- logs still carry the same correlation identifiers,
|
|
83
|
-
- docs or `AGENTS.md/CLAUDE.md` are updated only if the visible architecture or command surface changed.
|