360 Secure SkillHub
360 安全技能中心

principle-foundational-thinking

该 Skill 在编写逻辑前提供软件设计原则:先确定核心类型与数据结构,再安排脚手架与功能工作的顺序,并检查并发共享状态是否需要隔离;不包含具体实现、脚本或工具调用。

cursor
热度 0.00
最近更新 2026-10-18 16:52:29
分类:开发依赖:纯提示词应用场景:代码生成 / 概念解释

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add cursor/plugins/principle-foundational-thinking
Metadata
name
principle-foundational-thinking
description
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.
disable-model-invocation
true

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.