kritya 0.8.45-beta → 0.8.47-beta
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/README.md +52 -20
- package/dist/agent/systemPrompt.js +3 -3
- package/dist/agent/workflow.js +492 -12
- package/dist/commands/registry.js +400 -44
- package/dist/headless.js +34 -0
- package/dist/ui/App.js +68 -14
- package/dist/ui/SelectList.js +30 -4
- package/dist/ui/StatusLine.js +2 -1
- package/dist/ui/useAgent.js +52 -8
- package/dist/ui/windowList.js +100 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,8 @@ autonomously looping until your request is done. Anything that mutates state
|
|
|
44
44
|
confining writes to the workspace; falls back to unsandboxed (with a
|
|
45
45
|
warning) if the sandbox binary isn't installed
|
|
46
46
|
- **Staged project workflow** — `/flow-brainstorm → spec → plan → build →
|
|
47
|
-
review → fix` for building something new end-to-end
|
|
47
|
+
review → fix → ship` for building something new end-to-end, with parked
|
|
48
|
+
projects you can pick up again later
|
|
48
49
|
- **MCP + Agent Plugins support** — extend with external tools/servers, each
|
|
49
50
|
individually trust-gated
|
|
50
51
|
- **Undo/redo/checkpoints** — revert or rewind file changes and conversation
|
|
@@ -166,8 +167,11 @@ In-session commands (type `/` to see them with autocomplete; letters filter the
|
|
|
166
167
|
| `/flow-build` | project workflow: implement the plan, with tests |
|
|
167
168
|
| `/flow-review` | project workflow: spec-compliance and security review of the build |
|
|
168
169
|
| `/flow-fix` | project workflow: fix the review's findings, each one re-verified |
|
|
170
|
+
| `/flow-ship` | project workflow: hand over the finished project, with the test suite actually run |
|
|
171
|
+
| `/flow` | continue the workflow from wherever the project stands |
|
|
172
|
+
| `/flow-back <phase>` | rewind to a phase and re-run everything after it (bounded — see below) |
|
|
169
173
|
| `/plan` | toggle plan mode: `/plan`, `/plan on`, `/plan off` (unrelated to `/flow-plan`) |
|
|
170
|
-
| `/project` | workflow status; `goto <phase>`, `rename <name>`, `clear`
|
|
174
|
+
| `/project` | workflow status; `list`, `resume <name>`, `goto <phase>`, `rename <name>`, `clear` |
|
|
171
175
|
| `/diff` | show the cumulative git diff of this session's changes |
|
|
172
176
|
| `/init` | scan the repo and generate a `KRITYA.md` project-memory file |
|
|
173
177
|
| `/commit` | have the agent review, stage, and commit the current git changes |
|
|
@@ -202,9 +206,9 @@ checkpoints). `Ctrl+K` is the kill switch (see below). `Ctrl+C` exits.
|
|
|
202
206
|
|
|
203
207
|
- **Staged new-project workflow** — ask kritya to build something new (a
|
|
204
208
|
FastAPI backend, a Next.js frontend, a CLI) and it doesn't dive straight into
|
|
205
|
-
code. It runs
|
|
206
|
-
— writing a durable artifact for each under `docs/<name>/` and
|
|
207
|
-
your approval between phases:
|
|
209
|
+
code. It runs seven phases — **brainstorm → spec → plan → build → review →
|
|
210
|
+
fix → ship** — writing a durable artifact for each under `docs/<name>/` and
|
|
211
|
+
stopping for your approval between phases:
|
|
208
212
|
|
|
209
213
|
| Phase | Produces |
|
|
210
214
|
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -214,35 +218,63 @@ checkpoints). `Ctrl+K` is the kill switch (see below). `Ctrl+C` exits.
|
|
|
214
218
|
| `build` | the code, with tests written before the code they test, plus negative/failure-path tests for security/reliability-tagged milestones, and a live milestone checklist |
|
|
215
219
|
| `review` | `review.md` — a one-line scorecard, then spec-compliance, security, and reliability findings |
|
|
216
220
|
| `fix` | `fix.md` — the review's findings addressed and re-verified |
|
|
221
|
+
| `ship` | `ship.md` — a handover summary, the test suite actually run, and an optional commit |
|
|
217
222
|
|
|
218
223
|
Spec comes before plan on purpose: the spec settles _what_ (and pins the
|
|
219
224
|
numbered acceptance criteria everything downstream is held to), the plan
|
|
220
225
|
settles _how_ and sequences milestones against those criteria. Each phase
|
|
221
226
|
reads only the artifact immediately before it, so nothing gets re-derived.
|
|
222
|
-
The
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
227
|
+
The agent walks the phases on its own, or you drive them by hand with
|
|
228
|
+
`/flow-brainstorm <idea>`, `/flow-spec`, `/flow-plan`, `/flow-build`,
|
|
229
|
+
`/flow-review`, `/flow-fix`, `/flow-ship` — and after each one kritya tells
|
|
230
|
+
you which command comes next, so the handoff doesn't depend on the model
|
|
231
|
+
remembering to say it.
|
|
232
|
+
|
|
233
|
+
**Where it stops is a policy, not a property of the phase list.** It hands
|
|
234
|
+
back for approval after brainstorm, spec and plan — the phases where changing
|
|
235
|
+
course is still cheap — then runs build through ship as one stretch, because
|
|
236
|
+
by then the work is already done and "shall I now review what I just built?"
|
|
237
|
+
adds a round trip without adding a decision. `/flow` continues from wherever
|
|
238
|
+
the project stands; `--auto` runs the rest without stopping, `--until <phase>`
|
|
239
|
+
stops at a named phase, and `--fast` merges brainstorm and spec into one
|
|
240
|
+
stretch. A phase refuses to run if the artifact it reads was never written
|
|
241
|
+
(`--force` overrides). `/flow-fix` only fixes what review found; if anything
|
|
242
|
+
is still open afterward it tells you to run `/flow-review` again, `/flow-fix`
|
|
243
|
+
again, or `/flow-back <phase>` if the finding is really a problem with the
|
|
244
|
+
requirement — that rewinds to a phase and re-runs everything after it, bounded
|
|
245
|
+
at two passes so a disagreement the model can't resolve can't spend forever.
|
|
246
|
+
|
|
247
|
+
**Parking a project keeps its phase.** Starting a second project used to
|
|
248
|
+
overwrite the first's place in the flow, because `.kritya/project.json` only
|
|
249
|
+
ever holds the active one. A registry at `.kritya/projects.json` now keeps
|
|
250
|
+
every project the workspace has run, so `/project list` shows them all and
|
|
251
|
+
`/project resume <name>` picks one up exactly where it stopped — phase,
|
|
252
|
+
loop-back budget and all. `/project clear` ends the active workflow but parks
|
|
253
|
+
rather than forgets it, and a new `/flow-brainstorm` names the way back.
|
|
254
|
+
|
|
255
|
+
**A gate doesn't cost you a file read.** Each phase records a one-line
|
|
256
|
+
scorecard, so `/project` shows what every phase concluded ("6 ACs, 2 MUST")
|
|
257
|
+
instead of just a generic description — you can judge whether to approve
|
|
258
|
+
without opening anything. When a project is active, launch names its phase,
|
|
259
|
+
and after a gated phase `/flow` is prefilled into the input line: Enter
|
|
260
|
+
continues, Esc (or any edit) discards it. The gate still holds — nothing runs
|
|
261
|
+
until you submit.
|
|
262
|
+
|
|
263
|
+
While a workflow is active the statusline carries a `⚑ name N/7 phase` flag
|
|
264
|
+
and the spinner names the running phase. `/project` shows the full picture,
|
|
265
|
+
including a warning if an earlier artifact was edited after a later one
|
|
266
|
+
already depended on it.
|
|
235
267
|
|
|
236
268
|
The project is named from your idea unless you name it yourself with a short
|
|
237
269
|
prefix — `/flow-brainstorm reverser: a script that reverses a string` gives
|
|
238
270
|
you `docs/reverser/`. `/project rename <name>` moves an existing one.
|
|
239
271
|
|
|
240
|
-
Cost matters here —
|
|
272
|
+
Cost matters here — seven phases in one session adds up — so kritya compacts
|
|
241
273
|
the conversation at each phase boundary (the artifact is on disk, so the
|
|
242
274
|
transcript that produced it is redundant), caps artifact length, and in the
|
|
243
275
|
build phase dispatches independent milestones to isolated write subagents
|
|
244
276
|
rather than pulling every file into the main context. The review phase runs
|
|
245
|
-
its
|
|
277
|
+
its three reviewers as read-only subagents, so only their findings come back;
|
|
246
278
|
the fix phase does the same to re-verify only what it changed.
|
|
247
279
|
|
|
248
280
|
In the plan phase, plan mode's read-only guard is relaxed just enough to let
|
|
@@ -3,7 +3,7 @@ import os from "node:os";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { gitStatusShort } from "../git/git.js";
|
|
5
5
|
import { buildSkillsSection, defaultExtraSkillRoots } from "./skills.js";
|
|
6
|
-
import { artifactPath, loadProjectState, PHASE_COMMAND, PHASE_ORDER, PHASE_SUMMARY, } from "./workflow.js";
|
|
6
|
+
import { artifactPath, BACK_COMMAND, DEFAULT_GATES, loadProjectState, PHASE_COMMAND, PHASE_ORDER, PHASE_SUMMARY, } from "./workflow.js";
|
|
7
7
|
const MEMORY_FILES = ["KRITYA.md"];
|
|
8
8
|
const MEMORY_MAX_CHARS = 4000;
|
|
9
9
|
/**
|
|
@@ -103,13 +103,13 @@ You help with software engineering tasks: writing code, fixing bugs, explaining
|
|
|
103
103
|
- You are rendering into a terminal: prefer bullets to tables, keep any table to 3 columns or fewer with short cells, and never use <br> or other HTML inside them.
|
|
104
104
|
|
|
105
105
|
# Project workflow (new projects)
|
|
106
|
-
When the user asks to create a NEW project or app (a FastAPI backend, a Next.js frontend, a CLI, etc.), do not jump straight to code. Run this ${PHASE_ORDER.length}-phase workflow, writing a durable artifact for each phase
|
|
106
|
+
When the user asks to create a NEW project or app (a FastAPI backend, a Next.js frontend, a CLI, etc.), do not jump straight to code. Run this ${PHASE_ORDER.length}-phase workflow, writing a durable artifact for each phase:
|
|
107
107
|
${PHASE_ORDER.map((p, i) => {
|
|
108
108
|
const artifact = artifactPath("<name>", p) ?? "the application code";
|
|
109
109
|
return ` ${i + 1}. ${p.padEnd(11)}-> ${artifact.padEnd(28)}(${PHASE_SUMMARY[p]})`;
|
|
110
110
|
}).join("\n")}
|
|
111
111
|
Each phase reads the artifact immediately before it and does not redo that phase's work: the spec owns requirements, contracts and numbered acceptance criteria; the plan owns architecture and the milestone order, citing criteria by number rather than restating them. Keep artifacts dense — every later phase pays to read them.
|
|
112
|
-
Track state in .kritya/project.json ({ "name", "phase", "updatedAt" }): read it at the start of a turn to resume at the right phase, and update "phase" (with write_file) when you advance.
|
|
112
|
+
Track state in .kritya/project.json ({ "name", "phase", "updatedAt", "summaries" }): read it at the start of a turn to resume at the right phase, and update "phase" (with write_file) when you advance. When a phase finishes, add a one-line scorecard for it under "summaries" (keyed by phase name, e.g. "6 ACs, 2 MUST") so /project can show what each phase concluded without the user opening the file — read the file, set the one key, and write it back with every other key unchanged. Stop and ask the user to approve after ${DEFAULT_GATES.join(", ")} — those are the phases where changing course is still cheap. From build onward the run continues without asking, so carry straight on through the phases the command asked for. The user may also drive phases manually with ${PHASE_ORDER.map((p) => PHASE_COMMAND[p]).join(", ")}; when they do, that command sets the phase for you. If a finding cannot be fixed because the requirement or the design is wrong rather than the code, add a "revisit" field ({ "to": "spec" or "plan", "reason": "<one line>" }) instead of working around it, and tell the user to run ${BACK_COMMAND}.
|
|
113
113
|
${memory}${buildSkillsSection(workspace, defaultExtraSkillRoots(workspace, trustWorkspace), trustWorkspace)}
|
|
114
114
|
# Environment
|
|
115
115
|
- OS: ${os.platform()} (${os.release()})
|