跳到正文
GitHub·· 9 天前AI 评分62

Prism 发布:让 AI 编辑器或 MCP 宿主调度本地专家模型

bryanbarton525/prism

AI 导读

Prism 是一个让 AI 编辑器或 MCP 宿主保持主导、把窄任务分流给本地或自托管专家模型的工具,每个二进制内置配套的 agents、skills、constitutions、references、scripts 和 evals,运行时无需源码检出。

正文

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

来源:GitHub · github.com