@codyswann/lisa 2.345.1 → 2.348.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/all/copy-overwrite/scripts/check-state-classification.mjs +609 -0
  2. package/all/copy-overwrite/scripts/lisa-command-envelope.mjs +194 -0
  3. package/all/copy-overwrite/scripts/lisa-schema-validate.mjs +208 -0
  4. package/all/copy-overwrite/scripts/schemas/lisa-command-envelope.v1.schema.json +119 -0
  5. package/all/copy-overwrite/scripts/schemas/lisa-state-contract.v1.schema.json +191 -0
  6. package/all/create-only/state/README.md +41 -0
  7. package/all/create-only/state/state-contract.example.json +46 -0
  8. package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
  9. package/dist/core/upstream-evidence-manifest.js +92 -10
  10. package/dist/core/upstream-evidence-manifest.js.map +1 -1
  11. package/expo/copy-overwrite/scripts/bdd/baseline.mjs +224 -0
  12. package/expo/copy-overwrite/scripts/bdd/contract.mjs +121 -0
  13. package/expo/copy-overwrite/scripts/bdd/envelope.mjs +231 -0
  14. package/expo/copy-overwrite/scripts/bdd/parse.mjs +220 -0
  15. package/expo/copy-overwrite/scripts/bdd/render.mjs +170 -0
  16. package/expo/copy-overwrite/scripts/bdd/report.mjs +361 -0
  17. package/expo/copy-overwrite/scripts/bdd/validate.mjs +282 -0
  18. package/expo/copy-overwrite/scripts/bdd/waivers.mjs +210 -0
  19. package/expo/copy-overwrite/scripts/bdd-matrix.mjs +278 -0
  20. package/expo/copy-overwrite/scripts/check-bdd-coverage.mjs +657 -0
  21. package/expo/create-only/bdd/coverage-map.json +38 -0
  22. package/expo/create-only/bdd/features/.keep +5 -0
  23. package/expo/github-rulesets/bdd-coverage.json +33 -0
  24. package/expo/package-lisa/package.lisa.json +3 -0
  25. package/package.json +1 -1
  26. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa/.codex-plugin/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  29. package/plugins/lisa/.codex-plugin/skills/lisa-codify-verification/SKILL.md +4 -0
  30. package/plugins/lisa/.codex-plugin/skills/lisa-implement/SKILL.md +2 -0
  31. package/plugins/lisa/.codex-plugin/skills/lisa-research/SKILL.md +7 -1
  32. package/plugins/lisa/.codex-plugin/skills/lisa-task-decomposition/SKILL.md +2 -0
  33. package/plugins/lisa/.codex-plugin/skills/lisa-test-strategy/SKILL.md +1 -0
  34. package/plugins/lisa/.codex-plugin/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  35. package/plugins/lisa/.codex-plugin/skills/lisa-verify/SKILL.md +1 -1
  36. package/plugins/lisa/rules/eager/reset-seed-coverage.md +48 -0
  37. package/plugins/lisa/rules/reference/reset-seed-coverage.md +231 -0
  38. package/plugins/lisa/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  39. package/plugins/lisa/skills/lisa-codify-verification/SKILL.md +4 -0
  40. package/plugins/lisa/skills/lisa-implement/SKILL.md +2 -0
  41. package/plugins/lisa/skills/lisa-research/SKILL.md +7 -1
  42. package/plugins/lisa/skills/lisa-task-decomposition/SKILL.md +2 -0
  43. package/plugins/lisa/skills/lisa-test-strategy/SKILL.md +1 -0
  44. package/plugins/lisa/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  45. package/plugins/lisa/skills/lisa-verify/SKILL.md +1 -1
  46. package/plugins/lisa-agy/plugin.json +1 -1
  47. package/plugins/lisa-agy/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  48. package/plugins/lisa-agy/skills/lisa-codify-verification/SKILL.md +4 -0
  49. package/plugins/lisa-agy/skills/lisa-implement/SKILL.md +2 -0
  50. package/plugins/lisa-agy/skills/lisa-research/SKILL.md +7 -1
  51. package/plugins/lisa-agy/skills/lisa-task-decomposition/SKILL.md +2 -0
  52. package/plugins/lisa-agy/skills/lisa-test-strategy/SKILL.md +1 -0
  53. package/plugins/lisa-agy/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  54. package/plugins/lisa-agy/skills/lisa-verify/SKILL.md +1 -1
  55. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  56. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  57. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  58. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  59. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  60. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  61. package/plugins/lisa-copilot/rules/eager/reset-seed-coverage.md +48 -0
  62. package/plugins/lisa-copilot/rules/reference/reset-seed-coverage.md +231 -0
  63. package/plugins/lisa-copilot/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  64. package/plugins/lisa-copilot/skills/lisa-codify-verification/SKILL.md +4 -0
  65. package/plugins/lisa-copilot/skills/lisa-implement/SKILL.md +2 -0
  66. package/plugins/lisa-copilot/skills/lisa-research/SKILL.md +7 -1
  67. package/plugins/lisa-copilot/skills/lisa-task-decomposition/SKILL.md +2 -0
  68. package/plugins/lisa-copilot/skills/lisa-test-strategy/SKILL.md +1 -0
  69. package/plugins/lisa-copilot/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  70. package/plugins/lisa-copilot/skills/lisa-verify/SKILL.md +1 -1
  71. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  72. package/plugins/lisa-cursor/rules/reset-seed-coverage-reference.mdc +236 -0
  73. package/plugins/lisa-cursor/rules/reset-seed-coverage.mdc +53 -0
  74. package/plugins/lisa-cursor/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  75. package/plugins/lisa-cursor/skills/lisa-codify-verification/SKILL.md +4 -0
  76. package/plugins/lisa-cursor/skills/lisa-implement/SKILL.md +2 -0
  77. package/plugins/lisa-cursor/skills/lisa-research/SKILL.md +7 -1
  78. package/plugins/lisa-cursor/skills/lisa-task-decomposition/SKILL.md +2 -0
  79. package/plugins/lisa-cursor/skills/lisa-test-strategy/SKILL.md +1 -0
  80. package/plugins/lisa-cursor/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  81. package/plugins/lisa-cursor/skills/lisa-verify/SKILL.md +1 -1
  82. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  83. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  84. package/plugins/lisa-expo/.codex-plugin/skills/ops-db-ops/SKILL.md +93 -2
  85. package/plugins/lisa-expo/skills/ops-db-ops/SKILL.md +94 -3
  86. package/plugins/lisa-expo/skills/ops-db-ops/agents/openai.yaml +2 -2
  87. package/plugins/lisa-expo-agy/plugin.json +1 -1
  88. package/plugins/lisa-expo-agy/skills/ops-db-ops/SKILL.md +94 -3
  89. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-expo-copilot/skills/ops-db-ops/SKILL.md +94 -3
  91. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-expo-cursor/skills/ops-db-ops/SKILL.md +94 -3
  93. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  95. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  96. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  97. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  98. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  99. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  100. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  101. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  102. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  103. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  104. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  105. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  106. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  107. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  108. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  109. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  110. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  111. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  112. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  113. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  114. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  115. package/plugins/lisa-rails-agy/plugin.json +1 -1
  116. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  117. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  118. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  119. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  120. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  121. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  122. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  123. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  124. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  125. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  126. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  127. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  128. package/plugins/src/base/rules/eager/reset-seed-coverage.md +48 -0
  129. package/plugins/src/base/rules/reference/reset-seed-coverage.md +231 -0
  130. package/plugins/src/base/skills/lisa-acceptance-criteria/SKILL.md +1 -0
  131. package/plugins/src/base/skills/lisa-codify-verification/SKILL.md +4 -0
  132. package/plugins/src/base/skills/lisa-implement/SKILL.md +2 -0
  133. package/plugins/src/base/skills/lisa-research/SKILL.md +7 -1
  134. package/plugins/src/base/skills/lisa-task-decomposition/SKILL.md +2 -0
  135. package/plugins/src/base/skills/lisa-test-strategy/SKILL.md +1 -0
  136. package/plugins/src/base/skills/lisa-verification-lifecycle/SKILL.md +1 -0
  137. package/plugins/src/base/skills/lisa-verify/SKILL.md +1 -1
  138. package/plugins/src/expo/skills/ops-db-ops/SKILL.md +94 -3
  139. package/scripts/check-state-classification.mjs +27 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ops-db-ops
3
- description: Database migrations, reverts, schema generation, and GraphQL codegen for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
3
+ description: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -8,9 +8,10 @@ allowed-tools:
8
8
 
9
9
  # Ops: Database Operations
10
10
 
11
- Manage database migrations, schema generation, and GraphQL code generation.
11
+ Manage database migrations, schema generation, GraphQL code generation, and the project's
12
+ reset/seed/verify state operations.
12
13
 
13
- **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`) and optional environment (default: `dev`)
14
+ **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`, `seed`, `reset`, `reset:verify`, `state:inventory`, `state:classify`) and optional environment (default: `dev`)
14
15
 
15
16
  ## Path Convention
16
17
 
@@ -21,6 +22,21 @@ Manage database migrations, schema generation, and GraphQL code generation.
21
22
 
22
23
  **CRITICAL**: Never run migrations or reverts against production without explicit human confirmation.
23
24
 
25
+ **Destructive state operations are stricter than that.** `reset` (and any `seed` that clears before
26
+ it writes) is governed by the `reset-seed-coverage` rule and never runs on the strength of a
27
+ confirmation alone:
28
+
29
+ - Run `--dry-run` first, always, and read what it says it will change. A dry run that reports an
30
+ entity whose ownership it cannot establish is a STOP, not a warning.
31
+ - The environment is whatever the adapter resolves server-side. A `--stage`, `TEST_ENV`, URL, host,
32
+ or public build-time variable is a *request* the adapter checks, never the answer. If the requested
33
+ stage and the resolved environment disagree, that is a refusal to investigate — not something to
34
+ re-run with a different flag.
35
+ - **Production has no override, in any repo, ever.** There is no flag, variable, or confirmation
36
+ phrase that makes a production reset correct. If one appears to exist, stop and report it.
37
+ - Never invent a reset. If the project ships no reset adapter, say so and stop; do not improvise
38
+ deletions with ad-hoc queries or the migration tooling.
39
+
24
40
  ## Discovery
25
41
 
26
42
  Read the backend `package.json` to discover available migration and schema scripts:
@@ -31,10 +47,22 @@ Read the backend `package.json` to discover available migration and schema scrip
31
47
  - `generate:sql-schema*` — regenerate SQL schema for MCP
32
48
  - AWS credential/profile scripts such as `aws:signin:*` and any environment-backed remote profile
33
49
 
50
+ Read the backend and frontend `package.json` to discover the state operations. Discover them; do not
51
+ assume these exact names — a project may expose them under its own, and this skill runs whatever the
52
+ project declares:
53
+ - `db:seed` / `seed:*` — write the fixture baseline
54
+ - `db:reset` / `reset:*` — converge state back to that baseline
55
+ - `db:reset:verify` / `reset:verify:*` — prove the post-state, by exact counts
56
+ - `state:inventory` — enumerate what the running environment actually holds
57
+ - `check:state-classification` — compare that inventory against the state contract
58
+
34
59
  Read the frontend `package.json` to discover codegen scripts:
35
60
  - `fetch:graphql:schema:*` — fetch GraphQL schema
36
61
  - `generate:types:*` — generate TypeScript types
37
62
 
63
+ If a state script the operation needs does not exist, report the absence and the scripts that DO
64
+ exist. Do not substitute a different script, and do not fall back to running SQL by hand.
65
+
38
66
  ## AWS Prerequisite
39
67
 
40
68
  All database operations (except `codegen`) require AWS credentials. Verify the target profile first:
@@ -113,11 +141,74 @@ STAGE={env} bun run generate:sql-schema
113
141
 
114
142
  **Note**: The backend must be running (locally or deployed) for schema fetching to work.
115
143
 
144
+ ### seed (write the fixture baseline)
145
+
146
+ Run the project's discovered seed script for the target environment. A seed is additive or
147
+ convergent, never a blind wipe; if the project's seed clears first, treat it as a reset and follow
148
+ the reset sequence below.
149
+
150
+ ```bash
151
+ cd "${BACKEND_DIR:-../backend-v2}"
152
+ {package-manager} run {discovered-seed-script} --stage {env}
153
+ ```
154
+
155
+ ### reset (converge state back to the baseline)
156
+
157
+ Never a single command. The sequence is fixed:
158
+
159
+ 1. **Dry run.** `{discovered-reset-script} --dry-run --stage {env}`. Read the enumeration. Stop on
160
+ any entity of unknown ownership, on any `forbidden`-classified entity appearing at all, and on
161
+ any disagreement between the requested stage and the resolved environment.
162
+ 2. **Classify first if the contract is stale.** If `check:state-classification` reports an
163
+ unclassified entity, the reset does not run — an unclassified entity is neither safe to keep nor
164
+ safe to delete. Fix the state contract, then start over at step 1.
165
+ 3. **Apply**, passing an idempotency key when running in CI:
166
+ `{discovered-reset-script} --stage {env} --idempotency-key {run-id}`.
167
+ 4. **Verify** with `reset:verify`. A reset that mutated but did not verify is a failure, not a
168
+ partial success.
169
+ 5. **Converge check.** Applying a second time must report no further change. If the second run keeps
170
+ deleting, the ownership predicate is wrong — report it rather than re-running.
171
+
172
+ ### reset:verify (prove the post-state)
173
+
174
+ ```bash
175
+ {package-manager} run {discovered-verify-script} --stage {env}
176
+ ```
177
+
178
+ Verification asserts **exact** expected counts per fixture entity. "At least one" passes against a
179
+ leak, which is the condition being guarded.
180
+
181
+ ### state:inventory (enumerate what the environment actually holds)
182
+
183
+ Produces the runtime inventory the classification check compares against. A complete inventory
184
+ covers more than rows: identity-provider objects, object storage prefixes, search indexes, queues
185
+ and dead-letter backlogs, caches with a persistence tier, derived and materialized views, and
186
+ runtime-created jobs. Record anything that could not be enumerated, with the reason.
187
+
188
+ ### state:classify (compare the inventory to the contract)
189
+
190
+ ```bash
191
+ node scripts/check-state-classification.mjs
192
+ ```
193
+
194
+ Exit 0 = every entity the environment holds is classified and every policy obligation is met.
195
+ Nonzero = an unclassified entity, an unswept `fixture-owned` entity, a stale classification, an
196
+ incomplete inventory, or a missing assurance. Report the findings verbatim — each names the entity
197
+ and what is missing.
198
+
116
199
  ## Output Format
117
200
 
201
+ Every state operation returns the standard command envelope on stdout — one JSON object with
202
+ `schemaVersion`, `capability`, `mode`, `operation`, `environment`, `contractVersion`, `dryRun`,
203
+ `status`, `correlationId`, and `summary{deleted,created,preserved}`. Report from that envelope, not
204
+ from prose scraped off stderr. A destructive operation that produced no envelope has not been
205
+ verified, whatever its exit code said.
206
+
118
207
  Report operation result:
119
208
 
120
209
  | Operation | Environment | Target | Status | Details |
121
210
  |-----------|-------------|--------|--------|---------|
122
211
  | migrate | dev | local DB | SUCCESS | 2 migrations applied |
123
212
  | codegen | dev | frontend | SUCCESS | Types regenerated |
213
+ | reset | dev | reset adapter | completed | deleted 12 / preserved 31, converged on second apply, correlation `abc123` |
214
+ | state:classify | dev | state contract | failed | `public.notes` unclassified — fail closed |
@@ -1,4 +1,4 @@
1
1
  display_name: "Ops Db Ops"
2
- short_description: "Database migrations, reverts, schema generation, and GraphQL codegen for Expo + serverless backend projects"
2
+ short_description: "Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend"
3
3
  default_prompt:
4
- - "Use $ops-db-ops: Database migrations, reverts, schema generation, and GraphQL codegen for Expo + serverless backend projects."
4
+ - "Use $ops-db-ops: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend…."
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ops-db-ops
3
- description: Database migrations, reverts, schema generation, and GraphQL codegen for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
3
+ description: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -8,9 +8,10 @@ allowed-tools:
8
8
 
9
9
  # Ops: Database Operations
10
10
 
11
- Manage database migrations, schema generation, and GraphQL code generation.
11
+ Manage database migrations, schema generation, GraphQL code generation, and the project's
12
+ reset/seed/verify state operations.
12
13
 
13
- **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`) and optional environment (default: `dev`)
14
+ **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`, `seed`, `reset`, `reset:verify`, `state:inventory`, `state:classify`) and optional environment (default: `dev`)
14
15
 
15
16
  ## Path Convention
16
17
 
@@ -21,6 +22,21 @@ Manage database migrations, schema generation, and GraphQL code generation.
21
22
 
22
23
  **CRITICAL**: Never run migrations or reverts against production without explicit human confirmation.
23
24
 
25
+ **Destructive state operations are stricter than that.** `reset` (and any `seed` that clears before
26
+ it writes) is governed by the `reset-seed-coverage` rule and never runs on the strength of a
27
+ confirmation alone:
28
+
29
+ - Run `--dry-run` first, always, and read what it says it will change. A dry run that reports an
30
+ entity whose ownership it cannot establish is a STOP, not a warning.
31
+ - The environment is whatever the adapter resolves server-side. A `--stage`, `TEST_ENV`, URL, host,
32
+ or public build-time variable is a *request* the adapter checks, never the answer. If the requested
33
+ stage and the resolved environment disagree, that is a refusal to investigate — not something to
34
+ re-run with a different flag.
35
+ - **Production has no override, in any repo, ever.** There is no flag, variable, or confirmation
36
+ phrase that makes a production reset correct. If one appears to exist, stop and report it.
37
+ - Never invent a reset. If the project ships no reset adapter, say so and stop; do not improvise
38
+ deletions with ad-hoc queries or the migration tooling.
39
+
24
40
  ## Discovery
25
41
 
26
42
  Read the backend `package.json` to discover available migration and schema scripts:
@@ -31,10 +47,22 @@ Read the backend `package.json` to discover available migration and schema scrip
31
47
  - `generate:sql-schema*` — regenerate SQL schema for MCP
32
48
  - AWS credential/profile scripts such as `aws:signin:*` and any environment-backed remote profile
33
49
 
50
+ Read the backend and frontend `package.json` to discover the state operations. Discover them; do not
51
+ assume these exact names — a project may expose them under its own, and this skill runs whatever the
52
+ project declares:
53
+ - `db:seed` / `seed:*` — write the fixture baseline
54
+ - `db:reset` / `reset:*` — converge state back to that baseline
55
+ - `db:reset:verify` / `reset:verify:*` — prove the post-state, by exact counts
56
+ - `state:inventory` — enumerate what the running environment actually holds
57
+ - `check:state-classification` — compare that inventory against the state contract
58
+
34
59
  Read the frontend `package.json` to discover codegen scripts:
35
60
  - `fetch:graphql:schema:*` — fetch GraphQL schema
36
61
  - `generate:types:*` — generate TypeScript types
37
62
 
63
+ If a state script the operation needs does not exist, report the absence and the scripts that DO
64
+ exist. Do not substitute a different script, and do not fall back to running SQL by hand.
65
+
38
66
  ## AWS Prerequisite
39
67
 
40
68
  All database operations (except `codegen`) require AWS credentials. Verify the target profile first:
@@ -113,11 +141,74 @@ STAGE={env} bun run generate:sql-schema
113
141
 
114
142
  **Note**: The backend must be running (locally or deployed) for schema fetching to work.
115
143
 
144
+ ### seed (write the fixture baseline)
145
+
146
+ Run the project's discovered seed script for the target environment. A seed is additive or
147
+ convergent, never a blind wipe; if the project's seed clears first, treat it as a reset and follow
148
+ the reset sequence below.
149
+
150
+ ```bash
151
+ cd "${BACKEND_DIR:-../backend-v2}"
152
+ {package-manager} run {discovered-seed-script} --stage {env}
153
+ ```
154
+
155
+ ### reset (converge state back to the baseline)
156
+
157
+ Never a single command. The sequence is fixed:
158
+
159
+ 1. **Dry run.** `{discovered-reset-script} --dry-run --stage {env}`. Read the enumeration. Stop on
160
+ any entity of unknown ownership, on any `forbidden`-classified entity appearing at all, and on
161
+ any disagreement between the requested stage and the resolved environment.
162
+ 2. **Classify first if the contract is stale.** If `check:state-classification` reports an
163
+ unclassified entity, the reset does not run — an unclassified entity is neither safe to keep nor
164
+ safe to delete. Fix the state contract, then start over at step 1.
165
+ 3. **Apply**, passing an idempotency key when running in CI:
166
+ `{discovered-reset-script} --stage {env} --idempotency-key {run-id}`.
167
+ 4. **Verify** with `reset:verify`. A reset that mutated but did not verify is a failure, not a
168
+ partial success.
169
+ 5. **Converge check.** Applying a second time must report no further change. If the second run keeps
170
+ deleting, the ownership predicate is wrong — report it rather than re-running.
171
+
172
+ ### reset:verify (prove the post-state)
173
+
174
+ ```bash
175
+ {package-manager} run {discovered-verify-script} --stage {env}
176
+ ```
177
+
178
+ Verification asserts **exact** expected counts per fixture entity. "At least one" passes against a
179
+ leak, which is the condition being guarded.
180
+
181
+ ### state:inventory (enumerate what the environment actually holds)
182
+
183
+ Produces the runtime inventory the classification check compares against. A complete inventory
184
+ covers more than rows: identity-provider objects, object storage prefixes, search indexes, queues
185
+ and dead-letter backlogs, caches with a persistence tier, derived and materialized views, and
186
+ runtime-created jobs. Record anything that could not be enumerated, with the reason.
187
+
188
+ ### state:classify (compare the inventory to the contract)
189
+
190
+ ```bash
191
+ node scripts/check-state-classification.mjs
192
+ ```
193
+
194
+ Exit 0 = every entity the environment holds is classified and every policy obligation is met.
195
+ Nonzero = an unclassified entity, an unswept `fixture-owned` entity, a stale classification, an
196
+ incomplete inventory, or a missing assurance. Report the findings verbatim — each names the entity
197
+ and what is missing.
198
+
116
199
  ## Output Format
117
200
 
201
+ Every state operation returns the standard command envelope on stdout — one JSON object with
202
+ `schemaVersion`, `capability`, `mode`, `operation`, `environment`, `contractVersion`, `dryRun`,
203
+ `status`, `correlationId`, and `summary{deleted,created,preserved}`. Report from that envelope, not
204
+ from prose scraped off stderr. A destructive operation that produced no envelope has not been
205
+ verified, whatever its exit code said.
206
+
118
207
  Report operation result:
119
208
 
120
209
  | Operation | Environment | Target | Status | Details |
121
210
  |-----------|-------------|--------|--------|---------|
122
211
  | migrate | dev | local DB | SUCCESS | 2 migrations applied |
123
212
  | codegen | dev | frontend | SUCCESS | Types regenerated |
213
+ | reset | dev | reset adapter | completed | deleted 12 / preserved 31, converged on second apply, correlation `abc123` |
214
+ | state:classify | dev | state contract | failed | `public.notes` unclassified — fail closed |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ops-db-ops
3
- description: Database migrations, reverts, schema generation, and GraphQL codegen for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
3
+ description: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -8,9 +8,10 @@ allowed-tools:
8
8
 
9
9
  # Ops: Database Operations
10
10
 
11
- Manage database migrations, schema generation, and GraphQL code generation.
11
+ Manage database migrations, schema generation, GraphQL code generation, and the project's
12
+ reset/seed/verify state operations.
12
13
 
13
- **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`) and optional environment (default: `dev`)
14
+ **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`, `seed`, `reset`, `reset:verify`, `state:inventory`, `state:classify`) and optional environment (default: `dev`)
14
15
 
15
16
  ## Path Convention
16
17
 
@@ -21,6 +22,21 @@ Manage database migrations, schema generation, and GraphQL code generation.
21
22
 
22
23
  **CRITICAL**: Never run migrations or reverts against production without explicit human confirmation.
23
24
 
25
+ **Destructive state operations are stricter than that.** `reset` (and any `seed` that clears before
26
+ it writes) is governed by the `reset-seed-coverage` rule and never runs on the strength of a
27
+ confirmation alone:
28
+
29
+ - Run `--dry-run` first, always, and read what it says it will change. A dry run that reports an
30
+ entity whose ownership it cannot establish is a STOP, not a warning.
31
+ - The environment is whatever the adapter resolves server-side. A `--stage`, `TEST_ENV`, URL, host,
32
+ or public build-time variable is a *request* the adapter checks, never the answer. If the requested
33
+ stage and the resolved environment disagree, that is a refusal to investigate — not something to
34
+ re-run with a different flag.
35
+ - **Production has no override, in any repo, ever.** There is no flag, variable, or confirmation
36
+ phrase that makes a production reset correct. If one appears to exist, stop and report it.
37
+ - Never invent a reset. If the project ships no reset adapter, say so and stop; do not improvise
38
+ deletions with ad-hoc queries or the migration tooling.
39
+
24
40
  ## Discovery
25
41
 
26
42
  Read the backend `package.json` to discover available migration and schema scripts:
@@ -31,10 +47,22 @@ Read the backend `package.json` to discover available migration and schema scrip
31
47
  - `generate:sql-schema*` — regenerate SQL schema for MCP
32
48
  - AWS credential/profile scripts such as `aws:signin:*` and any environment-backed remote profile
33
49
 
50
+ Read the backend and frontend `package.json` to discover the state operations. Discover them; do not
51
+ assume these exact names — a project may expose them under its own, and this skill runs whatever the
52
+ project declares:
53
+ - `db:seed` / `seed:*` — write the fixture baseline
54
+ - `db:reset` / `reset:*` — converge state back to that baseline
55
+ - `db:reset:verify` / `reset:verify:*` — prove the post-state, by exact counts
56
+ - `state:inventory` — enumerate what the running environment actually holds
57
+ - `check:state-classification` — compare that inventory against the state contract
58
+
34
59
  Read the frontend `package.json` to discover codegen scripts:
35
60
  - `fetch:graphql:schema:*` — fetch GraphQL schema
36
61
  - `generate:types:*` — generate TypeScript types
37
62
 
63
+ If a state script the operation needs does not exist, report the absence and the scripts that DO
64
+ exist. Do not substitute a different script, and do not fall back to running SQL by hand.
65
+
38
66
  ## AWS Prerequisite
39
67
 
40
68
  All database operations (except `codegen`) require AWS credentials. Verify the target profile first:
@@ -113,11 +141,74 @@ STAGE={env} bun run generate:sql-schema
113
141
 
114
142
  **Note**: The backend must be running (locally or deployed) for schema fetching to work.
115
143
 
144
+ ### seed (write the fixture baseline)
145
+
146
+ Run the project's discovered seed script for the target environment. A seed is additive or
147
+ convergent, never a blind wipe; if the project's seed clears first, treat it as a reset and follow
148
+ the reset sequence below.
149
+
150
+ ```bash
151
+ cd "${BACKEND_DIR:-../backend-v2}"
152
+ {package-manager} run {discovered-seed-script} --stage {env}
153
+ ```
154
+
155
+ ### reset (converge state back to the baseline)
156
+
157
+ Never a single command. The sequence is fixed:
158
+
159
+ 1. **Dry run.** `{discovered-reset-script} --dry-run --stage {env}`. Read the enumeration. Stop on
160
+ any entity of unknown ownership, on any `forbidden`-classified entity appearing at all, and on
161
+ any disagreement between the requested stage and the resolved environment.
162
+ 2. **Classify first if the contract is stale.** If `check:state-classification` reports an
163
+ unclassified entity, the reset does not run — an unclassified entity is neither safe to keep nor
164
+ safe to delete. Fix the state contract, then start over at step 1.
165
+ 3. **Apply**, passing an idempotency key when running in CI:
166
+ `{discovered-reset-script} --stage {env} --idempotency-key {run-id}`.
167
+ 4. **Verify** with `reset:verify`. A reset that mutated but did not verify is a failure, not a
168
+ partial success.
169
+ 5. **Converge check.** Applying a second time must report no further change. If the second run keeps
170
+ deleting, the ownership predicate is wrong — report it rather than re-running.
171
+
172
+ ### reset:verify (prove the post-state)
173
+
174
+ ```bash
175
+ {package-manager} run {discovered-verify-script} --stage {env}
176
+ ```
177
+
178
+ Verification asserts **exact** expected counts per fixture entity. "At least one" passes against a
179
+ leak, which is the condition being guarded.
180
+
181
+ ### state:inventory (enumerate what the environment actually holds)
182
+
183
+ Produces the runtime inventory the classification check compares against. A complete inventory
184
+ covers more than rows: identity-provider objects, object storage prefixes, search indexes, queues
185
+ and dead-letter backlogs, caches with a persistence tier, derived and materialized views, and
186
+ runtime-created jobs. Record anything that could not be enumerated, with the reason.
187
+
188
+ ### state:classify (compare the inventory to the contract)
189
+
190
+ ```bash
191
+ node scripts/check-state-classification.mjs
192
+ ```
193
+
194
+ Exit 0 = every entity the environment holds is classified and every policy obligation is met.
195
+ Nonzero = an unclassified entity, an unswept `fixture-owned` entity, a stale classification, an
196
+ incomplete inventory, or a missing assurance. Report the findings verbatim — each names the entity
197
+ and what is missing.
198
+
116
199
  ## Output Format
117
200
 
201
+ Every state operation returns the standard command envelope on stdout — one JSON object with
202
+ `schemaVersion`, `capability`, `mode`, `operation`, `environment`, `contractVersion`, `dryRun`,
203
+ `status`, `correlationId`, and `summary{deleted,created,preserved}`. Report from that envelope, not
204
+ from prose scraped off stderr. A destructive operation that produced no envelope has not been
205
+ verified, whatever its exit code said.
206
+
118
207
  Report operation result:
119
208
 
120
209
  | Operation | Environment | Target | Status | Details |
121
210
  |-----------|-------------|--------|--------|---------|
122
211
  | migrate | dev | local DB | SUCCESS | 2 migrations applied |
123
212
  | codegen | dev | frontend | SUCCESS | Types regenerated |
213
+ | reset | dev | reset adapter | completed | deleted 12 / preserved 31, converged on second apply, correlation `abc123` |
214
+ | state:classify | dev | state contract | failed | `public.notes` unclassified — fail closed |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ops-db-ops
3
- description: Database migrations, reverts, schema generation, and GraphQL codegen for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
3
+ description: Database migrations, reverts, schema generation, GraphQL codegen, and the reset/seed/verify state operations for Expo + serverless backend projects. Operates on the backend (TypeORM) and frontend (GraphQL code generation).
4
4
  allowed-tools:
5
5
  - Bash
6
6
  - Read
@@ -8,9 +8,10 @@ allowed-tools:
8
8
 
9
9
  # Ops: Database Operations
10
10
 
11
- Manage database migrations, schema generation, and GraphQL code generation.
11
+ Manage database migrations, schema generation, GraphQL code generation, and the project's
12
+ reset/seed/verify state operations.
12
13
 
13
- **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`) and optional environment (default: `dev`)
14
+ **Argument**: `$ARGUMENTS` — operation (`migrate`, `revert`, `generate`, `schema`, `codegen`, `seed`, `reset`, `reset:verify`, `state:inventory`, `state:classify`) and optional environment (default: `dev`)
14
15
 
15
16
  ## Path Convention
16
17
 
@@ -21,6 +22,21 @@ Manage database migrations, schema generation, and GraphQL code generation.
21
22
 
22
23
  **CRITICAL**: Never run migrations or reverts against production without explicit human confirmation.
23
24
 
25
+ **Destructive state operations are stricter than that.** `reset` (and any `seed` that clears before
26
+ it writes) is governed by the `reset-seed-coverage` rule and never runs on the strength of a
27
+ confirmation alone:
28
+
29
+ - Run `--dry-run` first, always, and read what it says it will change. A dry run that reports an
30
+ entity whose ownership it cannot establish is a STOP, not a warning.
31
+ - The environment is whatever the adapter resolves server-side. A `--stage`, `TEST_ENV`, URL, host,
32
+ or public build-time variable is a *request* the adapter checks, never the answer. If the requested
33
+ stage and the resolved environment disagree, that is a refusal to investigate — not something to
34
+ re-run with a different flag.
35
+ - **Production has no override, in any repo, ever.** There is no flag, variable, or confirmation
36
+ phrase that makes a production reset correct. If one appears to exist, stop and report it.
37
+ - Never invent a reset. If the project ships no reset adapter, say so and stop; do not improvise
38
+ deletions with ad-hoc queries or the migration tooling.
39
+
24
40
  ## Discovery
25
41
 
26
42
  Read the backend `package.json` to discover available migration and schema scripts:
@@ -31,10 +47,22 @@ Read the backend `package.json` to discover available migration and schema scrip
31
47
  - `generate:sql-schema*` — regenerate SQL schema for MCP
32
48
  - AWS credential/profile scripts such as `aws:signin:*` and any environment-backed remote profile
33
49
 
50
+ Read the backend and frontend `package.json` to discover the state operations. Discover them; do not
51
+ assume these exact names — a project may expose them under its own, and this skill runs whatever the
52
+ project declares:
53
+ - `db:seed` / `seed:*` — write the fixture baseline
54
+ - `db:reset` / `reset:*` — converge state back to that baseline
55
+ - `db:reset:verify` / `reset:verify:*` — prove the post-state, by exact counts
56
+ - `state:inventory` — enumerate what the running environment actually holds
57
+ - `check:state-classification` — compare that inventory against the state contract
58
+
34
59
  Read the frontend `package.json` to discover codegen scripts:
35
60
  - `fetch:graphql:schema:*` — fetch GraphQL schema
36
61
  - `generate:types:*` — generate TypeScript types
37
62
 
63
+ If a state script the operation needs does not exist, report the absence and the scripts that DO
64
+ exist. Do not substitute a different script, and do not fall back to running SQL by hand.
65
+
38
66
  ## AWS Prerequisite
39
67
 
40
68
  All database operations (except `codegen`) require AWS credentials. Verify the target profile first:
@@ -113,11 +141,74 @@ STAGE={env} bun run generate:sql-schema
113
141
 
114
142
  **Note**: The backend must be running (locally or deployed) for schema fetching to work.
115
143
 
144
+ ### seed (write the fixture baseline)
145
+
146
+ Run the project's discovered seed script for the target environment. A seed is additive or
147
+ convergent, never a blind wipe; if the project's seed clears first, treat it as a reset and follow
148
+ the reset sequence below.
149
+
150
+ ```bash
151
+ cd "${BACKEND_DIR:-../backend-v2}"
152
+ {package-manager} run {discovered-seed-script} --stage {env}
153
+ ```
154
+
155
+ ### reset (converge state back to the baseline)
156
+
157
+ Never a single command. The sequence is fixed:
158
+
159
+ 1. **Dry run.** `{discovered-reset-script} --dry-run --stage {env}`. Read the enumeration. Stop on
160
+ any entity of unknown ownership, on any `forbidden`-classified entity appearing at all, and on
161
+ any disagreement between the requested stage and the resolved environment.
162
+ 2. **Classify first if the contract is stale.** If `check:state-classification` reports an
163
+ unclassified entity, the reset does not run — an unclassified entity is neither safe to keep nor
164
+ safe to delete. Fix the state contract, then start over at step 1.
165
+ 3. **Apply**, passing an idempotency key when running in CI:
166
+ `{discovered-reset-script} --stage {env} --idempotency-key {run-id}`.
167
+ 4. **Verify** with `reset:verify`. A reset that mutated but did not verify is a failure, not a
168
+ partial success.
169
+ 5. **Converge check.** Applying a second time must report no further change. If the second run keeps
170
+ deleting, the ownership predicate is wrong — report it rather than re-running.
171
+
172
+ ### reset:verify (prove the post-state)
173
+
174
+ ```bash
175
+ {package-manager} run {discovered-verify-script} --stage {env}
176
+ ```
177
+
178
+ Verification asserts **exact** expected counts per fixture entity. "At least one" passes against a
179
+ leak, which is the condition being guarded.
180
+
181
+ ### state:inventory (enumerate what the environment actually holds)
182
+
183
+ Produces the runtime inventory the classification check compares against. A complete inventory
184
+ covers more than rows: identity-provider objects, object storage prefixes, search indexes, queues
185
+ and dead-letter backlogs, caches with a persistence tier, derived and materialized views, and
186
+ runtime-created jobs. Record anything that could not be enumerated, with the reason.
187
+
188
+ ### state:classify (compare the inventory to the contract)
189
+
190
+ ```bash
191
+ node scripts/check-state-classification.mjs
192
+ ```
193
+
194
+ Exit 0 = every entity the environment holds is classified and every policy obligation is met.
195
+ Nonzero = an unclassified entity, an unswept `fixture-owned` entity, a stale classification, an
196
+ incomplete inventory, or a missing assurance. Report the findings verbatim — each names the entity
197
+ and what is missing.
198
+
116
199
  ## Output Format
117
200
 
201
+ Every state operation returns the standard command envelope on stdout — one JSON object with
202
+ `schemaVersion`, `capability`, `mode`, `operation`, `environment`, `contractVersion`, `dryRun`,
203
+ `status`, `correlationId`, and `summary{deleted,created,preserved}`. Report from that envelope, not
204
+ from prose scraped off stderr. A destructive operation that produced no envelope has not been
205
+ verified, whatever its exit code said.
206
+
118
207
  Report operation result:
119
208
 
120
209
  | Operation | Environment | Target | Status | Details |
121
210
  |-----------|-------------|--------|--------|---------|
122
211
  | migrate | dev | local DB | SUCCESS | 2 migrations applied |
123
212
  | codegen | dev | frontend | SUCCESS | Types regenerated |
213
+ | reset | dev | reset adapter | completed | deleted 12 / preserved 31, converged on second apply, correlation `abc123` |
214
+ | state:classify | dev | state contract | failed | `public.notes` unclassified — fail closed |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.345.1",
3
+ "version": "2.348.0",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"