Skip to content

Latest commit

 

History

History
371 lines (264 loc) · 10.8 KB

File metadata and controls

371 lines (264 loc) · 10.8 KB

Prism

Dynamically generates analysis perspectives tailored to any topic, then verifies each one before synthesis.

Pipeline: seed research → Devil's Advocate bias gate → dynamic perspective generation → parallel specialist agents → Socratic verification per analyst → synthesis.

Philosophy

Expose hidden assumptions before any analysis begins.

Commands

Skill Claude Code Codex Description
analyze /prism:analyze psm analyze General-purpose multi-perspective analysis with MCP-based Socratic verification + ambiguity scoring
incident /prism:incident psm incident Incident RCA with UX-impact perspective injection and Devil's Advocate gate
prd /prism:prd psm prd PRD policy conflict analysis against your codebase ontology
brownfield /prism:brownfield psm brownfield Scan and manage reference repositories for ontology context
setup /prism:setup psm setup Runtime-aware setup plus brownfield default repository management

Prerequisites

Before installing Prism, make sure you have one supported runtime installed:

  1. Claude Code for /prism:* commands inside Claude Code
  2. Codex CLI for psm * commands inside Codex

Installation

Prism keeps its active runtime in ~/.prism/config.yaml. The shared setup entrypoint is:

bash scripts/setup.sh --runtime <claude|codex>

Prism follows a split-source model for skills:

  • The checked-in repo skills/ directory is the single authored source of truth.
  • Claude Code reads the repo commands/ and skills/ trees directly.
  • Codex setup installs managed mirror copies into ~/.codex/skills and matching rules into ~/.codex/rules.

Use --runtime codex if you want global psm commands plus managed Codex installs under ~/.codex. Use --runtime claude if you want Claude Code as the active backend while keeping Claude on the checked-in repo assets.

Codex Installation

From the Prism repo:

bash scripts/setup.sh --runtime codex

This refreshes:

  • ~/.codex/skills/prism-* from the canonical repo skills/ source
  • ~/.codex/rules/prism.md
  • ~/.codex/bin/psm
  • Prism's Codex MCP configuration and ~/.prism/config.yaml

Then make sure ~/.codex/bin is on your PATH:

export PATH="$HOME/.codex/bin:$PATH"

Start a new Codex session and run:

psm setup
psm analyze
psm brownfield

Quick verification:

which psm
cat ~/.prism/config.yaml

Expected result:

  • which psm points to ~/.codex/bin/psm
  • ~/.prism/config.yaml contains runtime.backend: codex
  • ~/.codex/skills/prism-setup/SKILL.md exists as a setup-managed mirror of ./skills/setup/SKILL.md

Claude Code Installation

Step 1: Install the plugin

Inside Claude Code, register the Prism marketplace and install the plugin:

/plugin marketplace add valentin1235/prism
/plugin install prism@prism

Or from the terminal CLI:

claude plugin marketplace add valentin1235/prism
claude plugin install prism@prism

The plugin will be automatically enabled after installation. You can verify with /plugin (Installed tab) or:

claude plugin list

Step 2: Select the Claude runtime

From the Prism repo:

bash scripts/setup.sh --runtime claude

Then open Claude Code and run:

/prism:setup

This keeps ~/.prism/config.yaml aligned with Claude Code and configures the MCP server (prism-mcp) used by the analysis pipeline.

If you also want plain-text psm analyze, psm incident, psm prd, and psm setup to work inside Claude Code, let /prism:setup integrate the Prism quick-reference block into your current project's CLAUDE.md.

Step 3: Verify installation

Restart Claude Code, then type:

/prism:incident

If everything is configured correctly, the skill will start the incident intake process.

Quick verification from the terminal:

cat ~/.prism/config.yaml
rg -n '/prism:(analyze|incident|prd|setup)|skills/.*/SKILL.md' CLAUDE.md

Expected result:

  • ~/.prism/config.yaml contains runtime.backend: claude
  • CLAUDE.md maps /prism:* slash commands to the checked-in repo skills/*/SKILL.md entries

Full settings.json Example

After completing all installation steps, your ~/.claude/settings.json should contain at least:

{
  "enabledPlugins": {
    "prism@prism": true
  }
}

Usage

Codex

psm setup
psm brownfield
psm analyze
psm incident
psm prd path/to/prd.md

Claude Code

/prism:setup
/prism:brownfield
/prism:analyze
/prism:incident
/prism:prd path/to/prd.md

Workflow Summary

Skill Workflow Output
analyze Intake → Seed Analysis → Perspective Generation → Parallel Analysts → Socratic Verification (per analyst) → Synthesis Analysis report
incident Intake → Session Setup → Analyze (UX-impact perspective + incident seed hints) → RCA Report Postmortem report
prd Read PRD → Create config → Analyze (policy scope) → Finder post-process → PM report prd-policy-review-report.md
brownfield Scan home dir for GitHub repos → SQLite registry → Set defaults for ontology scope Repo registry

All analysis skills share the same core pattern via prism_analyze MCP: spawn multi-perspective agents → Devil's Advocate gate → synthesize. The MCP server handles async execution; skills poll prism_task_status until completion.


How It Works

MCP Server

Prism runs a local Go MCP server (mcp/prism-mcp) that orchestrates the analysis pipeline. The server exposes these tools:

Tool Purpose
prism_analyze Start analysis pipeline; returns task_id immediately
prism_task_status Poll task progress (stage, %)
prism_analyze_result Retrieve completed report
prism_cancel_task Cancel a running analysis
prism_interview Socratic verification loop (per analyst)
prism_da_review Devil's Advocate critique gate
prism_score Ambiguity scoring (gates perspective generation)
prism_brownfield Repository registry (scan / set defaults / query)

The binary auto-builds from source via mcp/run.sh if .go files have changed.

analyze: Socratic Verification & Ambiguity Scoring

Each analyst self-verifies through a prism_interview loop before reporting:

Analyst → write findings.json → prism_interview(start) → question
       → answer (with evidence) → auto-score → next question
       → ... repeat until PASS or max rounds (20)

Ambiguity Score:

Dimension Weight Measures
Assumption Clarity 0.4 Are hidden assumptions made explicit?
Relevance 0.4 Are findings grounded in the actual evidence provided?
Constraints 0.2 Are scope boundaries and limitations stated?

Verdict: PASS (score > 0.8) or FORCE PASS (max rounds reached, flagged for user attention).

Agent Mapping

Role Agent Type Notes
Seed analyst / Perspective generator prism:finder Spawned by skill before MCP call
Specialist analysts claude CLI subprocess Run in parallel by MCP server; model passed as param
Devil's Advocate prism:devils-advocate Called via prism_da_review; pure reasoning, no file access
PRD post-processor prism:finder Transforms technical analysis into PM report
Analyze with Socratic Verification (/prism:analyze)
graph TD
    A[User Input] --> B[Problem Intake]
    B --> C["Seed Analysis (Opus)"]
    C --> D["Perspective Generation (Opus)"]
    D --> E[Ontology Scope from Brownfield]
    E --> F[prism_analyze MCP call]

    F --> G1[Analyst 1: Investigate]
    F --> G2[Analyst 2: Investigate]
    F --> GN[Analyst N: Investigate]

    G1 --> H1["prism_interview Loop"]
    G2 --> H2["prism_interview Loop"]
    GN --> HN["prism_interview Loop"]

    H1 -->|"score > 0.8 → PASS"| I[Collect Verified Findings]
    H2 -->|"score > 0.8 → PASS"| I
    HN -->|"score > 0.8 → PASS"| I

    I --> J["prism_da_review Gate"]
    J --> K[Synthesis & Report]

    style C fill:#7c3aed,color:#fff
    style D fill:#7c3aed,color:#fff
    style G1 fill:#4a9eff,color:#fff
    style G2 fill:#4a9eff,color:#fff
    style GN fill:#4a9eff,color:#fff
    style H1 fill:#ef4444,color:#fff
    style H2 fill:#ef4444,color:#fff
    style HN fill:#ef4444,color:#fff
    style J fill:#ef4444,color:#fff
    style K fill:#16a34a,color:#fff
Loading
Incident RCA (/prism:incident)
graph TD
    A[User Input + Screenshots] --> B[Language Detection]
    B --> C[Session Setup]
    C --> D["prism_analyze with:
    - incident seed hints
    - ux-impact.json perspective
    - incident report template"]

    D --> E1[Timeline Analyst]
    D --> E2[Root Cause Analyst]
    D --> E3[Contributing Factors Analyst]
    D --> EN[User Impact Analyst]

    E1 --> F["prism_da_review Gate"]
    E2 --> F
    E3 --> F
    EN --> F

    F --> G[RCA Report in User's Language]

    style E1 fill:#4a9eff,color:#fff
    style E2 fill:#4a9eff,color:#fff
    style E3 fill:#4a9eff,color:#fff
    style EN fill:#4a9eff,color:#fff
    style F fill:#ef4444,color:#fff
    style G fill:#16a34a,color:#fff
Loading
PRD Policy Analysis (/prism:prd)
graph TD
    A["/prism:prd path/to/prd.md"] --> B[Read PRD]
    B --> C[Create analyze-config.json]
    C --> D[Invoke analyze skill]

    D --> E1[Policy Analyst 1]
    D --> E2[Policy Analyst 2]
    D --> EN[Policy Analyst N]

    E1 --> F["prism_da_review Gate"]
    E2 --> F
    EN --> F

    F --> G[Raw Analysis Report]
    G --> H["prism:finder Agent (PM post-processor)"]
    H --> I["prd-policy-review-report.md
    with PM Decision Checklist"]

    style E1 fill:#4a9eff,color:#fff
    style E2 fill:#4a9eff,color:#fff
    style EN fill:#4a9eff,color:#fff
    style F fill:#ef4444,color:#fff
    style H fill:#7c3aed,color:#fff
    style I fill:#16a34a,color:#fff
Loading

Troubleshooting

"Reference docs not configured"

The skill tried to access reference docs but no brownfield repositories are configured. Run /prism:setup or /prism:brownfield to configure them.

MCP server fails to start

The Go binary auto-builds on first run via mcp/run.sh. If the build fails, check that Go is installed (go version) and run cd mcp && go build -o prism-mcp . manually.

Skill not showing in autocomplete

Make sure "prism@prism": true is in your enabledPlugins and restart Claude Code.


Inspired By

Prism's multi-perspective analysis and Socratic verification approach was inspired by Ouroboros.

License

MIT