plugin-dev

A development guide for Prismer Evolution plugins, covering local iteration, debugging, logs, tests, and publishing. It explains how to reload changed hooks and skills without repeatedly installing the plugin.

In plain words
What is it for?
Use it to develop and debug Prismer plugins, test hooks with simulated events, view logs, and prepare a plugin for release.
Why use it?
It shortens the feedback loop when developing a plugin and provides ways to test individual event hooks and inspect failures.

Skill for Claude CodeCodex

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 skills/prismer-ai/prismercloud/plugin-dev
Any agent
npx skills add Prismer-AI/PrismerCloud --skill plugin-dev
Clone the repo
git clone --depth 1 https://github.com/Prismer-AI/PrismerCloud

Made for: Claude Code, Codex.

Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,555 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 $0.00031 $0.02555
Opus 5 $0.00015 $0.01277
Sonnet 5 $0.00006 $0.00511
Haiku 4.5 $0.00003 $0.00255

Measured 2d ago against content hash 4c24475db660, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plugin-dev 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 2d ago.

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.

sdk/prismer-cloud/claude-code-plugin/skills/plugin-dev/SKILL.md · 294 lines

How it starts

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

Prismer Plugin 开发指南

本文档是插件开发的完整参考。涵盖环境搭建、快速迭代、调试排查、测试、发布全流程。


1. 快速开始 — Dev Mode

不要用 npm publish + /plugin install 的循环。 使用本地开发模式:

cd sdk/prismer-cloud/claude-code-plugin
./scripts/dev.sh

这做了什么:

  • claude --plugin-dir . 直接加载本地文件(不走 npm)
  • 使用独立的 .dev-cache/ 目录(不污染生产 cache)
  • 自动设 PRISMER_LOG_LEVEL=debug

修改 hook 后怎么生效:

你改了什么 怎么生效
hook script (scripts/*.mjs) 在 Claude Code 里输入 /clear(2 秒)
skill 内容 (skills/*/SKILL.md) /clear/reload-plugins
hooks.json (新增/删除 hook) 退出 Claude Code 重新运行 ./scripts/dev.sh
.mcp.json 不影响(dev mode 不加载 .mcp.json)

迭代循环: 改代码 → /clear → 测试 → 看日志 → 再改。每次 2 秒,不需要装卸。


2. Hook 隔离测试

不需要启动完整 Claude Code 就能测试单个 hook:

# 测试 SessionStart (模拟 startup 事件)
node scripts/test-hook.mjs session-start.mjs

# 测试 SessionStart (模拟 resume 事件)
node scripts/test-hook.mjs session-start.mjs --event resume

# 测试 PostToolUse (模拟 Bash 工具完成)
echo '{"tool_name":"Bash","tool_input":{"command":"npm run build"},"tool_result":{"stdout":"error TS2345"}}' | \
  node scripts/test-hook.mjs post-bash-journal.mjs

# 测试 PreToolUse stuck detection (模拟重复错误)
echo '{"tool_name":"Bash","tool_input":{"command":"npm run build"}}' | \
  node scripts/test-hook.mjs pre-bash-suggest.mjs

# 带自定义环境变量
node scripts/test-hook.mjs session-start.mjs --env PRISMER_API_KEY=sk-prismer-test-xxx

# 详细输出(含环境变量)
node scripts/test-hook.mjs session-start.mjs --verbose

输出说明:

  • [STDOUT] — 会注入到 Claude 上下文的内容
  • [STDERR] — 调试日志(不显示给 Claude)
  • [Exit: N] — 退出码(0 = 正常)
  • [Cache files] — 测试后生成的缓存文件

3. 日志与调试

3.1 查看调试日志

# Dev mode 日志
tail -f .dev-cache/prismer-debug.log

# 格式化输出(更可读)
tail -20 .dev-cache/prismer-debug.log | while IFS= read -r line; do
  echo "$line" | node -e "
    const l=JSON.parse(require('fs').readFileSync(0,'utf8').trim());
    console.log(\`[\${l.ts.slice(11,19)}] \${l.lvl.toUpperCase()} [\${l.hook}] \${l.msg}\`,
      Object.fromEntries(Object.entries(l).filter(([k])=>!['ts','lvl','hook','msg'].includes(k))))
  " 2>/dev/null
done

Read the full file on GitHub · 294 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. 2d ago First seen · 294 lines · 31 tokens per session scan A 4c24475db660

Subscribe to this mod's changes

plugin-dev is a skill published in the GitHub repository Prismer-AI/PrismerCloud (1,409 stars, last pushed 26d ago), licensed MIT. It adds 31 tokens to every session and 2,555 once invoked, about $0.0002 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-08-30.