This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the nf-core-utils Nextflow plugin, which provides utility functions used by nf-core pipelines. The plugin extends Nextflow with custom functions for configuration validation, notification, reporting, versioning, and reference handling.
# Install the locked development toolchain
mise install
# Build the plugin
mise run assemble
# or
mise exec -- ./gradlew assemble
# Run unit tests
mise run test
# or
mise exec -- ./gradlew test
# Clean build artifacts
mise run clean
# Install plugin locally for testing
mise run install
# or
mise exec -- ./gradlew install
# Run end-to-end validation (installs the plugin first)
mise run validate
# Test with Nextflow
mise exec -- nextflow run hello -plugins nf-core-utils@0.1.0# Publish the plugin (requires GitHub credentials in ~/.gradle/gradle.properties)
mise run release
# or
mise exec -- ./gradlew releasePluginThe plugin follows Nextflow's PF4J-based plugin architecture:
- NfUtilsPlugin.groovy: Main plugin entry point extending BasePlugin
- NfUtilsExtension.groovy: Primary extension point providing @Function-annotated methods
- NfUtilsFactory: Factory class for plugin initialization
Located in src/main/groovy/nfcore/plugin/nfcore/:
- NfcoreConfigValidator: Validates pipeline configurations and profiles
- NfcoreNotificationUtils: Handles emails, Slack/Teams notifications, and terminal output formatting
- NfcoreReportingUtils: Manages MultiQC reporting and pipeline summaries
- NfcoreVersionUtils: Version aggregation and formatting (YAML, topic channels)
- NfcoreCitationUtils: Citation extraction and formatting from module meta.yml files
- NfcoreReportingOrchestrator: Orchestrates comprehensive reporting (versions + citations + bibliography + methods)
The plugin provides three main extension categories accessible via @Function annotations:
- Configuration & Validation:
checkConfigProvided(),checkProfileProvided() - Notification & Logging:
completionEmail(),imNotification(),completionSummary() - Reporting & Versioning:
getWorkflowVersion(), comprehensive reporting via orchestrator classes
- ReferencesUtils: Handles igenomes and custom reference file resolution
- Functions:
getGenomeAttribute(),getReferencePath(),getReferenceMetadata(),getReferenceAttribute()
- NextflowPipelineUtils: Core pipeline utilities
- Functions:
dumpParametersToJSON(),checkCondaChannels()
- Uses
io.nextflow.nextflow-pluginversion0.0.1-alpha3 - Plugin version:
0.3.0 - Nextflow compatibility:
25.10.4+(seebuild.gradle) - Extension points:
NfUtilsExtensionandNfUtilsFactory - Dependencies: SnakeYAML for YAML processing
Define common development tasks and lock Java 21, Nextflow, nf-test, and uv for local
development and CI. Use mise tasks ls to list commands. Gradle itself is managed
by the Gradle wrapper.
locked = true makes mise install fail when mise.lock lacks a tool or platform.
After changing [tools], refresh it with MISE_LOCKED=0 mise lock.
[env] unsets AGENT and CLAUDECODE: they turn on Nextflow agent mode, which breaks snapshots.
gradle.properties includes org.gradle.java.installations.fromEnv=JAVA_HOME
so Gradle toolchains pick up the JDK selected by mise. Verify with
mise exec -- ./gradlew -q javaToolchains.
- Unit tests in
src/test/groovy/nfcore/plugin/ - Organized by functionality: nextflow/, nfcore/, references/
- Uses Spock framework for testing
- Test resources in
src/test/resources/
- NfcoreReportingOrchestratorTest: Tests comprehensive reporting functionality
- NfcoreVersionUtilsTest: Tests version processing and formatting
- NextflowPipelineTest: Tests core pipeline utilities
- Observer tests for pipeline monitoring functionality
include { checkConfigProvided; completionEmail; getWorkflowVersion } from 'plugin/nf-core-utils'- Pipeline initialization: Config/profile validation
- Version reporting: Workflow version strings and comprehensive reporting
- Completion handlers: Email notifications, Slack/Teams integration
- MultiQC integration: Parameter summaries and method descriptions
The plugin implements trace observers for pipeline monitoring:
- NfcorePipelineObserver: Monitors workflow execution
- NfcorePipelineObserverFactory: Creates observers based on session configuration
- Built for Nextflow 25.10.4+; CI tests the minimum and every supported stable release line in
.github/workflows/validation.yml - Uses modern Nextflow plugin development patterns
- Follows nf-core community standards and conventions
- Utility classes are stateless and use static methods where possible
- Extension methods delegate to utility classes for testability
- Clear separation between Nextflow extension points and core business logic
Comprehensive documentation exists in docs/ directory:
NextflowPipelineExtension.mdNfCoreUtilities.mdReferencesExtension.md