askill
module-create

module-createSafety 95Repository

Create a new nf-core module from scratch. Use when creating custom modules, wrapping new bioinformatics tools, or contributing modules to nf-core/modules repository.

0 stars
1.2k downloads
Updated 2/6/2026

Package Files

Loading files...
SKILL.md

Create nf-core Module

Generate a new Nextflow module following nf-core standards for tool wrapping.

Quick Commands

# Interactive module creation
conda run -n nf-core nf-core modules create

# Create with tool name specified
conda run -n nf-core nf-core modules create tool/subtool

# Create local module (pipeline-specific)
conda run -n nf-core nf-core modules create --local tool/subtool

# Create in specific directory
conda run -n nf-core nf-core modules create --dir /path/to/pipeline tool/subtool

Process

  1. Check Bioconda: Ensure tool is available in Bioconda
  2. Run Create Command: Generate module scaffold
  3. Edit main.nf: Implement process logic
  4. Update meta.yml: Document inputs, outputs, parameters
  5. Write Tests: Create nf-test test cases
  6. Lint Module: Validate against standards
  7. Submit PR: If contributing to nf-core/modules

Module Naming

  • Format: tool or tool/subtool
  • Lowercase only
  • Examples:
    • fastqc (single tool)
    • bwa/mem (tool with subtool)
    • samtools/sort, samtools/index (same tool, different operations)

Generated Files

modules/nf-core/tool/subtool/
├── main.nf           # Process definition
├── meta.yml          # Metadata file
├── environment.yml   # Conda environment
└── tests/
    ├── main.nf.test      # nf-test tests
    ├── main.nf.test.snap # Test snapshots
    ├── nextflow.config   # Test config
    └── tags.yml          # Test tags

main.nf Structure

process TOOL_SUBTOOL {
    tag "$meta.id"
    label 'process_single'  // or process_low, process_medium, process_high

    conda "${moduleDir}/environment.yml"
    container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
        'https://depot.galaxyproject.org/singularity/tool:version' :
        'quay.io/biocontainers/tool:version' }"

    input:
    tuple val(meta), path(input_file)

    output:
    tuple val(meta), path("${prefix}.out"), emit: output
    path "versions.yml"                   , emit: versions

    when:
    task.ext.when == null || task.ext.when

    script:
    def args = task.ext.args ?: ''
    def prefix = task.ext.prefix ?: "${meta.id}"
    """
    tool subtool \\
        $args \\
        --input $input_file \\
        --output ${prefix}.out

    cat <<-END_VERSIONS > versions.yml
    "${task.process}":
        tool: \$(tool --version | sed 's/.*version //')
    END_VERSIONS
    """

    stub:
    def prefix = task.ext.prefix ?: "${meta.id}"
    """
    touch ${prefix}.out

    cat <<-END_VERSIONS > versions.yml
    "${task.process}":
        tool: 1.0.0
    END_VERSIONS
    """
}

meta.yml Structure

name: tool_subtool
description: Brief description of what the tool does
keywords:
  - genomics
  - alignment
  - sorting
tools:
  - tool:
      description: Full description of the tool
      homepage: https://tool-homepage.com
      documentation: https://tool-docs.com
      tool_dev_url: https://github.com/tool/repo
      doi: "10.1093/bioinformatics/xyz"
      licence: ["MIT"]

input:
  - - meta:
        type: map
        description: |
          Groovy Map containing sample information
          e.g. `[ id:'sample1', single_end:false ]`
    - input_file:
        type: file
        description: Input file description
        pattern: "*.{bam,sam}"

output:
  - output:
      - meta:
          type: map
          description: Sample metadata
      - "${prefix}.out":
          type: file
          description: Output file description
          pattern: "*.out"
  - versions:
      - versions.yml:
          type: file
          description: File containing software versions
          pattern: "versions.yml"

authors:
  - "@github_username"
maintainers:
  - "@github_username"

Process Labels

LabelCPUsMemoryTime
process_single16 GB4h
process_low212 GB4h
process_medium636 GB8h
process_high1272 GB16h
process_long212 GB20h
process_high_memory10200 GB12h

Container Sources

  1. Bioconda/Biocontainers (preferred):

    container "${ workflow.containerEngine == 'singularity' ?
        'https://depot.galaxyproject.org/singularity/tool:1.0--h123' :
        'quay.io/biocontainers/tool:1.0--h123' }"
    
  2. Custom container:

    container "docker.io/org/tool:version"
    

Finding Container Versions

# Search Bioconda
conda search -c bioconda tool

# Search Biocontainers
curl -s "https://api.biocontainers.pro/ga4gh/trs/v2/tools/tool/versions" | jq

# Check quay.io
curl -s "https://quay.io/api/v1/repository/biocontainers/tool/tag/" | jq

Lint Module

# Lint specific module
conda run -n nf-core nf-core modules lint tool/subtool

# Lint all modules
conda run -n nf-core nf-core modules lint --all

Test Module

# Run tests
conda run -n nf-core nf-test test modules/nf-core/tool/subtool/

# Update snapshots
conda run -n nf-core nf-test test modules/nf-core/tool/subtool/ --update-snapshot

Contributing to nf-core/modules

  1. Fork nf-core/modules
  2. Create module following guidelines
  3. Run lint and tests
  4. Open PR to nf-core/modules
  5. Request review from modules-team

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

96/100Analyzed 2/12/2026

An exceptionally well-structured and comprehensive skill for creating nf-core modules. It provides clear commands, detailed code templates, and covers the entire lifecycle from creation to testing and linting.

95
100
90
95
98

Metadata

Licenseunknown
Version-
Updated2/6/2026
Publisherjonasscheid

Tags

apici-cdgithubgithub-actionslintingtesting