con un clic
jat-complete
// Complete current JAT task with full verification. Verifies work (tests/lint), commits changes, writes memory entry, closes task, and emits final signal. Session ends after completion.
// Complete current JAT task with full verification. Verifies work (tests/lint), commits changes, writes memory entry, closes task, and emits final signal. Session ends after completion.
Onboard a new client project — analyze client docs, create knowledge bases, write Supabase migration, generate PRD and tasktree. Run after jst-new has set up the mechanical scaffolding.
Begin working on a JAT task. Registers agent identity, selects a task, searches memory, detects conflicts, declares files, emits IDE signals, and starts work. Use this at the beginning of every JAT session.
Escalatory browser verification - open the app in a real browser and test the feature you built. Use after showing "READY FOR REVIEW" when the user asks you to verify in a browser.
| name | jat-complete |
| description | Complete current JAT task with full verification. Verifies work (tests/lint), commits changes, writes memory entry, closes task, and emits final signal. Session ends after completion. |
| metadata | {"author":"jat","version":"1.0"} |
Complete current task with full verification protocol. Session ends after completion.
/skill:jat-complete # Complete task, show completion block
/skill:jat-complete --kill # Complete and auto-kill session
jt close)You MUST have emitted a review signal before running this:
jat-signal review '{
"taskId": "TASK_ID",
"taskTitle": "TASK_TITLE",
"summary": ["What you accomplished"],
"filesModified": [
{"path": "src/file.ts", "changeType": "modified", "linesAdded": 50, "linesRemoved": 10}
]
}'
Check the tmux session name or identity file:
TMUX_SESSION=$(tmux display-message -p '#S' 2>/dev/null)
# Agent name is the tmux session without "jat-" prefix
AGENT_NAME="${TMUX_SESSION#jat-}"
Find your in-progress task:
jt list --json | jq -r '.[] | select(.assignee == "AGENT_NAME" and .status == "in_progress") | .id'
If no task found, check for spontaneous work (uncommitted changes without a formal task).
Only if no in_progress task was found.
Check git status and conversation context for work that was done without a formal task:
git status --porcelain
git diff --stat
git log --oneline -5
If work is detected, propose creating a backfill task record:
jt create "INFERRED_TITLE" \
--type INFERRED_TYPE \
--description "INFERRED_DESCRIPTION" \
--assignee "$AGENT_NAME" \
--status in_progress
If no work detected, exit the completion flow.
Run verification checks appropriate to the project:
# Emit verifying signal
jat-step verifying --task "$TASK_ID" --title "$TASK_TITLE" --agent "$AGENT_NAME"
# Then run checks:
# - Tests (npm test, pytest, etc.)
# - Lint (eslint, ruff, etc.)
# - Type check (tsc --noEmit, etc.)
# - Build (npm run build, etc.)
If verification fails, stop and fix issues before continuing.
Only update docs when changes affect how others use the codebase:
Most tasks do NOT need doc updates.
# Get task type for commit prefix
TASK_TYPE=$(jt show "$TASK_ID" --json | jq -r '.[0].issue_type // "task"')
# Commit with proper message format
jat-step committing --task "$TASK_ID" --title "$TASK_TITLE" --agent "$AGENT_NAME" --type "$TASK_TYPE"
If jat-step is not available, commit manually:
# Stage ONLY the specific files you modified — never git add -A, git add ., or git add -u
git add path/to/file1 path/to/file2
git commit -m "TASK_TYPE($TASK_ID): TASK_TITLE
Co-Authored-By: Pi Agent <noreply@pi.dev>"
Save context from this session for future agents. Use the Write tool to create:
.jat/memory/{YYYY-MM-DD}-{taskId}-{slug}.md
Include YAML frontmatter (task, agent, project, completed, files, tags, labels, priority, type) and sections: Summary, Approach, Decisions (if notable), Key Files, Lessons (if any).
Then trigger incremental index:
jat-memory index --project "$(pwd)"
If indexing fails, log the error but continue. Memory is non-blocking.
Posts a customer-facing reply comment BEFORE close for tasks that originated from user feedback. Comments are the canonical channel per epic jat-47wul — they render in the IDE thread AND in the feedback widget back to the reporter (jat-47wul.4). The server forces external: true for author_type: agent per jat-47wul.2, so agent comments are always customer-visible.
KILL_FLAG=""
if [[ "$IS_KILL" == true ]]; then KILL_FLAG="--kill"; fi
jat-step replying --task "$TASK_ID" --title "$TASK_TITLE" --agent "$AGENT_NAME" $KILL_FLAG
jat-step replying generates a completion bundle, extracts the LLM-authored devResponse field, resolves the reporter from task identity (approver → requester → creator), and POSTs the reply via /api/tasks/:id/comments. The bundle is cached at /tmp/jat-bundle-<task>.json so STEP 6 reuses it without paying for a second LLM call.
The step is non-blocking. It silently exits 0 when:
ANTHROPIC_API_KEY is unset or bundle generation failsdevResponse (LLM determined task isn't user-originated)localhost:3333For internal chores, refactors, and dev-spawned tasks with no external reporter, no comment is posted and the close proceeds normally.
jat-step closing --task "$TASK_ID" --title "$TASK_TITLE" --agent "$AGENT_NAME"
Or manually:
jt close "$TASK_ID" --reason "Completed by $AGENT_NAME"
Note: Integration callbacks (Supabase status sync, dev_notes) fire automatically from
jt close— no agent action needed. Notes are sourced from: review signal → git commits → assignee name.
jt epic close-eligible
jat-step complete --task "$TASK_ID" --title "$TASK_TITLE" --agent "$AGENT_NAME"
This generates a structured completion bundle and emits the final complete signal.
Then output the completion banner:
TASK COMPLETED: $TASK_ID
Agent: $AGENT_NAME
Summary:
- [accomplishment 1]
- [accomplishment 2]
Quality: tests passing, build clean
Session complete. Spawn a new agent for the next task.
| State | Meaning | Task Status |
|---|---|---|
| Ready for Review | Code done, awaiting user decision | in_progress |
| Complete | Closed, reservations released | closed |
Never say "Task Complete" until jt close has run.
No task in progress:
No task in progress. Run /skill:jat-start to pick a task.
Verification failed:
Verification failed:
- 2 tests failing
- 5 lint errors
Fix issues and try again.
| Step | Name | Tool |
|---|---|---|
| 1 | Get Task and Agent Identity | jt list, tmux |
| 1D | Spontaneous Work Detection | git status |
| 2 | Verify Task | jat-step verifying |
| 2.5 | Update Documentation | (if appropriate) |
| 3 | Commit Changes | jat-step committing |
| 3.5 | Write Memory Entry | Write tool + jat-memory index |
| 4 | Mark Task Complete | jat-step closing (callback fires automatically) |
| 4.5 | Auto-Close Epics | jt epic close-eligible |
| 5 | Emit Completion Signal | jat-step complete |