360 Secure SkillHub
360 安全技能中心

principle-foundational-thinking

提供编码前的结构性思考原则:先确定核心类型与数据结构,按选项价值安排脚手架与功能顺序;代码层强调避免过早抽象、显式优先,并提醒在共享状态前评估并发修改风险。内容为纯文本原则,不含可执行脚本或工具。

分类:开发
poteto
热度 0.00
最近更新 2026-11-25 17:46:33

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add poteto/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. Over-engineering is often a premature decision that closes doors. The right foundational data structure keeps doors open.

Data structures first. Get the data shape right before writing logic. The right shape makes downstream code obvious. Define core types early, trace every access pattern, and choose structures that match the dominant paths. A data-structure change late is a rewrite. Early, it is often a one-line diff.

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.

Subtraction comes before scaffolding: remove dead weight first, then lay foundations.