Document MuleSoft Project
Create documentation that explains what the project does, how requests and data move through it,
how it fails, and how another engineer can operate or extend it. Derive claims from repository
evidence and prefer a small, navigable document set over a single exhaustive dump.
Inputs and outputs
Accept a Mule project root and an optional requested scope such as architecture, one flow, API
contract, onboarding, or a full refresh. Default to the current repository and an adaptive
documentation suite when the user does not narrow the request.
Write only documentation files unless the user explicitly requests source changes. Preserve
existing filenames and structure when they already serve the same purpose.
Load the references
Read these files directly from this skill folder:
- Always read MuleSoft analysis before inspecting a project.
- Read documentation blueprints before choosing output
files or editing existing documentation.
- Read Mermaid guide whenever the output includes diagrams.
- Always read privacy and evidence before writing or
validating output.
Do not load unrelated references from other skills unless the task independently requires them.
Workflow
1. Establish scope and safety
- Read repository instructions and existing documentation before generating content.
- Resolve the project root to a real path. Do not follow symlinks outside it.
- Ignore
.git, dependency caches, build output, generated sources, IDE metadata, certificates,
keystores, and binary files.
- Treat configuration values, environment files, logs, fixtures, and examples as potentially
sensitive. Never decrypt secrets.
- If the requested root is not a Mule project, report the evidence checked and stop without
creating generic documentation.
2. Build a deterministic inventory
Run the bundled inventory tool and inspect its JSON before reading individual implementation files:
python3 <skill-root>/scripts/inventory_mule_project.py <project-root> --pretty
<skill-root> is this skill's own directory: ${CLAUDE_PLUGIN_ROOT}/skills/mule-docs when installed
as a Claude Code plugin, .agents/skills/mule-docs when vendored into the project. Resolve it before
running the command.
Use the inventory to route deeper inspection. Verify important behavior in the actual source files;
the inventory is an index, not a substitute for reading code.
For test documentation, use the value-safe mule-testing inventory when that sibling skill is
installed:
python3 <skills-root>/mule-testing/scripts/inventory_munit.py <project-root> --pretty
It adds executable/ignored counts, test structures, selector attribute names, fixture paths, and
heuristic flow mappings without exposing selector values or fixture contents. Verify material claims
in the suite source.
Inspect, when present:
pom.xml and mule-artifact.json
src/main/mule/**/*.xml and global error handlers
- RAML/OAS specifications and examples
- external and inline DataWeave
- property references and environment templates
- MUnit suites
- deployment workflows and runtime configuration
- existing README and
docs/ content
3. Create an evidence ledger
Keep a working list of every material claim with its repository-relative source path and symbol,
flow, endpoint, or property key. Apply this precedence:
- Runtime behavior: Mule XML and DataWeave.
- Public contract: RAML/OAS, cross-checked against runtime listeners and APIKit routes.
- Build and runtime versions: POM and Mule artifact metadata.
- Configuration: referenced property keys and committed templates, never deployed values.
- Tests: MUnit source and CI configuration.
- Existing prose: contextual evidence only after verification.
Keep user-provided business context separate from implementation evidence. Attribute it as
Provided by project stakeholders when it is included in the documentation; do not use it as
proof of runtime behavior. If it conflicts with the repository, document the discrepancy instead
of silently choosing one account.
Record contradictions as documentation gaps. Label a conclusion as inferred when the source does
not establish it directly. Put unresolved questions in a compact Open questions section instead
of inventing an answer.
4. Offer an optional business-context checkpoint
After inspecting the repository and existing documentation, identify business information that
would materially improve the requested documentation but cannot be derived safely from source.
Common examples include:
- the business outcome and capability this application supports
- intended readers and the decisions or tasks the documentation should help with
- upstream and downstream system roles, business ownership, and support ownership
- business meaning of important routes, statuses, errors, and data fields
- criticality, service expectations, compliance constraints, and recovery priorities
- known business limitations, planned changes, and terminology
If material questions remain, present a compact set before drafting:
- Ask only questions whose answers would change useful content; do not ask the user to restate
facts already available in the repository.
- State that every question is optional and that the user may answer what they know, skip an item,
or skip the entire checkpoint.
- Where practical, give two to four concise, evidence-informed options plus
Other (please specify) and Not sure / Skip. Accept free-form answers as well.
- Briefly explain why each answer matters when that is not obvious.
- Prefer one batch of no more than five questions. Ask a follow-up only when an answer introduces
a material ambiguity.
- Do not make documentation work contingent on optional business answers. If the user skips or
does not know, continue with verified technical facts and label or omit unsupported business
claims.
Example presentation:
Optional business context — answer any items you know, or reply "skip":
1. Who is the primary reader? A) API consumers B) Mule developers C) Support/operators
D) Mixed audience E) Other (please specify) F) Not sure / Skip
2. How critical is this integration? A) Business-critical B) Important but recoverable
C) Best effort D) Other (please specify) E) Not sure / Skip
Record answered items in the evidence ledger as user-provided context. Keep unanswered items only
when they are actionable and material; group them under Open questions > Business context in the
closest owning document.
5. Choose the adaptive document set
Create or reconcile:
| Condition |
Output |
| Any valid Mule project |
README.md and docs/architecture.md |
| RAML/OAS, APIKit routes, or HTTP listeners |
docs/api-contract.md |
| Evidenced local setup, configuration, or deployment steps |
docs/onboarding.md |
| Schedulers, queues, batch jobs, retries, notifications, or monitoring |
docs/operations.md |
| More than ten top-level flows |
docs/flows.md |
Do not create an empty or speculative document merely to satisfy the table. If an existing document
already owns a topic, update it rather than creating a duplicate.
For a targeted request, update only the requested document and directly affected cross-references.
6. Explain from multiple perspectives
Cover the applicable perspectives without repeating the same facts:
- Purpose and boundary: the problem, actors, upstream/downstream systems, and API-led layer when
directly evidenced or explicitly attributed to user-provided business context.
- Runtime path: triggers, routing, transformations, connector calls, state changes, and response.
- Contract: endpoints/events, headers, payload shapes, correlation, and errors.
- Failure behavior: local/global handlers, retry or continuation semantics, writeback, and
notification paths.
- Configuration and security: property names, secure-property boundaries, authentication
mechanism, and trust boundaries without secret values.
- Changeability: extension points, design decisions, tests, deployment, operational checks, and
known gaps.
Use tables for inventories and comparisons, prose for rationale, code snippets only when they make
an exact contract clearer, and Mermaid only when relationships or sequence benefit materially.
7. Reconcile existing documentation
- Preserve correct manually authored explanations and project-specific terminology.
- Change a claim only when source evidence contradicts it or the user requests a rewrite.
- Preserve unrelated sections, links, and document topology.
- Add source paths near detailed claims so a maintainer can verify them.
- Do not delete a document or collapse a multi-document suite without explicit approval.
- Use repository-relative links and paths; never publish local absolute paths.
8. Validate before delivery
Run the documentation audit over the files changed:
python3 <skill-root>/scripts/audit_documentation.py <documentation-root>
Then:
- Render or parse every new Mermaid block when a Mermaid renderer is available.
- Re-read the diff for unsupported claims and leaked values.
- Confirm links resolve and diagrams match the prose.
- Confirm no source code or configuration was modified unintentionally.
- Summarize files created or updated, evidence gaps, and validations performed.
Non-negotiable rules
- Never copy credential values, tokens, passwords, private keys, certificates, keystores, real
secret-property ciphertext, or sensitive log payloads into documentation.
- Never infer business guarantees from flow names alone.
- Never describe a connector, retry, transaction, security policy, or error mapping that is not
evidenced.
- Never paste whole Mule XML or DataWeave files; explain behavior and cite the source location.
- Never replace customer/project identity in generated project documentation unless the user asks
for anonymization, but always redact secrets and personal data.
- Never include examples or terminology from unrelated customer projects in this reusable skill.
Generalize the mechanism; do not retain prior application names, topology, fields, endpoints,
schedules, volumes, error counts, exact log text, or numeric tuning values.
1---2name: mule-docs3description: Analyze MuleSoft Mule 4 repositories and create or update evidence-backed Markdown documentation with Mermaid diagrams. Use for project overviews, architecture and flow documentation, API contracts, connector and DataWeave documentation, configuration guides, onboarding, deployment, operations, testing, troubleshooting, or documentation-gap audits. Use for full-project documentation and targeted refreshes after Mule XML, RAML/OAS, DataWeave, MUnit, configuration, or deployment changes. Do not use for generic non-Mule repositories or source-code changes unrelated to documentation.4---56# Document MuleSoft Project78Create documentation that explains what the project does, how requests and data move through it,9how it fails, and how another engineer can operate or extend it. Derive claims from repository10evidence and prefer a small, navigable document set over a single exhaustive dump.1112## Inputs and outputs1314Accept a Mule project root and an optional requested scope such as architecture, one flow, API15contract, onboarding, or a full refresh. Default to the current repository and an adaptive16documentation suite when the user does not narrow the request.1718Write only documentation files unless the user explicitly requests source changes. Preserve19existing filenames and structure when they already serve the same purpose.2021## Load the references2223Read these files directly from this skill folder:24251. Always read [MuleSoft analysis](references/mulesoft-analysis.md) before inspecting a project.262. Read [documentation blueprints](references/documentation-blueprints.md) before choosing output27 files or editing existing documentation.283. Read [Mermaid guide](references/mermaid-guide.md) whenever the output includes diagrams.294. Always read [privacy and evidence](references/privacy-and-evidence.md) before writing or30 validating output.3132Do not load unrelated references from other skills unless the task independently requires them.3334## Workflow3536### 1. Establish scope and safety3738- Read repository instructions and existing documentation before generating content.39- Resolve the project root to a real path. Do not follow symlinks outside it.40- Ignore `.git`, dependency caches, build output, generated sources, IDE metadata, certificates,41 keystores, and binary files.42- Treat configuration values, environment files, logs, fixtures, and examples as potentially43 sensitive. Never decrypt secrets.44- If the requested root is not a Mule project, report the evidence checked and stop without45 creating generic documentation.4647### 2. Build a deterministic inventory4849Run the bundled inventory tool and inspect its JSON before reading individual implementation files:5051```bash52python3 <skill-root>/scripts/inventory_mule_project.py <project-root> --pretty53```5455`<skill-root>` is this skill's own directory: `${CLAUDE_PLUGIN_ROOT}/skills/mule-docs` when installed56as a Claude Code plugin, `.agents/skills/mule-docs` when vendored into the project. Resolve it before57running the command.5859Use the inventory to route deeper inspection. Verify important behavior in the actual source files;60the inventory is an index, not a substitute for reading code.6162For test documentation, use the value-safe `mule-testing` inventory when that sibling skill is63installed:6465```bash66python3 <skills-root>/mule-testing/scripts/inventory_munit.py <project-root> --pretty67```6869It adds executable/ignored counts, test structures, selector attribute names, fixture paths, and70heuristic flow mappings without exposing selector values or fixture contents. Verify material claims71in the suite source.7273Inspect, when present:7475- `pom.xml` and `mule-artifact.json`76- `src/main/mule/**/*.xml` and global error handlers77- RAML/OAS specifications and examples78- external and inline DataWeave79- property references and environment templates80- MUnit suites81- deployment workflows and runtime configuration82- existing README and `docs/` content8384### 3. Create an evidence ledger8586Keep a working list of every material claim with its repository-relative source path and symbol,87flow, endpoint, or property key. Apply this precedence:88891. Runtime behavior: Mule XML and DataWeave.902. Public contract: RAML/OAS, cross-checked against runtime listeners and APIKit routes.913. Build and runtime versions: POM and Mule artifact metadata.924. Configuration: referenced property keys and committed templates, never deployed values.935. Tests: MUnit source and CI configuration.946. Existing prose: contextual evidence only after verification.9596Keep user-provided business context separate from implementation evidence. Attribute it as97`Provided by project stakeholders` when it is included in the documentation; do not use it as98proof of runtime behavior. If it conflicts with the repository, document the discrepancy instead99of silently choosing one account.100101Record contradictions as documentation gaps. Label a conclusion as inferred when the source does102not establish it directly. Put unresolved questions in a compact `Open questions` section instead103of inventing an answer.104105### 4. Offer an optional business-context checkpoint106107After inspecting the repository and existing documentation, identify business information that108would materially improve the requested documentation but cannot be derived safely from source.109Common examples include:110111- the business outcome and capability this application supports112- intended readers and the decisions or tasks the documentation should help with113- upstream and downstream system roles, business ownership, and support ownership114- business meaning of important routes, statuses, errors, and data fields115- criticality, service expectations, compliance constraints, and recovery priorities116- known business limitations, planned changes, and terminology117118If material questions remain, present a compact set before drafting:119120- Ask only questions whose answers would change useful content; do not ask the user to restate121 facts already available in the repository.122- State that every question is optional and that the user may answer what they know, skip an item,123 or skip the entire checkpoint.124- Where practical, give two to four concise, evidence-informed options plus `Other (please125 specify)` and `Not sure / Skip`. Accept free-form answers as well.126- Briefly explain why each answer matters when that is not obvious.127- Prefer one batch of no more than five questions. Ask a follow-up only when an answer introduces128 a material ambiguity.129- Do not make documentation work contingent on optional business answers. If the user skips or130 does not know, continue with verified technical facts and label or omit unsupported business131 claims.132133Example presentation:134135```text136Optional business context — answer any items you know, or reply "skip":1371. Who is the primary reader? A) API consumers B) Mule developers C) Support/operators138 D) Mixed audience E) Other (please specify) F) Not sure / Skip1392. How critical is this integration? A) Business-critical B) Important but recoverable140 C) Best effort D) Other (please specify) E) Not sure / Skip141```142143Record answered items in the evidence ledger as user-provided context. Keep unanswered items only144when they are actionable and material; group them under `Open questions > Business context` in the145closest owning document.146147### 5. Choose the adaptive document set148149Create or reconcile:150151| Condition | Output |152| --------------------------------------------------------------------- | -------------------------------------- |153| Any valid Mule project | `README.md` and `docs/architecture.md` |154| RAML/OAS, APIKit routes, or HTTP listeners | `docs/api-contract.md` |155| Evidenced local setup, configuration, or deployment steps | `docs/onboarding.md` |156| Schedulers, queues, batch jobs, retries, notifications, or monitoring | `docs/operations.md` |157| More than ten top-level flows | `docs/flows.md` |158159Do not create an empty or speculative document merely to satisfy the table. If an existing document160already owns a topic, update it rather than creating a duplicate.161162For a targeted request, update only the requested document and directly affected cross-references.163164### 6. Explain from multiple perspectives165166Cover the applicable perspectives without repeating the same facts:167168- **Purpose and boundary:** the problem, actors, upstream/downstream systems, and API-led layer when169 directly evidenced or explicitly attributed to user-provided business context.170- **Runtime path:** triggers, routing, transformations, connector calls, state changes, and response.171- **Contract:** endpoints/events, headers, payload shapes, correlation, and errors.172- **Failure behavior:** local/global handlers, retry or continuation semantics, writeback, and173 notification paths.174- **Configuration and security:** property names, secure-property boundaries, authentication175 mechanism, and trust boundaries without secret values.176- **Changeability:** extension points, design decisions, tests, deployment, operational checks, and177 known gaps.178179Use tables for inventories and comparisons, prose for rationale, code snippets only when they make180an exact contract clearer, and Mermaid only when relationships or sequence benefit materially.181182### 7. Reconcile existing documentation183184- Preserve correct manually authored explanations and project-specific terminology.185- Change a claim only when source evidence contradicts it or the user requests a rewrite.186- Preserve unrelated sections, links, and document topology.187- Add source paths near detailed claims so a maintainer can verify them.188- Do not delete a document or collapse a multi-document suite without explicit approval.189- Use repository-relative links and paths; never publish local absolute paths.190191### 8. Validate before delivery192193Run the documentation audit over the files changed:194195```bash196python3 <skill-root>/scripts/audit_documentation.py <documentation-root>197```198199Then:200201- Render or parse every new Mermaid block when a Mermaid renderer is available.202- Re-read the diff for unsupported claims and leaked values.203- Confirm links resolve and diagrams match the prose.204- Confirm no source code or configuration was modified unintentionally.205- Summarize files created or updated, evidence gaps, and validations performed.206207## Non-negotiable rules208209- Never copy credential values, tokens, passwords, private keys, certificates, keystores, real210 secret-property ciphertext, or sensitive log payloads into documentation.211- Never infer business guarantees from flow names alone.212- Never describe a connector, retry, transaction, security policy, or error mapping that is not213 evidenced.214- Never paste whole Mule XML or DataWeave files; explain behavior and cite the source location.215- Never replace customer/project identity in generated project documentation unless the user asks216 for anonymization, but always redact secrets and personal data.217- Never include examples or terminology from unrelated customer projects in this reusable skill.218 Generalize the mechanism; do not retain prior application names, topology, fields, endpoints,219 schedules, volumes, error counts, exact log text, or numeric tuning values.