foundations

foundations is a command for Claude Code from TheWayWithin/agent-11. It costs 20 tokens per session (7,837 once invoked), scanned A, original, MIT.

A command for turning foundation documents into structured YAML and a handoff manifest. It can also report status, refresh changed documents, and validate completeness.

In plain words
What is it for?
Use it to initialize project context, detect changed foundation files, update extracted data, and verify that document handoffs are complete.
Why use it?
It removes the need to repeatedly scan project documents by keeping their extracted information structured and checking whether required content is ready.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/thewaywithin/agent-11/foundations
Clone the repo
git clone --depth 1 https://github.com/TheWayWithin/agent-11

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for foundations

README.md
[![agentmods](https://agentmods.dev/badge/commands/thewaywithin/agent-11/foundations.svg)](https://agentmods.dev/commands/thewaywithin/agent-11/foundations)
Your own site
<a href="https://agentmods.dev/commands/thewaywithin/agent-11/foundations"><img src="https://agentmods.dev/badge/commands/thewaywithin/agent-11/foundations.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,837 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.07837
Opus 5 $0.00010 $0.03918
Sonnet 5 $0.00004 $0.01567
Haiku 4.5 $0.00002 $0.00784

Measured yesterday against content hash 70937a90c571, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

foundations scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/foundations.md · 1,015 lines

How it starts

The opening of the file, as written. The whole thing — 1,015 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/foundations Command

PURPOSE

Manage the handoff of BOS-AI foundation documents to AGENT-11. This command scans the documents/foundations/ directory, extracts content to structured YAML schemas, and produces a handoff-manifest.yaml for project context.

Key Design Principle: Extract complete, structured data that agents can parse directly - not lossy prose summaries.

SUBCOMMANDS

/foundations init

Initialize the foundations system - scan documents, extract to structured YAML, generate manifest.

/foundations status

Show current state of all foundation documents with present/extracted/modified status.

/foundations refresh

Re-extract documents that have changed (checksum mismatch).

/foundations validate

Validate that required documents are present and extracted data is complete.


EXECUTION PROTOCOL

Step 1: Parse Subcommand

Extract the subcommand from the user's input:

  • init - Full initialization with extraction
  • status - Show status table
  • refresh - Update changed documents
  • validate - Check document and extraction completeness

If no subcommand provided, default to status.


SUBCOMMAND: init

Phase 1: Directory Scan

Scan Location: documents/foundations/

Document Category Matching (case-insensitive, order of precedence):

Category Priority 1 Priority 2 Priority 3 Priority 4 Priority 5
prd prd.md requirements.md product-requirements.md -prd-.md prd-*.md
vision vision-mission.md vision.md strategic-plan.md vision-and-mission.md
roadmap strategic-roadmap.md roadmap.md development-plan.md
icp client-success-blueprint.md icp.md personas.md customer-success.md
research market-and-client-research.md market-research.md competitive-analysis.md research.md
brand brand-style-guidelines.md brand.md style-guide.md brand-style-guide.md
marketing marketing-bible.md marketing.md positioning.md positioning-statement.md
pricing pricing-strategy.md pricing.md pricing-tiers.md

Read the full file on GitHub · 1,015 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 1,015 lines · 20 tokens per session scan A 70937a90c571

Subscribe to this mod's changes

foundations is a command published in the GitHub repository TheWayWithin/agent-11 (15 stars, last pushed 13d ago), licensed MIT. It adds 20 tokens to every session and 7,837 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.