Build Mule Application
Build the current Mule 4 application using its repository instructions and configured build tools. Default to a validation and package operation. Do not turn a build request into a release.
This skill owns local validation, test execution, reports, packaging, local runtime actions, and
version/commit/tag preparation. Route MUnit authoring, repair, fixtures, mocks, and assertions to
mule-testing when that skill is installed. Route Exchange publishing and Anypoint deployment to
mule-ops and the authenticated Anypoint connector.
1. Establish scope
Distinguish these modes:
| Mode | Actions |
|---|---|
| Validate | Static checks and tests only |
| Package | Validate, test, and create a deployable artifact |
| Release preparation | Explicit version, changelog, commit, tag, and optional push |
If the user says only build, use Package. Version bumps, changelog edits, commits, tags,
local runtime changes and pushing require explicit user scope. Publishing and deployment are
separate Anypoint operations owned by mule-ops.
2. Inspect before changing anything
- Read repository instructions,
pom.xml,mule-artifact.json, build scripts, CI workflows, and relevant changelog or release policy. - Review
git status --shortand preserve unrelated or uncommitted changes. - Confirm required Java, Maven, Mule runtime, and connector versions.
- Identify the project's established validation, test, package, and release commands.
- Check whether the requested build needs network or authenticated artifact repositories.
Do not copy organization names, application identity, repositories, profiles, endpoints, or credentials into reusable commands or output.
3. Validate the source
Before choosing a lint profile, follow the shared mule-lint standards protocol. The build workflow executes the project gate; it does not redefine which Mule practices or rules are canonical.
Run the project's configured checks before packaging. Prefer, when available:
- XML, DataWeave, RAML/OAS, and configuration validation;
- Mule lint and security checks;
- focused MUnit tests for changed behavior;
- the required full test suite.
Do not skip tests by default. Skip them only when the user requests it or the repository's documented workflow requires a separate test stage, and state the resulting verification gap.
When Mule source changed, use the mule-development post-development checklist before building.
When Mule XML changed and the development skill is installed, run:
python3 <skills-root>/mule-development/scripts/check_embedded_expressions.py .
<skills-root> is the directory holding the mule-* skills: ${CLAUDE_PLUGIN_ROOT}/skills when
installed as a Claude Code plugin, .agents/skills when vendored into the project.
This catches truncated #[…] expressions in CDATA that XML parsing and packaging can miss.
4. Reconcile contracts and documentation
Review the changed files and update only documentation made stale by the change:
| Change | Check |
|---|---|
| Endpoint, event, or payload | API/event contract and consumer guidance |
| Flow, route, or dependency | Architecture and flow documentation |
| Scheduler, batch, queue, retry, timeout, or concurrency | Operations guidance |
| Configuration key or deployment input | Onboarding and configuration tables |
| Error mapping or recovery behavior | Contract, troubleshooting, and runbook |
| Test or validation command | Contributor/build guidance |
Use the mule-docs targeted-refresh workflow when installed. Do not rewrite
unrelated prose or add unsupported business context.
5. Package
Use the repository's established command or the configured Mule build tool. For a tool call, pass the
project root as cwd and preserve the project's normal test behavior.
Before running, show or record:
- command or tool and relevant non-secret options;
- whether tests are enabled;
- expected artifact directory;
- any known network or authentication dependency.
If the build fails, report the first actionable failure and relevant context. Do not mask a failed test by rerunning with tests skipped unless the user approves that diagnostic step.
6. Release preparation, only when requested
When the user explicitly requests a release:
- Apply the repository's versioning policy. If none exists, propose patch, minor, or major with the compatibility rationale and obtain direction when the choice is material.
- Update all evidenced version surfaces that must remain synchronized.
- Update an existing changelog using its established format; do not create one unless requested or required by repository instructions.
- Re-run validation, tests, and packaging after version changes.
- Use
mule-reviewin release-readiness mode on the resulting candidate when the skill is installed. Do not continue onNot readyorUnresolved; complete or explicitly accept every condition before continuing fromReady with conditions. - Commit or tag only when authorized. Make an annotated tag only after the final release commit.
- Push only when explicitly requested.
If the user also requests publishing to Exchange or deploying, restarting, scaling, or rolling back
a runtime, hand that work to mule-ops and the authenticated Anypoint connector after local release
preparation is complete. The operational handoff follows
<skills-root>/mule-ops/references/anypoint-readiness.md; mule-build does not probe or mutate the
platform itself. Those platform mutations are a separate scope and approval. Never treat a readiness
probe or a successful package as approval to publish or deploy.
Use semantic-version guidance as a starting point, not a replacement for the project's release policy:
| Change | Typical bump |
|---|---|
| Backward-compatible fix | Patch |
| Backward-compatible capability | Minor |
| Breaking public contract or runtime compatibility | Major |
Configuration-only changes do not universally mean “no version bump”; follow how the project packages and deploys configuration.
7. Verify the artifact
After a successful package:
- locate the generated deployable artifact;
- confirm it was produced by the current build and is not a stale file;
- confirm the packaged version matches the intended build or release version;
- report whether tests, lint, and security checks passed, failed, or were skipped;
- confirm no secret-bearing configuration or unintended generated files entered the diff.
8. Report
Provide:
- build mode and outcome;
- exact artifact path;
- validations and tests run;
- tests or checks skipped and why;
- files changed by the workflow;
- version, commit, and tag only when release actions occurred;
- remaining warnings or user actions.