mohitmishra786/low-level-dev-skills/cpp-templates
Claude Code and agent skill by mohitmishra786/low-level-dev-skills
- community
Checking that the SKILL.md file is still in the repository.
C++ template skill for reading template errors and optimizing compile times. Use when deciphering template error stacks, setting -ftemplate-backtrace-limit, writing concepts and requires-clauses, understanding SFINAE vs concepts, or profiling template instantiation bottlenecks with Templight. Activates on queries about C++ templates, template error messages, concepts, requires expressions, SFINAE, template metaprogramming, or slow template compilation.
Install
npx vskill@latest install mohitmishra786/low-level-dev-skills/cpp-templatesSKILL.md
C++ Templates
Purpose
Guide agents through reading and fixing template error messages, using concepts as cleaner constraints, understanding SFINAE vs concepts trade-offs, and profiling template instantiation depth and compile times with Templight.
Triggers
- "How do I read this massive C++ template error?"
- "How do I use concepts to constrain a template?"
- "What's the difference between SFINAE and concepts?"
- "My templates make compilation very slow"
- "How do I write a requires-clause?"
- "How do I profile template instantiation times?"
Workflow
1. Reading template error messages
Template errors print full instantiation chains. Strategy: read from the bottom up.
Rules for reading:
- Find the first error line (top of output) — that's your code
- Skip all the
note:lines until you find "required from here" or "in instantiation of" - The bottom of the stack shows the type that failed substitution
2. SFINAE — legacy constraint technique
SFINAE (Substitution Failure Is Not An Error) silently removes overloads that fail substitution:
SFINAE errors are cryptic. Prefer concepts (C++20) for new code.
3. Concepts — modern constraints (C++20)
4. Requires expressions
5. SFINAE vs concepts comparison
| Aspect | SFINAE | Concepts | |
|---|---|---|---|
| Syntax | Complex, verbose | Clean, readable | |
| Error messages | Cryptic wall-of-text | Clear constraint failure | |
| Compile time | Can be slow (many substitutions) | Generally faster | |
| C++ version | C++11 | C++20 | |
| Short-circuit | No | Yes (concept subsumption) | |
Use in if constexpr | Awkward | Natural | |
| Overload ranking | Manually via priority | Automatic by constraint specificity |
Migration: replace enable_if with concept constraints; replace void_t helpers with requires.
6. Template instantiation profiling with Templight
7. Reducing template compile times
Related skills
- Use
skills/build-systems/build-accelerationfor ccache and PCH to reduce overall compile time - Use
skills/compilers/clangfor Clang-specific diagnostics and concept error output - Use
skills/low-level-programming/cpp-coroutinesfor another advanced C++20 feature
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/compilers/cpp-templates/SKILL.md
Popularity
- Repository stars
- 70
- Repository forks
- 10
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 25 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mohitmishra786/low-level-dev-skills/cpp-templates)