app-development
Skill1 starsChanged 7 days agoMITView on GitHub
Create, modify, or review MicroTech Apps and Pages in layers/apps, including lifecycle ownership, static routes, typed arguments, subscriptions, and workers. Use for application contracts, not board wiring or display-pipeline internals.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- lubusIN/frappe-skillstheir own version, first seen Nov 4, 2026
- dragnoir/Shopify-agent-skillstheir own version, first seen Feb 1, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- lubusIN/frappe-skills★ 72same name
- dragnoir/Shopify-agent-skills★ 48same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- aesthetic-reviewSkill
- codesizeSkill
- design-contractSkill
- device-operationsSkill
- esp32Skill
- lvgl-integrationSkill
- lvgl-ui-layoutSkill
- motion-interactionSkill
- ui-reviewSkill
- ux-heuristicsSkill
- visual-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
30 rules. About 0 are common, 14 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Read layers/apps/README.md, the target App route table, and the nearest production Page.
- Very specific: line 23
Read app_manager_types.h, app_manager.h, app_ui.h, and the target service's public header before changing interfaces or ownership.
- Distinctive: line 55
Use typed Page ops for new Pages.
- Very specific: line 59
Keep only instance state in Page memory, set memory_size to that state's exact size, keep it within APP_MANAGER_PAGE_STATE_BYTES, and …
- Very specific: line 75
When the App owns icons, author SVG sources, register them in resource_manifest.cmake plus app_image_ids.h, and run idf.py reconfigure (see …
- Very specific: line 78
Use asynchronous navigation from LVGL callbacks (app_ui_request_* or app_manager_navigate_async).
- Very specific: line 82
Add focused host coverage for the changed behavior.
- Very specific: line 91
START receives freshly zeroed storage for exactly memory_size bytes.
- Very specific: line 101
Prefer one file per substantial page with a narrow <app>_internal.h for routes and shared helpers.
- Distinctive: line 104
Create UI only below the Page Screen in MOUNT.
- Distinctive: line 106
Start foreground resources in RESUME, stop them in PAUSE.
- Distinctive: line 110
STOP releases retained START state and does not repeat resources whose PAUSE path already released them.
- Distinctive: line 115
Treat ops context and arguments as callback-scoped.
- Distinctive: line 117
Keep blocking file, audio, parsing, network, and hardware work off the UI worker.
- Distinctive: line 155
Every partial-initialization path unwinds only resources that were actually initialized.
- Very specific: line 183
Check every entry that navigates to the App with app_manager_builtin_has_app() before creating a clickable control.
- Very specific: line 187
If the App owns persisted state, add its reset hook to app.cmake and make its persistence header visible to apps_persistence.c.
- Very specific: line 200
Do not create LVGL objects in START or use lv_screen_active() as a Page root.
- Distinctive: line 201
Do not present unimplemented behavior as an available feature.
- Distinctive: line 204
Do not call LVGL from background workers.
- Distinctive: line 205
Do not apply label APIs to non-label objects.
- Very specific: line 207
Keep required external identifiers readable at their decision surface.
- Distinctive: line 209
Do not create runtime Pages outside the owning App route table.
- Distinctive: line 210
Do not clear a subscription, worker, or service handle after failed cleanup.
- Distinctive: line 211
Do not add another LVGL task, tick source, Screen manager, or direct hardware ownership to an App.
- Very specific: line 213
Do not keep a callback-scoped context, Screen, or Typed Blob pointer beyond its documented lifetime.
- Distinctive: line 216
Do not make a generic "app-static" copy of Page data without naming the owner, the release point and the stale-result policy.
- Very specific: line 218
Do not treat volatile, a cleared pointer or an unverified cleanup acknowledgement as a worker-lifetime barrier.
- Very specific: line 220
Do not modify ESP-IDF, managed_components, or BSP third-party code to hide an application defect.
- Very specific: line 225
Use the tiers in doc/verification.md for commands and scope.
≈ “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
MicroTech App Development
Apply this workflow to built-in applications under layers/apps. Follow
AGENTS.md, doc/verification.md, and doc/code-style.md; verify current
types, contracts, and capacities in the owning headers instead of copying them
from this skill.
Sources of Truth
- Section 12, "Application Development Contract", in
layers/app_manager/README.mdis the authoritative contract for Page ops, context validity, lifecycle ownership, navigation, and arguments. Section 1 of that document andlayers/apps/README.mdadditionally require a background Page to retain only passive state, not an active timer, subscription, input registration, worker, or active service session. - Read
layers/apps/README.md, the target App route table, and the nearest production Page. Prefer Weather as the typed-ops and Typed Blob reference. - Read
app_manager_types.h,app_manager.h,app_ui.h, and the target service's public header before changing interfaces or ownership. - Image assets follow the SVG-first pipeline in references/asset-authoring.md; no committed PNG sources exist.
- Resource lifetime, teardown ordering and stale-async-result handling are in references/application-ownership.md.
- Adaptable typed-ops and worker skeletons are in assets/page-skeletons.md. They show ownership and lifecycle shape, not layout or a shipped implementation.
Framework Facts and Their Consequences
| Framework fact | Application consequence |
Page memory is a fixed arena slot defined by APP_MANAGER_PAGE_STATE_BYTES; exactly memory_size bytes are zeroed when an instance is created | Keep only instance-private data in it, set memory_size = sizeof(page_state), add a compile-time bound, and allocate large or variable payloads separately. |
| A successful STOP releases the instance and its memory; UNMOUNT only removes the mounted Screen | Decide explicitly whether the next MOUNT continues instance state or reinitializes it. Clear every LVGL pointer in UNMOUNT without assuming the arena itself was cleared. A STOP cleanup failure preserves the instance. Back/exit rollback can MOUNT and RESUME that same instance before retrying STOP, so do not irreversibly clear retained argument, selection, or remount-input state while returning failure. |
app_manager_page_context_t and its arguments pointer are callback-scoped | Copy any Typed Blob payload that must outlive NEWINTENT or any other lifecycle callback. Do not retain context, screen or arguments in Page state. |
context->screen exists only while mounted; START and STOP receive NULL | Create UI only in MOUNT under that Screen, and dereference LVGL pointers only while mounted. |
| NEWINTENT is a side channel on an existing instance and fully replaces its intent | Validate and copy new arguments in both mounted and unmounted cases. An absent or invalid replacement clears the retained argument state; refresh immediately only when the Screen exists, otherwise apply the replacement in MOUNT or RESUME. |
Typed ops PAUSE/STOP return esp_err_t; raw handlers report through app_manager_this_page_report_cleanup_error() | Use one cleanup channel per definition. Clear a handle only after its release succeeds so the lifecycle can retry. |
| The route table is immutable and every Page instance is created through an App-owned route | Keep definitions and routes const; use file-local static const unless another translation unit must reference the definition. Do not create runtime Pages, and keep Page IDs unique within the App. |
app_manager_navigate_async() copies its request but borrows the completion context; the completion runs only after successful admission | Do not pass Page arena, callback-stack, or other Page-lifetime storage. Prefer NULL or explicitly owned storage that outlives completion; if admission fails, no callback runs, so release a newly allocated context on that error path. |
The complete contract remains Section 12 of layers/app_manager/README.md; the
public types in app_manager_types.h override this summary.
Workflow
- Classify the change (new App, new Page, existing Page update) and the Page model (static, refresh, session, worker, argument driven); implement only the lifecycle stages its owned resources require.
- Use typed Page ops for new Pages; raw handlers are the compatibility path for existing direct message dispatch.
- Inventory every UI object, timer, subscription, worker, snapshot, argument, and retained handle by acquisition and release stage.
- Keep only instance state in Page memory, set
memory_sizeto that state's exact size, keep it withinAPP_MANAGER_PAGE_STATE_BYTES, and allocate large payloads separately. - Implement MOUNT/UNMOUNT first, then required RESUME/PAUSE, START/STOP, and NEWINTENT behavior. Preserve the first cleanup error and failed handle.
- Bind the immutable definition through an App-owned static route; export an
App descriptor only for a new App. Add its stable ID to
app_manager_ids.hand its ID toMT_APP_CATALOG_IDS; use the standard<app_id>_appdirectory, or updatemt_app_dir_name()for an exception. Define all requiredapp.cmakefields:MT_APP_ID,MT_APP_SOURCES,MT_APP_INCLUDE_DIRS,MT_APP_PRIVATE_REQUIRES,MT_APP_CAPABILITIES,MT_APP_RESOURCE_MANIFEST,MT_APP_REQUIRED,MT_APP_HIDDEN, andMT_APP_RESET_HOOK, using""where a field is intentionally empty. Select it in the intended product manifest; a catalog entry alone does not compile it. KeepMT_APP_HIDDENsynchronized with the descriptor'sAPP_MANAGER_APP_FLAG_HIDDEN. When the App owns icons, author SVG sources, register them inresource_manifest.cmakeplusapp_image_ids.h, and runidf.py reconfigure(see references/asset-authoring.md). - Use asynchronous navigation from LVGL callbacks (
app_ui_request_*orapp_manager_navigate_async); validate Typed Blob version, type, and exact size before decoding withmemcpy. A custom completion can run after Page teardown, so never pass Page arena or a callback stack pointer as its context. - Add focused host coverage for the changed behavior; validation scope
follows the
doc/verification.mdworkflow. - For visible or interaction changes, use
ui-reviewat the affected-page scope. Simulator commands, scenario assertions, and session operation live insim/README.md; layout decisions uselvgl-ui-layout. Pure logic changes with no UI impact do not automatically require a screenshot matrix.
Ownership Rules
- START receives freshly zeroed storage for exactly
memory_sizebytes. Set every nonzero sentinel and initialize every START-acquired resource there. - Page state survives UNMOUNT/remount until successful STOP. A Page with only MOUNT state may reset the whole state in MOUNT; a Page with START state must preserve its declared retained fields and reset or rebuild only mount-local fields. Never rely on arena contents that were not deliberately retained.
- Lifecycle callbacks, including NEWINTENT, run on the UI worker. NEWINTENT validates the replacement intent, copies valid data, and clears any invalid or absent copy instead of retaining the previous argument. It may update its own mounted UI and must not block.
- Prefer one file per substantial page with a narrow
<app>_internal.hfor routes and shared helpers; do not split a cohesive small page just for shape. Register every source explicitly in the App'sapp.cmake. - Create UI only below the Page Screen in MOUNT; destroy it and clear every LVGL pointer in UNMOUNT.
- Start foreground resources in RESUME, stop them in PAUSE; support a compensating RESUME-to-PAUSE before the target becomes stably visible.
- Return cleanup failures from ops PAUSE/STOP (raw handlers report through
app_manager_this_page_report_cleanup_error(); do not mix both paths). - STOP releases retained START state and does not repeat resources whose PAUSE path already released them. Keep valid handles when either release stage fails so a later lifecycle request can retry. If STOP returns an error, preserve the retained argument, selection, and rebuild inputs that a rollback MOUNT/RESUME may need; only final successful STOP may invalidate them.
- Treat ops context and arguments as callback-scoped; copy any payload needed after the callback.
- Keep blocking file, audio, parsing, network, and hardware work off the UI
worker; update UI only through owned snapshots or the UI dispatcher. LVGL
callbacks run on the PSRAM-stacked
lvglworker, so never commit NVS or write/erase internal flash there: queue the one-shot storage work onchore_serviceor the owning service worker (see theesp32skill).
State and Resource Placement
| Data or resource | Owner | Required lifetime | Release or invalidation point |
| LVGL objects, animation targets and Screen-local render cache | Page | MOUNT to UNMOUNT | Delete children through the Page root, then clear every stored LVGL pointer in UNMOUNT. |
| Instance selection, copied arguments, filter/calculation state intended across remount | Page arena | START to successful STOP | Reset only by an explicit policy; never free the arena block. |
| Timer, UI subscription, Page worker and active service session | Page | RESUME to PAUSE | Stop in reverse acquisition order. Attempt independent releases, preserve the first error, and retain only failed resources or resources whose safe release depends on them. |
| Work that must continue while the Page is backgrounded or its App is inactive | Independent service/system owner | According to that service's own lifecycle | Keep only passive copied state or an invalid/idle handle in the Page arena. An App-private worker or session must stop in PAUSE and must not survive the App becoming backgrounded. |
| Large decoded payload, network/file buffer, page worker stack | Page or owning service, allocated outside the arena | Shortest interval that needs it | Keep pointer and size together; release in the stage that acquired it. Never put the allocation in the arena. |
| Data shared by several Pages of one App | App-level owner | App lifetime | Use a deliberate App/service API rather than promoting one Page's instance state to a file-static. |
| Asynchronous completion from a worker or service | Requesting owner plus an identity/generation check | Until completion is consumed or proven stale | Publish into the owner's mailbox; never write through a paused/unmounted Page pointer. |
| Read-only tables and immutable descriptors | Firmware | Whole firmware lifetime | Keep in Flash/.rodata; do not copy into Page state merely for convenience. |
A Page may own a foreground subscription only from RESUME to PAUSE. Only an
EVENT_BUS_DISPATCH_UI handler may assume the Page Screen and visible widgets
exist; an EVENT_BUS_DISPATCH_PUBLISHER handler runs in the publishing task and
must not touch LVGL. When work must continue after PAUSE, complete it
synchronously first or move it to an independent service/system owner whose own
lifecycle handles App inactivity. An App-private worker or session is not such an
owner: it must stop when its last Page pauses. A Page may retain only passive
copied state or an inactive prediction from an independent owner. START/STOP may
allocate and release passive Page state, but it must not preserve an active
timer, subscription, input registration, worker, or service session across a
successful PAUSE. Never use a subscription to keep paused Page LVGL pointers
alive.
Worker and Session Teardown
For an App-owned worker, session or IPC endpoint, use references/application-ownership.md and verify all of these:
- Every partial-initialization path unwinds only resources that were actually initialized; a failed instance is never published as usable. On teardown, continue independent releases after an error and preserve the first error.
- Teardown closes ingress before stopping producers, drains or releases queued payloads, waits for callbacks or workers to acknowledge exit, and only then frees their storage. Still attempt independent cleanup after one release fails; retain only the failed resource and any resource that cannot be safely released without it. Return the first cleanup error. Do not synchronously join a task from its own callback.
- Allocations, I/O and waits happen outside scheduler locks. Validate the instance identity again after reacquiring a lock.
- Late completions carry an instance/generation identity and are discarded or delivered as a copied result without dereferencing Page memory.
- A release failure leaves the handle and ownership evidence intact for a later PAUSE/STOP retry. Do not claim that grouping fields into one struct, deleting a static reservation or freeing an idle singleton proves peak-memory recovery; state the measured time interval and assumptions.
Optional Apps and Entry Closure
Apps are not all compiled into every product. A product manifest
(products/<product>/product.cmake) selects a subset of app_catalog.cmake;
required Apps are Home, Menu and Settings. When adding or reviewing an optional
App:
- Declare
MT_APP_REQUIRED FALSEin itsapp.cmakeand list every required board capability inMT_APP_CAPABILITIES; a product that lacks the capability must not select the App. - Check every entry that navigates to the App with
app_manager_builtin_has_app()before creating a clickable control. Never leave a Home card, Settings row or storage shortcut that navigates to an App absent from the build. - If the App owns persisted state, add its reset hook to
app.cmakeand make its persistence header visible toapps_persistence.c; the shared factory-reset path invokes the selected hooks generated from the product. - A hidden App (
APP_MANAGER_APP_FLAG_HIDDEN) can still be optional; the flag only removes it from the launcher and recent-task surfaces, not from the build. KeepMT_APP_HIDDENinapp.cmakesynchronized with the descriptor flag; repository configuration tests enforce that agreement. - Cover both the selected and unselected composition in host tests. A minimal
product fixture (
products/minimal) builds only the sharedcommonlayer plus Home, Menu and Settings; it must not link any other App.
Prohibited Patterns
- Do not create LVGL objects in START or use
lv_screen_active()as a Page root. - Do not present unimplemented behavior as an available feature. Explain a disabled control or unavailable service when the reason helps the user act; avoid placeholder feature announcements unrelated to the task.
- Do not call LVGL from background workers; use the UI dispatcher or snapshots.
- Do not apply label APIs to non-label objects; a button caption is its child label.
- Keep required external identifiers readable at their decision surface;
text-treatment choices live in
lvgl-ui-layout. - Do not create runtime Pages outside the owning App route table.
- Do not clear a subscription, worker, or service handle after failed cleanup.
- Do not add another LVGL task, tick source, Screen manager, or direct hardware ownership to an App.
- Do not keep a callback-scoped
context, Screen, or Typed Blob pointer beyond its documented lifetime. Routeuser_datamay be retained only when its immutable storage covers the firmware lifetime and its ownership is explicit. - Do not make a generic "app-static" copy of Page data without naming the owner, the release point and the stale-result policy.
- Do not treat
volatile, a cleared pointer or an unverified cleanup acknowledgement as a worker-lifetime barrier. - Do not modify ESP-IDF,
managed_components, or BSP third-party code to hide an application defect.
App-Focused Verification
Use the tiers in doc/verification.md for commands and scope. Before handing off, record
which of these App-local checks were completed and which remain unverified:
- App IDs, catalog membership, product selection, and manifest hidden state are
wired; every route, Page ID and
root_page_idresolves to an immutable definition; optional-App entries are guarded byapp_manager_builtin_has_app(). - Definitions and routes are file-local
static constunless referenced across translation units, in which case the definition is exportedconstand declaredextern. memory_size == sizeof(page_state) <= APP_MANAGER_PAGE_STATE_BYTES, and any separately allocated payload has one acquisition path, a size bound and a release path.- MOUNT creates UI only under
context->screen; UNMOUNT clears every stored LVGL pointer and does not clear instance data that must survive remount. - Each timer, subscription, worker and session has a symmetric release path;
cleanup attempts independent releases, returns the first cleanup error and
retains only failed resources or resources whose safe release depends on them.
A Page-owned
EVENT_BUS_DISPATCH_PUBLISHERcallback either cannot access Page storage or is drained synchronously before teardown. - A background Page and background App retain no active timer, subscription, input registration, worker, or service session. Work that survives App inactivity belongs to an independent service/system owner.
- NEWINTENT validates version, type and exact payload size, copies a valid replacement, clears invalid or absent intent, and behaves correctly both while mounted and while unmounted.
- Background completions carry generation/identity checks; stale results cannot
dereference Page memory or update a different instance. Async navigation
completion never receives Page arena or callback-stack storage as
context. - Optional-App composition was checked with the relevant product selection, and a hidden App was not mistaken for an unbuilt App.
- Visible changes followed
ui-reviewandlvgl-ui-layout; pure logic changes used the affected host suite without adding a screenshot matrix.
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.

