Principle Foundational Thinking

作者 cursorccb5507cec15无许可证10K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Apply before writing logic: choosing core types and data structures, sequencing scaffold-vs-feature work, asking what concurrent actors share. Get the data structures right so downstream code becomes obvious.

AI 生成的概览

在编写逻辑前指导基础工程决策:数据结构、脚手架顺序与并发隔离。

功能
该技能提供一组在编写代码前进行结构性决策的原则。它建议先定义核心类型和数据结构,梳理访问模式,并选择与主要路径匹配的结构。它还涉及将 CI、lint 和共享类型等脚手架工作排在功能之前,以及在可能发生并发修改时隔离共享状态。它产出的是指导,而非文件或代码。
适用场景
在开始新功能、模块或代码库且核心类型与数据结构尚未确定时使用。它也适用于规划工作顺序、决定先构建哪些脚手架,或推理并发参与者之间的共享状态。
运行要求
无需工具、软件包或凭据;仅为说明性指令,不附带脚本。

Foundational Thinking

Structural decisions protect option value. Code-level decisions protect simplicity.

Data structures first. Get the data shape right before writing logic. Define core types early, trace every access pattern, and choose structures that match the dominant paths.

At code level, DRY the structure, not every line. Types and data models should converge. Three similar statements still beat a premature abstraction. Prefer explicit over clever. Test behavior and edge cases, not line counts.

Concurrency corollary. Before sharing state between actors, ask "what happens if another actor modifies this concurrently?" If not "nothing", isolate.

Scaffold first. If something helps every later phase, do it first. Ask "does every subsequent phase benefit from this existing?" CI, linting, test infrastructure, and shared types are scaffold. Sequence for option value: setup before features, tests before fixes. Keep commits small and single-purpose.

Each increment should land a coherent abstraction or deepen one that exists. Do not spread a new capability across callers as special-case coordination.

Subtraction comes before scaffolding. Remove dead code first, then lay foundations.

来源与署名

来源:cursor/plugins位于pstack/skills/principle-foundational-thinking提交ccb5507

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架