ask-handoff

Claude Code runbook — greeting capability gate (subagent)

slug sophia-bot-2026-10-30-greeting-capability-gate-claude-code project sophia-bot source cursor updated 10/30/2026, 5:47:44 PM

Claude Code runbook — greeting capability gate

Role: This plan is for Claude Code in an interactive terminal, invoked by the Cursor orchestrator. Not for Cursor execute unless the human overrides. Parent plan: sophia-bot-2026-10-30-greeting-capability-gate Task: TICKET-108744 (+108597) Worktree: /home/asksuite/Documentos/.agent-worktrees/sophia-bot/ticket-108744 Branch: fix/TICKET-108744-greeting-day-use-offer (no upstream)

Orchestrator contract

  1. Open interactive terminal (human can type mid-run).
  2. cd into the worktree above.
  3. Launch Claude Code once per task (or one session that does tasks in order — human chooses).
  4. Paste the Task brief for the current task only.
  5. Wait for the Output block (format below). Do not accept long essays as done.
  6. Orchestrator reviews diffs + output → next task or review skill.
  7. No commit. No push. Human asks separately.

Suggested launch (adjust to local Claude Code CLI):

cd /home/asksuite/Documentos/.agent-worktrees/sophia-bot/ticket-108744
# interactive — leave TTY attached; do not pipe away stdin
claude

If the CLI needs a one-shot prompt flag, still keep the session interactive so the human can intervene.

Hard rules for Claude Code

  • Read parent plan acceptance; implement one task at a time (TDD red→green).
  • Repo: only this worktree. Do not touch other repos.
  • Follow AGENTS.md (incl. prompt rules: general gates, no incident answer-keys).
  • No new code comments. No drive-by refactors.
  • End every task with the Output block only (plus errors if any).

Output block (mandatory — keep short)

STATUS: DONE | BLOCKED | PARTIAL
TASK: <N>
FILES: <comma-separated paths changed>
VERIFY: <exact pytest command> → <pass|fail|skipped> (<n passed>/<n>)
DIFF_SUMMARY: <one line>
NEXT: <ready for task N+1 | need human: …>
BLOCKERS: <none | …>

No prose outside this block unless STATUS=BLOCKED (then ≤5 lines).

Task briefs (paste one)

Brief — Task 1 (Critic)

Parent: ask-handoff plan sophia-bot-2026-10-30-greeting-capability-gate Task 1. TDD first: create tests/test_unit/test_response_critic_capability_gate.py, then edit src/agents/reason/reason_core/llm/response_critic.py. Gate: pure help/greeting exempt; naming specific product/service/amenity as offerable requires grounding; tool-backed quotation/form offers stay exempt; no “don’t say day use” ban. Verify: pipenv run pytest tests/test_unit/test_response_critic_capability_gate.py -q Emit Output block.

Brief — Task 2 (Reason unit)

Parent Task 2. TDD: tests/test_unit/test_reason_unit_capability_gate_prompt.py using _capture_system_prompt pattern from tests/test_unit/test_graph_configuration.py. Edit src/agents/reason/reason_unit/graph.py: drop day use prices/rates from primary-contact bullet; add general greeting/offer gate (grounded products / tool-backed only). Verify: pipenv run pytest tests/test_unit/test_reason_unit_capability_gate_prompt.py -q Emit Output block.

Brief — Task 3 (Reason chain)

Parent Task 3. Same as Task 2 for src/agents/reason/reason_chain/graph.py + tests/test_unit/test_reason_chain_capability_gate_prompt.py. Verify: pipenv run pytest tests/test_unit/test_reason_chain_capability_gate_prompt.py -q Emit Output block.

Brief — Task 4 (Integration smoke)

Parent Task 4. Create tests/test_integration/test_reason_greeting_capability_gate.py: bare PT greeting must not advertise Day Use without sources. Skip cleanly if no LLM env. Verify: pipenv run pytest tests/test_integration/test_reason_greeting_capability_gate.py -q Emit Output block.

Brief — Task 5 (Sweep)

Parent Task 5. Run focused unit sweep from parent plan; fix only regressions from Tasks 1–4. Verify: command from parent Task 5. Emit Output block.

After all tasks

Orchestrator runs leanflow review (designated model). Human validates. Commit only on explicit ask (TICKET-108744 - fix: …, note 108597 in PR/body).