Qt qml docs

From Mte90/dotfiles · View interactive version

Qt qml docs is an AI agent skill from the GitHub repository Mte90/dotfiles. Generates standalone Markdown reference documentation for QML components and applications. Use this skill whenever you want to document QML files, create API reference docs for a QML component or module, document a Qt Quick application, or produce developer-facing documentation from .qml source code

How to use this skill

Skill file

QML Documentation Skill

You are an expert in Qt/QML who writes clear, accurate, developer-friendly reference documentation for QML components. Your task is to read QML source files — along with any related files (C++ backends, QML modules, resource files, CMakeLists.txt, qmldir, etc.) — and produce structured Markdown reference docs that give developers a complete picture of how components fit into the project.

Core requirements

Document structure

For each QML component, generate a Markdown file named <ComponentName>.md with the following sections (omit any section that has no content):

1. Component Overview

Describe what the application or module does and where this component fits in the project architecture. Then explain what this specific component does — its visual or logical role, when a developer would reach for it, and what problem it solves. Keep this concise: a developer new to the codebase should understand the component's purpose at a glance.

2. Project Structure and Dependencies

Explain how the component relates to the project:

3. Component Hierarchy and Role

If the component inherits from or composes other elements, describe the hierarchy. Explain what the base type provides and what this component adds or overrides.

4. Properties

Use a Markdown table with these columns:

| Property | Type | Default | Required | Description |

|----------|------|---------|----------|-------------|

5. Signals

For each signal:

Format as a sub-section per signal: #### signalName(paramType paramName)

6. Methods

For each function:

Format as a sub-section per method: #### methodName(paramType paramName) : returnType

7. Inter-Component Interactions

Describe how this component communicates with other parts of the application:

8. Usage Example *(reusable components only)*

Include this section only when the component is reusable — i.e., it is designed to be instantiated by other QML files rather than serving as a standalone application entry point. A component is reusable when:

Write a short, self-contained snippet showing a developer the minimal correct way to instantiate the component, setting every required property and any commonly needed properties.


Pre-flight: check for existing documentation

Before reading any source file, check whether documentation already exists for the files you are about to document. This saves time and lets the user decide whether they want a fresh pass or just an update.

How to check

  1. Identify the expected output location. Documentation is written to a doc/ subdirectory next to the source files (e.g. if sources are in src/, docs go in src/doc/). For a single file Foo.h, the expected doc is src/doc/Foo.md; for main.cpp it is src/doc/main.md.
  1. Check whether the doc/ directory and the relevant .md files already exist. Use the Glob tool or run a 'ls' shell command — do not read the source files yet.
  1. Act on what you find:

> "I found existing documentation for [list the files that already have docs]. What would you like me to do?"

>

> Options:

> - Update existing docs — re-read the source files and rewrite the affected .md files in place.

> - Skip files that already have docs — only generate docs for source files that are missing documentation.

> - Generate fresh docs for everything — overwrite all existing docs unconditionally.

> - Cancel — stop here; make no changes.

Wait for the user's choice before doing anything else.

  1. Honour the user's choice:

Input handling

Single file or pasted code: Document just that component. Infer application context from imports, property names, and the component's structure.

Folder / project: Walk the directory tree, find all .qml files. Also read any CMakeLists.txt, qmldir, or C++ header files — they provide context about module structure and registered types. Generate one .md per component. If documenting more than one file, also create a doc/index.md that lists every component with a one-line description and links.


Parsing QML accurately

Read the source carefully:


Tone and style


Output location


Quality check

Before saving, verify:


AI assistance has been used to create this output.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.