agentleFS
Facta-DevFacta-Dev/beautifulqt/.claude/skills/platform-port/SKILL.md

platform-port

Skill0 starsChanged 20 days agoMITView on GitHub

Ports an OS-specific capability into <app>'s src/platform: a new keystore backend, app paths, single instance or notification, with the portable interface, the per-OS implementation and the boundary test.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT activate this skill when:

    line 21
  2. Distinctive:

    Fail closed: When a capability is unavailable (no keystore, no notification daemon), the implementation reports the failure to the caller …

    line 38
  3. Distinctive:

    No fabricated platform API: verify the call against the installed Qt version and the target OS documentation before using it.

    line 49
  4. Very specific:

    No OS header outside src/platform/, and no Q_OS_* branch in a feature, in the ui-kit or in the composition root.

    line 52
  5. Distinctive:

    Every implementation has a test: the interface against the fakes, the implementation behind the platform abstraction with whatever the OS …

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

<app> platform-port skill

Reusable workflow for adding an operating-system capability to <app> without leaking it into the portable layers. An agent invokes this skill; the requester supplies the capability, the skill supplies the interface, the per-OS implementation and the boundary check.

When to Activate

Activate this skill when the request needs a decision only the operating system can make: the credential store, the application data directory, the single-instance lock, the system tray, the notification centre, the file dialog, the deep-link handler, or an OS-version behaviour.

Do NOT activate this skill when:

  • The behaviour is portable and Qt already provides it (use the Qt API directly, e.g. QStandardPaths).
  • The request is to change what the app does rather than where the OS is consulted.
  • The capability is already behind an interface in src/platform/ — extend that interface instead of adding a second one.

Core Principles

  • One interface, N implementations. The portable code calls a stable interface in src/platform/; each OS provides its own implementation of it. The application never learns which OS it runs on.
  • #ifdef Q_OS_* only in src/platform/. No OS header, no platform branch, no platform-specific type outside that directory — the architecture test under tests/_platform/architecture/ enforces it.
  • Fail closed. When a capability is unavailable (no keystore, no notification daemon), the implementation reports the failure to the caller instead of silently degrading to something unsafe.
  • Secrets stay in the OS. The interface handles a credential; it never returns it in plain text to a layer that would log it, and never writes it to QSettings or to a file.
  • One new behaviour at a time. A port is small: interface, one implementation, one test, then the next OS.

Rules

  • No fabricated platform API: verify the call against the installed Qt version and the target OS documentation before using it; if it cannot be verified here, say so in the report.
  • No OS header outside src/platform/, and no Q_OS_* branch in a feature, in the ui-kit or in the composition root.
  • The new interface is documented with its failure modes and its thread affinity, and it never blocks the GUI thread.
  • A credential is never logged, never stored in QSettings, never included in an error message, and never written to a crash dump.
  • Every implementation has a test: the interface against the fakes, the implementation behind the platform abstraction with whatever the OS allows in CI.
  • The architecture suite is run after the change and reported.

Research References

ClaimSourceYearLink
The platform directory is the only place allowed to branch on the operating systemPLAYBOOK_DESKTOP_QT.md §3-PLAYBOOK_DESKTOP_QT.md
The layer law is asserted by an executable test over the source treetests/_platform/architecture/-tests/_platform/architecture/
QStandardPaths is the portable location APIQt documentation2025https://doc.qt.io/qt-6/qstandardpaths.html
Secrets belong in the OS credential store, never in the repositoryPLAYBOOK_SECURITY.md-PLAYBOOK_SECURITY.md
The platform CMake target and its per-OS sourcessrc/platform/CMakeLists.txt-src/platform/CMakeLists.txt

Output Format

Capability: <what the OS must provide>
Interface: <path> — <method signatures> — failure modes: <list>
Implementations:
  <os>  <path> — <mechanism> — verified: <how, or "not verifiable here">
Wiring: <what the composition root or the slice now constructs>
Boundary check: <Q_OS_* / OS headers found outside src/platform → none>
Secret handling: <where the credential lives, and where it never goes>
Gates:
  cmake --build build → <result>
  QT_QPA_PLATFORM=offscreen ctest --test-dir build → <result>
Open: <the next OS, if any>

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.