| name | generating-easyconfig |
| description | Generate a production ready easyconfig file. |
Generating Easyconfig
You are tasked with producing a syntactically correct and logically sound EasyBuild easyconfig file (.eb).
Your primary objective is to reuse existing easyconfigs when possible and only generate new ones when strictly necessary, following EasyBuild best practices.
CRITICAL RULES
- Assumptions are FORBIDDEN.
- You MUST choose exactly one workflow. Otherwise, return an error.
- You MUST create a checklist of the workflow for yourself and follow it step by step.
- You MUST interpret workflow's steps sequentially from the first line to the last line.
- Do NOT skip steps. Do NOT combine steps.
High-Level Policy (Non-Negotiable)
- Always search existing EasyBuild easyconfigs first, using
mcp__eb_tools__search_local_easyconfigs tool
- If a suitable easyconfig for the software already exists, reuse or adapt it
- Only generate a new easyconfig if none exists
- Minimize custom logic and shell commands
- Ensure long-term maintainability
Inputs
These variables MUST be defined in your context window. If they are NOT, return an error.
- TC_NAME: Toolchain name.
- SW_NAME: Software name.
- TC_VERSION: Toolchain version.
- SW_VERSION: Software version.
- SW_SUFFIX: List of features with their versions (can be empty).
You may also have these information:
- New easyconfig filename
- Absolute path to the template easyconfig
Workflow
- Use only the
mcp__eb_tools__search_local_easyconfigs tool to check if an exact match easyconfig already exists locally (matching SW_NAME, SW_VERSION, TC_NAME, TC_VERSION, and SW_SUFFIX).
- NEVER use
mcp__eb_tools__search_upstream_easyconfigs for finding an exact match.
- If an exact match exists, you MUST return its absolute path and STOP (early exit).
- If no exact match exists, continue to Step 2 to find a similar easyconfig as a template for adaptation.
- Find the closest easyconfig file as a template.
- If Absolute path to the template easyconfig is given by user, use it as the template.
- Otherwise, use both
mcp__eb_tools__search_upstream_easyconfigs and mcp__eb_tools__search_local_easyconfigs tools to find the closest easyconfig to user request. First, prefer the closest software version. Second, prefer the closest toolchain. Third, prefer the closest versionsuffix. The closest match takes priority regardless of source (local or upstream).
- If no easyconfig found by previous step, proceed to next step and generate from scratch without a template.
- Use the template to generate the new easyconfig content based on the High-Level Policy section.
- For EACH easyconfig parameter you plan to set or modify, you MUST consult
./PARAMS.md (located in the same directory as this skill file) for specific instructions:
- You MUST apply the parameter's instruction in
./PARAMS.md line by line and in order.
- If a parameter is NOT listed in
./PARAMS.md, use mcp__eb_tools__list_all_easyconfig_parameters and search its output (using built-in Grep functionality) to retrieve its definition.
- If additional context is needed (e.g., software-specific build requirements), use
mcp__web__agent.
- Consider a patch file ONLY when you MUST change upstream source code of the EXACT same software version; you MUST reuse existing patches whenever possible.
- Identify purpose of the patch. Bug fix, missing feature, workaround, or a site-specific tweak.
- Check the upstream code of the target software version. Read release notes and changelog, search issues and commits, verify if the patch is still needed (Ignore site-specific tweaks).
- If the patch is still needed, Reimplement minimally based on the upstream code of the EXACT target version (do not blindly copy). Add clear comments in easyconfig explaining why the patch exists and what is its scope of usage.
- If the patch is needed, use to write it.
- The absolute path of the generated easyconfig.
- Any missing dependencies collected in Step 8 (if applicable). Ask user to generate their easyconfig.
- STOP workflow.
Extra Information
To retrieve more information from easybuild official documentations, use mcp__web__agent on Official EasyConfig Docs.