Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/theqtcompanyrnd-qt-cpp-review/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 197% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 163% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 186% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 347% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 115% | 0% |
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.
"audit", "look over", "code review", "sanity check"
/qt-cpp-review — review using universal Qt6 C++ rules only/qt-cpp-review framework — also apply Qt framework/moduledevelopment rules (BC, exports, d-pointers, qdoc, QML versioning)
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_*_EXPORT macro
#include <QtModule/private/*_p.h> (private headers)Q_DECLARE_PRIVATE, Q_D(), Q_Q()qt_internal_add_module or qt_add_module in CMakeLists.txtsync.profile or .qmake.conf in the repository rootDo not auto-enable framework mode — only suggest it. Let the user confirm.
When framework mode is enabled:
--framework to the linter (if supported)references/qt-framework-checklist.md alongside theuniversal checklist
Detect the user's intended scope from their language:
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.
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.
The review proceeds in three phases. Never skip a phase.
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.
bashpython3 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):
NRVO, COW detach, etc.)
balance, dataChanged roles, flags, default: in data())
QNetworkReply::error, SSL, timeouts, arg() mismatch
null guards, unbounded containers, qDeleteAll depth
value classes, ternary operator
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:
60–79 = investigation target (max 10 total across all agents), <60 = suppress
(pass lint output as context to each agent)
See Agent missions below for the six agents.
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.
Launch all six agents in parallel. Pass each agent:
Each agent should read all files in scope, then focus on its assigned categories.
Scope: QAbstractItemModel signal protocol, role system, index validity, proxy model correctness.
Check for:
beginInsertRows/endInsertRows balance — every structuralmodel change (add/remove/move) must use the correct begin/end pairs. layoutChanged is NOT a substitute for insert/remove.
roleNames() returning roles that data() does not handle(missing switch cases, fall-through to default)
dataChanged emitted with empty roles vector (forces fullrefresh instead of targeted update)
beginRemoveRows called with first > last (edge case whencontainer is empty — QAIM contract violation)
flags() returning inappropriate flags (e.g. ItemIsEditablefor non-editable items)
setData() returning true without emitting dataChangedthrough data()/index() API
filtered containers (wrong index space)
References: references/qt-review-checklist.md § Model Contracts
Scope: Memory ownership, parent-child, resource cleanup, Rule of Five, RAII correctness.
Check for:
new is visible andno corresponding delete/deleteLater/smart-pointer wrapping exists (Rule of Five violation)
deleteLater() on QNetworkReply in finished handlersQ_ASSERT wrapping side-effectful expressions (compiled outin release builds — the side effect disappears)
Q_ASSERT as the sole null guard (crashes in release)Q_DISABLE_COPY_MOVEnew but no parent and no otherlifecycle management (scope, smart pointer, explicit delete)
QObject::connect() called with potentially nullsender/receiver outside a null guard (runtime warning)
m_recentlyAccessed-style tracking lists that maintainpointers to objects that may be deleted elsewhere (dangling)
(YAGNI violation — codebase scope only)
References: references/qt-review-checklist.md § Ownership & Lifecycle, § Polymorphic Classes, § RAII Classes
Scope: Cross-thread QObject access, mutex consistency, signal emission from worker threads.
Check for:
QtConcurrent::run()or QThread worker without synchronization (mutex, atomic, queued connection, or other thread-safe primitive)
Qt::DirectConnection (or explicit non-queued connections) to main-thread receivers
addNote, removeRows, etc.) frombackground threads
QList, QHash) modified from multiplethreads without consistent synchronization
(m_operationCount++ from multiple threads)
References: references/qt-review-checklist.md § Thread Safety
Scope: Qt naming conventions, const-correctness, move semantics, enum hygiene, noexcept correctness.
Check for:
get-prefix on mere getters (Qt reserves get for userinteraction or out-parameter decomposition)
accessors — UB via meta-object system)
std::forward<T>() on forwarding/universal referencesreturn std::move(localVar) preventing NRVOconst local variable preventing implicit move on return(e.g. const QJsonDocument doc(...); return doc; forces copy)
const method returning mutable pointer through raw pointerindirection (findById() const returning T* lets callers mutate via a const accessor — const doesn't propagate through raw pointers)
noexcept on functions containing Q_ASSERT (incompatible —Q_ASSERT may throw for testing, noexcept terminates)
switch over enum with default: label (suppresses -Wswitch)QList<QString> instead of QStringListconst on methods that don't modify stateconst QMetaObject::Connection preventing handle cleanupReferences: references/qt-review-checklist.md § API & Naming, § Enums, § Methods, § Move Semantics, § Operators
Scope: Missing error checks, input validation, security.
Check for:
QFile::open() return value ignoredQJsonDocument::fromJson() result not checked forisNull()/isObject() before use
QNetworkReply::error() not checked before readAll()hasError() not checked after writinghttp:// instead of https:// in URLsQNetworkAccessManager::sslErrors)setTransferTimeout)(e.g. timer intervals, font sizes)
(unbounded strings from untrusted sources)
QString::arg() with wrong placeholder countsaveToFile() returning true regardless of I/O errorsReferences: references/qt-review-checklist.md § Error Handling & Validation
Scope: Performance anti-patterns, dead code, unnecessary copies, code smells.
Check for:
QRegularExpression constructed inside a loop (expensivecompilation on every iteration)
roleNames() rebuilding QHash on every call (should cache)unnecessary detach/deep-copy
operator[] on shared QHash (triggers detach) —use .value() for reads
allocation)
that are always true/false given preconditions)
(e.g. search cache surviving data edits)
QMap/QHash iteration order nondeterminism when selectinga "best" or "first" entry (.first() changes if keys are added; use deterministic tie-breaking)
QMap for small fixed-size constant data (use array/switch)methods (implicit deep copy on every call — return const ref or cache)
read by any method (dead state — wasted CPU and memory)
which could trigger re-entry
References: references/qt-review-checklist.md § Performance & Code Quality
| Confidence | Meaning | Action | |------------|---------|--------| | 90–100 | Certain: direct rule violation with full symbol trace | Report as finding | | 80–89 | High: rule violation confirmed but edge case possible | Report as finding | | 60–79 | Medium: likely issue but cannot fully verify | Report as investigation target | | <60 | Low: suspicion only | Suppress entirely |
Investigation targets are findings the agent believes are real but cannot fully verify — e.g. noexcept correctness requiring whole-program analysis, dead code that may have callers outside scope, or design-intent judgments like virtual access levels. These are presented in a separate section for human verification. Maximum 10 investigation targets per report, prioritized by confidence within the 60–79 band.
Present the final report as follows. Use exactly this structure.
## Qt Code Review Report
**Scope**: [diff: `git diff HEAD~1..HEAD` | files: <paths>]
**Files reviewed**: N
**Issues found**: N (M from lint, K from deep analysis)
---
### Lint findings
For each lint finding:
#### [L-NNN] <Short title>
- **File**: `path/to/file.cpp:42`
- **Rule**: <rule ID from checklist>
- **Finding**: <what the script detected>
- **Mitigation**: <what to do, in prose — no code patches>
---
### Deep analysis findings
For each agent finding:
#### [D-NNN] <Short title>
- **File**: `path/to/file.cpp:42`
- **Category**: <agent name: Model Contracts | Ownership &
Lifecycle | Thread Safety | API & C++ Correctness | Error
Handling | Performance & Quality>
- **Confidence**: NN/100
- **Finding**: <description of the issue>
- **Trace**: <how the issue was confirmed — which symbols were
followed, what was checked>
- **Mitigation**: <what to do, in prose — no code patches>
---
### Investigation targets (human verification needed)
Findings the agent identified but could not fully verify.
Maximum 10, sorted by confidence. These require human judgment.
For each investigation target:
#### [I-NNN] <Short title>
- **File**: `path/to/file.cpp:42`
- **Category**: <agent name>
- **Confidence**: NN/100
- **Finding**: <what the agent suspects>
- **Unverified because**: <what the agent could not confirm —
e.g. "cannot trace all callees for throw potential",
"only one implementation visible in scope">
- **How to verify**: <specific action for the reviewer>
---
### Summary
| Category | Lint | Deep | Investigate | Total |
|----------|------|------|-------------|-------|
| ... | N | N | N | N |
| **Total**| **M**| **K**| **I** | **N** |
Findings below confidence 60 are suppressed entirely.The following reference files contain detailed checklists extracted from the Qt wiki "Things To Look Out For In Reviews":
references/qt-review-checklist.md — Universal Qt6 C++ reviewrules (always loaded)
references/qt-framework-checklist.md — Qt framework/moduledevelopment rules (loaded only in framework mode)
references/qt-deprecated-classes.md — Classes and patternsthat should no longer be used in Qt implementation
references/lint-scripts/qt_review_lint.py — Single-passPython linter (runs all 60+ checks in <1s)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→pass | 11,161 | 10,001 | -10% | 1 | 1 | 0% | 2,075 | 6,009 | +190% | 0 | 0 | — |
case-05 | pass→pass | 16,575 | 23,875 | +44% | 1 | 1 | 0% | 3,330 | 9,399 | +182% | 0 | 0 | — |
case-01 | fail→fail | 23,438 | 34,816 | +49% | 1 | 1 | 0% | 4,142 | 4,663 | +13% | 0 | 0 | — |
case-02 | fail→fail | 36,545 | 5,824 | -84% | 1 | 1 | 0% | 6,250 | 4,556 | -27% | 0 | 0 | — |
case-03 | fail→fail | 20,822 | 6,284 | -70% | 1 | 1 | 0% | 3,717 | 4,552 | +22% | 0 | 0 | — |
case-06 | pass→pass | 16,269 | 15,579 | -4% | 1 | 1 | 0% | 3,455 | 6,627 | +92% | 0 | 0 | — |
case-07 | fail→pass | 10,584 | 4,562 | -57% | 1 | 1 | 0% | 1,670 | 4,959 | +197% | 0 | 0 | — |
case-08 | fail→fail | 18,126 | 2,084 | -89% | 1 | 1 | 0% | 1,115 | 4,486 | +302% | 0 | 0 | — |
case-09 | fail→pass | 11,623 | 2,650 | -77% | 1 | 1 | 0% | 1,783 | 4,691 | +163% | 0 | 0 | — |
case-22 | fail→pass | 10,205 | 2,527 | -75% | 1 | 1 | 0% | 1,592 | 4,553 | +186% | 0 | 0 | — |
case-10 | fail→pass | 6,672 | 3,511 | -47% | 1 | 1 | 0% | 1,065 | 4,759 | +347% | 0 | 0 | — |
case-11 | fail→pass | 13,797 | 6,076 | -56% | 1 | 1 | 0% | 2,424 | 5,212 | +115% | 0 | 0 | — |
case-12 | pass→pass | 12,554 | 9,297 | -26% | 1 | 1 | 0% | 2,190 | 5,644 | +158% | 0 | 0 | — |
case-13 | pass→pass | 9,891 | 5,578 | -44% | 1 | 1 | 0% | 1,591 | 5,046 | +217% | 0 | 0 | — |
case-14 | pass→pass | 9,687 | 4,632 | -52% | 1 | 1 | 0% | 1,610 | 4,942 | +207% | 0 | 0 | — |
case-15 | pass→pass | 13,204 | 7,140 | -46% | 1 | 1 | 0% | 2,131 | 5,373 | +152% | 0 | 0 | — |
case-16 | pass→pass | 11,243 | 8,211 | -27% | 1 | 1 | 0% | 1,888 | 5,533 | +193% | 0 | 0 | — |
case-17 | pass→pass | 7,133 | 4,811 | -33% | 1 | 1 | 0% | 1,143 | 5,025 | +340% | 0 | 0 | — |
case-18 | pass→pass | 10,469 | 6,328 | -40% | 1 | 1 | 0% | 1,833 | 5,243 | +186% | 0 | 0 | — |
case-19 | fail→pass | 13,372 | 3,218 | -76% | 1 | 1 | 0% | 2,055 | 4,692 | +128% | 0 | 0 | — |
case-20 | fail→pass | 4,453 | 2,026 | -55% | 1 | 1 | 0% | 708 | 4,500 | +536% | 0 | 0 | — |
case-21 | pass→pass | 10,495 | 3,678 | -65% | 1 | 1 | 0% | 1,581 | 4,772 | +202% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 18 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 18 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.