Skip to content
cccskills
FreePublished on GitHub

type-design-analysis

型設計の品質と不変性を4軸スコアで分析する。interface, type, class の追加・変更時に使用。

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Type Design Analysis スキル

目的

型設計の品質と不変性を分析し、堅牢な型システムの構築を支援する。

評価軸(各1-10スコア)

1. Encapsulation(カプセル化)

  • 10: 完全なカプセル化、内部状態へのアクセス不可
  • 7-9: ほぼ完全、一部のgetter/setterあり
  • 4-6: 部分的、一部の内部が露出
  • 1-3: 不十分、内部が広く公開

チェックポイント: privateフィールド、readonly修飾子、getter/setter

2. Invariant Expression(不変性表現)

  • 10: すべての不変性が型で表現
  • 7-9: 主要な不変性が型で表現
  • 4-6: 一部の不変性のみ
  • 1-3: ドキュメントのみに依存

チェックポイント: Union型、Branded型、型ガード

3. Invariant Usefulness(不変性の有用性)

  • 10: クリティカルなビジネスルールを保護
  • 7-9: 重要なエラーを防止
  • 4-6: 一般的なミスを防止
  • 1-3: 限定的な保護

4. Invariant Enforcement(不変性の強制)

  • 10: 構築時と全変異点で検証
  • 7-9: 構築時に検証、変異は制限
  • 4-6: 部分的な検証
  • 1-3: 検証なし、信頼ベース

アンチパターン(検出して報告)

  1. 貧血ドメインモデル - データのみで振る舞いがない型
  2. 変更可能な内部の公開 - 配列やオブジェクトを直接公開
  3. ドキュメント依存の不変性 - 型ではなくコメントで制約を表現
  4. 過度に広い責任 - 1つの型に多すぎる責任
  5. 構築境界での検証不足 - 無効な状態で構築可能

出力形式

# Type Design Analysis Results

## [型名]

- ファイル: path/to/file.ts

| 軸 | スコア | 理由 |
|----|--------|------|
| Encapsulation | X/10 | ... |
| Invariant Expression | X/10 | ... |
| Invariant Usefulness | X/10 | ... |
| Invariant Enforcement | X/10 | ... |

- 総合スコア: X/10
- 検出されたアンチパターン: ...
- 改善提案: ...

## Summary

- 分析した型の数: X
- 平均スコア: X/10
- 検出されたアンチパターン: X

注意事項

  • 新規追加または変更された型のみを分析
  • 4つの軸すべてでスコアを付与
  • 具体的な改善提案を含める

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

プロジェクトガイドラインへの準拠をチェックし、バグ、スタイル違反、コード品質問題を検出する。PRレビュー時に使用。

The English summary is being prepared. Showing the original description.

feel-flow/ai-spec-driven-development7Updated Oct 18, 2026

Enforces project coding standards during code review: naming conventions (PascalCase for classes, camelCase for methods/variables, UPPER_SNAKE_CASE for constants, kebab-case for files), standard file structure, anti-magic-number policy, file size limits (500/800 lines), security patterns, and design patterns. Use when reviewing code, writing new code, or checking adherence to project conventions.

The English summary is being prepared. Showing the original description.

feel-flow/ai-spec-driven-development7Updated Oct 18, 2026

機能を保持したまま不要な複雑性を排除し、コードの簡潔性と可読性を向上させる。30行超の関数や3段以上のネスト検出時に使用。

The English summary is being prepared. Showing the original description.

feel-flow/ai-spec-driven-development7Updated Oct 18, 2026

コードコメントの正確性、完全性、長期的な保守性を分析する。JSDoc、コメント、README等のドキュメントが変更された場合に使用。

The English summary is being prepared. Showing the original description.

feel-flow/ai-spec-driven-development7Updated Oct 18, 2026

サイレント失敗を検出し、堅牢なエラーハンドリングを確保する。PRレビューでのエラーハンドリング検査時に使用。

The English summary is being prepared. Showing the original description.

feel-flow/ai-spec-driven-development7Updated Oct 18, 2026

Enforces error handling standards: silent error prohibition, custom error class hierarchy (AppError base with category never-fallback / transient / permanent, cause preservation, ValidationError / UnauthorizedError / UpstreamError etc. — canonical definitions in ERRORS.md), external-boundary normalization (normalizeExternalError), Result pattern (Result.ok/Result.fail), proper try-catch with error type checking, structured error logging with a single Logger contract, fallback prohibition categories (isNeverFallback), and HTTP status code mapping. Use when implementing error handling, reviewing catch blocks, or designing error responses.

The English summary is being prepared. Showing the original description.

feel-flow/ai-spec-driven-development7Updated Oct 18, 2026

See all skills by feel-flow

Report a problem with this skill