Skip to content

feat: add modernise-apps skill - #2

Merged
kabaros merged 10 commits into
mainfrom
modernise-skill
Oct 15, 2026
Merged

kabaros merged 10 commits into
mainfrom
modernise-skill

Conversation

@kabaros

@kabaros kabaros commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

implements https://dhis2.atlassian.net/browse/LIBS-866

Built with Claude, guided and tested by @kabaros

Adds a new modernise-apps skill for bringing existing DHIS2 apps up to date, covering six things an app can need any combination of, or none:

  • Yarn → pnpm — bumps cli-app-scripts, converts the lockfile, and fixes the phantom-dependency issues Yarn 1's flat hoisting used to hide.
  • @dhis2/cli-style → shared configs — replaces d2-style with the new @dhis2/config-* packages (eslint, prettier, stylelint, ls-lint, commitlint — whichever the app already had configured) and moves git hooks to native husky/lint-staged.
  • Platform library bumps — updates @dhis2/ui, @dhis2/app-runtime, and @dhis2/d2-i18n. Non-breaking (current major) by default for each; if latest would cross a major for any of them, that's treated as an explicit decision rather than taken silently.
    • Upgrading @dhis2/multi-calendar-dates/@js-temporal/polyfill is out of scope here and has its own skill, multi-calendar-dates-upgrade (feat: add calendar-upgrade skill #4). This skill points to it when an app uses either.
  • CI modernisation — replaces bespoke GitHub Actions workflows with the shared dhis2/workflows-platform reusable workflows wherever one exists, and bumps outdated actions and the Node version in whatever stays custom. Picks the ref from the app's state: @v2 (the default) for pnpm apps off cli-style, the pnpm branch for pnpm apps still on cli-style, and @v1 for yarn apps. A yarn app that's off cli-style gets a custom commitlint step, since @v1's commit linting depends on cli-style.
  • App Hub continuous delivery — wires the app to workflows-platform's shared release.yml so releases publish to apps.dhis2.org automatically on every conventional-commit push, replacing the manual version-bump-and-draft-release flow. Offered when missing rather than added unprompted, since it needs an App Hub app ID and a DHIS2_BOT_APPHUB_TOKEN secret from the user.
  • README refresh — a pnpm badge alongside existing badges, an app description pulled from the App Hub when the app is published there, and the scaffold's verbose "Available Scripts" section collapsed into a concise "Get Started".

Each task ends with an install/build/lint pass, plus an optional opt-in e2e sanity check that boots the app against a real DHIS2 server and confirms it still renders after login.

Includes 10 evals (scaffolded + real-app fixtures, individual and combined, plus dedicated CI-migration fixtures) comparing with-skill vs. baseline agent runs.

Test plan

  • npx skills add /path/to/ai-devtools --skill modernise-apps -y against a real Yarn/cli-style app and confirm all tasks complete cleanly
  • Eval suite passes (src/skills/modernise-apps-workspace)

@kabaros
kabaros marked this pull request as draft September 14, 2026 08:42
Covers two independent modernisation tasks for existing DHIS2 apps:
migrating the package manager from Yarn to pnpm, and moving off
@dhis2/cli-style onto the shared @dhis2/config-* packages (eslint,
prettier, stylelint, ls-lint, commitlint -- whichever the app already
had configured), plus a non-breaking @dhis2/ui version bump. Removes
@dhis2/cli-style only once every config it was proxying has a real
replacement.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kabaros kabaros changed the title feat: add modernise repo skill feat: add modernise-apps skill Sep 16, 2026
@kabaros
kabaros marked this pull request as ready for review September 18, 2026 11:27
…esh step

Adds a third independent modernisation task -- moving bespoke GitHub
Actions workflows onto dhis2/workflows-platform reusable workflows and
bumping outdated actions/Node versions -- documented in the new
references/ci-migration.md, including the known gap where
lint.yml/lint-commits.yml/lint-pr-title.yml internally require
@dhis2/cli-style and the pnpm-no-cli-style branch that fixes it.

Also adds a README-refresh step to the pnpm migration (pnpm badge, an
App Hub-sourced app description matched by d2.config.js's id, and a
concise "Get Started" section replacing the scaffold's verbose
per-script "Available Scripts" layout), extends the platform-library
bump step to cover @dhis2/app-runtime and @dhis2/d2-i18n alongside
@dhis2/ui (non-breaking by default, with an explicit choice offered
if latest would cross a major), and extends the eval suite with
dedicated CI-migration fixtures (a real app-management-app snapshot
and a synthetic one to avoid the confound of a baseline agent finding
an already-fixed real repo to copy).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
kabaros and others added 5 commits September 22, 2026 13:36
…I ref guidance

Extracts platform-library version bumps (@dhis2/ui, @dhis2/app-runtime,
@dhis2/d2-i18n, @dhis2/multi-calendar-dates) out of style-configs-migration.md
into its own references/platform-library-bumps.md -- it's an orthogonal
concern, not something that belongs in the cli-style migration doc.

The @dhis2/multi-calendar-dates step now covers useDatePicker and the
period-calculation helpers (getFixedPeriodByDate, getAdjacentFixedPeriods,
etc.), not just getNowInCalendar -- dhis2/multi-calendar-dates#102 touched
all of them. Adds guidance to write a before/after regression test across
gregory/ethiopic/nepali before bumping, as a real committed test if the app
has a test runner or a temporary standalone script otherwise. Also reflects
that 3.x is now published as latest, not alpha-only.

Corrects the dhis2/workflows-platform CI guidance: @v1 is yarn-only and its
lint/lint-commits/lint-pr-title jobs require @dhis2/cli-style internally;
the pnpm branch is pnpm-native but keeps that cli-style coupling; @v2 is
pnpm-native without it. Which ref to use depends on the app's pnpm and
cli-style status independently, not just "point at @pnpm".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… @dhis2/config-* packages

@dhis2/config-eslint/prettier/stylelint/lslint/commitlint are now on the
latest dist-tag, not alpha-only -- drop the alpha-tag guidance. Package.json
examples resolve the actual current version via npm view/dist-tags rather
than pinning the literal "latest" tag or a hardcoded version number.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use @v2 for pnpm apps off cli-style, keep the pnpm branch for pnpm apps
still on cli-style and @v1 for yarn apps. Bump custom-job Node to 24.

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

Use jest snapshot tests captured before the bump and compared with --ci
after. Document temporarily patching @js-temporal/polyfill@0.4.3 so an
Ethiopic baseline can be captured on Node 24 / CLDR 48.

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

Add a platform-library-bumps step for apps that import the polyfill
themselves (often pinned to 0.4.3 via resolutions): snapshot-test every
direct usage across gregory/ethiopian/nepali before upgrading, move to
0.5.1 as a real dependency, and apply the CLDR 48 Ethiopic era patch by
default with an offer to revert it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kabaros and others added 2 commits October 15, 2026 14:45
…2.0 helpers

Target @dhis2/multi-calendar-dates 3.2.0 and migrate hand-rolled
calendar date code (formatting, month/day arithmetic, days in a month)
to formatCalendarDate, addToCalendarDate and getDaysInMonth, deleting
the app's own helpers.

Add Step 4: check the production build's source maps for
multi-calendar-dates and @js-temporal/polyfill copies, flag anything
besides 3.x's vendored Temporal, and try to reduce extra copies to
0.5.1 (with the Ethiopic patch if Ethiopic matters).

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

Upgrading @dhis2/multi-calendar-dates and @js-temporal/polyfill is a
behavioural migration (breaking API, regression snapshots, Ethiopic era
patch, bundle checks), not tooling modernisation. It moves to the new
multi-calendar-dates-upgrade skill; this skill keeps the @dhis2/ui,
app-runtime and d2-i18n bump and points to the new skill instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kabaros kabaros mentioned this pull request Oct 15, 2026
2 tasks
@kabaros
kabaros merged commit 4124dfe into main Oct 15, 2026
6 checks passed
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.

2 participants