Workflow for generating MuleSoft projects from Anypoint Exchange templates, local .jar templates, or from scratch via the `mule-mcp-server`. Use when users ask to "create a project", "generate project", "build integration", "create API", "use template", or "from template". Performs template discovery and calls create_mule_project only after explicit user confirmation; delegates flow generation to the `build-mule-integration` skill.
67
81%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
Guide the user through multi-step Mule project generation via the create-project-template skill . For any project creation request, the request must go through this workflow. Do not call create_mule_project directly. This workflow performs proper discovery of the template (or generation path) from the user — Exchange search and selection, local template path, or scratch — and obtains user confirmation before create_mule_project may be invoked at the designated project-creation step in the chosen flow. After project creation, flow work is entirely delegated to the build-mule-integration skill.
Triggers:
Mandatory path: Route every project-creation request through this workflow so that discovery and confirmation happen first; only then call create_mule_project at the designated project-creation step in the chosen flow (Exchange, Scratch, or Local).
Your behavior should be deliberate and confirmation-driven. Take time to understand user requirements and organizational template availability before proposing a template. The quality of your template discovery directly impacts adherence to organizational standards. Treat this as a collaborative decision-making process — never proceed to template selection or project generation without explicit user confirmation at each checkpoint.
Agent tone — choice options: When presenting multiple-choice options to the user (e.g. via AskUserQuestion / <ask_followup_question>), use full, formal sentences, not brief phrases. For example: use "Yes, create this project with the defaults." not "Yes, create with defaults"; use "Yes, but let me specify the name and the path." not "Let me specify name/path"; use "No, search Exchange for templates instead." not "Search Exchange for templates instead."
Important: Execute steps without commentary; never proceed to the next step without explicit user confirmation.
create_mule_project: Do not call create_mule_project until this workflow has completed discovery and the user has approved (Confirmation checkpoint 2). Never invoke it directly in response to a project-creation request. Call it only at the designated project-creation step in the chosen flow (Exchange, Scratch, or Local).scripts/search_templates.sh output for user selection of templatemvn clean compile and only report success if it passes.create_mule_project until the user explicitly approves (e.g. Template Integration Plan for Exchange, or equivalent confirmation for Local/Scratch). Calling create_mule_project without having completed the workflow and received this approval is prohibited.build-mule-integration skill until the user explicitly approves flow customization.build-mule-integration skill. Follow that skill in full. This workflow does not perform flow generation itself; the build-mule-integration skill handles it after its Technical Summary is approved and its verification gate passes.build-mule-integration skill..jar files only; directory-based templates are NOT supported.This skill ships small bash helpers under scripts/. Invoke them with the Bash tool at the absolute path you were given in the "skill is now active" message (the directory containing this SKILL.md). Do not use relative paths like ../scripts/... — Cline's working directory shifts across turns and relative paths break.
| Script | Purpose | Output |
|---|---|---|
scripts/search_templates.sh <search-term> | Step E2 — search Anypoint Exchange for type == "template" assets via two parallel exchange asset list calls (one unscoped, one --organizationId <my-org>), dedup, rank by token overlap with <search-term>, then enrich the top 10 with description, minMuleVersion, and sourceLocation ("private" for org-scoped hits, "public" otherwise). | Single JSON array on stdout (max 10 rows), sorted private-first. Exits 1 with an error on stderr when no templates match. |
The script wraps anypoint-cli-v4 exchange asset list (paginated) plus anypoint-cli-v4 exchange asset describe (top-N enrichment). It auto-resolves a real environment from anypoint-cli-v4 account environment list so it works regardless of how ANYPOINT_ENV is set in the shell.
This is the FIRST step for ANY project generation request. You MUST resolve template source (Exchange / local .jar / scratch) before proceeding.
When the user enters a project-creation prompt, ALWAYS ask the template source question first. Do not infer or skip this step.
<ask_followup_question>
<question>I can help you create this project. Which template source would you prefer?</question>
<options>["I want to use organizational templates from Anypoint Exchange.", "I have a local template .jar file I want to use.", "I want to generate from scratch without a template."]</options>
</ask_followup_question>Then proceed based on the user's answer: Exchange → Step E1 (and run scripts/search_templates.sh when ready); local .jar → Step L1 (get path if needed); scratch → Step S1.
Only skip the question above when the user has already made the choice explicit in the same message, as follows.
Evaluate in order; stop at first match. Only when the user's message clearly states one of these, proceed directly without asking:
Otherwise (e.g. "create a project", "build an integration", "create an API", or no clear source): Always ask the template source question first; do not infer.
Important: Even if private Exchange search returns templates that appear to match perfectly, you MUST still search public Exchange as well. This ensures:
- Users see all available template options across both exchanges.
- Users can make informed decisions with complete organizational template information.
Before running scripts/search_templates.sh, you MUST complete these investigation steps in order.
Analyze the user's prompt and prepare search parameters.
Extract: Systems/Connectors (e.g. Salesforce, SAP, PostgreSQL), Integration Pattern (sync, API, batch, event-driven), Domain Context (healthcare, finance), Action Keywords (migrate, expose, transform, notify).
Strategy: Specific systems → include names in the search query. Generic need → pattern keywords (sync, API, batch). Industry/compliance → include domain. No details → ask the clarifying question below.
Build the search query: [System1] + [System2] + [Pattern/Action]. Examples: "Salesforce database sync"; "REST API order"; "SAP Anypoint MQ integration". This string is what you will pass as the first argument to scripts/search_templates.sh in Step E2a.
If requirements are unclear, prompt via AskUserQuestion:
<ask_followup_question>
<question>To find the best template for your project, I need a bit more context:
- What systems or data sources are involved?
- What type of integration? (REST API, system sync, event processing, batch)</question>
<options>["REST API exposing data.", "System-to-system sync.", "Event-driven processing.", "Batch processing.", "Let me describe in detail."]</options>
</ask_followup_question>Run the bundled search script with the Bash tool, passing the query you built in Step E1a. The script handles pagination, dedup-by-latest-version, ranking, and the public/private label internally — there is no need to make two separate calls per the Search Completeness Rule; one invocation searches everything visible to the authenticated user.
<skill-dir>/scripts/search_templates.sh "<search-query-from-E1a>"The script returns at most 10 ranked results (private-first), each enriched with description and minMuleVersion via exchange asset describe.
The script writes a single JSON array to stdout. Each row has:
{
"name": "Salesforce to Salesforce Contact Bidirectional Sync",
"groupId": "org.mule.templates",
"assetId": "template-sfdc2sfdc-contact-bidirectional-sync",
"version": "2.1.4",
"minMuleVersion": "4.1.1",
"description": "Template description (may be empty)",
"sourceLocation": "private"
}Exit code 1 + a stderr message means no templates matched — handle as the "no results" branch in E2b.
The script already does dedup-by-latest-version, token-overlap ranking, and private-first sorting; you do not re-rank or re-merge. Just read the JSON array, then present it.
If description is empty for a row, omit that bullet rather than printing Description: (looks worse than no line at all). The same applies to any other field the publisher left blank.
If no results found, prompt via AskUserQuestion:
<ask_followup_question>
<question>No templates found matching your requirements. Would you like to:</question>
<options>["I want to search with different terms.", "I want to generate the project from scratch.", "I will provide a local template .jar file."]</options>
</ask_followup_question>Present results to the user with full asset details:
<ask_followup_question>
<question>I found the following templates matching your requirements:
**1. [Template Name]** [Private]
- Asset: `groupId:assetId`
- Version: X.X.X (latest)
- Min Mule Version: [minMuleVersion from response]
- Description: [brief description]
**2. [Template Name]** [Public]
- Asset: `groupId:assetId`
- Version: X.X.X (latest)
- Min Mule Version: [minMuleVersion from response]
- Description: [brief description]
</question>
<options>["I'll use Template 1.", "I'll use Template 2.", "I want to search with different terms.", "I would like to use one of these templates, or create the integration from scratch."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (template selection): stop and wait for explicit template choice before Step E3.
Output after user confirms:
name — Template namegroupId — Group identifierassetId — Asset identifierversion — Selected versionminMuleVersion — Minimum Mule version (from search_templates.sh output)sourceLocation — "private" or "public" (from search_templates.sh output)Before generation, present a comprehensive plan for user approval:
Template Integration Plan
User Requirement: "[original request summary]"
Selected Template:
Project Configuration (optional — defaults used if not specified):
What Will Be Created:
pom.xmlsrc/main/mule/src/main/resources/Post-Generation: Flow generation is entirely delegated to the build-mule-integration skill. That skill handles connector discovery, trigger selection, technical summary, and the actual flow generation.
Then prompt via AskUserQuestion:
<ask_followup_question>
<question>Please review the Template Integration Plan above. Should I proceed with project generation?</question>
<options>["Yes, proceed with project generation.", "Yes, but let me specify the project name and path.", "No, I want to select a different template.", "Cancel."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (project creation): do not call
create_mule_projectuntil the user approves this plan.
Output: User approval to proceed.
Pre-flight checklist — before calling create_mule_project, verify ALL:
If ANY item is missing, STOP and get confirmation.
Only after ALL confirmations, call create_mule_project per Reference → create_mule_project Schema.
Exchange (this path): all of the following are required:
projectPath — path where project will be createdprojectName — name for the projectassetId — from selected templategroupId — from selected templateversion — from selected templateassetType — set to "template"After generation, verify:
pom.xml exists and is valid.src/main/mule/ contains flow files.Output: Generated project path, validation status.
After project creation, flow generation or updates follow the build-mule-integration skill.
Gather only what is needed to present the confirmation question: project path and list of XML files in src/main/mule/. All flow-generation work (reading flow content, connector discovery, trigger selection, and the flow generation itself) is entirely delegated to build-mule-integration; do not do it in this step.
Prompt via AskUserQuestion:
<ask_followup_question>
<question>The project has been created. Would you like me to generate or update Mule flows based on your requirements?
**Project:** [projectPath]
**Available XML files:** [list of .xml files in src/main/mule/]
What flow changes would you like?</question>
<options>["Generate flows based on my original request.", "Let me describe specific flow requirements.", "No flow changes needed — the project is ready."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (flow generation): get approval before handing off to
build-mule-integrationskill.
When the user approves flow generation, switch to and follow the build-mule-integration skill. Validation and success reporting are handled entirely by that skill.
Flow objective: Generate Mule Integration Projects from scratch without predefined templates, using baseline generation capabilities.
Triggers for this branch: no suitable templates found in Exchange search; user explicitly requests scratch generation; user declines all presented template options; template-based generation fails; "from scratch", "without template", "generate new".
Before creating the project, prompt via AskUserQuestion:
<ask_followup_question>
<question>I'll create a new Mule project from scratch.
Optional project details (defaults will be used if not specified):
- **Project Name**: [derived from user prompt or use default]
- **Project Path**: [current workspace or specify]
Should I proceed with scratch generation?</question>
<options>["Yes, create this project with the defaults.", "Yes, but let me specify the name and the path.", "No, search Exchange for templates instead.", "Cancel."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (project creation): get approval before calling
create_mule_project.
Output: User approval with projectName and projectPath (required; see Reference).
Call create_mule_project per Reference → create_mule_project Schema.
Scratch (this path): required only:
projectPath — path where project will be createdprojectName — name for the projectNo template parameters; creates minimal scaffold project.
Output: Generated project path.
Flow generation follows the build-mule-integration skill.
Prompt via AskUserQuestion:
<ask_followup_question>
<question>The project has been created. Would you like me to generate Mule flows based on your requirements?
**Project:** [projectPath]
What flows would you like to generate?</question>
<options>["Generate flows based on my original request.", "Let me describe specific flow requirements.", "No flow changes needed — the project is ready."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (flow generation): get approval before handing off to
build-mule-integration.
When the user approves flow generation, switch to and follow the build-mule-integration skill. Validation and success reporting are handled entirely by that skill.
Flow objective: Generate Mule Integration Projects using .jar template files stored on the user's local file system.
Triggers for this branch: user specifies they have a local template .jar file; user provides a file path ending with .jar; "use my local template"; "generate from [path].jar"; "use template at /path/to/template.jar".
Important: Per Core Rules (local template format) — directory-based templates are NOT supported.
Parse the request for:
.jar file pathExamples of trigger prompts:
If .jar path provided in request:
If path NOT provided or not a .jar file, prompt via AskUserQuestion:
<ask_followup_question>
<question>Please provide the path to your local template `.jar` file:</question>
<options>["I will enter the .jar file path.", "No, search Exchange for templates instead.", "No, I want to generate from scratch instead."]</options>
</ask_followup_question>Output: templatePath (must end with .jar), integration intent.
.jar FileValidate the provided .jar path:
.jar extension — file must end with .jar.If validation fails, prompt via AskUserQuestion:
<ask_followup_question>
<question>The path [path] is not a valid Mule template `.jar` file. [specific error]. Would you like to:</question>
<options>["I will provide a different .jar file path.", "No, search Exchange for templates instead.", "No, I want to generate from scratch instead."]</options>
</ask_followup_question>Output: Validated templatePath (.jar file), template name extracted from filename.
Prompt via AskUserQuestion:
<ask_followup_question>
<question>I'll create a project from your local template.
**Local Template:** [templatePath]
**Template Name:** [extracted or filename]
Optional project details (defaults will be used if not specified):
- **Project Name**: [derived or use default]
- **Project Path**: [current workspace or specify]
Should I proceed?</question>
<options>["Yes, create this project with the defaults.", "Yes, but let me specify the name and the path.", "No, I want to use a different template.", "Cancel."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (project creation): do not call
create_mule_projectuntil the user confirms.
Output: User approval, templatePath, projectName and projectPath (required; see Reference).
Pre-flight checklist — before calling create_mule_project, verify:
If ANY item is missing, STOP and get confirmation.
Call create_mule_project per Reference → create_mule_project Schema.
Local (this path): all of the following are required:
projectPath — path where project will be createdprojectName — name for the projectassetFilePath — path to the local .jar template fileOutput: Generated project path.
Flow generation or updates follow the build-mule-integration skill
Gather only what is needed to present the confirmation question: project path, template path, and list of XML files in src/main/mule/. All flow-generation work (reading flow content, connector discovery, trigger selection, and the flow generation itself) is entirely delegated to build-mule-integration; do not do it in this step.
Prompt via AskUserQuestion:
<ask_followup_question>
<question>The project has been created from your local template. Would you like me to generate or update Mule flows based on your requirements?
**Project:** [projectPath]
**Template Used:** [local template .jar path]
**Available XML files:** [list of .xml files in src/main/mule/]
What flow changes would you like?</question>
<options>["Generate or update flows based on my original request.", "Let me describe specific flow requirements.", "No flow changes needed — the project is ready."]</options>
</ask_followup_question>Important: Per Confirmation Checkpoints (flow generation): get approval before handing off to
build-mule-integration.
When the user approves flow generation, switch to and follow the build-mule-integration skill. Validation and success reporting are handled entirely by that skill.
| User Request | Initial Flow | Steps | Fallback Option |
|---|---|---|---|
| "Use local template at /path/template.jar" | Local Template | L1 → L2 → L3 → L4 → L5 | Exchange or Scratch |
| "Create from scratch" | Scratch | S1 → S2 → S3 | Exchange Template |
| "Generate integration" (no template preference) | Exchange Template | E1 → E2 → E3 → E4 → E5 | Scratch if no matches |
| "Use Exchange template" | Exchange Template | E1 → E2 → E3 → E4 → E5 | Scratch if no matches |
| Template search returns no results | Fallback to Scratch | S1 → S2 → S3 | — |
Local .jar validation fails | Offer Exchange or Scratch | Step 1 re-entry | — |
Scratch and Local end at handoff to build-mule-integration (S3b, L5c); Exchange ends at E5c. Validation and success reporting for flows are handled by build-mule-integration.
Users can switch between flows at specific checkpoints. Honor these requests:
| Current Flow | User Says | Action |
|---|---|---|
| Exchange Template (Step E2) | "Use local template instead" | → Jump to Step L1 |
| Exchange Template (Step E2) | "Proceed without template" | → Jump to Step S1 |
| Local Template (Step L3) | "Search Exchange instead" | → Jump to Step E1 |
| Local Template (Step L2 — validation fails) | "Generate from scratch" | → Jump to Step S1 |
| Scratch (Step S1) | "Actually, search for templates" | → Jump to Step E1 |
Important: When switching flows, carry forward any already-gathered information (project name, requirements, etc.) to avoid re-asking the user.
| Tool / Script | Purpose | Requires User Approval |
|---|---|---|
scripts/search_templates.sh <query> | Step E2a — search Anypoint Exchange for templates (private and public) and return an enriched, ranked JSON array on stdout (max 10 rows). | No (read-only Bash call) |
create_mule_project (mule-mcp-server) | Create project from template or scratch. Do not call directly — only call from within this workflow at Step E4, S2, or L4 after the corresponding confirmation checkpoint has been satisfied. | YES (workflow + user approval required) |
Note: Flow generation (E5, S3, L5) is handled entirely by the
build-mule-integrationskill — this workflow does not invoke any flow-generation tool directly.
scripts/search_templates.sh ReferenceInvocation:
<skill-dir>/scripts/search_templates.sh "<search-query>"| Argument | Required | Description |
|---|---|---|
<search-query> | Yes | Search terms built in Step E1a (e.g. "salesforce database sync"). |
The script runs two exchange asset list calls in parallel — one unscoped (public) and one with --organizationId <my-org> (private) — and tags each row by which call returned it. The user's org id is auto-resolved from account environment list. Returns the top 10 ranked results (private-first), enriched via exchange asset describe.
Stdout: JSON array sorted private-first (max 10 rows). Each row carries name, groupId, assetId, version, minMuleVersion, description, sourceLocation. Exit code 1 + stderr message means no templates matched.
create_mule_project Schema| Parameter | Required | Description |
|---|---|---|
projectPath | Yes | Path where project will be created |
projectName | Yes | Name for the project |
assetId | For Exchange | Asset ID from selected template |
groupId | For Exchange | Group ID from selected template |
version | For Exchange | Version from selected template |
assetType | For Exchange | Set to "template" for Exchange templates |
assetFilePath | For Local | Path to local .jar template file |
Usage by flow:
projectPath, projectName, assetId, groupId, version, assetType: "template" (all required).jar: projectPath, projectName, assetFilePath (all required)projectPath, projectName (both required, no template parameters)Use this format when reporting project generation success. Set variant as Exchange (include "Template Used"), Scratch (no template line), or Local Template (include "Source Template").
**Project Generation Complete** [variant: add " (Scratch)" or " (Local Template)" for those flows; omit for Exchange]
**Location:** [project path]
[**Template Used:** [template name] v[version] — Exchange only | **Source Template:** [local .jar path] — Local only | omit for Scratch]
**Created Files:**
- pom.xml (Maven configuration)
- src/main/mule/[flow files]
- src/main/resources/[property files]| Issue | Action |
|---|---|
| No templates found in Exchange | Offer scratch generation or different search terms |
| Template download fails | Retry once, then offer alternative templates |
| Project compilation fails | Check dependencies, validate XML, report specific error |
Local .jar file not found | Ask user to verify path and provide correct .jar file location |
Local file is not a .jar | Inform user per Core Rules (local template format); ask for correct path |
| Multiple versions of same template | Always present ONLY the latest version |
Request: "Create an integration that syncs customer data between Salesforce and PostgreSQL"
Step 1: Detect path → no local .jar provided, no scratch request → Exchange Template Flow.
Step E1: Analyze request
"Salesforce database sync template"Step E2: Run scripts/search_templates.sh "Salesforce database sync template" 10:
salesforce-db-sync-template v2.1.0 (private; older versions already collapsed by the script), sf-postgres-connector-template v1.0.0 (public).Step E3: Present Template Integration Plan
Step E4: Generate project using create_mule_project
assetId, groupId, version, assetType: "template".Step E5: Flow generation is entirely delegated to the build-mule-integration skill. Ask user for flow customization approval (E5b); when approved, switch to and follow the build-mule-integration skill. It runs in full (project investigation, trigger and connector discovery, technical summary, flow generation, validation, and success reporting). No further project-generation steps after handoff.
A successful Mule project generation requires:
build-mule-integration (delegated).Important: See Confirmation Checkpoints and Validation Standard (Core Rules).
32e2b58
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.