apply
Implement tasks from an OpenSpec change (Experimental)
Optional: --force to overwrite existing files, --harness to scaffold repo-level harness docs, --project-root <path> to specify target directory
> /plugin marketplace add heurema/signum > /plugin install signum@signum
How it fires
How this command gets triggered: by you, by Claude, or both.
/initContext preview
What this command does when you run it.
Optional: --force to overwrite existing files, --harness to scaffold repo-level harness docs, --project-root <path> to specify target directory
name: init
description: Bootstrap project context (project.intent.md and project.glossary.json) from an existing codebase using deterministic scan + LLM synthesis + interactive editing. Use --harness to scaffold additional repo-level harness docs.
arguments:
- name: flags
description: "Optional: --force to overwrite existing files, --harness to scaffold repo-level harness docs, --project-root <path> to specify target directory"
required: falseYou are the Signum Init orchestrator. Bootstrap project context for a new or existing project.
The user's arguments: `$ARGUMENTS`
SCAN → SYNTHESIZE → PRESENT → VERIFY
---
Parse `$ARGUMENTS`:
**Usage:**
/signum:init [--force] [--harness] [--project-root <path>]
For Claude Code plugin usage, `/signum:init` is the canonical form. `--harness` requires Signum `>= v4.18.0`.
---
Run:
resolve_signum_helper() {
local helper="$1"
if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/lib/${helper}" ]; then
printf '%s\n' "${CLAUDE_PLUGIN_ROOT}/lib/${helper}"
return 0
fi
if [ -f "lib/${helper}" ]; then
printf '%s\n' "lib/${helper}"
return 0
fi
echo "ERROR: Signum helper not found: ${helper}" >&2
return 1
}
INIT_SCANNER_PATH=$(resolve_signum_helper "init-scanner.sh") || exit 1
INIT_HARNESS_SCAFFOLD_PATH=$(resolve_signum_helper "init-harness-scaffold.sh") || exit 1
printf 'INIT_SCANNER_PATH=%s\n' "$INIT_SCANNER_PATH"
printf 'INIT_HARNESS_SCAFFOLD_PATH=%s\n' "$INIT_HARNESS_SCAFFOLD_PATH"Save the resolved helper paths as `INIT_SCANNER_PATH` and `INIT_HARNESS_SCAFFOLD_PATH`.
Run:
ls project.intent.md 2>/dev/null && echo "INTENT_EXISTS=true" || echo "INTENT_EXISTS=false" ls project.glossary.json 2>/dev/null && echo "GLOSSARY_EXISTS=true" || echo "GLOSSARY_EXISTS=false"
If `HARNESS_MODE=true`, also run:
bash "$INIT_HARNESS_SCAFFOLD_PATH" --project-root "${PROJECT_ROOT:-.}" 2>/dev/nullSave this JSON as HARNESS_SCAFFOLD. It contains the additional harness-doc drafts plus `.missingCount` / `.existingCount`.
If `HARNESS_MODE=true` AND **both** `project.intent.md` and `project.glossary.json` already exist AND `--force` was NOT provided:
Harness docs already exist. No files written.
and stop.
If `HARNESS_MODE=false` AND (`project.intent.md` OR `project.glossary.json` already exists) AND `--force` was NOT provided:
project.intent.md already exists. To overwrite, run: /signum:init --force To update (merge), run: /signum:init --force
bash "$INIT_SCANNER_PATH" --project-root "${PROJECT_ROOT:-.}" 2>/dev/nullSave the output JSON as SCAN_SIGNALS. This contains all signals needed for synthesis.
Report to user:
SCAN complete. Found signals: - Authoritative docs: [yes/no] - CLAUDE.md: [yes/no] - README.md: [yes/no] - Package manifest: [yes/no] - Git history (6 months): [N commits] - Public entrypoints: [N found] - Existing glossary: [yes/no] - Existing intent: [yes/no] - Harness docs missing: [N] (only when --harness) - Harness docs already present: [N] (only when --harness)
---
If `HARNESS_MODE=true`, harness docs come from `INIT_HARNESS_SCAFFOLD_PATH` (deterministic; do NOT ask the synthesizer to invent them).
If existing `project.intent.md` **and** `project.glossary.json` are both being preserved (harness-only brownfield mode), skip the synthesizer entirely.
Otherwise, pass SCAN_SIGNALS to the init-synthesizer agent. The synthesizer will: 1. Apply source precedence hierarchy (docs/ > CLAUDE.md > README > package.json) 2. Generate `project.intent.md` with evidence comments and confidence annotations 3. Generate `project.glossary.json` with canonicalTerms and aliases 4. Emit coverage summary
**Key rules enforced by synthesizer:**
---
Show the generated drafts to the user with a separator:
════════════════════════════════════════ DRAFT: project.intent.md ════════════════════════════════════════ [full generated content] ════════════════════════════════════════ DRAFT: project.glossary.json ════════════════════════════════════════ [full generated content] ════════════════════════════════════════
Then ask:
Review the drafts above. Options: [1] Accept and write both files [2] Edit intent first, then write [3] Edit glossary first, then write [4] Accept intent only, skip glossary [5] Cancel (write nothing) Enter choice (1-5):
Wait for user confirmation before writing any file.
If the user chooses to edit (options 2 or 3), open the draft for editing and present the revised version before final write.
On cancel (option 5): print "Cancelled. No files written." and stop.
If brownfield preserve mode is active (existing intent + glossary kept as-is), show only the missing harness-doc drafts:
═════
Signum is a contract-first proof gate for agentic software changes: it turns a task into a reviewed contract, executes against that contract, audits the result, and packages evidence that humans and CI can inspect.
Repo: heurema/signum
Implement tasks from an OpenSpec change (Experimental)
Archive a completed change in the experimental workflow
Enter explore mode - think through ideas, investigate problems, clarify requirements
Propose a new change - create it and generate all artifacts in one step