principle-foundational-thinking
Use before writing logic, picking core types, or deciding whether infrastructure or features come first. Settle data shapes and groundwork first, and isolate any state that concurrent actors could change.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- principle-foundational-thinking
- description
- Use before writing logic, picking core types, or deciding whether infrastructure or features come first. Settle data shapes and groundwork first, and isolate any state that concurrent actors could change.
- disable-model-invocation
- true
03 SKILL.md 正文
Foundational thinking
Fix the data shapes and the order of groundwork before any logic exists, so the code that follows inherits them. Structural decisions should keep future options open, and code-level decisions should keep things simple.
When it applies
Before writing logic, when choosing core types and data structures, when deciding whether scaffolding or features come first, and when concurrent actors might share state. It is never a reason for speculative abstraction; principle-laziness-protocol still governs size.
What to do
- Choose the core types first. Enumerate how the data will be read and written, and pick structures that fit the most common paths. An audit log queried by actor and time range wants an append-only store indexed on those fields, chosen before any handler exists.
- At the code level, deduplicate structure (types and data models should converge), not every repeated line. A few similar statements beat a premature abstraction. Prefer explicit code over clever code, and test behavior and edge cases over line coverage.
- If two actors will touch the same state, ask what a simultaneous change by the other one would do. Isolate the state unless that answer is "nothing". See principle-separate-before-serializing-shared-state.
- Scaffold first. Anything every later phase benefits from (CI, linting, test infrastructure, shared types, a secrets scanner in pre-commit) comes before features. Sequence the work to keep options open: infrastructure ahead of features, and tests ahead of fixes.
- Keep commits small and about one thing.
- Make each increment introduce a coherent abstraction or deepen an existing one.
- Subtract before scaffolding. Delete dead code first, then lay foundations (principle-subtract-before-you-add).
The failure it prevents
Logic written against the wrong data shape, premature deduplication, races from casually shared state, and features built before the infrastructure that would verify them.
Done when
Core types are named and justified by access patterns before logic exists, and the scaffold is in place before features.
Related: principle-experience-first, principle-subtract-before-you-add, principle-separate-before-serializing-shared-state, principle-model-the-domain.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.