typescript-rules SKILL.md skillA
typescript-rules from shinpr/ai-coding-project-boilerplate is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add shinpr/ai-coding-project-boilerplate/typescript-rules@git:20260901.dd3607bPins git:20260901.dd3607b in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- shinpr/ai-coding-project-boilerplate
- Path
.claude/skills-ja/typescript-rules/SKILL.md- Versions recorded
- 5
- Latest version
- git:20260901.dd3607b, committed Sep 1, 2026
- First version recorded
- Dec 19, 2025
- Size
- 7,178 bytes
- Repository stars
- 234
- License
- MIT
型安全性とエラーハンドリングルールを適用。any禁止、型ガード必須。TypeScript実装、型定義レビュー時に使用。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# TypeScript 開発ルール
## 前提条件の検出
プロジェクト規約を適用する前に、`tsconfig`、ランタイム・フレームワーク設定、lint・format設定、パスエイリアス、package scripts、代表的なモジュールを確認する。設定または確立済みのパターンに裏付けられたルールだけをプロジェクト固有として扱う。限られたパターンから導いた結論には推測であることを明記する。競合する規約によって公開契約、ランタイムの振る舞い、エラー境界が変わる場合は作業を止め、必要な情報源またはユーザー判断を具体的に示す。
## Backend実装における型安全性
**データフローでの型安全性**
入力層(`unknown`) → 型ガード → ビジネス層(型保証) → 出力層(シリアライズ)
**Backend固有の型シナリオ**:
- **API通信**: レスポンスは`unknown`で受け、型ガードで検証
- **フォーム入力**: 外部入力は`unknown`、バリデーション後に型確定
- **レガシー統合**: レガシーとの境界では`unknown`として受け取り、根拠のある型アサーションが必要な場合は、その境界を所有するアダプター内に限定する
- **テストコード**: 設定済みのテストハーネスでモックの入出力型を定義する。意図的に一部だけを持つfixtureには`Partial<T>`を使用し、Vitestが設定されている場合にのみ型付きの`vi.fn<[Args], Return>()`を使用する
## コーディング規約
**クラス使用の判断基準**
- **推奨:関数とinterfaceでの実装**
- 背景: テスタビリティと関数合成の柔軟性が向上
- **クラス使用を許可**:
- フレームワーク要求時(NestJSのController/Service、TypeORMのEntity等)
- カスタムエラークラス定義時
- 状態とビジネスロジックが密結合している場合(例: ShoppingCart、Session、StateMachine)
- **判断基準**: 「このデータは振る舞いを持つか?」がYesならクラス検討
```typescript
// 関数とinterface
interface UserService { create(data: UserData): User }
const userService: UserService = { create: (data) => {...} }
```
**関数設計**
- **引数は0-2個まで**: 3個以上はオブジェクト化
```typescript
// オブジェクト引数
…Read the whole file at its exact version.
How to install
mdr add shinpr/ai-coding-project-boilerplate/typescript-rules@sha256:3eff33317a9d3783The line at the top of this page pins the label git:20260901.dd3607b, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_kytm5kf3lbfr63zp)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 5 versions of this file, between Dec 19, 2025 and Sep 1, 2026, about one every 64 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260901.dd3607b latest | 2026-09-01 | dd3607b | 7,178 B | A | view · diff |
| git:20260719.3140886 | 2026-07-19 | 3140886 | 7,223 B | A | view · diff |
| git:20251231.a528a47 | 2025-12-31 | a528a47 | 4,788 B | A | view · diff |
| git:20251230.8d746f9 | 2025-12-30 | 8d746f9 | 4,820 B | A | view · diff |
| git:20251219.6eb2d0a | 2025-12-19 | 6eb2d0a | 4,783 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (7178 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
shinpr/ai-coding-project-boilerplate · 234 stars · license MIT · pushed 2026-10-14 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_kytm5kf3lbfr63zp GET https://markdownregistry.com/api/v1/resolve?ref=shinpr/ai-coding-project-boilerplate/typescript-rules GET https://markdownregistry.com/api/v1/blob/3eff33317a9d3783b926bb5f6785cc7e3a3edbfd826b8648695b77acdbe9dfd1
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from shinpr/ai-coding-project-boilerplate
Every file in shinpr/ai-coding-project-boilerplate