/80-phase-execute
**Goal:** Implement code changes according to the contract.
$ npx -y skills add heurema/signum --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/80-phase-execute
Context preview
What this command does when you run it.
**Goal:** Implement code changes according to the contract.
Command definition
80-phase-execute.mdPhase 2: EXECUTE
**Goal:** Implement code changes according to the contract.
Step 2.0: Capture baseline (before any changes)
Use the Bash tool to record the current commit SHA (audit chain: this is where the Engineer starts from) and run project checks BEFORE the engineer touches anything:
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
CONTRACT_PATH="${ARTIFACT_ROOT}contract.json"
EXECUTION_CONTEXT_PATH="${ARTIFACT_ROOT}execution_context.json"
BASELINE_PATH="${ARTIFACT_ROOT}baseline.json"
# Record base commit for audit chain
BASE_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "no-git")
EXECUTE_START=$(date -u +%Y-%m-%dT%H:%M:%SZ)
echo "{\"base_commit\":\"$BASE_COMMIT\",\"started_at\":\"$EXECUTE_START\"}" > "$EXECUTION_CONTEXT_PATH"
echo "Execution context: base_commit=$BASE_COMMIT"
# Set run_id for receipt chain
RUN_ID=$(jq -r '.contractId // "signum-run"' "$CONTRACT_PATH")
jq --arg rid "$RUN_ID" '. + {run_id:$rid}' "$EXECUTION_CONTEXT_PATH" > "${EXECUTION_CONTEXT_PATH}.tmp" \
&& mv "${EXECUTION_CONTEXT_PATH}.tmp" "$EXECUTION_CONTEXT_PATH"
# Lint
if [ -f "pyproject.toml" ] && grep -q "ruff" pyproject.toml 2>/dev/null; then
BL_LINT_EXIT=$(ruff check . >/dev/null 2>&1; echo $?)
elif [ -f "package.json" ] && grep -q "eslint" package.json 2>/dev/null; then
BL_LINT_EXIT=$(npx eslint . >/dev/null 2>&1; echo $?)
else
BL_LINT_EXIT=0
fi
# Typecheck
if [ -f "pyproject.toml" ] && grep -q "mypy" pyproject.toml 2>/dev/null; then
BL_TYPE_EXIT=$(mypy . >/dev/null 2>&1; echo $?)
elif [ -f "tsconfig.json" ]; then
BL_TYPE_EXIT=$(npx tsc --noEmit >/dev/null 2>&1; echo $?)
else
BL_TYPE_EXIT=0
fi
# Tests — capture per-test names for regression tracking
if [ -f "pyproject.toml" ] && grep -q "pytest" pyproject.toml 2>/dev/null; then
BL_TEST_RAW=$(pytest --tb=no -q 2>&1)
BL_TEST_EXIT=$?
BL_TEST_FAILING=$(echo "$BL_TEST_RAW" | grep -E '^FAILED ' | sed 's/^FAILED //' | sed 's/ - .*//' | jq -R . | jq -s .)
[ -z "$BL_TEST_FAILING" ] && BL_TEST_FAILING='[]'
elif [ -f "package.json" ] && grep -q '"test"' package.json 2>/dev/null; then
BL_TEST_EXIT=$(npm test >/dev/null 2>&1; echo $?)
BL_TEST_FAILING='[]'
elif [ -f "Cargo.toml" ]; then
BL_TEST_EXIT=$(cargo test >/dev/null 2>&1; echo $?)
BL_TEST_FAILING='[]'
else
BL_TEST_EXIT=0
BL_TEST_FAILING='[]'
fi
jq -n \
--argjson lint "$BL_LINT_EXIT" \
--argjson type "$BL_TYPE_EXIT" \
--argjson test "$BL_TEST_EXIT" \
--argjson failing "$BL_TEST_FAILING" \
'{ lint: $lint, typecheck: $type, tests: { exit_code: $test, failing: $failing } }' > "$BASELINE_PATH"
echo "Baseline captured: lint=$BL_LINT_EXIT type=$BL_TYPE_EXIT test=$BL_TEST_EXIT"If `repo-contract.json` exists in the project root, also capture invariant baseline to `repo_contract_baseline.json` under the canonical artifact root:
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
REPO_CONTRACT_BASELINE_PATH="${ARTIFACT_ROOT}repo_contract_baseline.json"
if [ -f "repo-contract.json" ]; then
python3 - "$REPO_CONTRACT_BASELINE_PATH" <<'PY'
import json
import subprocess
import sys
output_path = sys.argv[1]
with open('repo-contract.json') as f:
rc = json.load(f)
results = {}
for inv in rc.get('invariants', []):
r = subprocess.run(inv['verify'], shell=True, capture_output=True, text=True)
results[inv['id']] = {
'description': inv['description'],
'severity': inv['severity'],
'verify': inv['verify'],
'exit_code': r.returncode,
'passed': r.returncode == 0,
}
with open(output_path, 'w') as f:
json.dump(results, f, indent=2)
total = len(results)
passed = sum(1 for v in results.values() if v['passed'])
print(f'Repo-contract baseline: {passed}/{total} invariants passing')
PY
fiStep 2.0.5: Capture pre-execute snapshot (receipt chain)
Use the Bash tool to capture a deterministic workspace snapshot before the engineer runs. This snapshot anchors the receipt chain, and it is written under the canonical artifact root so `base_tree_hash` in the execute receipt references the active contract's snapshot.
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
SNAPSHOT_PATH="${ARTIFACT_ROOT}snapshots/execute-attempt-01.json"
# Resolve snapshot-tree.sh from known trusted Signum install roots only.
_SIGNUM_SNAPSHOT=""
for _d in \
"${_REAL_HOME:=$HOME}/.claude/plugins/signum/platforms/claude-code" \
"${_REAL_HOME}/.local/share/emporium/signum/platforms/claude-code" \
"${_REAL_HOME}/.nex/plugins/signum/platforms/claude-code"; do
[ -f "${_d}/lib/snapshot-tree.sh" ] || continue
_SIGNUM_SNAPSHOT="${_d}/lib/snapshot-tree.sh"
break
done
if [ -z "$_SIGNUM_SNAPSHOT" ]; then
echo "WARNING: snapshot-tree.sh not found — receipt chain will be incomplete"
else
bash "$_SIGNUM_SNAPSHOT" execute-attempt-01 --workspace-root "$PWD" --signum-dir "$ARTIFACT_ROOT"
echo "Pre-execute snapshot captured"
fiStep 2.0.6: Codebase Awareness hint context
Use the Bash tool to derive optional Codebase Awareness context before launching the Engineer. Context generation stays non-blocking; reuse decision validation runs after the Engineer returns.
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
CONTRACT_PATH="${ARTIFACT_ROOT}contract.json"
CONTRACT_ENGINEER_PATH="${ARTIFACT_ROOT}contract-engineer.json"
CODEBASE_INDEX_PATH=".signum/cache/codebase-index-v1.json"
STYLE_PROFILE_PATH=".signum/cache/style-profile-v1.json"
FILE_DIGESTS_PATH=".signum/cache/file-digests-v1.json"
FILE_EXTRACTS_PATH=".signum/cache/file-extracts-v1.json"
IMPLEMENTATION_CONTEXT_PATH="${ARTIFACT_ROOT}implementation_context.json"
REUSE_CANDIDATES_PATH="${ARTIFACT_ROOT}reuse_candidates.json"
REUSE_DECISION_PATH="${ARTIFACT_ROOT}reuse_decision.json"
_PRead more
Phase 2: EXECUTE
**Goal:** Implement code changes according to the contract.
Step 2.0: Capture baseline (before any changes)
Use the Bash tool to record the current commit SHA (audit chain: this is where the Engineer starts from) and run project checks BEFORE the engineer touches anything:
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
CONTRACT_PATH="${ARTIFACT_ROOT}contract.json"
EXECUTION_CONTEXT_PATH="${ARTIFACT_ROOT}execution_context.json"
BASELINE_PATH="${ARTIFACT_ROOT}baseline.json"
# Record base commit for audit chain
BASE_COMMIT=$(git rev-parse HEAD 2>/dev/null || echo "no-git")
EXECUTE_START=$(date -u +%Y-%m-%dT%H:%M:%SZ)
echo "{\"base_commit\":\"$BASE_COMMIT\",\"started_at\":\"$EXECUTE_START\"}" > "$EXECUTION_CONTEXT_PATH"
echo "Execution context: base_commit=$BASE_COMMIT"
# Set run_id for receipt chain
RUN_ID=$(jq -r '.contractId // "signum-run"' "$CONTRACT_PATH")
jq --arg rid "$RUN_ID" '. + {run_id:$rid}' "$EXECUTION_CONTEXT_PATH" > "${EXECUTION_CONTEXT_PATH}.tmp" \
&& mv "${EXECUTION_CONTEXT_PATH}.tmp" "$EXECUTION_CONTEXT_PATH"
# Lint
if [ -f "pyproject.toml" ] && grep -q "ruff" pyproject.toml 2>/dev/null; then
BL_LINT_EXIT=$(ruff check . >/dev/null 2>&1; echo $?)
elif [ -f "package.json" ] && grep -q "eslint" package.json 2>/dev/null; then
BL_LINT_EXIT=$(npx eslint . >/dev/null 2>&1; echo $?)
else
BL_LINT_EXIT=0
fi
# Typecheck
if [ -f "pyproject.toml" ] && grep -q "mypy" pyproject.toml 2>/dev/null; then
BL_TYPE_EXIT=$(mypy . >/dev/null 2>&1; echo $?)
elif [ -f "tsconfig.json" ]; then
BL_TYPE_EXIT=$(npx tsc --noEmit >/dev/null 2>&1; echo $?)
else
BL_TYPE_EXIT=0
fi
# Tests — capture per-test names for regression tracking
if [ -f "pyproject.toml" ] && grep -q "pytest" pyproject.toml 2>/dev/null; then
BL_TEST_RAW=$(pytest --tb=no -q 2>&1)
BL_TEST_EXIT=$?
BL_TEST_FAILING=$(echo "$BL_TEST_RAW" | grep -E '^FAILED ' | sed 's/^FAILED //' | sed 's/ - .*//' | jq -R . | jq -s .)
[ -z "$BL_TEST_FAILING" ] && BL_TEST_FAILING='[]'
elif [ -f "package.json" ] && grep -q '"test"' package.json 2>/dev/null; then
BL_TEST_EXIT=$(npm test >/dev/null 2>&1; echo $?)
BL_TEST_FAILING='[]'
elif [ -f "Cargo.toml" ]; then
BL_TEST_EXIT=$(cargo test >/dev/null 2>&1; echo $?)
BL_TEST_FAILING='[]'
else
BL_TEST_EXIT=0
BL_TEST_FAILING='[]'
fi
jq -n \
--argjson lint "$BL_LINT_EXIT" \
--argjson type "$BL_TYPE_EXIT" \
--argjson test "$BL_TEST_EXIT" \
--argjson failing "$BL_TEST_FAILING" \
'{ lint: $lint, typecheck: $type, tests: { exit_code: $test, failing: $failing } }' > "$BASELINE_PATH"
echo "Baseline captured: lint=$BL_LINT_EXIT type=$BL_TYPE_EXIT test=$BL_TEST_EXIT"If `repo-contract.json` exists in the project root, also capture invariant baseline to `repo_contract_baseline.json` under the canonical artifact root:
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
REPO_CONTRACT_BASELINE_PATH="${ARTIFACT_ROOT}repo_contract_baseline.json"
if [ -f "repo-contract.json" ]; then
python3 - "$REPO_CONTRACT_BASELINE_PATH" <<'PY'
import json
import subprocess
import sys
output_path = sys.argv[1]
with open('repo-contract.json') as f:
rc = json.load(f)
results = {}
for inv in rc.get('invariants', []):
r = subprocess.run(inv['verify'], shell=True, capture_output=True, text=True)
results[inv['id']] = {
'description': inv['description'],
'severity': inv['severity'],
'verify': inv['verify'],
'exit_code': r.returncode,
'passed': r.returncode == 0,
}
with open(output_path, 'w') as f:
json.dump(results, f, indent=2)
total = len(results)
passed = sum(1 for v in results.values() if v['passed'])
print(f'Repo-contract baseline: {passed}/{total} invariants passing')
PY
fiStep 2.0.5: Capture pre-execute snapshot (receipt chain)
Use the Bash tool to capture a deterministic workspace snapshot before the engineer runs. This snapshot anchors the receipt chain, and it is written under the canonical artifact root so `base_tree_hash` in the execute receipt references the active contract's snapshot.
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
SNAPSHOT_PATH="${ARTIFACT_ROOT}snapshots/execute-attempt-01.json"
# Resolve snapshot-tree.sh from known trusted Signum install roots only.
_SIGNUM_SNAPSHOT=""
for _d in \
"${_REAL_HOME:=$HOME}/.claude/plugins/signum/platforms/claude-code" \
"${_REAL_HOME}/.local/share/emporium/signum/platforms/claude-code" \
"${_REAL_HOME}/.nex/plugins/signum/platforms/claude-code"; do
[ -f "${_d}/lib/snapshot-tree.sh" ] || continue
_SIGNUM_SNAPSHOT="${_d}/lib/snapshot-tree.sh"
break
done
if [ -z "$_SIGNUM_SNAPSHOT" ]; then
echo "WARNING: snapshot-tree.sh not found — receipt chain will be incomplete"
else
bash "$_SIGNUM_SNAPSHOT" execute-attempt-01 --workspace-root "$PWD" --signum-dir "$ARTIFACT_ROOT"
echo "Pre-execute snapshot captured"
fiStep 2.0.6: Codebase Awareness hint context
Use the Bash tool to derive optional Codebase Awareness context before launching the Engineer. Context generation stays non-blocking; reuse decision validation runs after the Engineer returns.
source lib/contract-dir.sh 2>/dev/null || true
ARTIFACT_ROOT="$(active_artifact_root 2>/dev/null || echo .signum/)"
CONTRACT_PATH="${ARTIFACT_ROOT}contract.json"
CONTRACT_ENGINEER_PATH="${ARTIFACT_ROOT}contract-engineer.json"
CODEBASE_INDEX_PATH=".signum/cache/codebase-index-v1.json"
STYLE_PROFILE_PATH=".signum/cache/style-profile-v1.json"
FILE_DIGESTS_PATH=".signum/cache/file-digests-v1.json"
FILE_EXTRACTS_PATH=".signum/cache/file-extracts-v1.json"
IMPLEMENTATION_CONTEXT_PATH="${ARTIFACT_ROOT}implementation_context.json"
REUSE_CANDIDATES_PATH="${ARTIFACT_ROOT}reuse_candidates.json"
REUSE_DECISION_PATH="${ARTIFACT_ROOT}reuse_decision.json"
_PSignum 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.
Other commands on signum.
- /apply
Implement tasks from an OpenSpec change (Experimental)
Open command - /archive
Archive a completed change in the experimental workflow
Open command - /explore
Enter explore mode - think through ideas, investigate problems, clarify requirements
Open command - /propose
Propose a new change - create it and generate all artifacts in one step
Open command - /sync
Sync delta specs from a change to main specs
Open command - /update
Update a change - revise existing planning artifacts and keep them coherent (Experimental)
Open command

