build-feature
Build a feature
1. Read the closest existing feature
Find the command most like the one you are building and read it with its test: src/commands/task/add.ts for a write that returns an entity, src/commands/today.ts for a list, src/commands/label/delete.ts for a destructive write behind --yes. For a new command or subcommand, add-command is the checklist of every file to touch. Read the rules in AGENTS.md. Done when you can name the file you will copy patterns from.
2. Settle decisions in one round
List what the request leaves open: command and flag names (consistent verbs and flags across entities; see docs/decisions/001-lenient-cli-ergonomics.md), positional argument or named flag, the human and --json output, error codes, --dry-run and --yes, behaviour under a read-only token. Ask the owner all of them at once, each with your recommendation. Don't ask what the code can answer. Done when every decision has an answer.
3. Write "done" as checkable behaviours
Write each behaviour as a command and the expected result, for example: "td label create --name work --json calls addLabel with { name: 'work' } and prints the label as JSON". Each becomes a test. Done when a test could pass or fail on every one.
4. Build in thin slices, test first
For each behaviour: write its test at the public interface (program.parseAsync(['node', 'td', ...])), see it fail, make it pass, run its test file. Follow write-tests. Done when every behaviour from step 3 has a passing test you saw fail.