diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 8353abf..a1572da 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -5,15 +5,15 @@ "email": "admin@ai-architect.tools" }, "metadata": { - "description": "Session optimizer: context-budget Stop guard, status line, and the refine gate (prompt → bound, research-backed execution contract).", - "version": "1.4.3" + "description": "Session optimizer, split into three independently installable plugins: context-guard (Stop-hook context budget + memory-writer checkpoint subagent + subagent spend tracker), refine-gate (UserPromptSubmit prompt-binding gate + /refine skill), and statusline (multi-line status bar + install skill).", + "version": "2.0.0" }, "plugins": [ { - "name": "session-optimizer", - "source": "./", - "description": "Context-budget Stop guard + status line for long Claude Code sessions, plus the refine gate: a UserPromptSubmit hook and /refine skill that resolve vague prompt references (\"the X solution\", \"the heat variable\", \"like before\") to concrete artifacts with evidence, then select an execution strategy from a research-backed table (15 strategies verified against 2024-2026 literature, counter-evidence included: intrinsic self-correction degrades reasoning arXiv:2310.01798; CoT marginal on reasoning models; multi-agent failure taxonomy MAST). Acceptance criteria must be external signals - tests, measurements, sources - never the model re-checking itself.", - "version": "1.4.3", + "name": "context-guard", + "source": "./plugins/context-guard", + "description": "Context-budget guard: a Stop hook enforces a per-model checkpoint protocol — at the WARN threshold it writes a mechanical checkpoint stub and delegates persistence to a budgeted memory-writer subagent as a reflection pause, at the hard cap it forces checkpoint-then-clear. A SubagentStop tracker surfaces true session spend (main thread + subagents). Default protocol uses only vanilla Claude Code; a scoped memory layer is detected at runtime when installed.", + "version": "2.0.0", "author": { "name": "Clement Deust", "email": "admin@ai-architect.tools" @@ -26,15 +26,76 @@ "context-window", "token-budget", "checkpoint", - "statusline", + "stop-hook", + "subagent-cost", "session-management" ], - "category": "productivity", - "runtime": [ - "cli", - "cowork" + "category": "productivity" + }, + { + "name": "refine-gate", + "source": "./plugins/refine-gate", + "description": "Prompt-binding gate: a UserPromptSubmit hook + /refine skill that resolve vague prompt references (\"the X solution\", \"like before\", \"still broken\") to concrete artifacts with evidence, then select an execution strategy from a research-backed table (15 strategies verified against 2024-2026 literature, counter-evidence included: intrinsic self-correction degrades reasoning arXiv:2310.01798; CoT marginal on reasoning models; multi-agent failure taxonomy MAST). Acceptance criteria must be external signals - tests, measurements, sources - never the model re-checking itself.", + "version": "2.0.0", + "author": { + "name": "Clement Deust", + "email": "admin@ai-architect.tools" + }, + "homepage": "https://github.com/cdeust/session-optimizer", + "repository": "https://github.com/cdeust/session-optimizer", + "license": "MIT", + "keywords": [ + "claude-code", + "prompt-engineering", + "refine", + "intent-binding", + "userpromptsubmit", + "execution-strategy" + ], + "category": "productivity" + }, + { + "name": "statusline", + "source": "./plugins/statusline", + "description": "Multi-line Claude Code statusline with RGB-gradient context bars tied to per-model checkpoint thresholds (shared with context-guard), monthly cost tracking, per-session telemetry, rate-limit gauges, and live subagent spend. Ships an install skill that copies the bundled assets into ~/.claude and wires settings.json.", + "version": "2.0.0", + "author": { + "name": "Clement Deust", + "email": "admin@ai-architect.tools" + }, + "homepage": "https://github.com/cdeust/session-optimizer", + "repository": "https://github.com/cdeust/session-optimizer", + "license": "MIT", + "keywords": [ + "statusline", + "status", + "context", + "git", + "cost", + "rate-limits", + "telemetry", + "ui" + ], + "category": "productivity" + }, + { + "name": "session-optimizer", + "source": "./", + "description": "DEPRECATED meta plugin (v2.0.0). session-optimizer split into three independently installable plugins: context-guard, refine-gate, and statusline. This shim registers no functional hooks — it only announces the migration at session start. Install the three plugins from this marketplace, then uninstall session-optimizer.", + "version": "2.0.0", + "author": { + "name": "Clement Deust", + "email": "admin@ai-architect.tools" + }, + "homepage": "https://github.com/cdeust/session-optimizer", + "repository": "https://github.com/cdeust/session-optimizer", + "license": "MIT", + "keywords": [ + "deprecated", + "meta", + "session-management" ], - "runtime_notes": "Hooks (Stop guard, refine gate) and the statusline run wherever Claude Code plugins run: CLI, desktop app, IDE extensions, and Cowork. The claude.ai chat / Claude Desktop chat surface has no hook mechanism - there, upload skills/refine/ as an Agent Skill (same SKILL.md format): the /refine procedure travels, the automatic per-prompt gate does not." + "category": "productivity" } ] } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 33f50cf..f9bf910 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "session-optimizer", - "description": "Session optimizer for long Claude Code sessions: context-budget Stop guard + status line (per-model checkpoint protocol), and a refine gate — a UserPromptSubmit hook + /refine skill that bind vague prompt references to concrete artifacts and select a research-backed execution strategy before any code is touched.", - "version": "1.4.3", + "description": "DEPRECATED meta plugin (v2.0.0): session-optimizer split into three independently installable plugins — context-guard (Stop-hook context budget + memory-writer checkpoint subagent + subagent spend tracker), refine-gate (UserPromptSubmit prompt-binding gate + /refine skill), and statusline (multi-line status bar + install skill). This shim registers no functional hooks; it only announces the migration at session start. Install the three plugins from the same marketplace, then uninstall session-optimizer.", + "version": "2.0.0", "author": { "name": "Clement Deust", "email": "admin@ai-architect.tools" @@ -10,14 +10,8 @@ "repository": "https://github.com/cdeust/session-optimizer", "license": "MIT", "keywords": [ - "claude-code", - "context-window", - "token-budget", - "checkpoint", - "statusline", - "session-management", - "prompt-engineering", - "refine", - "intent-binding" + "deprecated", + "meta", + "session-management" ] } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a76785..4a870f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,9 +32,16 @@ jobs: run: bash tests/statusline/test_heat_rgb.sh - name: Shellcheck statusline script - run: shellcheck statusline-command.sh + run: shellcheck plugins/statusline/assets/statusline-command.sh - - name: Validate hook and plugin JSON + - name: Validate marketplace, plugin, and hook JSON run: | + python -m json.tool .claude-plugin/marketplace.json > /dev/null python -m json.tool .claude-plugin/plugin.json > /dev/null python -m json.tool hooks/hooks.json > /dev/null + for plugin in context-guard refine-gate statusline; do + python -m json.tool "plugins/$plugin/.claude-plugin/plugin.json" > /dev/null + python -m json.tool "plugins/$plugin/hooks/hooks.json" > /dev/null + done + python -m json.tool plugins/statusline/assets/statusline-budget.json > /dev/null + python -m json.tool plugins/statusline/assets/ctxguard-thresholds.json > /dev/null diff --git a/.gitignore b/.gitignore index e1801cf..beaa8b8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__/ *.pyc .DS_Store .claude/ +.pytest_cache/ diff --git a/README.md b/README.md index 245006e..f2dc22a 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,20 @@