coding-guidance-qt — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited coding-guidance-qt (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill adds portable Qt implementation, refactoring, and review guidance for Qt C++ code with a QWidget desktop focus. Widget, dialog, model/view, Designer, and desktop-UX guidance here is specific to Widgets work; broader QObject, threading, and build guidance also applies to non-UI Qt C++ code.
This skill provides portable Qt engineering principles. Compose with:
security (threat modeling)
ui-design-guidance (stronger design and UX work), project-core-dev (repo-specific build/test commands), project-platform-diagnose (environment-sensitive diagnosis)
Use this as the default principle skill for Qt code. Reach for coding-guidance-cpp only when the task is mostly non-Qt C++ or needs deeper general C++ design judgment than Qt-specific guidance.
Open bundled references only when the task actually needs them:
for CMake, generated-code, or Qt5/Qt6 compatibility work
for diagnosis-heavy tasks
for .ui files, Qt Widgets Designer, uic, or generated ui_*.h code
for layout, dialog, panel, and desktop-UX work
for QAbstractItemModel, roles, resets, selections, and model/view contract work
Stay in the main skill when the task is broad Qt implementation or review and no single failure mode dominates yet.
eventing, object lifetime, or Qt build tooling
guidance here when it genuinely applies, and rely on a QML/Qt Quick-specific skill or repo guidance for declarative UI architecture, bindings, and scene graph concerns
needed
.ui forms, tests,and build files before editing.
affinity, layouts, and tests when the request is partially specified. Ask only when multiple plausible Qt designs would change semantics.
layout behavior, model contracts, and UI-thread rules explicit.
modern typed connect usage, minimal GUI-thread work, and narrow seams between widgets and domain logic.
Qt Test for widget, signal-slot, and model behavior; GoogleTest for pure non-Qt domain logic. Do not mix both in the same seam without a reason. If the repo already uses Qt Test, use QSignalSpy-style assertions for signal contracts.
smoke path the repo supports. If the change touches Qt5/Qt6 compatibility, validate each supported build variant.
Use this instead of the default implementation workflow when the task is primarily cleanup or restructuring:
affinity, layout behavior, and model or binding contracts.
duplicated object wiring, and layout hacks one step at a time.
coverage first when behavior is unclear.
easier to reason about.
When reviewing (not implementing), skip the implementation workflow and use this instead:
Critical > Important >Suggestion.
connection lifetime mistakes, GUI-thread blocking, model/view contract violations, layout breakage, Qt5/Qt6 build regressions, resource-path and platform assumptions, and missing tests.
for signal issues, thread affinity for cross-thread issues, begin/end and reset boundaries for model issues, and the visible interaction path for layout or .ui regressions.
sections.
QObject ownership, parent-child lifetime, and thread affinity as corecontracts, not cleanup details
QApplication; create it beforeany widget, QPixmap, QIcon, or other GUI object
QObject subclasses; keep lifetime and ownership explicitdeleteLater() rather than immediate deletion when an object may still beparticipating in the event loop
not outlive the receiver
connect syntax over string-based SIGNAL and SLOTmacros unless the repo is constrained by old APIs
work
structural changes with the correct begin/end calls
setGeometry() when a real layout should ownsizing and positioning
enough to test behavior without full UI setup
wide controller classes
or model logic
them; do not introduce needless conversions at every boundary
defaults.
signal wiring easy to find
QMainWindow code, separate central-widget setup, action/menu setup, andsignal wiring instead of burying everything in one constructor
plain C++ domain logic owns rules and state transitions; Qt-facing models or adapters translate domain state for the UI; widgets own presentation, local interaction, and signal wiring
simpler than stuffing decisions into slots
child for the same lifetime
obvious; use QPointer or a clearer ownership boundary when deletion can race with callbacks or queued work
construction site
the connection or tie the connection to a context object
not vague implementation detail
need a stable contract
bindings, or other observers
signature compatibility, and that moc ran after the last Q_OBJECT change
routing are local
contract-heavy model work.
and reset behavior are compatibility boundaries
be tested and debugged directly
blobs
over burying logic in widget callbacks
design smells; this skill still defaults to the QWidget side
references/qt-model-view-checklist.md
instead of manual sizing or geometry hacks
QFormLayout, QSplitter, QDockWidget, QGroupBox, andQDialogButtonBox deliberately where their semantics match the screen
provides them, instead of hard-coding one platform's desktop conventions
QSizePolicy, stretch factors, margins, spacing,accessibility names, and keyboard flow
references/qt-layouts-and-desktop-ux.md
are marshaled back
assume the default connection behavior is always correct
event handling model all remain valid there
workers, and asynchronous replies
for queued callbacks and pending replies
.ui guidance is Widgets-specific.changes that affect generated code are not trivial refactors
ui_*.h files; change the .ui form, the wrapperwidget, or the build inputs that generate them
.ui XML, form settings, customwidget declarations, and generated includes as part of the source contract
rather than hard-coded Qt5:: or Qt6:: targets
pattern, prefer Qt's own helper commands such as qt_standard_project_setup() and qt_add_executable() over ad hoc target setup
variant instead of assuming dynamic find_package is enough
assumptions
tr() by default; do not introduce raw UI text that bypasses extraction
rather than incidental
maintained alternative exists; if a touched API is obsolete, treat migration pressure as part of the design review
instead of spreading Qt types everywhere without benefit
references/qt-build-compatibility.md
edges, not just private helper functions
dependent visual assertions
tests that do not compile are incomplete
qDebug() and qWarning() deliberately for widget size, object class,state transitions, and connection-path diagnostics
lifetime inspection over guessing
references/qt-debugging-checklist.md
Q_OBJECT, stale moc output, or signal/slot signature mismatchdeleteLater() timingui_*.h instead of the underlying .ui or wrapper codeQSizePolicy, stretch, spacing, or minimumsize changes
lifetime or signature fact that breaks the path
the illegal GUI or parenting access occurs
data() role,missing begin*/end*, invalid index handling, reset misuse, or stale selection/persistent-index assumptions
.ui bugs, name the affected screen path and the geometry orform-setting change that causes the regression
input that is stale, missing, or version-skewed
Use these when the right choice is not obvious:
die, redesign the boundary before adding more behavior.
different thread, make that hop explicit and local.
or reset behavior, treat it as a compatibility boundary rather than a local cleanup.
magic sizes, stop and check whether the right layout type, size policy, or stretch factor would solve it cleanly.
do not hard-code one target family or test only one build.
persistence, and orchestration together, introduce a presenter/controller seam before adding more slots.
rethink the design before polishing the code.
signals and slots, widgets vs. QML, testing, or Qt version support, follow them unless they create a correctness problem.
problem. When narrowness conflicts with correctness or lifecycle safety, prefer correctness. When it conflicts with style alone, prefer narrowness unless the task is explicitly a cleanup.
adjacent issue while you are in the file.
model-shaping steps, or dialog flows is a pattern; before extracting, check whether a small helper, adapter, presenter, or model object is the simpler move.
identity, or Qt containers, keep it as plain testable C++ instead of forcing Qt into the core domain.
A change is done when:
out with a concrete reason
validation path
verified when touched
Critical and Important severity are addressedReview this Qt dialog and layout refactor for ownership, size-policy, and accessibility regressionsRefactor this Qt widget controller so business logic moves out of slots and the UI stays responsiveFix this Qt CMake setup so the repo can build cleanly against both Qt5 and Qt6~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.