opencode-skills-collection 4.1.2 → 4.1.3

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.
Files changed (68) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +9 -1
  2. package/bundled-skills/antigravity-maintainer-batch-release/SKILL.md +15 -1
  3. package/bundled-skills/deep-research-framework/SKILL.md +81 -0
  4. package/bundled-skills/five-axis-code-review/SKILL.md +78 -0
  5. package/bundled-skills/git-commit-message/SKILL.md +76 -0
  6. package/bundled-skills/idea-to-blueprint/LICENSE +21 -0
  7. package/bundled-skills/idea-to-blueprint/SKILL.md +260 -0
  8. package/bundled-skills/idea-to-blueprint/assets/AGENTS.md.template +38 -0
  9. package/bundled-skills/idea-to-blueprint/assets/CLAUDE.md.template +38 -0
  10. package/bundled-skills/idea-to-blueprint/assets/DECISIONS.md.template +14 -0
  11. package/bundled-skills/idea-to-blueprint/assets/PROGRESS.md.template +47 -0
  12. package/bundled-skills/idea-to-blueprint/assets/session-prompt.md +23 -0
  13. package/bundled-skills/idea-to-blueprint/references/architecture-decisions.md +202 -0
  14. package/bundled-skills/idea-to-blueprint/references/blueprint-template.md +259 -0
  15. package/bundled-skills/idea-to-blueprint/references/code-quality-and-review.md +216 -0
  16. package/bundled-skills/idea-to-blueprint/references/design-minimal.md +96 -0
  17. package/bundled-skills/idea-to-blueprint/references/edge-case-catalog.md +239 -0
  18. package/bundled-skills/idea-to-blueprint/references/intake-questions.md +105 -0
  19. package/bundled-skills/idea-to-blueprint/references/research-protocol.md +196 -0
  20. package/bundled-skills/idea-to-blueprint/references/session-protocol.md +133 -0
  21. package/bundled-skills/idea-to-blueprint/references/stories-ac-tests.md +194 -0
  22. package/bundled-skills/idea-to-blueprint/references/ux-writing-guide.md +128 -0
  23. package/bundled-skills/idea-to-blueprint/scripts/lint_blueprint.py +460 -0
  24. package/bundled-skills/liuguang-banlan-ui/SKILL.md +22 -18
  25. package/bundled-skills/liuguang-banlan-ui/assets/starter/launcher.css +2 -2
  26. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/index.html +5 -4
  27. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme-config.js +3 -10
  28. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme.css +48 -62
  29. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/index.html +5 -4
  30. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme-config.js +27 -35
  31. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme.css +48 -62
  32. package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/spectral-field.js +135 -148
  33. package/bundled-skills/liuguang-banlan-ui/references/style-contract.md +26 -7
  34. package/bundled-skills/liuguang-banlan-ui/references/verification.md +19 -7
  35. package/bundled-skills/liuguang-banlan-ui/scripts/measure_preview.py +78 -47
  36. package/bundled-skills/liuguang-banlan-ui/scripts/serve_preview.py +35 -0
  37. package/bundled-skills/liuguang-banlan-ui/scripts/validate_manifest.py +34 -3
  38. package/bundled-skills/liuguang-banlan-ui/tests/test_measure_preview.py +119 -0
  39. package/bundled-skills/liuguang-banlan-ui/tests/test_serve_preview.py +38 -0
  40. package/bundled-skills/liuguang-banlan-ui/tests/test_validate_manifest.py +73 -0
  41. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +12 -12
  42. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +1 -1
  43. package/bundled-skills/meeting-notes/SKILL.md +80 -0
  44. package/bundled-skills/repo-foundation/SKILL.md +166 -0
  45. package/bundled-skills/repo-foundation/references/LICENSE.md +21 -0
  46. package/bundled-skills/repo-foundation/references/bootstrap.md +63 -0
  47. package/bundled-skills/repo-foundation/references/companion.md +9 -0
  48. package/bundled-skills/repo-foundation/references/continuity.md +50 -0
  49. package/bundled-skills/repo-foundation/references/evolution.md +60 -0
  50. package/bundled-skills/repo-foundation/references/migration-examples.md +53 -0
  51. package/bundled-skills/repo-foundation/references/shared-contracts.md +48 -0
  52. package/bundled-skills/repo-foundation/references/verification.md +50 -0
  53. package/bundled-skills/repo-native-refactor/SKILL.md +225 -0
  54. package/bundled-skills/repo-native-refactor/references/LICENSE.md +21 -0
  55. package/bundled-skills/repo-native-refactor/references/deterministic-tooling.md +101 -0
  56. package/bundled-skills/repo-native-refactor/references/error-reliability.md +117 -0
  57. package/bundled-skills/repo-native-refactor/references/finding-taxonomy.md +181 -0
  58. package/bundled-skills/repo-native-refactor/references/refactor-examples.md +77 -0
  59. package/bundled-skills/repo-native-refactor/references/repository-prose.md +157 -0
  60. package/bundled-skills/repo-native-refactor/references/repository-rehabilitation.md +94 -0
  61. package/bundled-skills/repo-native-refactor/references/semantic-risk.md +187 -0
  62. package/bundled-skills/repo-native-refactor/references/shared-contracts.md +48 -0
  63. package/bundled-skills/repo-native-refactor/references/testing-integrity.md +103 -0
  64. package/bundled-skills/tech-writing-proofread/SKILL.md +78 -0
  65. package/bundled-skills/typescript-expert/scripts/ts_diagnostic.py +40 -19
  66. package/bundled-skills/youtube-summarizer/SKILL.md +3 -3
  67. package/package.json +1 -1
  68. package/skills_index.json +254 -0
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: repo-native-refactor
3
+ description: "Review diffs without editing, or perform evidence-based cleanup while preserving authorized behavior, public contracts, and domain ownership."
4
+ category: development
5
+ risk: critical
6
+ source: https://github.com/Natchannnn/repository-engineering-skills
7
+ source_repo: Natchannnn/repository-engineering-skills
8
+ source_type: community
9
+ date_added: "2026-09-30"
10
+ author: Natchannnn
11
+ tags: [repository-engineering, code-review, refactoring, public-contracts]
12
+ tools: [codex]
13
+ license: MIT
14
+ license_source: https://github.com/Natchannnn/repository-engineering-skills/blob/e55b378158d5134a77af3b8dace4a2a1b17e41e2/LICENSE
15
+ metadata:
16
+ version: "0.3.0"
17
+ license: "MIT"
18
+ ---
19
+
20
+ # Repo-native refactor
21
+
22
+ ## When to Use
23
+
24
+ - Use when the user asks to review a diff, branch, or PR for correctness, contract breaks, or operational risk.
25
+ - Use when the user authorizes bounded cleanup before opening a PR or asks to consolidate duplicated policy with shared ownership.
26
+ - Use for repository rehabilitation only when the user explicitly requests work across multiple domains.
27
+ - Establish review-only, edit, or combined authority before choosing the operating mode.
28
+
29
+ Produce the smallest coherent change that belongs naturally in the target repository.
30
+
31
+ Prioritize in order:
32
+ 1. **Correctness and security:** prevent regressions, avoid new security vulnerabilities, handle boundary conditions.
33
+ 2. **Semantic integrity:** preserve existing invariants, state transitions, validation, and error boundaries.
34
+ 3. **Contracts stay as declared:** the rule lives in `references/shared-contracts.md` §1. Preserve the authorized target contract; otherwise keep exact declared types. Internal helpers are fine when exposed contracts stay exact.
35
+ 4. **Repository conformity:** match surrounding naming, domain conventions, and architectural precedents.
36
+ 5. **Economy and simplicity:** minimal intervention. Delete dead weight, avoid premature abstractions.
37
+
38
+ This is a post-implementation audit and small cleanup skill. It is not permission to redesign the repository. Establish a concrete consequence such as inconsistent behavior, duplicated policy that must change together, unclear ownership, avoidable resource cost, or a demonstrated maintenance obstacle. Leave healthy code unchanged when the benefit is speculative.
39
+
40
+ ---
41
+
42
+ ## Minimal intervention and evidence gate
43
+
44
+ - **Evidence-based intervention:** refactor only with concrete evidence of divergence, defect, or operational risk. If greenfield code or an additive diff is already minimal, idiomatic, and passing, leave it. A pattern you recognize is a candidate finding, not a reason to change anything.
45
+ - **Semantic DRY (Cost-benefit consolidation):** merge duplicated logic only when the copies share an owner, an invariant, and a reason to change, and only if merging saves more than it costs. Leave similar-looking checks in separate domains alone, and keep small local duplication when merging would obscure ownership.
46
+ - **Contract boundary protection:** preserve public interfaces, parameter names, and return types, except where the task clearly authorizes the change. During cleanup, keep the authorized target contract; don't revert to the old one.
47
+
48
+ ---
49
+
50
+ ## Operating modes
51
+
52
+ - **Review vs. Refactor Authority:** first establish the outcome: findings, edits, or both. Review-only means inspection and verification, no source edits. Authorized cleanup allows bounded corrections; don't ask approval again for routine choices.
53
+ - **Change-set cleanup:** for a working tree, branch, commit range, feature, or bounded checkpoint. Work diff-first; read surrounding code only to understand ownership, contracts, and precedent.
54
+ - **Repository rehabilitation:** only when explicitly requested across multiple domains. Read [repository rehabilitation](references/repository-rehabilitation.md), build a short profile, and work in batches you can verify independently.
55
+
56
+ ---
57
+
58
+ ## Evidence hierarchy
59
+
60
+ Use the evidence hierarchy to guide investigation, not to resolve material contradictions automatically. Reconcile conflicting requirements, documentation, callers, and tests before changing the affected contract. When repository patterns conflict, resolve in order:
61
+ 1. User requirements and explicitly authorized scope.
62
+ 2. Documented architecture and repository guidelines.
63
+ 3. Observable public contracts and persisted schemas.
64
+ 4. Healthy sibling code within the same domain and runtime boundary.
65
+ 5. Relevant tests, schemas, callers, and dependencies.
66
+ 6. Dominant local conventions.
67
+ 7. Language and runtime idioms.
68
+ 8. Conservative, idiomatic defaults.
69
+
70
+ Never treat a temporary workaround, buggy sibling, or accidental pattern as precedent.
71
+
72
+ ---
73
+
74
+ ## Workflow
75
+
76
+ ### 1. Establish scope and baseline
77
+ Before mutating code, identify:
78
+ - Comparison base and working-tree state.
79
+ - In-scope files vs. untouched user modifications.
80
+ - Existing verification commands and their current pass/fail status.
81
+
82
+ Differentiate pre-existing failures from regressions introduced by this pass. Never claim a check ran when it did not.
83
+
84
+ ### 2. Establish intent, ownership, and preservation
85
+ Refactoring is behavior-preserving by default. Protect:
86
+ - Public APIs, serializations, and database schemas.
87
+ - Concurrency guarantees, idempotency, timeouts, and retries.
88
+ - Resource lifecycles (file handles, sockets, database transactions).
89
+
90
+ If a bug requires an observable change, classify and report it as an intentional behavioral correction rather than routine cleanup.
91
+
92
+ ### 3. Inventory findings before rewriting
93
+ Inspect the authorized scope for:
94
+ - Validation or control flow whose structure obscures an invariant, creates inconsistent behavior, or duplicates the same owned policy.
95
+ - Misplaced domain ownership or leaky abstractions.
96
+ - Leaked unmanaged resources or missing atomic flush/sync calls.
97
+ - Unnecessary boilerplate, dead code, or commentary narrating syntax.
98
+
99
+ Read [finding taxonomy](references/finding-taxonomy.md) for complex cases. Establish the smallest adequate correction before editing.
100
+
101
+ ### 4. Classify risk and refactor
102
+ Risk bands:
103
+ - **R0 - Mechanical:** Established formatter or locally provable cleanup.
104
+ - **R1 - Low Structural:** Local residue with straightforward test verification.
105
+ - **R2 - Contextual Structural:** Renames, control-flow changes, extraction of shared predicates.
106
+ - **R3 - Semantic:** Errors, fallbacks, retries, serialization, transactions, async, or lifecycles.
107
+ - **R4 - Critical Boundary:** Auth, permissions, crypto, data migrations, persistence durability.
108
+
109
+ Read [semantic risk](references/semantic-risk.md) for R2+ changes. Never mass-rewrite R3 or R4 behavior without explicit instructions and verified tests.
110
+
111
+ ### 5. Audit code prose
112
+ - When prose is in scope, treat comments, docstrings, CLI output, and error messages as distinct surfaces. Read [repository prose](references/repository-prose.md) for that work.
113
+ - Delete comments that merely narrate obvious syntax or execution order.
114
+ - Preserve and tighten comments that explain non-obvious invariants, protocol quirks, rounding, or hardware workarounds.
115
+ - Never invent fictitious tickets, PR references, or production incident IDs.
116
+
117
+ ### 6. Verify and review
118
+ - Run the smallest repository-native checks that meaningfully exercise the change. For R3/R4 changes or weak test suites, read [error and reliability boundaries](references/error-reliability.md) and [testing integrity](references/testing-integrity.md).
119
+ - Prioritize diff reviewability and coherence over raw line minimization; do not compress code into unreadable one-liners.
120
+ - Distinguish intentional behavioral corrections from mechanical cleanup.
121
+ - Review the final diff like a skeptical maintainer. Every line needs a reason. No contract changed without permission, no test got weaker, no dependency moved for nothing.
122
+
123
+ ---
124
+
125
+ ## Reference routing
126
+
127
+ Read supporting references only when the corresponding trigger occurs:
128
+
129
+ - **[references/shared-contracts.md](references/shared-contracts.md):** Canonical contract + evidence hierarchy. Read when touching any public interface or reconciling conflicts.
130
+ - **[references/refactor-examples.md](references/refactor-examples.md):** R0–R4 good/bad diffs. Read before rewriting a candidate finding.
131
+ - **[references/finding-taxonomy.md](references/finding-taxonomy.md):** Read for complex multi-smell diffs to name owner + consequence.
132
+ - **[references/semantic-risk.md](references/semantic-risk.md):** Read for R2+ changes, justification gate, and stop conditions.
133
+ - **[references/repository-prose.md](references/repository-prose.md):** Read when editing comments, docstrings, CLI output, or error messages.
134
+ - **[references/error-reliability.md](references/error-reliability.md) + [references/testing-integrity.md](references/testing-integrity.md):** Read for R3/R4 or weak test suites.
135
+ - **[references/deterministic-tooling.md](references/deterministic-tooling.md):** Read before introducing new scanners or bulk-codemod tools.
136
+ - **[references/repository-rehabilitation.md](references/repository-rehabilitation.md):** Read only for explicitly requested multi-domain rehabilitation, in verifiable batches.
137
+
138
+ ---
139
+
140
+ ## Hard stops
141
+
142
+ Do not force a refactor where intent, ownership, public-contract consequences, migration semantics, or concurrency behavior cannot be established. Do not guess between conflicting architectural patterns without evidence.
143
+
144
+ ---
145
+
146
+ ## Completion Report
147
+
148
+ Scale the completion report to the change. Omit empty sections. Format completion concisely:
149
+
150
+ ### Result
151
+ Use one: **Verified**, **Verified with caveats**, **Needs review**, or **Failed verification**.
152
+
153
+ For review-only requests, an empty findings list is a complete result, not an
154
+ embarrassing one. Never manufacture findings to fill a report: each reported
155
+ finding needs a producer, a consumer, and an observed consequence, or it is
156
+ not reported.
157
+
158
+ ### Changed
159
+ Summarize material corrections by file and function.
160
+
161
+ ### Preserved intentionally
162
+ Note specific patterns or contracts deliberately retained to avoid breaking downstream consumers.
163
+
164
+ ### Verification
165
+ List exact verification commands executed and their outcomes.
166
+
167
+ ### Residual uncertainty
168
+ Document unresolved limitations or high-risk boundaries intentionally deferred.
169
+
170
+ ---
171
+
172
+ ## Examples
173
+
174
+ ### Review without editing
175
+
176
+ ```text
177
+ Use repo-native-refactor to review this branch against main for public-contract
178
+ breaks and retry failures. Do not edit source files. Report only findings with
179
+ a concrete producer, consumer, and observable consequence.
180
+ ```
181
+
182
+ Inspect the comparison base and relevant callers, run proportionate verification,
183
+ and report evidence-backed findings. An empty findings list is a valid result.
184
+
185
+ ### Consolidate one owned policy
186
+
187
+ ```text
188
+ Use repo-native-refactor to consolidate the duplicated eligibility checks owned
189
+ by this billing module. Preserve the current accepted inputs, error types, and
190
+ return values. Leave similar checks in other domains alone and run the module's tests.
191
+ ```
192
+
193
+ Confirm that the copies share an owner, invariant, and reason to change before
194
+ extracting anything. Keep the correction bounded and verify the final behavior.
195
+
196
+ ## Limitations
197
+
198
+ - Review requires an identifiable comparison base and enough repository evidence to establish contracts and ownership.
199
+ - Similar syntax alone does not establish shared policy or justify consolidation.
200
+ - The skill cannot establish migration or concurrency safety without relevant requirements and verification; unresolved material uncertainty is a hard stop.
201
+ - Local checks and self-review do not establish independent review or universal reliability.
202
+
203
+ ## Security & Safety Notes
204
+
205
+ Review-only mode permits inspection and verification without source edits. The
206
+ authorized cleanup mode can modify source files, so the declared risk is `critical`
207
+ under this collection's state-modification classification. Keep edits within the
208
+ user's authorized scope, preserve unrelated user changes, and apply the R3/R4
209
+ verification and stop conditions before changing sensitive behavior. Cleanup
210
+ authority does not authorize publishing, deploying, or changing external systems.
211
+
212
+ ---
213
+
214
+ ## When NOT to Use
215
+
216
+ - **Clean greenfield code:** Do not refactor newly written code that is already minimal, idiomatic, and passing all tests.
217
+ - **Speculative cleanup:** If you cannot state the domain owner and the concrete maintenance consequence in a single sentence, leave the code unmodified.
218
+ - **Risk classification:** When uncertain between risk bands (such as R2 structural vs. R3 semantic), default conservatively to the higher risk band and require explicit justification.
219
+
220
+
221
+ ## Source & License
222
+
223
+ Adapted from [Natchannnn/repository-engineering-skills](https://github.com/Natchannnn/repository-engineering-skills/tree/e55b378158d5134a77af3b8dace4a2a1b17e41e2).
224
+ The original MIT copyright notice and license are retained in [references/LICENSE.md](references/LICENSE.md).
225
+ Collection adaptations add metadata, explicit triggers, interaction examples, limitations, and safety notes; the core workflow and supporting reference instructions are retained.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Natchannnn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,101 @@
1
+ # Deterministic tooling policy
2
+
3
+ Use deterministic tools for problems they can reliably establish.
4
+
5
+ Examples:
6
+
7
+ - formatter;
8
+ - compiler;
9
+ - type checker;
10
+ - linter;
11
+ - dependency graph analysis;
12
+ - dead-code analysis;
13
+ - security scanning;
14
+ - AST/CST structural matching.
15
+
16
+ Tool output is evidence, not architectural authority.
17
+
18
+ ## Project tools first
19
+
20
+ Prefer tools already configured by the repository.
21
+
22
+ Do not install a new slop scanner or refactoring dependency merely because this skill mentions one.
23
+
24
+ Use repository configuration when available.
25
+
26
+ ## Structural search and rewrite
27
+
28
+ AST/CST tools are strong for locating syntactic patterns.
29
+
30
+ They do not prove semantic equivalence.
31
+
32
+ Regex and text search may locate prose candidates such as step narration, repeated docstrings, or section banners. They cannot determine whether a comment carries a contract, historical constraint, or operational rationale. Never auto-delete or rewrite prose solely from a phrase match, comment-density target, or AI-detector score.
33
+
34
+ `ast-grep` can display or interactively apply rewrites, while `--update-all/-U` accepts every matching rewrite without confirmation. Therefore unattended bulk application is appropriate only for transformations already classified as mechanically safe.
35
+
36
+ Do not bulk-rewrite:
37
+
38
+ - exception ownership;
39
+ - fallback behavior;
40
+ - retry;
41
+ - authorization;
42
+ - transaction semantics;
43
+ - unresolved type mismatches;
44
+ - async error behavior.
45
+
46
+ ## Dead-code and dependency analysis
47
+
48
+ Unused-code tools build a model of repository reachability.
49
+
50
+ A reported unused file/export/dependency may reflect:
51
+
52
+ - missing entry points;
53
+ - dynamic imports;
54
+ - plugin registration;
55
+ - generated files;
56
+ - incomplete framework integration;
57
+ - analyzer configuration gaps.
58
+
59
+ Knip documentation explicitly describes these situations and recommends correcting module-graph/configuration understanding rather than blindly suppressing or deleting findings.
60
+
61
+ Before deletion:
62
+
63
+ 1. determine why the analyzer considers the item unreachable;
64
+ 2. check framework/runtime discovery;
65
+ 3. check generated references;
66
+ 4. verify entry/plugin configuration;
67
+ 5. delete only when semantic ownership confirms it is dead.
68
+
69
+ ## Suppression policy
70
+
71
+ Do not respond to surprising findings by immediately adding ignores or suppression.
72
+
73
+ First determine whether:
74
+
75
+ - the code is actually dead;
76
+ - analyzer configuration is incomplete;
77
+ - the tool does not model the framework behavior.
78
+
79
+ Suppression should document a known limitation, not hide unexplained evidence.
80
+
81
+ ## Tool confidence
82
+
83
+ Classify findings:
84
+
85
+ **Confirmed:** tool result plus repository evidence agree.
86
+
87
+ **Probable:** tool result plausible but not fully established.
88
+
89
+ **Uncertain:** analyzer limitations or runtime behavior may invalidate it.
90
+
91
+ When two repository tools disagree, the dynamic-entry check (imports, plugin
92
+ registration, generated references, entry configuration) wins over static
93
+ reachability claims. A scanner cannot declare dead what the runtime can load.
94
+
95
+ Only confirmed findings should drive destructive automated changes.
96
+
97
+ ## Prose diagnostics
98
+
99
+ Use deterministic prose scans only to build an inspection queue. A useful diagnostic reports location and pattern without asserting authorship or defect status.
100
+
101
+ Do not install an AI detector or generic slop scanner merely to approve a refactor. If such a tool already exists in repository workflow, treat its output as a secondary signal and require repository evidence before mutation.
@@ -0,0 +1,117 @@
1
+ # Error and reliability boundaries
2
+
3
+ Error handling is about ownership, not visual cleanliness.
4
+
5
+ Before changing an error path establish:
6
+
7
+ 1. where the failure originates;
8
+ 2. which layer understands its meaning;
9
+ 3. which layer can recover;
10
+ 4. which layer should add context;
11
+ 5. which layer should log;
12
+ 6. which layer decides whether the operation continues.
13
+
14
+ ## Swallowed errors
15
+
16
+ An empty or minimal catch is suspicious when it destroys meaningful failure information.
17
+
18
+ It may still be intentional for:
19
+
20
+ - best-effort telemetry;
21
+ - feature detection;
22
+ - cleanup;
23
+ - optional enrichment;
24
+ - compatibility probing.
25
+
26
+ Understand the owner before changing behavior.
27
+
28
+ Never blindly convert:
29
+
30
+ `catch {}`
31
+
32
+ into:
33
+
34
+ `log + throw`.
35
+
36
+ That changes observable semantics.
37
+
38
+ ## Fallbacks
39
+
40
+ An empty array, empty string, null, cached value, or default object may represent:
41
+
42
+ - legitimate degradation;
43
+ - product behavior;
44
+ - backward compatibility;
45
+ - masking of infrastructure failure.
46
+
47
+ Determine which before removing it.
48
+
49
+ ## Logging
50
+
51
+ Avoid duplicate logging across layers.
52
+
53
+ The layer that has sufficient context and ownership should normally log.
54
+
55
+ Lower-level code may enrich or propagate errors without logging when an outer boundary owns observability.
56
+
57
+ Do not remove logs solely because console output resembles debug residue; CLI or system output may be contractual.
58
+
59
+ Do not casually rewrite log templates, structured field names, event names, metric labels, or severity. Dashboards, alerts, parsers, support procedures, and tests may depend on them even when no static caller is visible.
60
+
61
+ ## Error and output wording
62
+
63
+ Error messages, status text, stdout, and stderr are potentially observable behavior.
64
+
65
+ Before rewording, check:
66
+
67
+ - tests and snapshots;
68
+ - callers that parse or display the text;
69
+ - CLI and API compatibility expectations;
70
+ - monitoring, support, or localization workflows;
71
+ - whether the repository treats error codes or typed values as the stable contract instead.
72
+
73
+ Improve wording only when the task permits it and the compatibility surface is understood. Do not replace precise domain language with generic claims such as "operation failed gracefully" or "an unexpected issue occurred".
74
+
75
+ ## Retry
76
+
77
+ Before modifying retry logic determine:
78
+
79
+ - which failures are retryable;
80
+ - retry owner;
81
+ - maximum attempts;
82
+ - backoff;
83
+ - jitter;
84
+ - timeout;
85
+ - idempotency;
86
+ - side effects.
87
+
88
+ Retries without idempotency analysis are high risk.
89
+
90
+ ## Timeout and cancellation
91
+
92
+ Do not add or remove timeout/cancellation behavior without understanding:
93
+
94
+ - caller expectations;
95
+ - resource ownership;
96
+ - cleanup;
97
+ - nested timeout interactions.
98
+
99
+ ## Transactions
100
+
101
+ Transaction scope is semantic.
102
+
103
+ Moving calls inside or outside a transaction can change consistency and locking behavior even when code looks simpler.
104
+
105
+ Treat transaction refactors as R3 or R4.
106
+
107
+ ## Partial failure
108
+
109
+ Distributed or multi-step work may intentionally succeed partially.
110
+
111
+ Do not force all-or-nothing behavior unless the domain contract requires it.
112
+
113
+ ## Reliability rule
114
+
115
+ A cleaner-looking error path is not automatically a more correct one.
116
+
117
+ Preserve operational semantics unless evidence justifies change.
@@ -0,0 +1,181 @@
1
+ # Finding taxonomy
2
+
3
+ A finding is evidence that deserves investigation. It is not automatically a defect.
4
+
5
+ Before mutating code, establish:
6
+
7
+ **Observed pattern, then actual consequence, then owning layer, then repository evidence, then appropriate correction.**
8
+
9
+ A scanner match, generic style preference, complexity number, or resemblance to common AI-generated code is insufficient by itself.
10
+
11
+ ## 1. Repository conformity
12
+
13
+ Look for changes that introduce a second way to solve a problem the repository already solves coherently.
14
+
15
+ Examples include parallel:
16
+
17
+ - validation systems;
18
+ - error models;
19
+ - persistence access paths;
20
+ - logging conventions;
21
+ - configuration mechanisms;
22
+ - helper ecosystems;
23
+ - domain models.
24
+
25
+ Diagnosis requires comparing semantics and ownership, not just names.
26
+
27
+ A different implementation is acceptable when its domain, lifecycle, boundary, or invariants genuinely differ.
28
+
29
+ ## 2. Domain semantic erosion
30
+
31
+ Look for lost or weakened domain meaning.
32
+
33
+ Signals include generic names at domain-significant scope, loosely typed business states, business rules hidden inside technical transformations, or domain concepts flattened into generic payloads.
34
+
35
+ Restore terminology only from repository or task evidence.
36
+
37
+ Do not invent more sophisticated-sounding vocabulary.
38
+
39
+ Short generic locals in tiny scopes are not automatically problematic.
40
+
41
+ ## 3. Architectural fragmentation
42
+
43
+ Look for:
44
+
45
+ - responsibilities placed outside their natural owner;
46
+ - feature logic split across unnecessary technical layers;
47
+ - accidental service/factory/adapter chains;
48
+ - oversized orchestration functions;
49
+ - abstractions with no present policy or boundary value;
50
+ - local solutions that bypass established architecture.
51
+
52
+ Do not judge architecture from file count alone.
53
+
54
+ A thin abstraction may legitimately encode dependency direction, ownership, compatibility, policy, or test boundaries.
55
+
56
+ ## 4. Reinvention and duplication
57
+
58
+ Distinguish:
59
+
60
+ **same syntax**
61
+
62
+ from
63
+
64
+ **same concept**.
65
+
66
+ Code should normally be consolidated only when implementations share:
67
+
68
+ - ownership;
69
+ - invariants;
70
+ - semantic purpose;
71
+ - expected reasons to change.
72
+
73
+ Two similar blocks in different domains may intentionally remain separate.
74
+
75
+ ## 5. Error semantics
76
+
77
+ Look for:
78
+
79
+ - swallowed errors;
80
+ - fake success;
81
+ - universal empty fallbacks;
82
+ - lost context;
83
+ - logging at multiple ownership layers;
84
+ - retry at the wrong layer;
85
+ - infrastructure failure converted into misleading domain data.
86
+
87
+ Determine the error owner before changing propagation.
88
+
89
+ “Fail loudly” is not a universal rule.
90
+
91
+ ## 6. Type and schema integrity
92
+
93
+ Investigate:
94
+
95
+ - unchecked external data;
96
+ - unsafe type suppression;
97
+ - unexplained assertions;
98
+ - loose object/dict structures crossing domain boundaries;
99
+ - mismatch between runtime validation and static types;
100
+ - duplicated incompatible schemas.
101
+
102
+ Escape hatches are findings, not automatic defects.
103
+
104
+ A local assertion at a known third-party boundary may be intentional.
105
+
106
+ ## 7. Testing integrity
107
+
108
+ Look for:
109
+
110
+ - implementation logic copied into expected values;
111
+ - mocks that replace the behavior being tested;
112
+ - tests coupled to private implementation unnecessarily;
113
+ - assertions weakened to accommodate a change;
114
+ - regression cases removed;
115
+ - meaningless tests created for apparent coverage.
116
+
117
+ A passing test is useful evidence only to the extent that the test independently constrains behavior.
118
+
119
+ ## 8. Security and reliability
120
+
121
+ Inspect relevant changes for:
122
+
123
+ - missing authorization;
124
+ - insecure defaults;
125
+ - lost validation;
126
+ - unbounded retry;
127
+ - missing timeout;
128
+ - incorrect cleanup;
129
+ - broken idempotency;
130
+ - partial-failure handling;
131
+ - unsafe concurrency;
132
+ - transaction leaks;
133
+ - secrets exposed to logs.
134
+
135
+ Treat these areas as high semantic risk.
136
+
137
+ ## 9. Repository prose and communication integrity
138
+
139
+ Inspect comments, docstrings, test descriptions, errors, logs, command output, and user-facing strings according to their distinct roles.
140
+
141
+ Look for:
142
+
143
+ - narration that restates syntax or execution order;
144
+ - inflated or generic claims without a concrete invariant;
145
+ - documentation that repeats names and types but adds no contract;
146
+ - stale prose that contradicts behavior;
147
+ - domain language flattened into generic wording;
148
+ - valuable rationale buried inside lengthy explanation;
149
+ - observable strings reworded as if they were internal comments.
150
+
151
+ Prose that resembles common AI output is a finding, not proof that it is wrong. Resolve the repository's local prose conventions, then decide whether to delete, preserve, tighten, correct, or report it.
152
+
153
+ Do not use phrase blacklists, comment quotas, or AI-detector scores as mutation authority. Read [repository-native prose](repository-prose.md) when prose is material to the cleanup.
154
+
155
+ ## 10. Operational quality
156
+
157
+ Look for:
158
+
159
+ - temporary debug output;
160
+ - incorrect log ownership;
161
+ - missing structured context;
162
+ - accidental config drift;
163
+ - speculative environment flags;
164
+ - divergent metrics/tracing conventions;
165
+ - output changes that consumers may observe.
166
+
167
+ Remember that output can be a contract.
168
+
169
+ ## 11. Change discipline
170
+
171
+ Look for:
172
+
173
+ - unrelated cleanup;
174
+ - mass formatting;
175
+ - opportunistic renaming;
176
+ - dependency churn;
177
+ - broad modernization;
178
+ - multiple unrelated architectural changes in one diff;
179
+ - generated artifacts edited outside normal workflow.
180
+
181
+ A technically “better” change can still be a worse patch if it becomes harder to review, revert, or reason about.