Skip to content

Conversation

shinpr
Copy link
Owner

@shinpr shinpr commented Aug 17, 2025

To maintain consistency between Japanese and English versions, applied the following improvements:

  1. Added type guard implementation pattern

    • Clarified concrete usage of unknown type
    • Demonstrated safe validation of external input
  2. Clarified class usage criteria

    • Added concrete decision criterion: "Does this data have behavior?"
    • Specified cases requiring state management (ShoppingCart, Session, etc.)
  3. Added external API exception to type complexity management

    • External API types are exceptions to 20-field limit
    • Clarified boundary with appropriate internal conversion

Adjusted to English expressions that are clear for Claude Code, and achieved complete structural alignment between Japanese and English versions (both files are 177 lines).

Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

shinpr and others added 2 commits August 17, 2025 17:36
AIの実行精度最大化のため、最小限の記述で最大の効果を得られるよう以下を改善:

1. 型ガードの実装パターンを追加
   - unknown型の具体的な使用方法を明示
   - 外部入力の安全な検証方法を例示

2. クラス使用の判断基準を明確化
   - 「データが振る舞いを持つか」という具体的な判断基準を追加
   - 状態管理が必要なケース(ShoppingCart、Session等)を明示

3. 型の複雑性管理に外部API例外を追加
   - 外部API型は20フィールド制限の例外とすることを明記
   - 内部では適切に変換することで境界を明確化

これらの改善により、AIが迷わず正確な実装判断ができるようになり、
同時に保守性も向上する。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
To maintain consistency between Japanese and English versions, applied the following improvements:

1. Added type guard implementation pattern
   - Clarified concrete usage of unknown type
   - Demonstrated safe validation of external input

2. Clarified class usage criteria
   - Added concrete decision criterion: "Does this data have behavior?"
   - Specified cases requiring state management (ShoppingCart, Session, etc.)

3. Added external API exception to type complexity management
   - External API types are exceptions to 20-field limit
   - Clarified boundary with appropriate internal conversion

Adjusted to English expressions that are clear for Claude Code,
and achieved complete structural alignment between Japanese and English versions (both files are 177 lines).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@shinpr shinpr self-assigned this Aug 17, 2025
@shinpr shinpr merged commit 52d7f5f into main Aug 17, 2025
1 check passed
@shinpr shinpr deleted the feat/improve-typescript-rules-clarity branch August 17, 2025 08:44
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