# Principle foundational thinking

> Principle foundational thinking is an open-source agent skill for developer tools. Guides the agent to settle data shapes and shared state before writing logic. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/principle-foundational-thinking
- **Repository:** https://github.com/michael-denyer/pstack-claude
- **GitHub stars:** 5,057
- **License:** MIT
- **Skill name:** principle-foundational-thinking
- **Collection:** https://github.com/michael-denyer/pstack-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill tells the agent to design the core types and data structures first, then write logic on top of them. It asks the agent to trace how data is accessed across the codebase and pick structures that fit the most common paths, keeping duplication reduction focused on the structure rather than every line of code.

It also covers concurrency: before state is shared between actors, the agent is directed to consider what happens if another actor changes it at the same time, and to isolate that state unless the answer is that nothing goes wrong. For project setup, it advises scaffolding shared foundations such as CI, tests and shared types early, removing dead code first, and keeping commits small and focused on one change.

The skill is plain instructions in a single SKILL.md file with no scripts. It is written for Claude Code as part of the pstack plugin and is not meant to be invoked directly by the user.

## When your agent uses it

> 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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-foundational-thinking)
- [License: MIT](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-foundational-thinking)

## Features

- **Data shape first:** Directs the agent to define core types and trace access patterns before writing logic.
- **Dominant path structures:** Guides choosing data structures that suit the most frequent access paths.
- **Concurrency isolation check:** Prompts the agent to ask how concurrent actors could modify shared state and isolate it when needed.
- **Scaffold ordering:** Sequences shared foundations like CI, tests and types ahead of feature work.
- **Small focused commits:** Encourages removing dead code and keeping each commit single-purpose.

## Good for

- Design the types for a new data model before implementing features
- Plan the order of setup work versus feature work in a new project
- Review whether shared state in a service needs isolation from concurrent writers
- Refactor a codebase so its data structures make downstream code simpler

## Install

### Claude Code

This skill ships in the `pstack` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude
```

Or copy only this skill to `~/.claude/skills/principle-foundational-thinking`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-foundational-thinking &&
cp -R "$tmp/plugins/pstack/skills/principle-foundational-thinking" ~/.claude/skills/principle-foundational-thinking &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/principle-foundational-thinking` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/principle-foundational-thinking` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-foundational-thinking &&
cp -R "$tmp/plugins/pstack/skills/principle-foundational-thinking" ~/.agents/skills/principle-foundational-thinking &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/principle-foundational-thinking` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/principle-foundational-thinking` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-foundational-thinking &&
cp -R "$tmp/plugins/pstack/skills/principle-foundational-thinking" ~/.cursor/skills/principle-foundational-thinking &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/principle-foundational-thinking` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-foundational-thinking
```

Or copy the folder to `~/.gemini/skills/principle-foundational-thinking` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/principle-foundational-thinking`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-foundational-thinking &&
cp -R "$tmp/plugins/pstack/skills/principle-foundational-thinking" ~/.copilot/skills/principle-foundational-thinking &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/principle-foundational-thinking` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git
```

Then copy `pstack-claude/plugins/pstack/skills/principle-foundational-thinking` into your agent's skills folder as `principle-foundational-thinking`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Principle foundational thinking trigger?

It is meant to apply before writing logic, specifically when choosing core types and data structures, sequencing scaffold versus feature work, and when asking what concurrent actors share.

### Does Principle foundational thinking need any scripts or external tools?

No scripts are included. It is a single SKILL.md instruction file with no tool permissions set.

### Which clients does Principle foundational thinking work with?

It is distributed as a Claude Code plugin through the pstack-claude marketplace.

### How do I install Principle foundational thinking in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/principle-foundational-thinking to use it in all your projects, or to .claude/skills/principle-foundational-thinking in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

### Does Principle foundational thinking run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Principle foundational thinking?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Principle foundational thinking?

The closest alternatives to Principle foundational thinking are Principle separate before serializing shared state, Principle subtract before you add, Principle never block on the human, Principle model the domain and Abstract.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Principle separate before serializing shared state](https://ai-powered.com/skills/principle-separate-before-serializing-shared-state): Principle separate before serializing shared state is an open-source agent skill for developer tools.
- [Principle subtract before you add](https://ai-powered.com/skills/principle-subtract-before-you-add): Principle subtract before you add is an open-source agent skill for developer tools.
- [Principle never block on the human](https://ai-powered.com/skills/principle-never-block-on-the-human): Principle never block on the human is an open-source agent skill for developer tools.
- [Principle model the domain](https://ai-powered.com/skills/principle-model-the-domain): Principle model the domain is an open-source agent skill for developer tools.
- [Abstract](https://ai-powered.com/skills/abstract): Abstract is an open-source agent skill for developer tools.
- [Principle experience first](https://ai-powered.com/skills/principle-experience-first): Principle experience first is an open-source agent skill for developer tools.
- [Principle laziness protocol](https://ai-powered.com/skills/principle-laziness-protocol): Principle laziness protocol is an open-source agent skill for developer tools.
- [Principle exhaust the design space](https://ai-powered.com/skills/principle-exhaust-the-design-space): Principle exhaust the design space is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/principle-foundational-thinking
