@devflow-core/dsh-devflow 0.1.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.
Files changed (61) hide show
  1. package/NOTICE +13 -0
  2. package/README.md +82 -0
  3. package/assets/commands/devflow-adversarial.toml +11 -0
  4. package/assets/commands/devflow-audit.toml +32 -0
  5. package/assets/commands/devflow-debt.toml +42 -0
  6. package/assets/commands/devflow-find-fault.toml +11 -0
  7. package/assets/commands/devflow-learn.toml +21 -0
  8. package/assets/commands/devflow-plan.toml +58 -0
  9. package/assets/commands/devflow-prove.toml +20 -0
  10. package/assets/commands/devflow-pua.toml +40 -0
  11. package/assets/commands/devflow-review.toml +36 -0
  12. package/assets/commands/devflow-spec.toml +49 -0
  13. package/assets/commands/devflow.toml +35 -0
  14. package/assets/presets/devflow-2/NOTICE +4 -0
  15. package/assets/presets/devflow-2/README.md +71 -0
  16. package/assets/presets/devflow-2/agent.cordis.yml +337 -0
  17. package/assets/presets/devflow-2/custom-bash.mjs +213 -0
  18. package/assets/presets/devflow-2/preset.yml +3 -0
  19. package/assets/presets/devflow-2/tool-bootstrap.mjs +496 -0
  20. package/assets/scripts/devflow-audit.js +275 -0
  21. package/assets/scripts/devflow-debt.js +196 -0
  22. package/assets/scripts/devflow-doctor.js +90 -0
  23. package/assets/scripts/devflow-plan.js +638 -0
  24. package/assets/scripts/devflow-review.js +93 -0
  25. package/assets/scripts/devflow-spec.js +238 -0
  26. package/assets/skills/devflow-adversarial/SKILL.md +71 -0
  27. package/assets/skills/devflow-audit/SKILL.md +78 -0
  28. package/assets/skills/devflow-brainstorm/SKILL.md +176 -0
  29. package/assets/skills/devflow-brainstorm/references/interview-discipline.md +184 -0
  30. package/assets/skills/devflow-build/SKILL.md +238 -0
  31. package/assets/skills/devflow-build/references/build-methods.md +40 -0
  32. package/assets/skills/devflow-core/SKILL.md +93 -0
  33. package/assets/skills/devflow-core/references/core-methods.md +131 -0
  34. package/assets/skills/devflow-core/references/reference-projects.md +133 -0
  35. package/assets/skills/devflow-core/references/skill-guide.md +63 -0
  36. package/assets/skills/devflow-cut/SKILL.md +208 -0
  37. package/assets/skills/devflow-cut/references/cut-methods.md +65 -0
  38. package/assets/skills/devflow-cut/references/native-capability-checklist.md +112 -0
  39. package/assets/skills/devflow-docs-followup/SKILL.md +132 -0
  40. package/assets/skills/devflow-docs-followup/agents/openai.yaml +4 -0
  41. package/assets/skills/devflow-find-fault/SKILL.md +109 -0
  42. package/assets/skills/devflow-learn/SKILL.md +176 -0
  43. package/assets/skills/devflow-plan/SKILL.md +142 -0
  44. package/assets/skills/devflow-plan/references/plan-methods.md +74 -0
  45. package/assets/skills/devflow-project-knowledge/SKILL.md +354 -0
  46. package/assets/skills/devflow-prove/SKILL.md +216 -0
  47. package/assets/skills/devflow-prove/references/code-review-checklist.md +202 -0
  48. package/assets/skills/devflow-prove/references/flow-self-test.md +775 -0
  49. package/assets/skills/devflow-prove/references/proof-recovery-methods.md +26 -0
  50. package/assets/skills/devflow-pua/SKILL.md +197 -0
  51. package/assets/skills/devflow-pua/references/flavor-display.md +49 -0
  52. package/assets/skills/devflow-pua/references/methodology-library.md +193 -0
  53. package/assets/skills/devflow-pua/references/methodology-router.md +78 -0
  54. package/assets/skills/devflow-spec/SKILL.md +92 -0
  55. package/assets/skills/devflow-spec/references/spec-plan-methods.md +15 -0
  56. package/cordis.patch.yml +11 -0
  57. package/lib/dsh-home.js +33 -0
  58. package/lib/index.js +79 -0
  59. package/lib/mount-once.js +34 -0
  60. package/lib/sync.js +168 -0
  61. package/package.json +32 -0
@@ -0,0 +1,216 @@
1
+ ---
2
+ name: devflow-prove
3
+ description: "Use before saying done, fixed, complete, working, passed, resolved, ready, or candidate_pass; use after builds, bug fixes, rule/docs/skill changes, tests, validation, and any PASS/FAIL/BLOCKED evidence claim. Runs the narrowest sufficient check, performs adversarial review for development work, and reports Command/Result/Adversarial review/Judgment."
4
+ ---
5
+
6
+ # DevFlow Prove
7
+
8
+ No proof, no completion.
9
+
10
+ **Violating the letter of the rules is violating the spirit of the rules.**
11
+
12
+ ## Methodology Assets
13
+
14
+ When this skill activates, read these local references before choosing or running proof scenarios:
15
+
16
+ - `skills/devflow-prove/references/flow-self-test.md` — end-to-end scenario tests and pressure scenarios for the framework itself.
17
+ - `skills/devflow-prove/references/code-review-checklist.md` — language-specific code quality criteria for adversarial code review.
18
+
19
+ ## Process
20
+
21
+ Load `skills/devflow-prove/references/proof-recovery-methods.md` before selecting proof. It owns the shared proof and recovery method details used by Prove and PUA.
22
+
23
+ 1. Identify the command, test, build, lint, diff check, validation script, or manual scenario that proves the claim.
24
+ 2. Confirm the exact changed files, approved File Structure/Plan boundary, latest Prewalk Execution Trace and Current Handoff Facts. Read the task's remaining-work completion evidence plus the nearest comparable code.
25
+ 3. Run the narrowest sufficient check now, then independently inspect the actual implementation diff before interpreting test results.
26
+ 4. Run adversarial review (对抗式审查) against the approved responsibility boundary, Prewalk facts, direct contracts, nearby convention, and likely regressions.
27
+ 5. For code changes: run the **Code Quality Review** (General Engineering Review + Language-Specific Checklist from `code-review-checklist.md`), then generate a **Code Review Report** (see format below). Classify each evidence-backed finding as Blocker, Warning, or Recommendation. An unresolved Blocker or Warning returns `FAIL` facts to Core; recommendations do not block an otherwise proven result.
28
+ 6. Read the real output and exit status.
29
+ 7. If it fails, report `FAIL` facts to `devflow-core`; Core selects Recovery or another owner. Use `devflow-pua` when the failure includes user challenge, repeated miss, or changed-wrong behavior.
30
+ 8. If it cannot run, report `BLOCKED` facts to `devflow-core` and name the missing condition.
31
+ 9. On `PASS`, load `devflow-learn` for its mandatory proactive completion review before final completion reporting. The review may yield a learning card, a project-knowledge candidate pending user confirmation, or no useful record.
32
+ 10. Only then report completion or `candidate_pass`.
33
+
34
+ ## Exception Return Boundary
35
+
36
+ Prove is the terminal direct-success step. `PASS` completes only after the Learn review. `FAIL`, `BLOCKED`, an adversarial gap, an unresolved Code Review Blocker/Warning, or a missing recovery-proof field are non-unique facts and return to `devflow-core`; Prove does not select the repair, recovery, or re-clarification skill.
37
+
38
+ ## Proof Selection
39
+
40
+ | Work type | Proof |
41
+ |---|---|
42
+ | Docs/rules/skills | File presence, frontmatter, required wording, command entries, path consistency, scenario checklist. |
43
+ | Code | Targeted test, build, lint, typecheck, or runtime scenario. **Plus: inspect the actual implementation diff against the approved File Structure/Plan boundary, Prewalk evidence, and nearest comparable code before interpreting test results.** **Plus: comment verification — check requirements recorded by the Spec/Plan or local convention, and any non-obvious decision, business, security, or compatibility boundary.** **Plus: language-specific code quality review — detect language from file extensions, apply the matching checklist in `skills/devflow-prove/references/code-review-checklist.md`, and classify evidence-backed Blockers, Warnings, and Recommendations.** |
44
+ | Bug fix | Original symptom reproduction or regression check. **Plus: verify any documented fix rationale and any non-obvious failure condition that needs preservation.** |
45
+ | Framework design | Native capability coverage, anti-pattern gates, skill behavior, and output contracts. |
46
+ | Productized skill pack | `npm test` or equivalent package validation. |
47
+
48
+ ## Adversarial Review
49
+
50
+ After development work, adversarial review (对抗式审查) is mandatory before completion: check the strongest plausible reason the change is still wrong, incomplete, unreachable, over-broad, or under-verified. If the adversarial review finds a real gap, report `FAIL` facts to `devflow-core` before claiming completion.
51
+
52
+ Adversarial review checklist for code changes:
53
+
54
+ - **Correctness**: Does the code actually solve the stated goal? Are edge cases handled?
55
+ - **Regression**: Could this change break sibling callers, shared state, or downstream consumers?
56
+ - **Activation path**: Is the new code actually reachable? Can the user/trigger reach it?
57
+ - **Scope creep**: Does the diff include unrequested behavior or drive-by refactors?
58
+ - **Proof coverage**: Is the verification narrow enough to be meaningful, or is it a rubber-stamp?
59
+ - **Code comments**: Are all Spec/Plan/local-convention requirements present? Are non-obvious decisions, business rules, security, or compatibility boundaries documented where needed? A missing triggered comment is an approved-contract gap; absence of untriggered narration is not.
60
+ - **Code Quality**: Two-layer review. The adversarial review items above (Correctness, Regression, Activation path, Scope creep) already cover functional correctness. Then run the **General Engineering Review** from `skills/devflow-prove/references/code-review-checklist.md` for the remaining dimensions: requirements understanding, code quality (readability, maintainability, testability), performance, security, error handling. Finally, detect language(s) from file extensions and apply the matching **Language-Specific Checklist**. **Generate a diff-first Code Review Report (see format below) with actual changed-code evidence, Plan boundary, Prewalk evidence, Blockers, Warnings, Recommendations, and Boundary verdict; unresolved Blockers or Warnings block PASS.**
61
+
62
+ After agent rule, command, prompt, entry, or `SKILL.md` changes, run a Skill Activation Chain Check before completion:
63
+
64
+ ```text
65
+ Skill Activation Check: trigger <user words/command/upstream output>; surface <description/command/entry>; action <loads/calls target skill>; evidence <artifact/check/output>
66
+ ```
67
+
68
+ Check:
69
+
70
+ - Trigger: natural user wording, explicit command, or upstream stage output can reach the target skill.
71
+ - Surface: the target `description`, command prompt, or entry file contains real trigger wording.
72
+ - Runtime action: the rule says to load/call the skill, not only "reference" it.
73
+ - Handoff evidence: the downstream skill artifact, check, or output contract is required before completion.
74
+ - Breakpoint: if activation is broken, fix the trigger chain before editing skill internals again.
75
+
76
+ ## Required Output
77
+
78
+ ```text
79
+ Command: <actual command run>
80
+ Result: <key output summary>
81
+ Adversarial review: <strongest challenge and disposition, or not applicable for non-development verification>
82
+ Judgment: PASS / FAIL / BLOCKED
83
+ ```
84
+
85
+ Add coverage when useful:
86
+
87
+ ```text
88
+ Coverage: <what was verified>
89
+ Not covered: <none or explicit gap>
90
+ ```
91
+
92
+ ## Code Review Report
93
+
94
+ For code changes, after running the Code Quality Review (General Engineering Review + Language-Specific Checklist), generate this report before claiming PASS or FAIL. Review the actual diff before relying on test results. A Blocker or unresolved Warning returns `FAIL` facts to Core; Recommendations remain visible but do not independently prevent PASS.
95
+
96
+ ```text
97
+ Code Review Report:
98
+ - Diff reviewed: [actual changed files/ranges].
99
+ - Plan boundary: [approved File Structure row(s) and verdict].
100
+ - Prewalk evidence: [Execution Trace, Handoff Facts, remaining-work completion evidence].
101
+ - Comparable code: [nearest inspected file/symbol and observed convention].
102
+ - Blockers: [count].
103
+ 1. [Blocker] [file:line] — [changed-code evidence and concrete risk] → [smallest correction].
104
+ - Warnings: [count].
105
+ 1. [Warning] [file:line] — [evidence-backed issue] → [required closure].
106
+ - Recommendations: [count].
107
+ 1. [Recommendation] [file:line] — [contextual improvement] → [optional choice].
108
+ - Boundary verdict: [within approved responsibility/touch set or drift facts returned to Core].
109
+ - Judgment: PASS (no unresolved Blockers or Warnings) / FAIL (Blocker or Warning remains).
110
+ ```
111
+
112
+ Rules:
113
+ - Every Blocker or Warning identifies an actual changed-code location, evidence, concrete risk, and smallest correction.
114
+ - A pattern preference, function size, class name, dependency count, missing cache, or fixed architectural shape cannot block by itself.
115
+ - Re-review the new diff after every quality repair and explicitly close or persist each prior Blocker/Warning.
116
+ - **STOP gate**: when a Blocker or Warning remains, do not claim `PASS`; return the facts to Core for the next lifecycle decision. Recommendations remain visible but do not independently stop an otherwise proven result.
117
+
118
+ ## Learning Check
119
+
120
+ Every `PASS` must load `devflow-learn` before the final completion report. The review actively extracts reusable implementation patterns, constrained decisions, effective proof, conventions, invariants, and business-fact candidates from verified work. A card is conditional on useful future-task value; the review itself is mandatory.
121
+
122
+ If the user corrected the result, repeated the same rule, or a non-obvious pitfall appeared, preserve the existing `devflow-learn` recovery capture in addition to the `PASS` review.
123
+
124
+ When a review identifies a code-backed business-semantic change, report the candidate and wait for user confirmation before loading `devflow-project-knowledge`. Do not update `docs/project-knowledge/` automatically.
125
+
126
+ Report:
127
+
128
+ ```text
129
+ Learning closure:
130
+ - Learning signal: PASS review/correction/pitfall/none
131
+ - Recall record: none/index/card
132
+ - Review result: learning card/project-knowledge candidate/no useful record
133
+ - New sediment: none/card/rule/skill
134
+ - Next intercept: next time <X>, first do <Y>, do not do <Z>
135
+ ```
136
+
137
+ Do not create noisy learning entries for one-off facts, raw implementation narration, already-covered lessons, or pure refactors without reusable insight.
138
+
139
+ ## Pressure Recovery Check
140
+
141
+ If proof fails after repeated attempts, or the user says the result is wrong, changed wrong, not what they asked for, or hard to distinguish:
142
+
143
+ ```text
144
+ Pressure check: user challenged result / repeated miss / failed proof
145
+ Next step: devflow-core -> devflow-pua
146
+ ```
147
+
148
+ Do not continue the same approach with only minor wording, parameter, or nearby-file tweaks. `devflow-pua` must stop, restate the goal, ask or infer the desired result, list 3 hypotheses, and choose a materially different approach before the next proof.
149
+
150
+ ## Recovery Proof Contract
151
+
152
+ After a `devflow-pua` recovery, the first Prove pass must cite the PUA recovery output as evidence that recovery actually ran — triggering the skill alone is not proof. Quote these fields from the PUA output:
153
+
154
+ ```text
155
+ Recovery evidence:
156
+ - METHOD / SWITCH: <flavor/method and any switch line>
157
+ - User-view miss: <classification>
158
+ - New success contract: <expected result + verification>
159
+ - Changed approach: <old path abandoned; new path>
160
+ ```
161
+
162
+ If any field is missing or empty, recovery was not executed. Report `FAIL` facts to `devflow-core`, which may select `devflow-pua`; a bare `METHOD:` line without diagnosis, quarantine, and a changed approach is not recovery.
163
+
164
+ ## Evidence Rules
165
+
166
+ - Do not write "should work" as a result.
167
+ - Do not hide skipped checks.
168
+ - If verification is partial, say exactly what remains unverified.
169
+ - Never use old output, "looks good", or a delegated claim without independent verification.
170
+ - Running the same successful command twice without changes adds no evidence.
171
+ - On DeepSeek Harness (DSH), oversized tool results are pruned (default threshold 8192 chars, keeping the head 4096 and tail 1024). Preserve the key command, result excerpt, and judgment rationale in your own context — the completion report or `todo_write` — before a long output is truncated; do not rely on a pruned tool result still holding the evidence.
172
+
173
+ ## Failure Loop
174
+
175
+ If proof fails:
176
+
177
+ ```text
178
+ Judgment: FAIL
179
+ Failure facts: ...
180
+ Next step: devflow-core Recovery route; use devflow-pua for user challenge, changed-wrong result, repeated miss, or quality complaint
181
+ ```
182
+
183
+ Recovery requires re-reading facts, listing 3 hypotheses, and trying a materially different approach.
184
+
185
+ ## Anti-Rationalization
186
+
187
+ | Excuse | Reality |
188
+ |---|---|
189
+ | "This is only documentation." | Documentation can still be broken, stale, or uncallable. Validate it. |
190
+ | "A partial check is enough." | Partial proof must be labeled partial. |
191
+ | "The tool said success." | Tool claims are data. Verify the actual artifact/output. |
192
+ | "I am confident." | Confidence is not evidence. |
193
+ | "Comments are optional, the code works." | Comments required by the Spec, Plan, project convention, or a non-obvious boundary are implementation requirements; verify them. |
194
+ | "The code is self-explanatory." | Clear code can avoid redundant narration, but it cannot waive an approved documentation requirement or an important non-obvious reason. |
195
+
196
+ ## Red Flags — STOP
197
+
198
+ - About to say "done", "fixed", "complete", or "passed" without running verification
199
+ - Using "should work", "probably", or "seems to"
200
+ - Trusting a delegated claim without independent verification
201
+ - Reusing old output as proof
202
+ - Expressing satisfaction before verification runs
203
+ - Skipping the Skill Activation Chain Check after rule/skill/command changes
204
+ - Claiming PASS when an approved documentation requirement or an important non-obvious boundary is unaddressed
205
+
206
+ **All of these mean: run the command, read the output, then claim.**
207
+
208
+ ## Verification
209
+
210
+ Before leaving this skill, confirm:
211
+
212
+ - [ ] Actual command or manual scenario was run.
213
+ - [ ] Result summary cites real output.
214
+ - [ ] Judgment is `PASS`, `FAIL`, or `BLOCKED`.
215
+ - [ ] Coverage and gaps are clear when relevant.
216
+ - [ ] After a `devflow-pua` recovery, the Prove pass cites the Recovery Proof Contract fields (METHOD/SWITCH, User-view miss, New success contract, Changed approach).
@@ -0,0 +1,202 @@
1
+ # Code Review Checklist
2
+
3
+ Two-layer review: general engineering dimensions (all languages) + language-specific best practices.
4
+
5
+ ## How to Use
6
+
7
+ 1. Read the approved File Structure/Plan boundary, latest Prewalk Execution Trace, Current Handoff Facts, remaining-work completion evidence, actual changed diff, and nearest comparable code.
8
+ 2. Run the **General Engineering Review** first — applies to all code changes regardless of language.
9
+ 3. Detect the language(s) from changed file extensions.
10
+ 4. Apply the matching **Language-Specific Checklist** below.
11
+ 5. For full-stack changes, apply all relevant language checklists.
12
+ 6. Classify findings only from actual changed-code evidence and concrete risk: unmet approved requirement, active security/data/authorization risk, correctness regression, or demonstrated operational failure is a `Blocker`; an evidence-backed boundary, contract, local-convention, side-effect, or verification issue requiring closure is a `Warning`; other contextual guidance is a `Recommendation`. Unresolved Blockers and Warnings prevent `PASS`.
13
+
14
+ > **Note**: Functional correctness, regression, activation path, scope creep, and proof coverage are already covered by the adversarial review checklist in `SKILL.md`. The General Engineering Review below covers the remaining dimensions that the adversarial review does not.
15
+
16
+ > **Applicability**: Treat the following design, framework, and language items as context checks, not universal prescriptions. Apply one when the approved scope, existing project convention, measured workload, public contract, or concrete failure mode makes it relevant. Security, authorization, data protection, injection prevention, resource safety, and an explicit project rule remain hard checks.
17
+
18
+ > **Non-blocking by itself**: a pattern preference, function or class size, dependency count, absent cache, or fixed architecture shape is not a Blocker or Warning without changed-code evidence and concrete risk.
19
+
20
+ ## General Engineering Review
21
+
22
+ Applies to all code changes. Review the items proportionately to the changed behavior and classify them with the rules above; do not fail a small change merely because it omits a speculative abstraction or style preference.
23
+
24
+ ### 1. Requirements Understanding
25
+
26
+ - [ ] Business goal is clear: what does this code achieve?
27
+ - [ ] Inputs, outputs, and boundary conditions are identified.
28
+ - [ ] Non-functional requirements are addressed (performance, security, availability).
29
+
30
+ ### 2. Code Quality
31
+
32
+ #### 2.1 Readability
33
+
34
+ - [ ] A maintainer can identify business intent, key rules, failure paths, and side effects from local names and structure.
35
+ - [ ] Types and functions have one dominant, coherent responsibility; boundaries are changed only when dependencies, lifecycle, or change reasons justify it.
36
+ - [ ] Important conditions use domain language; code avoids unexplained flags, magic values, and opaque control flow where a clearer local expression is warranted.
37
+ - [ ] Comments explain WHY, not WHAT; names and structure carry ordinary explanation.
38
+
39
+ #### 2.2 Maintainability
40
+
41
+ - [ ] The nearest applicable project convention for naming, layering, errors, logging, caching, and tests is followed, or a deliberate deviation has reason, impact, and proof.
42
+ - [ ] Dependencies, configuration, and extension points are introduced only when current scope or evidence makes them useful.
43
+ - [ ] Meaningful duplication is consolidated only when shared code improves local understanding, correctness, or a demonstrated reuse need.
44
+ - [ ] New abstraction preserves a current boundary, replacement need, test need, or multiple real implementations; it is not added only to satisfy a design principle.
45
+
46
+ #### 2.3 Testability
47
+
48
+ - [ ] State and side effects have an appropriate test seam for the changed behavior; use interfaces, dependency injection, pure functions, or existing project mechanisms only when they improve that seam.
49
+ - [ ] Side effects are controlled and isolated where the current risk or project convention requires it.
50
+ - [ ] Tests cover changed main paths, edge cases, and boundary conditions proportionately to risk.
51
+
52
+ ### 3. Performance
53
+
54
+ - [ ] Time and space complexity fit the expected data volume or measured workload.
55
+ - [ ] No N+1 query problems or repeated expensive work on an identified hot path.
56
+ - [ ] Caching, optimization, and concurrency are assessed when workload or a concrete failure mode makes them relevant; any chosen cache has measurable benefit, ownership, invalidation, and consistency behavior.
57
+ - [ ] Performance techniques are not added speculatively where the simpler path is sufficient.
58
+
59
+ ### 4. Security
60
+
61
+ - [ ] Input validation prevents injection (SQL, XSS, command, path traversal).
62
+ - [ ] Output encoding prevents XSS.
63
+ - [ ] Sensitive data is encrypted (at rest and in transit).
64
+ - [ ] Authorization and permission checks are in place.
65
+ - [ ] Logs do not leak sensitive data (passwords, tokens, PII).
66
+
67
+ ### 5. Error Handling
68
+
69
+ - [ ] Exceptions are classified appropriately (business vs system vs validation).
70
+ - [ ] Error messages are user-friendly and actionable.
71
+ - [ ] Resources are properly released (connections, files, streams).
72
+ - [ ] Fail-fast principle applied where appropriate.
73
+
74
+ ## Language-Specific Checklists
75
+
76
+ ## C# / .NET
77
+
78
+ - Use enums for fixed value sets; no magic strings/numbers.
79
+ - Use `const` or `static readonly` for true constants; not `static` instance fields.
80
+ - Prefer LINQ over manual loops when it improves readability without hurting performance.
81
+ - Use `var` when the type is obvious from the right side; use explicit type when it aids readability.
82
+ - Use `StringBuilder` for string concatenation in loops; not `+=`.
83
+ - Use `string.IsNullOrEmpty()` / `string.IsNullOrWhiteSpace()`; not `== ""` or `== null`.
84
+ - Prefer `async/await` over `.Result` / `.Wait()`; avoid sync-over-async.
85
+ - Use `ConfigureAwait(false)` in library code.
86
+ - Use collection initializers: `new List<T> { a, b, c }`.
87
+ - Use null-conditional operators (`?.`) and null-coalescing (`??`) appropriately.
88
+ - Use `record` for immutable data; `class` for mutable.
89
+ - Use pattern matching (`is`, `switch` expressions) over type checks + casts.
90
+ - Use `nameof()` for parameter/property references in exceptions and notifications.
91
+ - Prefer dependency injection over static service locators.
92
+ - Use `using` statements/declarations for IDisposable.
93
+ - Check for: `==` vs `.Equals()`, mutable structs, enum underlying type mismatches, missing `ConfigureAwait(false)` in library code.
94
+
95
+ ## Java
96
+
97
+ - Use enums for fixed value sets; no magic strings/numbers.
98
+ - Use `Optional<T>` for nullable return values; not `null` returns with `@Nullable`.
99
+ - Prefer `Stream` API over manual loops when it improves readability.
100
+ - Use `StringBuilder` for string concatenation in loops.
101
+ - Use `Objects.requireNonNull()` for null checks.
102
+ - Prefer `List.of()` / `Map.of()` (Java 9+) for immutable collections.
103
+ - Use `try-with-resources` for AutoCloseable.
104
+ - Prefer interfaces as types: `List<String>` not `ArrayList<String>`.
105
+ - Use `@Override` when implementing interface methods or overriding superclass methods.
106
+ - Use `final` for variables that should not be reassigned.
107
+ - Prefer records (Java 16+) for immutable data carriers.
108
+ - Use `instanceof` pattern matching (Java 16+) over type checks + casts.
109
+ - Use `switch` expressions with `->` and `yield`.
110
+ - Check for: `==` for string comparison, `Integer` cache range, unchecked exceptions, raw types.
111
+
112
+ ## TypeScript / JavaScript
113
+
114
+ - Use `enum` or union types for fixed value sets; no magic strings/numbers.
115
+ - Use `const` by default; `let` only when reassignment is needed; never `var`.
116
+ - Prefer `interface` for object shapes; `type` for unions and intersections.
117
+ - Use optional chaining (`?.`) and nullish coalescing (`??`).
118
+ - Use `readonly` for immutable properties and `Readonly<T>` / `ReadonlyArray<T>` for immutable collections.
119
+ - Prefer `unknown` over `any`; use type guards to narrow.
120
+ - Use discriminated unions for state machines; not boolean flags.
121
+ - Use `as const` for literal type inference.
122
+ - Prefer `import type` for type-only imports.
123
+ - Use `Promise` with `async/await`; not `.then()` chains when possible.
124
+ - Use `Map`/`Set` for key-value/unique collections; not plain objects when keys are non-string.
125
+ - Check for: `==` vs `===`, `null` vs `undefined`, mutable default parameters, `any` overuse.
126
+
127
+ ## Vue
128
+
129
+ - Use `<script setup>` with Composition API; not Options API for new code.
130
+ - Use `ref()` / `reactive()` for state; `computed()` for derived values.
131
+ - Use `defineProps()` / `defineEmits()` with TypeScript types.
132
+ - Use `watch()` / `watchEffect()` for side effects; clean up in `onUnmounted()`.
133
+ - Prefer `v-model` with `defineModel()` over manual prop/emit sync.
134
+ - Use `provide()` / `inject()` for dependency injection across deep component trees.
135
+ - Use `<Suspense>` for async component loading.
136
+ - Keep components small and composable; extract reusable logic to composables (`use*` functions).
137
+ - Use `v-if` for conditional rendering, `v-show` for frequent toggling.
138
+ - Use `:key` with `v-for` for stable identity; not array index.
139
+ - Check for: reactive property addition without `reactive()`, missing `key` in `v-for`, `v-if` + `v-for` on same element, missing `onUnmounted` cleanup.
140
+
141
+ ## React
142
+
143
+ - Use function components with hooks; not class components for new code.
144
+ - Use `useState` for local state; `useReducer` for complex state logic.
145
+ - Use `useMemo` / `useCallback` only when profiling shows a need; not by default.
146
+ - Use custom hooks (`use*`) to extract reusable logic.
147
+ - Use `useEffect` with proper cleanup; not for derived state (use `useMemo` instead).
148
+ - Use `React.memo()` only when profiling shows re-render issues.
149
+ - Use `key` prop with stable identity in lists; not array index.
150
+ - Use `children` prop for composition; not prop drilling when possible.
151
+ - Use Context for cross-cutting concerns; not for every piece of state.
152
+ - Use `forwardRef` when the component needs to expose a ref.
153
+ - Use `useId()` for stable unique IDs.
154
+ - Use Suspense + lazy for code splitting.
155
+ - Check for: stale closures in `useEffect`, missing dependency arrays, `useEffect` for derived state, unnecessary `useMemo`/`useCallback`.
156
+
157
+ ## Python
158
+
159
+ - Use `Enum` / `IntEnum` for fixed value sets; no magic strings/numbers.
160
+ - Use type hints (`typing` module) for function signatures.
161
+ - Use `dataclass` for data containers; `NamedTuple` for immutable records.
162
+ - Use `pathlib.Path` for file paths; not `os.path` string concatenation.
163
+ - Use `f-strings` for string formatting; not `%` or `.format()`.
164
+ - Use `with` statements for resource management.
165
+ - Use `collections` module: `defaultdict`, `Counter`, `deque` where appropriate.
166
+ - Use list/dict comprehensions over manual loops when readable.
167
+ - Use `if __name__ == "__main__":` guard for script entry.
168
+ - Use `@dataclass(frozen=True)` for immutable data.
169
+ - Use `match` statement (Python 3.10+) for structural pattern matching.
170
+ - Use `@property` for computed attributes; not getter methods.
171
+ - Use `abc.ABC` / `@abstractmethod` for interfaces.
172
+ - Check for: mutable default arguments, `is` vs `==`, bare `except`, `global` overuse.
173
+
174
+ ## Go
175
+
176
+ - Use `iota` constants or named types for fixed value sets; no magic strings/numbers.
177
+ - Use `errors.Is()` / `errors.As()` for error checking; not `==`.
178
+ - Use `defer` for cleanup; LIFO order.
179
+ - Use `context.Context` for cancellation and timeouts in all I/O functions.
180
+ - Use `struct` with methods; not inheritance.
181
+ - Use interfaces with small method sets (1-3 methods); define at point of use.
182
+ - Use `goroutine` + `channel` for concurrency; not shared state with mutex when possible.
183
+ - Use `sync.WaitGroup` for goroutine coordination.
184
+ - Use table-driven tests as the default test pattern.
185
+ - Use `go fmt` style; tabs not spaces.
186
+ - Use `:=` for new variables; `=` for reassignment.
187
+ - Use `if err != nil` error handling; not panic/recover for control flow.
188
+ - Check for: goroutine leaks, unclosed channels, nil interface values, slice aliasing, unhandled errors.
189
+
190
+ ## SQL
191
+
192
+ - Use parameterized queries; never string concatenation for SQL.
193
+ - Use `COALESCE` / `NULLIF` for null handling; not `ISNULL` or `IFNULL` when portable.
194
+ - Use `EXISTS` over `IN` for subqueries on large datasets.
195
+ - Use `JOIN` with explicit `ON`; not implicit comma joins.
196
+ - Use `WITH` (CTE) for complex queries; not nested subqueries.
197
+ - Use `UPSERT` (`ON CONFLICT` / `MERGE`) for insert-or-update; not SELECT-then-INSERT.
198
+ - Use `CASE WHEN` for conditional logic; not `IIF` or `DECODE` when portable.
199
+ - Use `EXPLAIN` to verify query plans for non-trivial queries.
200
+ - Use indexes on columns in `WHERE`, `JOIN`, and `ORDER BY` clauses.
201
+ - Use `TRANSACTION` / `BEGIN...COMMIT` for multi-statement atomicity.
202
+ - Check for: `SELECT *`, missing `WHERE` in `UPDATE`/`DELETE`, N+1 queries, implicit type conversion, missing index on hot path.