reproduce-and-fix-issu…
Reproduce triaged Slack bugs through a configured app-control adapter, verify existing fixes, and open a bounded draft pull…
TypeScript best practices. Use when reading or editing any .ts or .tsx file.
Claude Code
$ npx -y skills add backnotprop/pstack --skill typescript-best-practices --agent claude-code
Codex
$ npx skills add backnotprop/pstack --skill typescript-best-practices -a codex -y
Cursor
$ npx skills add backnotprop/pstack --skill typescript-best-practices -a cursor -y
Gemini CLI
$ npx skills add backnotprop/pstack --skill typescript-best-practices -a gemini-cli -y
GitHub Copilot
$ npx skills add backnotprop/pstack --skill typescript-best-practices -a github-copilot -y
OpenCode
$ npx skills add backnotprop/pstack --skill typescript-best-practices -a opencode -y
Windsurf
$ npx skills add backnotprop/pstack --skill typescript-best-practices -a windsurf -y
name: typescript-best-practices description: TypeScript best practices. Use when reading or editing any .ts or .tsx file. paths: ["**/*.ts", "**/*.tsx"] disable-model-invocation: true
Apply the **type-system-discipline** principle skill first.
| Rule | Summary | |------|---------| | Discriminated unions | Model variants with a `kind` literal discriminant so impossible states can't be represented. No optional-field bags. | | Branded types | Brand primitives with `& { readonly __brand: "X" }` so they can't be mixed up. Validate once at the boundary. A brand comes from a verifying type guard (`input is AgentId`), never from `as`. | | Constructive modeling | Build the shape so the illegal value can't be constructed. `[T, ...T[]]` for non-empty, `[T, T][]` for even length, `start` plus `duration` for a range. Not a runtime guard, not a wish for refinement types. | | Simplest total type | Keep `T[]` while every operation on it stays total. Strengthen to `NonEmpty<T>` only where the loose type forces `!`, a cast, or a "should never happen" throw. | | `unknown` over `any` | External data is `unknown`. | | Schemas before guards | Before hand-writing a property-by-property type guard, use the repository's runtime schema library and infer the type from the schema, such as `z.infer`. | | No `as` casts | Every `as` is a runtime crash waiting. Cast only after validation. | | Narrowing hierarchy | Discriminant switch > `in` operator > `typeof`/`instanceof` > user-defined type guard > `as`. | | Type guards | Must verify the claim. A lying guard is worse than `as` because the bug hides behind a name that says it's safe. Name them `isX` or `hasX`. | | Exhaustiveness | Inline `const _exhaustive: never = x;` in default arms so the compiler errors when a new variant is added. | | `satisfies` over `as` | Validates the value without widening literal types. | | Boundary validation | Parse where data crosses in, into a named domain type. `Record<string, unknown>` (however spelled) stops at that parse. Trust types inside. See the **boundary-discipline** principle skill. | | Schema-derived types | Reach for `Pick`/`Omit`/`Parameters`/`ReturnType`/`Awaited`/`typeof` before declaring a new interface. | | Object args | Pass objects, not positional, so argument order is self-documenting. Skip on hot paths (per-frame render, tokenizers, parsers). | | Real tests | Don't mock what you can run. Prefer the framework's real test primitives with leak/disposable checks, and verify UI in a running build. Mock only what you can't run locally. | | Structured telemetry | Prefer structured logger diagnostics with enough context to debug from an id. No `console.log` in shipped code. |
Examples: `references/patterns.md`.
i'm poteto. i'm not a president or ceo, but i've worked with millions of lines of code at Meta, Netflix, and Cursor. i'm also on the react core team where i help build and maintain react compiler. there's a growing sense that ai writes too much slop code.
Reproduce triaged Slack bugs through a configured app-control adapter, verify existing fixes, and open a bounded draft pull…
Configure Benny and prepare its triage and repro automations. Use when installing Benny or changing its Slack, tracker,…
Triage Slack issue reports with one thread-only verdict, evidence review, cause-aware routing, tracker dedupe, and fail-closed…
Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for…
Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena,…
Use for \"automate me\", \"create/update/refresh my -mode skill\", \"turn/capture my preferences or working style into a skill\",…
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Converts books and documents (PDF, EPUB, DOCX, HTML, Markdown, plain text, RTF, MOBI/AZW with Calibre) into structured agent…
Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…