diff --git a/README.md b/README.md index 5cd551c..b5ea954 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ columns or more. 1. **Plan.** Ask for one, like _"plan the export feature"_. Claude grills you on the design until you both agree, then writes `SCOPE.md`, `TASKS.md`, `QUESTIONS.md` - and `PROGRESS.md` in your configured `projectsDir`. + and `PROGRESS.md` in your plan folder (see Where plans live). 2. **Agree the criteria.** Settle each pull request's acceptance criteria before its first task starts. 3. **Run a task.** `/next-task` picks the first task that isn't blocked (or use @@ -117,6 +117,32 @@ columns or more. | `progress-reminder` | After a commit, reminds you to close the task in `PROGRESS.md` | | `version-bump` | In a repo that ships `.claude-plugin/plugin.json`, bumps the patch version on a branch's first commit and blocks a push that didn't bump it | +## Where plans live 🗂️ + +Plans are written to one of two places: + +- **The repo** (default, and the source of truth). `projectsDir` in `workflow.json`, + `docs/projects` unless you change it. +- **An Obsidian vault**, chosen per machine. Set it in `.claude/workflow.env`, which + is untracked: `.claude/.gitignore` keeps it out of git, so teammates keep the repo + folder. + +| Key in `.claude/workflow.env` | What it holds | +| --- | --- | +| `TASKFLOW_PLANS_SOURCE` | `repo` or `obsidian`. Anything else, or missing, means `repo` | +| `TASKFLOW_OBSIDIAN_VAULT` | The vault's folder name, looked up in Obsidian's vault list | +| `TASKFLOW_OBSIDIAN_VAULT_PATH` | The vault's absolute path instead; it wins over the name | +| `TASKFLOW_OBSIDIAN_PATH` | The folder inside the vault, e.g. `taskflow/my-repo` | + +See [`examples/workflow.env.example`](examples/workflow.env.example). `/init-workflow` +and the Taskflow panel both set it for you. With Obsidian on, plans are read and +written in the vault only, and a bad vault setting stops with a message instead of +falling back to the repo. + +> 💡 Plan files in a vault are written by absolute path, which asks permission every +> time. Add the vault to `permissions.additionalDirectories` in +> `.claude/settings.local.json` to stop the prompts. + ## Configuration ⚙️ Everything specific to your repo lives in one file you own: `.claude/workflow.json`. @@ -125,7 +151,7 @@ Everything specific to your repo lives in one file you own: `.claude/workflow.js | Key | What it holds | | --- | --- | -| `projectsDir` | Where plan folders live | +| `projectsDir` | Where plan folders live in the repo (see Where plans live above) | | `gates` | Your lint, types, unit and e2e commands | | `e2eTriggerPaths` | File patterns whose changes make the e2e suite run | | `docsChecklist` | Each doc and what it covers, checked before a behaviour change is done | diff --git a/commands/deviation.md b/commands/deviation.md index 98f8203..29f14bb 100644 --- a/commands/deviation.md +++ b/commands/deviation.md @@ -4,7 +4,8 @@ argument-hint: "" allowed-tools: Read, Edit, Glob, Bash --- -Append a session-log entry to the active `PROGRESS.md` recording: `$1` +Append a session-log entry to the active `PROGRESS.md` - under the plan dir the +`plan-start` skill's **Where plans live** section locates - recording: `$1` Shape it as: today's date, the task ID, the commit hash if one has landed, then **Deviation:** what the plan called for, what turned out to be true, and what was diff --git a/commands/next-task.md b/commands/next-task.md index e99b955..38af039 100644 --- a/commands/next-task.md +++ b/commands/next-task.md @@ -4,6 +4,8 @@ argument-hint: "[TASK-ID]" allowed-tools: Read, Edit, Glob, Grep, Bash --- +Locate the plan as the `plan-start` skill's **Where plans live** section says. + Take the task named by `$1`. Without an argument, take the first ⬜ task row in `PROGRESS.md` whose blockers are all settled and whose pull request's acceptance criteria are agreed - and if the frontier holds more diff --git a/commands/plan-status.md b/commands/plan-status.md index a0bac4c..fcce422 100644 --- a/commands/plan-status.md +++ b/commands/plan-status.md @@ -4,8 +4,8 @@ argument-hint: "[project-name]" allowed-tools: Read, Glob, Bash --- -Find the active plan under the `projectsDir` from `.claude/workflow.json`. With -an argument, use `/$1/`. Without one, use the folder whose +Find the active plan under the plan dir, located as the `plan-start` skill's +**Where plans live** section says. With an argument, use `/$1/`. Without one, use the folder whose `PROGRESS.md` was modified most recently; if several are close, list them and ask. Read `PROGRESS.md` for state and `QUESTIONS.md` for the questions themselves. diff --git a/examples/workflow.env.example b/examples/workflow.env.example new file mode 100644 index 0000000..585eb4c --- /dev/null +++ b/examples/workflow.env.example @@ -0,0 +1,13 @@ +# Copy to .claude/workflow.env - machine-specific and never committed +# (.claude/.gitignore lists it). Leave it out to keep plans in the repo. + +# Where plans live: "repo" (projectsDir in workflow.json) or "obsidian". +TASKFLOW_PLANS_SOURCE=obsidian + +# The vault, by folder name (matched against your Obsidian vault list)... +TASKFLOW_OBSIDIAN_VAULT=MyVault +# ...or by absolute path, which wins over the name. +# TASKFLOW_OBSIDIAN_VAULT_PATH=/Users/you/Documents/MyVault + +# The folder inside the vault: no "..", no leading "/". +TASKFLOW_OBSIDIAN_PATH=taskflow/my-repo diff --git a/skills/init-workflow/SKILL.md b/skills/init-workflow/SKILL.md index 693eb6d..3430836 100644 --- a/skills/init-workflow/SKILL.md +++ b/skills/init-workflow/SKILL.md @@ -9,11 +9,11 @@ Every other skill in this plugin reads `.claude/workflow.json`. This skill write ## 0. If the config already exists, this is a re-run -Read `.claude/workflow.json` before anything else. When it is there, the owner +Read `.claude/workflow.json` and `.claude/workflow.env` before anything else. When either is there, the owner has already answered - **never re-ask from scratch and never silently overwrite.** -Run the detection in step 1 anyway, then report the file's current values beside +Run the detection in step 1 anyway, then report both files' current values beside what you found, and ask a single question: keep the config as it stands, or change it. @@ -21,7 +21,7 @@ change it. | -------------- | ---------- | | Detection agrees with the file | Say so and stop. A re-run that changes nothing is the expected outcome | | Detection found drift - a renamed script, a doc that no longer exists, a new diagram folder | List each difference as `current -> found` and ask which to keep, per field | -| The owner wants a tier, the diagram decision or a pull-request convention changed | Re-ask **only** those questions, carrying the current value as the first option, labelled `(current)` | +| The owner wants a tier, the diagram decision, the plan source or a pull-request convention changed | Re-ask **only** those questions, carrying the current value as the first option, labelled `(current)` | Preserve every field you were not asked to change, including any the owner hand edited after the last run. Write the file only once the answers are in. @@ -30,7 +30,7 @@ edited after the last run. Write the file only once the answers are in. | Field | How to fill it | | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `projectsDir` | An existing plan folder if the repo has one (`docs/projects`, `.planning`, or wherever plans already live); otherwise `docs/projects` | +| `projectsDir` | An existing plan folder if the repo has one (`docs/projects`, `.planning`, or wherever plans already live); otherwise `docs/projects`. Whether plans live there or in an Obsidian vault is **asked - see below** | | `gates` | Read `package.json` scripts, or the `Makefile`, `justfile`, `Cargo.toml`, `pyproject.toml`. Map lint / types / unit / e2e to the **script names that exist**. Omit a gate the repo has no script for - never invent one | | `e2eTriggerPaths` | The paths whose changes need the slow suite. Ask if it is not obvious | | `docsChecklist` | One row per doc that must stay true, each with what it owns. Read the repo's docs before writing rows | @@ -63,6 +63,36 @@ that does not keep one is a practice decision, and it belongs to the owner - say in your report that the key is unset and what that costs: a hard decision made during a plan lives only in the gitignored plan folder and is lost with it. +### Where plans live - ask + +The rule is in plan-start's [Where plans live](../plan-start/SKILL.md#where-plans-live). +The repo folder stays the default source of truth; a vault is the owner's choice. +List the vaults this machine knows: + +```bash +jq -r '.vaults[].path' "$HOME/Library/Application Support/obsidian/obsidian.json" +``` + +Ask with its own `AskUserQuestion` call, one option each: + +- the repo folder - `projectsDir` from above - labelled `(Recommended)`; +- each vault found - label the folder basename, description the path. With no + `obsidian.json`, offer none; +- an absolute vault path, typed through Other. + +On a vault, a follow-up asks the path inside it, default `taskflow/`. + +Then tell the owner how the Obsidian setup works, in a few lines: + +- `.claude/workflow.env` holds the machine-specific keys and is never committed; + `projectsDir` in `workflow.json` keeps the repo folder. +- `TASKFLOW_PLANS_SOURCE` picks the source of truth - `repo` unless it says + `obsidian`. Only that source is read. +- The Taskflow panel shows these settings and edits them. +- Plan files in the vault are written by absolute path, which prompts every + time. Adding the vault to `permissions.additionalDirectories` in + `.claude/settings.local.json` stops that - offer to do it. + ## 2. Ask which model takes each tier Every task in a plan declares a difficulty tier, and the tier binds the runner: @@ -210,11 +240,22 @@ Codex model id when a tier runs on Codex: "models": { "deep": "opus", "surface": "sonnet", "mechanical": "haiku" } ``` +Leave `projectsDir` as step 1 found it, whatever the plan source. + +On a vault choice, write `.claude/workflow.env` with only the keys plan-start +allows: `TASKFLOW_PLANS_SOURCE=obsidian`, `TASKFLOW_OBSIDIAN_VAULT=` +for a listed vault whose basename no other vault shares, or +`TASKFLOW_OBSIDIAN_VAULT_PATH=` for a typed one or a shared basename, and +`TASKFLOW_OBSIDIAN_PATH=`. On a re-run, change only the keys asked +about; moving back to the repo sets `TASKFLOW_PLANS_SOURCE=repo` and keeps the +vault keys. Make sure `.claude/.gitignore` exists and lists `workflow.env`. + Write `"aiSignature": false` unless the owner asked for AI attribution in commits. It is the switch for every `Co-Authored-By` trailer and "Generated with" line the workflow writes, and a missing key means `false`. -Gitignore the per-project plan folders. Plans are working documents: committing +Gitignore the per-project plan folders - skip this for a vault source, which is +outside the repo. Plans are working documents: committing them invites code and commit messages to cite them, and a citation to a gitignored file points at nothing. @@ -269,4 +310,4 @@ A prose invariant rots the first time someone edits without reading it. force is needed. Confirm they are active with `/hooks`. Report the tier mapping, the diagram decision and the pull-request conventions that were chosen, which gates -were detected, which were missing, and what you gitignored. +were detected, which were missing, where plans live, and what you gitignored. diff --git a/skills/init-workflow/templates/CLAUDE-workflow-section.md b/skills/init-workflow/templates/CLAUDE-workflow-section.md index ca1e829..69b397c 100644 --- a/skills/init-workflow/templates/CLAUDE-workflow-section.md +++ b/skills/init-workflow/templates/CLAUDE-workflow-section.md @@ -7,8 +7,9 @@ Paste into the target repo's `CLAUDE.md`, replacing the bracketed values. ## Workflow Before touching code, create `SCOPE.md`, `TASKS.md`, `QUESTIONS.md` and -`PROGRESS.md` in `//`. Run `/plan-start -` to scaffold them. +`PROGRESS.md` in `/` under the plan directory +`.claude/workflow.json` / `.claude/workflow.env` resolve (see plan-start). Run +`/plan-start ` to scaffold them.