sflow-init
Create deterministic smart initialization for a fresh repository, or verify and safely repair existing Singularity Flow assets without overwriting repository customizations.
SKILL.mdplugin/skills/sflow-init/SKILL.md
GitHubVerify or repair branch initialization
<!-- sflow-copilot-pause -->Before any boundary lookup or SFlow action, run singularity-flow pause status --json and follow its data.agentInstruction. If data.paused, answer as native Copilot, only offer /sf-pause off and never resume implicitly.
Output contract: Let the CLI validate and mutate state; preserve its exact result, warnings, publication status, artifacts, and next actions. Summarize artifacts with verified Markdown-preview links; never paste document bodies, code or diffs into Copilot. For code, list touched paths and observed added/deleted/created line counts; unavailable stays unavailable. Use existing evidence, not extra calls solely for display. Summaries, links and opened previews are not human review or approval. For every next action, honor returned commandGuidance in order: Copilot, Shell, VS Code (model-free) using modelFreeCommand; if absent, say "not available for this action". Missing Copilot: "no verified equivalent". Never invent routes.
Boundary: no Story required; cwd=opened Git root or verified repositoryPath from singularity-flow workspace current --json; refuse if neither resolves; never search $HOME/parents. Use exact CLI-returned paths. repositoryPath is command cwd, not a prefix for absolute file paths. Never rebase paths or strip .git/worktrees. Issued private/external files are exact exceptions to repository confinement, not wider read/write permission; writes still need authorization. Resolve relative paths only against their declared base. On failure, preserve the path and error; never search or recreate it.
Setup only: do not implement, submit, approve, reset, stash, force-push, or edit customizations.
For explicitly requested smart or zero-manual initialization, require a fresh repository:
- Run
singularity-flow init --smart-detect --dry-run --jsononce. Show stacks, commands, gaps, suggestions, write set, and proposal SHA-256. Never run a detected command. - Ask explicitly about unresolved candidates and optional protections. Never infer ambiguity or select unchecked suggestions.
- Show
--accept-proposal <file> --confirm <sha256>; use--yesonly after explicit acceptance. - Activate only after exact confirmation. Preserve the receipt, commit, readiness, and next command. Proposal-only and review-proposal files are not active law.
- Run metadata-only
singularity-flow precheck --quick --json. Offer Copilot/sf-readyand Shellsingularity-flow precheck --run --scope dependency-test --json. Only the readiness flow (/sf-readyor its shown Shell equivalent)—not init—executes the confirmed repository plan.
On INI_RECOVERY_REQUIRED, run only its exact
singularity-flow init --recover --proposal <SHA256> --json; never edit its journal.
For ordinary init, --check, or --repair:
- Run
singularity-flow init --check --jsonfirst. Show branch, completeness, missing files, and validation errors. - Validate a supplied Work ID as letters, numbers,
.,_, or-. Ifsetup/<WORK-ID>is current, usesingularity-flow init --repair. Otherwise require a clean tree and runsingularity-flow init --repair --work-id <WORK-ID> [--base <BASE>] --fetch(--baseonly when the person named one; omitted, it is the remote default, never an assumedmain). It creates, reuses or fast-forwards the setup branch. Never initialize the Story branch; leave it forsingularity-flow start <WORK-ID> --from-branch setup/<WORK-ID>after setup is committed and published. Never modify base. - When no Work ID was supplied and the check reports missing assets, run
singularity-flow init --repairon the current branch. - Restore only missing packaged files; never replace customization. Restore invalid files from Git.
- Rerun
singularity-flow init --check --json, then runsingularity-flow doctor --offline --json. Report every remaining failure and warning with its exact fix. - Show
git status --shortand added files. Do not commit or push repair automatically; after review, offer/sf-configuration publishto commit and push the setup branch. - Before the first Story, offer
/sf-readyandsingularity-flow precheck --run --scope dependency-test --json.
If the initial check is complete, change nothing and say the branch is initialized.