Skip to content

totem init: no headless / targeted single-skill refresh — managed-block reconcile unreachable in CI/agent contexts #2222

Description

@satur8d

Problem

Reconciling one distributed skill's managed block — the exact remediation totem doctor --parity prints for distributed-skill drift ("re-run totem init") — is unreachable in any non-interactive context. Hit live reconciling totem-status's stale signoff skill (mmnto-ai/totem-status#59, consumer 553c04a9 ≠ canonical 228ae8aa).

Three dead ends:

  1. totem init is interactive and aborts under non-TTY. It prompts Which tools should Totem configure? [all/none/select] then Install git enforcement hooks? (Y/n). Headless it aborts with Warning: Detected unsettled top-level await ... await program.parseAsync(). Piping (printf 'all\n' | totem init) clears the first prompt but stalls on the second and still aborts. No CI job or agent can run it.
  2. totem init --bare skips skills entirelySkipping AI tool and hook installation for bare mode. So it never refreshes the managed block. Wrong tool.
  3. Full totem init over-scaffolds. To refresh one skill block in totem-status it created/modified 8 surfaces.mcp.json, .claude/hooks/PreWriteShield.cjs, .claude/skills/review-reply/, .gemini/hooks/BeforeTool.js, .gemini/settings.json, .totem/lessons/, and edited CLAUDE.md / GEMINI.md / .claude/settings.json. It also flips LF→CRLF on the skill file, which may itself defeat the canonical hash match.

Net: the doctor flags the drift and says "re-run totem init," but there is no clean, headless, targeted way to do exactly that. Today it is only reachable by a human at a TTY who then manually reverts 7 unwanted changes.

Ask

A non-interactive, targeted refresh path — either/both:

  • --yes / -y (assume defaults, no prompts) so totem init runs headless in CI/agents.
  • totem init --skill <name> (or totem skills refresh <name>) that refreshes ONLY the named distributed skill's managed block (between totem:skill-start / totem:skill-end) and scaffolds nothing new — the surgical inverse of --force-skill-refresh.
  • Ensure managed-block writes preserve canonical line endings (LF) so the refresh actually clears the doctor --parity hash drift rather than trading content drift for EOL drift.

Evidence

  • mmnto-ai/totem-status#59 — the blocked reconcile.
  • Two-prompt + top-level-await abort reproduced on @mmnto/cli@1.71.0 (project-local) and 1.71.1 (global, TOTEM_NO_REEXEC=1), 2026-06-21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions