Skip to content

/50-project-resolution

Before setup, determine the correct project directory. The pipeline MUST run in the target project's root, not an unrelated session CWD.

From plugin
signum
1823 skills5 agents23 commands
> /plugin marketplace add heurema/signum
> /plugin install signum@signum

Command definition

50-project-resolution.md

Project Resolution

Before setup, determine the correct project directory. The pipeline MUST run in the target project's root, not an unrelated session CWD.

**Resolution order:**

1. If `SIGNUM_PROJECT_ROOT` is set, validate and use it. 2. If the explicit `project` argument is provided, validate and use it. 3. Otherwise, infer the current git repository root with `git rev-parse --show-toplevel`. 4. If no git root exists, use the current directory only. Do not search arbitrary home or sibling directories.

Use the Bash tool to detect and switch to the target project:

CURRENT_DIR=$(pwd -P)
TARGET_DIR=""

canonicalize_project_root() {
  local dir="$1"
  if [ ! -d "$dir" ]; then
    echo "ERROR: project root is not a directory: $dir" >&2
    exit 1
  fi
  (cd "$dir" && pwd -P)
}

# 1. Explicit environment override
if [ -n "${SIGNUM_PROJECT_ROOT:-}" ]; then
  TARGET_DIR=$(canonicalize_project_root "$SIGNUM_PROJECT_ROOT")
  echo "Using SIGNUM_PROJECT_ROOT: $TARGET_DIR"
fi

# 2. Explicit slash-command project argument, if provided
if [ -z "$TARGET_DIR" ]; then
  # TARGET_DIR=$(canonicalize_project_root "<value of project argument>")
  :
fi

# 3. Deterministic git-root fallback from the current directory
if [ -z "$TARGET_DIR" ]; then
  GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)
  if [ -n "$GIT_ROOT" ]; then
    TARGET_DIR=$(canonicalize_project_root "$GIT_ROOT")
    echo "Using git repository root: $TARGET_DIR"
  fi
fi

# 4. Safe non-git fallback: current directory only
if [ -z "$TARGET_DIR" ]; then
  TARGET_DIR="$CURRENT_DIR"
  echo "WARNING: No git repository root detected. Using current directory only: $TARGET_DIR" >&2
fi

PROJECT_ROOT="$TARGET_DIR"
export PROJECT_ROOT
echo "PROJECT_DIR=$PROJECT_ROOT"

If `PROJECT_ROOT` differs from `CURRENT_DIR`, use `cd "$PROJECT_ROOT"` in ALL subsequent Bash tool calls, or prefix commands with `cd "$PROJECT_ROOT" &&`.

Read more
@heurema
Ships withsignum

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.

Stars on GitHub

Momentum

stars in total
18
Star history of heurema/signum on GitHub, a chart by star-history.com

Other commands on signum.

apply
Auto-invoked

apply

Command

Implement tasks from an OpenSpec change (Experimental)

@heurema@heuremaInstall Command
archive
Auto-invoked

archive

Command

Archive a completed change in the experimental workflow

@heurema@heuremaInstall Command
explore
Auto-invoked

explore

Command

Enter explore mode - think through ideas, investigate problems, clarify requirements

@heurema@heuremaInstall Command
propose
Auto-invoked

propose

Command

Propose a new change - create it and generate all artifacts in one step

@heurema@heuremaInstall Command
sync
Auto-invoked

sync

Command

Sync delta specs from a change to main specs

@heurema@heuremaInstall Command
update
Auto-invoked

update

Command

Update a change - revise existing planning artifacts and keep them coherent (Experimental)

@heurema@heuremaInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command