@ibotor/smart-trellis 0.5.23 → 0.5.24

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 (24) hide show
  1. package/README.md +143 -213
  2. package/dist/configurators/shared.d.ts.map +1 -1
  3. package/dist/configurators/shared.js +2 -0
  4. package/dist/configurators/shared.js.map +1 -1
  5. package/dist/migrations/manifests/0.5.23.json +9 -0
  6. package/dist/templates/common/bundled-skills/trellis-dev-preflight/SKILL.md +162 -0
  7. package/dist/templates/common/bundled-skills/trellis-quality-review/SKILL.md +82 -0
  8. package/dist/templates/common/bundled-skills/trellis-quality-review/docs/overview.md +331 -0
  9. package/dist/templates/common/bundled-skills/trellis-quality-review/evals/evals.json +50 -0
  10. package/dist/templates/common/bundled-skills/trellis-quality-review/references/copy-fidelity.md +56 -0
  11. package/dist/templates/common/bundled-skills/trellis-quality-review/references/decision-tree.md +102 -0
  12. package/dist/templates/common/bundled-skills/trellis-quality-review/references/formatting-fidelity.md +37 -0
  13. package/dist/templates/common/bundled-skills/trellis-quality-review/references/framework-rules.md +59 -0
  14. package/dist/templates/common/bundled-skills/trellis-quality-review/references/report-format.md +23 -0
  15. package/dist/templates/common/bundled-skills/trellis-quality-review/references/safe-refactor-boundaries.md +158 -0
  16. package/dist/templates/common/bundled-skills/trellis-quality-review/references/scope-control.md +49 -0
  17. package/dist/templates/common/bundled-skills/trellis-quality-review/references/severity.md +105 -0
  18. package/dist/templates/common/bundled-skills/trellis-quality-review/references/small-change-fast-path.md +51 -0
  19. package/dist/templates/common/bundled-skills/trellis-quality-review/references/verification-selection.md +81 -0
  20. package/dist/templates/common/bundled-skills/trellis-quality-review/scripts/diff_scans.sh +145 -0
  21. package/dist/templates/common/bundled-skills/verification-before-completion/SKILL.md +139 -0
  22. package/dist/templates/common/commands/micro-task.md +33 -0
  23. package/dist/templates/trellis/workflow.md +1 -1
  24. package/package.json +1 -1
@@ -0,0 +1,56 @@
1
+ # Copy Fidelity
2
+
3
+ User-visible copy is product behavior. Review it separately from code quality.
4
+
5
+ ## What Counts as Copy
6
+
7
+ Check every added or modified:
8
+
9
+ - label
10
+ - title
11
+ - placeholder
12
+ - tooltip
13
+ - helper text
14
+ - description
15
+ - radio/checkbox/select option
16
+ - button text
17
+ - validation message
18
+ - empty state
19
+ - modal title
20
+ - table column title
21
+ - confirmation text
22
+ - option order
23
+
24
+ ## Classification
25
+
26
+ For each changed copy or option-order line, classify it as:
27
+
28
+ - **Exact requirement text:** the text/order appears in the user's requirement.
29
+ - **Necessary adaptation:** minimal wording/order change required by the feature.
30
+ - **Existing text preserved:** adjacent text appears in diff context but was not changed.
31
+ - **Out-of-scope copy change:** copy/order was polished, rewritten, moved, or added without requirement support.
32
+
33
+ ## Rules
34
+
35
+ 1. Revert out-of-scope copy changes to the previous text/order when safe.
36
+ 2. When reordering options for a required default or required order, do not change child descriptions/helper text unless explicitly requested.
37
+ 3. Do not improve tone, punctuation, wording, examples, or explanatory text during review unless the requirement asks for it.
38
+ 4. Preserve helper descriptions, placeholders, and validation messages unless the requested feature cannot work without changing them.
39
+ 5. If copy ownership is unclear, ask before changing more text.
40
+
41
+ ## Diff Scan
42
+
43
+ Use this scan as a starting point, then manually check each hit against the requirement:
44
+
45
+ ```bash
46
+ git diff -U0 HEAD -- '*.vue' '*.ts' '*.tsx' | rg '^[+-][^+-].*(label|title|placeholder|help|message|Radio|Checkbox|Button|Tooltip|content|confirmText|cancelText|text-|请选择|请输入|验证|账户|服务商|域名|说明|提示)'
47
+ ```
48
+
49
+ ## Common Copy Mistakes
50
+
51
+ | Mistake | Correction |
52
+ | --- | --- |
53
+ | Treating wording polish as harmless | Treat copy as behavior and verify it against the requirement |
54
+ | Changing radio descriptions when only label/default changed | Preserve existing helper text |
55
+ | Reordering options without requirement support | Restore order unless required |
56
+ | Editing placeholder/help text for consistency | Leave it unchanged unless requested |
@@ -0,0 +1,102 @@
1
+ # Decision Tree
2
+
3
+ Use this routing tree after reading `SKILL.md` and before deeper review. Its purpose is to make reference loading deterministic so copy, formatting, framework, and reporting checks are not skipped.
4
+
5
+ ## Start Gate
6
+
7
+ 1. **Is there a frontend diff?**
8
+ - Check with `scripts/diff_scans.sh --files` when available, or manually run `git diff --name-only HEAD -- '*.vue' '*.ts' '*.tsx' '*.jsx' '*.js' '*.css' '*.scss'`.
9
+ - Use `scripts/diff_scans.sh --cached` for staged-only review or `scripts/diff_scans.sh --base main` for branch/PR-style review when appropriate.
10
+ - If no frontend files changed, do not continue with this skill unless the user explicitly requested frontend review planning.
11
+ - If frontend files changed, continue.
12
+
13
+ 2. **Can you restate the current requirement?**
14
+ - If yes, write the one-sentence requirement and continue.
15
+ - If no, inspect the conversation and diff.
16
+ - If still unclear and further edits depend on interpretation, ask the user before changing code.
17
+
18
+ 3. **Does the change qualify for the small-change fast path?**
19
+ Signals include a one-file or very localized UI/copy/style/config change with no API, state-flow, validation, routing, permissions, shared type, or data transformation impact.
20
+ - If yes, read `references/small-change-fast-path.md`, confirm the diff contains only the requested change, and skip full review unless inspection finds scope expansion.
21
+ - If no, continue with the normal review tree.
22
+
23
+ 4. **Load scope control for normal review.**
24
+ - Read `references/scope-control.md`.
25
+ - Classify changed blocks as in-requirement, necessary-adjacent, or out-of-scope before cleanup.
26
+
27
+ ## Framework Branch
28
+
29
+ 5. **Does the diff include Vue, Vite Vue, Pinia, Vue Router, or `.vue` files?**
30
+ - If yes, use `vue-best-practices` and read `references/framework-rules.md`.
31
+ - Run or reproduce the Vue added-line scan for `v-model:` when relevant.
32
+
33
+ 6. **Does the diff include React, Next.js, JSX/TSX, React hooks, or Next route/page files?**
34
+ - If yes, use `vercel-react-best-practices` and read `references/framework-rules.md`.
35
+ - Check server/client boundaries, hook placement, page/container responsibilities, and unnecessary memoization.
36
+
37
+ 7. **Does any changed file own multiple responsibilities touched by this requirement?**
38
+ - If yes, build the responsibility map from `scope-control.md` and `framework-rules.md`.
39
+ - Before splitting components, extracting composables/hooks, moving helpers, or changing ownership, read `references/safe-refactor-boundaries.md`.
40
+ - Split or extract only when the current requirement created unclear ownership or repeated logic and the safe-refactor checks pass.
41
+ - If no, avoid structural refactor.
42
+
43
+ ## Diff Fidelity Branch
44
+
45
+ 8. **Could modified existing files contain formatting-only churn?**
46
+ Signals include changed indentation, wrapping, import/object layout, blank lines, class ordering, or formatter output.
47
+ - If yes, read `references/formatting-fidelity.md`.
48
+ - Compare normal diff and whitespace-insensitive diff for affected files.
49
+ - Restore out-of-scope formatting when safe.
50
+
51
+ 9. **Could user-visible copy or option order have changed?**
52
+ Signals include changed `label`, `title`, `placeholder`, `help`, `message`, button text, validation text, modal/table text, radio/select options, or localized strings.
53
+ - If yes, read `references/copy-fidelity.md`.
54
+ - Classify each changed copy/order line against the requirement.
55
+ - Restore out-of-scope copy/order changes when safe.
56
+
57
+ 10. **Did the current diff add suspicious frontend patterns?**
58
+ Use `scripts/diff_scans.sh` when available. Signals include:
59
+ - debug or suppression lines: `console.log`, `debugger`, `eslint-disable`, `@ts-ignore`, `@ts-expect-error`, `TODO`, `FIXME`
60
+ - TypeScript risk lines: `any`, `as any`, `as unknown as`, non-null assertions
61
+ - Vue risk lines: `v-model:`, deep watchers, direct prop mutation patterns
62
+ - React/Next/browser-boundary risk lines: `use client`, `dangerouslySetInnerHTML`, `window`, `document`, web storage access
63
+ - copy/accessibility text lines: labels, placeholders, messages, `aria-label`, `alt`
64
+ - If yes, inspect and fix only current-work instances unless adjacent legacy code blocks correctness.
65
+ - Treat scan hits as signals, not automatic defects.
66
+ - If ownership is unclear, mention it in Notes instead of expanding scope.
67
+
68
+ ## Severity, Verification, and Report Branch
69
+
70
+ 11. **Before fixing or deferring findings, has severity been classified?**
71
+ - Read `references/severity.md`.
72
+ - Classify findings as Blocker, Must Fix Before Handoff, Should Fix If In Scope, or Note Only.
73
+ - Fix Blocker findings when possible.
74
+ - Fix Must Fix findings when introduced by the current diff and ownership is clear.
75
+ - Fix Should Fix findings only when the edit is small and inside scope.
76
+ - Record Note Only findings without expanding the diff.
77
+
78
+ 12. **Before final response, has verification been selected and run or intentionally skipped?**
79
+ - If claiming completion or correctness, use `verification-before-completion`.
80
+ - Read `references/verification-selection.md` before choosing lint, typecheck, test, build, or diff-only verification.
81
+ - Choose the smallest relevant verification set from project scripts and docs.
82
+ - If verification is skipped, state why.
83
+
84
+ 13. **Before final response, load report format.**
85
+ - Read `references/report-format.md`.
86
+ - Include Scope Check, Formatting Fidelity, Copy Fidelity, Changed, Removed, Verified, and Notes.
87
+
88
+ ## Quick Routing Table
89
+
90
+ | Signal | Required action |
91
+ | --- | --- |
92
+ | Tiny localized UI/copy/style/config change | Read `small-change-fast-path.md`; use diff inspection unless disqualified |
93
+ | Any normal frontend diff | Read `scope-control.md` |
94
+ | `.vue`, Pinia, Vue Router, Vite Vue | Use `vue-best-practices`; read `framework-rules.md` |
95
+ | React, Next.js, `.tsx`, hooks | Use `vercel-react-best-practices`; read `framework-rules.md` |
96
+ | Component split, hook/composable extraction, helper move, ownership change | Read `safe-refactor-boundaries.md` |
97
+ | Formatting-only looking diff | Read `formatting-fidelity.md` |
98
+ | Label/title/placeholder/message/options changed | Read `copy-fidelity.md` |
99
+ | Added debug/type suppression lines | Classify severity, then fix current-work instances or explain why not |
100
+ | Deciding fix vs defer | Read `severity.md` |
101
+ | Choosing verification | Read `verification-selection.md` |
102
+ | Final handoff | Use `verification-before-completion`; read `report-format.md` |
@@ -0,0 +1,37 @@
1
+ # Formatting Fidelity
2
+
3
+ Formatting-only diffs are code changes. Review them separately from logic and copy.
4
+
5
+ ## Default Rule
6
+
7
+ Preserve existing formatting for existing code unless the user explicitly asked to format, or the touched new/changed code cannot pass required verification without a minimal formatting change.
8
+
9
+ For every modified existing file, compare normal and whitespace-insensitive diffs:
10
+
11
+ ```bash
12
+ git diff HEAD -- path/to/file
13
+ git diff -w HEAD -- path/to/file
14
+ ```
15
+
16
+ ## Classification
17
+
18
+ - **Necessary formatting:** layout required for newly added code or to satisfy a non-formatting correctness/lint issue in the touched block.
19
+ - **Out-of-scope formatting:** single-line/multiline wrapping, indentation, blank-line, object/call layout, chain layout, or trailing whitespace changes that do not change behavior and were not required.
20
+ - **Formatter conflict:** preserving original code style makes `prettier/prettier` complain, but changing it would reformat existing out-of-scope code.
21
+
22
+ ## Rules
23
+
24
+ 1. If normal diff shows a block but `git diff -w` makes it disappear, treat it as likely out-of-scope formatting until proven necessary.
25
+ 2. Do not run broad `eslint --fix` or prettier on existing files during scope review unless the user asked for formatting.
26
+ 3. Revert out-of-scope formatting to the previous layout when safe.
27
+ 4. If formatter rules conflict with scope preservation, prefer scope preservation for existing code.
28
+ 5. When needed, run scoped lint with formatting rules disabled and report the conflict instead of expanding the diff.
29
+ 6. New code should still be readable and locally consistent, but do not reflow surrounding old code just to match formatter output.
30
+
31
+ ## High-Signal Questions
32
+
33
+ - Did this file change only because a formatter touched it?
34
+ - Does `git diff -w` remove the entire block?
35
+ - Did line wrapping change without behavior or type impact?
36
+ - Did import/order/object layout change without necessity?
37
+ - Would reverting formatting leave the requested behavior intact?
@@ -0,0 +1,59 @@
1
+ # Framework Rules
2
+
3
+ Use this reference when the review touches Vue, React, Next.js, routes, stores, components, composables, hooks, or styling conventions.
4
+
5
+ ## Shared Frontend Rules
6
+
7
+ - Keep page/container files focused on orchestration.
8
+ - Keep presentational components focused on one UI section.
9
+ - Keep stateful side effects in composables/hooks.
10
+ - Keep pure feature-local logic in local helpers.
11
+ - Avoid magic strings when a small typed union or constant improves clarity.
12
+ - Avoid adding comments unless they explain business rules, side effects, temporary mock behavior, or non-obvious constraints.
13
+ - Do not create broad shared abstractions for logic used only once.
14
+ - Before structural refactors, use `safe-refactor-boundaries.md` to decide whether the split is safer than keeping code local.
15
+
16
+ ## Vue / Vite / Pinia
17
+
18
+ Load `vue-best-practices` before editing Vue code.
19
+
20
+ Check current-work code for:
21
+
22
+ - Composition API and `<script setup>` usage where the project uses it.
23
+ - typed `defineProps`, `defineEmits`, and `defineModel` usage.
24
+ - section-local state staying near the owning component.
25
+ - composables owning stateful logic and side effects, not presentational markup.
26
+ - Pinia stores used for shared application state, not one-off local UI state.
27
+ - route/page components doing orchestration rather than owning multiple unrelated UI sections.
28
+ - newly introduced `v-model:` usage if the project lint rule disallows arguments.
29
+
30
+ Diff-only scan for Vue projects with `vue/no-v-model-argument`:
31
+
32
+ ```bash
33
+ git diff -U0 HEAD -- '*.vue' | rg '^\+[^+].*v-model:'
34
+ ```
35
+
36
+ If an added line contains `v-model:value="..."` and the project uses `vue/no-v-model-argument`, rewrite the touched code to the project-approved binding/event style instead of editing unrelated old occurrences.
37
+
38
+ ## React / Next.js
39
+
40
+ Load `vercel-react-best-practices` before editing React or Next.js code.
41
+
42
+ Check current-work code for:
43
+
44
+ - server/client component boundary correctness in Next.js.
45
+ - unnecessary client components or broad `use client` placement.
46
+ - hooks used only in valid component/hook contexts.
47
+ - derived state that can be computed instead of stored.
48
+ - callback/prop contracts that are typed and stable enough for the feature.
49
+ - expensive render work introduced by the current change.
50
+ - route/page files doing orchestration rather than owning large reusable UI sections.
51
+
52
+ Do not add memoization by default. Add it only when there is a clear render-cost or identity-stability reason related to the current change.
53
+
54
+ ## Styling
55
+
56
+ - Preserve layout unless the requirement asks for visual changes.
57
+ - Do not normalize class ordering, spacing, or style object layout unless required by touched code or lint.
58
+ - Avoid moving styles across files just for preference.
59
+ - If design tokens exist, use project conventions already present in nearby code.
@@ -0,0 +1,23 @@
1
+ # Report Format
2
+
3
+ Keep the final report concise and evidence-based.
4
+
5
+ Use this structure:
6
+
7
+ - **Scope Check:** whether the diff stayed within the requested requirement, plus any out-of-scope code intentionally left unchanged.
8
+ - **Severity:** Blocker, Must Fix, Should Fix, and Note Only summary for current-diff findings.
9
+ - **Formatting Fidelity:** whether normal diff vs `git diff -w` was checked, what formatting-only changes were restored, and any remaining formatter conflicts.
10
+ - **Copy Fidelity:** whether changed user-visible text/order was checked against the requirement, what was restored, and any remaining necessary copy changes.
11
+ - **Changed:** cleanup, refactor, comment, or boundary changes made during review.
12
+ - **Removed:** dead code blocks, unused imports, unused state, or files removed.
13
+ - **Verified:** exact commands and exit status.
14
+ - **Notes:** skipped findings, historical issues, or remaining risks with reasons.
15
+
16
+ ## Reporting Rules
17
+
18
+ - Do not claim checks passed unless command output was read and exit status was successful.
19
+ - If verification fails due to historical or unrelated issues, say so explicitly and explain whether the current change appears related.
20
+ - If you skipped lint/typecheck/test/build, explain why.
21
+ - Avoid long narrative. Prefer short bullets with concrete evidence.
22
+ - Mention out-of-scope issues without fixing them unless they block the current requirement.
23
+ - Keep Severity concise; do not list every Note Only issue when one representative summary is enough.
@@ -0,0 +1,158 @@
1
+ # Safe Refactor Boundaries
2
+
3
+ Use this reference before splitting components, extracting composables/hooks, moving helpers, or changing ownership. The goal is to reduce responsibility pile-up without creating abstraction churn or expanding beyond the current diff.
4
+
5
+ ## Core Rule
6
+
7
+ Refactor only when it improves the current requirement's clarity, correctness, or maintainability inside the review boundary. File size alone is not enough.
8
+
9
+ A safe refactor has all of these properties:
10
+
11
+ - The problematic responsibility is touched by the current diff.
12
+ - The target boundary is obvious and nameable.
13
+ - The extracted interface is smaller than the code it hides.
14
+ - The move does not require unrelated callers, routes, stores, styles, or tests to change.
15
+ - Behavior, copy, layout, and public contracts remain unchanged unless required.
16
+ - Verification can cover the moved logic or affected render path.
17
+
18
+ ## Strong Signals to Split or Extract
19
+
20
+ Consider a targeted split when at least one is true:
21
+
22
+ - A page/container now owns orchestration plus multiple changed UI sections.
23
+ - A component now mixes rendering with request orchestration, validation, mapping, and modal/table/form state touched by this requirement.
24
+ - The current diff duplicates non-trivial logic in two or more places.
25
+ - Newly added side effects make the render component hard to follow.
26
+ - Newly added pure mapping/formatting/validation logic obscures the UI path.
27
+ - A modal/drawer/wizard section has its own state, validation, and actions that can be named independently.
28
+ - A hook/composable would isolate stateful behavior used by the current feature without becoming a generic utility.
29
+
30
+ ## Strong Signals Not to Refactor
31
+
32
+ Avoid structural refactor when any is true:
33
+
34
+ - The file is merely large, but the current change touches a small localized area.
35
+ - The split would require moving unrelated markup, styles, tests, or callers.
36
+ - The extracted function/component would have many props or return values just to keep behavior working.
37
+ - The new abstraction would be used once and does not hide meaningful complexity.
38
+ - Naming the boundary requires vague words like `Common`, `Base`, `Manager`, `Handler`, or `Utils`.
39
+ - The refactor would change user-visible copy, layout, option order, focus behavior, or event timing.
40
+ - The user requested a micro-change or explicitly asked to avoid broad cleanup.
41
+
42
+ ## Boundary Heuristics
43
+
44
+ ### Page / Route / Container
45
+
46
+ Should own:
47
+
48
+ - route params and navigation glue
49
+ - top-level data loading orchestration
50
+ - composition of feature sections
51
+ - passing typed props and event handlers to children
52
+
53
+ Should not accumulate:
54
+
55
+ - multiple independent UI sections with detailed markup
56
+ - modal internals
57
+ - table cell formatting details
58
+ - form field validation internals
59
+ - low-level API payload mapping when it obscures orchestration
60
+
61
+ ### Component
62
+
63
+ Should own:
64
+
65
+ - one nameable UI section
66
+ - local UI state for that section
67
+ - typed props/events or callbacks
68
+ - minimal formatting needed for display
69
+
70
+ Extract when the component contains multiple independently nameable regions touched by this requirement, such as search form + table + edit modal + upload drawer.
71
+
72
+ Do not extract when the child would only wrap a few lines and add prop plumbing without hiding complexity.
73
+
74
+ ### Composable / Hook
75
+
76
+ Should own:
77
+
78
+ - stateful logic and side effects
79
+ - async request lifecycle
80
+ - derived state tied to the feature
81
+ - event handlers whose behavior is not just presentational
82
+
83
+ Good candidates:
84
+
85
+ - `useUserTableData`
86
+ - `useDomainForm`
87
+ - `useUploadDialog`
88
+
89
+ Weak candidates:
90
+
91
+ - `useHelpers`
92
+ - `useCommon`
93
+ - `usePageLogic`
94
+ - a hook returning 15 unrelated values
95
+
96
+ ### Helper
97
+
98
+ Should own pure logic:
99
+
100
+ - formatters
101
+ - mappers
102
+ - validators
103
+ - sort/filter predicates
104
+ - small calculations
105
+
106
+ Keep helpers local when used only by one component/composable. Move to a separate file only when the helper is non-trivial, reused by current-work code, or makes the owning file materially clearer.
107
+
108
+ ### Types
109
+
110
+ Keep feature-local types near the owning component/composable when they are not reused.
111
+
112
+ Move types to shared files only when:
113
+
114
+ - multiple current-work files consume them
115
+ - they represent API or route/store boundaries
116
+ - colocating them would create import cycles or unclear ownership
117
+
118
+ ## Vue-Specific Guidance
119
+
120
+ - Prefer `<script setup>` and typed props/emits when the project uses that style.
121
+ - Keep section-local refs in the section component unless parent orchestration needs them.
122
+ - Extract a composable when state transitions, async effects, watchers, or derived state dominate the component.
123
+ - Avoid Pinia for one-off UI state; use Pinia when state is shared across routes/features or must outlive the component.
124
+ - Avoid composables that return large bags of unrelated refs; split by feature behavior instead.
125
+
126
+ ## React / Next-Specific Guidance
127
+
128
+ - Keep route/page components focused on orchestration and server/client boundary correctness.
129
+ - Do not add `use client` broadly just to support a small interactive child; prefer isolating the client component when feasible and in scope.
130
+ - Extract a hook when stateful behavior or side effects obscure the component body.
131
+ - Extract a component when a nameable UI section has its own props and events.
132
+ - Do not add `useMemo`/`useCallback` as a refactor unless identity stability or render cost is a real current-diff concern.
133
+
134
+ ## Safe Refactor Procedure
135
+
136
+ 1. Name the responsibility that is piled up.
137
+ 2. Confirm it is touched by the current requirement.
138
+ 3. Choose the smallest boundary that hides complexity without leaking many props/returns.
139
+ 4. Preserve public behavior, copy, layout, and event timing.
140
+ 5. Move only the directly related code.
141
+ 6. Re-run the smallest relevant verification from `verification-selection.md`.
142
+ 7. If any step requires broad unrelated edits, stop and record the idea as Note Only.
143
+
144
+ ## Reporting
145
+
146
+ When you refactor, report why the boundary was safe:
147
+
148
+ ```text
149
+ Changed:
150
+ - Extracted EditDomainModal because the current diff added independent modal state, validation, and submit handling; parent now only orchestrates open/close and refresh.
151
+ ```
152
+
153
+ When you do not refactor, report why not when relevant:
154
+
155
+ ```text
156
+ Severity:
157
+ - Should Fix: did not split SettingsPage because the large table section was pre-existing and untouched by this request.
158
+ ```
@@ -0,0 +1,49 @@
1
+ # Scope Control
2
+
3
+ Use this gate before any cleanup or refactor. The purpose is to protect the user's requested change from scope creep.
4
+
5
+ ## Default Rule
6
+
7
+ Change only what the requirement asks for, plus the smallest necessary adjacent code to keep it correct, typed, lint-clean, or buildable.
8
+
9
+ Do not opportunistically optimize, polish, reorder, refactor, rename, reformat, or clean up code the requirement does not touch.
10
+
11
+ Preserve existing user-visible text, helper descriptions, option order, placeholders, tooltips, validation messages, comments, and layout unless the requirement explicitly asks to change them or the feature cannot work without the change.
12
+
13
+ If the user says “do not change anything not mentioned”, treat all non-required UI/text changes as high-risk and list them explicitly in the review.
14
+
15
+ ## Gate Steps
16
+
17
+ 1. Restate the current requirement in one sentence.
18
+ 2. Inspect `git status` and `git diff HEAD` before editing.
19
+ 3. Classify each changed block:
20
+ - **In requirement:** directly implements or verifies the requested change.
21
+ - **Necessary adjacent:** required to keep the requested change correct, typed, lint-clean, or buildable.
22
+ - **Out of scope:** opportunistic old-code optimization, unrelated formatting, broad refactor, unrelated dead-code cleanup, renamed abstractions, style changes, user-visible copy changes, helper-description changes, or option-order changes not needed by the requirement.
23
+ 4. Only edit **In requirement** and **Necessary adjacent** blocks.
24
+ 5. For **Out of scope** blocks, do not extend the change.
25
+ 6. Revert your own out-of-scope edits when safe.
26
+ 7. If an out-of-scope edit predates the session or ownership is unclear, leave it untouched and mention it in Notes.
27
+ 8. If classification is unclear and would change more code, ask the user instead of deciding silently.
28
+
29
+ ## Responsibility Map
30
+
31
+ Use this map to decide whether structure changes are justified:
32
+
33
+ - **route/page/container:** orchestration, data loading, high-level composition
34
+ - **component:** one UI section with typed props/emits or typed component props/callbacks
35
+ - **composable/hook:** stateful logic, side effects, derived state, lifecycle coordination
36
+ - **helper:** pure feature-local logic
37
+ - **api/types:** external boundary and shared contracts
38
+
39
+ Split only when the current requirement created unclear ownership or repeated logic. Keep feature-local types/helpers near the owning unit unless reused broadly.
40
+
41
+ ## Common Scope Mistakes
42
+
43
+ | Mistake | Correction |
44
+ | --- | --- |
45
+ | Optimizing old code during requirement review | Record it in Notes unless it blocks the current requirement |
46
+ | Splitting every type/helper into standalone files | Keep local helpers local unless reused |
47
+ | Moving UI state into parent unnecessarily | Keep section-local state near the section |
48
+ | Letting old violations expand scope | Fix only newly introduced violations unless adjacent legacy code blocks correctness |
49
+ | Trusting visual refactor | Preserve behavior and verify with commands |
@@ -0,0 +1,105 @@
1
+ # Severity
2
+
3
+ Classify findings before fixing them. Severity applies to the current review boundary: default to `git diff HEAD` unless the user requested staged-only or a specific base ref. Historical or untouched issues are usually Note Only unless they block the current requirement.
4
+
5
+ ## Levels
6
+
7
+ ### Blocker
8
+
9
+ Must be fixed before handoff. The current diff introduces or exposes a problem that can break build, typecheck, runtime behavior, critical user flow, permissions, data integrity, or security.
10
+
11
+ Frontend examples:
12
+
13
+ - current diff causes build, typecheck, or required test failure
14
+ - key page crashes or fails to render
15
+ - form cannot submit, primary action cannot be clicked, or required user flow is broken
16
+ - API payload or response mapping is wrong for the changed feature
17
+ - permission/auth guard is loosened or bypassed
18
+ - Next.js server/client boundary error prevents render or build
19
+ - changed props/types break touched consumers
20
+ - unsanitized user-controlled `dangerouslySetInnerHTML` or equivalent XSS risk
21
+ - production-executed `debugger`
22
+
23
+ Action: fix in the current review if possible, rerun relevant verification, and report as blocking if not resolved.
24
+
25
+ ### Must Fix Before Handoff
26
+
27
+ Should be fixed before delivery when introduced by the current diff, even if it does not immediately fail build.
28
+
29
+ Frontend examples:
30
+
31
+ - added `console.log`, `debugger`, unexplained `@ts-ignore`, `@ts-expect-error`, or broad `eslint-disable`
32
+ - current-work dead code: unused props, emits, refs, state, imports, branches, mock fields
33
+ - out-of-scope user-visible copy, helper text, placeholder, validation message, or option-order changes
34
+ - out-of-scope formatting churn mixed into the diff
35
+ - current diff introduces obvious duplicated logic that can be removed locally
36
+ - local UI state was lifted or globalized without requirement support
37
+ - newly added loading/error state is never rendered or consumed
38
+ - temporary mock/demo data is scattered in production components
39
+
40
+ Action: fix when ownership is clear and the fix stays inside the requirement boundary. If ownership is unclear, record in Notes instead of expanding scope.
41
+
42
+ ### Should Fix If In Scope
43
+
44
+ Real issue, but fix only when it is clearly within the current requirement and the change is small.
45
+
46
+ Frontend examples:
47
+
48
+ - unclear name in newly added function, prop, event, or variable
49
+ - newly added condition is hard to read but safe
50
+ - new component is somewhat large but not yet clearly multi-responsibility
51
+ - duplicated new snippet appears twice and a local helper would clarify it
52
+ - type could be narrower, but current type is safe
53
+ - composable/hook return shape is slightly broad but still understandable
54
+ - helper extraction would improve clarity but requires moving files or touching callers
55
+ - tests are not ideal, but selected verification covers the main changed path
56
+
57
+ Action: fix only if the edit is small and does not expand scope. Otherwise mention as a follow-up Note.
58
+
59
+ ### Note Only
60
+
61
+ Do not fix during this review. The issue is historical, untouched, unclear ownership, or not needed for the current requirement.
62
+
63
+ Frontend examples:
64
+
65
+ - old component is large but this task touched only a tiny unrelated line
66
+ - historical lint/typecheck/test failures
67
+ - old copy inconsistency
68
+ - legacy form validation pattern
69
+ - old API layer or directory structure concerns
70
+ - untouched hook/composable design issue
71
+ - existing `any`, formatter churn, or test gap not introduced by the current diff
72
+
73
+ Action: record briefly in Notes when useful. Do not mark the current task failed unless it blocks the current requirement.
74
+
75
+ ## Classification Flow
76
+
77
+ 1. **Was it introduced or exposed by the current review diff?**
78
+ - No: Note Only, unless it blocks the current requirement.
79
+ - Yes: continue.
80
+
81
+ 2. **Can it break build, typecheck, runtime behavior, critical flow, permissions, data integrity, or security?**
82
+ - Yes: Blocker.
83
+ - No: continue.
84
+
85
+ 3. **Is it current-work debug code, unexplained suppression, dead code, out-of-scope copy, or out-of-scope formatting?**
86
+ - Yes: Must Fix Before Handoff.
87
+ - No: continue.
88
+
89
+ 4. **Is the fix small, local, and inside the current requirement boundary?**
90
+ - Yes: Should Fix If In Scope.
91
+ - No: Note Only.
92
+
93
+ ## Reporting
94
+
95
+ Keep severity concise. Prefer counts and high-signal examples over long lists.
96
+
97
+ Example:
98
+
99
+ ```text
100
+ Severity:
101
+ - Blocker: none
102
+ - Must Fix: removed added console.log; restored out-of-scope placeholder change
103
+ - Should Fix: did not split SettingsPanel because it would touch unrelated sections
104
+ - Note Only: pre-existing vue-tsc errors in src/legacy/* are unrelated to touched files
105
+ ```
@@ -0,0 +1,51 @@
1
+ # Small-Change Fast Path
2
+
3
+ Use this path for tiny, low-risk frontend changes where full quality review would create more churn than value.
4
+
5
+ ## Qualifying Changes
6
+
7
+ A change qualifies only when all are true:
8
+
9
+ - The user's request is narrow and explicit.
10
+ - The diff is limited to one file or a very small localized area.
11
+ - The change does not affect API shape, routing, permissions, state flow, data transformation, validation behavior, dependency configuration, or shared types.
12
+ - The change is easy to verify by reading the diff.
13
+ - No suspicious added lines appear, such as `console.log`, `debugger`, `@ts-ignore`, `eslint-disable`, `TODO`, or `FIXME`.
14
+
15
+ Common qualifying examples:
16
+
17
+ - UI spacing, width, color, or alignment constants
18
+ - single label/copy change explicitly requested by the user
19
+ - table column width/order requested by the user
20
+ - small style/class adjustment
21
+ - single local config flag with no behavior cascade
22
+
23
+ ## Disqualifiers
24
+
25
+ Do not use the fast path if any are true:
26
+
27
+ - The change affects component boundaries, composables/hooks, stores, route logic, API calls, form validation, permissions, upload/download behavior, or data mapping.
28
+ - The diff spans multiple modules or shared abstractions.
29
+ - The change introduces or edits TypeScript types used outside the local file.
30
+ - The diff includes unrelated formatting or copy churn.
31
+ - The user asks for a full review, cleanup, refactor, verification, or confidence before handoff.
32
+ - The project currently has failing diagnostics that may be related to the touched code.
33
+
34
+ ## Fast Path Procedure
35
+
36
+ 1. Restate the small requirement in one sentence.
37
+ 2. Inspect the relevant diff only.
38
+ 3. Confirm the diff contains only the requested localized change.
39
+ 4. Do not run broad lint, typecheck, unit tests, or build by default.
40
+ 5. If a minimal targeted command is obvious and cheap, run it only when it directly validates the change.
41
+ 6. Report that the fast path was used and whether verification was limited to diff inspection.
42
+
43
+ ## Required Final Note
44
+
45
+ When using this path, include a short note like:
46
+
47
+ ```text
48
+ Used small-change fast path: skipped lint/typecheck/test/build because the diff is a localized UI/copy/config change and diff inspection confirmed scope.
49
+ ```
50
+
51
+ If the diff inspection finds scope expansion, leave the fast path and return to the normal decision tree.