A disciplined workflow plugin for Cursor, Claude Code, et al.: propose-then-implement, tight feedback loops, and stack conventions across all projects and accounts.
Rules (34) Commands (9) Agents (4) Skills (34)
34 rules TypeScript — prefer explicit `| undefined` over optional `?:` for data-shaped fields. # TypeScript: prefer explicit `| undefined` over optional `?:`
For data-shaped fields and props that callers must reason about, type them as `T | undefined` rather than `field?: T`.
## Prefer
```ts
type Props = {
projectId: string | undefined;
user: User | undefined;
};
```
## Avoid
```ts
type Props = {
projectId?: string;
user?: User;
};
```
## Why
Explicit `| undefined` forces every caller to make a deliberate decision about the missing case. Optional `?:` lets callers silently forget the field exists, which masks bugs.
## When `?:` is fine
Pure UI affordance flags where "omitted" obviously means "off": `showHeader?`, `disabled?`, `hideFooter?`. These don't carry data and have a sensible default-false interpretation.
New code lives next to the feature that uses it; promote to shared only when broadly reused. Keep imports at the top of the file; avoid inline or mid-function imports. Investigate root cause before writing any fix; cap hypothesis attempts Keep files small and single-purpose; split by responsibility when they grow. End-to-end engineering loop — think, plan, build, review, test, ship, reflect Treat the context window as a finite budget; prefer narrow reads, delegation, and clean handoffs over dragging stale context forward. TypeScript — use named exports; avoid `export default`. Never hand-edit generated/codegen output; change the source schema and regenerate. TypeScript — don't use `any` or `as` casts to bypass the type system. Backend — don't modify central infrastructure (settings, base classes, middleware, shared fixtures) to make a single test or eval pass. Don't reuse "", 0, None, or null as sentinel values for distinct lifecycle states — model the state explicitly. TypeScript — use `== null` / `!= null` for nullability checks; strict equality everywhere else. Backend — in Python logging, pass format args as separate parameters (%s style); don't pre-format with f-strings. Frontend — use the project's generated/typed API client wrapper; never raw fetch/axios. When project-local rules or skills contradict cadence on the same topic, follow the project-local rule and mention the conflict once. When a lesson keeps recurring, draft a rule promotion for user approval — never auto-commit Default to propose-then-implement. Investigate, present options, wait for approval before changing code. React 19 + Compiler — default to no manual memoization; only reach for it when referential identity genuinely matters. Backend — when adding a new ORM model that has an admin/inspection UI, register it with a minimal usable configuration or document why not. After edits, run the project's linter and type checker; fix what you introduced. Read your own diff like a stranger before declaring done; calibrate confidence with quoted evidence Default to test-first for new behavior and bug fixes — write the failing test, watch it fail for the right reason, then write the minimal code to pass. Frontend — use the design system's theme tokens for colors, spacing, and typography; no raw hex/RGB or magic pixel values. When you change a shared contract (signature, schema field, union variant, dispatch type), update every caller and test in the same change. Verify changes against real runtime evidence before claiming done; stale evidence is not evidence Backend — in async code, eagerly fetch related ORM fields; don't rely on implicit lazy loading. Decompose non-trivial work into a sequence of small, independently verifiable steps with explicit acceptance checks per step. After shipping or debugging, capture one durable lesson per session Frontend — define server-state queries/mutations via centralized option factories; avoid ad-hoc inline keys. Keep commits and PRs surgical. Exclude unrelated changes; target the right branch. Refactors must land complete in one change — no orphan call sites, legacy aliases, or compat shims. For self-contained subtasks, delegate to a fresh subagent with a precise brief instead of inheriting your conversation context. Backend — generate migrations during development; do not run/apply them against shared databases on the user's behalf.