@laitszkin/apollo-toolkit 3.12.0 → 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/AGENTS.md +6 -6
- package/CHANGELOG.md +18 -1
- package/README.md +9 -10
- 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 +4 -12
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/enhance-existing-features/SKILL.md +21 -37
- package/generate-spec/SKILL.md +32 -17
- 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 +19 -25
- 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 +13 -25
- package/merge-changes-from-local-branches/SKILL.md +13 -37
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/open-source-pr-workflow/SKILL.md +4 -7
- package/optimise-skill/SKILL.md +8 -8
- package/optimise-skill/references/definition.md +1 -0
- package/optimise-skill/references/example_skill.md +8 -8
- 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/review-spec-related-changes/SKILL.md +30 -38
- package/ship-github-issue-fix/SKILL.md +2 -2
- package/solve-issues-found-during-review/SKILL.md +8 -43
- package/systematic-debug/SKILL.md +12 -39
- 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/discover-edge-cases/CHANGELOG.md +0 -19
- package/discover-edge-cases/LICENSE +0 -21
- package/discover-edge-cases/README.md +0 -87
- package/discover-edge-cases/SKILL.md +0 -32
- package/discover-edge-cases/agents/openai.yaml +0 -4
- package/discover-edge-cases/references/architecture-edge-cases.md +0 -41
- package/discover-edge-cases/references/code-edge-cases.md +0 -46
- package/discover-security-issues/CHANGELOG.md +0 -32
- package/discover-security-issues/LICENSE +0 -21
- package/discover-security-issues/README.md +0 -35
- package/discover-security-issues/SKILL.md +0 -54
- package/discover-security-issues/agents/openai.yaml +0 -4
- package/discover-security-issues/references/agent-attack-catalog.md +0 -117
- package/discover-security-issues/references/common-software-attack-catalog.md +0 -168
- package/discover-security-issues/references/red-team-extreme-scenarios.md +0 -81
- package/discover-security-issues/references/risk-checklist.md +0 -78
- package/discover-security-issues/references/security-test-patterns-agent.md +0 -101
- package/discover-security-issues/references/security-test-patterns-finance.md +0 -88
- package/discover-security-issues/references/test-snippets.md +0 -73
- 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/recover-missing-plan/SKILL.md +0 -85
- package/recover-missing-plan/agents/openai.yaml +0 -4
- package/review-change-set/LICENSE +0 -21
- package/review-change-set/README.md +0 -55
- package/review-change-set/SKILL.md +0 -46
- package/review-change-set/agents/openai.yaml +0 -4
- package/review-codebases/LICENSE +0 -21
- package/review-codebases/README.md +0 -69
- package/review-codebases/SKILL.md +0 -46
- package/review-codebases/agents/openai.yaml +0 -4
- package/scheduled-runtime-health-check/LICENSE +0 -21
- package/scheduled-runtime-health-check/README.md +0 -107
- package/scheduled-runtime-health-check/SKILL.md +0 -135
- package/scheduled-runtime-health-check/agents/openai.yaml +0 -4
- package/scheduled-runtime-health-check/references/output-format.md +0 -20
- 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 -55
- package/submission-readiness-check/agents/openai.yaml +0 -4
|
@@ -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.
|
|
@@ -1,126 +0,0 @@
|
|
|
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.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Naming And Function Simplification
|
|
2
|
-
|
|
3
|
-
## Naming improvements
|
|
4
|
-
|
|
5
|
-
Rename only when the current name creates real ambiguity.
|
|
6
|
-
|
|
7
|
-
Good rename reasons:
|
|
8
|
-
|
|
9
|
-
- hides domain role, unit, quantity, ownership, or lifecycle stage,
|
|
10
|
-
- uses stale terminology after a refactor,
|
|
11
|
-
- collides with another concept in the same scope,
|
|
12
|
-
- makes boolean, enum, or state-transition meaning unclear,
|
|
13
|
-
- forces readers to inspect implementation before understanding intent.
|
|
14
|
-
|
|
15
|
-
Avoid renaming when:
|
|
16
|
-
|
|
17
|
-
- the name is already clear in local context,
|
|
18
|
-
- the change is pure personal preference,
|
|
19
|
-
- the name is part of a stable external API, database schema, event contract, or migration-sensitive field,
|
|
20
|
-
- the rename would create broad churn without reducing ambiguity.
|
|
21
|
-
|
|
22
|
-
## Naming patterns
|
|
23
|
-
|
|
24
|
-
- Prefer domain nouns over implementation nouns: `selectedAccount` over `item`.
|
|
25
|
-
- Include units for quantities: `timeoutMs`, `amountCents`, `windowDays`.
|
|
26
|
-
- Use booleans that read as predicates: `isEligible`, `hasPendingRetry`, `shouldPersist`.
|
|
27
|
-
- Name collections by contents: `pendingInvoices`, not `list`.
|
|
28
|
-
- Name state transitions by lifecycle: `markSettlementComplete`, not `updateStatus`.
|
|
29
|
-
- Keep test data names meaningful: `expiredSubscription`, `duplicateEvent`, `unauthorizedActor`.
|
|
30
|
-
|
|
31
|
-
## Function simplification signals
|
|
32
|
-
|
|
33
|
-
Simplify functions that contain:
|
|
34
|
-
|
|
35
|
-
- repeated guard clauses or duplicated validation,
|
|
36
|
-
- mixed parsing, validation, orchestration, persistence, and formatting,
|
|
37
|
-
- nested branches that hide the main path,
|
|
38
|
-
- temporary variables whose names encode implementation steps rather than domain state,
|
|
39
|
-
- hard-coded workflow steps repeated in multiple callers,
|
|
40
|
-
- comments explaining what code structure should make obvious.
|
|
41
|
-
|
|
42
|
-
## Safe simplification moves
|
|
43
|
-
|
|
44
|
-
- Extract pure transformations and validations into small helpers.
|
|
45
|
-
- Replace repeated literal mappings with a named table or function.
|
|
46
|
-
- Flatten nested conditionals with explicit guard clauses when it clarifies failure paths.
|
|
47
|
-
- Centralize one business rule behind one function when multiple callers duplicate it.
|
|
48
|
-
- Split orchestration from local computation when tests need a deterministic unit.
|
|
49
|
-
- Delete dead compatibility paths only when reachability evidence and tests support deletion.
|
|
50
|
-
|
|
51
|
-
## Extraction rules
|
|
52
|
-
|
|
53
|
-
Create a reusable helper only when at least one condition is true:
|
|
54
|
-
|
|
55
|
-
- two or more call sites duplicate the same rule,
|
|
56
|
-
- the extracted logic has a clear domain name and stable contract,
|
|
57
|
-
- the helper makes a high-value invariant testable,
|
|
58
|
-
- the helper isolates an external dependency contract or side-effect boundary,
|
|
59
|
-
- the current function has multiple reasons to change.
|
|
60
|
-
|
|
61
|
-
Keep extracted helpers close to the owner module unless the repository already has a shared utility location for that domain.
|
|
62
|
-
|
|
63
|
-
## Behavior preservation checklist
|
|
64
|
-
|
|
65
|
-
Before and after simplification, verify:
|
|
66
|
-
|
|
67
|
-
- inputs, outputs, exceptions, side effects, and ordering are unchanged,
|
|
68
|
-
- persisted data and emitted events keep the same contract,
|
|
69
|
-
- public API and CLI behavior remain stable,
|
|
70
|
-
- log fields remain compatible unless stale names were intentionally corrected,
|
|
71
|
-
- existing tests still pass and new tests cover extracted rules.
|
|
72
|
-
|
|
73
|
-
If these checks can be enforced by existing or newly added tests, do not treat subjective confidence alone as a reason to avoid the simplification.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Repository Scan And Backlog Selection
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
## Required scan
|
|
8
|
-
|
|
9
|
-
- Read `AGENTS.md/CLAUDE.md`, `README*`, project docs, manifests, task runners, CI configs, and test setup.
|
|
10
|
-
- List entrypoints: CLI commands, servers, workers, jobs, frontend routes, scripts, libraries, or public packages.
|
|
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.
|
|
14
|
-
- Inspect current git state before editing so unrelated user changes are not overwritten.
|
|
15
|
-
- Identify generated, vendored, lock, snapshot, build-output, and fixture files; exclude them from refactoring unless they are human-maintained source.
|
|
16
|
-
|
|
17
|
-
## Code quality backlog signals
|
|
18
|
-
|
|
19
|
-
Prioritize files or functions with:
|
|
20
|
-
|
|
21
|
-
- high fan-in or many call sites,
|
|
22
|
-
- critical business rules or money/security/data-integrity decisions,
|
|
23
|
-
- duplicated condition trees, conversions, validation, or external-call choreography,
|
|
24
|
-
- unclear naming around ownership, units, state, or lifecycle,
|
|
25
|
-
- large functions that mix parsing, validation, orchestration, side effects, and formatting,
|
|
26
|
-
- log messages that describe old concepts or omit branch/failure context,
|
|
27
|
-
- low or missing tests around meaningful invariants and edge cases.
|
|
28
|
-
|
|
29
|
-
## Evidence to capture
|
|
30
|
-
|
|
31
|
-
For each candidate record:
|
|
32
|
-
|
|
33
|
-
- file path and symbol name,
|
|
34
|
-
- owning module or module cluster,
|
|
35
|
-
- job lens that exposed the issue,
|
|
36
|
-
- observed quality problem,
|
|
37
|
-
- why it matters to maintainability or correctness confidence,
|
|
38
|
-
- expected behavior-neutral change,
|
|
39
|
-
- tests or validations needed to prove safety,
|
|
40
|
-
- reason to defer if the candidate requires product or architecture approval.
|
|
41
|
-
|
|
42
|
-
## Exclusion rules
|
|
43
|
-
|
|
44
|
-
Do not refactor:
|
|
45
|
-
|
|
46
|
-
- third-party, generated, or compiled artifacts,
|
|
47
|
-
- snapshots where churn would hide signal,
|
|
48
|
-
- code the user marked as actively edited elsewhere,
|
|
49
|
-
- public schema/API names that require migration planning,
|
|
50
|
-
- areas that cannot be validated and are not causing a clear quality risk.
|
|
51
|
-
|
|
52
|
-
## Backlog scoring
|
|
53
|
-
|
|
54
|
-
Prefer a small set of high-confidence improvements over an exhaustive sweep.
|
|
55
|
-
|
|
56
|
-
Score each candidate by:
|
|
57
|
-
|
|
58
|
-
1. **Impact**: criticality, call frequency, future change risk.
|
|
59
|
-
2. **Confidence**: evidence that the change is behavior-neutral.
|
|
60
|
-
3. **Validation**: ability to test or otherwise prove equivalence.
|
|
61
|
-
4. **Blast radius**: number of modules, public contracts, and migrations affected.
|
|
62
|
-
|
|
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.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# Risk-Based Testing Strategy
|
|
2
|
-
|
|
3
|
-
## Principle
|
|
4
|
-
|
|
5
|
-
Choose tests from the risk inventory, not from a generic coverage target.
|
|
6
|
-
|
|
7
|
-
For every non-trivial pass, ask what could regress silently if the cleanup were wrong.
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
Confidence decisions must include the agent's own ability to understand and complete the refactor, not only the apparent difficulty of the code. Strong tests, characterization coverage, narrow rollback points, and clear validation commands are objective support: if the refactor breaks behavior, the agent should use the failing guardrails to repair the true owner and return the suite to green instead of treating the task as impossible.
|
|
12
|
-
|
|
13
|
-
Do not require pre-existing tests before every refactor. Instead:
|
|
14
|
-
|
|
15
|
-
- if existing guardrails are already sufficient, proceed;
|
|
16
|
-
- if the area is high-risk and guardrails are weak, add the smallest high-value tests first and treat that as progress toward the refactor.
|
|
17
|
-
|
|
18
|
-
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.
|
|
19
|
-
|
|
20
|
-
## Unit tests
|
|
21
|
-
|
|
22
|
-
Use for:
|
|
23
|
-
|
|
24
|
-
- extracted helpers,
|
|
25
|
-
- renamed or simplified business rules,
|
|
26
|
-
- validation and rejection logic,
|
|
27
|
-
- branch-specific errors and side effects,
|
|
28
|
-
- formatting or parsing boundaries.
|
|
29
|
-
|
|
30
|
-
Good oracles:
|
|
31
|
-
|
|
32
|
-
- exact return values,
|
|
33
|
-
- exact domain state transitions,
|
|
34
|
-
- exact error class or reason code,
|
|
35
|
-
- emitted side effect or explicit lack of side effect.
|
|
36
|
-
|
|
37
|
-
For high-risk legacy code with weak coverage, characterization-style unit tests are often the first unlock step even before the larger cleanup happens.
|
|
38
|
-
|
|
39
|
-
## Property-based tests
|
|
40
|
-
|
|
41
|
-
Use when logic has invariants or broad input space:
|
|
42
|
-
|
|
43
|
-
- serialization or parsing round trips,
|
|
44
|
-
- sorting, grouping, deduplication, aggregation,
|
|
45
|
-
- authorization or eligibility predicates,
|
|
46
|
-
- idempotency, retry, replay, and state-machine transitions,
|
|
47
|
-
- generated mocked external-service states.
|
|
48
|
-
|
|
49
|
-
Record `N/A` only with a concrete reason, such as "no generated input space; pass only renamed local variables."
|
|
50
|
-
|
|
51
|
-
## Integration tests
|
|
52
|
-
|
|
53
|
-
Use when the risk spans modules:
|
|
54
|
-
|
|
55
|
-
- orchestration calling extracted domain helpers,
|
|
56
|
-
- persistence plus domain transition,
|
|
57
|
-
- API/CLI handler plus service layer,
|
|
58
|
-
- logging contract across a real execution path,
|
|
59
|
-
- adapter behavior with mocked external services.
|
|
60
|
-
|
|
61
|
-
For external services, prefer mocks, fakes, local emulators, or recorded stable fixtures unless the real contract is explicitly under test.
|
|
62
|
-
|
|
63
|
-
When risk comes from multi-module coupling rather than one local function, integration coverage is often the best guardrail to add before refactoring.
|
|
64
|
-
|
|
65
|
-
## E2E tests
|
|
66
|
-
|
|
67
|
-
Use only when:
|
|
68
|
-
|
|
69
|
-
- the project already has reliable E2E infrastructure,
|
|
70
|
-
- the path is user-critical,
|
|
71
|
-
- required external services are stable, controlled, or safely mocked,
|
|
72
|
-
- the same confidence cannot be gained from faster integration tests.
|
|
73
|
-
|
|
74
|
-
If E2E is unreliable or too costly, add stronger integration coverage and state the reason.
|
|
75
|
-
|
|
76
|
-
## Edge and adversarial coverage
|
|
77
|
-
|
|
78
|
-
Consider:
|
|
79
|
-
|
|
80
|
-
- null, empty, malformed, duplicate, oversized, and boundary inputs,
|
|
81
|
-
- unauthorized actors and invalid transitions,
|
|
82
|
-
- stale, duplicate, out-of-order, or replayed events,
|
|
83
|
-
- dependency timeout, 429/500, partial response, and inconsistent response,
|
|
84
|
-
- partial write, rollback, compensation, and idempotency behavior,
|
|
85
|
-
- concurrency or shared-state contamination when the code is stateful.
|
|
86
|
-
|
|
87
|
-
## Test hygiene
|
|
88
|
-
|
|
89
|
-
- Keep tests deterministic and close to the behavior owner.
|
|
90
|
-
- Prefer table-driven cases for many similar business permutations.
|
|
91
|
-
- Preserve failing seeds or examples from property-based tests.
|
|
92
|
-
- Do not weaken existing tests to fit the refactor.
|
|
93
|
-
- If old tests asserted implementation details, rewrite them around stable behavior while preserving the business invariant.
|
|
94
|
-
- Once stable guardrails exist, do not refuse a maintainability-improving refactor purely because confidence feels lower than ideal; combine self-assessed ability with the objective safety net and let the guardrails decide.
|
|
95
|
-
- If stable guardrails do not yet exist for a high-risk area, create them as the next execution direction instead of treating the refactor as blocked forever.
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: merge-conflict-resolver
|
|
3
|
-
description: Resolve git merge conflicts using deterministic rules that preserve correct functionality. Use when branch consolidation encounters merge conflicts and needs automated resolution guidance that reads both parent versions and applies scenario-specific strategies.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Merge Conflict Resolver
|
|
7
|
-
|
|
8
|
-
## Dependencies
|
|
9
|
-
|
|
10
|
-
- Required: none.
|
|
11
|
-
- Conditional: **`commit-and-push`** when the user expects the resolved tree to be **committed** or **pushed**—**MUST** run that skill for the submission leg instead of bare `git commit` / ad-hoc push when readiness gates apply.
|
|
12
|
-
- Optional: none.
|
|
13
|
-
- Fallback: If a **gated** submission was requested but **`commit-and-push`** is unavailable, **MUST** stop and report.
|
|
14
|
-
|
|
15
|
-
## Standards
|
|
16
|
-
|
|
17
|
-
- Evidence: Read both parent versions from conflict markers before resolving.
|
|
18
|
-
- Execution: Read conflicts → apply scenario rules → verify with tests → recommit via **`commit-and-push`** when persisting to git.
|
|
19
|
-
- Quality: Prefer preserving functionality over keeping either branch's exact changes.
|
|
20
|
-
- Output: Return resolved files with passing verification.
|
|
21
|
-
|
|
22
|
-
## Workflow
|
|
23
|
-
|
|
24
|
-
### 1) Read conflict markers
|
|
25
|
-
|
|
26
|
-
- Read both parent versions from conflict markers before editing.
|
|
27
|
-
- Never use `-X ours`/`-X theirs` as the default strategy; only for narrowly justified conflicts after reading the actual content.
|
|
28
|
-
|
|
29
|
-
### 2) Apply scenario rules
|
|
30
|
-
|
|
31
|
-
| Scenario | Resolution |
|
|
32
|
-
|----------|-----------|
|
|
33
|
-
| Same line, both branches changed behavior | Read both code paths and compose merged logic preserving the verified invariant |
|
|
34
|
-
| Same line, bug fix vs refactor | Keep the bug fix, reapply compatible refactor structure |
|
|
35
|
-
| File deleted in one, modified in other | Keep version supported by current references/tests; delete only if proven correct |
|
|
36
|
-
| Both modified same file differently | Preserve both when compatible; manually compose overlapping changes |
|
|
37
|
-
| Test files conflict | Preserve both coverages unless one assertion is obsolete |
|
|
38
|
-
| Config file (non-overlapping keys) | Keep both values |
|
|
39
|
-
| package.json dependency | Keep higher version if compatible |
|
|
40
|
-
| Same function added differently | Keep both; rename if needed |
|
|
41
|
-
|
|
42
|
-
### 3) Verify after resolution
|
|
43
|
-
|
|
44
|
-
- `git add <resolved-files>`
|
|
45
|
-
- Run targeted tests or build checks for changed files.
|
|
46
|
-
- If verification fails, resolve differently before committing.
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "merge-conflict-resolver"
|
|
3
|
-
short_description: "Resolve git merge conflicts with deterministic, evidence-based rules"
|
|
4
|
-
default_prompt: >-
|
|
5
|
-
Use $merge-conflict-resolver to read both sides of conflict markers, apply scenario-specific resolution rules that preserve intended behavior, verify with the project’s tests or checks, and when the user needs persistence, hand off to $commit-and-push instead of ad-hoc git commands.
|