Skip to content

Decide and migrate empty-state detection from plugin-side to CLI-side #15

Description

@ivklgn

Re-verified after v0.7.0 — still open, and the asymmetry is now sharper: the repatriation moved hook policy into the CLI but left this one signal behind.

Problem

Empty-state detection (the "your .archcore/ is empty, run /archcore:init" nudge) lives plugin-side in plugins/archcore/bin/lib/empty-state.sh — a find + wc check sourced by bin/session-start (line 230). The rest of the SessionStart payload is composed by the CLI. The emptiness signal is therefore recomputed per host instead of coming from one authoritative source, and it is now the only remaining piece of hook policy in the plugin.

It also carries a coupling that is easy to break by accident: skills/init/lib/agent-files.md sizes imported link stubs to stay under 200 bytes specifically so they do not trip the "functionally populated" check in empty-state.sh. That threshold is a contract between two files in different layers, documented in only one of them.

Expected result

A decision on whether to migrate, and — if yes — moving the empty-state signal into the CLI's SessionStart handler so all hosts share one authoritative check, with the plugin consuming it. The 200-byte stub threshold moves with it and gets stated where it is enforced.

Impact

Removes duplicated per-host logic, keeps the nudge consistent across all four hosts, and completes the v0.7.0 layer split. This is as much a go/no-go decision as an implementation; the plans gate it on validating the current plugin-side UX first.

Proposed approach

  • Decision: migrate vs. keep plugin-side (after UX validation).
  • If migrating: CLI handler owns the signal; plugin consumes it; the stub-size contract is documented CLI-side and pinned by a test.

Acceptance criteria

  • A recorded decision, and (if approved) a single authoritative empty-state check consumed by all hosts.

References

Design rationale: .archcore/plugin/zero-content-onboarding-implementation.plan.md (Out of scope), zero-content-onboarding.idea.md, cli-owns-layers-4-5.adr.md. Code: plugins/archcore/bin/session-start, plugins/archcore/bin/lib/empty-state.sh, plugins/archcore/skills/init/lib/agent-files.md. Cross-repo (Archcore CLI).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:onboarding/archcore:init and first-run experienceneeds-cliDepends on the separate Archcore CLI (Go) repopriority:P3Optional / roadmapsize:M1-3 days

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions