You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,9 @@ src/
47
47
48
48
## Key Patterns
49
49
50
-
-**ID references**: All explicit IDs use `id:` prefix. Use `requireIdRef()` for ID-only args, `isIdRef()`/`extractId()` for mixed refs (fuzzy name + explicit ID)
50
+
-**Lenient ID handling**: Raw IDs (alphanumeric or numeric) are accepted everywhere without `id:` prefix. `lenientIdRef()` accepts `id:xxx` or raw ID-like strings, rejects plain text. `resolveRef()` auto-retries raw IDs as direct lookups before giving up. Use `isIdRef()`/`extractId()` for mixed refs (fuzzy name + explicit ID)
51
+
-**Implicit view subcommand**: `td project <ref>` defaults to `td project view <ref>` via Commander's `{ isDefault: true }`. Same for task, workspace, comment, notification. Edge case: if a project/task name matches a subcommand name (e.g., "list"), the subcommand wins — user must use `td project view list`
52
+
-**Named flag aliases**: Where commands accept positional args for context (project, task, workspace), named flags are also accepted (`--project`, `--task`, `--workspace`). Error if both positional and flag are provided
The CLI required strict `id:` prefix for all ID arguments (e.g., `id:6QwcgwGW2H73WrVJ`). This created friction for both human users (copy-pasting IDs from other tools) and AI agents (extra formatting step). Additionally, viewing a resource required spelling out the `view` subcommand, and some positional arguments had no named flag alternative, making them harder to use in scripts.
10
+
11
+
## Decision
12
+
13
+
Three ergonomic improvements, all backward compatible:
14
+
15
+
**1. Lenient ID handling.** Accept raw IDs without `id:` prefix everywhere. `lenientIdRef()` replaces `requireIdRef()`. `resolveRef()` auto-retries raw-ID-looking strings as direct lookups before failing. Detection: `looksLikeRawId()` matches numeric strings or alphanumeric mix (no spaces, not pure alpha).
16
+
17
+
**2. Implicit view subcommand.**`td project <ref>` defaults to `td project view <ref>` using Commander's `{ isDefault: true }`. Applied to project, task, workspace, comment, notification commands.
18
+
19
+
**3. Named flag aliases.** Positional context arguments also accept named flags: `--project` (section list), `--task` (reminder list/add), `--workspace` (workspace projects/users). Error if both positional and flag are provided.
20
+
21
+
## Consequences
22
+
23
+
-`id:` prefix still works everywhere (backward compatible)
24
+
- Subcommand names take priority over implicit view: a project named "list" requires `td project view list`
25
+
- Skill content documents only canonical forms (explicit subcommands, `id:xxx`) to avoid encouraging collision-prone patterns
26
+
- AGENTS.md documents the full picture including implicit behavior
0 commit comments