Qt logo next to a pixel art creature on a background of glowing cubes.

Qt’s New Agent Skills in Action with Claude Code

By

This year, I’ve been diving into Anthropic’s Claude Code and I’m amazed at how capable it is at both understanding existing code and writing new code. Being a Qt application developer, when I heard some new Qt skills were released to augment the out-of-the-box Claude Code experience, of course I had to take them for a spin. 

Skills (which deprecate custom commands) in Claude Code are prepackaged functionality that can be invoked at any time (either by the user via slash commands or automatically). This first incarnation of Qt agent skills comes in three categories: documentation, review, and QML coding. Both the documentation and review skills come in two flavors (QML and C++) making a total of five.

Slash CommandSkill Description
/qt-cpp-docsGenerates one .md (Markdown) file per .cpp/.h file pair
/qt-qml-docsGenerates one .md (Markdown) file per .qml file
/qt-cpp-reviewRuns static analysis (linter) on one or more .cpp/.h file pairs
/qt-qml-reviewRuns static analysis (linter) on one or more .qml files
/qt-qmlImproves the way QML code is generated

Installation

Installing the Qt agent skills into Claude Code is a breeze since they’re already in the plugin marketplace. A call to /plugins followed by /reload-plugins does the trick. The plugin is called qt-development-skills.

Discover Plugins

If you type /qt at the prompt, Claude Code should show the available slash commands.

/qt prompt

If instead you get No commands match “/qt” you probably forgot to run /reload-plugins.

Prompt no commands

Invoking the Skills

There are two ways to invoke the skills: 

1. The first way is to manually call the skill’s slash command from the Claude Code prompt. For example, to invoke the QML coding skill, type /qt-qml.

Skills slash command

Calling the slash command is probably the best way to invoke a skill because it is deterministic i.e. guaranteed to load the skill’s SKILL.md into context.

2. The other way is to let Claude automatically load the skill when it thinks it’s necessary. The problem with this approach is that the skill may or may not load; however, this nondeterministic behavior can be overcome by adding a line to CLAUDE.md such as 

invoke /qt-qml before any .qml file is written to 

Whichever method you choose, Claude Code will print Successfully loaded skill to let you know that that the skill was indeed loaded into context, for example:

Claude skill

Documentation Skills

Both the /qt-cpp-docs and /qt-qml-docs skills can either be run on a single source file (by supplying an argument)

 /qt-cpp-docs and /qt-qml-docs skills prompt

or on all source files in the project (with no arguments).

 /qt-cpp-docs and /qt-qml-docs skills

In either case, the skill should create a doc folder (if it doesn’t already exist) and populate it with one .md file corresponding to each source file. The skill does not modify the source code at all (as would be the case when using Doxygen).

This is what the top of an output .md file looks like in Chrome with the Markdown Reader extension.

Top of an output .md file

According to SKILL.md, the documentation skills are “developer-friendly” i.e. intended for humans to read; however, one could feed the output .md files to Claude Code as well for additional context. 

If you were to ask Claude Code to document a file without Qt agent skills, it will simply add // comments to the source files. I suspect .md files were chosen to keep documentation separate from source code.

Review Skills

Both the /qt-cpp-review and /qt-qml-review skills require Python to be installed.

Like the documentation skills, the review skills can either be run on a single source file (by supplying an argument)

Skills can either be run on a single source file

or on all source files in the project (with no arguments).

All source files in the project (with no arguments).

The output is a list of recommendations. Below is an example recommendation denoted L-001.

Output is a list of recommendations

Since Claude Code can write to files, you can take it a step further and apply all the recommendations,

Apply all the recommendations

just one,

Apply one recommendation

or a subset specified as a list.

Recommend subset specified as a list

Under the hood, the review skills first run a quick deterministic Python script followed by a more lengthy deep analysis consisting of six subagents, the list of which depends on whether we’re reviewing C++ or QML.

C++ SubagentQML Subagent
Model ContractsBindings & Properties
Ownership & LifecycleLayout & Anchoring
Thread SafetyComponent Loading & Lifecycle
API, Naming & C++ CorrectnessListView & Delegate Correctness
Error Handling & ValidationStates, Transitions & Structure
Performance & Code QualityPerformance & Code Quality

For the details of what each subagent checks, please see SKILL.md for C++ or QML.

QML Coding Skill

The /qt-qml skill improves the QML code that Claude Code generates.

To be sure the improvements will be made, explicitly invoke the skill.

Explicitly invoke the skill

Below is a list of the improvements provided by the skill.

CategoryDescription
Importsversion-free imports (Qt 6), style-specific control imports, unnecessary import removal
Controls1prefer Qt Quick Controls over building equivalent UI controls from atomic primitives
Component loadinguse Loader for conditional UI
Property bindingsdeclarative over imperative, circular dependency prevention, binding preservation
Layoutsanchors vs Layout.* conflicts, sizing discipline inside layouts, positioner selection
ListView and delegatesrequired property for roles, delegate reuse, state management
State managementstates/PropertyChanges patterns, targeted transitions
Animations2off-screen pausing, Animator types, Behavior pitfalls
ImagessourceSize, async loading, error handling
Accessibilityroles, names, keyboard navigation
Singletonspragma Singleton + qmldir requirements
Internationalization3qsTr() wrapping, placeholder conventions
Performance4clipping, opacity, Canvas avoidance, shader and particle management

To prove that the /qt-qml skill is actually doing its job, I asked Claude Code to generate four QML components, each targeting one of the improvements (indicated by superscripts) in the table above. I did this both with and without the /qt-qml skill loaded into context and manually compared the output QML. Standard diff tools cannot be used because code generation is nondeterministic i.e. issuing the same prompt twice will generate different code. Below are the four examples:

Example 1. Controls: Prefer Qt Quick Controls over primitives

Issuing the following prompt

Create QML button

should generate a file called Button.qml which renders as follows.

Button.qml

With /qt-qml QtQuick.Controls is imported and the component derives from Button.

/qt-qml QtQuick.Controls

Without /qt-qml the component derives from Item (a QML primitive).

Without /qt-qml the component derives from Item

QtQuick controls are typically more optimized than an implementation using primitives such as Item and Rectangle.

Example 2. Animations: off-screen pausing

Issuing the following prompt

Issuing the following prompt

should generate a file called PulsingRectangle.qml which renders as follows (but animated).

PulsingRectangle.qml

With /qt-qml the line running: root.visible stops the animation when the component is not shown on screen.

root.visible stops the animation when the component is not shown on screen

Without /qt-qml the running property is bound to a root property which does not guarantee stopping the animation when invisible.

root.visible stops the animation when the component is not shown on screen

Binding running to root.visible saves valuable CPU cycles by only running the animation when the component is visible.

Example 3. Internationalization: qsTr() wrapping

Issuing the following prompt

Internationalization: qsTr() wrapping

should generate a file called Hello.qml which renders as follows.

Generate a file called Hello.qml

With /qt-qml the string is wrapped in qsTr() for language translation.

With /qt-qml the string is wrapped in qsTr() for language translation

Without /qt-qml the string is not wrapped in qsTr().

Without /qt-qml the string is not wrapped in qsTr()

 

If Claude Code were to generate a lot of QML without wrapping strings in qsTr(), it would take extra effort to get them all wrapped.

Example 4. Performance: Canvas avoidance

Issuing the following prompt

Prompt: create a QML analog clock component

should generate a file called AnalogClock.qml which renders as follows.

 AnalogClock.qml

With /qt-qml the tick marks are rendered with a Rectangle in a Repeater.

 Rectangle in a Repeater

Without /qt-qml the tick marks are rendered in a Canvas.

Without /qt-qml the tick marks are rendered in a Canvas

Using primitives like Rectangle (when possible) will usually perform better than Canvas, which runs imperative JavaScript each time it needs to paint.

Conclusion

Qt’s new agent skills are a great example of how domain-specific expertise can make AI coding tools even more effective. While Claude Code is already impressive on its own, these skills help it better understand Qt best practices, generate higher-quality QML, provide more relevant code reviews, and produce useful documentation with less prompting. 

If you’re already using Claude Code for Qt development, these skills are worth adding to your workflow. You’ll get higher-quality QML by default, faster reviews that catch real issues, and documentation that actually reflects how your codebase works all without having to steer the model at every step. 

If AI-assisted software development is on your mind, I invite you to read our technical series How to Make AI Code Your Way. Start here: Part 1: Teach Claude Code Your Project-Specific Skills.