AGENT SKILL

bootstrap-prelude

Prelude bootstrapping for TypeScript. Use when creating or rebuilding a prelude.ts from ambient generic helpers and types.

License 许可
MIT
所属仓库
sanurb/.dotfiles
最近更新
2026-11-12
Stars
★ 2
Forks
0

01 前言 Front Matter

name
bootstrap-prelude
description
Prelude bootstrapping for TypeScript. Use when creating or rebuilding a prelude.ts from ambient generic helpers and types.
disable-model-invocation
true

02 资源文件 1

03 SKILL.md 正文

Bootstrap a TypeScript Prelude

A prelude is an explicitly imported module for ambient helpers and types: ubiquitous, domain-neutral building blocks that have no more precise owner. Use the bundled prelude.ts as the foundation, then adapt it to evidence from the target repository. Apply ../coding-standards/SKILL.md throughout.

Ambient describes a helper's role, not a TypeScript global. Keep prelude exports behind ordinary imports; do not add global declarations or global augmentation.

1. Map the repository

Read repository instructions, package manifests, TypeScript configuration, source layout, and import conventions. Locate:

  • an existing prelude or equivalent shared module;
  • files named utils, helpers, common, types, result, errors, or similar;
  • generic type aliases and tiny generic functions repeated across modules;
  • established libraries for results, schemas, redaction, branding, collections, and exhaustive matching;
  • every caller of plausible ambient helpers.

Search by both filenames and concepts. Use the ubiquitous generic helper/type categories in the coding standards as seed search terms, then inspect definitions and callers rather than classifying from names alone.

Completion criterion: Every plausible ambient definition found by repository-wide filename, symbol, and duplication scans is inventoried with its owner, callers, dependencies, and current behavior.

2. Classify every candidate

A symbol belongs in the prelude when all of these hold:

  • it is domain-neutral and useful across unrelated modules;
  • no domain, application service, adapter, protocol, or focused generic module is a more precise owner;
  • centralizing it reduces duplication or gives a ubiquitous concept one canonical implementation;
  • its dependencies are minimal, stable, and already justified by the project;
  • its behavior is small enough to understand at the import site or hidden behind a precise type.

Keep a symbol with its focused owner when it encodes domain meaning, application policy, boundary translation, framework behavior, I/O, or a cohesive generic concept such as string casing or non-trivial collection operations. Prefer an established library over a local duplicate. A prelude is a curated foundation, not a barrel or miscellaneous dumping ground.

Record one decision for every candidate: use the established library, keep the current owner, move into the prelude, merge with a template symbol, or delete as an unused duplicate.

Completion criterion: Every inventoried candidate has one decision grounded in its semantics and callers; no candidate remains classified only by its filename or name.

3. Seed from the template

Read the bundled prelude.ts completely. Copy it to the project's established shared-module location as the starting point. If a prelude already exists, merge deliberately instead of overwriting it.

Choose exactly one expected-failure foundation:

  1. When the project uses Effect, use Effect's result/error facilities and remove the template's local Result fallback.
  2. When the project uses better-result, use it and remove the local fallback.
  3. When the project uses neither, ask whether to install better-result.
    • If accepted, install it and remove the local fallback.
    • If declined, enable the template's local Result types and helpers.

Retain each other template export only when repository usage, the coding standards, or the requested foundation justifies it. Preserve compatible existing behavior when merging equivalent helpers; surface semantic conflicts rather than silently choosing one implementation.

Completion criterion: The target file is founded on the template, has exactly one result strategy, and every retained template export has an explicit justification.

4. Consolidate ambient helpers and types

Move or merge the approved repository candidates into the prelude. For each moved symbol:

  • preserve behavior unless a behavior change was requested;
  • preserve or deliberately migrate its public name and type contract;
  • update every caller to import from the prelude directly;
  • retain required JSDoc, safety comments, and targeted lint suppressions;
  • remove superseded definitions and compatibility re-exports after their callers move.

Keep the resulting module side-effect free. It must not read configuration, acquire resources, register handlers, perform I/O, contain domain/application policy, or re-export unrelated modules.

Completion criterion: Every approved candidate has one canonical definition, every caller uses it, and no removed source remains as a second source of truth.

5. Verify the foundation

Run the repository's formatter, type checker, linter, and focused tests. Search again for the old symbols, duplicate definitions, stale import paths, and broad utility files that were part of the inventory. Review every prelude export for current usage or an explicit foundational reason.

Report:

  • the chosen result strategy;
  • template exports retained or removed;
  • repository helpers moved, merged, left in place, or deleted;
  • verification commands and outcomes.

Completion criterion: Repository checks pass, every inventory decision is reflected in code, duplicate ambient definitions are gone, and every prelude export is justified.

04 同仓库更多 Skills

sanurb
sanurb/.dotfiles

writing-great-skills

Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.

内容创作者写作与文案
★ 2
sanurb
sanurb/.dotfiles

write-discoverable-code

Rules for writing code that coding agents (and humans) can find and understand through plain-text search. Apply whenever writing or renaming code: functions, types, constants, files, error messages, doc comments. Grounded in measurement: agents navigate by plain-text search, not by AST or language server, so every identifier is a search query and every search miss costs wasted reads.

开发工程师
★ 2
sanurb
sanurb/.dotfiles

wrangler

Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

后端与接口
★ 2
sanurb
sanurb/.dotfiles

workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

★ 2
sanurb
sanurb/.dotfiles

web-perf

Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.

Skill与智能体开发
★ 2
sanurb
sanurb/.dotfiles

wayfinder

Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.

★ 2