critic-cache
$
npx mdskill add closedloop-ai/claude-plugins/critic-cacheValidate critic reviews to skip redundant agent launches.
- Prevents wasted compute by skipping critics when plans remain unchanged.
- Depends on Bash scripts and plan.json content hashing.
- Compares current file hashes against stored critic-gates.json records.
- Returns CRITIC_CACHE_HIT to bypass execution or CRITIC_CACHE_MISS to proceed.
SKILL.md
.github/skills/critic-cacheView on GitHub ↗
---
name: critic-cache
description: |
Check if critic reviews are still valid before re-running Phase 2.5 critics.
Compares plan.json + critic-gates.json content hash against stored hash from last critic run.
Triggers on: entering Phase 2.5, checking critic cache, before launching critics.
Returns CRITIC_CACHE_HIT to skip critics or CRITIC_CACHE_MISS to re-run them.
context: fork
allowed-tools: Bash
---
# Critic Cache
Check whether prior critic reviews are still valid, avoiding redundant Sonnet agent launches when the plan hasn't changed since the last critic run.
## When to Use
Activate this skill at the start of Phase 2.5 (Critic Validation), **before** launching any critic agents. If the cache is fresh, skip the entire critic phase.
## Usage
Run the cache check script:
```bash
bash ${CLAUDE_SKILL_DIR}/scripts/check_critic_cache.sh <WORKDIR>
```
## Interpreting Output
### Cache Hit
```
CRITIC_CACHE_HIT
```
**Action:** Skip all critic agent launches. Proceed directly to Phase 2.6 (or Phase 2.7 if no merge is needed). The existing `$WORKDIR/reviews/*.review.json` files are still valid.
### Cache Miss
```
CRITIC_CACHE_MISS
reason: <why the cache is stale or missing>
```
**Action:** Run critics as normal. After all critics complete, stamp the cache:
```bash
if [ -f ".closedloop-ai/settings/critic-gates.json" ]; then
cat $WORKDIR/plan.json .closedloop-ai/settings/critic-gates.json | shasum -a 256 > $WORKDIR/reviews/.plan-hash
else
shasum -a 256 $WORKDIR/plan.json > $WORKDIR/reviews/.plan-hash
fi
```
## How Freshness Works
The script hashes both `plan.json` and `.closedloop-ai/settings/critic-gates.json` (if it exists) into a single combined hash. This ensures:
- Plan content changes → cache miss → critics re-run
- Critic configuration changes (adding/removing critics) → cache miss → critics re-run
- No changes → cache hit → critics skipped
## Cache Conditions
Cache hit requires ALL of:
1. `plan.json` exists
2. `reviews/` directory exists with at least 1 `.review.json` file
3. `reviews/.plan-hash` exists
4. Current combined hash matches stored hash
More from closedloop-ai/claude-plugins
- artifact-type-tailored-contextCompresses artifacts for judge evaluation. Reads a single raw artifact, applies tiered summarization within a token budget, and returns compacted content with metadata. Isolation via forked context prevents pollution of agent context
- build-status-cache|
- closedloop-envProvides ClosedLoop environment paths (CLOSEDLOOP_WORKDIR, CLAUDE_PLUGIN_ROOT) to agents. This skill should be used by any agent that needs to access ClosedLoop run directories, plugin schemas, or other path-dependent resources.
- cross-repo-cache|
- decision-tableUse when the user wants a code-grounded decision table for current behavior, wants to compare current behavior against a plan or work item, or needs a control-flow artifact for recovery, retry, finalization, validation, state-machine, or review-heavy edge cases.
- eval-cache|
- extract-plan-md|
- find-plugin-fileThis skill should be used when needing to locate files within the Claude Code plugins cache directory (~/.claude/plugins/cache). Triggers include finding tool scripts, skill files, or any plugin resource when the hardcoded path is unknown or varies by plugin version. Use when slash commands or orchestrators need to dynamically resolve plugin file paths.
- learning-qualityStructured format for capturing high-quality learnings during ClosedLoop runs
- mermaid-visualizerThis skill should be used when a user asks to explain a complex idea, concept, or system architecture, or when a diagram would be helpful to visualize control flows, system architectures, data flows, state machines, sequence diagrams, or entity relationships.