sflow-phase

Generate and publish configured artifacts for the active Singularity Flow phase.

SKILL.md

GitHub

Generate the active phase

<!-- sflow-copilot-pause -->

First run singularity-flow phase enter --compose --for-agent --json once in every turn, also after an interrupted one: an earlier turn's entry is context, not this turn's binding. It composes context only when admitted. Lookup from current cwd (non-Git allowed). Never search /Users, $HOME or parents for a repo. Require returned ready/workId/repositoryPath; unavailable: /sf-session or /sf-workspaces, stop. It checks pause before Git. If paused, native Copilot; only offer /sf-pause off, never resume implicitly. Otherwise follow agentGuide.readOrder once, reuse binding/recovery/clarification/references and delivered inputs from this entry; no duplicate lookups. Read clarification.checkpoint: missing answers permit questions, not drafting. Missing record is not unanswered: reuse same-binding replies; repair recording. Never ask users to supply questions or slice control instructions. Use personalization.replyName literally in replies, never artifacts or approval identity.

<!-- sflow-output-contract: clarification-and-artifact -->

Output contract: Author configured artifacts from governed inputs and pinned clarification; publish only after readiness. Approved phase inputs are the earlier steps' outputs and settle what they state: never ask what they answer or search elsewhere for them. 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. On a refusal read remediationPlan: run its first read-only step once and follow context.strategy; never retry an unchanged condition or edit an earlier phase to clear it. One returned automatic plan-hash action (such as sync) may run once, then re-enter once. When a result's act.state is author, or it routes back to this skill with nothing for a person to answer, edit, review or confirm, that is this turn's own work: do it, never relay it. A file edit that does not match is not a refusal: read the file again and redo the edit. Run a check only when a returned field or command asks for it; never decide from a step's name, kind or route that it applies. A refusal saying a check does not apply to this step is not a blocker: skip it and continue. Act on a result's act first: its state, do routes and any ask. A bounded result names agentOutput.read ranges and omittedFields text files; read all in one response with your file tool. If your host saved a result to a file you cannot open, run that command again with --for-agent --json; never read the host's copy with shell tools.

<!-- sflow-execution-boundary -->

Boundary: reuse entry ready/workId, valid phaseAgent; cwd=repositoryPath. Honor mutationContract. Returned workItemRoot/artifact paths only; never $HOME. 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. Blocked: relay resolution.issues[].choices too. Eligible risk needs reason/expiry and authorized human confirmation. Never auto-accept risk.

  1. Use entry authoring; false policyVerified: show policyReason, offer /sf-validate then /sf-recover, stop. If effectiveAuthoringSkill is not /sf-phase, relay it and Terminal equivalent: singularity-flow prepare <phase>, stop; null drafts nothing. retained-generation: relay next, stop.
  2. Review diffs. contextAdmission.pendingEvidence: preserve files/index, repair verified drafts, review contracts before publication. Otherwise stop for human/protected/unowned edits. successor-preparation-required: run successor.preparation.command; preserve private drafts/publications, refresh entry once.
  3. Use entry context.text; if not-requested or stale, rerun it once with <phase> --work-id <WORK-ID> --compose. not-admitted: relay blockers/next, stop; never infer --task. Unavailable World Model is no authoring ban.
  4. Follow clarification.checkpoint; off skips. Reuse same-binding human replies; ask only unanswered/changed questions with ask_user (unavailable: show them and stop; stage chat replies). File-edit {"responses":[...]} at clarification.responseStagingPath, run checkpoint.recordAction alone. On refusal preserve replies/staging; repair recording, not questions. Remove staging only on success; record before preparation. Staging is JSON only, never handwritten governed records.
  5. Run singularity-flow prepare <phase> unless prepared in step 2 or authoringProgress.draft.draftExists. Preparation is not authoring: finish artifact/Agent brief/TODOs (native file-edit tool, context.text/retainedExecutionEvidence); never stop there. Preserve drafts/managed blocks/approvals. Deterministic: regenerator only.
  6. Preserve REQ/AC IDs; /sf-code owns tags. Follow scopeReview. Retained files: evidence fulfillment, primary visual/inspection contracts. Review planningEvidenceRepair when sameTurn; recheck.
  7. Prepublish rechecks recovery; never accept draft holds.
  8. Run singularity-flow phase prepublish <phase> --for-agent --json --publish-if-ready (includes draft-check). Correct every agent finding under correction.class/sameTurn; route others via correction.guidance/correction.skill, code to /sf-code. Never invent, pad, blindly delete markers, nest models or overwrite producers. Follow returned repairLoop.protocol; stop unchanged.
  9. Ready and publishIfReady.published false: use returned commands.publish; advisories and requiredBefore: approve create no hold. Absent: relay commands.next, stop. ARTIFACT_AUTHORING_INCOMPLETE: recheck/retry once if ready. Keep sanitized telemetry/<phase>-gen<N>.json. Never submit/approve.
  10. From publishIfReady.review, report commit/push, model/cost, hash-bound documents. Relay handoff's copilotCommand/command. Not submission/review readiness.