Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计通过

caching-strategy-optimizer缓存策略优化器

Agent Skill

caching-strategy-optimizer 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

188

周安装

8

GitHub Stars

2

下载量

66
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:caching-strategy-optimizer(缓存策略优化器)
来源仓库:https://github.com/monkey1sai/openai-cli
仓库路径:skills/caching-strategy-optimizer
安装命令:
npx skills add https://github.com/monkey1sai/openai-cli --skill caching-strategy-optimizer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/monkey1sai/openai-cli --skill caching-strategy-optimizer

简介

caching-strategy-optimizer 用于处理 GitHub 仓库、Issue 和 Pull Request 信息。

  • 适合在代码协作或仓库状态整理场景中使用。
  • 通过 npx skills add 命令从指定 GitHub 路径安装并使用该技能。
  • 安装前需确认权限范围、维护状态及是否触发联网或命令执行。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Caching Strategy Optimizer

Dramatically speed up CI pipelines with intelligent caching.

Cache Key Strategy

Package Manager Caches

# NPM - Hash package-lock.json
- uses: actions/cache@v3
  with:
    path: ~/.npm
    key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-npm-

# pnpm - More aggressive caching
- uses: pnpm/action-setup@v2
  with:
    version: 8

- uses: actions/cache@v3
  with:
    path: |
      ~/.pnpm-store
      node_modules
    key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
    restore-keys: |
      ${{ runner.os }}-pnpm-

# Python pip
- uses: actions/cache@v3
  with:
    path: ~/.cache/pip
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}

# Cargo/Rust
- uses: actions/cache@v3
  with:
    path: |
      ~/.cargo/bin/
      ~/.cargo/registry/index/
      ~/.cargo/registry/cache/
      ~/.cargo/git/db/
      target/
    key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

Docker Layer Caching

Using Buildx

- name: Set up Docker Buildx
  uses: docker/setup-buildx-action@v3

- name: Build with cache
  uses: docker/build-push-action@v5
  with:
    context: .
    cache-from: type=gha
    cache-to: type=gha,mode=max

Registry-based Cache

- name: Build with registry cache
  uses: docker/build-push-action@v5
  with:
    context: .
    cache-from: type=registry,ref=myapp:buildcache
    cache-to: type=registry,ref=myapp:buildcache,mode=max

Build Output Caching

# Next.js cache
- uses: actions/cache@v3
  with:
    path: |
      ${{ github.workspace }}/.next/cache
    key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
    restore-keys: |
      ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
      ${{ runner.os }}-nextjs-

# Webpack cache
- uses: actions/cache@v3
  with:
    path: node_modules/.cache/webpack
    key: ${{ runner.os }}-webpack-${{ hashFiles('webpack.config.js') }}-${{ hashFiles('src/**') }}

# TypeScript build cache
- uses: actions/cache@v3
  with:
    path: |
      dist
      tsconfig.tsbuildinfo
    key: ${{ runner.os }}-tsc-${{ hashFiles('**/*.ts') }}

Test Results Caching

# Jest cache
- uses: actions/cache@v3
  with:
    path: /tmp/jest_rt
    key: ${{ runner.os }}-jest-${{ hashFiles('**/*.test.ts') }}

# Pytest cache
- uses: actions/cache@v3
  with:
    path: .pytest_cache
    key: ${{ runner.os }}-pytest-${{ hashFiles('**/*test*.py') }}

Before/After Metrics

## Before Optimization

- Total time: 12 minutes
- npm ci: 4 minutes
- Build: 5 minutes
- Tests: 3 minutes

## After Caching

- Total time: 3 minutes
- npm ci: 30 seconds (cache hit)
- Build: 1 minute (incremental)
- Tests: 1.5 minutes (cache hit)

**Improvement: 75% faster (12m → 3m)**

Cache Hit Rate Monitoring

- name: Check cache hit
  id: cache
  uses: actions/cache@v3
  with:
    path: node_modules
    key: ${{ runner.os }}-deps-${{ hashFiles('package-lock.json') }}

- name: Log cache status
  run: |
    if [ "${{ steps.cache.outputs.cache-hit }}" == "true" ]; then
      echo "✅ Cache hit - saved $(date -u -d @$SECONDS +%M:%S)"
    else
      echo "❌ Cache miss - installing from scratch"
    fi

Best Practices

  1. Precise keys: Include all dependencies in hash
  2. Restore keys: Fallback to partial matches
  3. Multiple paths: Cache related files together
  4. Size limits: GitHub Actions limit is 10GB
  5. Expiration: Caches expire after 7 days
  6. Mode=max: Docker cache mode for better hits
  7. Monitor hits: Track cache effectiveness

Common Pitfalls

Too generic keys: key: deps (always hits) ✅ Specific keys: key: deps-${{hashFiles('package-lock.json')}}

Missing restore-keys: Cache miss on minor changes ✅ Restore keys: Partial match fallback

Caching node_modules with wrong lock fileMatch lock file: Hash the right lockfile

Output Checklist

  • Package manager cache configured
  • Build output cache
  • Docker layer cache (if applicable)
  • Test cache configured
  • Cache keys use file hashes
  • Restore keys for fallback
  • Before/after metrics documented
  • Cache hit monitoring

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.43%
按下载量换算25

Claude

30.92%
按下载量换算20

Cursor

16.97%
按下载量换算11

Gemini CLI

9.44%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills