@jskit-ai/jskit-cli 0.2.80 → 0.2.81

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.
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  access,
3
3
  appendFile,
4
- mkdir,
5
- stat
4
+ mkdir
6
5
  } from "node:fs/promises";
7
6
  import { constants as fsConstants } from "node:fs";
8
7
  import path from "node:path";
@@ -22,6 +21,9 @@ import {
22
21
  import {
23
22
  resolveExistingSessionRoot
24
23
  } from "./paths.js";
24
+ import {
25
+ hasWorktree
26
+ } from "./worktrees.js";
25
27
 
26
28
  async function assertTargetRootWritable(targetRoot) {
27
29
  try {
@@ -236,72 +238,60 @@ async function assertSessionExists(paths) {
236
238
  };
237
239
  }
238
240
 
239
- async function assertIssueArtifacts(paths) {
240
- const [issueText, issueUrl] = await Promise.all([
241
- readTrimmedFile(path.join(paths.sessionRoot, "issue.md")),
242
- readTrimmedFile(path.join(paths.sessionRoot, "issue_url"))
243
- ]);
244
- if (issueText && issueUrl) {
241
+ async function assertIssueTextExists(paths) {
242
+ const issueText = await readTrimmedFile(path.join(paths.sessionRoot, "issue.md"));
243
+ if (issueText) {
245
244
  return {
246
245
  ok: true,
247
246
  precondition: createPrecondition({
248
- id: "issue_artifacts",
247
+ id: "issue_text_exists",
249
248
  ok: true,
250
- message: "Issue text and GitHub issue URL exist."
249
+ message: "Issue text exists."
251
250
  })
252
251
  };
253
252
  }
254
253
  return {
255
254
  ok: false,
256
255
  error: createError({
257
- code: "issue_artifacts_missing",
258
- message: "Issue text and GitHub issue URL are required.",
259
- repairCommand: `jskit session ${paths.sessionId} step`
256
+ code: "issue_text_missing",
257
+ message: "Cannot create a GitHub issue before issue.md exists.",
258
+ repairCommand: `jskit session ${paths.sessionId} step --issue -`
260
259
  }),
261
260
  precondition: createPrecondition({
262
- id: "issue_artifacts",
261
+ id: "issue_text_exists",
263
262
  ok: false,
264
- message: "Issue text and GitHub issue URL exist."
263
+ message: "Issue text exists."
265
264
  })
266
265
  };
267
266
  }
268
267
 
269
- async function assertIssueTextExists(paths) {
270
- const issueText = await readTrimmedFile(path.join(paths.sessionRoot, "issue.md"));
271
- if (issueText) {
268
+ async function assertIssueUrlExists(paths) {
269
+ const issueUrl = await readTrimmedFile(path.join(paths.sessionRoot, "issue_url"));
270
+ if (issueUrl) {
272
271
  return {
273
272
  ok: true,
274
273
  precondition: createPrecondition({
275
- id: "issue_text_exists",
274
+ id: "issue_url_exists",
276
275
  ok: true,
277
- message: "Issue text exists."
276
+ message: "GitHub issue URL exists."
278
277
  })
279
278
  };
280
279
  }
281
280
  return {
282
281
  ok: false,
283
282
  error: createError({
284
- code: "issue_text_missing",
285
- message: "Cannot create a GitHub issue before issue.md exists.",
286
- repairCommand: `jskit session ${paths.sessionId} step --issue -`
283
+ code: "issue_url_missing",
284
+ message: "Cannot create a plan before the GitHub issue exists.",
285
+ repairCommand: `jskit session ${paths.sessionId} step`
287
286
  }),
288
287
  precondition: createPrecondition({
289
- id: "issue_text_exists",
288
+ id: "issue_url_exists",
290
289
  ok: false,
291
- message: "Issue text exists."
290
+ message: "GitHub issue URL exists."
292
291
  })
293
292
  };
294
293
  }
295
294
 
296
- async function hasWorktree(paths) {
297
- try {
298
- const stats = await stat(paths.worktree);
299
- return stats.isDirectory();
300
- } catch {
301
- return false;
302
- }
303
- }
304
-
305
295
  async function assertWorktreeExists(paths) {
306
296
  if (await hasWorktree(paths)) {
307
297
  return {
@@ -361,8 +351,8 @@ export {
361
351
  assertGitCurrentBranch,
362
352
  assertGitRepository,
363
353
  assertGithubOrigin,
364
- assertIssueArtifacts,
365
354
  assertIssueTextExists,
355
+ assertIssueUrlExists,
366
356
  assertPrUrlExists,
367
357
  assertSessionExists,
368
358
  assertTargetRootWritable,
@@ -4,21 +4,45 @@ App brief:
4
4
 
5
5
  {{app_brief}}
6
6
 
7
- Produce a concise but useful app-level blueprint. It must describe product intent, not implementation steps for the current issue.
7
+ Produce a concise but useful app-level blueprint. It must describe product intent, platform choices, and architectural boundaries. It must not become an implementation workboard for one issue.
8
+
9
+ Before writing the blueprint, classify the app state if local files are available:
10
+
11
+ - empty
12
+ - non_jskit_repo
13
+ - partial_jskit_app
14
+ - jskit_app
15
+
16
+ Use these markers for a real JSKIT app when they exist:
17
+
18
+ - package.json
19
+ - config/public.js
20
+ - src/main.js
21
+ - packages/main/package.descriptor.mjs
22
+ - .jskit/lock.json
23
+
24
+ If the app is empty or only a fresh minimal scaffold, keep platform choices explicit and provisional until decided. Do not treat a missing `config.tenancyMode` line or untouched minimal scaffold as a final tenancy decision.
8
25
 
9
26
  Cover:
10
27
 
11
28
  - App purpose and what the app will do in general.
12
29
  - Primary users and actors.
13
30
  - Type of multihoming or tenancy: none, personal, workspaces, or another explicit model from the brief.
31
+ - Database engine, if the app needs persistence.
32
+ - Auth provider, if the app needs auth.
14
33
  - The role of each surface: app, admin, console, settings, public, workspace, or any app-specific surface from the brief.
15
34
  - Global view of the main product areas and navigation destinations.
16
35
  - Key domain concepts and data objects, without inventing database schemas unless the brief clearly requires them.
36
+ - Ownership model per persistent entity when it is already clear: public, user, workspace, or workspace_user.
37
+ - Baseline JSKIT package workflows to accept as defaults and any intended overrides.
38
+ - Package install, generator, and custom-code areas at a high level.
39
+ - CRUDs likely to need server ownership, and any narrow exceptions that should be called out later.
17
40
  - Important non-goals and constraints.
18
41
  - First useful screen and what it should show.
19
42
  - Settings, admin, and operator expectations when relevant.
43
+ - Verification expectations, including UI checks for user-facing screens.
20
44
 
21
- If the brief is ambiguous, state the assumption in the blueprint instead of asking questions.
45
+ If the brief is ambiguous, state the assumption in the blueprint instead of asking questions. Do not invent detailed feature behavior that the brief does not support.
22
46
 
23
47
  When the blueprint is ready, output only the final markdown surrounded by these exact markers:
24
48
 
@@ -12,4 +12,15 @@ Failure output:
12
12
 
13
13
  {{doctor_output}}
14
14
 
15
- Fix the root cause in this worktree. Do not push, open a PR, merge, or remove the worktree. When the fix is ready, report changed files and verification, then the user will rerun the JSKIT session step.
15
+ Fix the root cause in this worktree. Do not silence the failure or remove checks to make the step pass.
16
+
17
+ Diagnosis rules:
18
+
19
+ - Identify whether the failure is dependency/setup, JSKIT metadata, generated contract drift, routing/surface wiring, CRUD ownership, UI verification receipt, test-auth, or ordinary application code.
20
+ - Prefer repairing the JSKIT-owned contract or generated metadata over adding local-path hacks.
21
+ - Do not run `npm install` only because optional agent docs are missing. Run installs only when the failure or a JSKIT setup/session step requires dependency repair.
22
+ - If a generator/package command is the correct repair, use the `jskit` command rather than hand-recreating generated structure.
23
+ - For UI receipt failures, run the relevant Playwright check and record it with `jskit app verify-ui --command "<playwright command>" --feature "<label>" --auth-mode <mode>` when possible.
24
+ - If login is required, use the app's development auth bootstrap path rather than a live external auth flow.
25
+
26
+ Do not push, open a PR, merge, or remove the worktree. When the fix is ready, report the root cause, files changed, verification, and anything still unverified. The user or Studio will rerun the JSKIT session step.
@@ -0,0 +1,35 @@
1
+ Execute the approved implementation plan for JSKIT session {{session_id}}.
2
+
3
+ GitHub issue: {{issue_url}}
4
+ Issue number: {{issue_number}}
5
+ Issue title: {{issue_title}}
6
+ Issue body file: {{issue_file}}
7
+ Plan file: {{plan_file}}
8
+ Worktree: {{worktree}}
9
+
10
+ Implement the plan in the session worktree. Keep the change scoped to the issue and approved plan.
11
+
12
+ Implementation rules:
13
+
14
+ - Inspect the current app before editing. Do not assume a JSKIT app shape without checking files.
15
+ - Prefer existing JSKIT helpers, package runtime seams, generated scaffolds, and documented generators over new local helpers.
16
+ - If the plan calls for a generator or package install, use the planned `jskit` command unless inspection proves it does not apply. If you skip a generator, explain the exact gap.
17
+ - For non-CRUD route pages, use `jskit generate ui-generator page ...` when it fits instead of hand-writing both route files and placement entries.
18
+ - For CRUD work, scaffold the server side first with `crud-server-generator` before CRUD UI or CRUD route work.
19
+ - Do not hand-write a separate CRUD migration for a table owned by `crud-server-generator`.
20
+ - Do not hand-build CRUD endpoints or page trees before the server CRUD package and shared resource file exist.
21
+ - Keep direct knex exceptional and minimal. Prefer internal json-rest-api seams outside generated CRUD packages and explicit weird-custom feature lanes.
22
+ - Keep runtime, UI, and data concerns separated.
23
+ - Avoid accidental scope expansion.
24
+ - Do not create old workflow files such as `.jskit/WORKBOARD.md`; the session files and receipts are the workflow record.
25
+ - If user-facing UI changes, bring the screen to Material Design and Vuetify quality before calling it done. Include coherent responsive layout, loading, empty, error, disabled, and success states where relevant.
26
+ - If verification needs login, use the app's local development auth bootstrap path rather than a live external auth login.
27
+
28
+ After making changes:
29
+
30
+ - Review for repeated code, unnecessary helpers, fragmented functions, placeholder work, missing states, broken route wiring, ownership mistakes, and weak JSKIT reuse.
31
+ - Run the smallest relevant checks you can run safely in the worktree.
32
+ - For changed user-facing UI, run or clearly identify the Playwright verification path. When possible, record UI verification with `jskit app verify-ui --command "<playwright command>" --feature "<label>" --auth-mode <mode>`.
33
+ - Summarize changed files and checks run.
34
+
35
+ Do not create commits, branches, issues, pull requests, merges, or worktree cleanup yourself. JSKIT session will handle those steps.
@@ -2,12 +2,30 @@ Create a GitHub issue from this user request:
2
2
 
3
3
  {{user_input}}
4
4
 
5
- Ask clarifying questions if the request is not specific enough to produce a useful implementation issue.
5
+ First inspect the local app enough to understand the request in context. Use package.json, config, .jskit metadata, routes, packages, and any saved app blueprint when available. Classify the current app state as empty, non_jskit_repo, partial_jskit_app, or jskit_app before assuming ordinary feature work is possible.
6
6
 
7
- When the issue text is ready, output only the final issue body surrounded by these exact markers:
7
+ Draft an implementation-ready issue, not a broad product essay.
8
+
9
+ Preserve these JSKIT boundaries:
10
+
11
+ - If the app is empty or a partial JSKIT app, the issue should be about bootstrap or recovery before feature implementation.
12
+ - If platform choices are still provisional, make the issue resolve those choices before installing tenancy-sensitive packages.
13
+ - Do not ask the developer to redesign standard JSKIT package-owned workflows from scratch. Treat selected package workflows as defaults unless the request asks for overrides, restrictions, or custom additions.
14
+ - For persisted app-owned data, prefer generated/package ownership over direct hand-built persistence. A new ordinary table should usually become a server CRUD-owned entity before CRUD UI or route work.
15
+ - For non-CRUD app pages, prefer the JSKIT UI generator when it fits.
16
+ - Keep direct knex or low-level runtime work exceptional and explicitly justified.
17
+ - Do not include workflow bookkeeping such as old workboards in the issue body. JSKIT session state and receipts are the workflow tracker.
18
+
19
+ Ask concise clarifying questions if the request is not specific enough to produce a useful implementation issue. Ask only for details that materially change the ticket.
20
+
21
+ When the issue is ready, output only the final issue title and body surrounded by these exact markers:
22
+
23
+ [issue_title]
24
+ <short issue title>
25
+ [/issue_title]
8
26
 
9
27
  [issue_text]
10
- <issue title and body>
28
+ <issue body in Markdown, without repeating the title as a heading>
11
29
  [/issue_text]
12
30
 
13
31
  The issue should be concrete, scoped, and implementation-ready. Include acceptance criteria when they are useful.
@@ -0,0 +1,50 @@
1
+ Create an implementation plan for JSKIT session {{session_id}}.
2
+
3
+ GitHub issue: {{issue_url}}
4
+ Issue number: {{issue_number}}
5
+ Issue title: {{issue_title}}
6
+ Issue body file: {{issue_file}}
7
+ Issue title file: {{issue_title_file}}
8
+ Plan file to create: {{plan_file}}
9
+ Worktree: {{worktree}}
10
+
11
+ Read the issue and inspect the local app before planning. Use the issue files, package.json, .jskit metadata, config, packages, routes, generated references, package docs, and any saved app blueprint when available.
12
+
13
+ Start by identifying the app state and the implementation lane:
14
+
15
+ - empty, non_jskit_repo, partial_jskit_app, or jskit_app
16
+ - package install
17
+ - generator scaffolding
18
+ - custom local code
19
+ - a combination of those
20
+
21
+ Planning rules:
22
+
23
+ - Keep the plan scoped to the issue. Avoid "while I am here" work.
24
+ - Prefer vertical slices that produce visible or end-to-end progress.
25
+ - If the work is too broad to review confidently, split it into clear chunks.
26
+ - Make generator decisions concrete. Name the exact `jskit` commands to run when a generator or package install applies.
27
+ - For non-CRUD route page work, plan to check `jskit show ui-generator --details` and `jskit list-placements` before hand-writing pages or placement entries.
28
+ - For CRUD work, plan server ownership first. Name the `jskit generate crud-server-generator scaffold ...` command before any CRUD UI plan.
29
+ - For CRUD-owned tables, plan around the real database table shape. Do not plan a separate hand-written migration for a table that `crud-server-generator` will own.
30
+ - Every persisted app-owned table should have generated/package CRUD ownership unless there is a narrow explicit exception.
31
+ - Do not hand-build CRUD routes, CRUD endpoints, or CRUD page trees before the server CRUD package and shared resource file exist.
32
+ - `feature-server-generator` is for non-CRUD workflows and orchestration, not ordinary persisted entity tables.
33
+ - Keep runtime, UI, and data concerns separated.
34
+ - Keep direct knex exceptional and minimal. Prefer internal json-rest-api seams outside generated CRUD packages and explicit weird-custom feature lanes.
35
+ - For package-owned baseline workflows, plan to install and verify the baseline before inventing custom code around it.
36
+ - For user-facing UI, include Material/Vuetify quality expectations and a Playwright verification path.
37
+ - If login is required for UI verification, plan for a development-only auth bootstrap path instead of live external auth.
38
+ - Do not create or update the old `.jskit/WORKBOARD.md` workflow. JSKIT session state, receipts, issue text, plan file, transcript, and commits are the tracker.
39
+
40
+ If setup values are needed, ask plainly using exact env var or option names. For example: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST, DB_PORT, AUTH_SUPABASE_URL, AUTH_SUPABASE_PUBLISHABLE_KEY, APP_PUBLIC_URL.
41
+
42
+ If the issue is not clear enough to plan safely, ask the user concise follow-up questions first.
43
+
44
+ When the plan is ready, output only the final plan surrounded by these exact markers:
45
+
46
+ [plan]
47
+ <implementation plan in Markdown>
48
+ [/plan]
49
+
50
+ Keep the plan concrete and implementation-oriented. Include the likely files or areas to touch, ordered steps, generator commands to consider, review expectations, and checks that should be run.
@@ -12,4 +12,17 @@ Failure output:
12
12
 
13
13
  {{doctor_output}}
14
14
 
15
- Diagnose the failure and fix only what is required in this worktree. Do not push, open a PR, merge, or remove the worktree unless JSKIT Studio explicitly instructs it.
15
+ Diagnose the failure and fix only what is required in this worktree.
16
+
17
+ Check for:
18
+
19
+ - missing or wrong GitHub remote
20
+ - missing GitHub auth
21
+ - branch push failure
22
+ - PR body/title issue
23
+ - stale local git state
24
+ - rejected merge or failing required checks
25
+
26
+ Use repository-portable repairs only. Do not hard-code local paths or credentials. Do not create a parallel manual workflow around the JSKIT session.
27
+
28
+ Do not push, open a PR, merge, or remove the worktree unless JSKIT Studio or the JSKIT session step explicitly instructs it. Report root cause, changed files, commands run, and remaining risk.
@@ -1,22 +1,43 @@
1
- Review pass {{review_pass}} for session {{session_id}}.
2
-
3
- {{review_pass_note}}
1
+ Review changes for session {{session_id}}.
4
2
 
5
3
  Changed files from the latest commit:
6
4
 
7
5
  {{changed_files}}
8
6
 
9
- Check through the changed code and see if the changes are done without problems:
7
+ Review the committed changes and fix important issues in this worktree when the fix is clear and scoped.
8
+
9
+ Use four passes:
10
+
11
+ 1. Deslop review
12
+ - repeated functions or duplicated local helpers
13
+ - helpers reimplemented locally when a kernel/runtime seam already exists
14
+ - placeholder, fake-complete, or vague UI/copy/code structure
15
+ - dead code, unused props/imports, TODO-shaped gaps, or accidental abstractions
16
+ - missing loading, empty, error, permission, or ownership states
17
+ - broken flows, missing route wiring, missing migrations, or stale generated metadata
18
+ - surface or entity ownership mistakes: public, user, workspace, workspace_user
19
+ 2. JSKIT review
20
+ - existing helper/runtime seam available?
21
+ - should this have been a package install, generator step, or scaffold extension instead of hand code?
22
+ - if a generator existed, was the exact `jskit` command used or was the gap documented?
23
+ - for CRUD work, was `crud-server-generator scaffold` used before CRUD UI or CRUD route hand-coding?
24
+ - for CRUD-owned tables, did the change avoid a separate hand-written CRUD migration?
25
+ - does every live app-owned table have generated/package CRUD ownership or a narrow explicit exception?
26
+ - is direct app-owned knex usage limited to generated CRUD packages or explicit weird-custom feature lanes?
27
+ - are surface, route, ownership, package metadata, and migration choices aligned with JSKIT conventions?
28
+ 3. UI standards review
29
+ - user-facing screens follow Material Design and Vuetify best practices
30
+ - list screens have clear hierarchy, actions, density, empty states, and table/list patterns
31
+ - view and edit/new screens have clear grouping, labels, helper text, validation, spacing, and action placement
32
+ - responsive layout, loading, disabled, success, and error states are coherent
33
+ - improve weak screens before sign-off when the fix is scoped
34
+ 4. Verification review
35
+ - run the smallest relevant verification commands for the changed scope
36
+ - any changed user-facing UI should be exercised with Playwright when possible
37
+ - UI verification should normally be recorded through `jskit app verify-ui`
38
+ - if login is required, use the chosen local test-auth path instead of live external auth
39
+ - if there is no usable local auth bootstrap path, record it as a blocking testability gap
10
40
 
11
- - slop
12
- - repeated code
13
- - ownership issues
14
- - repeated helpers
15
- - fragmented functions
16
- - unnecessary complications
17
- - tricky code
18
- - missing tests
19
- - weak verification
20
- - JSKIT convention violations
41
+ Do not create commits, branches, pull requests, merges, or worktree cleanup yourself. JSKIT session owns those steps.
21
42
 
22
- Once you are done, provide a list ordered by priority, with a proposal on how to fix each important issue. If there are no important findings, say so explicitly and list any residual risk.
43
+ When finished, report findings ordered by severity, fixes made, changed files, checks run, and anything still unverified. If there are no important findings, say so explicitly and list residual risk.
@@ -1,9 +1,13 @@
1
- User check {{review_pass}} for session {{session_id}}.
1
+ User check for session {{session_id}}.
2
2
 
3
3
  The code should already be built or runnable according to the implementation instructions.
4
4
 
5
- Ask the user to test the changed behavior in the app and report whether it works as intended.
5
+ Ask the user to test the changed behavior in the app and report whether it works as intended. Be specific about the user-visible behavior, route, command, or workflow to inspect.
6
6
 
7
- If the user finds a problem, diagnose it and fix it in this worktree. If the behavior works, tell the user to run:
7
+ If the user finds a problem, diagnose the root cause and fix it in this worktree. Keep the fix scoped. Reuse JSKIT helpers, generated seams, and package workflows where they apply.
8
+
9
+ If the behavior works, tell the user to run:
8
10
 
9
11
  jskit session {{session_id}} step --user-check passed
12
+
13
+ Do not commit, push, create a PR, merge, or clean up the worktree yourself. JSKIT session owns those steps.