@skein-code/cli 0.2.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.
@@ -0,0 +1,330 @@
1
+ # Skein Next Steps
2
+
3
+ This document is the handoff point for the next development conversation. It
4
+ describes the current shipped baseline and the smallest high-value sequence of
5
+ work that should follow it. Do not redo the baseline hardening before taking on
6
+ one of the milestones below.
7
+
8
+ ## Current Baseline
9
+
10
+ - Product name: `Skein`; primary executable: `skein`.
11
+ - Compatibility executables: `mosaic` and `mosaic-code`.
12
+ - Current release: `0.2.0`.
13
+ - Runtime requirement: Node.js `>=22.16.0` (the runtime uses unflagged
14
+ `node:sqlite` with FTS5, and current CLI/build dependencies require this
15
+ Node 22 baseline).
16
+ - Retrieval: local BM25/path/symbol index with automatic ContextEngine-plugin
17
+ detection and fallback.
18
+ - Agent: provider-agnostic multi-turn runner for OpenAI, Anthropic, Gemini, and
19
+ OpenAI-compatible endpoints; built-in tools, permissions, checkpoints,
20
+ workflows, Skills, MCP, expert profiles, sessions, and memory are present.
21
+ - UI: real Ink/React terminal UI, not a browser prototype. It supports prompt
22
+ history, `@file` completion, command completion, multiline editing, queued
23
+ follow-ups, live context inspection, permission approval, themes, ASCII mode,
24
+ `NO_COLOR`, and narrow-height degradation.
25
+ - Storage: sessions, checkpoints, local index, and project configuration still
26
+ use `.mosaic/` paths for compatibility. `SKEIN_*` environment variables are
27
+ preferred, while `MOSAIC_*` aliases remain supported.
28
+
29
+ ## Verified Release Contract
30
+
31
+ Run these commands from the repository root before changing release behavior:
32
+
33
+ ```bash
34
+ npm ci
35
+ npm run check
36
+ npm run test:pty
37
+ npm audit --omit=dev
38
+ npm pack
39
+ ```
40
+
41
+ The latest verified package was `skein-code-cli-0.2.0.tgz`. The verifier writes
42
+ its SHA-256 to `artifacts/package/skein-code-cli-0.2.0.tgz.sha256`, and CI
43
+ retains the checksum beside the package metadata. The checksum is deliberately
44
+ not copied into this packaged document because doing so would change the
45
+ archive it describes.
46
+
47
+ The final verification included a fresh install and real PTY interaction for
48
+ all three executable aliases, `/about`, a permission prompt, denial, and clean
49
+ Ctrl+C exit. PTY coverage included 20, 24 ASCII, 40, 80, 120 columns and a
50
+ 40x10 short-height case. The current suite contains 31 test files and 252 tests.
51
+
52
+ ## Recommended Order
53
+
54
+ ### P0: Continuous Integration And Release Reproducibility (Branch Rule Pending)
55
+
56
+ `.github/workflows/ci.yml` now covers Node 22 on macOS and Linux. It runs
57
+ typecheck, unit tests, build, smoke, the PTY suite when `expect` is available,
58
+ audit, and an isolated `npm pack` install. The release workflow records the
59
+ package checksum and verifies all three bin aliases.
60
+
61
+ Definition of done:
62
+
63
+ - Pull requests cannot merge with a failing `npm run check`.
64
+ - A clean checkout can reproduce the package without local `dist/` or
65
+ `.mosaic/` state.
66
+ - CI logs retain the PTY dimensions and package metadata.
67
+
68
+ Implementation notes:
69
+
70
+ - `.github/workflows/ci.yml` runs the Node 22 contract on Linux and macOS and
71
+ exposes a stable `check` status for branch protection.
72
+ - `.github/workflows/release.yml` rebuilds tagged or manually dispatched
73
+ packages, verifies tag/version agreement, and retains the tarball plus its
74
+ SHA-256 checksum.
75
+ - `npm run release:verify` reproduces the package from source, installs it into
76
+ an isolated prefix, rejects packaged local state, and exercises `skein`,
77
+ `mosaic`, and `mosaic-code`.
78
+ - Configure the `main` branch rule to require the `check` status after the
79
+ workflow is present on GitHub.
80
+
81
+ ### P1: Skein Storage Namespace And Migration
82
+
83
+ The product is branded Skein but durable paths are still named `.mosaic`.
84
+ Design a backward-compatible migration rather than renaming blindly:
85
+
86
+ 1. Define the canonical future paths (`.skein/` and `SKEIN_HOME`).
87
+ 2. Detect existing `.mosaic` state and show the source and destination before
88
+ copying.
89
+ 3. Migrate config, sessions, checkpoints, indexes, themes, and memory metadata
90
+ atomically with a manifest and rollback path.
91
+ 4. Continue reading old `MOSAIC_*` variables and old paths for at least one
92
+ compatibility release.
93
+
94
+ Definition of done:
95
+
96
+ - Migration is idempotent and tested against interrupted copies.
97
+ - No session, checkpoint, or memory record is lost.
98
+ - `skein doctor` reports the active namespace and migration status.
99
+
100
+ Implementation progress:
101
+
102
+ - `src/utils/namespace.ts` now resolves canonical `.skein` and legacy `.mosaic`
103
+ project namespaces, with `SKEIN_HOME`/`MOSAIC_HOME` compatibility.
104
+ - `skein doctor --json` includes a hash-bearing read-only migration manifest;
105
+ `skein migrate` previews it and `skein migrate --yes` performs an atomic
106
+ temporary-directory copy while retaining `.mosaic` as the rollback source.
107
+ - Sessions, checkpoints, local indexes, memory, themes, Skills, rules, and
108
+ agent profiles follow the active namespace. Both namespace names are ignored
109
+ by retrieval and file tools.
110
+ - Conflict and symlink entries block migration; repeated migration is
111
+ idempotent.
112
+ - `skein migrate --rollback` now performs a read-only verification preview;
113
+ `--rollback --yes` atomically moves the canonical namespace aside, verifies
114
+ it again, and removes it only when the legacy source, canonical files, and
115
+ migration manifest still match. Changed, missing, extra, partial, symlink,
116
+ and non-directory state blocks rollback.
117
+ - `skein migrate --home` applies the same preview, migration, and rollback
118
+ contract to user-level state. `skein doctor` reports project and user
119
+ namespace status independently.
120
+ - `skein migrate --recover` detects interrupted `.migrating-*` and
121
+ `.rollback-*` directories. It resumes or restores a single complete verified
122
+ snapshot, removes only partial data proven redundant with legacy state, and
123
+ blocks changed or ambiguous candidates. Recovery is preview-only until
124
+ `--yes`; `--home` covers user-level state and `doctor` surfaces pending
125
+ recovery. Normal CLI lifecycles and managed session, checkpoint, team-run,
126
+ index, project-config, and default memory writes hold shared cross-process
127
+ leases; migration, rollback, and recovery require an exclusive lease. SQLite
128
+ rollback-journal locks permit concurrent shared holders and are released by
129
+ the operating system immediately after a crash. Cached legacy store paths are
130
+ rejected after migration, and real child-process tests cover contention and
131
+ `SIGKILL` cleanup. Overlapping custom source/destination paths are rejected
132
+ before copying.
133
+ - The `.mosaic` compatibility window is now an explicit, versioned lifecycle:
134
+ `legacyCompatibilityStatus()` reports the phase (`active` in 0.2.0,
135
+ `deprecated` in 0.3.0, `pending-removal` in 0.4.0, `removed` in 0.5.0),
136
+ whether legacy paths and `MOSAIC_*` variables are still in use, and the
137
+ concrete paths involved. `skein doctor` surfaces this as `legacyCompatibility`
138
+ so users see the removal timeline before aliases disappear.
139
+
140
+ ### P1: ContextEngine-Plugin Production Adapter
141
+
142
+ Exercise the adapter against a real ContextEngine-plugin fixture, not only the
143
+ local fallback. Cover capability negotiation, index progress, search/context
144
+ packing, unavailable PostgreSQL/pgvector, stale indexes, multi-root workspaces,
145
+ and a useful degraded-mode explanation in the TUI and headless output.
146
+
147
+ Definition of done:
148
+
149
+ - `auto` selects the external engine only when its health contract is valid.
150
+ - A failed external query falls back without losing the user request.
151
+ - Results preserve source paths, symbols, line ranges, scores, and token caps.
152
+ - An integration fixture runs in CI without requiring a developer database.
153
+
154
+ Implementation progress:
155
+
156
+ - `auto` now negotiates the real 0.4 CLI boundary using `--version`, required
157
+ help flags, exit behavior, and strict required response fields. Capability
158
+ probes are coalesced, cached for ten seconds after completion, refreshable,
159
+ and recover when an executable is installed while Skein is running.
160
+ - Compatible but unindexed workspaces use ContextEngine only for `index`;
161
+ `search` and `context` fall back locally. Explicit `contextengine` mode makes
162
+ missing, incompatible, unhealthy, and unindexed states hard failures, and
163
+ `doctor` treats that explicit requirement as required.
164
+ - External index progress is parsed from the current CR/ANSI human stream and
165
+ finalized only after the JSON result validates. Multi-root aliases use
166
+ `main`, `workspace2`, and later numbered roots; single-root directories with
167
+ those literal names remain ordinary paths.
168
+ - Search/context hits are schema-checked, realpath-bound, hash-checked, and
169
+ compared with current file lines. A stale or invalid hit rejects the entire
170
+ external response; empty auto-mode results are cross-checked locally so new
171
+ files are not missed. Synthetic commit-lineage hits are reconstructed with a
172
+ constrained read-only Git command. Skein ignores external `packedText` and
173
+ repacks verified current-file or commit-summary bytes under its own top-K and
174
+ token limits.
175
+ - External processes use a private temporary working directory and a minimal
176
+ `CONTEXTENGINE_*`/proxy/certificate environment. Repository `.env` files and
177
+ generic chat-model credentials are not inherited. External failures and
178
+ unknown index fields are redacted or stripped before reaching output.
179
+ - Structured degradation now reaches the TUI, headless text/final JSON,
180
+ `skein search/context`, and `doctor`; narrow TUI layouts show a separate
181
+ fallback reason and remediation row.
182
+ - `test/fixtures/contextengine-cli.mjs` is a faithful CLI-boundary fixture, not
183
+ an embedded fake database. It covers unavailable PostgreSQL/pgvector,
184
+ unindexed and malformed contracts, stale/current/empty hits, commit-lineage
185
+ verification, multi-root mapping, oversized progress, credential redaction,
186
+ cache recovery, and degraded channels without requiring PostgreSQL in CI.
187
+
188
+ ### P1: Multi-Agent Scheduler And Team UX
189
+
190
+ Harden the existing expert delegation into an explicit observable scheduler:
191
+
192
+ - opt-in per-agent token, tool, and time policies;
193
+ - cancellation and timeout propagation;
194
+ - permission inheritance and independent audit trails;
195
+ - deterministic aggregation and conflict reporting;
196
+ - visible active-agent, queued-agent, and failed-agent states in the TUI;
197
+ - no concurrent mutation of the same session or workspace without a checkpoint
198
+ boundary.
199
+
200
+ Definition of done:
201
+
202
+ - Two read-only experts can run concurrently and aggregate deterministically.
203
+ - Mutating work is serialized or isolated and always remains reversible.
204
+ - Interrupting the parent reliably stops child work and clears queued work.
205
+
206
+ Implementation progress:
207
+
208
+ - `team_run` now routes read-only profiles to independently configured models,
209
+ shares bounded reports with a reviewer, and supports a capped revision loop.
210
+ - `/team <objective>` launches the flow from the TUI. Wide terminals render a
211
+ picture-in-picture Team Cockpit; narrow terminals use the normal timeline.
212
+ - Project-owned model routes are stripped until config trust is explicit, and
213
+ credentials are referenced by environment-variable name rather than stored.
214
+ - Routes may also select installed `codex`, `claude`, or `grok` runtimes. They
215
+ run without a shell in read-only/plan mode and feed normalized reports into
216
+ the same cockpit and reviewer loop.
217
+ - Team runs now persist a local manifest plus content-addressed reports and
218
+ peer handoffs. `skein agents runs/show/delete` provides recovery and audit
219
+ access; `agents.persistBoard=false` disables this for privacy-sensitive runs.
220
+ - Team Cockpit now renders safe observable telemetry—phase, active tool, token
221
+ usage, tool count, timeout/budget state, and final report—without exposing
222
+ hidden model chain-of-thought.
223
+ - `Ctrl+T` and `/workbench` now open an interactive Team Workbench with Agents,
224
+ Tasks, and Messages views, keyboard navigation, selected-agent report
225
+ expansion, run summary, and persistent soft-budget alerts. The focused view
226
+ degrades to the full available width on narrow terminals.
227
+ - Running Agents can now receive an explicit stop or retry request from the
228
+ Workbench. A retry creates a new attempt linked by `retryOf`, preserves the
229
+ stopped attempt in telemetry, and feeds only the fresh result into the
230
+ caller's aggregation. Completed attempts remain immutable until the next
231
+ report-inspection increment.
232
+ - Named `agents.connections` now let API routes share one provider, base URL,
233
+ and credential environment-variable reference. This supports the common
234
+ relay/gateway case where one key grants access to many model families while
235
+ keeping subscription-backed official CLIs on their own login path.
236
+ - `skein agents connections` and `/connections` expose redacted connection
237
+ status and route counts. Repository-owned connections are stripped until
238
+ project config is trusted, just like direct model routes.
239
+ - `skein agents models <connection>` can query a compatible/OpenAI connection's
240
+ standard `/models` endpoint, giving users model IDs without trial-and-error
241
+ configuration. The command is read-only and does not persist the catalog.
242
+ - Team routing now supports `agents.defaultConnection` and optional
243
+ `agents.defaultModel`. Most users configure one shared gateway once; profile
244
+ routes only contain model or provider overrides when needed. CLI and TUI
245
+ surfaces label inherited versus overridden routes, and unknown defaults fail
246
+ validation before any agent starts.
247
+ - `skein agents setup` now provides a guided user-level setup for a shared
248
+ connection and default model, with a non-interactive provisioning form. The
249
+ wizard stores only credential environment-variable names and preserves other
250
+ user configuration.
251
+ - Team budgets default to `observe`: telemetry is retained, but configured
252
+ thresholds do not warn or terminate work. `guard` adds non-blocking threshold
253
+ warnings, while `strict` is an explicit hard-stop policy for controlled jobs.
254
+ - Task budget policy is separate from the provider context window and Skein's
255
+ session compaction boundary. The latter remains a technical context limit,
256
+ not a default product ceiling for large tasks.
257
+ - The scheduler now emits `agent_queued` and `agent_cancelled` events so queued,
258
+ running, cancelled, and completed specialists are all observable. A parent
259
+ cancellation or upstream timeout clears queued work and records the reason on
260
+ each cleared agent. The council reviewer emits a required `CONFLICTS` field
261
+ that is parsed into a structured conflict report and surfaced in the returned
262
+ team summary. The TUI Team Cockpit and Workbench render the queued and
263
+ cancelled states with distinct glyphs, colors, and the cancellation reason.
264
+ - See `docs/MULTI_MODEL_TEAMS.md`. Writer worktrees, persistent blackboard
265
+ artifacts, cost controls, Gemini CLI, and optional tmux/iTerm pane hosts remain
266
+ next.
267
+
268
+ ### P2: MCP, Skills, And Workflow Trust UX
269
+
270
+ Add a first-run catalog and inspection flow for bundled capabilities. Keep
271
+ installation explicit and reviewable: show source, requested tools, filesystem
272
+ scope, network scope, and trust state before activation. Add fixture servers and
273
+ Skills that exercise timeout, malformed schema, disconnect, and version drift.
274
+
275
+ ### P2: Memory Quality And User Control
276
+
277
+ Keep SQLite as the default durable engine. Improve the lifecycle around the
278
+ already separated short-term working memory and durable records:
279
+
280
+ - explicit consolidation from a completed session;
281
+ - confidence decay, expiry, supersession, and provenance display;
282
+ - workspace/user/session scopes with retrieval explanations;
283
+ - export, delete-all, and privacy review commands;
284
+ - bounded retrieval under the model token budget.
285
+
286
+ Never promote model-inferred facts directly into durable memory without the
287
+ existing candidate/approval path.
288
+
289
+ ### P2: Terminal Accessibility And Visual Regression
290
+
291
+ Keep the current restrained graphite/cinder/mono theme system and add actual
292
+ final-frame regression tests for widths 20-160 and heights 8-60. Include CJK,
293
+ wide emoji, screen-reader mode, `TERM=dumb`, `NO_COLOR`, ASCII glyph mode,
294
+ permission panels, multiline composer, history search, and active palettes.
295
+ Use a terminal emulator fixture where raw ANSI logs cannot prove what remains
296
+ visible in the final frame.
297
+
298
+ ### P3: Distribution
299
+
300
+ After CI and migration stabilize, publish the scoped npm package, document
301
+ upgrade/migration behavior, and add platform install options only if they can
302
+ reuse the same signed artifact. Keep `mosaic` aliases until a measured
303
+ deprecation window is complete.
304
+
305
+ ## Useful Entry Points
306
+
307
+ - `src/ui/tui.tsx` — interactive state, queueing, height budgeting, and key
308
+ handling.
309
+ - `src/ui/components.tsx` — terminal presentation, glyphs, sanitization, and
310
+ responsive panels.
311
+ - `src/agent/runner.ts` — model/tool loop, context events, verification, and
312
+ delegation boundaries.
313
+ - `src/context/context-engine.ts` — external/local retrieval selection.
314
+ - `src/context/local-index.ts` — offline fallback index.
315
+ - `src/mcp/manager.ts` — MCP lifecycle and tool registration.
316
+ - `src/skills/catalog.ts` — Skills discovery and activation.
317
+ - `src/memory/store.ts` and `src/tools/working-memory.ts` — durable and
318
+ short-term memory layers.
319
+ - `src/tools/permissions.ts` — policy evaluation and scoped approvals.
320
+ - `test/ui-tui-integration.test.tsx`, `test/ui-safety.test.tsx`, and
321
+ `test/pty/` — current interaction and terminal regression coverage.
322
+
323
+ ## Suggested Next Conversation Opening
324
+
325
+ Start with: “Implement the first worktree-isolated writer lane from the P1
326
+ multi-agent scheduler milestone. Preserve the current read-only council and
327
+ review gate, serialize integration into the main workspace, and prove cancel,
328
+ conflict, checkpoint, and rollback behavior before enabling parallel
329
+ mutation.” Then inspect the scheduler, team-run persistence, permissions, and
330
+ namespace lease boundaries before changing runtime behavior.
@@ -0,0 +1,113 @@
1
+ # Skein product brief
2
+
3
+ Research snapshot: 2026-07-20
4
+
5
+ ## Positioning
6
+
7
+ Skein is an open, context-first coding agent for the terminal. It combines a
8
+ polished interactive workspace with a scriptable CLI, but keeps model choice,
9
+ source code, retrieval, permissions, sessions, and checkpoints under the user's
10
+ control.
11
+
12
+ The product is designed around one promise:
13
+
14
+ > Understand the change surface before editing, show every consequential action,
15
+ > and make the entire run reproducible or reversible.
16
+
17
+ ## What we learned from the market
18
+
19
+ ### Auggie
20
+
21
+ Auggie establishes the baseline for a modern terminal agent: automatic workspace
22
+ indexing, a full-screen interactive mode, print/quiet automation, resumable
23
+ sessions, prompt enhancement, tasks, permissions, custom commands, plugins, MCP,
24
+ and multiple workspaces.
25
+
26
+ Sources:
27
+
28
+ - [Auggie overview](https://docs.augmentcode.com/cli/overview)
29
+ - [Auggie CLI reference](https://docs.augmentcode.com/cli/reference)
30
+ - [Auggie interactive mode](https://docs.augmentcode.com/cli/interactive)
31
+ - [Auggie product page](https://www.augmentcode.com/product/cli)
32
+
33
+ The opportunity is not a larger flag list. It is a more trustworthy ownership
34
+ model: unrestricted local automation, provider portability, visible context,
35
+ offline retrieval, inspectable state, and first-class rollback.
36
+
37
+ ### Gemini CLI
38
+
39
+ Gemini CLI shows that checkpoints and sandboxing are product features rather
40
+ than implementation details. Its checkpoint design stores project and
41
+ conversation state before edits; its CLI also supports text, JSON, and streaming
42
+ JSON output.
43
+
44
+ Sources:
45
+
46
+ - [Checkpointing](https://geminicli.com/docs/cli/checkpointing/)
47
+ - [Sandboxing](https://geminicli.com/docs/cli/sandbox/)
48
+ - [CLI reference](https://geminicli.com/docs/cli/cli-reference/)
49
+
50
+ ### ContextEngine-plugin
51
+
52
+ ContextEngine-plugin provides the strongest open integration path for code
53
+ retrieval: PostgreSQL FTS, symbols, paths, optional pgvector embeddings, graph
54
+ expansion, reranking, and token-budgeted MMR packing. Its CLI contract maps well
55
+ to an agent: `index`, `search`, `context`, and `status`.
56
+
57
+ Sources:
58
+
59
+ - [ContextEngine-plugin](https://github.com/lixiang12345/ContextEngine-plugin)
60
+ - [Architecture](https://github.com/lixiang12345/ContextEngine-plugin/blob/main/ARCHITECTURE.md)
61
+ - [Comparison with Augment](https://github.com/lixiang12345/ContextEngine-plugin/blob/main/COMPARISON.md)
62
+
63
+ ## Product principles
64
+
65
+ 1. **Context before tools.** Every task begins with retrieval and explicit file
66
+ mentions are merged into the evidence packet.
67
+ 2. **Open by default.** Headless automation is a core feature, not an enterprise
68
+ entitlement.
69
+ 3. **Local first, not local only.** The built-in index works without a service;
70
+ ContextEngine is selected automatically when installed.
71
+ 4. **Bring your own model.** OpenAI, Anthropic, Gemini, and OpenAI-compatible
72
+ endpoints share one agent contract.
73
+ 5. **Trust is visible.** Tool intent, permission category, result, changed files,
74
+ token use, and tasks are shown in the terminal and stored in the session.
75
+ 6. **Risky work is reversible.** A checkpoint is created before mutation and can
76
+ be inspected or restored independently of the project's Git history.
77
+ 7. **Terminal native.** Interactive use is calm and legible; non-interactive use
78
+ has deterministic text and JSON contracts.
79
+
80
+ ## V1 capability map
81
+
82
+ | Surface | Capability |
83
+ |---|---|
84
+ | Context | ContextEngine adapter, built-in BM25/path/symbol index, token packing, multi-root, `@file` mentions |
85
+ | Models | OpenAI, Anthropic, Gemini, OpenAI-compatible endpoints |
86
+ | Agent | Multi-turn tool loop, task plan, automatic verification, ask-only mode |
87
+ | Tools | Read, list, search, write, patch, shell, Git, context search, task updates |
88
+ | Trust | Workspace path boundary, allow/ask/deny policy, command rules, hooks, checkpoints |
89
+ | Sessions | Local persistence, resume/latest, list/show/delete/export |
90
+ | UX | Ink TUI, action timeline, context telemetry, plan rail, inline permission band, interruption |
91
+ | Automation | Prompt/stdin input, queue, quiet mode, JSON and JSONL event output, exit codes |
92
+ | Operations | Init, doctor, config, index/search/context/status, checkpoint management |
93
+
94
+ ## Differentiation
95
+
96
+ Skein is not claiming that an open lexical fallback beats a proprietary
97
+ retrieval model on every huge monorepo. Its advantage is the complete ownership
98
+ and trust envelope around the agent:
99
+
100
+ - users can start offline and upgrade retrieval without changing the agent;
101
+ - the same run works with four provider families;
102
+ - automation, structured output, and stored sessions are available locally;
103
+ - checkpoints and permission decisions are part of the core runtime;
104
+ - every subsystem is replaceable and auditable TypeScript.
105
+
106
+ The runtime treats provider usage as a hard session budget. It estimates usage
107
+ when a compatible endpoint omits token counters, clamps the provider output
108
+ allowance to the remaining budget, and records skipped tool calls rather than
109
+ leaving an incomplete assistant/tool message pair.
110
+
111
+ That makes Skein particularly strong for individual developers, regulated
112
+ teams, self-hosted environments, and tooling groups building their own agent
113
+ workflows.
@@ -0,0 +1,68 @@
1
+ # Skein Product Benchmark
2
+
3
+ This is a capability and workflow comparison, not a claim that products use
4
+ the same models or pricing. It was reviewed on 2026-07-22 against public
5
+ product documentation.
6
+
7
+ ## Positioning
8
+
9
+ Skein's strongest differentiators are provider independence, local-first
10
+ storage, an auditable permission/checkpoint model, reviewable durable memory,
11
+ and a real terminal UI that remains usable in narrow terminals. The product
12
+ already has more safety and context plumbing than a thin model wrapper.
13
+
14
+ The main opportunity is workflow clarity. Mainstream agents make the path from
15
+ "understand" to "plan" to "execute" to "review" explicit, and they expose
16
+ parallel work, code intelligence, trust boundaries, and sharing as first-class
17
+ product surfaces.
18
+
19
+ ## Evidence-Based Comparison
20
+
21
+ | Area | Mainstream signal | Skein today | Product implication |
22
+ | --- | --- | --- | --- |
23
+ | Context | Auggie automatically indexes projects and offers context-aware interactive and print modes. Its MCP Tool Search avoids loading every remote schema up front. See [Auggie overview](https://docs.augmentcode.com/cli/overview) and [integrations](https://docs.augmentcode.com/cli/integrations). | Local BM25/path/symbol retrieval plus a behavior-negotiated ContextEngine adapter, verified current-file/commit packing, empty-result cross-checks, observable fallback, progressive Skills, and hard token caps. Filesystem freshness remains `unknown` until each hit is consumed; doctor reports semantic readiness and query telemetry reports degraded channels. MCP schemas are registered eagerly. | Make MCP tool discovery lazy and measurable, and add proactive channel state to the TUI without pretending status alone proves freshness. |
24
+ | Workflow modes | Claude Code documents isolated subagents, agent teams, hooks, code intelligence, Skills, MCP, and plugins in one extension model. See [Claude Code extensions](https://code.claude.com/docs/en/features-overview). Copilot CLI exposes Plan and Autopilot modes. See [Copilot CLI](https://github.com/features/copilot/cli). | Ask and Build modes exist; Ask is read-only but does not produce a named approval-ready plan. | Add an explicit Plan mode. Keep it read-only and require approval before Build. |
25
+ | Code intelligence | Claude Code advertises language-server-backed symbol navigation and live type errors. | Retrieval is lexical/BM25/path/symbol index based; no LSP diagnostics or rename graph. | Add an optional LSP adapter after storage and scheduler foundations. |
26
+ | Parallel work | Claude documents isolated subagents and agent teams; Copilot CLI offers background delegation and fleet-style parallel work. | Routed multi-model councils share bounded reports, observe/guard/strict task-budget policies, reviewer acceptance/revision, and a responsive Team Cockpit. The main agent remains the only writer. | Add worktree-isolated writers, deterministic integration, and conflict/rollback UX without weakening the visible review gate. |
27
+ | Trust and execution | Gemini CLI documents sandboxing and trusted folders; Claude exposes lifecycle hooks and permission events. See the [Gemini CLI repository](https://github.com/google-gemini/gemini-cli) and [Claude hooks](https://code.claude.com/docs/en/hooks). | Category permissions, project trust, checkpoints, hooks, and audit trails are strong; process sandboxing and first-run trust inspection are incomplete. | Explain trust before activation and offer an optional OS/container sandbox. |
28
+ | Collaboration | Auggie supports integrations and conversation export; Copilot supports GitHub-native MCP and shareable workflows. | Session export and resumability are local; no shareable artifact or review bundle. | Add a deterministic redacted session/review bundle before any hosted sharing. |
29
+ | Distribution and recovery | Competitors provide guided installation, auth, update channels, and workflow-specific entry points. | Package/release verification is reproducible; `skein doctor` reports project/user namespace and interrupted-operation state, while shared live-process leases and exclusive mutation leases make migration, rollback, and recovery crash-safe without deleting changed canonical data. | Add capability review and upgrade UX, then define the measured legacy-alias window. |
30
+
31
+ ## Prioritized Roadmap
32
+
33
+ 1. **P0 reliability:** keep the CI green on the actual Node SQLite baseline and
34
+ configure `main` to require the stable `check` status.
35
+ 2. **P1 Plan mode:** shipped in this change as a read-only, approval-oriented
36
+ mode for both interactive and headless use.
37
+ 3. **P1 storage migration (compatibility window pending):** `.skein/` and `SKEIN_HOME` are
38
+ recognized canonical names, while existing `.mosaic/` state remains active
39
+ until an explicit `skein migrate --yes`. The command emits a hash-bearing
40
+ manifest, blocks conflicts/symlinks, copies through a temporary directory,
41
+ and retains the legacy source. `--rollback` verifies hashes before atomically
42
+ quarantining the canonical copy; `--recover` handles interrupted operations;
43
+ `--home` covers user-level state. Shared leases cover live managed writers,
44
+ while namespace mutation requires an exclusive crash-released lease.
45
+ 4. **P1 MCP progressive disclosure:** search and activate remote tool schemas
46
+ on demand instead of placing every schema in every model request.
47
+ 5. **P1 scheduler and isolation:** retain the shipped task-budget telemetry and
48
+ reviewer loop, then add cancellation propagation, deterministic integration,
49
+ and single-writer/worktree boundaries.
50
+ 6. **P1 code intelligence:** add optional LSP diagnostics and symbol actions
51
+ without making the local index or external ContextEngine mandatory.
52
+ 7. **P2 trust and sharing:** first-run capability review, sandbox adapters,
53
+ redacted review bundles, and explicit privacy/export/delete controls.
54
+
55
+ The benchmark deliberately does not copy cloud execution, vendor lock-in, or
56
+ autonomous mutation defaults into Skein. Those can be integrations later; the
57
+ core product should remain local, reversible, inspectable, and provider-neutral.
58
+
59
+ ## Dependency Maintenance Note
60
+
61
+ `@modelcontextprotocol/sdk@1.29.0` still declares
62
+ `@hono/node-server@^1.19.9`, whose entire 1.x line is affected by
63
+ [GHSA-frvp-7c67-39w9](https://github.com/honojs/node-server/security/advisories/GHSA-frvp-7c67-39w9).
64
+ Skein only imports MCP client transports, so the package currently applies a
65
+ scoped override to `@hono/node-server@2.0.11`. The real SDK interoperability
66
+ test guards this decision. Remove the override when the supported MCP v1 SDK
67
+ publishes a patched dependency range; do not start using Hono's server adapter
68
+ through the overridden major version.
@@ -0,0 +1,53 @@
1
+ # When this file is placed under a repository's .mosaic directory, hooks,
2
+ # permissions, verification commands, checkpoint overrides, and custom context
3
+ # executables require --trust-project-config. User-level config is trusted.
4
+ model:
5
+ provider: openai
6
+ model: gpt-5
7
+ temperature: 0.2
8
+ maxTokens: 8192
9
+
10
+ context:
11
+ engine: auto
12
+ maxTokens: 12000
13
+ topK: 12
14
+ contextEngineCommand: contextengine
15
+
16
+ permissions:
17
+ read: allow
18
+ write: ask
19
+ shell: ask
20
+ git: ask
21
+ network: ask
22
+ allowCommands:
23
+ - git status
24
+ - git diff
25
+ - git log
26
+ - npm test
27
+ - npm run typecheck
28
+ - npm run build
29
+ denyCommands:
30
+ - rm -rf /
31
+ - git reset --hard
32
+ - git clean -fd
33
+ - git checkout --
34
+ - sudo
35
+
36
+ agent:
37
+ maxTurns: 24
38
+ maxSessionTokens: 250000
39
+ autoVerify: true
40
+ verifyCommands:
41
+ - npm run typecheck
42
+ - npm test
43
+ checkpointBeforeWrite: true
44
+
45
+ hooks:
46
+ beforeTool: []
47
+ afterTool: []
48
+ afterTurn: []
49
+
50
+ ui:
51
+ color: true
52
+ compact: false
53
+ theme: auto
package/package.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "name": "@skein-code/cli",
3
+ "version": "0.2.0",
4
+ "description": "A context-first, model-agnostic coding agent with an auditable terminal workspace.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "keywords": [
8
+ "ai",
9
+ "coding-agent",
10
+ "cli",
11
+ "mcp",
12
+ "terminal"
13
+ ],
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "bin": {
18
+ "skein": "dist/cli.js",
19
+ "mosaic": "dist/cli.js",
20
+ "mosaic-code": "dist/cli.js"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "docs",
25
+ "examples",
26
+ "README.md",
27
+ "LICENSE"
28
+ ],
29
+ "engines": {
30
+ "node": ">=22.16.0"
31
+ },
32
+ "scripts": {
33
+ "build": "tsup",
34
+ "dev": "tsx src/cli.tsx",
35
+ "start": "node dist/cli.js",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest",
38
+ "pretest:pty": "npm run build",
39
+ "test:pty": "sh test/pty/run-visual.sh",
40
+ "verify:package": "node scripts/verify-package.mjs",
41
+ "release:verify": "npm run check && npm run verify:package --",
42
+ "typecheck": "tsc --noEmit",
43
+ "check": "npm run typecheck && npm test && npm run build && npm run smoke:dist",
44
+ "smoke:dist": "node dist/cli.js --help",
45
+ "prepublishOnly": "npm run check"
46
+ },
47
+ "dependencies": {
48
+ "@modelcontextprotocol/sdk": "^1.29.0",
49
+ "chalk": "^5.6.2",
50
+ "commander": "^15.0.0",
51
+ "diff": "^9.0.0",
52
+ "fast-glob": "^3.3.3",
53
+ "ignore": "^7.0.5",
54
+ "ink": "^7.1.1",
55
+ "ink-text-input": "^6.0.0",
56
+ "react": "^19.2.3",
57
+ "string-width": "^8.2.2",
58
+ "strip-ansi": "^7.2.0",
59
+ "yaml": "^2.8.2",
60
+ "zod": "^4.4.3"
61
+ },
62
+ "devDependencies": {
63
+ "@types/diff": "^8.0.0",
64
+ "@types/node": "^22.19.7",
65
+ "@types/react": "^19.2.7",
66
+ "tsup": "^8.5.1",
67
+ "tsx": "^4.21.0",
68
+ "typescript": "^5.9.3",
69
+ "vitest": "^4.0.18"
70
+ },
71
+ "overrides": {
72
+ "@modelcontextprotocol/sdk": {
73
+ "@hono/node-server": "2.0.11"
74
+ }
75
+ }
76
+ }