| description | Bind this project to an Obsidian vault (or any markdown directory) where projectstore will record artifacts. |
|---|---|
| argument-hint | <vault-path> [--layout engineering] [--lang en|ru] |
You are binding the current project to a markdown vault for projectstore.
Parse $ARGUMENTS:
- First positional arg: vault path. Expand
~if present. - Optional
--layout <name>: layout to use. Default:engineering. - Optional
--lang <en|ru>: template language. Default:en.
Steps:
-
Check for an existing bind (safer rebind, v0.4.1):
- Read
<project>/.claude/projectstore.jsonif it exists. - If absent: proceed to step 1 (fresh bind).
- If present, compare its
vault_pathwith the new path (after~expansion):-
Same vault: print "Already bound to
<path>. Re-run/projectstore:scaffoldif you need to (re)create the layout, or/projectstore:statusto inspect it." and stop. Do not rewrite the config. -
Different vault: show the user a one-block diff:
Existing bind: vault_path: <old> layout: <old layout> language: <old lang> Proposed bind: vault_path: <new> layout: <new layout> language: <new lang>Then ask via AskUserQuestion: "An existing projectstore bind was found. How to proceed?" with options:
- Replace bind (Recommended) — write the new config, leaving the old vault's
.projectstore/sessions/to expire on its own 24h TTL. - Keep old bind — make no changes, print "Kept binding to
<old>." and stop. - Cancel — make no changes, print "Cancelled." and stop.
Only on Replace bind, continue with the remaining steps below.
- Replace bind (Recommended) — write the new config, leaving the old vault's
-
- Read
-
Validate the vault path with
ls -la "<path>". If it does not exist, ask the user (via AskUserQuestion) whether to create it. -
Detect existing layout: list immediate subdirectories. If you see
adr/,epics/,concepts/,research/— the vault already uses an engineering-like layout; suggestengineering. Otherwise use the user's choice orengineeringdefault. -
Build the config as JSON:
Get
default_authorfromgit config --get user.name(fallback to$USER). -
Show the user the proposed config as a code block. Use AskUserQuestion to confirm: "Write
.claude/projectstore.jsonwith this config? [Yes / Edit a field / No]". -
On approval, write the file using the Write tool to
<project>/.claude/projectstore.json. -
Check
.gitignore: read<project>/.gitignoreif it exists. Unless.claude/is ignored wholesale, the machine-specific entries are:.claude/projectstore.json,.claude/settings.local.json,.claude/.projectstore/(per-session state). Ask via AskUserQuestion: "Add the missing entries to.gitignore? [Yes / No]". If yes, append them (use Edit). -
Offer scaffold: if the vault is empty or missing layout folders, ask: "Vault is empty/incomplete. Run
/projectstore:scaffoldto create the layout? [Yes / No]". If yes, invoke/projectstore:scaffoldimmediately (just describe; do not assume execution). -
Print summary: confirm the bind, list the layout's folders, suggest next commands (
/projectstore:status,/projectstore:adr "<first decision>",/projectstore:epic <ID> "<title>"). -
Auto-update reminder (v0.7+, only on first successful bind in this project): After Step 5 (config write), check whether the newly-written config has
autoupdate_asked: true. If not, ask the user via AskUserQuestion:"Claude Code does not auto-update third-party marketplaces by default. Want to enable auto-update for the SmartAndPoint marketplace so you'll be notified about future projectstore releases?"
Options:
- Yes, show me how (Recommended) — respond with: "Open
/plugin→ Marketplaces tab → SmartAndPoint → toggle auto-update on. New releases (v0.7+) will be detected at Claude Code startup; you'll need to run/reload-pluginsafter the notification to activate them." - No, I'll handle it manually — respond with: "OK. To pull the latest version at any time, run
/plugin marketplace update SmartAndPoint, then/reload-plugins." - Already enabled — respond with: "Great. New releases will be detected at the next Claude Code startup."
After the question is answered (regardless of choice), Edit
<project>/.claude/projectstore.jsonto add"autoupdate_asked": trueto the JSON object. This guarantees we ask only once per project. - Yes, show me how (Recommended) — respond with: "Open
-
Agent registration (v0.13, ADR-002): ask via AskUserQuestion — "Register projectstore's agents in CLAUDE.md/AGENTS.md so every session routes to them (critic after authoring artifacts, planner before implementing, reviewer before commit)? [Yes (Recommended) / No]". On Yes, run the
registerflow fromcommands/agents.md(block generated from the layout's roster; each write individually approved). On a rebind where a block already exists, offer repair/migrate instead of re-asking blindly. -
Agent model preset (v0.13, ADR-003): ask via AskUserQuestion — include this line in the question text: "These agents don't write code — they are critics, planners, and reviewers; they perform best on strong models at high effort." Options: Keep bundled default — opus + max (Recommended) / fable + max / sonnet + max / inherit (follow the session's model). Free-form model IDs and per-agent tuning live in
/projectstore:agents configure— mention it. A non-default choice runs theconfigureapply flow fromcommands/agents.md(override copies, approval-gated). Skippable. -
Status line offer (v0.13, ADR-006 — the final step, language is known by now): read
$CLAUDE_PLUGIN_ROOT/templates/<lang>/strings.json(fall back toen) and the plugin version, then show the fully rendered example:[PS#<version>] 📚 <statusline_example_epic> › <statusline_example_story> (in-progress)(for
ru:[PS#0.13.0] 📚 Супер-фича в супер-продукте › Ручка для туалетной бумаги (in-progress))Ask via AskUserQuestion: "Show your current epic/story in the status line, composed above any existing HUD? [Yes / No]". On Yes: Edit
projectstore.json→"statusline": { "enabled": true }(approval-gated) and report: "Enabled — restart Claude Code in this project to apply (the SessionStart hook wires it). A fresh session shows:[PS#<version>] 📚 <statusline_no_work>."
{ "vault_path": "<absolute-path>", "layout": "engineering", "auto_inject": true, "inject_depth": 1, "language": "en", "tags": [], "default_author": "<git user.name or $USER>", "active_skills": true, "approval_mode": "always" }