Skip to content

Checklist Item Add/Update/Position/Delete Commands#233

Open
k0d3x8its wants to merge 11 commits into
mheap:mainfrom
k0d3x8its:feat/checklist-item-crud
Open

Checklist Item Add/Update/Position/Delete Commands#233
k0d3x8its wants to merge 11 commits into
mheap:mainfrom
k0d3x8its:feat/checklist-item-crud

Conversation

@k0d3x8its

@k0d3x8its k0d3x8its commented May 25, 2026

Copy link
Copy Markdown

Add checklist item commands

Add checklist item CRUD commands: card:add-checklist-item,
card:delete-checklist-item, card:update-checklist-item,
card:delete-checklist. Includes resolveChecklistId helper on BaseCommand.

Commands added

  • card:delete-checklist — delete a checklist from a card by name
  • card:add-checklist-item — add an item to a checklist
  • card:delete-checklist-item — delete an item from a checklist by name
  • card:update-checklist-item — rename or reposition a checklist item (supports
    top, bottom, up, down, or a numeric position)

Changes

  • BaseCommand — new resolveChecklistId helper used by the new checklist
    commands

Not "shared across all checklist commands" — only new ones call it.

  • 4 new commands under src/commands/card/
  • Full unit test coverage for all 4 commands

Test plan

  • pnpm build && pnpm test — 327 unit tests pass across all packages
  • Manual CLI test — 1 checklist, 5 items (add, update, delete)
  • Shell script test — 1 checklist, 1 item end-to-end
  • Agent test — 5 cards, 100 checklist items

@mheap mheap left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes Requested

1. Duplicated parsePos method

Both add-checklist-item.ts:35-39 and update-checklist-item.ts:117-122 have identical parsePos implementations. Extract this to BaseCommand to follow DRY.

2. Duplicated item resolution logic

delete-checklist-item.ts:31-55 reimplements checklist + item resolution inline instead of reusing resolveChecklistId from BaseCommand. The item resolution could also be a shared helper.

3. computeRelativePos edge case - floating point precision

The midpoint calculation ((a + b) / 2) can lose precision after repeated moves. Consider using a wider gap (e.g., halving the distance to the far neighbor) or inserting with a fixed buffer.


Suggestions (non-blocking)

4. Missing --state flag on update-checklist-item

The Trello API supports state (complete/incomplete) on updateCardCheckItem, but the command doesn't expose it. Worth considering for a follow-up.

5. Heavy use of as any casts

BaseCommand.ts:207-210, add-checklist-item.ts:24, update-checklist-item.ts:48 all use as any[] or as any to bypass type checking. Reduces the value of TypeScript.


Positives

  • Test coverage is thorough — happy paths, error cases, edge cases, optimization paths, and relative positioning logic are all well tested.
  • Commands follow existing repo conventions (oclif patterns, flag naming, output shape).
  • The resolveChecklistId optimization to skip API calls when a raw 24-char hex ID is passed is a nice touch.
  • Changeset is properly formatted.
  • Error messages are clear and actionable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants