Skip to content

feat(adopt): init --manifest-only and sync --only skills — cheap, documented adoption; the manifest stays the single installed marker #1209

Closed

Description

@admarble

Epic: field-2026-09-28 (downstream non-Node adoption) Blocked by: #1201 Tier: mechanical Graph: tracker #1203

Decided 2026-09-28 (owner). This issue was a human gate; the ACs below record the decision. Split out of #1201.

Decision.

  1. run keeps requiring .sequant-manifest.json. The manifest is the single "installed" marker: doctor, status, update, sync, version-preflight, index.ts, run and sequant://install (fix(mcp): sequant://install is computed once at server start and swallows errors — reports "not installed" after a later init or on any read error #1195) all read it. A manifest-optional run would create a second definition of installed that all of them would have to reconcile. Instead, creating a manifest becomes cheap and documented. The minimal manifest is not a hack: init itself writes files: {} (manifest.ts:75), and nothing reads files.
  2. sync gains a group selector, --only skills. Since fix(sync/init/update): one ownership rule for project files — the clobbering class fixed file-by-file in #708/#814/#990/#1042/#1071/#1078 #1090 and sync overwrites .claude/settings.json wholesale, deleting project-owned hook matcher groups #1078, sync preserves user-modified files, so it doesn't clobber. The remaining objection is additions: hooks, agents and scripts/dev landing in a repo that only wanted the phase skills.

Rejected: a manifest-optional run (two installed-markers), and documenting a manual copy instead of a flag (it drifts from the package version).

AC

  • AC-1: sequant run with no manifest exits non-zero, prints the minimal manifest JSON (version, stack, installedAt, files: {}), and says that file alone is sufficient, or that sequant init --manifest-only writes it. Evidence: npx vitest run src/commands/run.test.ts
  • AC-2: sequant init --manifest-only creates .sequant-manifest.json and no other file, leaves an existing manifest untouched, and is registered with .option() in bin/cli.ts. Evidence: npx vitest run src/commands/init.test.ts
  • AC-3: sequant sync --only skills writes nothing outside .claude/skills/** and .sequant-manifest.json, and is registered with .option() in bin/cli.ts. Evidence: npx vitest run src/commands/sync.test.ts
  • AC-4: The skills pre-flight's missing-skills remedy (made consistent by fix(adopt): missing-skills remedies contradict each other, and the README plugin path omits the skills that runs need #1201) and the README's "Commit .claude/skills/" note (README:59, which says the fix is sequant sync) both name sequant sync --only skills. Evidence: npx vitest run src/lib/workflow/skills-preflight.test.ts

Graph metadata

May touch

  • bin/cli.ts
  • src/commands/run.ts
  • src/commands/init.ts
  • src/commands/sync.ts
  • src/lib/workflow/skills-preflight.ts
  • README.md

File overlap (don't run in the same wave; merge one first):

Activity

  1. added
    enhancement
    human-required
    needs-triage
    graph-2026-09-field
    on Sep 28, 2026
  2. changed the title [-]decision(adopt): should `sequant run` work without a manifest, and should `sync` gain a skills-only mode?[/-] [+]feat(adopt): `init --manifest-only` and `sync --only skills` — cheap, documented adoption; the manifest stays the single installed marker[/+] on Sep 28, 2026
  3. removed
    human-required
    needs-triage
    on Sep 28, 2026
  4. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Context before wave 3 (main @ 1b0fa9a). #1201 has merged (PR #1216). What it changed that this issue's AC-4 now depends on:

    • skills-preflight.ts builds one shared remedy string, with a SYNC_REWRITES_NOTE (defined around :45) that names what sequant sync rewrites. run-orchestrator.ts threads preflight.remedy into both worktree messages. AC-4 should change that single remedy. Do not add a second message.
    • README: the "Commit .claude/skills/" note is now at README.md:61 (was :59). fix(adopt): missing-skills remedies contradict each other, and the README plugin path omits the skills that runs need #1201 also added a plugin-install paragraph at README.md:52. It says sequant sync is not an option for a plugin-only setup, and that /sequant:setup (3 mirrored SKILL.md copies) copies the phase skills in. sync --only skills wording must not contradict that paragraph. The plugin-only path still has no npm.

    Run rules for the phase agents (spec, exec and qa):

    • exec and qa: do not run the full npm test. Run the targeted npx vitest run <files> named in the ACs, in the foreground with a timeout. Every MCP-dispatched phase has a hard 30-minute wall, and in wave 2 an exec ran up to 27 minutes. This applies to the qa phase too, not only exec.
    • Commit WIP early, and commit again before any mutation test. Work that is committed survives a phase timeout.
    • For a mutation record, failedTest must start with the test file path (src/…test.ts > <describe> > <case>). If it starts with a describe name, §6i floors the verdict to AC_NOT_MET.
    • In the PR body, put Closes #<this issue> for this issue and Refs #1203 for the tracker. Never Closes #1203.
    • A skill snippet that reads .sequant/settings.json must handle JSONC (comments and trailing commas), not bare JSON.parse/jq.
  5. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (4 ACs, ~5 directories)

    AC Quality Check

    Parser note (non-blocking): extractAcceptanceCriteria returns 0 items for this issue — every AC line is - AC-N: ... with no - [ ]/- [x] checkbox, and ac-parser.ts's five patterns all require one. Scope assessment then self-skips ("Trivial issue (0 AC items, 0 directories)"). This is the same house style #1201 (the issue this one was split from) used, and that shipped through spec→exec→qa fine — so this is a known, accepted format for this graph's decision issues, not a defect to fix here. Flagging only so state.json's AC tracking isn't mistaken for "nothing to check."
    Each AC is otherwise well-formed: one line, a concrete Evidence: command naming a real test file, no vague/unmeasurable language.
    No ## Non-Goals heading (consistent with #1201's format — a decision record, not a feature request).


    Scope Assessment

    Non-Goals: ⚠️ Not present (see AC Quality Check — decision-issue format).

    Manual read (tool self-skipped on 0 parsed AC): 3 distinct changes (manifest-only init, sync group selector, remedy-message consistency) across ~5 directories (bin/, src/commands/, src/lib/, src/lib/workflow/, repo root for README.md) plus 4 test files. Bounded and mechanical, matching the issue's own Tier: mechanical label.

    Verdict: ✅ SCOPE_OK (manual read; not machine-verified — see note above)


    Acceptance Criteria

    AC-1: sequant run with no manifest names the minimal manifest and init --manifest-only

    Verification: Integration Test
    Scenario: Given no .sequant-manifest.json in cwd → When sequant run <issue> is invoked → Then it exits non-zero, prints a minimal manifest JSON shape (version, stack, installedAt, files: {}), and states either "that file alone is sufficient" or that sequant init --manifest-only writes it.
    Assumptions: run.ts:57-61's current rejectPreflight("❌ Sequant is not initialized. Run \sequant init` first.")is the exact site to replace; no test currently asserts this message (checkedrun.test.ts`), so this is new coverage, not a rewrite of an existing assertion.

    AC-2: sequant init --manifest-only

    Verification: Integration Test
    Scenario: Given a project with no manifest → When sequant init --manifest-only runs → Then only .sequant-manifest.json is created (no .claude/, .sequant/logs, templates, etc.). Given a manifest already exists → When run again → Then it is left byte-identical.
    Assumptions: Stack resolution for the minimal manifest is non-interactive by construction (detect or fall back to "generic", mirroring initCommand's existing skipPrompts default) — this flag has no interactive mode.

    AC-3: sequant sync --only skills

    Verification: Integration Test
    Scenario: Given an initialized project → When sequant sync --only skills runs → Then only paths under .claude/skills/** and .sequant-manifest.json are written; .mcp.json, AGENTS.md, .opencode/, scripts/dev/, .claude/settings.json, .claude/agents/, .claude/hooks/, .claude/memory/ are untouched.
    Assumptions: --dry-run --only skills must preview the same restricted set (parity with the existing dry-run/apply invariant sync.ts already enforces for plain sync, #722/#1030).

    AC-4: Consistent sequant sync --only skills remedy

    Verification: Integration Test
    Scenario: Given a missing skill triggers the pre-flight → When the remedy is printed (worktree case via skills-preflight.ts's remedy field, and main-checkout case via run-orchestrator.ts's inline message) → Then both name sequant sync --only skills. Given the README's "Commit .claude/skills/" note → Then it names the same command.
    Assumptions: ⚠️ This is not a literal string swap. skills-preflight.test.ts (the evidence file) exercises both sites through RunOrchestrator.run() — see Implementation Plan Phase 3.


    Implementation Plan

    Phase 1: sync --only skills (AC-3) — do first, AC-4's remedy names it

    1. Add only?: "skills" to CopyTemplatesOptions (src/lib/templates.ts); in copyTemplates, skip the agents/hooks/memory copyDir calls, the scripts/dev symlink-or-copy step, and the .claude/settings.json write when only === "skills" — keep only the skills copyDir and the skills-version-marker write.
    2. In syncCommand (src/commands/sync.ts), thread options.only through: skip syncSequantMcpPin, AGENTS.md regen/preview, and decideOpencodeShimSync/refreshOpencodeShim entirely when only === "skills". Filter the computeTemplateChanges result (both the version-match fast path and the --dry-run preview) to paths under .claude/skills/ before reporting, so the printed summary matches what actually gets written.
    3. Add --only <group> to the sync command in bin/cli.ts, validated against an allow-list (currently just ["skills"]) the same way validatePhasesFlag validates --phases — reject an unknown group with a clear error rather than silently ignoring it.

    Phase 2: init --manifest-only (AC-2)

    1. In initCommand (src/commands/init.ts), add an early branch mirroring the existing --upgrade-skills early-return (right after assertTemplatesDirExists): if options.manifestOnly, check getManifest() — if present, report "already exists, left untouched" and return; if absent, resolve stack non-interactively (options.stack ?? (await detectStack()) ?? "generic"), call createManifest(stack, packageManager), print confirmation, and return before any directory/template/settings work.
    2. Add --manifest-only to the init command in bin/cli.ts.

    Phase 3: Unify the remedy message (AC-4) — depends on Phase 1

    1. src/lib/workflow/skills-preflight.ts: change the remedy field's recommended command to `sequant sync --only skills`. The trailing (${SYNC_REWRITES_NOTE}) parenthetical becomes false for this command (--only skills deliberately does not rewrite hooks/settings/scripts/AGENTS.md) — replace it with an accurate note (e.g., "writes only .claude/skills/** and the manifest") rather than dropping the caveat silently.
    2. src/lib/workflow/run-orchestrator.ts:1166-1174: same swap for the main-checkout abort message (currently `run \`sequant sync\` in it (${SYNC_REWRITES_NOTE})`).
    3. Update the existing assertions in skills-preflight.test.ts that currently expect SYNC_REWRITES_NOTE's content (hooks / .claude/settings.json / scripts/dev / AGENTS.md) in the remedy text — lines ~266-273, ~564, ~592, ~625-626. These will fail once the caveat text changes; update them to assert the new note instead of deleting the coverage.
    4. README.md's "Commit .claude/skills/" note (~line 59): change `sequant sync` to `sequant sync --only skills`.

    Design Review

    1. Where does this logic belong? No new modules. init.ts/sync.ts (command layer) for the two new flags, templates.ts (the existing copy/diff engine) for the skills-only scoping, skills-preflight.ts + run-orchestrator.ts for the remedy text — each change extends the module that already owns that behavior.
    2. Simplest correct approach? Thread an only?: "skills" filter through the existing copyTemplates/computeTemplateChanges/ownership-decision machinery. Rejected: a standalone syncSkillsOnly() that calls copyDir on .claude/skills directly — cheaper to write, but re-opens the exact dry-run/apply divergence update: --dry-run reports "0 modified" but apply rewrites every SKILL.md (dry-run vs apply divergence) #722 and fix(sync): dry-run lists files apply never writes — the template walk maps templates/opencode/** to .claude/opencode/** (phantom drift nag in serve; update plants unrendered {{PHASE}} files) #1030 already fixed by centralizing that logic once.
    3. What existing pattern does this follow? --upgrade-skills's early-return branch in initCommand (for --manifest-only); validatePhasesFlag's CLI allow-list validator (for --only); resolveOwnershipDecisions/printOwnershipDecisions's single-source-of-truth pattern (for --only skills preview/apply parity).
    4. What would a reviewer challenge? "Does --only skills really touch nothing else?" — AC-3's evidence must assert .mcp.json/AGENTS.md/.opencode/ are byte-identical after the run, not just that skills changed. Also: the owner already rejected a manifest-optional run and a manual-copy doc in the issue's own Decision section — that trade-off is settled, not open for re-litigation in this PR.

    ADR: Design Review Q2 names a rejected alternative (a standalone skills-only writer). Per docs/adr/README.md, the exec PR should add docs/adr/0003-<slug>.md recording the "thread only through the existing copy/diff/ownership pipeline" decision — can be short, matching the issue's own "mechanical" framing.


    Feature Quality Planning

    All standard checks pass. Notable items:


    Open Questions

    1. Should run-orchestrator.ts's main-checkout remedy (Phase 3, step 2) really change too, or only skills-preflight.ts's own remedy field? — Recommendation: change both. skills-preflight.test.ts (the AC-4 evidence file) exercises the orchestrator's message directly via RunOrchestrator.run() (see tests at lines ~594-627), so leaving it as bare sequant sync would fail the evidence command and reintroduce the exact inconsistency fix(adopt): missing-skills remedies contradict each other, and the README plugin path omits the skills that runs need #1201 fixed. Impact if wrong: AC-4's own evidence command fails, or the two messages drift apart again.
    2. Exact wording of AC-1's manifest-missing message. — Recommendation: something like Minimal manifest: {"version": "<pkg>", "stack": "generic", "installedAt": "<iso>", "files": {}} — write it yourself, or run \sequant init --manifest-only`.` Impact if wrong: low, AC-1 only requires the three named elements be present, not exact copy.

    Recommended Workflow

    Phases: spec → testgen → exec → qa
    Quality Loop: disabled
    Reasoning: All 4 ACs declare Evidence: resolving to npx vitest run <file>.test.ts against existing integration-style suites (Integration Test method) — testgen stubs the 4 new cases across run.test.ts/init.test.ts/sync.test.ts/skills-preflight.test.ts before implementation. Scope is bounded and well-specified (owner already made the design decision in the issue body); no complex/refactor label, no UI surface — quality loop not warranted.


    Label Review

    Current: enhancement, graph-2026-09-field
    Recommended: enhancement, graph-2026-09-field, planned
    Reason: Planning complete; no scope-warning or complexity signal to add further labels.
    Quality Loop: Won't auto-enable — SCOPE_OK (manual read), no complexity label.

    → gh issue edit 1209 --add-label planned

  6. added
    planned
    on Sep 29, 2026
  7. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Test Stubs Generated

    AC Verification Happy Path Failure Paths
    AC-1 Integration Test 1 test 1 error case
    AC-2 Integration Test 2 tests 1 error case
    AC-3 Integration Test 2 tests 1 error case
    AC-4 Integration Test 2 tests -

    Counts explained:

    • Happy Path: Number of positive/success test stubs
    • Failure Paths: Number of error handling / edge case stubs

    Integration Test Stubs (colocated, matching this repo's convention — not __tests__/integration/)

    Not covered by these stubs

    • AC-4's README.md ("Commit .claude/skills/" note) assertion — the AC's Evidence: command only runs skills-preflight.test.ts, which cannot assert README prose. Left as a manual/exec-time check.
    • CLI --only <group> and --manifest-only flag registration in bin/cli.ts — no dedicated CLI-flag test file exists in this repo; covered implicitly by the command-level stubs above plus manual verification during /exec.

    All 10 new stubs were run and confirmed to fail on throw new Error(...) (not on unrelated mock/setup crashes) against the current (pre-implementation) code — npx vitest run src/commands/run.test.ts src/commands/init.test.ts src/commands/sync.test.ts src/lib/workflow/skills-preflight.test.ts: 10 failed (all stub markers) / 275 passed (pre-existing, untouched).


    Next steps:

    1. Implement the test stubs (replace throw new Error(...) with actual test logic)
    2. Run /exec 1209 to implement the feature
    3. Verify tests pass with npm test

    Generated with Claude Code

  8. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Resuming exec (2026-09-29). The first wave-3 run was killed at 16:24 UTC by the MCP no-progress watchdog, which fires after 30 minutes with no phase boundary. This exec had been running for 36 to 44 minutes. Your committed WIP is on the branch and in the worktree, so pick up from it; do not start over.

    • Do not run the full npm test in exec or in qa. The last WIP commit said "before mutation testing and full suite". The full suite takes 10 to 13 minutes, and it is what pushed this phase past the wall. Run only the targeted npx vitest run <files> from the ACs, plus npx tsc --noEmit, in the foreground with a timeout. The runner runs the full suite.
    • Do at most one mutation per gate AC, commit before you mutate, and restore right after.
    • Keep the whole exec under 20 minutes. If you are near that, commit, push and open the PR with what is done, and list what is left in the PR body.
    • If git status ever shows tracked files deleted that you did not delete, stop and say so. Do not commit them. After the kill, the feat(logs): run log records each phase's model and the sequant version #1198 worktree had 44 top-level tracked files deleted (bin/, evals/, stacks/, CHANGELOG.md, LICENSE, …); the runner has restored them.
  9. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 4/4 met

    Gaps:

    • run's manifest-missing message omits the manifest filename, so a user writing it by hand is not told what file to create
    • sync --only skills prints an inaccurate completion summary claiming hooks/memory were updated
    • Stale testgen comment contradicts the implemented code
    • No real-filesystem test of the manifest-only / skills-only write-set; verified only by QA smoke
  10. added a commit that references this issue on Sep 29, 2026
  11. admarble commented on Sep 29, 2026

    @admarble
    ContributorAuthor

    Runner verification of PR #1221 (QA: AC_MET_BUT_NOT_A_PLUS, 4/4), now at 4795bc1

    QA's two fix_now findings were real, and both are fixed:

    • run's manifest-missing message now names .sequant-manifest.json, and the AC-1 test asserts it.
    • sync --only skills no longer prints "Skills, hooks, and memory files have been updated." It now says only skills and the manifest were written, and a new test covers it.
    • I also removed the stale testgen comment.

    Checks the runner ran:

    • tsc --noEmit is clean. The five AC test files passed: 291 tests.
    • Mutations: dropping the filename from the message failed only the AC-1 test, and forcing the unscoped summary failed only the new sync test. Both were restored.
    • Real-filesystem smoke test (from the worktree's npm run build, in a fresh temp git repo), covering QA's "no real-filesystem test" note:
      • init --manifest-only created only .sequant-manifest.json.
      • A second run printed "left untouched", and the file was byte-identical.
      • sync --only skills wrote 48 paths under .claude/skills/** plus .sequant-manifest.json, and nothing else.
    • I replaced the PR body (it was the orchestrator's bare "Automated PR" text) and dropped the doubled feat(#1209): feat(adopt): from the title. closingIssuesReferences is [1209].

    Note: the resumed exec ran for 24 minutes and made no new commits. The earlier WIP commits carried all the work.

  12. added a commit that references this issue on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgraph-2026-09-fieldplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions