feat(project): add description to create, update, and view#395
feat(project): add description to create, update, and view#395lmjabreu wants to merge 6 commits into
Conversation
|
@doistbot /review |
doistbot
left a comment
There was a problem hiding this comment.
This PR wires up project descriptions across the create, update, and view commands, keeping the new surface perfectly consistent with tasks.
Few things worth tightening:
- Retain the SDK parameter types in the
addProjectworkaround so we don't lose compile-time validation for the rest of the payload. - Strengthen the test coverage by using a markdown fixture to concretely test the
--rawview behavior, and add an assertion for the newdescriptionfield in the JSON outputs.
I also included a few optional follow-up notes in the details below.
Optional follow-up note (1)
- [P3] src/commands/project/index.ts:115: This PR adds new
projectcommand surface (view --raw,create --description/--stdin,update --description/--stdin), but the skill reference wasn't updated alongside it. That leavessrc/lib/skills/content.tsand the generatedskills/todoist-cli/SKILL.mdout of sync with the actual CLI behavior, so agents usingtd skill installwon't discover these new flags.
|
@doistbot /review |
doistbot
left a comment
There was a problem hiding this comment.
This cleanly wires up project descriptions across the create, update, and view commands, nicely matching the established patterns for tasks.
Few things worth tightening:
- Update
SKILL_CONTENTinsrc/lib/skills/content.tsto document the new--description,--stdin, and--rawflags for AI agent discovery. - Pass the
--rawflag down to the underlying task rows inproject viewso they don't unintentionally render markdown. - Strengthen a couple of test cases by asserting on a markdown mock sentinel value, and adding a regression check ensuring
--description ""remains a no-op on updates.
|
@doistbot /review |
doistbot
left a comment
There was a problem hiding this comment.
This PR nicely wires up project descriptions across the create, update, and view commands, maintaining a consistent experience with existing task patterns.
Few things worth tightening:
- Keep the shared JSON projection slim by isolating the
descriptionaddition to the create, update, and view outputs, as adding it toPROJECT_ESSENTIAL_FIELDSintroduces unnecessary serialization overhead to project list paths. - Add a test case for
project view --rawwith markdown task content (and ideally--detailed) to prove the newly plumbedrawflag correctly prevents rendering in the task-row output.
I also included a few optional follow-up notes in the details below.
Optional follow-up note (1)
- [P3] src/lib/skills/content.ts:165: The skill reference still only shows
--stdinonproject create. Sinceproject updatenow supports--stdintoo (including the empty-stdin clear flow), agents readingSKILL_CONTENTwon't discover that path. Add an update example here and regenerateSKILL.mdso the reference matches the CLI surface.
Surface project descriptions (26Q2 Project Essentials) in the CLI: - `project create` / `update` accept `--description <text>` and `--stdin` - `project view` renders the description as a markdown block (`--raw` disables) - curated `--json` output now includes `description` Mirrors the existing task-description flag surface. Clearing follows the same pattern as tasks: pipe empty input via `--stdin`. The SDK's project write-arg types don't yet include `description`, so the args are built as a variable to attach it without a cast; the REST client forwards the field. A follow-up SDK bump can type it and drop the workaround. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Keep the SDK arg signature in `addProject`/`updateProject` via
`Parameters<typeof api.x>[...] & { description?: string }`, so only
`description` escapes the types and the rest of the payload stays checked.
- Make the `--raw` view test meaningful: mock `renderMarkdown` (identity) and
assert the description routes through the renderer by default and bypasses it
under `--raw` (the renderer is a near no-op in the non-TTY test env, so the
prior plain-text assertion couldn't distinguish the two).
- Add JSON regression guards asserting `description` survives the curated
projection in project create/update/view `--json`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Pass `--raw` through to task rows in `project view` so task content isn't markdown-rendered when the user asked for raw output. - Document the new `--description`, `--stdin`, and `--raw` flags in SKILL_CONTENT (per AGENTS.md) and regenerate SKILL.md. - Strengthen the render test with a sentinel so it proves the renderer's output is what gets logged, not the raw markdown. - Add a regression test that `--description ""` is a no-op on update (clearing is via `--stdin`), guarding the truthiness contract. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…asts SDK 10.4.0 ships `description` on AddProjectArgs and UpdateProjectArgs (via Doist/todoist-sdk-typescript#620), so the temporary type workarounds in project create/update can go. Removed both casts; the SDK signature now covers the full payload. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1e7e70e to
9ca611f
Compare
doistbot
left a comment
There was a problem hiding this comment.
This diff successfully wires up project descriptions across the CLI creation, update, and view commands, aligning nicely with existing task behaviors.
Few things worth tightening:
- Keep the shared JSON projection slim by removing
descriptionfromPROJECT_ESSENTIAL_FIELDSand mapping it only in the command-specific outputs (create, update, view) to prevent unnecessary overhead on list-heavy paths. - Add a task-list test case to
project view --rawwith markdown task content to prove the flag correctly leaves task rows unrendered.
I also included a few optional follow-up notes in the details below.
Optional follow-up notes (2)
- [P3] src/lib/skills/content.ts:165: The skill reference only shows
--stdinforproject create. Now thatproject updatealso supports--stdin(including the flow to clear descriptions with empty input), add an update example here and regenerateSKILL.mdso AI agents can discover the new path. - [P3] src/lib/skills/content.ts:160: This
--rawexample is now inaccurate. The command help says--rawdisables markdown rendering, and the implementation also passesrawthrough task-row rendering, but this comment narrows it to the project description only. Please update the wording soSKILL_CONTENTstays consistent with the actual CLI behavior.
Address review thread: the existing --raw tests only covered the description block. Add task-list cases that put markdown in task content and assert `--raw` bypasses the renderer for task rows (and that the default path renders them), covering the `raw` passthrough to formatTaskRow(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Unassigning the review for now: the squad is holding the CLI and MCP description PRs until the feature releases (~next week). The code stays maintained in the meantime; I'll re-request when the hold lifts. |
What
Surfaces project descriptions (26Q2 Project Essentials) in the CLI. The backend shipped
project.descriptionvia sync and REST; this wires it into thetd projectverbs.td project createandtd project updateaccept--description <text>and--stdintd project viewrenders the description as a markdown block below the metadata (--rawto disable rendering)--jsonoutput now includesdescriptionDesign notes
--description/--stdin, theCONFLICTING_OPTIONSguard, theDescription:view block, markdown rendering) so the two read and behave the same. No client-side length check, consistent with tasks; the backend validates and trims.--stdin(sends'', which the backend treats as clear).--description ""is a no-op, matching tasks. No--no-descriptionflag.AddProjectArgs/UpdateProjectArgsdon't yet typedescription, though the REST client forwards it. The args are built as a variable to attach the field without a cast, with aTODOto drop the workaround once a follow-up SDK bump types it. Project reads already carrydescriptionin the SDK schema.Scope
create/update/view/ JSON.Testing
--description,--stdin, conflict), update (--description, clear via empty--stdin, conflict), and view (renders block, omits when empty).--dry-run.🤖 Generated with Claude Code