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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Please choose versions by [Semantic Versioning](http://semver.org/).
* MINOR version when you add functionality in a backwards-compatible manner, and
* PATCH version when you make backwards-compatible bug fixes.

## 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.

## v0.96.0

- feat: Config loading follows XDG Base Directory spec — new FindConfigDir prefers ~/.config/vault-cli/ over legacy ~/.vault-cli/ with no forced migration
Expand Down
26 changes: 13 additions & 13 deletions agents/goal-creator.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ You create one goal file in the configured vault. You read the vault config via

## 1. Parse arguments

Input form: `[goal description] [--tool] [--vault NAME] [--objective NAME]`.
Input form: `[goal description] [--non-interactive] [--vault NAME] [--objective NAME]`.

- `--tool` → MODE = `tool` (machine-readable JSON output, no AskUserQuestion calls, no audit, hard-fail on collision)
- `--non-interactive` (deprecated alias: `--tool`) → MODE = `non_interactive` (machine-readable JSON output, no AskUserQuestion calls, no audit, hard-fail on collision)
- `--vault NAME` → target vault override
- `--objective NAME` → parent objective name (string match against objectives_dir)
- Remaining tokens → goal description / title
Expand All @@ -52,7 +52,7 @@ Find the vault entry matching the requested vault name (or `default_vault` from
- `objectives_dir` — parent objective lookup folder (or empty)
- `themes_dir` — theme folder (or empty)

If the vault is not found, report the error and stop. In MODE=tool, return `{"success": false, "error": "..."}`.
If the vault is not found, report the error and stop. In MODE=non_interactive, return `{"success": false, "error": "..."}`.

## 3. Compose the title

Expand All @@ -68,8 +68,8 @@ Final filename: `{Title}.md` (no Jira prefix; goals are higher-level than tasks)
If `--objective NAME` was provided:

- Glob `{vault.path}/{objectives_dir}/*.md` and find a name match (case-insensitive, partial OK)
- If 0 matches → MODE=tool fails with `objective not found`; MODE=interactive AskUserQuestion to pick from list or skip
- If >1 matches → MODE=tool fails; MODE=interactive AskUserQuestion to pick
- If 0 matches → MODE=non_interactive fails with `objective not found`; MODE=interactive AskUserQuestion to pick from list or skip
- If >1 matches → MODE=non_interactive fails; MODE=interactive AskUserQuestion to pick
- Store as `OBJECTIVE_LINK` (e.g. `[[Objective Name]]`)

If `--objective` not provided, leave `OBJECTIVE_LINK` empty. Do not auto-detect.
Expand All @@ -86,14 +86,14 @@ In MODE=interactive, AskUserQuestion for timeline:

If the user picks a duration, compute `start_date = today` and `end_date = today + N weeks`. Store as `TIMELINE = "{start_date} to {end_date}"`.

In MODE=tool, leave timeline empty.
In MODE=non_interactive, leave timeline empty.

## 6. Determine category and priority

- **Category**: infer from keywords or description (e.g. `trading`, `health`, `learning`, `personal`); leave empty if unclear
- **Priority**: default 3; raise to 2 if user description signals importance; 1 reserved for top-priority goals

In MODE=tool, default to category=`""` and priority=3, do not block.
In MODE=non_interactive, default to category=`""` and priority=3, do not block.

## 7. Resolve template body

Expand Down Expand Up @@ -129,7 +129,7 @@ If a template body was loaded in step 7, use it. Otherwise, generate the standar

1. `Tags: [[Goal]]` (plus theme tags if set)
2. `---` separator
3. Short summary paragraph (1–2 sentences). **First sentence MUST state the outcome** — what's true when the goal is done, not what work happens. E.g. "Reduce X from Y to Z" not "Build Z by doing W". **Before writing, rephrase any mechanism-phrased input into outcome form** — this rule applies in both interactive and tool mode; do NOT rely on step 12 audit to catch it (audit only runs in interactive mode). Avoid `via X` / `by doing Y` / `through Z` / `Split X / Build Y / Refactor Z / Set up Z` openings — these are mechanism leaks. Mechanism details belong in `# Impact` as an "Approach" lead paragraph. See `docs/goal-writing.md#summary-first-sentence` for the sniff test.
3. Short summary paragraph (1–2 sentences). **First sentence MUST state the outcome** — what's true when the goal is done, not what work happens. E.g. "Reduce X from Y to Z" not "Build Z by doing W". **Before writing, rephrase any mechanism-phrased input into outcome form** — this rule applies in both interactive and non_interactive mode; do NOT rely on step 12 audit to catch it (audit only runs in interactive mode). Avoid `via X` / `by doing Y` / `through Z` / `Split X / Build Y / Refactor Z / Set up Z` openings — these are mechanism leaks. Mechanism details belong in `# Impact` as an "Approach" lead paragraph. See `docs/goal-writing.md#summary-first-sentence` for the sniff test.
4. `# Impact` — why this goal matters strategically. If a brief mechanism description is needed, lead with an "**Approach**:" paragraph before the strategic bullets.
5. `# Status Summary` — Progress / Current / Next / Blockers placeholders
6. `# Success Criteria` — measurable outcomes as checkboxes
Expand All @@ -145,7 +145,7 @@ Glob: {vault.path}/{goals_dir}/{filename}

If the file already exists:

- MODE=tool → return `{"success": false, "error": "goal file already exists: ..."}`
- MODE=non_interactive → return `{"success": false, "error": "goal file already exists: ..."}`
- MODE=interactive → AskUserQuestion: 1. Pick a different name 2. Cancel

## 11. Write the file
Expand All @@ -170,7 +170,7 @@ Run a light self-audit against the file:
- If `timeline` is set, validate it is ≤ 4 weeks
- No accidental empty sections

Skip in MODE=tool.
Skip in MODE=non_interactive.

## 13. Return

Expand All @@ -187,13 +187,13 @@ Next steps:
3. Verify: /vault-cli:verify-goal "{title}"
```

MODE=tool output (single JSON object on stdout, nothing else):
MODE=non_interactive output (single JSON object on stdout, nothing else):

```json
{"success": true, "path": "{absolute_path}", "filename": "{filename}"}
```

On error in MODE=tool:
On error in MODE=non_interactive:

```json
{"success": false, "error": "<message>"}
Expand All @@ -205,7 +205,7 @@ On error in MODE=tool:
- Vault not found → fail with the requested vault name in the error
- `goals_dir` directory does not exist on disk → create it (`mkdir -p`) before writing
- `goal_template` configured but file missing → fail with "template not found: {path}"
- `--objective` not resolvable → MODE=tool fails; MODE=interactive prompts
- `--objective` not resolvable → MODE=non_interactive fails; MODE=interactive prompts
- Filename collision → see step 10
- Timeline > 4 weeks → fail with "goals must be ≤ 4 weeks; use an objective for longer horizons"
</error_handling>
2 changes: 1 addition & 1 deletion agents/goal-manager-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Show goal status. Accepts an explicit goal name/path, or detects from conversati
- MODE=interactive: parse conversation for file paths, wiki links, goal mentions
- 0 matches → error "No active goal detected; pass a goal name explicitly"
- >1 matches → AskUserQuestion to select
- MODE=tool: return `{"success": false, "error": "goal name required in tool mode"}` and STOP
- MODE=non_interactive: return `{"success": false, "error": "goal name required in non_interactive mode"}` and STOP

2. **Find goal file:**
```
Expand Down
22 changes: 11 additions & 11 deletions agents/task-creator.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ You create one task file in the configured vault. You read the vault config via

## 1. Parse arguments

Input form: `[task description] [--tool] [--vault NAME]`.
Input form: `[task description] [--non-interactive] [--vault NAME]`.

- `--tool` → MODE = `tool` (machine-readable JSON output, no AskUserQuestion calls, no audit, hard-fail on collision)
- `--non-interactive` (deprecated alias: `--tool`) → MODE = `non_interactive` (machine-readable JSON output, no AskUserQuestion calls, no audit, hard-fail on collision)
- `--vault NAME` → target vault override
- Remaining tokens → task description / title

Expand All @@ -51,7 +51,7 @@ Find the vault entry matching the requested vault name (or `default_vault` from
- `task_template` — absolute path to the task template (or empty/absent)
- `goals_dir` — for optional parent-goal linking (or empty)

If the vault is not found, report the error and stop. In MODE=tool, return `{"success": false, "error": "..."}`.
If the vault is not found, report the error and stop. In MODE=non_interactive, return `{"success": false, "error": "..."}`.

## 3. Detect Jira / issue key in the description

Expand All @@ -60,7 +60,7 @@ Scan the description for patterns like `BRO-18665`, `TRADE-4304`, `OC-2042`, etc
- If found, store as `JIRA_KEY` and remove from the title text.
- If a single key is found, prepend it to the final filename: `{JIRA_KEY} {Title}.md`.

In MODE=interactive, optionally fetch the Jira issue details via `mcp__atlassian__getJiraIssue` to enrich the title and description (only if a Jira key was detected and the MCP tool is available). Skip in MODE=tool.
In MODE=interactive, optionally fetch the Jira issue details via `mcp__atlassian__getJiraIssue` to enrich the title and description (only if a Jira key was detected and the MCP tool is available). Skip in MODE=non_interactive.

## 4. Detect incident-shaped task (interactive only)

Expand All @@ -77,7 +77,7 @@ If matched, AskUserQuestion with a SEV-1..SEV-4 picker:

If the user picks a severity, store as `SEVERITY` for inclusion in frontmatter.

Skip this step entirely in MODE=tool.
Skip this step entirely in MODE=non_interactive.

## 5. Compose the title

Expand All @@ -90,7 +90,7 @@ Final filename: `{JIRA_KEY }{Title}.md` (Jira key prefix only when detected).

## 6. Determine category and priority

- **Category**: infer from keywords or task content (e.g. `octopus`, `trading`, `personal`); if unclear, leave empty in tool mode or AskUserQuestion in interactive mode
- **Category**: infer from keywords or task content (e.g. `octopus`, `trading`, `personal`); if unclear, leave empty in non_interactive mode or AskUserQuestion in interactive mode
- **Priority**: default 3 (low/normal); raise to 2 if SEV-2/3 incident or if user description signals urgency; 1 only on SEV-1

## 7. Resolve template body
Expand Down Expand Up @@ -145,7 +145,7 @@ Glob: {vault.path}/{tasks_dir}/{filename}

If the file already exists:

- MODE=tool → return `{"success": false, "error": "task file already exists: ..."}`
- MODE=non_interactive → return `{"success": false, "error": "task file already exists: ..."}`
- MODE=interactive → AskUserQuestion: 1. Pick a different name 2. Cancel

## 11. Write the file
Expand All @@ -165,7 +165,7 @@ Run a light self-audit against the file:
- Body has Success Criteria + Tasks sections (or template body)
- No accidental empty sections

Skip in MODE=tool.
Skip in MODE=non_interactive.

## 13. Return

Expand All @@ -182,13 +182,13 @@ Next steps:
3. Defer: /defer-task "{title}" <date>
```

MODE=tool output (single JSON object on stdout, nothing else):
MODE=non_interactive output (single JSON object on stdout, nothing else):

```json
{"success": true, "path": "{absolute_path}", "filename": "{filename}"}
```

On error in MODE=tool:
On error in MODE=non_interactive:

```json
{"success": false, "error": "<message>"}
Expand All @@ -201,5 +201,5 @@ On error in MODE=tool:
- `tasks_dir` directory does not exist on disk → create it (`mkdir -p`) before writing
- `task_template` configured but file missing → fail with "template not found: {path}"
- Filename collision → see step 10
- Unable to detect category/priority and MODE=tool → use category=`""` and priority=3, do not block
- Unable to detect category/priority and MODE=non_interactive → use category=`""` and priority=3, do not block
</error_handling>
8 changes: 4 additions & 4 deletions commands/complete-goal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Mark goal as complete (checks subtasks and success criteria)
argument-hint: "<goal-name-or-path> [--tool] [--force]"
argument-hint: "<goal-name-or-path> [--non-interactive] [--force]"
---

<objective>
Expand All @@ -9,7 +9,7 @@ Mark goal as complete using vault-cli. Verifies success criteria and linked subt

<process>
1. Parse arguments:
- If contains `--tool` → MODE=tool, remove flag from args
- If contains `--non-interactive` (or deprecated `--tool`) → MODE=non_interactive, remove flag from args
- If contains `--force` → FORCE=true, remove flag from args
- Otherwise → MODE=interactive
- Extract goal name from remaining args
Expand Down Expand Up @@ -41,7 +41,7 @@ Mark goal as complete using vault-cli. Verifies success criteria and linked subt
```
- If warnings in output, show them

3. **MODE=tool (--tool flag):**
3. **MODE=non_interactive (--non-interactive flag):**

a. Read goal file to check completion state
b. If incomplete success criteria or open subtasks (and FORCE not set):
Expand All @@ -60,7 +60,7 @@ Mark goal as complete using vault-cli. Verifies success criteria and linked subt

<success_criteria>
- vault-cli goal complete invoked (NOT Edit tool for frontmatter)
- **MODE=tool**: Returns JSON only, never forces unless `--force` explicitly passed
- **MODE=non_interactive**: Returns JSON only, never forces unless `--force` explicitly passed
- **MODE=interactive**: Shows progress, asks if incomplete, reports result
- Parent objective updated (by vault-cli)
- `--force` only used when user explicitly approves or passes the flag
Expand Down
14 changes: 7 additions & 7 deletions commands/complete-task.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Mark task as complete (normal or recurring)
argument-hint: "<task-name-or-path> [--tool] [--force]"
argument-hint: "<task-name-or-path> [--non-interactive] [--force]"
allowed-tools:
- Bash(vault-cli:*)
- Read
Expand All @@ -12,9 +12,9 @@ Mark task as complete using vault-cli. Handles normal and recurring tasks approp

<process>
1. Parse arguments:
- If contains `--tool` → MODE=tool, remove flag from args
- If contains `--non-interactive` (or deprecated `--tool`) → MODE=non_interactive, remove flag from args
- Otherwise → MODE=interactive
- If contains `--force` → FORCE=true, remove flag from args (interactive mode only — `--tool` overrides as defined in step 3)
- If contains `--force` → FORCE=true, remove flag from args (interactive mode only — `--non-interactive` overrides as defined in step 3)
- Extract task name from remaining args

2. **MODE=interactive (default):**
Expand Down Expand Up @@ -49,9 +49,9 @@ Mark task as complete using vault-cli. Handles normal and recurring tasks approp

Rationale for this closer (one-task-per-session contract, why never `/vault-cli:next-task` here, why the "no end-of-day suggestions" global rule does NOT override): see [`sync-progress.md` Phase 6](sync-progress.md) — same contract applies. Single source of truth lives there to prevent drift.

MODE=tool MUST NOT emit this panel (see step 3 — JSON only).
MODE=non_interactive MUST NOT emit this panel (see step 3 — JSON only).

3. **MODE=tool (--tool flag):**
3. **MODE=non_interactive (--non-interactive flag):**

a. Read task file to check completion state
b. If incomplete items:
Expand All @@ -70,7 +70,7 @@ Mark task as complete using vault-cli. Handles normal and recurring tasks approp

d. Never ask questions, never prompt.

e. **Never emit the `⚪ DONE` closer panel** — MODE=tool output is JSON only. The closer panel from step 2e is interactive-mode only.
e. **Never emit the `⚪ DONE` closer panel** — MODE=non_interactive output is JSON only. The closer panel from step 2e is interactive-mode only.

4. Task types (handled by vault-cli internally):
- Normal tasks: status→completed, goals updated, daily note checked
Expand All @@ -79,7 +79,7 @@ Mark task as complete using vault-cli. Handles normal and recurring tasks approp

<success_criteria>
- vault-cli task complete invoked (NOT Edit tool for frontmatter)
- **MODE=tool**: Returns JSON only, sets phase=human_review if incomplete
- **MODE=non_interactive**: Returns JSON only, sets phase=human_review if incomplete
- **MODE=interactive**: Shows completion %, aborts with `--force` hint if incomplete (no prompts), reports result on success
- Goal files updated (by vault-cli)
- Daily note updated (by vault-cli)
Expand Down
4 changes: 2 additions & 2 deletions commands/create-goal.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Create a new goal in the configured vault with guided prompts
argument-hint: "[goal description] [--tool] [--vault NAME] [--objective NAME]"
argument-hint: "[goal description] [--non-interactive] [--vault NAME] [--objective NAME]"
allowed-tools: [Task, Read, Write, Glob, Grep, Bash, AskUserQuestion]
---

Invoke the goal-creator agent to create a goal file in the vault.

Parse `$ARGUMENTS`:
- `--tool` → MODE=tool (orchestration mode, JSON output, no prompts)
- `--non-interactive` (deprecated alias: `--tool`) → MODE=non_interactive (orchestration mode, JSON output, no prompts)
- `--vault NAME` → target a specific vault (otherwise use the default vault from `~/.vault-cli/config.yaml`)
- `--objective NAME` → link to parent objective by name (interactive mode resolves via Glob/AskUserQuestion if ambiguous)
- Remaining text → goal description / title
Expand Down
4 changes: 2 additions & 2 deletions commands/create-task.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: Create a new task in the configured vault with guided prompts
argument-hint: "[task description] [--tool] [--vault NAME]"
argument-hint: "[task description] [--non-interactive] [--vault NAME]"
allowed-tools: [Task, Read, Write, Glob, Grep, Bash, AskUserQuestion]
---

Invoke the task-creator agent to create a task file in the vault.

Parse `$ARGUMENTS`:
- `--tool` → MODE=tool (orchestration mode, JSON output, no prompts)
- `--non-interactive` (deprecated alias: `--tool`) → MODE=non_interactive (orchestration mode, JSON output, no prompts)
- `--vault NAME` → target a specific vault (otherwise use the default vault from `~/.vault-cli/config.yaml`)
- Remaining text → task description / title

Expand Down
8 changes: 4 additions & 4 deletions commands/defer-goal.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Defer goal to specific date
argument-hint: "<goal-name> <YYYY-MM-DD|+Nd|weekday> [--tool]"
argument-hint: "<goal-name> <YYYY-MM-DD|+Nd|weekday> [--non-interactive]"
allowed-tools: Bash(vault-cli goal defer:*)
---

Expand All @@ -10,7 +10,7 @@ Defer goal to specific date using vault-cli. Supports absolute (YYYY-MM-DD), rel

<process>
1. Parse arguments:
- If contains `--tool` → MODE=tool, remove flag from args
- If contains `--non-interactive` (or deprecated `--tool`) → MODE=non_interactive, remove flag from args
- Otherwise → MODE=interactive
- Split remaining args: goal name = all but last, date = last word

Expand All @@ -30,7 +30,7 @@ Defer goal to specific date using vault-cli. Supports absolute (YYYY-MM-DD), rel
```
- If warnings in output, show them

3. **MODE=tool (--tool flag):**
3. **MODE=non_interactive (--non-interactive flag):**

a. Run vault-cli:
```bash
Expand All @@ -50,6 +50,6 @@ Defer goal to specific date using vault-cli. Supports absolute (YYYY-MM-DD), rel
- vault-cli goal defer invoked (NOT Edit tool for frontmatter)
- Date parsed and validated (by vault-cli)
- Goal defer_date updated (by vault-cli)
- MODE=tool: Returns JSON only
- MODE=non_interactive: Returns JSON only
- MODE=interactive: Full report
</success_criteria>
Loading
Loading