# Tasque Reference (V1) This file contains detailed storage, task model, CLI contract, and project conventions. Referenced from [AGENTS.md](./AGENTS.md). ## Storage Model Git repositories default to sync-worktree mode: - `tsq init` configures the `tsq-sync` branch/worktree unless `--sync-branch ` or `--worktree-name ` names a custom branch/worktree. - data operations are redirected to the configured sync worktree - legacy main-tree `.tasque` data migrates automatically when no `sync_branch` is configured - fresh clones fetch the configured sync branch and create the worktree on first use - `tsq sync` pushes the sync branch to `origin` and sets upstream automatically when needed - the main worktree keeps `.tasque/config.json` as the pointer to the sync branch Non-git directories use repo-local `.tasque/`: - `.tasque/events.jsonl` (canonical source of truth, append-only) - `.tasque/state.json` (derived cache, rebuildable, gitignored) - `.tasque/tasks.jsonl` (legacy state-cache name; read-only fallback when `state.json` is absent; removal target) - `.tasque/snapshots/` (replay checkpoints, local by default) - `.tasque/config.json` (project settings) - `.tasque/.lock` (ephemeral write lock) Event fields: - `id` (ULID, canonical) - `event_id` (legacy alias accepted on read) - `ts` (ISO datetime) - `type` - `actor` - `task_id` - `payload` Event types: - `task.created` - `task.updated` - `task.status_set` - `task.claimed` - `task.noted` - `task.spec_attached` - `task.superseded` - `dep.added` - `dep.removed` - `link.added` - `link.removed` Read path: - resolve configured sync worktree when `sync_branch` is set - migrate legacy git repos to the default sync worktree when no `sync_branch` is set - load latest snapshot (if any) - replay event tail - refresh `state.json` cache Write path: - append event(s) - update projection - periodically write snapshot ## Task Model Task fields: - `id` (`tsq-` root, `.` child); legacy `tsq-<8 crockford base32 chars>` IDs remain valid - `alias` (kebab-case slug generated from the creation title; stable across title edits) - `kind` (`task|feature|epic`) - `title` - `status` (`open|in_progress|blocked|deferred|closed|canceled`) - `planning_state` (`needs_planning|planned`) - `priority` (`0..3`) - `assignee` (optional) - `parent_id` (optional) - `superseded_by` (optional) - `duplicate_of` (optional) - `replies_to` (optional) - `discovered_from` (optional provenance metadata) - `labels[]` - `created_at`, `updated_at`, `closed_at` Dependencies: - edge: `child -> blocker` with `dep_type` (`blocks|starts_after`) - semantics: only `blocks` participates in ready/cycle checks; `starts_after` is non-blocking ordering metadata Relation types: - `relates_to` (bidirectional) - `replies_to` - `duplicates` - `supersedes` ## CLI Contract - `tsq` (no args, TTY): open read-only TUI - `tsq init [--wizard|--no-wizard] [--yes] [--preset ] [--sync-branch|--worktree-name ]` - `tsq init --install-skill|--uninstall-skill [--skill-targets ...] [--skill-name ] [--force-skill-overwrite]` - `tsq skills refresh` — update managed skill files across all targets; repo-independent (no `tsq init` or `.tasque/` required) - `tsq create [--kind ...] [-p ...] [--parent ] [--from-file tasks.md] [--description ] [--external-ref ] [--discovered-from ] [--planned|--needs-plan] [--ensure] [--id ] [--body-file ] [--force]` - `tsq plan --from [--apply] [--kind ...] [-p ...] [--planned|--needs-plan] [--ensure] [--force]` - `tsq show [--deps] [--spec|--with-spec] [--notes] [--history] [--all-notes] [--all-history]` - `tsq find ready [--lane ] [--assignee ] [--unassigned] [--kind ...] [--label ...] [--planning ] [--tree [--full]]` - `tsq find [filters...] [--tree [--full]]` - `tsq find search [--full]` - `tsq find similar ""` - `tsq watch [--once] [--interval ] [--status ] [--assignee ] [--tree] [--flat]` Notes: - For `find ready` and status-based `find` commands, `--full` is only valid with `--tree`. `--tree --full` keeps the full status set instead of applying the default tree status narrowing. `find search --full` remains valid without `--tree`. - `--id ` accepts `tsq-` or legacy `tsq-<8 crockford base32 chars>`. - Commands that accept a task ID also accept exact aliases and unique alias prefixes unless `--exact-id` is used. - `tsq find similar ""` shows ranked duplicate candidates with scores and reasons. - `tsq create` refuses similar open/in-progress/blocked/deferred tasks unless `--force` is passed. - `tsq show ` shows task, deps, attached spec when present, latest notes, and latest history. Selector flags narrow output to requested sections. - `tsq plan` previews by default. `--apply` creates planned child tasks under the parent from headings/checklist bullets. Inline `#labels` are attached during the same batch create. `watch` renders the task tree by default for human output. Use `--tree` to explicitly request tree view or `--flat` for the compact list view. These options are mutually exclusive. - `tsq tui [--once] [--interval ] [--status ] [--assignee ] [--board|--epics]` - `tsq stale [--days ] [--status ] [--assignee ] [--limit ]` - `tsq doctor` - `tsq repair [--fix] [--force-unlock]` - `tsq edit [--title ...] [--description ...] [--clear-description] [--priority ...] [--external-ref ] [--clear-external-ref] [--discovered-from ] [--clear-discovered-from]` - `tsq claim [--assignee ] [--start] [--require-spec]` - `tsq workon [--assignee ] [--require-spec]` - `tsq assign --assignee ` - `tsq start ` - `tsq planned ` - `tsq needs-plan ` - `tsq open ` - `tsq blocked ` - `tsq defer [--note ]` - `tsq done [--note ]` - `tsq reopen [--note ]` - `tsq cancel [--note ]` - `tsq orphans` - `tsq spec [--file | --stdin | --text | --show | --check] [--force]` - `tsq spec --update [--file | --stdin | --text ]` - `tsq spec --patch [--file | --stdin | --text ]` - `tsq block by ` - `tsq unblock by ` - `tsq order after ` - `tsq unorder after ` - `tsq deps [--direction ] [--depth ]` - `tsq relate ` - `tsq unrelate ` - `tsq duplicate of [--note ]` - `tsq duplicates [--limit ]` - `tsq merge --into [--reason ] [--force] [--dry-run]` - `tsq supersede with [--note ]` - `tsq note ` - `tsq note --stdin` - `tsq notes ` - `tsq label