By sharathsphd
Pratyabhijna x Active Inference creative-cognition engine v0.4 (mechanism study). Builds on v0.3's clean Haiku CLI substrate (no API key) and event-gated, always-shadow-revision cascade. v0.4 makes cit_temperature causal via best-of-K candidate width, makes the free-energy budget a hard gate inside run_cascade (HaikuRateLimitError on 429), adds a pluggable commit-policy stack (always_draft / always_revise / event_gated / learned_gate / oracle) so Experiments A/B/C from the v0.3 adversarial review run on a single cascade pass, and re-enables a stratified Sonnet LLM-judge bridge for construct validity (32-item subset, $5 cap, frozen prompt sha). Ships 19 MCP tools (18 v0.3 + judge_pair), 5 skills, 5 agents, 5 slash commands, and 3 lifecycle hooks.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Read the cascade audit log and explain the most recent decision. Args: optional `--n <int>` (default 1, the most recent cascade call).
Run the Alternative Uses Task on an object. Args: a single noun phrase; optional `--K <int>`.
Run the full Pratyabhijna cascade on the user's prompt. Args: prompt, constraint, K, aspects (comma-separated), must_avoid (comma-separated).
Interpret a poem or ambiguous text. Args: the text in triple-quotes; optional `--aspect a; --aspect b`.
Compose a poem through the cascade. Args: a single line topic + optional `--form haiku|sonnet|free` and `--avoid <cliché>`.
Audits a cascade run's audit trail and reports why the cascade picked what it picked. Use when the user is debugging a cascade output, asking "why this candidate?", or reviewing a benchmark result that looks suspect.
Generates and ranks divergent / non-obvious uses of a concept (Alternative Uses Task). Use when the user says "list K weird uses of X" or "give me K alternative applications of Y".
Interprets poems, koans, and ambiguous texts through the vimarsa aspect-shift detector. Use when the user supplies a text and asks for its meaning(s) - especially when multiple readings are possible.
Composes poetry through the Pratyabhijna cascade. Use when the user wants a generated poem with constraint anchoring and aspect-multiplicity. Always uses the cascade rather than raw LM sampling.
Generates non-obvious cross-domain analogies and hypotheses through the cascade with exploration-favouring sampler grids. Use for hypothesis brainstorming, BIG-Bench-Hard creative reasoning, or "what's a non-obvious explanation of X?" prompts.
Use when the user asks to interpret a poem, image, ambiguous figure, or text that admits multiple readings - especially when they want both readings surfaced. Routes through vimarsa to detect duck-rabbit aspect-shifts.
Use when the user asks "why did the cascade pick this candidate?", "trace the BMR for this prompt", or wants to inspect the cascade's audit trail. Reads `audit/phase8/mcp_calls.jsonl` and produces a per-step summary.
Use when the user asks for a poem, haiku, sonnet, ghazal, or any short literary form, or when they want a constraint-anchored creative composition. Routes through the Pratyabhijna cascade so the result reflects vimarsa aspect-shifts and BMR-driven candidate selection rather than raw LM sampling.
Use when the user asks for divergent or creative uses of an object, an Alternative Uses Task (AUT), brainstorm of unusual applications, or "give me K weird uses for X". Generates K candidate uses through iccha and ranks them via apohana + ananda.
Use for scientific or mathematical creativity tasks - hypothesis generation, analogy-finding across domains, BIG-Bench-Hard "Causal Judgement"-style problems, or any "give me a non-obvious explanation/analogy" prompt. The cascade is configured for higher cit-temperature and a wider sampler grid to favor exploration.
Admin access level
Server config contains admin-level keywords
External network access
Connects to servers outside your machine
Uses power tools
Uses Bash, Write, or Edit tools
A portable plugin (Cursor + Claude Code + standalone CLI) that operationalises Abhinavagupta's Pratyabhijñā five-śakti generative cascade as typed operators over an active-inference / Bayesian Model Reduction substrate, with a recursive vimarśa self-reflexivity layer.
v0.4 — mechanism study of recursive self-reflexivity layers for LLM creative cognition. Cascade-vs-bare null at the pilot's n; recursive revision pass robustly positive on its own (H8a, g = 0.65, p < 1e-4); learned commit gate beats the v0.3 event gate (H8b, F1 0.65 vs 0.52); proxy scorer disagrees with the Sonnet-4.5 LLM-judge at ρ = 0.0 (H9 — flagged as a metric-design problem, not a refutation). Cost ledger split honestly: Haiku cascade
$12.73 / 1,277calls; Sonnet judge$0.48 / 23rows; combined pilot spend$13.21. v0.4 frozen atpaper/v0.4/.Live site: https://sharathsphd.github.io/pratyabhijna/ — Astro Pages site that reads
benchmarks/results_v0.4/stats.jsondirectly and animates all 9 showcase demos with full cascade traces.Companion work. Pratyākṣa (direct perception / context-discipline) at https://zenodo.org/records/19680692 and https://sharathsphd.github.io/context-engineering-harness/. PCE is the recognition + creativity counterpart in the same author program.
This repository holds the engine, the dual plugin manifests (plugin/.claude-plugin/plugin.json, plugin/.cursor-plugin/plugin.json), the standalone pce CLI, the Phase 7 mechanism pilot's results and audit, the v0.4 paper, and the Astro v0.4 site.
docs/SPEC_v0.4.md, docs/PRD_v0.4.md, docs/RELEASE_NOTES_v0.4.md, docs/COMPLETION_PROMISES_v0.4.md.docs/adr/v0.4/ (ADR-001 cit_temperature substrate, ADR-002 learned commit gate, ADR-003 free-energy budget, ADR-004 managed-API fairness lattice, ADR-005 fixed-effects H5, ADR-006 typed Haiku errors, ADR-007 SDK code-path removal).docs/triz/v0.4/.plugin/.claude-plugin/plugin.json and plugin/.cursor-plugin/plugin.json (both at v0.4.0).# 1. Standalone CLI (works in any shell with `claude` on PATH)
git clone https://github.com/SharathSPhD/pratyabhijna.git
cd pratyabhijna
uv pip install -e . # required: registers the `pce` console script
# and pulls numpy / sentence-transformers
pce smoke # verifies the CLI, OAuth substrate, and cascade module
pce cascade --prompt "Write a haiku about rain on a tin roof" \
--constraint "imagism" --k 4 --seed 4242
# 2. Cursor plugin
cursor --install-plugin .
# 3. Claude Code plugin
claude plugin install https://github.com/SharathSPhD/pratyabhijna
# or, for a local clone:
ln -s "$(pwd)" "$HOME/.claude/plugins/pce"
See docs/RUN_LOCAL.md for the full operator guide, including the precedence chain (defaults → repo pce.toml → user ~/.config/pce/config.toml → env vars → CLI overrides) and example configurations.
# Regenerate the figure pack and autoreport against the published stats.json
python -m benchmarks.figures --version v0.4
python -m benchmarks.autoreport --version v0.4 --strict
# Build the paper PDF (tectonic preferred; latexmk also supported)
cd paper && tectonic -X compile main.tex
# Build and serve the Astro site locally
python scripts/prepare_site_data.py
cd docs/site && pnpm install && pnpm build && pnpm preview
The v0.4 pilot ran the same four base arms as v0.3 plus a five-policy commit multiplexer over the cascade arm. The arm matrix is:
| arm | role |
|---|---|
haiku_bare | architecture-vs-nothing primary control |
haiku_cascade | primary treatment (always-shadow revision; commit per policy) |
haiku_bare_2K_scorer | +K-compute control (H6.v4) |
haiku_generic_revise_2pass | revision-protocol control (H7.v4) |
The commit-policy multiplex over haiku_cascade is always_draft / always_revise / event_gated (the v0.3 policy) / learned_gate (ADR-002) / oracle (analysis upper bound).
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimnpx claudepluginhub sharathsphd/pratyabhijna --plugin pratyabhijna-creative-engineMonitor and steer multi-agent Claude Code trajectories using dynamical systems theory. Computes finite-time Lyapunov exponents (FTLE) over semantic embedding sequences to classify regime (CONVERGING / CYCLING / EXPLORING / DIVERGING / STUCK / OSCILLATING / PLATEAU) and prescribe interventions before a task derails.
Long-context discipline for Claude Code: Avacchedaka-typed retrieval, sublation, witness-consciousness invariants, event-boundary compaction, and Khyātivāda hallucination classification. 15 MCP tools, 3 skills, 3 agents, 4 commands, 3 hooks.
TRIZ 40 Inventive Principles engine for systematic contradiction resolution, ARIZ-85C analysis, and benchmark arena
Closed-loop autonomous AEO/LLM-SEO citation engineering. Audits your site, drafts the fix as a PR, measures the lift after merge. Powered by the Claude Code subscription CLI — no API keys.
Harness-native ECC operator layer - 67 agents, 271 skills, 92 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Comprehensive feature development workflow with specialized agents for codebase exploration, architecture design, and quality review
A growing collection of Claude-compatible academic workflow bundles. Covers scientific figures, manuscript writing and polishing, reviewer assessment, citation retrieval, data availability, paper reading, literature search, response letters, paper-to-PPTX conversion, and evidence-grounded Chinese invention patent drafting. Rules are organized as reusable skill folders with explicit workflows and quality checks.
Core skills library for Claude Code: TDD, debugging, collaboration patterns, and proven techniques
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.