/cpp-build
Fix C++ build errors, CMake issues, and linker problems incrementally. Invokes the cpp-build-resolver agent for minimal, surgical fixes.
> /plugin marketplace add affaan-m/ECC > /plugin install ecc@ecc
How it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/cpp-build
Context preview
What this command does when you run it.
Fix C++ build errors, CMake issues, and linker problems incrementally. Invokes the cpp-build-resolver agent for minimal, surgical fixes.
Command definition
cpp-build.mddescription: Fix C++ build errors, CMake issues, and linker problems incrementally. Invokes the cpp-build-resolver agent for minimal, surgical fixes.
C++ Build and Fix
This command invokes the **cpp-build-resolver** agent to incrementally fix C++ build errors with minimal changes.
What This Command Does
1. **Run Diagnostics**: Execute `cmake --build`, `clang-tidy`, `cppcheck` 2. **Parse Errors**: Group by file and sort by severity 3. **Fix Incrementally**: One error at a time 4. **Verify Each Fix**: Re-run build after each change 5. **Report Summary**: Show what was fixed and what remains
When to Use
Use `/cpp-build` when:
- `cmake --build build` fails with errors
- Linker errors (undefined references, multiple definitions)
- Template instantiation failures
- Include/dependency issues
- After pulling changes that break the build
Diagnostic Commands Run
# CMake configure
cmake -B build -S .
# Build
cmake --build build 2>&1 | head -100
# Static analysis (if available)
clang-tidy src/*.cpp -- -std=c++17
cppcheck --enable=all src/
Example Session
User: /cpp-build
Agent:
# C++ Build Resolution
## Initial Diagnostics
```bash
$ cmake --build build
src/service/user.cpp:25:15: error: use of undeclared identifier 'UserRepository'
src/handler/api.cpp:42:9: error: no matching function for call to 'process'
src/handler/api.cpp:58:1: error: non-void function does not return a value
Errors found: 3
Fix 1: Undeclared Identifier
File: src/service/user.cpp:25 Error: use of undeclared identifier 'UserRepository' Cause: Missing include
// Added include
#include "repository/user_repository.hpp"
$ cmake --build build
# 2 errors remaining
Fix 2: No Matching Function
File: src/handler/api.cpp:42 Error: no matching function for call to 'process'
// Changed
process(params.get("count"));
// To
process(std::stoi(params.get("count")));$ cmake --build build
# 1 error remaining
Fix 3: Missing Return
File: src/handler/api.cpp:58 Error: non-void function does not return a value
std::optional<User> getUser(const std::string& id) {
if (id.empty()) {
return std::nullopt;
}
auto user = findUser(id);
// Added missing return
return user;
}$ cmake --build build
# Build successful!
Final Verification
$ ctest --test-dir build --output-on-failure
Test project build
1/5 Test #1: unit_tests ........ Passed 0.02 sec
2/5 Test #2: integration_tests Passed 0.15 sec
All tests passed.Summary
| Metric | Count | |--------|-------| | Build errors fixed | 3 | | Linker errors fixed | 0 | | Files modified | 2 | | Remaining issues | 0 |
Build Status: PASS: SUCCESS
## Common Errors Fixed
| Error | Typical Fix |
|-------|-------------|
| `undeclared identifier` | Add `#include` or fix typo |
| `no matching function` | Fix argument types or add overload |
| `undefined reference` | Link library or add implementation |
| `multiple definition` | Use `inline` or move to .cpp |
| `incomplete type` | Replace forward decl with `#include` |
| `no member named X` | Fix member name or include |
| `cannot convert X to Y` | Add appropriate cast |
| `CMake Error` | Fix CMakeLists.txt configuration |
## Fix Strategy
1. **Compilation errors first** - Code must compile
2. **Linker errors second** - Resolve undefined references
3. **Warnings third** - Fix with `-Wall -Wextra`
4. **One fix at a time** - Verify each change
5. **Minimal changes** - Don't refactor, just fix
## Stop Conditions
The agent will stop and report if:
- Same error persists after 3 attempts
- Fix introduces more errors
- Requires architectural changes
- Missing external dependencies
## Related Commands
- `/cpp-test` - Run tests after build succeeds
- `/cpp-review` - Review code quality
- `verification-loop` skill - Full verification loop
## Related
- Agent: `agents/cpp-build-resolver.md`
- Skill: `skills/cpp-coding-standards/`
Read more
description: Fix C++ build errors, CMake issues, and linker problems incrementally. Invokes the cpp-build-resolver agent for minimal, surgical fixes.
C++ Build and Fix
This command invokes the **cpp-build-resolver** agent to incrementally fix C++ build errors with minimal changes.
What This Command Does
1. **Run Diagnostics**: Execute `cmake --build`, `clang-tidy`, `cppcheck` 2. **Parse Errors**: Group by file and sort by severity 3. **Fix Incrementally**: One error at a time 4. **Verify Each Fix**: Re-run build after each change 5. **Report Summary**: Show what was fixed and what remains
When to Use
Use `/cpp-build` when:
- `cmake --build build` fails with errors
- Linker errors (undefined references, multiple definitions)
- Template instantiation failures
- Include/dependency issues
- After pulling changes that break the build
Diagnostic Commands Run
# CMake configure cmake -B build -S . # Build cmake --build build 2>&1 | head -100 # Static analysis (if available) clang-tidy src/*.cpp -- -std=c++17 cppcheck --enable=all src/
Example Session
User: /cpp-build Agent: # C++ Build Resolution ## Initial Diagnostics ```bash $ cmake --build build src/service/user.cpp:25:15: error: use of undeclared identifier 'UserRepository' src/handler/api.cpp:42:9: error: no matching function for call to 'process' src/handler/api.cpp:58:1: error: non-void function does not return a value
Errors found: 3
Fix 1: Undeclared Identifier
File: src/service/user.cpp:25 Error: use of undeclared identifier 'UserRepository' Cause: Missing include
// Added include #include "repository/user_repository.hpp"
$ cmake --build build # 2 errors remaining
Fix 2: No Matching Function
File: src/handler/api.cpp:42 Error: no matching function for call to 'process'
// Changed
process(params.get("count"));
// To
process(std::stoi(params.get("count")));$ cmake --build build # 1 error remaining
Fix 3: Missing Return
File: src/handler/api.cpp:58 Error: non-void function does not return a value
std::optional<User> getUser(const std::string& id) {
if (id.empty()) {
return std::nullopt;
}
auto user = findUser(id);
// Added missing return
return user;
}$ cmake --build build # Build successful!
Final Verification
$ ctest --test-dir build --output-on-failure
Test project build
1/5 Test #1: unit_tests ........ Passed 0.02 sec
2/5 Test #2: integration_tests Passed 0.15 sec
All tests passed.Summary
| Metric | Count | |--------|-------| | Build errors fixed | 3 | | Linker errors fixed | 0 | | Files modified | 2 | | Remaining issues | 0 |
Build Status: PASS: SUCCESS
## Common Errors Fixed | Error | Typical Fix | |-------|-------------| | `undeclared identifier` | Add `#include` or fix typo | | `no matching function` | Fix argument types or add overload | | `undefined reference` | Link library or add implementation | | `multiple definition` | Use `inline` or move to .cpp | | `incomplete type` | Replace forward decl with `#include` | | `no member named X` | Fix member name or include | | `cannot convert X to Y` | Add appropriate cast | | `CMake Error` | Fix CMakeLists.txt configuration | ## Fix Strategy 1. **Compilation errors first** - Code must compile 2. **Linker errors second** - Resolve undefined references 3. **Warnings third** - Fix with `-Wall -Wextra` 4. **One fix at a time** - Verify each change 5. **Minimal changes** - Don't refactor, just fix ## Stop Conditions The agent will stop and report if: - Same error persists after 3 attempts - Fix introduces more errors - Requires architectural changes - Missing external dependencies ## Related Commands - `/cpp-test` - Run tests after build succeeds - `/cpp-review` - Review code quality - `verification-loop` skill - Full verification loop ## Related - Agent: `agents/cpp-build-resolver.md` - Skill: `skills/cpp-coding-standards/`
Your agent can write code, but ECC gives it a coordinated engineering system and toolbox: it plans before it builds, verifies changes with tests, reviews its own work from a fresh context, remembers what matters, and turns repeated wins into reusable skills
Repo: affaan-m/ECC
Other commands on ecc.
- /add-language-rules
Workflow command scaffold for add-language-rules in everything-claude-code.
Open command - /database-migration
Workflow command scaffold for database-migration in everything-claude-code.
Open command - /feature-development
Workflow command scaffold for feature-development in everything-claude-code.
Open command - /aside
Answer a quick side question without interrupting or losing context from the current task. Resume work automatically after answering.
Open command - /auto-update
Pull the latest ECC repo changes and reinstall the current managed targets.
Open command - /build-fix
Detect the project build system and incrementally fix build/type errors with minimal safe changes.
Open command

