-
Notifications
You must be signed in to change notification settings - Fork 0
Init Slash Command #9
Description
Claude Code Slash command for initialising whole system. Interactively walk user through:
1. Gather info
Gather information about the current state of the system from the user and from inspecting the filesystem.
- Q: Are your project, area and task files in an Obsidian vault (or will they be)? If yes, get path to vault root.
- Q: Do you have existing directories for these three things? Get all three paths.
- If they exist, read contents of all area and project files, and count files in tasks dir. Sample a few task files (or all if there aren't many) and inspect the frontmatter for conformity with taskdn spec. Also look for subdirectories (which will not show up in taskdn) - remember any changes needed.
- If in obsidian vault, read
plugins.jsonand look for TaskNotes, FolderFile etc. - Look for existing
tdninstallation and~/taskdn.config - Inspect current knowledge (from existing skills, MCPs, CLAUDE.md etc) which specifically talk about generic task management.
2. Formulate Initialisation Plan
Use the information you have to intelligently formulate an initialization plan. The installation plan will depend on the user's current setup, but the goal end state is:
- Areas, projects & tasks directories exist and are writable.
<task-dir>/archiveexists and is writabletdnCLI installed globally (including shell completions if supported)~/.taskdn.jsonconfigured with correct paths for all three directories.~/.taskdn.jsonset up to ignore any files necessary (eg Templates, FolderFile Files etc)
If any MD files representing areas, projects & tasks are already present in the relevant directories:
- Area, project & task files which the user wants to work with are not in subdirectories (they won't ever be read)
- All area & project & task files meet the minimum S1 requirements and where appropriate, existing frontmatter fields are converted to be S1-compliant
- Where the existing files show a tasks/project obviously belongs to an area, or a task to a project – the relationship fields have been correctly set in the frontmatter.
- Where there are existing tasks which are obviously "archived", they have been moved to
<task-dir>/archive
If we're in an obsidian vault:
- any relevant existing bases and templates have been updated as necessary and where they don't already exist we have created:
- Suitable basic templates for a new task, area or project
- (if bases plugin is enabled) Embeddable Bases for listing areas, projects and tasks
Once you have a clear initialisation plan, confirm it with the user. And if there's anything you're unclear about, ask the user and revise your plan based on their feedback. The pan should clearly state what changes will be made and in what order, and should be very explicit about changes which will be made to existing project, task and area files. It goes without saying that all changes to these files should be the minimum required. Everything else should be left as is.
3. Execute the Plan
Execute the initialization plan in phases, confirming the next actions with the user at appropriate points.
4. Confirmation
- Run
tdn config --aiandtdn doctor --aiand ensure things are properly configured. - Run
tdn context --aiand ensure it's returning the information you'd expect. - If a global user-level
CLAUDE.mdexists, insert a short note (see below) - Briefly summarise what you've done and suggest next actions for the user (include "download the desktop app from XXX" in this too.
Note to add to global CLAUDE.md
- One-para explanation including:
- "I manage my general tasks, projects & life areas as markdown files on disk using taskdn. Use the
tdn:task-managementskill and thetdnCLI to work with this system and get context from it. Quick ref: Create task:tdn new "My New Task" --ai. Get full context on everything:tdn context --ai. - Any relevant particulars of the user's setup.
- Short list of Rules & Guidance:
- ALWAYS use the tdn skill if the user specifically mentions "TDN", "Taskdn" or "taskdown".
- Probably use the skill if the user mentions one of their Life areas (A, B, C & D as of 2025-12-30)
- CRITICAL: Context matters: if a user is working in a project directory which has it's own task management system, be smart. If our cwd is a coding project with AI instructions to manage tasks with GH issues, the Linear MCP, or some local
tasks-tododirectory etc... "make a new task" almost certainly means to use that, not taskdn! If you think the user wants you to use taskdn, ASK THEM.