nightytidy 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.
- package/LICENSE +21 -0
- package/README.md +314 -0
- package/bin/nightytidy.js +3 -0
- package/package.json +55 -0
- package/src/checks.js +367 -0
- package/src/claude.js +655 -0
- package/src/cli.js +1012 -0
- package/src/consolidation.js +81 -0
- package/src/dashboard-html.js +496 -0
- package/src/dashboard-standalone.js +167 -0
- package/src/dashboard-tui.js +208 -0
- package/src/dashboard.js +427 -0
- package/src/env.js +100 -0
- package/src/executor.js +550 -0
- package/src/git.js +348 -0
- package/src/lock.js +186 -0
- package/src/logger.js +111 -0
- package/src/notifications.js +33 -0
- package/src/orchestrator.js +919 -0
- package/src/prompts/loader.js +55 -0
- package/src/prompts/manifest.json +138 -0
- package/src/prompts/specials/changelog.md +28 -0
- package/src/prompts/specials/consolidation.md +61 -0
- package/src/prompts/specials/doc-update.md +1 -0
- package/src/prompts/specials/report.md +95 -0
- package/src/prompts/steps/01-documentation.md +173 -0
- package/src/prompts/steps/02-test-coverage.md +181 -0
- package/src/prompts/steps/03-test-hardening.md +181 -0
- package/src/prompts/steps/04-test-architecture.md +130 -0
- package/src/prompts/steps/05-test-consolidation.md +165 -0
- package/src/prompts/steps/06-test-quality.md +211 -0
- package/src/prompts/steps/07-api-design.md +165 -0
- package/src/prompts/steps/08-security-sweep.md +207 -0
- package/src/prompts/steps/09-dependency-health.md +217 -0
- package/src/prompts/steps/10-codebase-cleanup.md +189 -0
- package/src/prompts/steps/11-crosscutting-concerns.md +196 -0
- package/src/prompts/steps/12-file-decomposition.md +263 -0
- package/src/prompts/steps/13-code-elegance.md +329 -0
- package/src/prompts/steps/14-architectural-complexity.md +297 -0
- package/src/prompts/steps/15-type-safety.md +192 -0
- package/src/prompts/steps/16-logging-error-message.md +173 -0
- package/src/prompts/steps/17-data-integrity.md +139 -0
- package/src/prompts/steps/18-performance.md +183 -0
- package/src/prompts/steps/19-cost-resource-optimization.md +136 -0
- package/src/prompts/steps/20-error-recovery.md +145 -0
- package/src/prompts/steps/21-race-condition-audit.md +178 -0
- package/src/prompts/steps/22-bug-hunt.md +229 -0
- package/src/prompts/steps/23-frontend-quality.md +210 -0
- package/src/prompts/steps/24-uiux-audit.md +284 -0
- package/src/prompts/steps/25-state-management.md +170 -0
- package/src/prompts/steps/26-perceived-performance.md +190 -0
- package/src/prompts/steps/27-devops.md +165 -0
- package/src/prompts/steps/28-scheduled-job-chron-jobs.md +141 -0
- package/src/prompts/steps/29-observability.md +152 -0
- package/src/prompts/steps/30-backup-check.md +155 -0
- package/src/prompts/steps/31-product-polish-ux-friction.md +122 -0
- package/src/prompts/steps/32-feature-discovery-opportunity.md +128 -0
- package/src/prompts/steps/33-strategic-opportunities.md +217 -0
- package/src/report.js +540 -0
- package/src/setup.js +133 -0
- package/src/sync.js +536 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
You are running an overnight backup and disaster recovery audit. Your job: answer "If the worst happened right now, could we recover — and how much would we lose?"
|
|
2
|
+
|
|
3
|
+
This is a READ-ONLY analysis. Do not create branches or modify code/infrastructure/data. Produce a comprehensive recovery posture assessment and generate the recovery documentation the team would desperately wish they had at 3am during an outage.
|
|
4
|
+
|
|
5
|
+
## Phase 1: Data Asset Inventory
|
|
6
|
+
|
|
7
|
+
**Step 1: Identify every data store** — search the codebase for every place data lives:
|
|
8
|
+
- Primary database(s) — engine, data, access patterns
|
|
9
|
+
- Cache layers (Redis, Memcached) — reconstructable from primary sources, or used as a primary store?
|
|
10
|
+
- File/object storage (S3, GCS, local filesystem) — uploads, generated docs, media
|
|
11
|
+
- Search indexes (Elasticsearch, Algolia, Typesense) — rebuildable from primary DB?
|
|
12
|
+
- Message queues — messages in-flight representing uncommitted state?
|
|
13
|
+
- Session storage — in-memory, database, or Redis?
|
|
14
|
+
- Logs and audit trails — survive infrastructure failure?
|
|
15
|
+
- Configuration and secrets — vault, env vars, config files, or hardcoded?
|
|
16
|
+
- Third-party service data (Stripe, SendGrid, Auth0, etc.) — is local DB or the third-party the source of truth?
|
|
17
|
+
|
|
18
|
+
**Step 2: Classify by criticality**
|
|
19
|
+
- **Irreplaceable**: Cannot be reconstructed (user data, transactions, uploads, audit logs)
|
|
20
|
+
- **Reconstructable**: Rebuildable at significant cost/time (search indexes, caches, derived analytics)
|
|
21
|
+
- **Ephemeral**: Loss acceptable (sessions, temp files, rate limit counters)
|
|
22
|
+
|
|
23
|
+
**Step 3: Assess volume and growth** — for each critical store: approximate size, growth pattern, unbounded growth risks, largest table/collection.
|
|
24
|
+
|
|
25
|
+
## Phase 2: Backup Coverage Assessment
|
|
26
|
+
|
|
27
|
+
**Step 1: Find existing backup configurations** — search for:
|
|
28
|
+
- DB backup scripts, cron jobs, IaC backup config (Terraform, CloudFormation — RDS snapshots, S3 versioning)
|
|
29
|
+
- Docker volume backups, backup-related env vars/config/dependencies (pg_dump, restic, velero, etc.)
|
|
30
|
+
- CI/CD backup jobs, backup documentation, cloud provider backup settings
|
|
31
|
+
|
|
32
|
+
**Step 2: Assess backup coverage per data store**
|
|
33
|
+
For each: Is it backed up? Method? Frequency? Storage location (same server/region/different)? Encrypted? Retention/rotation policy? Ever tested/restored? Point-in-time recovery capability (WAL, binlog, oplog)?
|
|
34
|
+
|
|
35
|
+
**Step 3: Identify backup gaps** — flag critical stores with:
|
|
36
|
+
- No backup — **CRITICAL**
|
|
37
|
+
- Backups on same infrastructure (doesn't survive infra failure) — **HIGH**
|
|
38
|
+
- Backups never tested — **HIGH**
|
|
39
|
+
- Infrequent backups relative to data change rate — **MEDIUM**
|
|
40
|
+
- No PITR despite high-frequency writes — **MEDIUM**
|
|
41
|
+
- Unencrypted backups containing PII — **MEDIUM**
|
|
42
|
+
|
|
43
|
+
## Phase 3: Recovery Capability Assessment
|
|
44
|
+
|
|
45
|
+
**Step 1: RPO analysis** — for each critical store, determine theoretical RPO:
|
|
46
|
+
- Daily backups, no WAL/binlog → up to 24h loss
|
|
47
|
+
- Hourly snapshots → up to 1h
|
|
48
|
+
- Continuous replication/WAL → near-zero
|
|
49
|
+
- No backups → everything since inception (catastrophic)
|
|
50
|
+
|
|
51
|
+
Flag mismatches against likely business tolerance (e.g., payment system with 24h RPO = unacceptable).
|
|
52
|
+
|
|
53
|
+
**Step 2: RTO analysis** — estimate total recovery time:
|
|
54
|
+
- New infrastructure provisioning (IaC vs. manual?)
|
|
55
|
+
- DB restoration time (size-dependent)
|
|
56
|
+
- File storage restoration
|
|
57
|
+
- Secrets/env reconfiguration
|
|
58
|
+
- Search index / cache rebuilding
|
|
59
|
+
- Post-restoration verification
|
|
60
|
+
- Total: "everything gone" → "users can use the product"
|
|
61
|
+
|
|
62
|
+
**Step 3: Single points of failure** — trace critical paths:
|
|
63
|
+
- Single DB instance (no replica), single server/AZ, single file storage location
|
|
64
|
+
- Secrets stored in only one place
|
|
65
|
+
- Bus factor = 1 for ops knowledge
|
|
66
|
+
- Single third-party dependency with no fallback
|
|
67
|
+
- DNS with no redundancy
|
|
68
|
+
|
|
69
|
+
**Step 4: Infrastructure reproducibility**
|
|
70
|
+
- What's defined as code vs. manual-only?
|
|
71
|
+
- What can be recreated from the repo alone?
|
|
72
|
+
- What requires manual setup (cloud console configs, DNS, SSL, third-party services)?
|
|
73
|
+
|
|
74
|
+
## Phase 4: Disaster Scenario Analysis
|
|
75
|
+
|
|
76
|
+
For each scenario below, assess: recovery path, data loss, time to operational, manual steps required, and what info the on-call engineer would need but might not have.
|
|
77
|
+
|
|
78
|
+
1. **Primary database destroyed** (server failure, accidental deletion, ransomware)
|
|
79
|
+
2. **Application servers destroyed** (redeploy from scratch — can repo alone suffice? What secrets/config/stateful components?)
|
|
80
|
+
3. **File storage destroyed/corrupted** (backups? Reproducible assets? What functionality breaks?)
|
|
81
|
+
4. **Third-party service permanently unavailable** (for each critical dependency: impact, local data sufficiency, coupling level)
|
|
82
|
+
5. **Credential compromise** (rotation without downtime? Process per credential type? Documented procedure?)
|
|
83
|
+
6. **Accidental data corruption / bad migration** (rollback capability? PITR? How to identify affected data? Audit trail?)
|
|
84
|
+
|
|
85
|
+
## Phase 5: Recovery Documentation
|
|
86
|
+
|
|
87
|
+
**Generate `docs/DISASTER_RECOVERY.md`** containing:
|
|
88
|
+
1. **Data Store Inventory** — table: | Data Store | Type | Criticality | Backup Method | Frequency | Location | RPO | RTO |
|
|
89
|
+
2. **Recovery Procedures** — per critical store: prerequisites, locating backups, restore commands, verification, failure fallbacks
|
|
90
|
+
3. **Infrastructure Recreation** — from-code vs. manual, env vars/secrets to re-provision
|
|
91
|
+
4. **Credential Rotation Procedures** — per credential: location, generation, dependent services, expected downtime
|
|
92
|
+
5. **Disaster Response Playbooks** — per scenario: detection, triage, recovery, verification, post-incident
|
|
93
|
+
6. **Emergency Contacts & Access** — template for team to fill in; mark gaps with `⚠️ TEAM INPUT NEEDED: [what's missing]`
|
|
94
|
+
|
|
95
|
+
**Generate `docs/BACKUP_RECOMMENDATIONS.md`** — specific recommendations: what to implement (with tooling), backup testing schedules, monitoring, redundancy additions, estimated effort per item.
|
|
96
|
+
|
|
97
|
+
## Output
|
|
98
|
+
|
|
99
|
+
Save report as `audit-reports/30_BACKUP_DISASTER_RECOVERY_REPORT_[run-number]_[date]_[time in user's local time].md`. Increment run number based on existing reports.
|
|
100
|
+
|
|
101
|
+
### Report Structure
|
|
102
|
+
1. **Executive Summary** — readiness rating (unprepared/minimal/partial/solid/robust), one-sentence worst-case impact statement, top 3 gaps
|
|
103
|
+
2. **Data Asset Inventory** — | Data Store | Engine | Criticality | Size Estimate | Growth Pattern | Backed Up? |
|
|
104
|
+
3. **Backup Coverage** — coverage matrix, critical gaps
|
|
105
|
+
4. **Recovery Capability** — RPO/RTO tables, total system RTO, single points of failure
|
|
106
|
+
5. **Infrastructure Reproducibility** — code vs. manual matrix
|
|
107
|
+
6. **Disaster Scenario Analysis** — summary table + detailed analysis per scenario
|
|
108
|
+
7. **Documentation Generated** — references to generated docs, list of all `⚠️ TEAM INPUT NEEDED` items
|
|
109
|
+
8. **Recommendations** — priority-ordered: what, why, effort, tooling
|
|
110
|
+
|
|
111
|
+
## Rules
|
|
112
|
+
- Be honest about uncertainty. "No DB backup config found in codebase — could be configured at infrastructure level outside this repo — verify with the team" is better than "There are no backups."
|
|
113
|
+
- When estimating RPO/RTO, state your assumptions clearly.
|
|
114
|
+
- Write recovery docs for someone stressed, tired, and unfamiliar with the system. Step-by-step. No assumed knowledge.
|
|
115
|
+
- Mark everything you can't determine from the codebase with `⚠️ TEAM INPUT NEEDED`.
|
|
116
|
+
- Use web search to research best practices for the specific databases and services the project uses.
|
|
117
|
+
- You have all night. Be thorough.
|
|
118
|
+
|
|
119
|
+
## Chat Output Requirement
|
|
120
|
+
|
|
121
|
+
In addition to writing the full report file, you MUST print a summary directly in the conversation when you finish. Do not make the user open the report to get the highlights. The chat summary should include:
|
|
122
|
+
|
|
123
|
+
### 1. Status Line
|
|
124
|
+
One sentence: what you did, how long it took, and whether all tests still pass.
|
|
125
|
+
|
|
126
|
+
### 2. Key Findings
|
|
127
|
+
The most important things discovered — bugs, risks, wins, or surprises. Each bullet should be specific and actionable, not vague. Lead with severity or impact.
|
|
128
|
+
|
|
129
|
+
**Good:** "CRITICAL: No backup configuration found for the primary Postgres database — total data loss risk."
|
|
130
|
+
**Bad:** "Found some issues with backups."
|
|
131
|
+
|
|
132
|
+
### 3. Changes Made (if applicable)
|
|
133
|
+
Bullet list of what was actually modified, added, or removed. Skip this section for read-only analysis runs.
|
|
134
|
+
|
|
135
|
+
### 4. Recommendations
|
|
136
|
+
|
|
137
|
+
If there are legitimately beneficial recommendations worth pursuing right now, present them in a table. Do **not** force recommendations — if the audit surfaced no actionable improvements, simply state that no recommendations are warranted at this time and move on.
|
|
138
|
+
|
|
139
|
+
When recommendations exist, use this table format:
|
|
140
|
+
|
|
141
|
+
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
142
|
+
|---|---|---|---|---|---|
|
|
143
|
+
| *Sequential number* | *Short description (≤10 words)* | *What improves if addressed* | *Low / Medium / High / Critical* | *Yes / Probably / Only if time allows* | *1–3 sentences explaining the reasoning, context, or implementation guidance* |
|
|
144
|
+
|
|
145
|
+
Order rows by risk descending (Critical → High → Medium → Low). Be honest in the "Worth Doing?" column — not everything flagged is worth the engineering time. If a recommendation is marginal, say so.
|
|
146
|
+
|
|
147
|
+
### 5. Report Location
|
|
148
|
+
State the full path to the detailed report file for deeper review.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
**Formatting rules for chat output:**
|
|
153
|
+
- Use markdown headers, bold for severity labels, and bullet points for scannability.
|
|
154
|
+
- Do not duplicate the full report contents — just the highlights and recommendations.
|
|
155
|
+
- If you made zero findings in a phase, say so in one line rather than omitting it silently.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Product Polish & UX Friction Audit
|
|
2
|
+
|
|
3
|
+
READ-ONLY analysis. Do not modify any code.
|
|
4
|
+
|
|
5
|
+
## Ground Rules
|
|
6
|
+
|
|
7
|
+
- Evaluate as a **user**, not a developer. "The code handles this correctly" is irrelevant if the user can't tell.
|
|
8
|
+
- Be specific: not "onboarding could be better" but "after signup, user lands on an empty dashboard with no guidance."
|
|
9
|
+
- Classify every issue: **broken** / **confusing** / **incomplete** / **missing**.
|
|
10
|
+
- Severity = frequency × pain. Trace every flow.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Phase 1: User Journey Mapping
|
|
15
|
+
|
|
16
|
+
**Entry points** — Trace each: signup, login, invite link, OAuth, magic link, public pages, shared links, API, CLI, deep links.
|
|
17
|
+
|
|
18
|
+
**Core journeys per user role:**
|
|
19
|
+
- First use: signup → onboarding → first meaningful action → "aha moment"
|
|
20
|
+
- Core loop: the daily/weekly workflow
|
|
21
|
+
- Configuration: settings, profile, team/org management
|
|
22
|
+
- Edge cases: account recovery, plan changes, data export, deletion
|
|
23
|
+
- Exit points: dead ends, confusing branches, flows that just stop
|
|
24
|
+
|
|
25
|
+
**Secondary flows** — Notifications, search, filtering, sorting, bulk actions, imports/exports, integrations, billing, admin.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Phase 2: First-Use & Onboarding
|
|
30
|
+
|
|
31
|
+
**Signup:** Step count, field necessity, email verification clarity (cross-device?), OAuth permission scope & failure fallback, error specificity (duplicate email, weak password, etc.).
|
|
32
|
+
|
|
33
|
+
**First experience:** What appears post-signup — empty state, tutorial, or sample data? Clear path to first action? Blocking setup steps? Skippable onboarding? Progress saved if user leaves?
|
|
34
|
+
|
|
35
|
+
**Empty states:** For every list/dashboard/feed — what shows with zero data? Does it guide the user toward populating it?
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Phase 3: Core Workflow
|
|
40
|
+
|
|
41
|
+
**Primary workflow:** Click/step count for common actions. Unnecessary confirmations? Missing confirmations on destructive actions? Undo support? Save clarity (auto vs. manual, feedback)?
|
|
42
|
+
|
|
43
|
+
**Forms & inputs:** Required/optional marking, inline vs. submit-only validation, sensible defaults, helpful placeholders, error display (all vs. first), input preservation on failure, progress for long forms, timezone/date format clarity.
|
|
44
|
+
|
|
45
|
+
**Navigation:** Location awareness (breadcrumbs, active states, titles), back-navigation (browser + in-app), information architecture logic, deep link shareability & permissions.
|
|
46
|
+
|
|
47
|
+
**Feedback & loading:** Immediate feedback on every action? Click-and-nothing-happens cases? Progress for long operations? Safe to navigate away? Retry without re-entry on failure?
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Phase 4: Edge Cases & Errors
|
|
52
|
+
|
|
53
|
+
**Destructive actions:** Confirmation with consequences explained? Undo available & obvious? Cascade effects communicated? Bulk action extra confirmation with count?
|
|
54
|
+
|
|
55
|
+
**Common error states:** Network offline, session expired (unsaved work?), permission denied (actionable message?), not found (helpful or generic 404?), rate limited (wait guidance?), file upload failures (size/type/network — all communicated?).
|
|
56
|
+
|
|
57
|
+
**Concurrency:** Two users editing same resource — conflict handling? Multi-tab state sync? Stale data refresh?
|
|
58
|
+
|
|
59
|
+
**Boundaries:** Long text (truncation/overflow/layout break?), special characters/emoji/RTL, large datasets (1000+ items — pagination/virtualization/performance?), minimum-input functionality.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Phase 5: Settings & Configuration
|
|
64
|
+
|
|
65
|
+
**Every setting:** Discoverable? Explained? Immediate or requires save? Resettable to default? Dangerous settings guarded?
|
|
66
|
+
|
|
67
|
+
**Missing settings users would expect:** Notification preferences, display prefs, timezone, language, default views, keyboard shortcuts, data export.
|
|
68
|
+
|
|
69
|
+
**Account management:** Change email/password/name? Delete account (clear, complete process)? Team invite/role/removal flows? Data fate on leave/deletion?
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Phase 6: Notifications
|
|
74
|
+
|
|
75
|
+
**Inventory all** emails, in-app, push, webhooks: trigger, content quality, user control (opt-out, frequency, channel).
|
|
76
|
+
|
|
77
|
+
**Transactional:** Welcome email usefulness, password reset clarity & expiry, invite context, billing transparency.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Phase 7: Accessibility Quick Scan
|
|
82
|
+
|
|
83
|
+
Flag obvious issues only (defer full audit): keyboard-only core flow completion, color-only information, screen reader labels on interactive elements, mobile responsiveness.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Output
|
|
88
|
+
|
|
89
|
+
Save as `audit-reports/31_PRODUCT_POLISH_REPORT_[run-number]_[date]_[time in user's local time].md`.
|
|
90
|
+
|
|
91
|
+
### Report Sections
|
|
92
|
+
|
|
93
|
+
1. **Executive Summary** — Overall polish level (rough/fair/good/polished), worst friction, journey health.
|
|
94
|
+
2. **User Journey Map** — All flows traced, health per flow (smooth / some friction / significant friction / broken).
|
|
95
|
+
3. **Critical Friction Points** — Table: Flow | Location (file/component) | Issue | Severity | Type
|
|
96
|
+
4. **First-Use & Onboarding** — Signup friction, onboarding gaps, empty states.
|
|
97
|
+
5. **Core Workflow** — Step-by-step assessment, friction, feedback, form quality.
|
|
98
|
+
6. **Edge Cases & Errors** — Destructive action safety, error quality, boundaries.
|
|
99
|
+
7. **Settings & Account** — Gaps, account management, configuration polish.
|
|
100
|
+
8. **Notifications** — Inventory, quality, missing notifications, user control.
|
|
101
|
+
9. **Accessibility Notes** — Obvious issues only.
|
|
102
|
+
10. **Recommendations** — Priority-ordered by effort: quick fixes (hours) / medium (days) / larger (weeks).
|
|
103
|
+
|
|
104
|
+
**Report rules:** Don't pad — if a flow is smooth, say so in one line. Note items requiring a running app as "verify in running app."
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Chat Summary (Required)
|
|
109
|
+
|
|
110
|
+
Print directly in conversation — don't make the user open the file.
|
|
111
|
+
|
|
112
|
+
1. **Status Line** — One sentence: what you did.
|
|
113
|
+
2. **Key Findings** — Most important friction points, specific and actionable.
|
|
114
|
+
3. **Recommendations** (only if warranted):
|
|
115
|
+
|
|
116
|
+
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
117
|
+
|---|---|---|---|---|---|
|
|
118
|
+
| *#* | *≤10 words* | *What improves* | *Low/Med/High/Critical* | *Yes/Probably/Only if time* | *1–3 sentences* |
|
|
119
|
+
|
|
120
|
+
Order by risk descending. Be honest in "Worth Doing?" — if marginal, say so.
|
|
121
|
+
|
|
122
|
+
4. **Report Location** — Full file path.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Feature Discovery & Opportunity Audit
|
|
2
|
+
|
|
3
|
+
Read the entire codebase. Identify features, capabilities, and improvements worth building — grounded purely in what exists, what's partial, and what the architecture supports.
|
|
4
|
+
|
|
5
|
+
**READ-ONLY. No web search. No code changes.**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
- Every recommendation must reference specific files, models, or patterns.
|
|
12
|
+
- Distinguish: **natural extensions** (80%+ done), **logical additions** (users would expect), **ambitious opportunities** (differentiators).
|
|
13
|
+
- Quality over quantity. 10 well-reasoned opportunities > 50 shallow ones.
|
|
14
|
+
- Be honest about effort and maintenance burden. "Add AI" is not a recommendation — specify data, infrastructure, and minimal viable version.
|
|
15
|
+
- Don't recommend features that conflict with the product's design intent.
|
|
16
|
+
- Prioritize features leveraging existing data/infrastructure over new systems.
|
|
17
|
+
- You have all night. Read everything.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Phase 1: Deep Codebase Understanding
|
|
22
|
+
|
|
23
|
+
**Product model** — What it does, who it serves, every feature, the full data model (entities, relationships, collected data), user roles/permissions, monetization (free/paid/tiers/gating), integrations.
|
|
24
|
+
|
|
25
|
+
**Architecture capabilities** — Background jobs, notification systems (email/push/in-app/webhooks), file handling, search (full-text/filtering/faceting), real-time (WebSockets/SSE), API surface & patterns, event/audit tracking.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Phase 2: Unfinished & Abandoned Features
|
|
30
|
+
|
|
31
|
+
**Partially built features** — Look for:
|
|
32
|
+
- DB tables/columns with no UI or API exposure
|
|
33
|
+
- Models/types defined but unused in routes/components
|
|
34
|
+
- Feature flags permanently off (read the guarded code)
|
|
35
|
+
- Routes/endpoints not linked from UI; unreachable components/pages
|
|
36
|
+
- TODO/FIXME comments describing planned features
|
|
37
|
+
- Migrations adding schema for unfinished features
|
|
38
|
+
- Config/env vars for unintegrated services
|
|
39
|
+
|
|
40
|
+
For each: what was it, how far did it get, what would finish it?
|
|
41
|
+
|
|
42
|
+
**Vestigial infrastructure** — Libraries barely used, notification infra sending only one type, permission systems more granular than needed, underutilized search/webhook/queue systems. These are sunk investment awaiting ROI.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 3: Data-Driven Opportunities
|
|
47
|
+
|
|
48
|
+
**Inventory all collected data** — User actions/events, timestamps, entity relationships, stored-but-unsurfaced metadata, computed-but-undisplayed aggregations.
|
|
49
|
+
|
|
50
|
+
**Underutilized data** — Analytics/insights, personalization signals, automation triggers, collaborative signals, historical trends. For each: what data exists → what feature it enables → existing pipeline support → effort.
|
|
51
|
+
|
|
52
|
+
**Missing data** — Features that need data not yet collected. What's the minimal collection that unlocks the most value?
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Phase 4: Pattern-Based Feature Discovery
|
|
57
|
+
|
|
58
|
+
**Generalization** — Hardcoded reports → report builder. Single notification type → configurable system. Fixed workflow → customizable engine. Single integration → framework. Manual admin → self-service. Single export → multi-format. Fixed views → customizable dashboards.
|
|
59
|
+
|
|
60
|
+
**Cross-entity features** — Unified search, activity feeds, bulk operations, broad tagging/categorization, universal comments/notes, import/export gaps.
|
|
61
|
+
|
|
62
|
+
**Power user features** — Keyboard shortcuts, saved filters/views, bulk editing, templates, API access, advanced search, custom fields, scheduled/recurring actions.
|
|
63
|
+
|
|
64
|
+
**Admin & ops** — Missing admin views, audit logging gaps, user impersonation, data export, usage analytics, health dashboards.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Phase 5: Automation & Intelligence
|
|
69
|
+
|
|
70
|
+
**Automate manual processes** — Repetitive action patterns (macros), predictable status transitions, inferable data entry, condition-triggered notifications, manual cleanup tasks.
|
|
71
|
+
|
|
72
|
+
**Smart defaults** — Fields users fill identically, likely next actions, adaptive settings, context-based pre-population.
|
|
73
|
+
|
|
74
|
+
**AI-augmentable features** — Text generation/summarization, manual classification, semantic search, auto-tagging, NL summaries of data, answering questions from product data. For each: what's augmented, what data feeds it, what infra exists, minimal viable version.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Phase 6: Platform Opportunities
|
|
79
|
+
|
|
80
|
+
**API-as-product** — Is the API exposable to third parties? What internal capabilities would externals pay for? Could webhook/event patterns power an integration ecosystem?
|
|
81
|
+
|
|
82
|
+
**Multi-tenancy / white-label** — Tenant-aware data model? Configurable branding? Partner resale/embedding potential?
|
|
83
|
+
|
|
84
|
+
**Extensibility** — Custom fields/views/workflows? Plugin architecture potential? Natural integration boundaries?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Output
|
|
89
|
+
|
|
90
|
+
Save as `audit-reports/32_FEATURE_DISCOVERY_REPORT_[run-number]_[date]_[time in user's local time].md`.
|
|
91
|
+
|
|
92
|
+
### Report Structure
|
|
93
|
+
|
|
94
|
+
1. **Executive Summary** — Maturity assessment, opportunity count by category, top 5 highest-value, overall untapped potential.
|
|
95
|
+
|
|
96
|
+
2. **Unfinished Features** — Table: Feature | Evidence (files/tables) | Completion % | Effort to Finish | Value | Recommendation
|
|
97
|
+
|
|
98
|
+
3. **Underutilized Infrastructure** — Table: Infrastructure | Current Usage | Potential Usage | Effort | Value
|
|
99
|
+
|
|
100
|
+
4. **Data Opportunities** — Underutilized: Data Available | Feature Enabled | Pipeline Support | Effort | Impact. Missing: Feature Desired | Data Needed | Collection Effort
|
|
101
|
+
|
|
102
|
+
5. **Feature Opportunities** (main deliverable) — Per feature: Name/description, Category (natural extension / logical addition / ambitious), Evidence (specific code references), Existing foundation (% estimate), Effort (days/weeks/months with specifics), Impact, Dependencies, Priority (Critical / High / Medium / Nice-to-have)
|
|
103
|
+
|
|
104
|
+
6. **Automation & Intelligence** — Manual→automated, smart defaults, AI opportunities with data/infra grounding.
|
|
105
|
+
|
|
106
|
+
7. **Platform Opportunities** — API, multi-tenancy, extensibility assessments.
|
|
107
|
+
|
|
108
|
+
8. **Recommended Build Order** — Priority sequence by dependencies and effort-to-value. Group: quick wins (days), medium (weeks), strategic (months).
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Chat Summary (Required)
|
|
113
|
+
|
|
114
|
+
Print directly in conversation — don't make the user open the report.
|
|
115
|
+
|
|
116
|
+
1. **Status** — One sentence: what you did.
|
|
117
|
+
2. **Key Findings** — Specific, grounded bullets. Lead with value. (e.g., "The `user_events` table tracks every action but nothing surfaces it — a dashboard is low-effort since `jobs/daily_stats.ts` already aggregates.")
|
|
118
|
+
3. **Recommendations** table:
|
|
119
|
+
|
|
120
|
+
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
121
|
+
|---|---|---|---|---|---|
|
|
122
|
+
| | ≤10 words | What improves | Low–Critical | Yes / Probably / Only if time | 1–3 sentences |
|
|
123
|
+
|
|
124
|
+
Order by value descending. Be honest — not everything is worth the engineering time. If nothing worth building was found, say so.
|
|
125
|
+
|
|
126
|
+
4. **Report Location** — Full path to the detailed report.
|
|
127
|
+
|
|
128
|
+
If a phase yielded zero findings, say so in one line.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Strategic Discovery Night
|
|
2
|
+
|
|
3
|
+
## Prompt
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
You are running an overnight strategic analysis of this codebase. You have several hours. Unlike the other overnight runs, this one is less about fixing things and more about discovering opportunities — competitive gaps, feature ideas, and architectural possibilities the team may not have considered.
|
|
7
|
+
|
|
8
|
+
This is a read-only analysis. Do not create a branch or modify any code.
|
|
9
|
+
|
|
10
|
+
## Your Mission
|
|
11
|
+
|
|
12
|
+
### Phase 1: Product Understanding
|
|
13
|
+
|
|
14
|
+
Before you can identify opportunities, you need to deeply understand what this product does and who it serves.
|
|
15
|
+
|
|
16
|
+
**Step 1: Reverse-engineer the product**
|
|
17
|
+
By reading the codebase, answer:
|
|
18
|
+
- What is this product? What problem does it solve?
|
|
19
|
+
- Who are the target users? (Infer from UI copy, feature set, data models, onboarding flows)
|
|
20
|
+
- What are the core features? List every distinct capability.
|
|
21
|
+
- What is the current user journey? (Sign up → onboarding → core usage → retention/engagement loops)
|
|
22
|
+
- What data does the product collect and how is it used?
|
|
23
|
+
- What integrations exist? (Third-party services, APIs, webhooks)
|
|
24
|
+
- What is the monetization model? (Infer from billing code, subscription logic, feature gating)
|
|
25
|
+
- What features are gated behind plans/tiers? What's free vs. paid?
|
|
26
|
+
|
|
27
|
+
**Step 2: Identify the product's strengths**
|
|
28
|
+
Based on the codebase:
|
|
29
|
+
- What features appear most mature and well-built?
|
|
30
|
+
- Where has the most engineering investment gone?
|
|
31
|
+
- What seems to be the core differentiator?
|
|
32
|
+
|
|
33
|
+
**Step 3: Identify the product's weaknesses**
|
|
34
|
+
Based on the codebase:
|
|
35
|
+
- What features feel half-built or abandoned? (Incomplete code, unused models, feature flags that are off)
|
|
36
|
+
- Where is the UX weakest?
|
|
37
|
+
- What capabilities are missing that users would likely expect?
|
|
38
|
+
- What data is collected but not used to provide value back to users?
|
|
39
|
+
|
|
40
|
+
### Phase 2: Competitive & Market Research
|
|
41
|
+
|
|
42
|
+
**Step 1: Identify competitors**
|
|
43
|
+
Based on your understanding of the product:
|
|
44
|
+
- Search the web for direct competitors (products solving the same problem)
|
|
45
|
+
- Search for indirect competitors (different approaches to the same underlying need)
|
|
46
|
+
- Search for adjacent products (solve a related problem, might expand into this space)
|
|
47
|
+
|
|
48
|
+
**Step 2: Analyze competitor features**
|
|
49
|
+
For the top 5-8 competitors:
|
|
50
|
+
- What features do they offer that this product doesn't?
|
|
51
|
+
- What features does this product have that they don't?
|
|
52
|
+
- How do they position themselves? (Read their marketing pages, pricing pages)
|
|
53
|
+
- What do their users complain about? (Search for reviews, Reddit threads, G2/Capterra reviews, Twitter complaints)
|
|
54
|
+
- What are they charging? How does their pricing model compare?
|
|
55
|
+
- What recent features have they launched? (Check their changelogs, blogs, social media)
|
|
56
|
+
|
|
57
|
+
**Step 3: Identify market trends**
|
|
58
|
+
- Search for recent industry analysis, trend reports, or thought leadership in this product's space
|
|
59
|
+
- What capabilities are becoming table stakes?
|
|
60
|
+
- What emerging technologies are competitors adopting?
|
|
61
|
+
- What are users in this space increasingly expecting?
|
|
62
|
+
|
|
63
|
+
### Phase 3: Feature Opportunity Analysis
|
|
64
|
+
|
|
65
|
+
**Step 1: Gap analysis**
|
|
66
|
+
Based on Phases 1 and 2, identify features this product is missing:
|
|
67
|
+
|
|
68
|
+
For each missing feature:
|
|
69
|
+
- What is it?
|
|
70
|
+
- Which competitors have it?
|
|
71
|
+
- How important is it to users? (Based on competitor reviews, user complaints, market trends)
|
|
72
|
+
- How hard would it be to build? (Based on the existing codebase architecture — is the foundation there, or would it require significant new infrastructure?)
|
|
73
|
+
- Priority recommendation: critical / high / medium / nice-to-have
|
|
74
|
+
|
|
75
|
+
**Step 2: Untapped data opportunities**
|
|
76
|
+
Look at the data the product already collects:
|
|
77
|
+
- What analytics or insights could be derived from existing data that aren't being surfaced to users?
|
|
78
|
+
- What personalization opportunities exist based on user behavior data?
|
|
79
|
+
- What automation could be triggered by patterns in the data?
|
|
80
|
+
- What reporting/dashboards could be built from existing data?
|
|
81
|
+
|
|
82
|
+
**Step 3: Integration opportunities**
|
|
83
|
+
- What third-party services would complement this product?
|
|
84
|
+
- What integration points exist in the codebase that aren't being used to their full potential?
|
|
85
|
+
- What workflows would benefit from connecting to other tools (Slack, email, calendar, CRM, etc.)?
|
|
86
|
+
|
|
87
|
+
**Step 4: UX improvement opportunities**
|
|
88
|
+
Based on your codebase analysis:
|
|
89
|
+
- Where are users likely experiencing friction? (Complex forms, multi-step processes, confusing navigation)
|
|
90
|
+
- What tasks take too many steps that could be simplified?
|
|
91
|
+
- Where could AI/automation reduce manual work for users?
|
|
92
|
+
- What onboarding improvements would help new users get value faster?
|
|
93
|
+
|
|
94
|
+
### Phase 4: Architectural Opportunity Analysis
|
|
95
|
+
|
|
96
|
+
**Step 1: Scalability assessment**
|
|
97
|
+
- What would break first if the user base 10x'd?
|
|
98
|
+
- Are there architectural bottlenecks that would need to be addressed?
|
|
99
|
+
- What's the current approach to background jobs, queuing, caching?
|
|
100
|
+
- Is the database schema ready for growth? (Missing indexes, inefficient queries, tables that would get too large)
|
|
101
|
+
|
|
102
|
+
**Step 2: Platform/extensibility opportunities**
|
|
103
|
+
- Could this product benefit from a plugin/extension system?
|
|
104
|
+
- Could parts of this product be exposed as an API for third-party developers?
|
|
105
|
+
- Is there a marketplace or ecosystem opportunity?
|
|
106
|
+
- Could the product support white-labeling or multi-tenancy?
|
|
107
|
+
|
|
108
|
+
**Step 3: AI integration opportunities**
|
|
109
|
+
Look at the codebase through an AI lens:
|
|
110
|
+
- What manual processes could be augmented or automated with AI?
|
|
111
|
+
- Where could AI improve the user experience? (Smart defaults, auto-categorization, natural language search, recommendations, content generation)
|
|
112
|
+
- What data does the product have that could train useful models?
|
|
113
|
+
- What would an "AI-first" version of this product look like?
|
|
114
|
+
|
|
115
|
+
## Output Requirements
|
|
116
|
+
|
|
117
|
+
Create the `audit-reports/` directory in the project root if it doesn't already exist. Save the report as `audit-reports/33_STRATEGIC_DISCOVERY_REPORT_[run-number]_[date]_[time in user's local time].md` (e.g., `33_STRATEGIC_DISCOVERY_REPORT_01_2026-02-16_2129.md`). Increment the run number based on any existing reports with the same name prefix in that folder.
|
|
118
|
+
|
|
119
|
+
### Report Structure
|
|
120
|
+
|
|
121
|
+
1. **Product Profile**
|
|
122
|
+
- What the product is and does (as understood from the codebase)
|
|
123
|
+
- Target users
|
|
124
|
+
- Core features inventory
|
|
125
|
+
- Strengths and weaknesses
|
|
126
|
+
- Current monetization model
|
|
127
|
+
|
|
128
|
+
2. **Competitive Landscape**
|
|
129
|
+
- Competitor matrix: table with | Competitor | Overlap | Unique Strengths | Weaknesses | Pricing |
|
|
130
|
+
- What competitors are doing that this product isn't
|
|
131
|
+
- What this product does better than competitors
|
|
132
|
+
- Market trends affecting this space
|
|
133
|
+
|
|
134
|
+
3. **Feature Opportunities**
|
|
135
|
+
Prioritized list, for each:
|
|
136
|
+
- Feature description
|
|
137
|
+
- User need it addresses
|
|
138
|
+
- Competitive context (who has it, is it table stakes?)
|
|
139
|
+
- Implementation complexity (based on current architecture)
|
|
140
|
+
- Priority: Critical / High / Medium / Nice-to-have
|
|
141
|
+
- Estimated effort: Small (days) / Medium (weeks) / Large (months)
|
|
142
|
+
|
|
143
|
+
4. **Untapped Data & Intelligence**
|
|
144
|
+
- Data currently collected but underutilized
|
|
145
|
+
- Analytics/insights that could be surfaced
|
|
146
|
+
- Personalization opportunities
|
|
147
|
+
- Automation triggers
|
|
148
|
+
|
|
149
|
+
5. **Integration & Ecosystem Opportunities**
|
|
150
|
+
- Third-party integrations worth building
|
|
151
|
+
- API/platform possibilities
|
|
152
|
+
- Ecosystem plays
|
|
153
|
+
|
|
154
|
+
6. **AI Integration Roadmap**
|
|
155
|
+
- AI opportunities ranked by impact and feasibility
|
|
156
|
+
- What data assets exist to support AI features
|
|
157
|
+
- Quick AI wins vs. larger AI initiatives
|
|
158
|
+
|
|
159
|
+
7. **Architectural Recommendations**
|
|
160
|
+
- Scalability concerns and suggested remediation
|
|
161
|
+
- Platform/extensibility opportunities
|
|
162
|
+
- Technical investments that would unlock future product capabilities
|
|
163
|
+
|
|
164
|
+
8. **Recommended Roadmap**
|
|
165
|
+
- Synthesize all findings into a suggested priority order
|
|
166
|
+
- Group into: This quarter / Next quarter / Future
|
|
167
|
+
- Note dependencies between items
|
|
168
|
+
|
|
169
|
+
## Rules
|
|
170
|
+
- This is READ-ONLY. Do not modify any code.
|
|
171
|
+
- Use web search to research competitors, market trends, and user feedback
|
|
172
|
+
- Be honest about uncertainty — mark items as "needs validation" when you're inferring rather than knowing
|
|
173
|
+
- Don't just list every possible feature — prioritize ruthlessly based on user impact and implementation feasibility
|
|
174
|
+
- When assessing implementation complexity, be specific about what exists in the codebase vs. what would need to be built
|
|
175
|
+
- Ground your recommendations in evidence (competitor data, user feedback, market trends, codebase analysis) — not just opinions
|
|
176
|
+
- Consider both quick wins and strategic bets
|
|
177
|
+
- Think like a product manager AND an engineer — the best opportunities are at the intersection of user value and technical feasibility
|
|
178
|
+
- You have all night. Do thorough research.
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Chat Output Requirement
|
|
182
|
+
|
|
183
|
+
In addition to writing the full report file, you MUST print a summary directly in the conversation when you finish. Do not make the user open the report to get the highlights. The chat summary should include:
|
|
184
|
+
|
|
185
|
+
### 1. Status Line
|
|
186
|
+
One sentence: what you did, how long it took, and whether all tests still pass.
|
|
187
|
+
|
|
188
|
+
### 2. Key Findings
|
|
189
|
+
The most important things discovered — bugs, risks, wins, or surprises. Each bullet should be specific and actionable, not vague. Lead with severity or impact.
|
|
190
|
+
|
|
191
|
+
**Good:** "CRITICAL: No backup configuration found for the primary Postgres database — total data loss risk."
|
|
192
|
+
**Bad:** "Found some issues with backups."
|
|
193
|
+
|
|
194
|
+
### 3. Changes Made (if applicable)
|
|
195
|
+
Bullet list of what was actually modified, added, or removed. Skip this section for read-only analysis runs.
|
|
196
|
+
|
|
197
|
+
### 4. Recommendations
|
|
198
|
+
|
|
199
|
+
If there are legitimately beneficial recommendations worth pursuing right now, present them in a table. Do **not** force recommendations — if the audit surfaced no actionable improvements, simply state that no recommendations are warranted at this time and move on.
|
|
200
|
+
|
|
201
|
+
When recommendations exist, use this table format:
|
|
202
|
+
|
|
203
|
+
| # | Recommendation | Impact | Risk if Ignored | Worth Doing? | Details |
|
|
204
|
+
|---|---|---|---|---|---|
|
|
205
|
+
| *Sequential number* | *Short description (≤10 words)* | *What improves if addressed* | *Low / Medium / High / Critical* | *Yes / Probably / Only if time allows* | *1–3 sentences explaining the reasoning, context, or implementation guidance* |
|
|
206
|
+
|
|
207
|
+
Order rows by risk descending (Critical → High → Medium → Low). Be honest in the "Worth Doing?" column — not everything flagged is worth the engineering time. If a recommendation is marginal, say so.
|
|
208
|
+
|
|
209
|
+
### 5. Report Location
|
|
210
|
+
State the full path to the detailed report file for deeper review.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
**Formatting rules for chat output:**
|
|
215
|
+
- Use markdown headers, bold for severity labels, and bullet points for scannability.
|
|
216
|
+
- Do not duplicate the full report contents — just the highlights and recommendations.
|
|
217
|
+
- If you made zero findings in a phase, say so in one line rather than omitting it silently.
|