소스 정보
- 저장소
- d-kimuson/dotfiles
- 최근 소스 활동
- 2026년 7월 24일 15:16
- 감지된 SKILL.md 언어
- 영어
- 스타
- 3
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/d-kimuson/dotfiles --skill typescript명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | typescript |
| description | Must always be enabled when writing/reviewing TypeScript code. |
| disable-model-invocation | false |
| user-invocable | true |
LLM-generated code faces inherent challenges with E2E testing and runtime verification. Compensate by maximizing compile-time verification through:
Goal: If it type-checks, it works. Shift as many bugs as possible from runtime to compile-time.
<type_assertions>
as Type Assertions are ProhibitedRationale: Type assertions bypass TypeScript's type system and introduce type unsoundness. They are frequently misused to silence legitimate type errors.
Policy:
as to resolve type errorsas any or as unknown as Xpath/to/file.ts:123 - requires manual review for potential as usage"is User-Defined Type Guards are ProhibitedRationale: User-defined type guards (x is T) are essentially type assertions in disguise. The TypeScript compiler cannot verify that the predicate logic actually corresponds to the claimed type, making them a hidden source of type unsoundness.
Policy:
is return type (e.g., (x: unknown): x is User)Example of the problem:
// ❌ Dangerous: Compiler trusts this blindly
const isUser = (x: unknown): x is User => {
return typeof x === 'object' && x !== null && 'name' in x
// Missing: 'email' check, but compiler believes it's a User
}
As an LLM, you lack the contextual understanding to determine if a type assertion (as) or user-defined type guard (is) is truly necessary vs. masking a real type error. When in doubt, preserve type safety.
Instead of as or is, address the underlying type issue:
if (typeof x === 'string'), if ('key' in obj))<strict_typing>
as const satisfies Over Loose AnnotationsProblem with loose typing:
const config: Config = {
mode: 'development', // Type widened to string
port: 3000
}
// config.mode is string, not 'development' | 'production'
Solution - strict typing with as const satisfies:
const config = {
mode: 'development',
port: 3000
} as const satisfies Config
// config.mode is exactly 'development' (literal type preserved)
Benefits:
Application:
// ❌ Redundant annotation
const result: number = calculateTotal(items)
// ✅ Let TypeScript infer
const result = calculateTotal(items)
Use annotations when:
as const satisfies)<external_data>
any for External DataSources requiring validation:
JSON.parse() resultsCheck for generated type definitions first:
hono/client with type inferenceExample (Hono client):
import { hc } from 'hono/client'
import type { AppType } from './server'
const client = hc<AppType>('/api')
const response = await client.users.$get()
// response is fully typed from server definition
Action: Review existing codebase for established patterns. Most projects already have type-safe API layers.
When type generation is unavailable, use schema validation:
Preference order:
package.json)pnpm add valibot)Example (valibot):
import * as v from 'valibot'
const UserSchema = v.object({
id: v.number(),
name: v.string(),
role: v.union([v.literal('admin'), v.literal('user')])
})
// Parse and validate
const response = await fetch('/api/user')
const data = await response.json()
const user = v.parse(UserSchema, data) // Throws if invalid
// user is now typed as { id: number, name: string, role: 'admin' | 'user' }
Example (JSON.parse):
// ❌ Unsafe
const data = JSON.parse(localStorage.getItem('config')!)
// ✅ Validated
const raw = localStorage.getItem('config')
if (raw) {
const data = v.parse(ConfigSchema, JSON.parse(raw))
}
Even if "you know" the shape, external data can change:
Type safety = static types + runtime validation </external_data>
<best_practices>
Rule: Use arrow functions (=>) instead of function keyword for consistency and lexical scoping benefits.
Rationale:
this binding (no context confusion)// ❌ Function declaration
function calculateTotal(items: Item[]): number {
return items.reduce((sum, item) => sum + item.price, 0)
}
// ✅ Arrow function
const calculateTotal = (items: Item[]): number => {
return items.reduce((sum, item) => sum + item.price, 0)
}
// ✅ Concise form (single expression)
const calculateTotal = (items: Item[]): number =>
items.reduce((sum, item) => sum + item.price, 0)
Exception: When hoisting is genuinely required (rare), document the reason.
type LoadingState<T> =
| { status: 'idle' }
| { status: 'loading' }
| { status: 'success'; data: T }
| { status: 'error'; error: Error }
const render = (state: LoadingState<User>) => {
switch (state.status) {
case 'idle':
return 'Not started'
case 'loading':
return 'Loading...'
case 'success':
return state.data.name // data is available
case 'error':
return state.error.message // error is available
}
}
Benefits: Impossible to access data when status is 'error'.
const assertNever = (x: never): never => {
throw new Error(`Unexpected value: ${x}`)
}
switch (state.status) {
case 'idle':
case 'loading':
case 'success':
case 'error':
return
default:
assertNever(state) // Compile error if cases are missing
}
// ❌ Ambiguous state
type User = {
data?: UserData
error?: Error
}
// What if both are defined? Neither?
// ✅ Explicit state
type User =
| { status: 'success'; data: UserData }
| { status: 'error'; error: Error }
unknown Over any for Truly Unknown Types// ❌ Disables all type checking
const process = (data: any) => {
return data.foo.bar // No errors, runtime explosion
}
// ✅ Forces validation
const process = (data: unknown) => {
if (typeof data === 'object' && data !== null && 'foo' in data) {
// Narrow the type before use
}
}
// Prevent accidental mutations
type Config = {
readonly apiUrl: string
readonly timeout: number
}
// For arrays
const items = ['a', 'b'] as const
If type definitions become incomprehensible, simplify the design:
<error_handling>
If you encounter legitimate type errors you cannot fix without as:
// TODO: Type error at line X - potential TypeScript limitation
// Requires manual review before using type assertion
const result = someComplexOperation() // Type error here
src/module.ts:45 - escalated for review"Do not:
as assertionsany to bypass the errorLaunch Chrome with remote debugging port and connect agent_browser with --auto-connect. Use when you need to reuse the user's existing browser profile (cookies, logins, extensions) for authenticated browsing automation.
agent 向けテキスト指示(skill / slash command / task プロンプト / CLAUDE.md 節 / コード生成プロンプト)を、バイアスを排した実行者に動かしてもらい、両面(実行者の自己申告 + 指示側メトリクス)で評価して反復改善する手法。改善が頭打ちになるまで回す。プロンプトや skill を新規作成・大幅改訂した直後、またはエージェントの挙動が期待通りにならない原因を指示側の曖昧さに求めたいときに使う。
日本語の技術文書・書籍原稿・技術記事の執筆規範。書籍の章や解説文向けの文章規範(整形、パラグラフライティング、論証の厳密さ、読み手の負荷の管理、視点と語り、演出の抑制、LLM っぽい空句の禁止、冗長の排除)と、箇条書きコンテンツを自然な文体の技術記事(ブログ記事)に仕上げるための執筆ガイドラインの両方を定める。日本語で技術書の章、草稿、記事、解説文を書く・推敲・リライトするとき、または箇条書きから技術記事を書き起こすときに使用する。
SOC 직업 분류 기준