qt-cpp-review
Performs deep, multi-domain code review for Qt6 C++ projects.
Install
mkdir -p .claude/skills/qt-cpp-review && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10427" && unzip -o skill.zip -d .claude/skills/qt-cpp-review && rm skill.zipInstalls to .claude/skills/qt-cpp-review
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.
Invoke when the user asks to review, check, audit, or look over Qt6 C++ code — or suggest before committing. Runs deterministic linting (60+ rules) then six parallel deep- analysis agents covering model contracts, ownership, threading, API correctness, error handling, and performance. Reports only high-confidence issues (>80/100) with structured mitigations. Read-only — never modifies code.Key capabilities
- →Run deterministic linting
- →Perform deep analysis on threading
- →Perform deep analysis on ownership
- →Perform deep analysis on API correctness
- →Report high-confidence issues
How it works
It combines deterministic linting with six parallel agent-driven analysis passes across focused domains.
Inputs & outputs
When to use qt-cpp-review
- →Qt6 code review
- →Sanity check before commit
- →Qt framework audit
About this skill
Qt Code Review
A structured, read-only code review skill for Qt6 C++ code that combines deterministic linting with parallel agent-driven deep analysis across six focused domains.
When to use this skill
- When the user mentions review-related tasks: "review", "check", "audit", "look over", "code review", "sanity check"
- Suggest running this skill before committing code
- When the user asks to validate Qt6 C++ code quality
Arguments
/qt-cpp-review— review using universal Qt6 C++ rules only/qt-cpp-review framework— also apply Qt framework/module development rules (BC, exports, d-pointers, qdoc, QML versioning)
Framework mode detection
If $ARGUMENTS contains "framework", enable framework mode.
If the argument is not passed, auto-detect by scanning the first
few files in scope for framework signals. If two or more of
the following are found, suggest to the user:
"This looks like Qt framework/module code. Run
/qt-cpp-review framework to also apply framework-specific
rules (BC, exports, qdoc, QML versioning)?"
Framework signals (any two = likely framework code):
QT_BEGIN_NAMESPACE/QT_END_NAMESPACEQ_CORE_EXPORT,Q_GUI_EXPORT,Q_WIDGETS_EXPORT, or anyQ_*_EXPORTmacro#include <QtModule/private/*_p.h>(private headers)Q_DECLARE_PRIVATE,Q_D(),Q_Q()qt_internal_add_moduleorqt_add_modulein CMakeLists.txtsync.profileor.qmake.confin the repository root
Do not auto-enable framework mode — only suggest it. Let the user confirm.
When framework mode is enabled:
- Pass
--frameworkto the linter (if supported) - Load
references/qt-framework-checklist.mdalongside the universal checklist - Include framework rules in each agent's mission context
Scope detection
Detect the user's intended scope from their language:
Diff/commit scope (narrow)
Triggered by language like: "this commit", "these changes", "the diff", "what I changed", "my changes", "staged changes", "outstanding changes", "before I commit"
Action: Run git diff (unstaged) and git diff --cached
(staged) to obtain the changeset. If the user says "this commit",
use git diff HEAD~1..HEAD. Review only the changed lines plus
sufficient surrounding context (±50 lines) for understanding.
Only report issues found in the changed lines — do not report
issues in unchanged surrounding context.
Codebase scope (wide)
Triggered by language like: "review the codebase", "audit the project", "check the repository", "review src/", or when a specific file/directory path is given without commit language.
Action: Glob for *.cpp, *.h, *.hpp files in the
specified scope. Review all matched files.
Execution order
The review proceeds in three phases. Never skip a phase.
Phase 1: Deterministic linting (scripts)
Run the unified Python linter against the target files. Requires Python 3.6+ (no external dependencies). If Python is not available, warn the user and skip to Phase 2.
python3 references/lint-scripts/qt_review_lint.py <files...>
# If python3 is not found, fall back to:
python references/lint-scripts/qt_review_lint.py <files...>
This single-pass scanner encodes all mechanically-checkable rules from the Qt review guidelines. It reads each file once and evaluates all rules per line. Output is deterministic and repeatable. The linter is authoritative — do not second-guess its output.
Collect all output before proceeding to Phase 2.
Rule categories (60+ checks):
- INC (Includes) — ordering, qglobal.h, qNN duplication
- DEP (Deprecated) — obsolete Qt/std class usage
- PAT (Patterns) — anti-patterns (min/max, std::optional, NRVO, COW detach, etc.)
- MDL (Model) — QAbstractItemModel contract (begin/end balance, dataChanged roles, flags, default: in data())
- ERR (Error Handling) — QFile::open, QJsonDocument::isNull, QNetworkReply::error, SSL, timeouts, arg() mismatch
- LCY (Lifecycle) — deleteLater, Q_ASSERT side effects, null guards, unbounded containers, qDeleteAll depth
- API (Naming) — get-prefix, enum hygiene, QList<QString>
- HDR/TMO/CND/VAL/TRN — headers, timeouts, conditionals, value classes, ternary operator
Phase 2: Agent-driven deep analysis (6 parallel agents)
Launch six focused review agents in parallel. Name each agent descriptively when launching (e.g. "Agent 1: Model Contracts") to provide progress visibility. Each agent has a tight scope and a specific checklist. Agents are READ-ONLY — they must never edit or write files.
Tool-agnostic agent contract: Each agent described below is a self-contained review mission. In Claude Code, launch them as general-purpose subagents. In other tools, implement each as whatever subprocess, prompt chain, or analysis pass the tool supports. The key requirement is that each agent:
- Has read access to all source files in scope
- Can search/grep the codebase to trace symbols
- Reports findings in the structured format below
- Applies confidence thresholds: >80 = confirmed finding, 60–79 = investigation target (max 10 total across all agents), <60 = suppress
- Does NOT duplicate findings from Phase 1 lint output (pass lint output as context to each agent)
See Agent missions below for the six agents.
Phase 3: Consolidation and reporting
Merge lint script output and all agent findings. Deduplicate (same file+line+issue = one finding). Apply confidence scoring. Format the final report using the output format below.
Agent missions
Launch all six agents in parallel. Pass each agent:
- The list of files in scope
- The Phase 1 lint output (so they skip already-flagged issues)
- Their specific mission below
Each agent should read all files in scope, then focus on its assigned categories.
Agent 1: Model Contracts
Scope: QAbstractItemModel signal protocol, role system, index validity, proxy model correctness.
Check for:
beginInsertRows/endInsertRowsbalance — every structural model change (add/remove/move) must use the correct begin/end pairs.layoutChangedis NOT a substitute for insert/remove.roleNames()returning roles thatdata()does not handle (missing switch cases, fall-through to default)dataChangedemitted with empty roles vector (forces full refresh instead of targeted update)beginRemoveRowscalled withfirst > last(edge case when container is empty — QAIM contract violation)flags()returning inappropriate flags (e.g.ItemIsEditablefor non-editable items)setData()returning true without emittingdataChanged- Proxy models accessing source model internals instead of going
through
data()/index()API - Filter/proxy models using source-model indices to index into filtered containers (wrong index space)
References: references/qt-review-checklist.md § Model
Contracts
Agent 2: Ownership & Lifecycle
Scope: Memory ownership, parent-child, resource cleanup, Rule of Five, RAII correctness.
Check for:
- Structs/classes with raw pointers where
newis visible and no correspondingdelete/deleteLater/smart-pointer wrapping exists (Rule of Five violation) - Missing
deleteLater()on QNetworkReply in finished handlers Q_ASSERTwrapping side-effectful expressions (compiled out in release builds — the side effect disappears)Q_ASSERTas the sole null guard (crashes in release)- Polymorphic QObject subclasses missing
Q_DISABLE_COPY_MOVE - Polymorphic classes missing virtual destructor
- QTimer/QObject created with
newbut no parent and no other lifecycle management (scope, smart pointer, explicit delete) QObject::connect()called with potentially null sender/receiver outside a null guard (runtime warning)m_recentlyAccessed-style tracking lists that maintain pointers to objects that may be deleted elsewhere (dangling)- Unbounded container growth (append without cap or trim)
- Destructor not cleaning up owned children recursively
- Abstract interfaces with no implementations beyond one class (YAGNI violation — codebase scope only)
References: references/qt-review-checklist.md § Ownership
& Lifecycle, § Polymorphic Classes, § RAII Classes
Agent 3: Thread Safety
Scope: Cross-thread QObject access, mutex consistency, signal emission from worker threads.
Check for:
- QObject member variables written from
QtConcurrent::run()orQThreadworker without synchronization (mutex, atomic, queued connection, or other thread-safe primitive) - Signals emitted from worker threads connected with
Qt::DirectConnection(or explicit non-queued connections) to main-thread receivers - Model mutations (
addNote,removeRows, etc.) from background threads - Shared containers (
QList,QHash) modified from multiple threads without consistent synchronization - Non-atomic increment/decrement of shared counters
(
m_operationCount++from multiple threads) - QTimer or other QObject operations from non-owner thread
References: references/qt-review-checklist.md § Thread
Safety
Agent 4: API, Naming & C++ Correctness
Scope: Qt naming conventions, const-correctness, move semantics, enum hygiene, noexcept correctness.
Check for:
get-prefix on mere getters (Qt reservesgetfor user interaction or out-parameter decomposition)- Non-const getter methods (especially Q_PROPERTY READ accessors — UB via meta-object system)
- Missing
std::forward<T>()on forwarding/universal references return std::move(localVar)preventing NRVOconstlocal variable preventing implicit move on return (e.g.const QJsonDocument doc(...); return doc;forces copy)constmethod returning mutable pointer through raw pointer indirection (findById() constreturningT*lets callers mutate via a const accessor — const doesn't propagate through raw pointers)noexcepton functions containingQ_ASSERT(incom
Content truncated.
When not to use it
- →Modifying code
Limitations
- →Read-only; cannot modify code
- →Suppresses findings below 60 confidence
How it compares
This provides a deep, multi-agent analysis compared to standard static analysis tools.
Compared to similar skills
qt-cpp-review side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| qt-cpp-review (this skill) | 0 | 3mo | Review | Advanced |
| code-coverage-with-gcov | 15 | 4mo | Review | Intermediate |
| cpp-expert | 0 | 2mo | No flags | Advanced |
| dev_unity_unreal | 0 | 6mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects
cpp-expert
Tr3kkR
Review Yuzu C++ source changes for C++23 correctness, idiomatic standard-library use, ABI boundaries, threading primitives, and cross-compiler portability across GCC, Clang, MSVC, and Apple Clang. Use for any governance Gate 3 review when `.cpp`, `.hpp`, or `.h` files change.
dev_unity_unreal
AllurinsX
dev_unity_unreal — an agent skill by AllurinsX.
at-dispatch-v2
pytorch
Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.
3d-games
davila7
3D game development principles. Rendering, shaders, physics, cameras.
cpp-pro
sickn33
Write idiomatic C++ code with modern features, RAII, smart pointers, and STL algorithms. Handles templates, move semantics, and performance optimization. Use PROACTIVELY for C++ refactoring, memory safety, or complex C++ patterns.