add-slice
Skill0 starsChanged 20 days agoMITView on GitHub
Scaffolds a new vertical slice in the <app> desktop tree — domain, application, adapters, presentation and tests — with the CMake targets, the ports and the composition-root wiring that keep the layer law intact.
In this repository24 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- add-linux-packagingSkill
- add-viewSkill
- claim-checkSkill
- clean-room-rebuildSkill
- corpus-retrievalSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- graphifySkill
- grillingSkill
- learnSkill
- planSkill
- platform-portSkill
- researchSkill
- reviewSkill
- shipSkill
- specSkill
- tddSkill
- verified-statusSkill
- visual-reviewSkill
- qt-best-practicesSkill
- qt-portSkill
- qt-reviewSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Distinctive: line 19
Do NOT activate this skill when:
- Distinctive: line 44
No fabricated paths: every file created must be listed with its real path, and every existing path referenced must exist in the tree.
- Distinctive: line 55
No new third-party dependency without an ADR.
- Very specific: line 57
No step is "done" until cmake --preset dev && cmake --build build and QT_QPA_PLATFORM=offscreen ctest --test-dir build are green.
≈ “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.
Files
<app> add-slice skill
Reusable workflow for adding one vertical slice to
<app>. An agent invokes this skill; the requester supplies the feature, the skill supplies the scaffolding, the layer discipline and the gate ladder.
When to Activate
Activate this skill when the request is a new feature that owns its own domain — a new kind of entity, screen or workflow that will grow: a new "tasks" slice, a new "settings" slice, a new billing slice.
Do NOT activate this skill when:
- The change adds a field, a rule or a screen to an existing slice — that
is a change inside
src/features/<slice>/, not a new slice. - The change is a bug fix (fix it in place, with a red test first).
- The request is a cross-cutting refactor of the composition root.
Core Principles
- Vertical, not horizontal. A slice owns one feature end to end: domain
rules, use cases, adapters and presentation. Nothing about the feature is
scattered across
src/infrastructure/orsrc/app/. - Four layers, four CMake targets.
domain,application,adaptersandpresentation, each with its own target, so a wrong dependency fails at link time. - Ports are consumer-defined. The interface a use case needs lives in
application/, next to the use case; the adapter that satisfies it lives inadapters/and may depend on the SDK, the store or the filesystem. - The composition root wires, it does not decide.
src/app/main.cppconstructs the adapters, hands them to the use cases and opens the window. - Mirror the
notesslice. The template already ships a worked example; copy its shape rather than inventing a new one.
Rules
- No fabricated paths: every file created must be listed with its real path, and every existing path referenced must exist in the tree.
- The domain and the application carry no GUI, network or SQL types; a
QWidget,QNetworkAccessManagerorQSqlQueryin those layers is a defect, not a style choice. - Each layer calls
desktop_assert_no_forbidden_include()with its forbidden set, exactly assrc/features/notes/CMakeLists.txtdoes. - The slice ships with at least one test per layer: a domain test, an
application test against the fakes in
tests/_shared/fakes/, a presentation test on the view model, and an architecture test if the slice introduces a new include rule. - No new third-party dependency without an ADR; the Qt modules already enabled are enough for a slice.
- No step is "done" until
cmake --preset dev && cmake --build buildandQT_QPA_PLATFORM=offscreen ctest --test-dir buildare green; report the real output.
Research References
| Claim | Source | Year | Link |
Per-target target_link_libraries makes a dependency violation fail at link time | CMake documentation | 2025 | https://cmake.org/cmake/help/latest/command/target_link_libraries.html |
| A consumer-owned interface is the hexagonal/ports-and-adapters rule the layer law encodes | PLAYBOOK_DESKTOP_QT.md §3 | - | PLAYBOOK_DESKTOP_QT.md |
| Qt Test suites are registered per target with the offscreen environment applied | cmake/qt.cmake | - | cmake/qt.cmake |
| The worked slice to mirror | src/features/notes/ | - | src/features/notes/CMakeLists.txt |
Output Format
Slice: <name> — path: src/features/<name>/
Created:
domain/ <files> — <what they hold>
application/ <files> — <use cases, ports>
adapters/ <files> — <port implementations>
presentation/ <files> — <view model, item model>
tests/ <files> — <cases>
CMake targets: <target> → <links>
Wiring: <what src/app/main.cpp now constructs>
Gates:
cmake --preset dev → <result>
cmake --build build → <result>
QT_QPA_PLATFORM=offscreen ctest --test-dir build → <result>
Open: <anything left for the next slice>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
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.

