Skip to content

fix: render array CLI params as repeatable flags in tool guidance#318

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/checklist-repeatable-flag
Feb 16, 2026
Merged

fix: render array CLI params as repeatable flags in tool guidance#318
zbigniewsobiecki merged 1 commit intodevfrom
fix/checklist-repeatable-flag

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Fix malformed Trello checklists created by Claude Code agents — they were passing --items '["Step 1", "Step 2"]' (JSON array as single arg) instead of --item "Step 1" --item "Step 2" (repeated flags)
  • Extract formatParam() helper from buildToolGuidance() to reduce cognitive complexity and cleanly handle array-type parameter rendering
  • Rename CLI flag from --items to --item (singular) to match the repeated-flag convention, with matching tool manifest update

Test plan

  • All 1504 existing tests pass
  • New test: array params render as --item <string> (repeatable) (required)
  • New test: optional array params render as [--tag <string> (repeatable)]
  • TypeScript typecheck clean
  • Biome lint clean (complexity warning resolved via formatParam() extraction)
  • Pre-commit hooks (lint + typecheck) pass
  • Pre-push hooks (full test suite) pass

🤖 Generated with Claude Code

Claude Code agents were passing --items as a single JSON array string
(e.g. --items '["Step 1", "Step 2"]'), creating one malformed checklist
item instead of individual items. This happened because buildToolGuidance()
rendered array params as `--items <array>`, giving no indication that
repeated flags are needed.

- Extract formatParam() helper from buildToolGuidance() to reduce
  cognitive complexity and handle array-type params
- Array params now render as `--item <string> (repeatable)` instead of
  `--items <array>`
- Rename CLI flag from --items to --item (singular) to match convention
- Rename tool manifest param from items → item to match the CLI flag
- Add test coverage for array parameter rendering (required + optional)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 3446103 into dev Feb 16, 2026
4 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/checklist-repeatable-flag branch February 16, 2026 22:02
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.

1 participant