prism

package module
v0.1.29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Prism

Prism logo

Prism keeps an AI editor or MCP host in charge while offloading narrow work to local or self-hosted specialist models. Every Prism binary contains the matching agents, skills, constitutions, references, scripts, and evals; a source checkout is not required at runtime.

Install and verify

Install a release binary, then inspect its compiled identity:

prism version
prism version --json
prism update --check
prism update
prism agent list
prism agent constitution kubectl

Release builds report the GitHub tag as both the Prism and bundle version. The bundle digest is a deterministic SHA-256 of every embedded asset. Local builds report devel+<commit>[.dirty]. Explicit --agent-dir or --skills-dir overrides are development mode and receive a digest calculated from the overridden content.

Prism uses Ollama by default at http://127.0.0.1:11434; SGLang, vLLM, and other OpenAI-compatible endpoints can be selected with PRISM_MODEL_RUNTIME_* settings.

Install into an agent host

prism install                         # interactive selection and preview
prism install --project --all --yes  # all bundled content in this project
prism install --global --all --yes  # all bundled content for every host
prism install --global --target codex --skill gh-pr-triage --specialist github-cli --yes
prism install --target copilot --skill gh-pr-triage --specialist github-cli
prism install --dry-run --all
prism install status
prism uninstall

Supported targets are Codex, VS Code/GitHub Copilot, Antigravity, Claude Code, and OpenCode. Skills are installed once into the universal .agents/skills location and linked into host-specific directories when needed; --copy disables links. Prism generates native specialist wrappers that delegate to the run_agent MCP tool, keeping the compiled constitution, model choice, tools, and policy inside Prism.

Each scope has .prism/install.json. Reinstall replaces only Prism-managed paths, removes stale managed files, preserves unrelated files, and refuses unmanaged collisions unless --force is supplied. Configuration files receive .prism-backup backups, and an adapter failure rolls back the transaction.

Graphify repository investigation is optional. The interactive installer offers the pinned managed environment and shows its exact destination and uv sync command before asking for that specific selection. Unattended --all or --yes never selects it; scripts must also pass --graphify-managed, an existing index, and its fingerprint. Prism never builds or refreshes an index. prism graphify setup --approve ... also supports local and self-hosted endpoints. prism graphify doctor is offline unless --probe is explicitly used; prism graphify remove --approve removes a Prism-owned managed environment only when its registration still matches, and always preserves user-managed installations and indexes.

The bundled repo-investigator specialist is the only host-facing Graphify workflow. Its Claude and Codex wrappers delegate architecture, relationship, dependency-path, and change-impact work through Prism run_agent; a normal one-file lookup should stay in the parent. Internal graphify-query instructions are deliberately not exported as a host skill. The reviewed upstream pin is Graphify v0.9.61; Prism enforces prism-graphify-mcp-v0.9.61. See usage for its explicit external prerequisites and non-goals.

prism instructions install remains available as a compatibility command.

MCP

Host configurations generated by prism install invoke only:

{
  "command": "/absolute/path/to/prism",
  "args": ["mcp", "serve", "--state-dir", "/absolute/path/to/selected/runtime"]
}

The generated absolute runtime state path makes project-isolated configuration independent of the host's working directory. --runtime-scope user|project selects that state separately from the host installation scope.

prism mcp serve does not require a repository. Prism assets come from the binary. Repository-aware work selects a workspace for each call:

{
  "agent_id": "github-cli",
  "skill_names": ["gh-pr-triage"],
  "task": "Summarize PR #42 CI status",
  "workspace": {
    "root": "/absolute/path/to/repository"
  }
}

Workspace resolution order is explicit workspace.root, one root advertised by the MCP host, then server-level --root. Multiple advertised roots require an explicit selection. Operations that do not need repository access work without a workspace. Local roots are canonicalized and repository plugins receive only a filesystem rooted at the selected directory.

Core MCP tools include list_agents, run_agent, get_constitution, doctor, suggest_route, recommend_tools, run_graph, list_skill_resources, read_skill_resource, and the policy, usage, and downstream-MCP inspection tools. recommend_tools suggests from an agent's authorized catalog without granting execution access. Bundle and runtime-extension provenance is stamped automatically; clients do not send bundle IDs or versions.

Documentation

Start with The Prism Book: quick start, installation, worked examples, architecture, testing, troubleshooting, and contributing.

Direct CLI use

prism config doctor

# Optional MiniLM retrieval + Laya choice reranking (Linux CPU service)
prism install --runtime-only --runtime-scope user \
  --tool-model onnx --decision-service install-laya
prism route suggest --task "Investigate deployment checkout-api in namespace staging"
echo "Summarize PR #42 CI status" | prism run github-cli --skills gh-pr-triage

# Runtime extensions (local paths, GitHub owner/repo, or GitHub URLs)
prism skill add owner/repo --skill release-review
prism agent add .claude/agents/reviewer.md --model local-review-model
prism agent skill add reviewer release-review
prism skill resources release-review

Managed mutations affect new CLI processes immediately and a running prism mcp serve after reconnect/restart. Active tasks retain their startup snapshot.

Direct CLI commands use the current directory when workspace access is needed. --root is an optional workspace fallback, not the location of Prism itself.

See usage documentation, model runtime configuration, local tool recommendation and measured performance, and the agent and skill authoring guides. The shipped Graphify/release coverage is recorded in the acceptance matrix.

Built-in specialists

Specialist Focus
github-cli Pull request and Actions triage
kubectl Kubernetes diagnostics
linear Linear issue and project workflows
argo Argo CD and workflow failures
web-docs-search Documentation and release research
go-helper Small Go helpers
go-scaffold Package and test scaffolding
frontend-builder Vanilla web UI subtasks
repo-investigator Repository architecture and relationship investigations

Development

go test ./...
go build -o prism ./cmd/prism
./prism version --json

Release builds inject the tag with:

go build -ldflags "-X github.com/bryanbarton525/prism/internal/buildinfo.Version=v1.2.3" ./cmd/prism

Documentation

Overview

Package prism exposes the immutable agent bundle compiled into the Prism binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BundleDigest

func BundleDigest() string

BundleDigest returns a deterministic SHA-256 over every embedded file. Paths and lengths are included so different directory layouts cannot collide.

func BundleFS

func BundleFS() fs.FS

BundleFS returns the embedded filesystem rooted at the module root.

func DigestFS

func DigestFS(fsys fs.FS) string

DigestFS calculates the same deterministic identity for a development override filesystem.

func DigestParts

func DigestParts(parts map[string]fs.FS) string

DigestParts deterministically hashes named filesystem trees. Development builds use it to identify the exact agent and skill overrides in effect.

Types

type BundleFile

type BundleFile struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
}

type BundleManifest

type BundleManifest struct {
	Digest string       `json:"digest"`
	Files  []BundleFile `json:"files"`
}

func Manifest

func Manifest() BundleManifest

Manifest returns the generated inventory of the exact files compiled into this binary. It is generated from the immutable embed.FS, so it cannot drift from the release artifact it describes.

Directories

Path Synopsis
cmd
prism command
Command prism is the entry point for the Prism CLI.
Command prism is the entry point for the Prism CLI.
internal
agent
Package agent loads and validates Prism agent specifications.
Package agent loads and validates Prism agent specifications.
app
Package app provides the shared AgentRunner used by both the CLI and MCP adapters.
Package app provides the shared AgentRunner used by both the CLI and MCP adapters.
buildinfo
Package buildinfo centralizes release and VCS identity for the CLI and MCP server.
Package buildinfo centralizes release and VCS identity for the CLI and MCP server.
cli
Package cli provides Cobra command handlers for the Prism CLI.
Package cli provides Cobra command handlers for the Prism CLI.
config
Package config centralizes Prism runtime configuration.
Package config centralizes Prism runtime configuration.
github
Package github provides an fs.FS implementation backed by the GitHub Contents API, plus a URL parser for github.com repository URLs.
Package github provides an fs.FS implementation backed by the GitHub Contents API, plus a URL parser for github.com repository URLs.
graphify
Package graphify defines the persisted, workspace-bound Graphify contract.
Package graphify defines the persisted, workspace-bound Graphify contract.
llm
mcp
Package mcp provides the MCP server adapter for Prism.
Package mcp provides the MCP server adapter for Prism.
ollama
Package ollama provides a minimal Ollama REST client for Prism.
Package ollama provides a minimal Ollama REST client for Prism.
result
Package result defines the normalized output envelope for all Prism agents.
Package result defines the normalized output envelope for all Prism agents.
rootresolver
Package rootresolver resolves the --root flag value to an fs.FS and a cleanup function.
Package rootresolver resolves the --root flag value to an fs.FS and a cleanup function.
selfupdate
Package selfupdate installs official release binaries on Unix hosts.
Package selfupdate installs official release binaries on Unix hosts.
skill
Package skill loads and validates Prism Agent Skills from SKILL.md files.
Package skill loads and validates Prism Agent Skills from SKILL.md files.
textutil
Package textutil provides shared, UTF-8-safe text bounding helpers used by plugins, the downstream MCP client, and result/prompt shaping.
Package textutil provides shared, UTF-8-safe text bounding helpers used by plugins, the downstream MCP client, and result/prompt shaping.
toolmodel
Package toolmodel runs local embedding models used for tool retrieval.
Package toolmodel runs local embedding models used for tool retrieval.
pkg
evidence
Package evidence defines bounded runtime evidence contracts.
Package evidence defines bounded runtime evidence contracts.
graph
Package graph defines bounded Prism workflow graph contracts.
Package graph defines bounded Prism workflow graph contracts.
observe
Package observe defines stable run-event contracts for Prism integrations.
Package observe defines stable run-event contracts for Prism integrations.
policy
Package policy defines stable Prism governance contracts.
Package policy defines stable Prism governance contracts.
report
Package report exposes Prism benchmark reports for external integrations.
Package report exposes Prism benchmark reports for external integrations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL