| name | build-manager |
| description | Advanced build management agent that provides high-performance incremental compilation, hot reload capabilities, and intelligent build orchestration. Features MD5-based change detection, process management, and multi-platform deployment support with tqdm progress visualization. |
| short_description | Advanced build management agent that provides high-performance incremental compilation, hot reload capabilities, and intelligent build orche |
Build Manager Agent Skill
Cursor Integration: This skill is auto-discovered by Cursor. It activates based on the task description matching the skill's capabilities.
Overview
Advanced build management agent that provides high-performance incremental compilation, hot reload capabilities, and intelligent build orchestration. Features MD5-based change detection, process management, and multi-platform deployment support with tqdm progress visualization.
Capabilities
- Incremental Compilation: MD5-based change detection for intelligent rebuilds
- Hot Reload System: Process termination and atomic binary replacement
- Build Orchestration: Parallel compilation with CPU optimization
- Multi-Platform Support: Cross-platform build and deployment
- Progress Visualization: Real-time build progress with ETA calculation
- Dependency Management: Cargo workspace and npm project handling
Cursor Tools
This skill uses the following Cursor-native tools:
| Tool | Purpose |
|---|
Read | Read files from the codebase |
Grep | Search for patterns in code (regex) |
SemanticSearch | Find code by meaning, not exact text |
Write | Create new files |
StrReplace | Edit existing files with precise replacements |
Shell | Execute terminal commands |
WebSearch | Search the web for documentation/references |
WebFetch | Fetch content from URLs |
Task | Launch subagents for complex parallel work |
ReadLints | Check for linter errors after edits |
Usage Examples
Fast Incremental Build
Hot Reload Deployment
Multi-Platform Build
Build Optimization Analysis
Output Format
Build Report
ð Build Manager Report - Incremental Build
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
Build Type: Incremental (MD5-based change detection)
Target: release
Platform: x86_64-unknown-linux-gnu
ð Build Statistics
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
Files Processed: 1,234
Changed Files: 23 (1.8%)
Build Time: 45.2s (ETA: 67% faster than full rebuild)
Peak Memory: 2.1GB
CPU Cores Used: 6/8
â¡ Performance Optimizations Applied
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
âEIncremental Compilation: Enabled (CARGO_INCREMENTAL=1)
âEParallel Jobs: 6 cores (75% of available)
âEsccache: Disabled (conflicts with incremental)
âELTO: Disabled for faster iteration
âEDebug Info: Stripped for release
ð Build Artifacts
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
âââ target/release/codex (8.2MB) - Main binary
âââ target/release/deps/ (245MB) - Dependencies
âââ target/release/build/ (89MB) - Build artifacts
âââ target/release/incremental/ (156MB) - Incremental cache
ð Hot Reload Status
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
Process Detection: âEFound 3 running instances
Termination: âEGraceful shutdown completed
Binary Replacement: âEAtomic copy successful
Restart: âENew process started (PID: 12345)
â EEBuild Warnings
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
- Large binary size: Consider stripping debug symbols
- Memory usage high: Monitor for OOM in production
- Dependencies: 47 crates updated, review for breaking changes
âEBuild Verification
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
- Compilation: âEPASSED
- Linking: âEPASSED
- Tests: âEPASSED (1,247 tests in 23.4s)
- Linting: âEPASSED (clippy)
- Formatting: âEPASSED (rustfmt)
- Security: âEPASSED (no vulnerabilities)
ð¯ Next Steps
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââE
1. Deploy to staging environment
2. Run integration tests
3. Monitor performance metrics
4. Consider enabling LTO for production release
Performance Metrics
{
"build_type": "incremental",
"change_detection": {
"method": "MD5",
"files_analyzed": 1234,
"changed_files": 23,
"change_ratio": 0.018
},
"timing": {
"total_build_time": 45.2,
"compilation_time": 38.7,
"linking_time": 4.1,
"test_time": 23.4,
"full_build_equivalent": 183.0,
"time_saved_percentage": 67.3
},
"resources": {
"peak_memory_mb": 2147,
"cpu_cores_used": 6,
"cpu_utilization_avg": 78.5,
"disk_io_mb": 456
},
"optimizations": {
"incremental_compilation": true,
"parallel_jobs": 6,
"sccache_disabled": true,
"lto_disabled": true,
"debug_stripped": true
},
"artifacts": {
"main_binary_size_mb": 8.2,
"dependencies_size_mb": 245,
"build_artifacts_size_mb": 89,
"incremental_cache_size_mb": 156
},
"verification": {
"compilation": "PASSED",
"linking": "PASSED",
"tests": "PASSED",
"linting": "PASSED",
"formatting": "PASSED",
"security": "PASSED"
}
}
Build Optimization Strategies
1. Incremental Compilation
[profile.dev]
incremental = true
codegen-units = 16 # Parallel code generation
[profile.release]
incremental = false # Full optimization for release
codegen-units = 1 # Single unit for better optimization
lto = true # Link-time optimization
2. Change Detection Algorithm
def detect_changes(self, source_files: List[Path]) -> List[Path]:
"""MD5-based change detection with caching"""
changed_files = []
cache_file = Path(".build_cache.json")
previous_hashes = {}
if cache_file.exists():
with open(cache_file) as f:
previous_hashes = json.load(f)
current_hashes = {}
for file_path in source_files:
if file_path.exists():
file_hash = hashlib.md5(file_path.read_bytes()).hexdigest()
current_hashes[str(file_path)] = file_hash
if str(file_path) not in previous_hashes or \
previous_hashes[str(file_path)] != file_hash:
changed_files.append(file_path)
with open(cache_file, 'w') as f:
json.dump(current_hashes, f, indent=2)
return changed_files
3. Process Management for Hot Reload
def hot_reload_binary(self, new_binary_path: Path, target_path: Path) -> bool:
"""Atomic binary replacement with process management"""
running_processes = self.find_processes_by_binary(target_path)
for proc in running_processes:
proc.terminate()
try:
proc.wait(timeout=10)
except subprocess.TimeoutExpired:
proc.kill()
temp_path = target_path.with_suffix('.tmp')
shutil.copy2(new_binary_path, temp_path)
temp_path.replace(target_path)
new_process = subprocess.Popen([str(target_path)])
logger.info(f"Hot reload completed, new process PID: {new_process.pid}")
return True
4. Progress Visualization
def build_with_progress(self, build_command: List[str]) -> bool:
"""Execute build with tqdm progress visualization"""
process = subprocess.Popen(
build_command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
bufsize=1,
universal_newlines=True
)
total_lines = 0
compiled_lines = 0
with tqdm(desc="Building", unit="lines") as pbar:
for line in process.stdout:
total_lines += 1
if "Compiling" in line or "Finished" in line:
compiled_lines += 1
pbar.update(1)
pbar.set_description(f"Compiling: {compiled_lines}/{total_lines}")
logger.debug(line.strip())
return process.wait() == 0
Configuration
Build Profiles
[build-manager]
default_profile = "dev"
progress_enabled = true
hot_reload_enabled = true
[build-manager.profiles.dev]
incremental = true
parallel_jobs = "75%"
optimization_level = 0
[build-manager.profiles.release]
incremental = false
parallel_jobs = "100%"
optimization_level = 3
lto = true
strip_debug = true
[build-manager.profiles.ci]
incremental = false
parallel_jobs = "50%"
progress_enabled = false
verbose_output = true
Platform-Specific Settings
{
"platforms": {
"linux": {
"compiler_flags": ["-march=native", "-mtune=native"],
"linker_flags": ["-fuse-ld=lld"],
"package_managers": ["apt", "snap"]
},
"macos": {
"compiler_flags": ["-march=native"],
"linker_flags": ["-fuse-ld=lld"],
"package_managers": ["brew", "port"]
},
"windows": {
"compiler_flags": ["/arch:AVX2"],
"linker_flags": ["/LTCG"],
"package_managers": ["choco", "winget"]
}
}
}
Integration Points
Development Workflow
the build-manager skill "Incremental dev build"
the build-manager skill "Optimized release build with LTO"
the build-manager skill "Build and hot-reload to staging"
CI/CD Integration
- name: Fast Build
run: the build-manager skill "Incremental CI build"
- name: Release Build
run: the build-manager skill "Optimized release build"
- name: Deploy
run: the build-manager skill "Hot reload to production"
IDE Integration
{
"tasks": [
{
"label": "Fast Build",
"type": "shell",
"command": "codex",
"args": ["$build-manager", "Incremental dev build"],
"group": "build"
},
{
"label": "Hot Reload",
"type": "shell",
"command": "codex",
"args": ["$build-manager", "Build and hot-reload"],
"group": "build"
}
]
}
Performance Benchmarks
Build Time Comparison
Full Rebuild: 183.2s
Incremental (10% changes): 45.2s (75% faster)
Incremental (1% changes): 12.8s (93% faster)
Cached Build: 8.3s (95% faster)
Resource Usage
Memory Usage: 2.1GB peak (vs 4.8GB full rebuild)
CPU Utilization: 78.5% avg (6 cores)
Disk I/O: 456MB transferred
Network: 0MB (offline build)
Troubleshooting
Common Issues
Incremental Build Corruption
rm -rf target/incremental/
the build-manager skill "Clean rebuild"
Hot Reload Failures
ps aux | grep codex
sudo the build-manager skill "Force restart"
Memory Issues
export CARGO_BUILD_JOBS=2
the build-manager skill "Low memory build"
Cache Conflicts
rm .build_cache.json
rm -rf target/
the build-manager skill "Fresh build"
$ the skill-install skill https://github.com/zapabob/codex-build-manager-skill`
Version: 2.10.0