npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tienne/gestalt

v0.163.0

Published

TypeScript AI Development Harness - Gestalt psychology-driven requirement clarification

Readme


The hardest part of building software isn't writing code — it's knowing what to build. Gestalt is an MCP server that runs inside Claude Code and acts as a structured interviewer: it applies five Gestalt psychology principles to raise requirement resolution from vague intent to a measurable score of ≥ 0.8, then crystallizes that into a validated Spec that drives the rest of your pipeline. No API key required.

/interview "user authentication system"   # AI interviews you until resolution ≥ 0.8
/spec                                      # crystallize into a validated Spec
/execute                                   # plan → execute → evaluate → evolve

Requires Node.js >= 22.0.0. Use nvm install 22 && nvm use 22 if needed.


Contents


Built with Gestalt, for Gestalt

This repository is developed using the gestalt-develop skill — the same pipeline you get when you install Gestalt. Every significant feature in v0.26.0 was implemented through the Interview → Spec → Execute → Evolve loop:

  • Memory → Interview feedback loop (prior specs auto-injected into new sessions)
  • execute-passthrough.ts 1,296-line God File decomposed into 8 focused modules
  • Code review context-collector migrated from regex to blastRadius() graph analysis
  • ESLint flat config + CI 3-gate pipeline (typecheck → lint → format:check)

This self-referential proof is the strongest argument for Gestalt: an AI harness that improves itself through its own pipeline. When Gestalt interviews you about a Gestalt feature, it applies the same five principles to its own architecture.


Quick Start

Install the plugin once, then use it in any Claude Code session.

From a terminal (outside a session):

claude plugin install gestalt@gestalt

Inside a Claude Code session:

/plugin marketplace add tienne/gestalt
/plugin install gestalt@gestalt

Then run the pipeline:

/interview "user authentication system"
/spec
/execute

Full MCP Reference — all tools, parameters, and examples


Installation

Windows hosts are not supported. The plugin starts its MCP server through sh -c, which a Windows host cannot run, and CI covers only Ubuntu and macOS. If you want to try it on Windows anyway, install globally with npm i -g @tienne/gestalt and register the server yourself with "command": "gestalt", "args": ["serve"], and "env": { "GESTALT_FOLLOW_PLUGIN": "0" }, as in Option 3.

Option 1: Claude Code Plugin (Recommended)

Bundles the MCP server, slash-command skills, Gestalt agents, and project context — pre-configured in a single install.

From a terminal:

claude plugin install gestalt@gestalt

Inside a Claude Code session:

/plugin marketplace add tienne/gestalt
/plugin install gestalt@gestalt

What you get:

| Item | Details | |------|---------| | MCP Tools | ges_interview, ges_generate_spec, ges_execute, ges_create_agent, ges_agent, ges_status, ges_code_graph, ges_graph_visualize, ges_benchmark, ges_generate_kb, ges_search, ges_sync, ges_pr, ges_peer, ges_architecture, ges_research, ges_digest, ges_prd — see the MCP reference | | Slash Commands | Workflow skills — /interview, /spec, /execute, /review, /pr, /brief, /jira-create, /slack-send, and more. Full list in Skills | | Agents | Pipeline agents, role agents, and review agents | | CLAUDE.md | Project context and MCP usage guide auto-injected |


Option 2: Claude Code Desktop

Install once, then point the config at the installed binary:

npm install -g @tienne/gestalt
{
  "mcpServers": {
    "gestalt": {
      "command": "gestalt",
      "args": ["serve"],
      "env": { "GESTALT_FOLLOW_PLUGIN": "0" }
    }
  }
}

MCP tools are available immediately after restart. Slash commands require the plugin or manual skills setup.

npx -y @tienne/gestalt works too, but read Startup timeouts first — the desktop app is the setup most likely to hit them.


Option 3: Claude Code CLI

npm install -g @tienne/gestalt
claude mcp add gestalt -e GESTALT_FOLLOW_PLUGIN=0 -- gestalt serve

Or add directly to ~/.claude/settings.json:

{
  "mcpServers": {
    "gestalt": {
      "command": "gestalt",
      "args": ["serve"],
      "env": { "GESTALT_FOLLOW_PLUGIN": "0" }
    }
  }
}

Startup timeouts

If the server connects sometimes and reports Connection closed other times, the cause is almost always npx, not Gestalt. Three things are worth knowing.

npx reaches the registry on every start. Pinning an exact version does not change that. Measured against npm: 1.9s on a warm cache, 20s on a cold one, and a 70s hang before failing when the registry is unreachable. Claude Code gives a stdio server 30s to answer initialize, so the cold and offline cases both surface as a closed connection. Installing the package globally and calling gestalt serve skips all of it.

GUI-launched sessions have a different PATH. Anything started outside a terminal — the desktop app, a launcher, launchd — inherits a PATH with no version manager on it, so npx is not found and the server dies instantly. Give command an absolute path, or set env.PATH on the server entry.

startup_timeout_sec does nothing in Claude Code. That key belongs to Codex. Claude Code reads the MCP_TIMEOUT environment variable (milliseconds) instead, so it goes in settings.json, where it lands in the Claude Code process:

{
  "env": { "MCP_TIMEOUT": "180000" }
}

The plugin install (Option 1) already handles the first two through scripts/mcp-serve.sh: it finds Node under nvm, fnm, Volta, or Homebrew, uses a globally installed gestalt only when its version matches the plugin's pin (a global of any other version is ignored with a warning, so updating the plugin is enough), and otherwise resolves the pinned version from the npm cache, falling back to the network only when the cache misses.

The terminal gestalt follows the plugin the same way. When an npm i -g install finds an installed gestalt plugin at a different version, it hands the command to that plugin's launcher, so updating the plugin also updates the CLI.

It looks at the user-scope gestalt@gestalt install for Claude Code (installed_plugins.json under both CLAUDE_CONFIG_DIR and ~/.claude, unless settings.json turns the plugin off) and the enabled plugin from the gestalt marketplace for Codex (CODEX_HOME or ~/.codex). With several installs it follows the highest version, even when the global itself is newer.

Runs from a repo checkout, a project dependency, or the npx cache keep their own version. An unpinned npx -y @tienne/gestalt still runs the global binary whatever version is installed there, so set GESTALT_FOLLOW_PLUGIN=0 wherever the version must stay pinned. The plugin's MCP manifests and gestalt update already do, and so do the Claude Code and Codex examples in this README. If you register the server another way, such as the Grok and Gemini commands, add the same variable to its env. For an existing Codex registration, add GESTALT_FOLLOW_PLUGIN = "0" under [mcp_servers.gestalt.env] in config.toml (CODEX_HOME or ~/.codex); gestalt update leaves npx registrations as they are. Delegation goes through the npm cache, so each call takes about two seconds longer until the global matches the plugin again.


Option 4: OpenAI Codex Plugin

Bundles the MCP server and every workflow skill, the same way the Claude Code plugin does.

codex plugin marketplace add tienne/gestalt
codex plugin add gestalt@gestalt

What you get:

| Item | Details | |------|---------| | MCP Tools | All ges_* tools — see the MCP reference | | Skills | Every skill in Skills, including gestalt:review and gestalt:pr | | Agents | Role agents and review agents (bundled for skills to read) |

Skills load on the next Codex session. Slash commands and the Claude Code Task panel are still Claude Code only — in Codex you invoke a skill by describing the task, and Codex reads the matching SKILL.md.

Start a new session after installing, then ask “Check Gestalt status” or “Set up Gestalt for this Codex project.” The server recognizes Codex during MCP initialization: new projects record execution context in AGENTS.md, and agent models inherit the active Codex session by default. Explicit client and model settings still take precedence; client: "both" continues writing both host files. For a persistent Codex-only project, ask the setup skill to save client: "codex". The skill runs setup --client codex through the versioned launcher below (or init --client codex for the graph and Git hook), with compatibility handling when the pinned CLI predates that option.

Skills use the bundled host adapter to translate Claude tool examples into the available Codex tools. They run CLI checks through the versioned launcher, so no global gestalt install is needed. The first CLI call may download the plugin's exact npm version and needs Node.js >=22 and npm on PATH.

If startup fails, check MCP status and Node/npm availability. If the recorded host or model is unexpected, inspect ges_status fields hostClient, client, and tierModels before changing project settings. Claude Task panels and Gestalt's current Claude Code hook integrations are optional; they do not gate Codex execution.

Gestalt has not integrated its code graph injection, WebFetch cache, or peer watching hooks with Codex. Codex desktop supports hooks in manually installed plugins, subject to explicit trust; plugins containing hooks are ineligible for the public directory. See Codex hook support for the official source, verified 2026-11-05, and the boundaries for other hosts, including Orca.


Option 5: OpenAI Codex CLI (MCP only)

If you want the MCP tools without the bundled skills:

codex mcp add gestalt --env GESTALT_FOLLOW_PLUGIN=0 -- npx -y @tienne/gestalt serve

Then add "client": "codex" to your project's gestalt.json so the active session context is written to AGENTS.md (which Codex reads automatically):

{
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
  "client": "codex"
}

Or set GESTALT_CLIENT=codex as an environment variable.

Codex uses host passthrough mode: Gestalt returns prompts and structured context, and Codex performs the reasoning, file edits, and command execution. When client is "codex", this remains true even if ANTHROPIC_API_KEY exists in your shell.

All MCP tools (ges_interview, ges_generate_spec, ges_execute, etc.) are available immediately. This option ships no skills — the pipeline runs entirely through MCP tool calls. Use Option 4 if you want gestalt:review and the other workflow skills. During execution, active context is written to a managed section in AGENTS.md; continue following the current MCP response (executeContext, taskContext, etc.) in the active Codex turn.


Option 6: Grok Build Plugin

Bundles the MCP server and workflow skills for Grok Build TUI/CLI. Install from the Grok marketplace (.grok-plugin/marketplace.json). Do not use the Claude marketplace here — that one copies the repo root.

grok plugin marketplace add tienne/gestalt
grok plugin install gestalt --trust

Then add "client": "grok" to your project's gestalt.json so the active session context is written to .grok/rules/gestalt-active.md (which Grok always scans):

{
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
  "client": "grok"
}

Or set GESTALT_CLIENT=grok as an environment variable.

Grok uses host passthrough mode: Gestalt returns prompts and structured context, and Grok performs the reasoning, file edits, and command execution. When client is "grok", this remains true even if ANTHROPIC_API_KEY exists in your shell.


Option 7: Grok Build CLI (MCP only)

If you want the MCP tools without the bundled skills:

grok mcp add gestalt -- npx -y @tienne/gestalt serve

If gestalt is also installed globally (any version), add GESTALT_FOLLOW_PLUGIN=0 to this server's env.

Then add "client": "grok" as in Option 6. This option ships no skills — the pipeline runs entirely through MCP tool calls. Use Option 6 if you want the workflow skills. During execution, active context is written to .grok/rules/gestalt-active.md.


Option 8: Google Gemini CLI

gemini mcp add gestalt -- npx -y @tienne/gestalt serve

If gestalt is also installed globally (any version), add GESTALT_FOLLOW_PLUGIN=0 to this server's env.

Or add directly to ~/.gemini/settings.json:

{
  "mcpServers": {
    "gestalt": {
      "command": "npx",
      "args": ["-y", "@tienne/gestalt", "serve"],
      "env": { "GESTALT_FOLLOW_PLUGIN": "0" }
    }
  }
}

Then add "client": "codex" to your project's gestalt.json — Gemini CLI reads AGENTS.md for persistent context, same as Codex:

{
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
  "client": "codex"
}

Use the /mcp command inside a Gemini CLI session to verify the server is connected.


Interview + Spec: The Core Differentiator

Claude Code and Cursor are excellent at executing tasks. Where they struggle is when the task itself is unclear. Gestalt fills that gap: before any code is written, it conducts a structured interview that surfaces assumptions, resolves contradictions, and captures acceptance criteria — producing a Spec precise enough to drive a dependency-aware execution plan.

1. Interview

Start with any topic. A rough sentence is enough.

/interview "I want to build a checkout flow with Stripe"

Gestalt conducts a multi-round interview. Each round targets the weakest resolution dimension using a weighted impact score (1 - clarity) × weight, so the interview always attacks the most critical gap first.

The five principles guide the process:

| Principle | Role | |-----------|------| | Closure | What's missing? Surfaces implicit requirements you haven't said yet | | Proximity | Which features belong together? Groups by domain | | Similarity | Are there repeating patterns across requirements? | | Figure-Ground | What's the core MVP vs. what's optional? | | Continuity | Any contradictions? Detected and penalized until resolved |

The resolution score rises across four dimensions:

| Dimension | Principle | Greenfield weight | Brownfield weight | |-----------|-----------|:-----------------:|:-----------------:| | goalClarity | Closure | 0.40 | 0.30 | | constraintClarity | Proximity | 0.25 | 0.20 | | successCriteria | Similarity | 0.20 | 0.15 | | priorityClarity | Figure-Ground | 0.15 | 0.15 | | contextClarity | Continuity | — | 0.20 |

The interview continues until overall ≥ 0.8:

Round 1 → resolution: 0.28  (lots of unknowns)
Round 4 → resolution: 0.55  (getting clearer)
Round 8 → resolution: 0.81  ready for Spec

Contradictions are penalized directly: unresolved contradictions subtract up to 0.15 from the overall score, making it structurally impossible to reach 0.8 without resolving them first.

Context Compression

When rounds exceed 5, Gestalt signals that compression is available. Use the compress action to summarize earlier rounds and keep the context window lean:

1. respond returns needsCompression: true + compressionContext
2. ges_interview({ action: "compress", sessionId }) → compressionContext
3. Caller generates summary → submits it → stored in session

The compressed summary is automatically injected into all subsequent rounds.


2. Spec Generation

From a completed interview:

/spec

From text (no interview required):

ges_generate_spec({ text: "Build a checkout flow with Stripe" })

With a built-in template:

| Template ID | Description | |-------------|-------------| | rest-api | REST API with auth, CRUD, and OpenAPI | | react-dashboard | React dashboard with charts, filters, and responsive layout | | cli-tool | CLI with subcommands, config file, and distribution |

ges_generate_spec({ text: "API with JWT authentication", template: "rest-api" })

The generated Spec includes:

goal                → Clear, precise project objective
constraints         → Technical and business constraints
acceptanceCriteria  → Measurable, verifiable success conditions
ontologySchema      → Entity-relationship model
gestaltAnalysis     → Key findings per Gestalt principle

Memory: The Feedback Loop

Every spec and execution result is automatically recorded in .gestalt/memory.json at your repo root.

{
  "specHistory": [
    { "specId": "...", "goal": "Build a user auth system", "sourceType": "text" }
  ],
  "executionHistory": [],
  "architectureDecisions": []
}

The interview gets shorter over time. When prior specs and execution history exist, Gestalt automatically injects that context into the gestaltContext.systemPrompt at the start of each new interview session. Prior goals, architecture decisions, and constraints become shared knowledge — the AI already knows what you've built and why.

Commit it. .gestalt/memory.json is plain JSON. Teammates inherit all prior decisions on git pull. To avoid merge conflicts, register the memory merge driver — see docs/memory-team-sharing.md.


Code Knowledge Graph

Build a static dependency graph of your codebase and extract blast-radius impact files for any change — so Gestalt's review and evolution steps only process the files that actually matter.

# Build or incrementally update the graph
ges_code_graph({ action: "build", repoRoot: "/path/to/repo" })

# Find all files impacted by a commit
ges_code_graph({ action: "blast_radius", repoRoot: "...", commitSha: "abc123" })

# Find files impacted by uncommitted changes
ges_code_graph({ action: "diff_radius", repoRoot: "..." })

Stored at .gestalt/code-graph.db (WAL SQLite, separate from the event store). After gestalt init, a post-commit hook keeps it current automatically.

Language support:

| Language | Extensions | Support level | |----------|-----------|--------------| | TypeScript / JavaScript | .ts, .tsx, .js, .jsx | First-class — TypeScript Compiler API, full AST analysis | | Python, Go, Java, Kotlin, Rust, Swift, Objective-C | various | Regex-based best-effort — basic function/class/import extraction; dynamic imports, macros, and metaprogramming may be missed |

See Code Knowledge Graph docs for the full reference.


Execute → Evaluate → Evolve

These stages run in Passthrough mode — Claude Code performs the actual file edits and code execution through its tools (Bash, Edit, etc.). Execute carries out real work; Gestalt manages state and advances the pipeline. No API key is used in this stage.

3. Execute

Transform the Spec into a dependency-aware execution plan and run it:

/execute

Planning applies four Gestalt principles in a fixed sequence:

| Step | Principle | What it does | |:---:|-----------|-------------| | 1 | Figure-Ground | Classifies acceptance criteria as critical vs. supplementary | | 2 | Closure | Decomposes ACs into atomic tasks, including implicit ones | | 3 | Proximity | Groups related tasks by domain | | 4 | Continuity | Validates the dependency DAG — no cycles, topological order confirmed |

Execution runs tasks in topological order. After each task, drift detection checks alignment with the Spec:

  • 3-dimensional score: Goal (50%) + Constraint (30%) + Ontology (20%)
  • Jaccard similarity measurement
  • Auto-triggers a retrospective when drift exceeds the threshold

Parallel Execution

The plan_complete response includes parallelGroups: string[][]. Tasks with no mutual dependencies are placed in the same group and can run concurrently:

"parallelGroups": [
  ["setup-db", "setup-env"],
  ["create-schema"],
  ["seed-data", "run-tests"]
]

Resuming an Interrupted Session

ges_execute({ action: "resume", sessionId: "<id>" })

Returns ResumeContext: completed task IDs, next task, and progressPercent. The ges_status response also includes resumeContext automatically for any active session.

Brownfield Audit

When a codebase already exists, audit it against the Spec before running new tasks:

# Step 1: request audit context
ges_execute({ action: "audit", sessionId: "<id>" })
# → returns auditContext (systemPrompt, auditPrompt)

# Step 2: submit codebase snapshot + audit result
ges_execute({
  action: "audit",
  sessionId: "<id>",
  codebaseSnapshot: "...",
  auditResult: {
    implementedACs: [0, 2],
    partialACs: [1],
    missingACs: [3],
    gapAnalysis: "..."
  }
})

Sub-Agent Spawning

Decompose a complex task into sub-tasks dynamically during execution:

ges_execute({
  action: "spawn",
  sessionId: "<id>",
  parentTaskId: "task-3",
  subTasks: [
    { title: "Write DB schema", description: "..." },
    { title: "Run migration", description: "...", dependsOn: ["spawned-<id>"] }
  ]
})

Real-Time Progress Panel

The /execute slash command displays live execution status in the Claude Code Task panel — completed/total tasks, current task name, failed count, and parallel group progress. Updated automatically at each planning step, task completion, and evaluation stage.


4. Evaluate

Execution triggers a two-stage evaluation automatically:

| Stage | Method | On failure | |:---:|-------|-----------| | 1 | Structural — runs lint → build → test | Short-circuits; Stage 2 is skipped | | 2 | Contextual — LLM validates each AC and goal alignment | Enters the Evolution Loop |

Success condition: score ≥ 0.85 AND goalAlignment ≥ 0.80


5. Evolve

When evaluation fails, the Evolution Loop engages. Three recovery flows are available:

Flow A — Structural Fix (when lint/build/test fails)

evolve_fix → submit fix tasks → re-evaluate

Flow B — Contextual Evolution (when AC score is too low)

evolve → patch Spec (ACs/constraints) → re-execute impacted tasks → re-evaluate

Spec patch scope: ACs and constraints are freely editable; ontology can be extended; goal is immutable.

Flow C — Lateral Thinking (when stagnation is detected)

Gestalt rotates through lateral thinking personas rather than terminating:

| Stagnation Pattern | Persona | Strategy | |--------------------|---------|---------| | Hard cap hit | Multistability | View from a different angle | | Oscillating scores | Simplicity | Strip down and converge | | No progress (no drift) | Reification | Fill in what's missing | | Diminishing returns | Invariance | Replicate what worked |

When all four personas are exhausted, the session doesn't end. It pauses at a Human Escalation gate (awaiting_human) that shows where it got stuck and offers four options: patch the spec, handle the task manually, restart, or abort. The human's decision and rationale go back through gate_resolve. Patching or manual handling resumes the session, and every decision is saved to Memory for future interviews.

Termination conditions:

| Condition | Trigger | |-----------|---------| | success | score ≥ 0.85 AND goalAlignment ≥ 0.80 | | stagnation | 2 consecutive rounds with delta < 0.05 | | oscillation | 2 consecutive score reversals | | hard_cap | 3 structural + 3 contextual failures | | caller | Manual termination | | human_escalation | All 4 lateral personas exhausted, then the human picks restart or abort at the gate |


Code Review

When evolution finishes, code review starts automatically:

review_start → agents submit perspectives → consensus → auto-fix

The review context-collector uses blastRadius() from the Code Knowledge Graph to scope analysis to impacted files only — falling back gracefully if no graph DB exists. See Agents for the full list of built-in reviewers.


Skills

Each skill is a slash command in Claude Code. In Codex the same skill is gestalt:<name>, and Codex picks it from your description of the task. Not sure which of two similar skills to use? See Choosing a skill.

| Skill | Use it to | |-------|-----------| | /interview | Clarify requirements through Gestalt-driven Q&A until the resolution score reaches 0.8. Stops before the Spec | | /spec | Turn a finished interview into a Spec | | /execute | Turn an existing Spec into a validated execution plan, then execute, evaluate, and evolve | | /solve | Drive interview → spec → execute as one loop without stopping between steps | | /dispatch | Send ready tasks from an execute session to terminals in an external agent runtime (Orca). Opt-in — without one, /execute's default parallel path is better | | /handoff | Pick where to hand a task (main, subagent, child worktree, independent worktree), set model and effort as a pair, and send it there. Uses Orca for worktrees when available | | /conductor | Turn the current session into a conductor that takes orders (spoken requests, Jira tickets, PR watch) across repos, assigns them to workers, and drives each to merge. Asks you only at fixed gates such as merge approval. See Conductor | | /setup | First-time project setup: gestalt.json, code graph, and post-commit hook | | /build-graph | Build or rebuild the code knowledge graph only | | /blast-radius | Before changing code, find the files a change would reach and load only those | | /diff-radius | See how far uncommitted and staged changes reach | | /architecture | Draw a screen-to-DB or deploy-path architecture view where every solid line cites code or an API spec. Unproven links stay dashed or become open questions | | /doubt | While building, send one decision (branching logic, an irreversible step, a security property claim) to a fresh-context subagent with only the artifact and its contract, and hear the case against it first. Stops after three rounds | | /review | Review a PR, branch, or commit with the review agents, and post inline comments when the target is a PR | | /review-loop | Follow someone else's GitHub PR as reviewer — review, post a verdict, wait for the author, and re-review until approve | | /review-reply | Work through review comments on your own PR: fix, commit, and post replies written by code-review-responder | | /pr | Write a PR description from the diff and the repo's conventions, then open it on GitHub with gh | | /local-pr | PRs that never leave the repo, for agents handing code to each other. No gh, auth, or remote needed | | /ship | Converge review on a local PR, then open a draft GitHub PR and collect Copilot review | | /brief | Performance reports, proposals, RFCs, and decision memos written as prose for stakeholders | | /presentation | Slide decks — presentation-writer writes the content and presentation-designer builds Reveal.js HTML | | /video-digest | Turn a YouTube video or a video file into a summary viewer where every bullet cites transcript sentences, with a table of contents, player, and a script that follows playback. Also exports Markdown. See Video digest | | /lens | Read a paper PDF, web article, internal doc, or podcast explained so it clicks: easy, but never wrong. By default an easy version opens first, with a toggle back to the closer-to-source report. Every sentence cites the source page and paragraph, claims that disagree with the source's own tables get a doubt mark, and unverified parts are collected at the end. Adds prior-work cards, links to your own notes, and interactive figures drawn from the source tables. See Reading lens | | /prd-view | Turn an existing PRD markdown into a single card-style HTML page. Sections follow the source, every block carries its source line range, and lines that never made it onto the page are reported. See PRD view | | /research | Competitor research in one document: sources, products, screen captures, comparison, judgment, and open questions. Cells without evidence say "unconfirmed" instead of being filled in. See Competitor research | | /market-scan | Survey the landscape of services that do the same job and pick reference candidates. Stops before screen capture and analysis | | /screen-ref | Collect only the competitor's screens. Builds a screen map, captures with personal data swapped for fake values, and stops before payment or other confirmations. No interpretation | | /device | Read and drive a mobile app on a real phone, emulator, or simulator. Picks the tool by purpose and OS version (iph, mobile-mcp, Maestro, idb, adb), installs it after you approve, then loops read, act, read again. Stops before payment and other hard-to-undo actions such as confirming a reservation. research and screen-ref call it for app screens | | /ux-research | Read collected screens from the user's and the business's point of view and write wow points and pain points. Observations link to captures and predictions carry an interpretation mark | | /reverse-plan | Work backward from the competitor's core business to why the screen was built that way, then split what to bring over from what not to. Everything is marked as interpretation | | /explain | Explain a concept, error, or code for a chosen audience, then check it with explain-check | | /jira-create | Draft a Jira ticket with jira-writer and create it after you approve the preview | | /slack-send | Draft a Slack message in the author's voice and send or schedule it after you approve | | /share | Open or close a session share for this session, approve or deny a waiting teammate, and kick a viewer. If the peer daemon isn't running it asks once and starts it detached from the session (gestalt peer daemon --detach). Runs only when you type it — the model can't call it on its own | | /agent | Call any agent directly when no dedicated skill covers the task |


Agents

Use any agent directly, outside the pipeline:

# List all available agents
/agent

# Run a specific agent on any task
/agent architect "review the module boundaries in this codebase"
/agent security-reviewer "check this authentication code for vulnerabilities"
/agent technical-writer "write a README for this module"

Role Agents

Built-in role agents each review from their own domain. The table lists the main ones; skill-support agents such as jira-writer and code-review-writer live in the same plugin/role-agents/ directory:

| Agent | Domain | |-------|--------| | architect | System design, scalability | | frontend-developer | UI, React, accessibility | | backend-developer | API, database, server | | devops-engineer | CI/CD, infrastructure, monitoring | | qa-engineer | Testing, quality, automation | | designer | UX/UI, design systems | | product-planner | Roadmap, user stories, metrics | | researcher | Analysis, data, benchmarks | | technical-writer | Documentation, API docs, guides, README |

Review Agents

Built-in review agents each analyze the code from one angle:

| Agent | Focus | |-------|-------| | security-reviewer | Injection, XSS, auth vulnerabilities, secrets | | performance-reviewer | Memory leaks, N+1 queries, bundle size, async | | quality-reviewer | Readability, SOLID, error handling, DRY | | frontend-reviewer | UI/React review, accessibility, bundle optimization | | comment-reviewer | Comment hygiene — restated code, dead code, stale comments, untracked TODOs | | writing-reviewer | Prose in changed docs and user-facing strings — wording, AI-tell rules | | harness-reviewer | Skill and agent docs, cross-repo references, self-contamination, copy drift |

Custom Agents

Generate a custom Role Agent from interview results:

# Step 1: get agent creation context
ges_create_agent({ action: "start", sessionId: "<id>" })
# → returns agentContext (systemPrompt, creationPrompt, schema)

# Step 2: submit the generated AGENT.md content
ges_create_agent({ action: "submit", sessionId: "<id>", agentContent: "..." })
# → creates agents/{name}/AGENT.md

CLI Mode

Run Gestalt from a terminal without Claude Code. interview, spec, and explain-eval call the LLM themselves, so they require ANTHROPIC_API_KEY. explain-check uses the key only with --judge. The other commands run without it.

# Set up a repo once: gestalt.json + code graph + post-commit hook
npx @tienne/gestalt init

# Start an interactive interview
npx @tienne/gestalt interview "my topic"

# Generate a Spec from a completed session
npx @tienne/gestalt spec <session-id>

# List all sessions
npx @tienne/gestalt status

# Start the MCP server manually (stdio)
npx @tienne/gestalt serve

| Command | What it does | |---------|--------------| | serve | Start the MCP server over stdio. Runs when no command is given | | interview [topic] | Interactive interview. Needs ANTHROPIC_API_KEY | | spec <session-id> | Generate a Spec from a completed interview. --force skips the resolution threshold. Needs ANTHROPIC_API_KEY | | status [session-id] | Status of one session, or every session when no id is given | | init | Create gestalt.json, build the code graph, and install the post-commit hook. --skip-graph, --skip-hook | | setup | Create gestalt.json only | | update | Check for and install the latest version | | graph-visualize | Open the code knowledge graph in the browser. --port, --no-browser | | pr <subcommand> | Local PRs inside the repo — create, list, show, diff, comment, review, merge, serve (read-only web UI), and more. See Local PR | | conductor <subcommand> | State and steps the conductor skill runs on — order add, queue add, tick, gate list/gate resolve, status, metrics, and more. See Conductor | | review-loop <subcommand> | Lookups the review-loop skill relies on: PR state, review rounds, approve gate | | harness-refs <subcommand> | Cross-repo reference checks the review and ship skills rely on | | humanize-scan, humanize-check | Check prose against the AI-tell rulebook | | explain-check, explain-eval | Judge an explanation for its audience, and compare two explanation prompts. explain-eval and explain-check --judge need ANTHROPIC_API_KEY | | usage-report | Event counts grouped by event type |

gestalt --help lists every command, and gestalt <command> --help shows its options.


Configuration

Generate a gestalt.json with IDE autocomplete support:

npx @tienne/gestalt setup
{
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
  "llm": {
    "model": "claude-sonnet-4-20250514"
  },
  "interview": {
    "resolutionThreshold": 0.8,
    "maxRounds": 10
  },
  "execute": {
    "driftThreshold": 0.6,
    "successThreshold": 0.85,
    "goalAlignmentThreshold": 0.80
  },
  "client": "claude-code"
}

Config priority (highest → lowest): code overrides → shell env vars → .env → gestalt.json → built-in defaults

Client Setting

The client field controls where Gestalt writes the active session context during execution:

| Value | Context file | When to use | |-------|-------------|-------------| | "claude-code" (default) | .claude/rules/gestalt-active.md | Claude Code (CLI, Desktop, Plugin) | | "codex" | AGENTS.md (managed section) | OpenAI Codex CLI, Google Gemini CLI | | "grok" | .grok/rules/gestalt-active.md | Grok Build TUI/CLI | | "both" | Claude + Codex only (not Grok) | Shared repos used by Claude Code and Codex |

"codex" is the right value for both Codex CLI and Gemini CLI — both read AGENTS.md for persistent project context. "both" never writes .grok/rules/.

When client is "claude-code", "codex", or "grok", MCP interview/spec generation uses passthrough mode even if an Anthropic API key is configured, so the host remains the active LLM. "both" does not force passthrough.

Multi-Provider LLM Tiers

Route LLM calls by task complexity across three tiers:

| Tier | Purpose | Example models | Where it runs today | |------|---------|---------------|---------------------| | frugal | Lightweight tasks — scoring, classification, short responses | llama3.2, claude-haiku-4-5 | Interview resolution scoring (CLI and client: "both" only), per-file KB summaries (only with summarize: true) | | standard | General tasks — interviews, spec generation | claude-sonnet-4-20250514 | Question generation, spec generation | | frontier | High-complexity reasoning | claude-opus-4-20250514 | No direct call path yet |

Configuring frugal moves both of those onto it. Leave it unset and scoring stays on standard while the KB summary step is skipped entirely — exactly as before. Configuring the tier alone does not enable KB summaries; call ges_generate_kb with summarize: true.

Under Claude Code or Codex the interview runs in Passthrough mode, so the host scores resolution and no adapter is involved; frugal scoring only applies to the CLI. The quality impact has not been measured yet — scripts/verify-frugal-scoring.ts compares both tiers against the golden set.

Mix providers freely. This example uses Anthropic for standard/frontier and a local Ollama model for frugal tasks:

{
  "$schema": "./node_modules/@tienne/gestalt/schemas/gestalt.schema.json",
  "llm": {
    "model": "claude-sonnet-4-20250514",
    "frugal": {
      "provider": "openai",
      "baseURL": "http://localhost:11434/v1",
      "apiKey": "ollama",
      "model": "llama3.2"
    },
    "standard": {
      "provider": "anthropic",
      "model": "claude-sonnet-4-20250514"
    },
    "frontier": {
      "provider": "anthropic",
      "model": "claude-opus-4-20250514"
    }
  }
}

If no tiers are configured, all tiers fall back to the top-level llm.model with the Anthropic adapter — fully backward-compatible.

Environment Variables

| Variable | Config path | Default | Description | |----------|-------------|---------|-------------| | ANTHROPIC_API_KEY | llm.apiKey | "" | Required only for CLI commands that call the LLM (interview, spec, explain-eval, explain-check --judge) | | GESTALT_MODEL | llm.model | claude-sonnet-4-20250514 | LLM model | | GESTALT_RESOLUTION_THRESHOLD | interview.resolutionThreshold | 0.8 | Interview completion threshold | | GESTALT_MAX_ROUNDS | interview.maxRounds | 10 | Max interview rounds | | GESTALT_DRIFT_THRESHOLD | execute.driftThreshold | 0.6 | Task drift detection threshold | | GESTALT_EVOLVE_SUCCESS_THRESHOLD | execute.successThreshold | 0.85 | Evolution success score | | GESTALT_EVOLVE_GOAL_ALIGNMENT_THRESHOLD | execute.goalAlignmentThreshold | 0.80 | Goal alignment threshold | | GESTALT_DB_PATH | dbPath | ~/.gestalt/events.db | SQLite event store path | | GESTALT_SKILLS_DIR | skillsDir | skills | Custom skills directory | | GESTALT_AGENTS_DIR | agentsDir | agents | Custom agents directory | | GESTALT_LOG_LEVEL | logLevel | info | Log level (debug/info/warn/error) | | GESTALT_CLIENT | client | claude-code | MCP client type (claude-code/codex/both/grok) | | GESTALT_LLM_FRUGAL_PROVIDER | llm.frugal.provider | anthropic | Frugal tier provider | | GESTALT_LLM_FRUGAL_API_KEY | llm.frugal.apiKey | "" | Frugal tier API key | | GESTALT_LLM_FRUGAL_BASE_URL | llm.frugal.baseURL | "" | Frugal tier base URL (e.g. Ollama) | | GESTALT_LLM_FRUGAL_MODEL | llm.frugal.model | — | Frugal tier model | | GESTALT_LLM_STANDARD_PROVIDER | llm.standard.provider | anthropic | Standard tier provider | | GESTALT_LLM_STANDARD_API_KEY | llm.standard.apiKey | "" | Standard tier API key | | GESTALT_LLM_STANDARD_BASE_URL | llm.standard.baseURL | "" | Standard tier base URL | | GESTALT_LLM_STANDARD_MODEL | llm.standard.model | — | Standard tier model | | GESTALT_LLM_FRONTIER_PROVIDER | llm.frontier.provider | anthropic | Frontier tier provider | | GESTALT_LLM_FRONTIER_API_KEY | llm.frontier.apiKey | "" | Frontier tier API key | | GESTALT_LLM_FRONTIER_BASE_URL | llm.frontier.baseURL | "" | Frontier tier base URL | | GESTALT_LLM_FRONTIER_MODEL | llm.frontier.model | — | Frontier tier model |


How It Works

Vague requirements are the primary cause of implementation drift. When the goal isn't precise, Claude fills gaps with assumptions — and those assumptions diverge from intent as the project grows.

Gestalt addresses this before any code is written. It runs a structured interview guided by five Gestalt psychology principles to raise requirement resolution to a measurable threshold (≥ 0.8). The result is a Spec: a validated JSON document that drives every subsequent step.

Passthrough Mode

Gestalt runs as an MCP server. In host passthrough mode, the connected coding agent, such as Claude Code or Codex, acts as the LLM: Gestalt returns prompts and context, and the host does the reasoning. Execute/review stages always use this pattern because the host owns file edits and command execution.

You (in Claude Code or Codex)
       │
       ▼  /interview "topic" or ges_interview
  Gestalt MCP Server
  (returns context + prompts)
       │
       ▼
  Host agent executes the prompts
  (generates questions, scores, plans)
       │
       ▼
  Gestalt MCP Server
  (validates, stores state, advances)
       │
       ▼  repeat until resolution ≥ 0.8
  Final Spec → Execution Plan

Architecture

Claude Code (you)
     │
     ▼  MCP / stdio transport
┌──────────────────────────────────┐
│        Gestalt MCP Server        │
│                                  │
│  Interview Engine                │
│  ├─ GestaltPrincipleSelector     │
│  ├─ ResolutionScorer             │
│  ├─ SessionManager               │
│  └─ ContextCompressor            │
│                                  │
│  Spec Generator                  │
│  ├─ PassthroughSpecGenerator     │
│  └─ SpecTemplateRegistry         │
│                                  │
│  Execute Engine                  │
│  ├─ DAG Validator                │
│  ├─ ParallelGroupsCalculator     │
│  ├─ DriftDetector                │
│  ├─ EvaluationEngine             │
│  ├─ AuditEngine                  │
│  └─ ExecuteSessionManager        │
│                                  │
│  Resilience Engine               │
│  ├─ StagnationDetector           │
│  ├─ LateralThinkingPersonas      │
│  └─ HumanEscalation              │
│                                  │
│  Review Pipeline                 │
│  ├─ AgentMatcher                 │
│  ├─ ContextCollector (blastRadius)│
│  └─ ReportGenerator              │
│                                  │
│  Agent System                    │
│  ├─ RoleAgentRegistry            │
│  ├─ RoleMatchEngine              │
│  └─ RoleConsensusEngine          │
│                                  │
│  Knowledge Base + Memory          │
│  ├─ KB Generator/Search/Sync     │
│  └─ ProjectMemoryStore           │
│                                  │
│  Code Graph Viz (D3.js, local HTTP)│
│                                  │
│  EventStore (SQLite WAL)         │
└──────────────────────────────────┘

Interactive map: docs/architecture/screen-chain.html shows how this repo fits together, from clients and skills through MCP tools and handlers down to engines and storage. Gestalt drew it with its own architecture skill, and every solid line points to the source line it came from. GitHub shows HTML files as source, so download the file and open it in a browser.

Further reading:


License

MIT © tienne