Communitygithub.com

majiayu000/claude-skill-registry-data

檢查上下文使用限制、監控剩餘時間、優化令牌消耗、調試上下文失敗。當詢問關於上下文百分比、速率限制、使用警告、上下文優化、代理架構、記憶系統時使用。

claude-skill-registry-data 是什麼?

這是一個專注於「上下文工程」的AI代理技能,旨在幫助開發者和AI代理用戶最大化LLM任務的推理品質,同時最小化令牌使用量。它提供了關於上下文品質優化、注意力機制理解、漸進式披露策略、子代理隔離以及量化測量等核心原則的詳細指南。該技能支援多種平台,包括Claude Code、Cursor和Codex,並涵蓋上下文壓縮、記憶系統、多代理協調模式、工具設計等進階主題。透過內建的運行時感知機制,它能自動注入使用量監控(如Claude使用限制和上下文視窗使用率),並在達到70%和90%的閾值時發出警告。此外,它還提供了Python腳本(如`context_analyzer.py`和`compression_evaluator.py`)來進行上下文健康分析和壓縮品質評估。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/majiayu000/claude-skill-registry-data/tree/HEAD/context-management/context-engineering-hoanghd218-landing-page-ai-kien

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

上下文工程

上下文工程旨在為LLM任務精選最小的高信號令牌集。目標是在最大化推理品質的同時最小化令牌使用量。

何時啟用

  • 設計/調試代理系統時
  • 上下文限制制約效能時
  • 優化成本/延遲時
  • 構建多代理協調時
  • 實施記憶系統時
  • 評估代理效能時
  • 開發LLM驅動的管道時

核心原則

  1. 上下文品質 > 數量 - 高信號令牌勝過詳盡內容
  2. 注意力是有限的 - U形曲線偏好開頭/結尾位置
  3. 漸進式披露 - 即時載入資訊
  4. 隔離防止退化 - 將工作分配給子代理
  5. 先測量再優化 - 了解你的基線

重要提示:

  • 為了簡潔可以犧牲文法。
  • 在維持高品質的同時確保令牌效率。
  • 將這些規則傳遞給子代理。

快速參考

主題使用時機參考資料
基礎知識了解上下文結構、注意力機制context-fundamentals.md
退化調試失敗、中間遺失、污染context-degradation.md
優化壓縮、遮蔽、快取、分割context-optimization.md
壓縮長會話、摘要策略context-compression.md
記憶跨會話持久性、知識圖譜memory-systems.md
多代理協調模式、上下文隔離multi-agent-patterns.md
評估測試代理、LLM作為評審、指標evaluation.md
工具設計工具整合、描述工程tool-design.md
管道專案開發、批次處理project-development.md
運行時感知使用限制、上下文視窗監控runtime-awareness.md

關鍵指標

  • 令牌利用率:70%時警告,80%時觸發優化
  • 令牌變異性:解釋了80%的代理效能變異
  • 多代理成本:約為單一代理基線的15倍
  • 壓縮目標:減少50-70%,品質損失低於5%
  • 快取命中目標:穩定工作負載達70%以上

四桶策略

  1. 寫入:將上下文儲存在外部(暫存板、文件)
  2. 選擇:僅提取相關上下文(檢索、過濾)
  3. 壓縮:在保留資訊的同時減少令牌(摘要)
  4. 隔離:分割到子代理中(分割)

反模式

  • 詳盡的上下文勝過精心挑選的上下文
  • 關鍵資訊放在中間位置
  • 在達到限制前沒有壓縮觸發機制
  • 對可並行化的任務使用單一代理
  • 工具缺乏清晰的描述

指南

  1. 將關鍵資訊放在上下文的開頭/結尾
  2. 在利用率達到70-80%時進行壓縮
  3. 使用子代理進行上下文隔離,而非角色扮演
  4. 使用4問題框架設計工具(什麼、何時、輸入、輸出)
  5. 優化每個任務的令牌數,而非每次請求的令牌數
  6. 使用基於探針的評估進行驗證
  7. 在生產環境中監控KV快取命中率
  8. 從最小化開始,只有在證實必要時才增加複雜度

運行時感知

系統透過PostToolUse鉤子自動注入使用量感知:

<usage-awareness>
Claude使用限制:5小時=45%,7天=32%
上下文視窗使用率:67%
</usage-awareness>

閾值:

  • 70%:警告 - 考慮優化/壓縮
  • 90%:嚴重 - 需要立即行動

資料來源:

  • 使用限制:Anthropic OAuth API (https://api.anthropic.com/api/oauth/usage)
  • 上下文視窗:狀態列暫存檔 (/tmp/ck-context-{session_id}.json)

腳本

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD agents while maintaining compliance

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Edit existing BMAD modules while maintaining coherence

majiayu000/claude-skill-registry-data

Analyzes current state and user query to answer BMad questions or recommend the next workflow or agent. Use when user says what should I do next, what do I do now, or asks a question about BMad

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Build AI agents with Google ADK Python (Agent Development Kit). Use for multi-agent systems, workflow agents (sequential/parallel/loop), Vertex AI deployment, tool integration, human-in-the-loop.

majiayu000/claude-skill-registry-data

Portfolio allocation and rebalancing optimizer. Manages asset allocation across stocks/cash/bonds, performs periodic rebalancing, and ensures diversification according to market regime and risk tolerance.

majiayu000/claude-skill-registry-data

Create a hilarious and ultra-realistic video of an anthropomorphic animal acting like a human vlogger in a real-world setting.

majiayu000/claude-skill-registry-data

Speech-to-text transcription and translation via OpenAI Audio API -- models, response formats, timestamps, prompting, streaming, chunking, and diarization

majiayu000/claude-skill-registry-data

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

majiayu000/claude-skill-registry-data

小省导购员数字人带货版即梦视频提示词生成系统,基于四大智能体协同(提示词生成师、质量管控师、知识库运维师、跨环节适配师),按照"主体+运动+场景+(镜头语言+光影+氛围)"公式输出中英文双版提示词,适配5s短视频。确保人物一致性、视觉连贯性、情绪连贯性,支持知识库智能复用和跨工具适配(Suno音乐、AI绘画),为数字人带货视频提供高质量提示词生成服务。

majiayu000/claude-skill-registry-data

Upload and manage files using Google Gemini File API via scripts/. Use for uploading images, audio, video, PDFs, and other files for use with Gemini models. Supports file upload, status checking, and file management. Triggers on "upload file", "file API", "upload image", "upload PDF", "upload video", "file management".

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Analyze images/audio/video with Gemini API (better vision than Claude). Generate images (Imagen 4), videos (Veo 3). Use for vision analysis, transcription, OCR, design extraction, multimodal AI.

majiayu000/claude-skill-registry-data

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

majiayu000/claude-skill-registry-data

Conduct domain and industry research. Use when the user says "lets create a research report on [domain or industry]

majiayu000/claude-skill-registry-data

Conduct market research on competition and customers. Use when the user says "create a market research report about [business idea]".

majiayu000/claude-skill-registry-data

Conduct technical research on technologies and architecture. Use when the user says "create a technical research report on [topic]".

majiayu000/claude-skill-registry-data

Builds, edit or validate Agent Skill through conversational discovery. Use when the user requests to "Create an Agent", "Optimize an Agent" or "Edit an Agent".

相關技能