cross-repo-cache
$
npx mdskill add closedloop-ai/claude-plugins/cross-repo-cacheVerify peer repo changes to skip redundant coordinator runs.
- Prevents unnecessary agent launches by checking git history.
- Depends on Bash scripts and peer repository git states.
- Compares current hashes against stored values from previous runs.
- Returns a cache hit or miss status to determine next steps.
SKILL.md
.github/skills/cross-repo-cacheView on GitHub ↗
---
name: cross-repo-cache
description: |
Check if cross-repo coordinator results can be reused, avoiding redundant Sonnet agent launches.
Compares peer repo git hashes against stored hashes from last coordinator run.
Triggers on: entering Phase 1.4.1, checking cross-repo cache, before discovering peers.
Returns CROSS_REPO_CACHE_HIT with cached status or CROSS_REPO_CACHE_MISS to re-run coordinator.
context: fork
allowed-tools: Bash
---
# Cross-Repo Cache Skill
Check whether prior cross-repo coordinator results are still valid, avoiding redundant Sonnet agent launches when peer repositories haven't changed.
## When to Use
Activate this skill at the start of Phase 1.4.1 (Discover peers), **before** launching `@code:cross-repo-coordinator`. If the cache is fresh, skip the coordinator and use cached results.
## Usage
### Check Cache (Phase 1.4.1)
```bash
bash ${CLAUDE_SKILL_DIR}/scripts/check_cross_repo_cache.sh <WORKDIR>
```
### Stamp Cache (after coordinator completes)
After the cross-repo-coordinator runs successfully, stamp the cache:
```bash
# Compute hash of peer repo states
if [ -f ".workspace-repos.json" ]; then
repo_hashes=""
for repo_path in $(python3 -c "import json; [print(r['path']) for r in json.load(open('.workspace-repos.json')) if r.get('path')]" 2>/dev/null); do
[ -d "$repo_path/.git" ] && repo_hashes="$repo_hashes$repo_path:$(git -C "$repo_path" rev-parse HEAD 2>/dev/null || echo unknown) "
done
echo "$repo_hashes" | shasum -a 256 > $WORKDIR/.cross-repo-hash
else
shasum -a 256 $WORKDIR/.cross-repo-needs.json > $WORKDIR/.cross-repo-hash
fi
```
## Interpreting Output
### Cache Hit
```
CROSS_REPO_CACHE_HIT
status: NO_CROSS_REPO_NEEDED | CAPABILITIES_IDENTIFIED
capabilities:
- peer-name: capability description
```
**Action:**
- If status is `NO_CROSS_REPO_NEEDED`: Mark 1.4.x phases complete, proceed to Phase 2
- If status is `CAPABILITIES_IDENTIFIED`: Skip coordinator, proceed to Phase 1.4.2 with cached capabilities
### Cache Miss
```
CROSS_REPO_CACHE_MISS
reason: <why the cache is stale or missing>
```
**Action:** Launch `@code:cross-repo-coordinator` as normal. After it completes, stamp the cache.
## How Freshness Works
The script hashes the git HEAD commit of each peer repository listed in `.workspace-repos.json`. If any peer has new commits, the hash changes and the coordinator re-runs. This correctly handles the case where a peer repo is updated between iterations.
## Cache Location
- Coordinator results: `$WORKDIR/.cross-repo-needs.json` (written by coordinator)
- Cache hash: `$WORKDIR/.cross-repo-hash` (written by stamp step)
- Per-repo cache: `.learnings/cross-repo-cache/{repo-name}/` (used by generic-discovery agents)
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.
- critic-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.