skill
shader-cache-optimization-agent-skill
๐ฎโก Game Shader Cache & Stutter Elimination Engine | Production-grade Claude Code skill & Python harness (v2.0.0) for graphics optimization. Features PSO pre-compilation, driver cache tuning, & crawl4
Set up
Skills are installed by placing their folder where your agent loads skills.
The download comes from github.com/dungnotnull/shader-cache-optimization-agent-skill itself, not from our server, so what you get is exactly what its author published.
Install instructions come from the README
README
synced Oct 22, 2026shader-cache-optimization
Shader Cache Optimization to Eliminate Game Stuttering
A bulletproof production-grade Claude Code harness for Shader Compilation & Cache Performance Engineering โ features flexible agent architecture with hooks system, type-safe configuration management, graceful degradation, and comprehensive automation. Gathers real-time authoritative data from GPU vendors, applies systematic optimization methods, integrates academic research, and delivers evidence-backed, risk-disclosed outputs to eliminate shader-compilation stutter in games.
Table of Contents
- Why This Skill
- Features
- Installation
- Quick Start
- Usage
- Architecture
- Quality Gates
- Data Sources
- Testing
- Knowledge Base
- Development
- Roadmap
- Contributing
- License
- Acknowledgments
- Citation
Why This Skill
Shader Compilation & Cache Performance Engineering practitioners face three structural problems:
- Data Fragmentation: Authoritative driver documentation, API specifications, and engine guidelines are scattered across vendor websites, Khronos registry, and game engine docs.
- Methodology Gaps: Most stutter-fix advice lacks systematic evidence, tiered sources, or quantitative benchmarks.
- No Self-Improvement: Static tools don't learn from new research, driver updates, or community discoveries.
shader-cache-optimization addresses all three by unifying real-time data aggregation, recognized optimization frameworks, and a continuously-updated academic knowledge base into one evidence-backed, risk-disclosed workflow.
Features
Core Capabilities
- Real-Time Data Aggregation: Fetches current driver cache configurations, API specifications, and engine documentation from authoritative sources
- Systematic Analysis Methods: Applies structured profiling, PSO trigger identification, and cache optimization strategies
- Academic Research Integration: Tier-labeled evidence hierarchy (Tier 1: Systematic Review โ Tier 4: News) with automatic citation
- Risk-Disclosed Outputs: Every recommendation includes probability assessment, impact analysis, and mitigation strategies
- Self-Improving Knowledge Pipeline: Weekly academic crawl + daily news feed automatically updates SECOND-KNOWLEDGE-BRAIN.md
- Multi-Scenario Analysis: Best/Base/Worst case modeling with probability estimates
- Graceful Degradation: 5-level fallback chain (Level 0: Full โ Level 4: Data Unavailable) with explicit LIMITATION banners
- Bilingual Support: Vietnamese and English output with automatic language detection
Analysis Types
- Profile-Focused: Identify shader compilation bottlenecks with frametime quantification
- Strategy-Focused: Develop comprehensive optimization plans (async/pre-build/cache/warm-up)
- Config-Focused: Driver and engine cache tuning with platform-specific settings
- Combined: Full analysis with all above components
Installation
Prerequisites
- Python 3.11 or higher
- Claude Code CLI or compatible harness
- Git (for cloning)
Install Dependencies
pip install -r requirements.txt
Install Skill
Option 1: Project-Level (Recommended)
# Clone or navigate to project directory
cd D:\972026\255-shader-cache-optimization
# Skill is available via project CLAUDE.md
# No additional installation needed
Option 2: Global Installation
# Copy skill files to global skills directory
mkdir -p ~/.claude/skills
cp -r skills/* ~/.claude/skills/
# Copy knowledge base
cp SECOND-KNOWLEDGE-BRAIN.md ~/.claude/
Verify Installation
# Check skill is available
/shader-cache-optimization --help
# Run validation
python tools/validate_project.py
Quick Start
Basic Usage
/shader-cache-optimization Analyze shader compilation stutter in Cyberpunk 2077 on NVIDIA RTX 3080 with Vulkan API
With Profiling Data
/shader-cache-optimization Optimize shader cache for Elden Ring. Frametime spikes 150ms on new area loads. DXVK on Linux.
Vietnamese Language
/shader-cache-optimization Tแปi ฦฐu shader cache cho game GTA V bแป stutter khi chuyแปn cแบฃnh. GPU AMD RX 6800 XT.
Usage
Standard Analysis
/shader-cache-optimization [query in English or Vietnamese]
Required Information (if not provided, skill will ask):
- Game/application name
- Graphics API (Vulkan/DX11/DX12/OpenGL)
- GPU vendor (NVIDIA/AMD/Intel)
- Stutter pattern (first-play, intermittent, consistent)
With Profiling Data
Provide frametime measurements or profiling logs:
/shader-cache-optimization Analyze stutter in [game]. PresentMon shows 200ms spikes on shader compilation. RenderDoc logs attached.
Comparison Analysis
/shader-cache-optimization Compare shader cache strategies between Vulkan and DX11 for [game]
Feasibility Assessment
/shader-cache-optimization Assess feasibility of eliminating shader stutter in [game] with [constraints]
Architecture
Harness Flow
USER INPUT
โ
โผ
[main.md โ Pre-Flight: Language Detection]
โ
โโโบ Step 1: sub-gather-requirements
โ โ Object, scope, stutter profile, inputs, constraints
โ
โโโบ Step 2: sub-evidence-collector
โ โ Driver docs, API specs, engine docs, benchmarks
โ
โโโบ Step 3: sub-core-analysis
โ โ Profiling, PSO triggers, async/pre-build, cache config
โ
โโโบ Step 4: sub-knowledge-updater
โ โ Academic citations with tier labels, gap flags
โ
โโโบ Step 5: sub-advisor
โ โ Verdict, scenarios, risks, evidence chain, remediation
โ
โโโบ Step 6: Quality Gate Review
โ Verify U1-U6 + G1-G4 โ Auto-fix โ Limitation flags
File Structure
255-shader-cache-optimization/
โโโ SKILL.md # Skill registry documentation
โโโ CLAUDE.md # Skill identity card
โโโ PROJECT-detail.md # Full technical specification
โโโ PROJECT-DEVELOPMENT-PHASE-TRACKING.md # Build roadmap
โโโ DEVELOPMENT-TRACKING.md # Session development tracking
โโโ README.md # This file
โโโ SECOND-KNOWLEDGE-BRAIN.md # Living knowledge base
โโโ requirements.txt # Python dependencies
โโโ pyproject.toml # Python package configuration
โโโ LICENSE # MIT license
โโโ .gitignore
โโโ config/ # Configuration management
โ โโโ default.yaml # Base configuration
โ โโโ production.yaml # Production overrides
โ โโโ development.yaml # Development overrides
โ โโโ hooks.yaml # Hooks configuration
โโโ scripts/ # Automation scripts
โ โโโ setup.sh # Unix/Linux setup
โ โโโ setup.bat # Windows setup
โ โโโ deploy.sh # Deployment script
โโโ references/ # Reference documentation
โ โโโ domain-knowledge.md # Domain reference material
โ โโโ prompt-templates.md # Reusable prompt templates
โโโ assets/ # Static resources
โ โโโ schemas.json # JSON validation schemas
โ โโโ system-diagram.md # Architecture documentation
โโโ skills/ # Sub-skill files
โ โโโ main.md # Primary harness orchestrator
โ โโโ sub-gather-requirements.md # Intake specialist
โ โโโ sub-evidence-collector.md # Data librarian
โ โโโ sub-core-analysis.md # Cache performance engineer
โ โโโ sub-knowledge-updater.md # Research librarian
โ โโโ sub-advisor.md # Senior advisor
โโโ src/ # Python package
โ โโโ shader_cache_optimization/
โ โโโ __init__.py # Package exports
โ โโโ hooks.py # Hooks implementation
โ โโโ config.py # Configuration management
โ โโโ degradation.py # Degradation management
โโโ tools/ # Validation and crawl tools
โ โโโ knowledge_updater.py # Knowledge crawl pipeline
โ โโโ test_knowledge_updater.py # Unit tests
โ โโโ validate_project.py # 8-File Contract validator
โ โโโ run_test_scenarios.py # End-to-end test runner
โโโ tests/ # Test scenarios
โ โโโ test-scenarios.md # Test scenario definitions
โ โโโ TEST_RESULTS.md # Test results
โโโ logs/ # Runtime logs (created at runtime)
Quality Gates
Universal Gates (U1-U6)
| Gate | Requirement |
|---|---|
| U1 | โฅ3 sources cited, โฅ1 academic/authoritative (Tier 1-2) |
| U2 | Disclosure/limitations before recommendation |
| U3 | Evidence hierarchy stated per source (Tier 1-4) |
| U4 | Language matches user preference |
| U5 | Output uses declared template (all sections) |
| U6 | Every claim traceable to โฅ1 source or flagged |
Domain Gates (G1-G4)
| Gate | Requirement |
|---|---|
| G1 | Compile spikes profiled with severity quantification |
| G2 | Async/pre-build compilation strategy applied |
| G3 | Cache persistence & invalidation configured |
| G4 | First-play warm-up addressed with method and time budget |
Enforcement Logic
- Each gate checked in order (U1โU2โ...โU6โG1โ...โG4)
- Auto-fix procedure runs on failure
- 2 retry attempts per gate
- After 2 failures: explicit limitation notice emitted, continue to next gate
- Final output: Post-Execution Gate Checklist showing pass/fail/limited status
Data Sources
Domain Authoritative Sources
GPU Driver Documentation:
- NVIDIA: https://docs.nvidia.com/gameworks/technologies/technologies-knowledge-base.html
- AMD GPUOpen: https://gpuopen.com/
- Intel: https://www.intel.com/content/www/us/en/developer/tools/oneapi/oneapi-rendering-optimizer.html
API Specifications:
- Vulkan Registry: https://registry.khronos.org/vulkan/specs/1.3/html/
- DirectX Documentation: https://learn.microsoft.com/en-us/windows/win32/direct3d12/
- OpenGL Registry: https://registry.khronos.org/OpenGL/
Game Engine Documentation:
- Unity: https://docs.unity3d.com/Manual/shader-variant-collection.html
- Unreal Engine: https://docs.unrealengine.com/5.0/en-US/optimizing-shaders-by-pipeline-state-caching-in-unreal-engine/
- Godot: https://docs.godotengine.org/en/stable/tutorials/performance/shaders.html
Open Source Projects:
- DXVK: https://github.com/doitsujin/dxvk/wiki
- VKD3D: https://wiki.winehq.org/Vkd3d
- Mesa Drivers: https://docs.mesa3d.org/
Academic & Research Sources
Journals:
- IEEE Transactions on Visualization and Computer Graphics (TVCG)
- ACM Transactions on Graphics (TOG)
- Computers & Graphics (Elsevier)
- Journal of Computer Graphics Techniques (JCGT)
- Entertainment Computing (Elsevier)
Conferences:
- SIGGRAPH / SIGGRAPH Asia
- Eurographics
- i3D (Interactive 3D Graphics and Games)
- GDC (Game Developers Conference)
Knowledge Update Schedule
# Weekly academic update (Mondays 8:00 AM)
0 8 * * 1 python D:/972026/255-shader-cache-optimization/tools/knowledge_updater.py >> logs/knowledge_update.log 2>&1
# Daily news update (Daily 7:00 AM)
0 7 * * * python D:/972026/255-shader-cache-optimization/tools/knowledge_updater.py --news-only >> logs/knowledge_news.log 2>&1
Testing
Run All Tests
# Validate 8-File Contract
python tools/validate_project.py
# Unit tests for knowledge updater
python tools/test_knowledge_updater.py
# End-to-end scenario tests
python tools/run_test_scenarios.py --all
Test Scenarios
The test suite (tests/test-scenarios.md) defines 5 comprehensive scenarios:
- Scenario 1: Standard analysis with complete inputs
- Scenario 2: Minimal-input analysis (defaults applied)
- Scenario 3: Comparison scenario (two objects/cases)
- Scenario 4: Risk/feasibility or conflict scenario
- Scenario 5: Degraded-mode scenario (missing data)
Expected Results
All scenarios should:
- Complete without harness failure
- Exercise all universal gates (U1-U6)
- Exercise all domain gates (G1-G4)
- Cover all verdict categories (Stutter-Free, Conditional, Persistent, Inconclusive)
- Include proper LIMITATION banners when applicable
Knowledge Base
SECOND-KNOWLEDGE-BRAIN.md is the living knowledge base automatically updated by the crawl pipeline. It contains:
- Core Concepts & Frameworks โ Foundational methods for shader compilation and cache optimization
- Key Research Papers & Standards โ Peer-reviewed sources with DOIs and tier labels
- State-of-the-Art Methods & Tools โ Current best practices and emerging techniques
- Authoritative Data Sources โ Curated list of domain-specific resources
- Analytical Frameworks โ Structured approaches to common problems
- Self-Update Protocol โ Crawl configuration and dedup rules
- Knowledge Update Log โ Automated entries with relevance scores
Manual Knowledge Query
# View knowledge base
cat SECOND-KNOWLEDGE-BRAIN.md
# Search for specific topic
grep -i "pipeline cache" SECOND-KNOWLEDGE-BRAIN.md
Development
Project Status
Version: 2.0.0 Status: BULLETPROOF PRODUCTION READY Phase: Phase 6 (Production-Grade Architecture Upgrade) โ 100% Complete
Build & Validation
# Clone repository
git clone https://github.com/972026-skill-library/255-shader-cache-optimization.git
cd 255-shader-cache-optimization
# Install dependencies
pip install -r requirements.txt
# Run validation suite
python tools/validate_project.py
python tools/test_knowledge_updater.py
python tools/run_test_scenarios.py
Project Structure Compliance
This project adheres to the 972026 Skill Library Standard v1.0:
- 8-File Contract: โ All required files present
- Sub-skills: โ 5 production-grade sub-skills
- Quality gates: โ U1-U6 + G1-G4 defined and enforced
- Knowledge pipeline: โ Crawl, dedup, scoring implemented
- Test coverage: โ 5 scenarios with full gate coverage
Roadmap
Completed (v2.0.0)
- Phase 0: Architecture & source mapping
- Phase 1: Core sub-skills (production-grade)
- Phase 2: Main harness + quality gates
- Phase 3: Knowledge pipeline + tests
- Phase 4: Testing & validation
- Phase 5: Integration & polish
- Phase 6: Production-grade architecture upgrade
Future Enhancements (v2.1+)
- Real-time shader compilation profiling integration
- GPU-specific cache tuning automation
- Community shader cache sharing platform
- Multi-game batch analysis
- Mobile graphics API support (Metal, GLES)
- Web service wrapper for REST API
- Real-time monitoring dashboard
Contributing
Contributions are welcome! Please ensure:
- Code Style: Follow PEP 8 for Python; Markdown for documentation
- Testing: Add test scenarios for new features
- Documentation: Update relevant sections in CLAUDE.md, README.md
- Validation: Run
python tools/validate_project.pybefore submitting
Submission Process
- Fork repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
License
MIT License โ see LICENSE for details.
Copyright (c) 2026 972026 Skill Library
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Acknowledgments
- Khronos Group โ Vulkan specification and pipeline cache documentation
- GPUOpen (AMD) โ Open-source graphics optimization resources
- NVIDIA Developer โ Shader cache best practices
- DXVK Project โ Vulkan-based DX11 implementation and caching
- Mesa3D โ Open-source OpenGL/Vulkan drivers
- 972026 Skill Library โ Standard and scaffold tools
Citation
If you use this skill in research or production, please cite:
@software{shader_cache_optimization,
title = {shader-cache-optimization: Shader Cache Optimization to Eliminate Game Stuttering},
author = {{972026 Skill Library}},
year = {2026},
version = {2.0.0},
url = {https://github.com/972026-skill-library/255-shader-cache-optimization}
}
Contact
- Issues: https://github.com/972026-skill-library/255-shader-cache-optimization/issues
- Discussions: https://github.com/972026-skill-library/255-shader-cache-optimization/discussions
- Documentation: See PROJECT-detail.md for full technical specification
Built with โค๏ธ for the graphics programming community