Enforce Clang verification, static analysis, and MCP compilation checks for C++ projects to ensure code quality and correctness.
A rigorous C++ development workflow that enforces verification and static analysis checks using the ClangVerifier MCP server and compilation tools.
This skill establishes a strict quality control process for C++ development, requiring file verification after every edit, static analysis before suggesting fixes, and explicit compilation checks before assuming success. Prevents common C++ errors by enforcing tool-based validation at every step.
1. **Mandatory File Verification**
- After editing ANY `.cpp` or `.hpp` file, immediately run the `verify_file` tool from the ClangVerifier MCP server
- Do not proceed to the next task until verification completes
- If verification fails, address the issues before continuing
2. **Static Analysis Before Fixes**
- Before suggesting ANY fix for a C++ error, run `run_tidy` to get a deep analysis of the issue
- Use the tidy analysis output to inform your fix recommendation
- Do not propose fixes based solely on error messages without running static analysis
3. **Explicit Compilation Verification**
- Never assume a build will pass without verification
- Always use the available MCP compilation tools to verify syntax and compilation success
- If compilation tools are available, use them after making changes
When working with C++ files, follow this sequence:
1. **Edit Phase**: Make changes to `.cpp` or `.hpp` files
2. **Verify Phase**: Run `verify_file` on edited files
3. **Analysis Phase**: If errors occur, run `run_tidy` for deep analysis
4. **Fix Phase**: Apply fixes based on tidy analysis
5. **Compile Phase**: Use MCP compilation tools to verify the build
6. **Repeat**: If issues remain, return to step 3
**Scenario 1: Editing a header file**
```
1. Edit Matrix.hpp to add new method
2. Run verify_file on Matrix.hpp
3. Address any verification errors
4. Run MCP compilation tools to verify build
```
**Scenario 2: Fixing a compilation error**
```
1. User reports error in multiply.cpp
2. Run run_tidy on multiply.cpp for analysis
3. Review tidy output for root cause
4. Propose fix based on analysis
5. Apply fix and run verify_file
6. Run MCP compilation tools to confirm fix
```
**Scenario 3: Large refactoring**
```
1. Edit multiple .cpp/.hpp files
2. Run verify_file on each edited file
3. If errors found, run run_tidy for analysis
4. Fix issues iteratively
5. Run MCP compilation tools for final verification
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/c-development-with-clang-verification/raw