본문으로 건너뛰기
cccskills
무료GitHub에 공개

learn

Extract reusable patterns from non-trivial work in the is-kit repository and store them as project knowledge. Use after meaningful API design, type-system work, debugging, or compatibility discoveries.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(14)

  • SKILL.md4.4 KB
  • LEARNED_INDEX.md2.8 KB
  • learned/balance-runtime-cost-with-compositional-design.md2.2 KB
  • learned/deprecate-public-api-before-major-removal.md2.7 KB
  • learned/keep-typed-schema-key-coverage-explicit.md3.7 KB
  • learned/model-transformations-as-decoders.md3.1 KB
  • learned/order-precise-overloads-before-generic-fallbacks.md2.7 KB
  • learned/prefer-non-throwing-intrinsic-brand-checks.md2.3 KB
  • learned/preserve-enumerable-key-membership-in-exact-structs.md3.8 KB
  • learned/preserve-explicit-generic-call-compatibility.md2.6 KB
  • learned/preserve-type-guard-semantics-across-host-values.md1.9 KB
  • learned/require-singleton-keys-for-single-property-refinements.md3.9 KB
  • learned/separate-property-refinement-absence-contracts.md3.9 KB
  • learned/test-packed-artifacts-from-a-consumer-project.md3.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

/learn - Capture Reusable is-kit Patterns

Analyze the current session and capture reusable knowledge for this TypeScript type-guard library.

Auto-Activation Criteria

Consider auto-activating this skill when:

  1. A non-trivial bug was fixed in runtime guard behavior or type inference.
  2. A public API design decision was made and validated with tests.
  3. A tricky TypeScript modeling pattern was discovered.
  4. A runtime/type parity issue was diagnosed and resolved.
  5. The session produced reusable guidance about tests, docs, or release safety for this library.

Do not activate for:

  • trivial typo fixes
  • one-line doc wording changes
  • obvious refactors with no reusable lesson
  • patterns already documented in .codex/skills/learn/learned/

Manual Trigger

Run /learn after finishing a meaningful implementation, refactor, or debugging session in is-kit.

What To Extract

1. Public API Design Patterns

  • What API was added or changed?
  • Why was that shape chosen over alternatives?
  • What backward-compatibility constraint mattered?
  • How should similar future APIs be designed?

Project-relevant examples:

  • Distinguishing key-level optionality from value-level undefined.
  • Choosing a specialized combinator vs. a more generic abstraction.
  • Preserving existing semantics in a minor release while introducing a new helper.

2. Type Modeling Patterns

  • How were inference, narrowing, or overloads preserved?
  • What TypeScript limitation mattered?
  • What exact type shape or helper solved it?

Project-relevant examples:

  • Modeling struct schemas with required vs. optional keys.
  • Normalizing intersection-heavy inferred types for tsd.
  • Preserving literal narrowing without assertion casts.

3. Runtime Validation Patterns

  • What runtime behavior needed to match the type-level contract?
  • What edge cases mattered?
  • What implementation detail should future changes preserve?

Project-relevant examples:

  • Own-key checks vs. inherited property checks in struct.
  • Exact-mode semantics when optional keys are present or absent.
  • Composing schema markers with existing value guards.

4. Verification Patterns

  • What test mix caught the issue?
  • What commands should be run after similar changes?
  • What docs needed updating to keep the repo consistent?

Project-relevant examples:

  • Adding both Jest and tsd coverage for public API changes.
  • Running pnpm build, pnpm lint, pnpm test, and pnpm test:types.
  • Updating README and docs site examples when semantics change.

Output Format

Create one file per pattern at:

.codex/skills/learn/learned/[pattern-name].md

Template:

# [Descriptive Pattern Name]

**Captured:** YYYY-MM-DD
**Context:** [When this pattern applies]
**Tags:** typescript, type-guards, combinators, struct, tsd, api-design, runtime-validation, etc.

## Problem

[Specific recurring problem this pattern solves]

## Solution

[Reusable approach, key decisions, constraints, and tradeoffs]

## Example

```ts
// Minimal real example from this codebase
```

## When To Use

[Trigger conditions for applying this pattern]

## Related Files

- `src/core/combinators/struct.ts`
- `src/types/schema.ts`
- `tests/core/combinators/struct.test.ts`
- `tests-d/core/combinators/struct.test-d.ts`

Process

  1. Review the session for candidate learnings.
  2. Select the highest-value reusable pattern(s).
  3. Draft the pattern file.
  4. Ask for user confirmation before saving.
  5. Save to .codex/skills/learn/learned/.
  6. Update .codex/skills/learn/LEARNED_INDEX.md with a one-line entry.

Index format:

- **[pattern-name](learned/pattern-name.md)** - One-line summary.

Common Pattern Categories For This Repository

  • Guard/combinator API design
  • Runtime/type parity in public APIs
  • struct schema semantics and exact-mode behavior
  • TypeScript inference and overload design
  • tsd-driven regression prevention
  • Object-shape validation edge cases
  • Documentation alignment after API changes

Notes

  • Capture only reusable, non-trivial lessons.
  • Prefer patterns that explain both runtime behavior and type inference.
  • Include the commands and tests that validated the pattern when relevant.
  • Keep entries concrete, searchable, and library-focused.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Run Prettier for the is-kit repository. Use when asked to format or check formatting in this project. Always consult AGENTS.md in the repo root before executing commands.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

nyaomaru/is-kit1182026년 10월 21일 업데이트

Create, compose, migrate, and review TypeScript runtime type guards with is-kit. Use when adding reusable guards; replacing typeof, null checks, or handwritten type predicates; narrowing unknown values; validating JSON or API responses; building collection or object schemas with struct or typedStruct; or reviewing existing is-kit usage. Do not use for one-off environment checks or validation that requires data transformation or rich error reporting.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

nyaomaru/is-kit1182026년 10월 21일 업데이트

nyaomaru의 스킬 모두 보기

이 스킬의 문제 신고