@kraftapps-ai/kai 1.8.3 → 1.8.4
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/kai +11 -4
- package/package.json +1 -1
package/kai
CHANGED
|
@@ -227,6 +227,9 @@ PRD_FILE=".kai/stories.json"
|
|
|
227
227
|
PROGRESS_FILE=".kai/progress.txt"
|
|
228
228
|
LOOP_MCP_ARGS="--mcp-config .kai/loop-mcp.json"
|
|
229
229
|
|
|
230
|
+
# Cap Node.js memory to prevent test runners from consuming all RAM
|
|
231
|
+
export NODE_OPTIONS="--max-old-space-size=2048"
|
|
232
|
+
|
|
230
233
|
# Stream output live when running in a tmux pane
|
|
231
234
|
KAI_STREAM=false
|
|
232
235
|
if [ -n "${TMUX:-}" ]; then
|
|
@@ -265,11 +268,15 @@ You are an expert Shopify developer. You have access to the Shopify Dev MCP tool
|
|
|
265
268
|
2. Read .kai/progress.txt for context on previous work.
|
|
266
269
|
3. **PLAN before coding.** List files and changes before touching code.
|
|
267
270
|
4. If the story involves Shopify APIs, call `learn_shopify_api` then use `introspect_graphql_schema` and `search_docs_chunks` to understand the right approach.
|
|
268
|
-
5. **WRITE FAILING TESTS FIRST.** For each acceptance criterion, write a test that verifies it. Run the
|
|
269
|
-
6. **Implement ONLY enough code to make the tests pass (green).** No more, no less.
|
|
271
|
+
5. **WRITE FAILING TESTS FIRST.** For each acceptance criterion, write a test that verifies it. Run ONLY the relevant test file(s) — they MUST fail (red). If a test already passes, your test is not testing the right thing.
|
|
272
|
+
6. **Implement ONLY enough code to make the tests pass (green).** No more, no less. Run only the relevant test file(s) to verify.
|
|
270
273
|
7. **Refactor** if needed — clean up while keeping tests green.
|
|
271
|
-
8.
|
|
274
|
+
8. **Final validation ONCE:** Run the full test suite ONE TIME at the end. Also validate GraphQL with `validate_graphql_codeblocks`, validate Liquid with `validate_theme_codeblocks`.
|
|
272
275
|
9. **SELF-REVIEW.** For each acceptance criterion, cite the test that covers it AND evidence it passes (file, line, command output). No "should work" or "probably".
|
|
276
|
+
|
|
277
|
+
## IMPORTANT: Resource management
|
|
278
|
+
- **NEVER run the full test suite repeatedly.** Run targeted tests during development (e.g., `npx vitest run path/to/test.ts`). Only run the full suite ONCE as a final check before committing.
|
|
279
|
+
- **Always use `npx vitest run`** (not `npx vitest` without `run`) — watch mode will hang forever.
|
|
273
280
|
10. Commit with a descriptive message.
|
|
274
281
|
11. Update .kai/stories.json: set `passes` to `true`.
|
|
275
282
|
12. Append to .kai/progress.txt.
|
|
@@ -278,7 +285,7 @@ You are an expert Shopify developer. You have access to the Shopify Dev MCP tool
|
|
|
278
285
|
- ONE STORY PER LOOP.
|
|
279
286
|
- **TDD is mandatory.** Tests first, then implementation. No exceptions.
|
|
280
287
|
- No placeholders. Fully implement or report BLOCKED.
|
|
281
|
-
- Do not break existing functionality. Run the
|
|
288
|
+
- Do not break existing functionality. Run the full test suite ONCE at the end as a final check.
|
|
282
289
|
- ALWAYS validate GraphQL and Liquid code using the MCP tools before marking complete.
|
|
283
290
|
- If ALL stories have `passes: true`, output: <promise>COMPLETE</promise>
|
|
284
291
|
|