Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Please choose versions by [Semantic Versioning](http://semver.org/).
## Unreleased

- refactor(plugin): rename orchestration-mode flag `--tool` → `--non-interactive` and internal label `MODE=tool` → `MODE=non_interactive` across create-task, create-goal, complete-task, complete-goal, defer-task, defer-goal commands and task-creator, goal-creator, goal-manager-agent agents; the command/agent instructions still accept `--tool` as a deprecated alias for one release. These flags are Claude Code slash-command arguments interpreted by the agent instructions — not vault-cli binary flags.
- feat(plugin): `/vault-cli:work-on-task` accepts `--non-interactive` — still orients the task (assistant sets status, tracks the daily note, discovers guides) but skips the create-task prompt (Phase 4) and the plan-task/execute-task sharpening chain (Phase 5), so headless callers (e.g. `vault-cli work-on`'s `claude --print` bootstrap) orient and stop instead of hanging on `AskUserQuestion`

## v0.96.0

Expand Down
15 changes: 11 additions & 4 deletions commands/work-on-task.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Find task details, transition Jira, set status, track on daily note, discover guides, then auto-sharpen and gate the planning → execution transition
argument-hint: "<jira-id-or-text>"
argument-hint: "<jira-id-or-text> [--non-interactive]"
allowed-tools: [Task, AskUserQuestion, Skill, Bash(vault-cli *)]
---

Expand All @@ -16,14 +16,17 @@ Find task details and relevant operational guides before starting work. Delegate

## Process

1. **Validate input**
- If no argument: `❌ Pass a task identifier or description.` and STOP
1. **Parse input**
- Parse `$ARGUMENTS`: if it contains `--non-interactive` → set `MODE=non_interactive` and strip that flag token from the arguments; otherwise `MODE=interactive`. Parsing is self-contained here — it does not depend on any other command. Use the stripped arguments as the task identifier everywhere below — NEVER pass the flag token into the assistant prompt or task search.
- If no argument remains after stripping: `❌ Pass a task identifier or description.` and STOP

**`MODE=non_interactive`** exists for headless callers — e.g. `vault-cli work-on`'s Claude bootstrap runs `claude --print`, which cannot answer `AskUserQuestion`, so an interactive gate would block until the session-start timeout. In this mode the command NEVER calls `AskUserQuestion` and NEVER runs the interactive sharpening chain (Phase 5): it orients (via the assistant) and stops. Interactive sharpening resumes later when the session is opened in a real terminal.

2. **Invoke work-on-task-assistant**
```
Task tool with:
subagent_type: 'vault-cli:work-on-task-assistant'
prompt: 'Find details and guides for: {arguments}'
prompt: 'Find details and guides for: {stripped arguments}'
```

3. **Auto-sharpen + auto-gate (Phase 5).** If the assistant's report ends with `Ready to work on this task.` (the `found` case), continue to Phase 5 below. If the report contains the `not_found:` marker, skip Phase 5 and run Phase 4 (Handle not_found) instead.
Expand All @@ -45,6 +48,8 @@ Output ends with `Ready to work on this task.`

The agent (dispatched in `## Process` step 2) emits a structured `not_found` verdict from its own Phase 1 (`Find task`) when the requested task cannot be found in any source. This phase parses that verdict and asks the user before any file is created.

**Non-interactive gate (checked first):** If `MODE=non_interactive`, do NOT call `AskUserQuestion` and do NOT create anything. Print the `not_found:` report — the `Searched:` block from the verdict, then `❌ Task not found: "<input>"` — followed by `ℹ️ Non-interactive mode: no task created. Re-run in a terminal to create one.` and STOP. Skip steps 1–7 below (they are the interactive create-gate).

1. **Parse the agent's report** for the `not_found:` marker AND capture the verdict body into variables. The agent's `<output_format>` defines two separate fenced markdown blocks — one for the `found` case (ends with `Ready to work on this task.`) and one for the `not_found:` case (literal `not_found:` header on its own line). Look for the `not_found:` block specifically; if the report ends with `Ready to work on this task.` and contains no `not_found:` block, Phase 4 is a no-op and you are done. When the `not_found:` block IS present, match on the `not_found:` token, then extract:
- `SEARCHED_BLOCK` — the bullet list under the `Searched:` line (verbatim, line-by-line, until the next blank line or `Suggested task name:` line)
- `SUGGESTED_NAME` — the value after `Suggested task name:` (verbatim, trimmed)
Expand Down Expand Up @@ -78,6 +83,8 @@ Goal: by the time work-on-task returns, the resolved task is in `phase: planning

Runs only after Phase 2 returned a `found` task — never on `not_found` (Phase 4 handles that branch).

**Non-interactive gate (checked first):** If `MODE=non_interactive`, SKIP Phase 5 entirely — do NOT invoke `plan-task` or `execute-task`. Both own `AskUserQuestion` flows and would hang a headless caller. The assistant's orient (status, daily note, guides) already ran in `## Process` step 2 and IS the complete non-interactive result. Print `✅ Oriented (non-interactive). Run /vault-cli:plan-task in a terminal to sharpen and gate execution.` and STOP.

1. **Resolve the task name from the assistant's report.** The assistant prints `📋 Task: <name>` near the top of its `found` block; that line is the canonical identifier. Capture it verbatim.

2. **Invoke `Skill: vault-cli:plan-task` with the captured name as a quoted argument.** plan-task owns its own entry contract, gate logic, and `AskUserQuestion` flow — do not intercept. Wait for it to return.
Expand Down
Loading