Back to Skills

cache-manager

verified

Manage analysis cache for incremental FSD validation

View on GitHub

Marketplace

local-plugins

jhlee0409/claude-plugins

Plugin

fsd-architect

Repository

jhlee0409/claude-plugins
2stars

plugins/fsd-architect/skills/cache-manager/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/jhlee0409/claude-plugins/blob/main/plugins/fsd-architect/skills/cache-manager/SKILL.md -a claude-code --skill cache-manager

Installation paths:

Claude
.claude/skills/cache-manager/
Powered by add-skill CLI

Instructions

# Cache Manager Skill

분석 결과를 캐시하여 증분 검증을 지원합니다.

## WHEN TO USE

This skill is invoked by:
- `/fsdarch:analyze` - To enable incremental analysis
- `/fsdarch:validate` - To speed up validation

## EXECUTION INSTRUCTIONS

### Step 1: Check Cache Existence

**Action:** Check if cache file exists

```
1. Use Glob to check for .fsd-architect.cache.json
2. If not found → return { valid: false, reason: 'no-cache' }
3. If found → proceed to Step 2
```

**Glob command:**
```bash
Glob: ".fsd-architect.cache.json"
```

### Step 2: Validate Cache

**Action:** Read and validate cache integrity

```
1. Read .fsd-architect.cache.json using Read tool
2. Parse JSON (handle parse errors → E501)
3. Check version field matches current plugin version
4. Compute hash of .fsd-architect.json
5. Compare with cached configHash
```

**Read commands:**
```bash
Read: .fsd-architect.cache.json
Read: .fsd-architect.json  # For hash comparison
```

**Hash Function Implementation:**

```typescript
/**
 * Simple string hash function for config comparison.
 * Produces a consistent hash for cache invalidation detection.
 */
function simpleHash(content: string): string {
  let hash = 0;
  for (let i = 0; i < content.length; i++) {
    const char = content.charCodeAt(i);
    hash = ((hash << 5) - hash) + char;
    hash = hash & hash; // Convert to 32bit integer
  }
  // Convert to base-36 for compact representation
  return Math.abs(hash).toString(36);
}
```

**Validation checks:**
```typescript
// Version check
if (cache.version !== '1.0.0') {
  return { valid: false, reason: 'version-mismatch' };  // E503
}

// Config hash check using simpleHash()
const currentConfig = await read('.fsd-architect.json');
const currentHash = simpleHash(currentConfig);
if (cache.configHash !== currentHash) {
  return { valid: false, reason: 'config-changed' };
}

// Age check (24 hours = 86400000 ms)
if (Date.now() - cache.timestamp > 86400000) {
  return { valid: false, reason: 'expired' };
}
```

```typescript
interfa

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
5653 chars