Skip to content
Dandi007Public

About

A sharp little toolkit of agent plugins for Claude Code — work folders, checkpoints, deep research, persistent memory

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

katana

A sharp little toolkit of agent plugins. Each plugin is independently installable — take only what you need.

Plugin What it does
guide Toolkit map + composition guide (using-katana), injected at session start
work-folder Work-folder convention (injected each session) + checkpoint skill for cross-session save/resume
deep-research Workflow-orchestrated research over your knowledge base + web + named platform sources (declared in config); judgment-driven stop; cited report
memory Verified facts as memory cards, auto-injected as an L1 index each session
obsidian-md Obsidian Markdown writing rules grounded in official docs (obsidian-writing) — wikilinks, headings, frontmatter, embeds, callouts; every rule cites obsidian.md/help
retrieval Multi-source information retrieval — intent→source routing, credibility ladder, fallback chains; web/reddit/twitter/code/github/gitlab/linear/feishu/search-note adapters
fpa First Principles Analysis (first-principles) — decompose the goal into effect-level needs before touching the incumbent; every claimed hard constraint must name the event that would break it; rebuild only from the constraints that survive

The wiki plugin is not part of katana: since 2026-09-20 it ships with Dandi007/docstore (plugins/docstore, skills wiki:author / paper-mode / wiki-article-share), and the wiki MCP tools are docstore's wiki_*. The former file-based wiki plugin here (/wiki:query / /wiki:ingest / /wiki:lint) was retired with the old :5601 server and has been removed.

Install (Claude Code)

/plugin marketplace add Dandi007/katana
/plugin install guide@katana
/plugin install work-folder@katana
/plugin install deep-research@katana
/plugin install memory@katana
/plugin install obsidian-md@katana
/plugin install retrieval@katana
/plugin install fpa@katana

Enable/disable any plugin independently with /plugin.

Install (OpenCode)

katana provides an OpenCode parity adapter that enables the same hook implementations to work on OpenCode. Install via npm:

opencode plugin opencode-katana

Or for development, add the local path to your opencode.json:

{
  "plugin": ["/path/to/katana"]
}

The adapter maps OpenCode events to Claude Code hook semantics, spawning the same plugins/*/hooks/* scripts. SessionStart hooks inject context (guide, work-folder, retrieval, memory), and all skills are exposed to OpenCode's skill discovery. No katana plugin currently registers a PostToolUse hook; the adapter still supports the event, but that path has no live consumer or test.

Configuration:

  • KATANA_PARITY_ROOT — override katana root path (default: auto-detect from adapter location)
  • KATANA_DISABLED_PLUGINS — comma-separated list of plugins to disable (e.g., writing,retrieval)

Parity verification:

./parity/e2e/run.sh parity/e2e/scenarios/basic.json both

This runs the same scenario on both Claude Code and OpenCode, comparing injection parity (via local session-store forensics), FPA validation triggers, and skill exposure.

Install (Codex)

Katana ships a Codex marketplace at .agents/plugins/marketplace.json. Each plugins/<name> package has its own .codex-plugin/plugin.json, so the Codex install shape mirrors the Claude Code plugin shape.

codex plugin marketplace add Dandi007/katana

Then open Codex Plugins, choose the Katana marketplace, and install the individual plugins you want (guide, retrieval, work-folder, writing, etc.).

For local development, point Codex at a clone:

codex plugin marketplace add /data/code/self/katana
codex plugin add retrieval@katana
codex plugin add work-folder@katana

Codex installs the bundled skills/ from each selected plugin. Claude Code SessionStart/PostToolUse hooks are not part of this Codex wrapper; use Codex repo instructions or a future Codex hooks adapter for equivalent lifecycle behavior.

Testing

Skills are regression-tested by contract: each skill declares an explicit contract (input prompt + mechanical artifact assertions), executed for real via claude -p in an isolated fixture KB with per-case snapshots. A judge layer backstops semantic expectations (NEEDS-REVIEW, never hard-fail). See tests/README.md.

Codex plugin metadata is checked with:

python3 scripts/validate_codex_plugins.py
python3 /path/to/plugin-creator/scripts/validate_plugin.py plugins/retrieval

Claude Code-specific features degrade gracefully elsewhere:

  • guide / work-folder context injection and memory index injection use Claude Code SessionStart hooks. On Codex, paste the work-folder convention (plugins/work-folder/rules/work-folder.md) into your project's AGENTS.md.
  • deep-research orchestration uses Claude Code's Workflow tool; other tools can follow the SKILL.md flow manually.
  • fpa is prompt-only — no hooks, no scripts, no Workflow orchestration. It runs identically on any tool that can load a SKILL.md.

Configuration

Katana plugins support three-tier configuration (highest priority first):

  1. Environment variables — machine-level overrides
  2. .katana file — project-level configuration (committed to repo)
  3. Default values — sensible defaults for most projects

.katana file

Create a .katana file in your project root to customize plugin behavior:

# Katana plugin configuration
# Priority: environment variables > this file > plugin defaults

# work-folder: override the default work folder path
work_folder_path=智元工作/工作记录

# memory: override the project memory directory
memory_project_dir=memory

# deep-research: override the knowledge base root directory
deep_research_kb_dir=.

# deep-research: named platform sources (name:entry pairs) and fan-out width
deep_research_sources=feishu:.agents/skills/lark-cli/SKILL.md,gitlab:.agents/skills/gitlab/SKILL.md,github:gh
deep_research_max_width=10

The file uses simple key=value format. Lines starting with # are comments.

Configuration options

Plugin Key Env var Default Description
work-folder work_folder_path KATANA_WORK_FOLDER docs/work-records Work folder base path
memory memory_project_dir CLAUDE_MEMORY_PROJECT_DIR memory Project memory directory
memory — CLAUDE_MEMORY_SYSTEM_DIR ~/.claude/memory System memory directory
deep-research deep_research_kb_dir DEEP_RESEARCH_KB_DIR current directory Knowledge base root
deep-research deep_research_sources DEEP_RESEARCH_SOURCES (none) Named sources, comma-separated name:entry
deep-research deep_research_max_width DEEP_RESEARCH_MAX_WIDTH 10 Max clues explored per round (fan-out width)

Removed keys: wiki_root (KATANA_WIKI_ROOT) and wiki_interface were read by the former wiki plugin's SessionStart hook. That plugin has been removed from katana, so no katana plugin reads them anymore and they can be dropped from .katana.

Note: System-level memory directory only supports environment variables (machine dimension, not project-specific).

Version control: Commit .katana to share project config with your team. Use environment variables for machine-specific overrides (paths, credentials) that shouldn't be in the repo.

Example

For a Chinese knowledge base project:

# .katana
work_folder_path=智元工作/工作记录
memory_project_dir=memory
deep_research_kb_dir=.
deep_research_sources=feishu:.agents/skills/lark-cli/SKILL.md,gitlab:.agents/skills/gitlab/SKILL.md,github:gh
deep_research_max_width=10

This tells katana to use 智元工作/工作记录/YYYY/MM/DD/<topic>/ for work folders instead of the default docs/work-records/.... The deep_research_sources / deep_research_max_width entries declare named platform sources for deep-research workers and the per-round fan-out width.

memory scanner

On session start the memory hook (plugins/memory/hooks/session-start) scans the memory card frontmatter with a pure shell + awk scanner (plugins/memory/hooks/scan-memory.awk) and injects the <memory-index>. It is a text script — no compiled binary, no download, no build step — so it ships intact in the npm package and runs anywhere bash + awk exist. If no cards are found it emits nothing (never blocks the session). Output is locked to a golden by plugins/memory/tests/scan-memory.test.sh.

Releasing (maintainer)

  1. Bump version in the plugin's plugin.json and version in the root package.json.
  2. Tag v<version> and push; npm-publish.yml publishes the package and creates the GitHub Release.

License

MIT

About

A sharp little toolkit of agent plugins for Claude Code — work folders, checkpoints, deep research, persistent memory

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages