nightytidy 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/nightytidy.js +1 -1
- package/package.json +1 -1
- package/src/agent/git-integration.js +4 -1
- package/src/claude.js +1 -1
- package/src/prompts/manifest.json +138 -138
- package/src/prompts/steps/02-test-coverage.md +181 -181
- package/src/prompts/steps/03-test-hardening.md +181 -181
- package/src/prompts/steps/04-test-architecture.md +130 -130
- package/src/prompts/steps/05-test-consolidation.md +165 -165
- package/src/prompts/steps/06-test-quality.md +211 -211
- package/src/prompts/steps/07-api-design.md +165 -165
- package/src/prompts/steps/08-security-sweep.md +207 -207
- package/src/prompts/steps/09-dependency-health.md +217 -217
- package/src/prompts/steps/10-codebase-cleanup.md +189 -189
- package/src/prompts/steps/11-crosscutting-concerns.md +196 -196
- package/src/prompts/steps/12-file-decomposition.md +263 -263
- package/src/prompts/steps/13-code-elegance.md +329 -329
- package/src/prompts/steps/14-architectural-complexity.md +297 -297
- package/src/prompts/steps/15-type-safety.md +192 -192
- package/src/prompts/steps/16-logging-error-message.md +173 -173
- package/src/prompts/steps/17-data-integrity.md +139 -139
- package/src/prompts/steps/18-performance.md +183 -183
- package/src/prompts/steps/19-cost-resource-optimization.md +136 -136
- package/src/prompts/steps/20-error-recovery.md +145 -145
- package/src/prompts/steps/21-race-condition-audit.md +178 -178
- package/src/prompts/steps/22-bug-hunt.md +229 -229
- package/src/prompts/steps/23-frontend-quality.md +210 -210
- package/src/prompts/steps/24-uiux-audit.md +284 -284
- package/src/prompts/steps/25-state-management.md +170 -170
- package/src/prompts/steps/26-perceived-performance.md +190 -190
- package/src/prompts/steps/27-devops.md +165 -165
- package/src/prompts/steps/28-scheduled-job-chron-jobs.md +141 -141
- package/src/prompts/steps/29-observability.md +152 -152
- package/src/prompts/steps/30-backup-check.md +155 -155
- package/src/prompts/steps/31-product-polish-ux-friction.md +122 -122
- package/src/prompts/steps/32-feature-discovery-opportunity.md +128 -128
- package/src/prompts/steps/33-strategic-opportunities.md +217 -217
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
# State Management Audit
|
|
2
|
-
|
|
3
|
-
Branch: `state-audit-[date]`. Map everything before fixing anything. Run tests after every change. Commit format: `fix: [state issue] in [module]`.
|
|
4
|
-
|
|
5
|
-
**Do NOT**: change business logic/API contracts, introduce new state libraries, refactor working patterns, or combine fixes into single commits.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Phase 1: State Source Inventory
|
|
10
|
-
|
|
11
|
-
### Catalog every state container
|
|
12
|
-
|
|
13
|
-
Search the entire codebase for where state lives:
|
|
14
|
-
|
|
15
|
-
- **Global stores** — Redux, Zustand, MobX, Vuex/Pinia, Recoil/Jotai, Context, Svelte stores, signals. Document: what data, subscribers, update mechanism, navigation persistence.
|
|
16
|
-
- **Server cache** — React Query, SWR, Apollo, RTK Query, urql. Document: cache keys, TTLs, invalidation strategy, whether mutations update cache or just refetch.
|
|
17
|
-
- **Component-local state** — `useState`, `useReducer`, `this.state`, Vue `ref()`/`reactive()`. Focus on state that *shouldn't* be local: shared data, state lost on unmount that shouldn't be, duplicates of global/server state.
|
|
18
|
-
- **URL state** — Query params, path params, hash. What's encoded? What *should* be (filters, pagination, tabs, search, sort)?
|
|
19
|
-
- **Browser storage** — localStorage, sessionStorage, IndexedDB, cookies. Document: data, read/write timing, TTL, unbounded growth, encryption for sensitive data.
|
|
20
|
-
- **Form state** — Controlled vs uncontrolled, form library config, multi-step persistence, draft preservation on navigation.
|
|
21
|
-
- **Derived/computed state** — Computed on read (selectors, `useMemo`) vs eagerly stored (duplication in disguise)?
|
|
22
|
-
- **Implicit state** — Untracked DOM state: scroll position, focus, `<details>` open/closed, caret position.
|
|
23
|
-
|
|
24
|
-
### Build a state map
|
|
25
|
-
|
|
26
|
-
For every meaningful piece of data, document:
|
|
27
|
-
|
|
28
|
-
| Data | Canonical Source | Other Copies | Sync Mechanism | Stale Window | Survives Refresh? | Should Survive? |
|
|
29
|
-
|------|-----------------|--------------|----------------|-------------|-------------------|-----------------|
|
|
30
|
-
|
|
31
|
-
### Classify state by lifecycle
|
|
32
|
-
|
|
33
|
-
Label each piece of state: **Session** (survives nav, not tab close), **Page** (resets on nav away), **Transient** (resets after interaction), **Persistent** (survives sessions), **Shared** (consistent across components/routes). Flag every mismatch between actual and correct lifecycle.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## Phase 2: Duplicated State
|
|
38
|
-
|
|
39
|
-
Duplicated state is the #1 source of "sometimes shows wrong data" bugs.
|
|
40
|
-
|
|
41
|
-
### Find duplicates
|
|
42
|
-
|
|
43
|
-
**Exact**: same data in server cache + global store, parent props + child fetch, URL params + component state, localStorage + store, overlapping store slices, form library + component state, server cache + manual loading/error state.
|
|
44
|
-
|
|
45
|
-
**Semantic**: list cache + individual item cache, normalized + denormalized copies, aggregates stored separately from source data (cart total vs cart items), permissions in auth token + separate endpoint.
|
|
46
|
-
|
|
47
|
-
### Fix safe duplications
|
|
48
|
-
|
|
49
|
-
Delete the copy; have consumers read from the canonical source. If the copy exists for performance, use a memoized selector. If for access, lift access via context/hooks. If server cache vs global store: server data → server cache library, client-only data → global store.
|
|
50
|
-
|
|
51
|
-
For complex cases requiring architectural decisions: document only, don't fix overnight.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Phase 3: Stale State
|
|
56
|
-
|
|
57
|
-
### Identify stale vectors
|
|
58
|
-
|
|
59
|
-
- **Server cache**: Missing mutation → invalidation links? Appropriate `staleTime`/refetch settings? Multi-tab consistency? Optimistic update rollback on failure?
|
|
60
|
-
- **Global store**: Updated on every relevant API response or only initial fetch? State cleared on logout? Session expiry awareness?
|
|
61
|
-
- **URL state**: Back/forward sync? Deep link initialization? Bidirectional URL ↔ UI sync?
|
|
62
|
-
- **Browser storage**: Missing TTL/version key? Stale auth tokens? Schema mismatches after app updates?
|
|
63
|
-
|
|
64
|
-
### Find specific bugs
|
|
65
|
-
|
|
66
|
-
Construct exact reproduction scenarios with numbered steps ending in the bug. Rate each: likelihood × visibility × impact.
|
|
67
|
-
|
|
68
|
-
### Fix
|
|
69
|
-
|
|
70
|
-
Add missing query invalidations, store updates, URL sync, staleTime config, logout cleanup, storage version keys. Err toward correctness over performance.
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Phase 4: Missing State Handling
|
|
75
|
-
|
|
76
|
-
Every async operation has four states: **idle, loading, error, success (data or empty)**.
|
|
77
|
-
|
|
78
|
-
### Audit each
|
|
79
|
-
|
|
80
|
-
**Loading**: Indicator exists? Right granularity (not full-page spinner for sidebar)? Grace period before showing? Independent per fetch? Stale-while-revalidate on refetch? Timeout for hung requests?
|
|
81
|
-
|
|
82
|
-
**Error**: Error state exists (not infinite loading)? Helpful message? Retry mechanism? Right scope (failed sidebar ≠ full page error)? App still usable? Auto-recovery? Error boundaries at appropriate levels?
|
|
83
|
-
|
|
84
|
-
**Empty**: Message shown? "No data yet" vs "no results for filter" distinguished? Loading vs empty distinguished (no flash of "No items" before data)?
|
|
85
|
-
|
|
86
|
-
**Optimistic rollback**: Server rejection reverts UI? User notified? Exact prior state restored? Handles navigation-away before error?
|
|
87
|
-
|
|
88
|
-
### Fix
|
|
89
|
-
|
|
90
|
-
Add missing loading/error/empty states matching existing patterns. Fix error boundaries. Fix optimistic rollback bugs.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Phase 5: State Lifecycle Bugs
|
|
95
|
-
|
|
96
|
-
### Doesn't survive when it should
|
|
97
|
-
|
|
98
|
-
- **Refresh**: Long form inputs, filters/pagination (→ URL params), auth token.
|
|
99
|
-
- **Navigation**: Back button restoring scroll, accordions, filters.
|
|
100
|
-
- **Tab switch**: Mobile app suspension, `visibilitychange` refetches resetting state.
|
|
101
|
-
|
|
102
|
-
### Survives when it shouldn't
|
|
103
|
-
|
|
104
|
-
- **Logout**: ALL user-specific state cleared? (stores, cache, storage, cookies, service worker, singletons). Common bug: User B sees User A's data briefly.
|
|
105
|
-
- **Navigation**: `/entity/123` → `/entity/456` shows old data (missing `key` prop or query invalidation).
|
|
106
|
-
- **Deletion**: Removed from every list, count, cache, derived state?
|
|
107
|
-
- **Permission change**: How long until UI reflects server-side changes?
|
|
108
|
-
|
|
109
|
-
### Hydration mismatches (SSR only)
|
|
110
|
-
|
|
111
|
-
Server/client render differences from: missing user context, timezone/locale, browser APIs, random/time values. Check for `typeof window` guards causing different output, `useEffect`-only state flashes, `suppressHydrationWarning` hiding real problems. Fix without changing final rendered output.
|
|
112
|
-
|
|
113
|
-
### Fix
|
|
114
|
-
|
|
115
|
-
Add route `key` props, unmount/logout cleanup, URL state sync, hydration fixes, sessionStorage for form drafts.
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## Phase 6: Architecture Assessment (Document only, don't rewrite)
|
|
120
|
-
|
|
121
|
-
- **Server vs client state separation**: Flag server data manually managed in Redux/Zustand with loading/error/success actions instead of living in a server cache library. Document migration path.
|
|
122
|
-
- **State proximity**: Flag over-globalized state (global but used by 1-2 components), under-globalized (prop drilling 4+ levels), over-scoped context providers.
|
|
123
|
-
- **Re-render hot spots**: Inline object/array context values, non-granular store subscriptions, missing memo, unmemoized derived state. Focus on lists, expensive components, interactive paths.
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
## Phase 7: Edge Cases (Document, don't fix unless trivial)
|
|
128
|
-
|
|
129
|
-
**Multi-tab**: Login/logout sync, data edits visible across tabs, concurrent edits (conflict detection?).
|
|
130
|
-
|
|
131
|
-
**Network interruption**: Mid-mutation offline, offline navigation with cached pages, online recovery/retry.
|
|
132
|
-
|
|
133
|
-
**Session expiry**: Mid-session token expiry handling, token refresh race deduplication, post-reauth state restoration.
|
|
134
|
-
|
|
135
|
-
Document: scenario, current behavior, expected behavior, user impact, fix complexity.
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Output
|
|
140
|
-
|
|
141
|
-
Save as `audit-reports/25_STATE_MANAGEMENT_REPORT_[run-number]_[date]_[time in user's local time].md`.
|
|
142
|
-
|
|
143
|
-
### Report sections
|
|
144
|
-
|
|
145
|
-
1. **Executive Summary** — Health rating (chaotic/fragile/adequate/solid/excellent), counts of findings and fixes.
|
|
146
|
-
2. **State Source Map** — Complete inventory table.
|
|
147
|
-
3. **Duplicated State** — Each duplication with divergence risk, fix status.
|
|
148
|
-
4. **Stale State Bugs** — Each with trigger, duration, impact, fix status.
|
|
149
|
-
5. **Missing UI States** — Gaps in loading/error/empty handling.
|
|
150
|
-
6. **Lifecycle Bugs** — State persisting/vanishing incorrectly.
|
|
151
|
-
7. **Hydration Mismatches** (SSR only).
|
|
152
|
-
8. **Edge Cases** — Multi-tab, offline, session expiry behavior.
|
|
153
|
-
9. **Re-render Hot Spots**.
|
|
154
|
-
10. **Architecture Assessment**.
|
|
155
|
-
11. **Fixes Applied** — File, issue, fix, tests pass, commit.
|
|
156
|
-
12. **Recommendations** — Priority-ordered.
|
|
157
|
-
|
|
158
|
-
### Chat summary (always print)
|
|
159
|
-
|
|
160
|
-
1. **Status**: One sentence — what you did, duration, tests passing.
|
|
161
|
-
2. **Key Findings**: Specific, actionable bullets with severity. Lead with impact, not vagueness.
|
|
162
|
-
3. **Changes Made** (if any).
|
|
163
|
-
4. **Recommendations** table (only if warranted):
|
|
164
|
-
|
|
165
|
-
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
166
|
-
|---|---|---|---|---|---|
|
|
167
|
-
|
|
168
|
-
Ordered by risk descending. Be honest about marginal recommendations.
|
|
169
|
-
|
|
170
|
-
5. **Report Location**: Full path.
|
|
1
|
+
# State Management Audit
|
|
2
|
+
|
|
3
|
+
Branch: `state-audit-[date]`. Map everything before fixing anything. Run tests after every change. Commit format: `fix: [state issue] in [module]`.
|
|
4
|
+
|
|
5
|
+
**Do NOT**: change business logic/API contracts, introduce new state libraries, refactor working patterns, or combine fixes into single commits.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Phase 1: State Source Inventory
|
|
10
|
+
|
|
11
|
+
### Catalog every state container
|
|
12
|
+
|
|
13
|
+
Search the entire codebase for where state lives:
|
|
14
|
+
|
|
15
|
+
- **Global stores** — Redux, Zustand, MobX, Vuex/Pinia, Recoil/Jotai, Context, Svelte stores, signals. Document: what data, subscribers, update mechanism, navigation persistence.
|
|
16
|
+
- **Server cache** — React Query, SWR, Apollo, RTK Query, urql. Document: cache keys, TTLs, invalidation strategy, whether mutations update cache or just refetch.
|
|
17
|
+
- **Component-local state** — `useState`, `useReducer`, `this.state`, Vue `ref()`/`reactive()`. Focus on state that *shouldn't* be local: shared data, state lost on unmount that shouldn't be, duplicates of global/server state.
|
|
18
|
+
- **URL state** — Query params, path params, hash. What's encoded? What *should* be (filters, pagination, tabs, search, sort)?
|
|
19
|
+
- **Browser storage** — localStorage, sessionStorage, IndexedDB, cookies. Document: data, read/write timing, TTL, unbounded growth, encryption for sensitive data.
|
|
20
|
+
- **Form state** — Controlled vs uncontrolled, form library config, multi-step persistence, draft preservation on navigation.
|
|
21
|
+
- **Derived/computed state** — Computed on read (selectors, `useMemo`) vs eagerly stored (duplication in disguise)?
|
|
22
|
+
- **Implicit state** — Untracked DOM state: scroll position, focus, `<details>` open/closed, caret position.
|
|
23
|
+
|
|
24
|
+
### Build a state map
|
|
25
|
+
|
|
26
|
+
For every meaningful piece of data, document:
|
|
27
|
+
|
|
28
|
+
| Data | Canonical Source | Other Copies | Sync Mechanism | Stale Window | Survives Refresh? | Should Survive? |
|
|
29
|
+
|------|-----------------|--------------|----------------|-------------|-------------------|-----------------|
|
|
30
|
+
|
|
31
|
+
### Classify state by lifecycle
|
|
32
|
+
|
|
33
|
+
Label each piece of state: **Session** (survives nav, not tab close), **Page** (resets on nav away), **Transient** (resets after interaction), **Persistent** (survives sessions), **Shared** (consistent across components/routes). Flag every mismatch between actual and correct lifecycle.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Phase 2: Duplicated State
|
|
38
|
+
|
|
39
|
+
Duplicated state is the #1 source of "sometimes shows wrong data" bugs.
|
|
40
|
+
|
|
41
|
+
### Find duplicates
|
|
42
|
+
|
|
43
|
+
**Exact**: same data in server cache + global store, parent props + child fetch, URL params + component state, localStorage + store, overlapping store slices, form library + component state, server cache + manual loading/error state.
|
|
44
|
+
|
|
45
|
+
**Semantic**: list cache + individual item cache, normalized + denormalized copies, aggregates stored separately from source data (cart total vs cart items), permissions in auth token + separate endpoint.
|
|
46
|
+
|
|
47
|
+
### Fix safe duplications
|
|
48
|
+
|
|
49
|
+
Delete the copy; have consumers read from the canonical source. If the copy exists for performance, use a memoized selector. If for access, lift access via context/hooks. If server cache vs global store: server data → server cache library, client-only data → global store.
|
|
50
|
+
|
|
51
|
+
For complex cases requiring architectural decisions: document only, don't fix overnight.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Phase 3: Stale State
|
|
56
|
+
|
|
57
|
+
### Identify stale vectors
|
|
58
|
+
|
|
59
|
+
- **Server cache**: Missing mutation → invalidation links? Appropriate `staleTime`/refetch settings? Multi-tab consistency? Optimistic update rollback on failure?
|
|
60
|
+
- **Global store**: Updated on every relevant API response or only initial fetch? State cleared on logout? Session expiry awareness?
|
|
61
|
+
- **URL state**: Back/forward sync? Deep link initialization? Bidirectional URL ↔ UI sync?
|
|
62
|
+
- **Browser storage**: Missing TTL/version key? Stale auth tokens? Schema mismatches after app updates?
|
|
63
|
+
|
|
64
|
+
### Find specific bugs
|
|
65
|
+
|
|
66
|
+
Construct exact reproduction scenarios with numbered steps ending in the bug. Rate each: likelihood × visibility × impact.
|
|
67
|
+
|
|
68
|
+
### Fix
|
|
69
|
+
|
|
70
|
+
Add missing query invalidations, store updates, URL sync, staleTime config, logout cleanup, storage version keys. Err toward correctness over performance.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Phase 4: Missing State Handling
|
|
75
|
+
|
|
76
|
+
Every async operation has four states: **idle, loading, error, success (data or empty)**.
|
|
77
|
+
|
|
78
|
+
### Audit each
|
|
79
|
+
|
|
80
|
+
**Loading**: Indicator exists? Right granularity (not full-page spinner for sidebar)? Grace period before showing? Independent per fetch? Stale-while-revalidate on refetch? Timeout for hung requests?
|
|
81
|
+
|
|
82
|
+
**Error**: Error state exists (not infinite loading)? Helpful message? Retry mechanism? Right scope (failed sidebar ≠ full page error)? App still usable? Auto-recovery? Error boundaries at appropriate levels?
|
|
83
|
+
|
|
84
|
+
**Empty**: Message shown? "No data yet" vs "no results for filter" distinguished? Loading vs empty distinguished (no flash of "No items" before data)?
|
|
85
|
+
|
|
86
|
+
**Optimistic rollback**: Server rejection reverts UI? User notified? Exact prior state restored? Handles navigation-away before error?
|
|
87
|
+
|
|
88
|
+
### Fix
|
|
89
|
+
|
|
90
|
+
Add missing loading/error/empty states matching existing patterns. Fix error boundaries. Fix optimistic rollback bugs.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Phase 5: State Lifecycle Bugs
|
|
95
|
+
|
|
96
|
+
### Doesn't survive when it should
|
|
97
|
+
|
|
98
|
+
- **Refresh**: Long form inputs, filters/pagination (→ URL params), auth token.
|
|
99
|
+
- **Navigation**: Back button restoring scroll, accordions, filters.
|
|
100
|
+
- **Tab switch**: Mobile app suspension, `visibilitychange` refetches resetting state.
|
|
101
|
+
|
|
102
|
+
### Survives when it shouldn't
|
|
103
|
+
|
|
104
|
+
- **Logout**: ALL user-specific state cleared? (stores, cache, storage, cookies, service worker, singletons). Common bug: User B sees User A's data briefly.
|
|
105
|
+
- **Navigation**: `/entity/123` → `/entity/456` shows old data (missing `key` prop or query invalidation).
|
|
106
|
+
- **Deletion**: Removed from every list, count, cache, derived state?
|
|
107
|
+
- **Permission change**: How long until UI reflects server-side changes?
|
|
108
|
+
|
|
109
|
+
### Hydration mismatches (SSR only)
|
|
110
|
+
|
|
111
|
+
Server/client render differences from: missing user context, timezone/locale, browser APIs, random/time values. Check for `typeof window` guards causing different output, `useEffect`-only state flashes, `suppressHydrationWarning` hiding real problems. Fix without changing final rendered output.
|
|
112
|
+
|
|
113
|
+
### Fix
|
|
114
|
+
|
|
115
|
+
Add route `key` props, unmount/logout cleanup, URL state sync, hydration fixes, sessionStorage for form drafts.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Phase 6: Architecture Assessment (Document only, don't rewrite)
|
|
120
|
+
|
|
121
|
+
- **Server vs client state separation**: Flag server data manually managed in Redux/Zustand with loading/error/success actions instead of living in a server cache library. Document migration path.
|
|
122
|
+
- **State proximity**: Flag over-globalized state (global but used by 1-2 components), under-globalized (prop drilling 4+ levels), over-scoped context providers.
|
|
123
|
+
- **Re-render hot spots**: Inline object/array context values, non-granular store subscriptions, missing memo, unmemoized derived state. Focus on lists, expensive components, interactive paths.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Phase 7: Edge Cases (Document, don't fix unless trivial)
|
|
128
|
+
|
|
129
|
+
**Multi-tab**: Login/logout sync, data edits visible across tabs, concurrent edits (conflict detection?).
|
|
130
|
+
|
|
131
|
+
**Network interruption**: Mid-mutation offline, offline navigation with cached pages, online recovery/retry.
|
|
132
|
+
|
|
133
|
+
**Session expiry**: Mid-session token expiry handling, token refresh race deduplication, post-reauth state restoration.
|
|
134
|
+
|
|
135
|
+
Document: scenario, current behavior, expected behavior, user impact, fix complexity.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Output
|
|
140
|
+
|
|
141
|
+
Save as `audit-reports/25_STATE_MANAGEMENT_REPORT_[run-number]_[date]_[time in user's local time].md`.
|
|
142
|
+
|
|
143
|
+
### Report sections
|
|
144
|
+
|
|
145
|
+
1. **Executive Summary** — Health rating (chaotic/fragile/adequate/solid/excellent), counts of findings and fixes.
|
|
146
|
+
2. **State Source Map** — Complete inventory table.
|
|
147
|
+
3. **Duplicated State** — Each duplication with divergence risk, fix status.
|
|
148
|
+
4. **Stale State Bugs** — Each with trigger, duration, impact, fix status.
|
|
149
|
+
5. **Missing UI States** — Gaps in loading/error/empty handling.
|
|
150
|
+
6. **Lifecycle Bugs** — State persisting/vanishing incorrectly.
|
|
151
|
+
7. **Hydration Mismatches** (SSR only).
|
|
152
|
+
8. **Edge Cases** — Multi-tab, offline, session expiry behavior.
|
|
153
|
+
9. **Re-render Hot Spots**.
|
|
154
|
+
10. **Architecture Assessment**.
|
|
155
|
+
11. **Fixes Applied** — File, issue, fix, tests pass, commit.
|
|
156
|
+
12. **Recommendations** — Priority-ordered.
|
|
157
|
+
|
|
158
|
+
### Chat summary (always print)
|
|
159
|
+
|
|
160
|
+
1. **Status**: One sentence — what you did, duration, tests passing.
|
|
161
|
+
2. **Key Findings**: Specific, actionable bullets with severity. Lead with impact, not vagueness.
|
|
162
|
+
3. **Changes Made** (if any).
|
|
163
|
+
4. **Recommendations** table (only if warranted):
|
|
164
|
+
|
|
165
|
+
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
166
|
+
|---|---|---|---|---|---|
|
|
167
|
+
|
|
168
|
+
Ordered by risk descending. Be honest about marginal recommendations.
|
|
169
|
+
|
|
170
|
+
5. **Report Location**: Full path.
|