Skip to content

fix: align description fallback pattern across commands, subagents and rules#1216

Merged
dyoshikawa merged 6 commits intodyoshikawa:mainfrom
saitota:i1078
Mar 2, 2026
Merged

fix: align description fallback pattern across commands, subagents and rules#1216
dyoshikawa merged 6 commits intodyoshikawa:mainfrom
saitota:i1078

Conversation

@saitota
Copy link
Contributor

@saitota saitota commented Feb 28, 2026

Accidentally closed PR #1205 by deleting the fork. Recreating with the same diff.

Summary

  • Remove description ?? "" and description || "" fallback patterns in commands, subagents and rules to propagate undefined instead of empty string
  • Make description field optional (z.optional(z.string())) across all command/subagent schemas for consistency with RulesyncRuleFrontmatterSchema
  • Improve cursor-rule.ts truthiness check to use explicit !== undefined && !== null && !== "" guard instead of falsy check
  • Add deepRemoveNullishObject edge case test for nested objects with all-null values

Closes #1078

Note

This PR addresses all occurrences of the description ?? "" / description || "" pattern found across the codebase, not just the two files mentioned in the issue #1078 .

References

Test plan

  • pnpm check
  • pnpm test

@dyoshikawa-claw
Copy link
Collaborator

/opencode review

@github-actions

This comment has been minimized.

@dyoshikawa
Copy link
Owner

@saitota Thank you. Please fix the points of the AI review.

- Remove remaining `description = ""` default in cursor-command.ts
- Simplify truthiness check in cursor-rule.ts to `if (frontmatter.description)`
@saitota
Copy link
Contributor Author

saitota commented Mar 2, 2026

@dyoshikawa Fixed No1 and No3. PTAL

  • No1 (MEDIUM): Removed description = "" in cursor-command.ts
  • No2(LOW): Skipped — ?? undefined is needed for null-to-undefined conversion (Kiro JSON)
  • No3(LOW): Simplified to if (frontmatter.description) in cursor-rule.ts

@dyoshikawa
Copy link
Owner

@saitota Thank you!

@dyoshikawa

This comment has been minimized.

@dyoshikawa-claw

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@saitota
Copy link
Contributor Author

saitota commented Mar 2, 2026

Okay, I'll handle this.

@saitota
Copy link
Contributor Author

saitota commented Mar 2, 2026

Fixed finding-1 from 2nd review. PTAL

  • Finding-1: Removed description: "" in toRulesyncCommand for kiro, codexcli, cline, kilo
  • Finding-12: Skipped — same reasoning as previous review finding-2 (?? undefined is needed for null-to-undefined conversion)

@dyoshikawa-claw

This comment has been minimized.

@github-actions

This comment has been minimized.

@saitota
Copy link
Contributor Author

saitota commented Mar 2, 2026

Fixed finding-1/7 from 3rd review. PTAL

  • Finding-1/7: Added undefined guard for description in geminicli-command.ts TOML generation to prevent literal "undefined" string output

@dyoshikawa

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

✓ Fix verified successfully

The fix for finding-1/7 has been correctly implemented in src/features/commands/geminicli-command.ts:126-129. The TOML generation now properly handles undefined descriptions by checking !== undefined before including the description field.

Verification results:

  • ✓ All CI checks pass (pnpm cicheck)
  • ✓ 4131 tests passed
  • ✓ Code quality checks passed (formatting, linting, type checking)
  • ✓ No security issues detected

github run

@dyoshikawa
Copy link
Owner

@saitota Thank you!

@dyoshikawa dyoshikawa merged commit a7a75aa into dyoshikawa:main Mar 2, 2026
7 checks passed
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.

fix: align description fallback pattern across commands and subagents

4 participants