Skip to content
cccskills
FreePublished on 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.

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

See how to install

Files included (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 (original)

Review the instructions the agent will receive before you install.

/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.

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

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.

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

nyaomaru/is-kit118Updated Oct 21, 2026

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.

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

nyaomaru/is-kit118Updated Oct 21, 2026

See all skills by nyaomaru

Report a problem with this skill