gm-oc 2.0.402 → 2.0.403

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-oc",
3
- "version": "2.0.402",
3
+ "version": "2.0.403",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -126,6 +126,51 @@ Invoke `browser` skill. Escalation — exhaust each before advancing:
126
126
 
127
127
  Completing a phase is NOT stopping. After every phase: read .prd, check git, invoke next skill. Only when .prd is deleted AND git is clean AND all commits are pushed may you return a final response to the user.
128
128
 
129
+ ## MANDATORY DEV WORKFLOW — ABSOLUTE RULES
130
+
131
+ These rules apply to ALL phases. Violations trigger immediate snake to planning.
132
+
133
+ **FILES**:
134
+ - Permanent structure ONLY — NO ephemeral/temp/mock/simulation files. Use exec: and browser skill instead
135
+ - Single primary implementations — ZERO failovers/fallbacks/demo modes ever
136
+ - Errors fail with brutally clear logs — NEVER hide through failovers or silent catches
137
+ - Hard 200-line limit per file — split files >200 lines BEFORE continuing
138
+ - NO report/doc files except CHANGELOG.md, CLAUDE.md, README.md, TODO.md — DELETE others on discovery
139
+ - Remove ALL comments immediately when encountered — zero tolerance
140
+ - NO test files (.test.js, .spec.js, __tests__/) — manual testing only via exec: and browser skill
141
+ - Clean ALL files not required for the program to function
142
+
143
+ **CODE QUALITY**:
144
+ - ALWAYS scan codebase (exec:codesearch) before editing to find existing implementations — resolve duplicates immediately, NEVER duplicate existing functionality
145
+ - DRY/clean/generalized/forward-thinking architecture — immediately solve architectural issues, CONTINUOUSLY reorganize to be maximally concise/simple without losing functionality
146
+ - Every extra symbol = technical debt — enforce clean short concise functional code
147
+ - ALWAYS write dynamic/modular code using ground truth — ZERO hardcoded values
148
+ - NO adjectives/descriptive language in code (variable/function names must be terse and functional)
149
+ - No mocks/simulations/fallbacks/hardcoded/fake elements — delete on discovery
150
+ - Set client-side debugging globals to make ALL client-side data accessible via simple REPL (window.__debug or similar)
151
+
152
+ **ERROR HANDLING**:
153
+ - Every error must throw and propagate with clear context
154
+ - No `|| defaultValue`, no `catch { return null }`, no graceful degradation
155
+ - The only acceptable error handling: catch → log the real error → re-throw or display to user
156
+
157
+ **DEBUGGING**:
158
+ - ALWAYS hypothesize/troubleshoot via execution BEFORE editing any files
159
+ - Check git history (`git log`, `git diff`) for troubleshooting known regressions — never revert, use differential comparisons and edit new code manually
160
+ - Keep execution logs concise (<4k chars ideal, 30k max)
161
+ - Clear cache before playwright/browser debugging
162
+ - Test locally when possible over live
163
+
164
+ **DOCUMENTATION**:
165
+ - CLAUDE.md: CONTINUOUSLY/IMMEDIATELY track technical info in realtime (NO progress/changelogs)
166
+ - TODO.md: CONTINUOUSLY track persistent todos — MUST completely clear/empty/delete before stopping
167
+ - CHANGELOG.md: CONTINUOUSLY append concise change summaries
168
+ - Deploy if deployable, publish to npm if package is on npm
169
+
170
+ **PROCESS**:
171
+ - Only persistent background shells for long-running CLI processes
172
+ - Manual testing ONLY — NO test files ever
173
+
129
174
  ## CONSTRAINTS
130
175
 
131
176
  **Tier 0**: no_crash, no_exit, ground_truth_only, real_execution, fail_loud
@@ -133,8 +178,6 @@ Completing a phase is NOT stopping. After every phase: read .prd, check git, inv
133
178
  **Tier 2**: no_duplication, no_hardcoded_values, modularity
134
179
  **Tier 3**: no_comments, convention_over_code
135
180
 
136
- **FAIL LOUD — NO FALLBACKS**: Never create fallback modes, demo modes, graceful degradation, silent error swallowing, or try/catch that returns a default value instead of propagating the error. Every error must throw and propagate. If something fails, the user must see exactly what failed and why. No `|| defaultValue`, no `catch { return null }`, no "demo mode", no "offline mode", no degraded functionality. The only acceptable error handling is: catch log the real error → re-throw or display to user.
137
-
138
- **Never**: `Bash(node/npm/npx/bun)` | skip planning | sequential independent items | screenshot before JS exhausted | narrate past unresolved mutables | stop while .prd has items | ask the user what to do next while work remains | create fallback/demo modes | silently swallow errors
181
+ **Never**: `Bash(node/npm/npx/bun)` | skip planning | sequential independent items | screenshot before JS exhausted | narrate past unresolved mutables | stop while .prd has items | ask the user what to do next while work remains | create fallback/demo modes | silently swallow errors | duplicate existing code | leave comments | create test files
139
182
 
140
- **Always**: invoke named skill at every transition | snake to planning on any new unknown | witnessed execution only | keep going until .prd deleted and git clean
183
+ **Always**: invoke named skill at every transition | snake to planning on any new unknown | witnessed execution only | scan codebase before edits | keep going until .prd deleted and git clean
@@ -118,9 +118,28 @@ gh run list --repo AnEntrypoint/<downstream-repo> --limit 3 --json databaseId,na
118
118
  ```
119
119
  Monitor any cascade runs the same way — poll, diagnose failures, fix if the cause is in this repo.
120
120
 
121
+ ## CODEBASE HYGIENE SWEEP
122
+
123
+ Before declaring complete, sweep the entire codebase for violations:
124
+
125
+ 1. **Files >200 lines** → split immediately
126
+ 2. **Comments in code** → remove all
127
+ 3. **Test files** (.test.js, .spec.js, __tests__/) → delete
128
+ 4. **Mock/stub/simulation files** → delete
129
+ 5. **Unnecessary doc files** (not CHANGELOG/CLAUDE/README/TODO.md) → delete
130
+ 6. **Duplicate code** → consolidate
131
+ 7. **Hardcoded values** → extract to config/constants
132
+ 8. **Fallback/demo modes** → remove, fail loud instead
133
+ 9. **TODO.md** → must be empty/deleted before completion
134
+ 10. **CHANGELOG.md** → must have entries for this session's changes
135
+ 11. **CLAUDE.md** → must reflect current technical state
136
+ 12. **Deploy/publish** → if deployable, deploy. If npm package, publish.
137
+
138
+ Any violation found = fix immediately before advancing.
139
+
121
140
  ## COMPLETION DEFINITION
122
141
 
123
- All of: witnessed end-to-end output | all failure paths exercised | .prd empty | git clean and pushed | all CI runs green | `user_steps_remaining=0`
142
+ All of: witnessed end-to-end output | all failure paths exercised | .prd empty | git clean and pushed | all CI runs green | codebase hygiene sweep clean | TODO.md empty/deleted | CHANGELOG.md updated | `user_steps_remaining=0`
124
143
 
125
144
  ## DO NOT STOP
126
145
 
@@ -128,9 +147,9 @@ After end-to-end verification passes: read .prd from disk. If any items remain,
128
147
 
129
148
  ## CONSTRAINTS
130
149
 
131
- **Never**: claim done without witnessed output | uncommitted changes | unpushed commits | failed CI runs | .prd items remaining | stop at first green | absorb surprises silently | respond to user while .prd has items
150
+ **Never**: claim done without witnessed output | uncommitted changes | unpushed commits | failed CI runs | .prd items remaining | TODO.md with items remaining | stop at first green | absorb surprises silently | respond to user while .prd has items | skip hygiene sweep | leave comments/mocks/test files/fallbacks
132
151
 
133
- **Always**: triage failure before snaking | witness end-to-end | snake to planning on any new unknown | enumerate remaining after every success | check .prd after every verification pass
152
+ **Always**: triage failure before snaking | witness end-to-end | snake to planning on any new unknown | enumerate remaining after every success | check .prd after every verification pass | run hygiene sweep before declaring complete | deploy/publish if applicable | update CHANGELOG.md
134
153
 
135
154
  ---
136
155
 
@@ -71,11 +71,18 @@ Pre-emit revealing unexpected behavior → new unknown → snake to `planning`.
71
71
  - Pre-emit debug passed with real inputs and error inputs
72
72
  - Post-emit verification matches pre-emit exactly
73
73
  - Hot reloadable: state outside reloadable modules, handlers swap atomically
74
- - Crash-proof: catch at every boundary, recovery hierarchy
75
- - No mocks/fakes/stubs anywhere
76
- - Files ≤200 lines, no duplicate code, no comments, no hardcoded values
77
- - No fallbacks, demo modes, or silent error swallowing every error must throw and propagate
74
+ - Errors throw with clear context — no fallbacks, demo modes, silent swallowing, `|| default`, `catch { return null }`
75
+ - No mocks/fakes/stubs/simulations/test files anywhere — delete on discovery
76
+ - Files ≤200 lines split immediately if over, do not advance
77
+ - No duplicate code scan codebase for existing implementations before writing
78
+ - No comments — remove any found
79
+ - No hardcoded values — dynamic/modular code using ground truth only
80
+ - No adjectives/descriptive language in variable/function names
81
+ - No unnecessary files — clean anything not required for the program to function
82
+ - Client-side code exposes debug globals (window.__debug or similar)
78
83
  - CLAUDE.md reflects actual behavior
84
+ - CHANGELOG.md updated with changes
85
+ - TODO.md cleared or deleted
79
86
 
80
87
  ## CODEBASE EXPLORATION
81
88
 
@@ -114,7 +114,11 @@ Invoke `browser` skill. Escalation — exhaust each before advancing:
114
114
 
115
115
  ## GROUND TRUTH
116
116
 
117
- Real services, real data, real timing. Mocks/fakes/stubs = delete immediately. No .test.js/.spec.js. Delete on discovery.
117
+ Real services, real data, real timing. Mocks/fakes/stubs/simulations = delete immediately. No .test.js/.spec.js. Delete on discovery. No fallback/demo modes — errors must fail loud with clear logs.
118
+
119
+ **SCAN BEFORE EDIT**: Before modifying or creating any file, search the codebase (exec:codesearch) for existing implementations of the same functionality. Resolve duplicates immediately — NEVER duplicate existing code.
120
+
121
+ **HYPOTHESIZE VIA EXECUTION**: Always troubleshoot and validate hypotheses through witnessed execution BEFORE editing files. Never edit based on assumptions — run the code first, observe the actual behavior, then edit with ground truth.
118
122
 
119
123
  ## DO NOT STOP
120
124
 
@@ -122,9 +126,9 @@ Never respond to the user from this phase. When all mutables are KNOWN, immediat
122
126
 
123
127
  ## CONSTRAINTS
124
128
 
125
- **Never**: `Bash(node/npm/npx/bun)` | fake data | mock files | Glob/Grep/Read/Explore (hook-blocked — use exec:codesearch) | sequential independent items | absorb surprises silently | respond to user or pause for input
129
+ **Never**: `Bash(node/npm/npx/bun)` | fake data | mock files | test files | fallback/demo modes | Glob/Grep/Read/Explore (hook-blocked — use exec:codesearch) | sequential independent items | absorb surprises silently | respond to user or pause for input | edit files before executing to understand current behavior | duplicate existing code
126
130
 
127
- **Always**: witness every hypothesis | import real modules | snake to planning on any new unknown | fix immediately on discovery | invoke next skill immediately when done
131
+ **Always**: witness every hypothesis | import real modules | scan codebase before creating/editing files | snake to planning on any new unknown | fix immediately on discovery | delete mocks/stubs/comments/test files on discovery | invoke next skill immediately when done
128
132
 
129
133
  ---
130
134
 
@@ -39,6 +39,8 @@ Planning = exhaustive mutable discovery. For every aspect of the task ask:
39
39
 
40
40
  Categories of unknowns to enumerate: file existence | API shape | data format | dependency versions | runtime behavior | environment differences | error conditions | concurrency | integration points | backwards compatibility | rollback paths | deployment steps | verification criteria
41
41
 
42
+ **MANDATORY CODEBASE SCAN**: Before planning any new implementation, search (exec:codesearch) for existing code that already does what you need. Add `existingImpl=UNKNOWN` mutable for every new feature — resolve by searching. Duplicating existing functionality is a Tier 2 violation.
43
+
42
44
  ## .PRD FORMAT
43
45
 
44
46
  Path: exactly `./.prd` in current working directory. **JSON array** written via `exec:nodejs`.