Repository navigation
Description
Rewritten 2026-08-07. The CLI surface this hung on was rejected, and the promotion question now has an answer: the user approves. Unblocked — #255/#231/#232 have all landed.
What survives verbatim
- Snippets live in
conciv/snippets/, besideconciv/extensions/.conciv/is committed user source;.conciv/is gitignored run state holding absolute paths and 0600 files. A nested gitignore cannot re-include a file whose parent is excluded, so "git-visible snippets under.conciv/" was never true. - No shared index file. A single index is a read-modify-write that two concurrent saves clobber, and a crash between two writes desyncs it. Each snippet carries its own metadata beside it — a directory read is the listing.
- Names are a portable slug: no separators, no traversal, no case-folding collisions.
../../xis a user error, not a write. Saving over an existing name is refused unless forced. - A description is recorded when given; a snippet saved without one lists a null description rather than a guess.
What changed: who promotes a run into a snippet
The original mechanism — conciv tools code '…' --save <name> — is gone. #223 is closed as rejected, and execution moved to the code-mode MCP server (docs/superpowers/specs/2026-08-04-one-tool-registry-design.md, packages/core/src/chat/code-mode.ts).
Promotion is a user approval decision, not a model action. The agent never saves a snippet by calling a tool; a successful run is offered to the user, and the user accepts or declines. This matches the cloudflare/mcp model where the application persists, never the model.
Note the mechanism is not a reuse of the existing approval: 'ask' gate (packages/core/src/chat/gate.ts). That gate fires before a call to decide whether it runs. Promotion fires after a run has already succeeded, to decide whether it is kept. Same principle — the user decides — but a distinct surface: a post-run promotion affordance, not a pre-call gate.
Open design questions, to settle before implementing
- Where the offer appears. The widget after a successful code-mode run, the CLI, or both. A run started by an agent in a headless session has no one to ask — does promotion simply not happen there, or is it queued for later review?
- What granularity is offered. A whole code-mode execution, or a user-selected slice of it.
- Where the name and description come from. User-typed at approval time, or agent-proposed and user-edited.
- Whether declining is remembered, so the same run is not offered repeatedly.
Acceptance criteria
- Promotion requires an explicit user approval; no code path lets the agent persist a snippet on its own
- A failing run is never offered for promotion
- Declining writes nothing
- Snippets land in
conciv/snippets/and a saved one is visible to plaingit status - Metadata lives per snippet; there is no shared index to corrupt, and two concurrent saves both survive
- A traversal or otherwise unportable name is refused as a user error
- Saving over an existing name is refused unless forced
- A snippet saved without a description lists a null description
- Listing snippets is a directory read, and has a machine-readable form for agents
- A saved snippet can be re-run by name, with arguments reaching it as a parameters binding
Design: docs/superpowers/specs/2026-08-04-cli-command-contract-design.md section 3b (location, index, and naming rules only — its tools code surface is superseded).
Related
- CLI: conciv tools code — code-only discovery and typed execution #223 — CLOSED, rejected. Do not implement
conciv tools code --save. - MCP: one code-mode tool over the registry — execute, with the catalog as a binding #231, registry: delete the old surface, add the guards, bring the suite green #232, epic: the page capability becomes a built-in extension (registry-declared, no special surface) #255 — CLOSED. The registry and code-mode surface exist.
- init: install a conciv skill and shrink the AGENTS.md mini-catalog #225 — does not depend on this; the init skill ships without a snippets section.
Activity
omridevk commentedon Aug 4, 2026
Needs rework, not closure — the mechanism this ticket hung on is gone but the idea stands.
conciv tools code --saveno longer exists:conciv tools codewas rejected and #223 is closed. Execution moved to a code-mode MCP server (docs/superpowers/specs/2026-08-04-one-tool-registry-design.md).What survives verbatim: snippets live in
conciv/snippets/, besideconciv/extensions/, becauseconciv/is committed user source and.conciv/is gitignored run state; no shared index file, since a directory read is the listing and a single index is a read-modify-write two concurrent saves clobber; portable-slug names, no traversal, no silent overwrite.What has to change: who saves. In
cloudflare/mcp's model the application persists a snippet, never the model — a promotion decision, not a tool the agent calls. So the trigger is no longer a CLI flag on a run. Reopen the design question of what promotes a successful execution into a saved snippet before implementing this.Blocked by the registry landing.
omridevk commentedon Aug 7, 2026
Promotion mechanism settled: reuse the existing ask registry.
There is no run with nobody upstream. Every run has a
sessionId, and that session has a human attached — so the approval bubbles to them, exactly asapproval: 'ask'already does.The machinery exists and should be reused rather than reinvented:
packages/core/src/chat/ask.ts—createAskRegistry(), keyed bysessionId, withopen/waitFor/reply/pending.packages/core/src/chat/gate.ts:102-106—asks.open(sessionId, approvalId)thenawait asks.waitFor(sessionId, approvalId, ASK_TIMEOUT_MS), blocking the call until the human decides.packages/contract/src/contract.ts:109—permissionDecisioncarries the answer back from the widget.Promotion differs from the gate only in when it fires: the gate asks before a call to decide whether it runs, promotion asks after a run succeeded to decide whether it is kept. Same registry, same session-keyed bubbling, different trigger point.
Not MCP elicitation. Asking back through the harness was probed and is a dead end: claude auto-cancels elicitation in headless, codex cancels pre-tool, and opencode does not implement it. Conciv asks through its own channel.
Resolves two of the open questions:
Where the offer appears— the session's approval surface, via the ask registry. A run with no one watching is not a special case; it is the timeout case.What happens when nobody is there—ASK_TIMEOUT_MSis 120s and a timeout is a non-approval, so the snippet is not saved. No queue, no deferred review. Declining costs nothing because the run already succeeded and returned its result.Still open: what granularity is offered (a whole code-mode execution or a slice), where the name and description come from (user-typed at approval time, or agent-proposed and user-edited), and whether a decline is remembered so the same run is not re-offered.
omridevk commentedon Aug 7, 2026
TanStack already ships this feature. Platform-ladder finding — read before implementing.
@tanstack/ai-code-mode-skills@0.3.13("Persistent runtime skill library for TanStack AI Code Mode agents") is the sibling of the@tanstack/ai-code-modewe already use inpackages/core/src/chat/code-mode.ts:235. It is not currently installed.codeModeWithSkills()returns a registry containingexecute_typescript,search_skills,get_skill,register_skill, and one callable tool per selected skill. Skill selection uses a cheap model bounded bymaxSkillsInContext. It emitsskill:registered,code_mode:skill_call,code_mode:skill_result, andcode_mode:skill_error.SkillStorage(verified against the publishedtypes.d.ts) is:A
Skillcarriesid,name(snake_case),description,code,inputSchema,outputSchema,usageHints,dependsOn,trustLevel,stats,createdAt,updatedAt— richer than the shape sketched in this ticket.Where their model conflicts with ours
1. The model registers, and nothing gates it. Their system prompt instructs the LLM to call
register_skillafter producing useful code. Their trust ladder (untrusted → provisional at 10+ runs ≥90% → trusted at 100+ runs ≥95%, configurable viacreateCustomTrustStrategy) sounds like a gate but is not: the docs state plainly that "the trust level is metadata only — it does not currently gate execution." Untrusted skills still run.So their trust strategy does not satisfy the approval requirement recorded above. It answers "is this skill reliable?" — a statistical quality signal. It does not answer "should this code be written into a directory the project commits to git?", which is the actual risk when the target is
conciv/snippets/.2. Their file storage uses a shared index — the exact thing this ticket rejected.
createFileSkillStoragelays out:This ticket rejected a shared index because it is a read-modify-write that two concurrent saves clobber and a crash between writes desyncs. Adopting
createFileSkillStorageverbatim reintroduces that. TheirloadIndex()/loadAll()split is a real API distinction though, and worth keeping.Proposed shape
Adopt the library, supply our own storage:
codeModeWithSkills()for the registry, search, selection, and theregister_skill/get_skill/search_skillssurface. Do not hand-roll any of it.SkillStorageourselves rather than usingcreateFileSkillStorage, so that:save()is the approval seam — it requires the user approval recorded above (via the existing session-keyed ask registry) before anything is written, and writes nothing on decline or timeout.conciv/snippets/, per-skill metadata, no_index.json— a directory read is the listing.loadIndex()is satisfied by reading each skill's metadata without its code.trustStrategyas what it actually is: a reliability signal surfaced to the user, never a substitute for approval.Still open
register_skillshould be exposed to the model at all, or whether the host observes a successfulexecute_typescriptand offers promotion. Their design says the model asks; our approval ruling means the user still decides. Exposing the tool and gatingsave()is the smaller change and keeps their prompt/registry intact.register_skillhas the model proposename,description,usageHints, and both schemas, which is a reasonable default if the user edits at approval time.Before implementing, read
docs/code-mode/code-mode-with-skills.mdupstream and the package source; the notes above come from the published docs plustypes.d.ts, not from a full source read.