Skip to content

feat(skill-dhis2-plugins): add skill for building DHIS2 plugins - #5

Draft
kabaros wants to merge 6 commits into
mainfrom
feat/plugin-skill
Draft

kabaros wants to merge 6 commits into
mainfrom
feat/plugin-skill

Conversation

@kabaros

@kabaros kabaros commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Why

AI assistants get DHIS2 plugins wrong in predictable ways. They use the outdated reference-repo prop shapes, treat pluginType as meaningful to Capture, pass DHIS2 UIDs instead of plugin aliases to setFieldValue, and add routing or an app shell to plugins. This skill gives them the facts, checked against the host apps' source.

What's in it

src/skills/dhis2-plugins/:

  • SKILL.md: how to choose a plugin type, scaffolding with pnpm create @dhis2/app --template plugin --pluginType <type> (with a manual fallback for older create-app versions), cross-cutting rules (experimental status, DHIS2 40.5+, sandboxing, no routing), and the pluginType convention (CAPTURE_FORM_FIELD, CAPTURE_ENROLLMENT, TRACKER_BULK_DATA_ENTRY, DASHBOARD). It defers to dhis2-apps for general app guidance.
  • references/:
    • form-field.md, enrollment.md, bulk-data-entry.md, dashboard.md: props typed from the host source, value formats, examples, and where the published docs differ.
    • hosting-plugins.md: embedding a plugin with <Plugin>, which props get stripped, typed custom props, and Jest setup.
    • host-configuration.md: the Tracker Plugin Configurator, the capture data store keys, and the Dashboard app selector.
    • develop-and-deploy.md: the mocked-props harness, build, deploy and App Hub.
  • evals/evals.json: five evals, one per plugin type plus hosting a plugin.

No changeset, since skills aren't published to npm.

Version notes

hosting-plugins.md recommends <Plugin<Props>> and relies on automatic Jest alias mapping. Both come from dhis2/app-runtime#1448 and dhis2/app-platform#971, now merged. The skill gives the version thresholds (app-runtime 3.18.0, cli-app-scripts 12.12.0, both released) and keeps workarounds for older versions.

Eval results (iteration 1)

The skill scored 35/36 assertions, against 28/36 for the baseline without it. The eval runs surfaced a wrong claim about <Plugin> accepting arbitrary props, which led to the app-runtime fix.

Related PRs

Part of a set that makes DHIS2 plugins (Capture form field / enrollment / bulk data entry, Dashboard) easier to build, and brings the docs in line with what the host apps actually pass:

🤖 Generated with Claude Code

kabaros and others added 2 commits December 1, 2026 10:04
Covers Capture form field, enrollment and bulk data entry plugins,
Dashboard plugins, and hosting plugins with the app-runtime <Plugin>
component. Prop types are taken from the Capture and Dashboard app
source, with notes where the published docs differ. Documents the
CAPTURE_<KIND> / DASHBOARD pluginType convention, scaffolding with
`pnpm create @dhis2/app --template plugin` (with a manual fallback),
a mocked-props dev harness, and host configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Jest mappings

Prefer the generic <Plugin<Props>> API and automatic Jest alias mapping
from upcoming app-runtime / cli-app-scripts releases, keeping the
workarounds for older versions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kabaros and others added 4 commits December 2, 2026 09:31
…ER_BULK_DATA_ENTRY

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est config

Jest uses the first moduleNameMapper pattern that matches, so an app's
^@/(.*)$ mapping shadowed the CSS mock for aliased imports like
@/App.module.css. Also make the Proxy style mock answer __esModule with
false so default imports get the class-name map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ROLLMENT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p-scripts 12.12.0 versions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant