---
name: contextia-start
description: Begin a work session on a Contextia task. Loads full context including project identity, relevant specs, norms, and previous session logs. Use at the start of any coding session, when the user says "start working on", "let's work on task", "begin task", "pick up task", or mentions a task ID.
argument-hint: [task-id]
---

# Session start: $ARGUMENTS

## Project identity
!`cat .contextia/system/identity.md 2>/dev/null || echo "(no identity.md — run /contextia-init-new or /contextia-init-existing first)"`

## Task definition
!`cat .contextia/work/tasks/*$(echo "$ARGUMENTS" | tr '[:upper:]' '[:lower:]' | sed 's/task-//')*.md 2>/dev/null || find .contextia/work/tasks/ -name "*.md" | xargs grep -l "$ARGUMENTS" 2>/dev/null | head -1 | xargs cat 2>/dev/null || echo "(task not found — run /contextia-new-task to create it)"`

## Relevant specs
!`uv run contextia context "$ARGUMENTS" --format context 2>/dev/null || echo "(contextia context not yet available — read specs manually from .contextia/system/specs/)"`

## Last session log
!`uv run contextia log last "$ARGUMENTS" --format context 2>/dev/null || find .contextia/work/active/ -path "*$ARGUMENTS*" -name "*.md" | sort | tail -1 | xargs cat 2>/dev/null || echo "(no previous session log for this task)"`

## Active proposals
!`find .contextia/work/active/ -path "*proposals*" -name "*.md" 2>/dev/null | xargs cat 2>/dev/null || echo "(no pending proposals)"`

---

You now have full context for this session. Before writing code:

1. Confirm you understand the task goal and the done criteria
2. Note any open questions from previous session logs
3. Check if pending proposals need to be promoted before continuing
4. If you need to change a spec, use `/contextia-propose` — never edit `system/` directly

At the end of the session, the user will run `/contextia-end $ARGUMENTS`.
