quality-checker
Executes build verification and runtime quality checks locally or in CI environments.
Install
mkdir -p .claude/skills/quality-checker && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10263" && unzip -o skill.zip -d .claude/skills/quality-checker && rm skill.zipInstalls to .claude/skills/quality-checker
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Run comprehensive quality checks (static analysis, memory safety, thread safety, build verification) on the MemCapture codebase. Use when validating code changes or debugging before committing.Key capabilities
- →Static analysis
- →Memory safety verification
- →Thread safety checking
- →Build verification
How it works
It executes a suite of analysis tools including AddressSanitizer, ThreadSanitizer, and Valgrind to detect memory and thread safety issues.
Inputs & outputs
When to use quality-checker
- →Validate code changes before commit
- →Debug memory leaks
- →Check thread safety in collection loops
About this skill
MemCapture Quality Checker
Purpose
Execute comprehensive quality checks on the MemCapture codebase directly on the developer's machine or Linux CI environment. Ensures the code builds cleanly, collects metrics correctly, and is free from memory and thread safety issues.
Usage
Invoke this skill when:
- Validating changes before committing
- Debugging build or runtime failures
- Running quality checks locally
- Verifying memory safety of new metric code
- Checking thread safety of collection loops
- Performing static analysis on new platform support
You can run all checks or select specific ones based on your needs.
What It Does
This skill runs quality checks using tools available on the local Linux development environment:
- CMake + g++: Build with strict warnings
- cppcheck: C++17 static analysis
- AddressSanitizer: Memory safety (built into g++)
- ThreadSanitizer: Thread safety (built into g++)
- Valgrind: Memory leak detection
No Docker container is required. MemCapture is a self-contained CMake project.
Available Checks
1. Static Analysis (cppcheck)
- cppcheck: Comprehensive C++17 static analyzer
- Output: Summary of errors and warnings per file
2. Memory Safety (AddressSanitizer)
- Heap use-after-free: Catches dangling smart pointer issues
- Heap buffer overflow: Catches out-of-bounds map/vector access
- Stack use-after-scope: Catches dangling references
- Memory leaks: Detects unreleased allocations
- Output: Runtime error report with stack trace
3. Thread Safety (ThreadSanitizer)
- Data race detection: Finds unsynchronized access to shared data
- Especially useful for
mQuitflag andmLinuxMemoryMeasurementsmap - Output: Runtime race report with access history
4. Build Verification
- Strict compilation: Builds with
-Wall -Wextra - C++17 conformance: No extensions
- Output: Build log and binary size
5. Integration Validation
- Test capture: 10-second run on local system
- Report validation: HTML and JSON output well-formed
- Schema check: All expected JSON top-level keys present
Execution Process
Step 1: Build (strict warnings)
mkdir -p build_quality && cd build_quality
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Wall -Wextra" \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
..
cmake --build . --parallel $(nproc) 2>&1 | tee build.log
Step 2: Static Analysis
cppcheck --enable=all \
--std=c++17 \
--suppress=missingInclude \
--suppress=unmatchedSuppression \
--error-exitcode=0 \
--xml --xml-version=2 \
*.cpp *.h FileParsers/ 2> cppcheck-report.xml
# Print human-readable summary
cppcheck --enable=all --std=c++17 --suppress=missingInclude *.cpp *.h FileParsers/
Step 3: Memory Safety (AddressSanitizer)
mkdir -p build_asan && cd build_asan
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address -g" \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
..
cmake --build . --parallel $(nproc)
ASAN_OPTIONS=detect_leaks=1 \
./MemCapture --platform AMLOGIC --duration 10 --json \
--output-dir /tmp/asan_test/ 2>&1 | tee asan.log
Step 4: Thread Safety (ThreadSanitizer)
mkdir -p build_tsan && cd build_tsan
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=thread -g" \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
..
cmake --build . --parallel $(nproc)
./MemCapture --platform AMLOGIC --duration 10 \
--output-dir /tmp/tsan_test/ 2>&1 | tee tsan.log
Step 5: Memory Leak (Valgrind)
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--xml=yes \
--xml-file=valgrind-report.xml \
./MemCapture --platform AMLOGIC --duration 5 \
--output-dir /tmp/valgrind_test/ 2>&1 | tee valgrind.log
Step 6: Integration Validation
./MemCapture --platform AMLOGIC --duration 10 --json \
--output-dir /tmp/integration_test/
# Verify outputs exist
ls -la /tmp/integration_test/report.html /tmp/integration_test/report.json
# Verify JSON schema
python3 -c "
import json, sys
with open('/tmp/integration_test/report.json') as f:
d = json.load(f)
expected = ['metadata', 'data', 'processes']
missing = [k for k in expected if k not in d]
print('MISSING keys:', missing) if missing else print('JSON schema OK')
"
Interpreting Results
Static Analysis (cppcheck)
- error: Critical issues that must be fixed
- warning: Potential problems to review
- style: Code style improvements
- performance: Missed optimization opportunities
Memory Safety (AddressSanitizer)
heap-use-after-free: Dangling pointer or reference — criticalheap-buffer-overflow: Out-of-bounds access — criticalDirect leak: Memory not freed — fix immediatelyIndirect leak: Typically from a lost parent structure
Thread Safety (ThreadSanitizer)
DATA RACE: Two threads access the same variable without synchronization- Common in MemCapture:
mQuitwithoutstd::atomic, map access without lock Lock order inversion: Potential deadlock in metric shutdown
Build Verification
- All warnings listed: Review every
-Wextrawarning - Binary size: Note if a new dependency significantly increases binary size
User Interaction
When invoked, ask the user:
-
Which checks to run?
- All checks (comprehensive)
- Static analysis only (fast)
- Memory safety only (AddressSanitizer or Valgrind)
- Thread safety only (ThreadSanitizer)
- Build verification only
- Integration validation only
-
Platform to test:
- AMLOGIC (default)
- REALTEK, BROADCOM, MEDIATEK
-
Report detail:
- Summary only (counts and critical issues)
- Detailed (all findings)
Example Invocations
- "Run quality checks" — all checks, AMLOGIC platform
- "Check memory safety" — AddressSanitizer + Valgrind
- "Quick static analysis" — cppcheck only
- "Verify my new Mediatek GPU code" — build + MEDIATEK integration run
- "Check thread safety of the collection loop" — ThreadSanitizer run
Output Files Generated
build.log: Compiler warnings and errorscppcheck-report.xml: Static analysis findingsasan.log: AddressSanitizer runtime outputtsan.log: ThreadSanitizer runtime outputvalgrind-report.xml+valgrind.log: Memory leak report
Best Practices
- Run static analysis first — fastest feedback loop
- Run AddressSanitizer on every new metric — catches issues that Valgrind may miss
- Run ThreadSanitizer when changing collection thread logic — race conditions are subtle
- Validate JSON schema after any JsonReportGenerator change — downstream consumers depend on it
- Always test with the correct platform flag — platform switch paths are not equivalent
Pull the latest test container:
docker pull ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest
Start container with workspace mounted:
docker run -d --name native-platform \
-v /path/to/workspace:/mnt/workspace \
ghcr.io/rdkcentral/docker-device-mgt-service-test/native-platform:latest
Step 2: Run Selected Checks
Execute the requested quality checks inside the container:
Static Analysis:
docker exec -i native-platform /bin/bash -c "
cd /mnt/workspace && \
cppcheck --enable=all \
--inconclusive \
--suppress=missingIncludeSystem \
--suppress=unmatchedSuppression \
--error-exitcode=0 \
--xml \
--xml-version=2 \
. 2> cppcheck-report.xml
"
Shell Script Checks:
docker exec -i native-platform /bin/bash -c "
cd /mnt/workspace && \
find . -name '*.sh' -type f -exec shellcheck {} +
"
Memory Safety:
docker exec -i native-platform /bin/bash -c "
cd /mnt/workspace/src/unittest && \
automake --add-missing && \
autoreconf --install && \
./configure && \
make -j\$(nproc) && \
find . -type f -executable -name '*gtest*' 2>/dev/null | while read test_bin; do
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--xml=yes \
--xml-file=\"valgrind-\$(basename \$test_bin).xml\" \
\"\$test_bin\" 2>&1 | tee \"valgrind-\$(basename \$test_bin).log\"
done
"
Thread Safety:
docker exec -i native-platform /bin/bash -c "
cd /mnt/workspace/src/unittest && \
find . -type f -executable -name '*gtest*' 2>/dev/null | while read test_bin; do
valgrind --tool=helgrind \
--track-lockorders=yes \
--xml=yes \
--xml-file=\"helgrind-\$(basename \$test_bin).xml\" \
\"\$test_bin\" 2>&1 | tee \"helgrind-\$(basename \$test_bin).log\"
done
"
Build Verification:
docker exec -i native-platform /bin/bash -c "
cd /path/to/build && \
cmake --build . --parallel $(nproc) && \
for bin in MemCapture; do
if [ -f \"\$bin\" ]; then
ls -lh \"\$bin\"
file \"\$bin\"
size \"\$bin\"
fi
done
"
Step 3: Report Results
Parse and summarize results for the user:
- Number of issues found by category
- Critical issues requiring immediate attention
- Warnings that should be addressed
- Memory leaks with stack traces
- Race conditions or deadlock risks
- Build errors or warnings
Step 4: Cleanup
Stop and remove the container:
docker stop native-platform
docker rm native-platform
Interpreting Results
Static Analysis (cppcheck)
- error: Critical issues that must be fixed
- warning: Potential problems to review
- style: Code style improvements
- **performanc
Content truncated.
When not to use it
- →Non-C++ projects
Prerequisites
Limitations
- →Requires Linux environment
- →Requires specific build tools
How it compares
It provides a complete, automated quality gate for C++ code rather than manual testing.
Compared to similar skills
quality-checker side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| quality-checker (this skill) | 0 | 3mo | Review | Advanced |
| code-coverage-with-gcov | 15 | 4mo | Review | Intermediate |
| static-analysis | 5 | 6mo | No flags | Advanced |
| rsyslog-test | 2 | 2mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by rdkcentral
View all by rdkcentral →You might also like
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects
static-analysis
gmh5225
Expertise in LLVM-based static analysis including dataflow analysis, pointer analysis, taint tracking, and program verification. Use this skill when implementing security scanners, bug finders, code quality tools, or performing program analysis research.
rsyslog-test
rsyslog
Standardizes testing and validation for rsyslog using the diag.sh framework.
rr-debugger
gadievron
Deterministic debugging with rr record-replay. Use when debugging crashes, ASAN faults, or when reverse execution is needed. Provides reverse-next, reverse-step, reverse-continue commands and crash trace extraction.
c-pro
sickn33
Write efficient C code with proper memory management, pointer arithmetic, and system calls. Handles embedded systems, kernel modules, and performance-critical code. Use PROACTIVELY for C optimization, memory issues, or system programming.
systemc-tools
intel
Use when writing, editing, reviewing, or debugging synthesizable SystemC code for Intel SystemC Compiler (ICSC) and SingleSource library. Covers rules for module hierarchy, channels and ports, process declarations, reset behavior, sensitivity lists, SystemC and C++ data types and collections. Applie