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 從公開儲存庫中收錄這些內容。

檢舉或申請下架