SKILLS_REPORTS

White Paper: workflow-reports Skill

A technical description of the workflow-reports skill in galaxy-skills/wf_dev (path: workflow-reports/). This document describes the skill’s structure, content, methodology, inputs/outputs, and the underlying Galaxy “workflow report” mechanism it targets. It does not evaluate fit against any external goal.


1. Shape and Packaging

A single, flat skill — no sub-skills, no router. Layout:

workflow-reports/
  SKILL.md                                  # entry point, full procedure
  README.md                                 # short orientation
  references/directives.md                  # full Galaxy markdown directive reference
  examples/histology-staining.md            # complete worked example
  examples/tissue-microarray-analysis.md    # second worked example

Total content: ~700 lines of markdown. The skill is self-contained; unlike nf-to-galaxy it does not delegate to or compose with other skills. The skill description string in frontmatter explicitly enumerates trigger phrases (“create a report for this workflow”, “draft a workflow report template”, “write a Galaxy report for workflow <id/url>“).

2. Domain Object: The Galaxy Workflow Report

The skill targets a specific Galaxy artifact: the markdown stored at report.markdown inside a Galaxy workflow. This markdown is rendered by Galaxy after a workflow invocation and is also editable in the Workflow Editor’s Report tab. A .ga workflow file already contains a report.markdown field; Galaxy populates it with a minimal default (invocation_inputs, invocation_outputs, workflow_display) which the skill is designed to replace.

The markdown is a template: it is authored once, against the workflow definition, and re-rendered for every invocation by substituting live invocation data into the embedded directives. The skill therefore operates on the workflow definition, not on any particular run.

3. Directive Mechanism

Galaxy markdown reports interpolate live data through fenced “directive” blocks:

```galaxy
directive_name(arg=value)
```

Strict rules encoded in the skill:

references/directives.md enumerates the full directive surface in five categories:

4. Required Inputs

The skill requires the full workflow definition in either form:

Option A — .ga file. Read the file directly. Output is written into its report.markdown field with user confirmation.

Option B — Galaxy API. GET https://<instance>/api/workflows/<id>/download?style=editor. The ?style=editor qualifier is required: the standard endpoint omits step.label and workflow_outputs, both of which are necessary to write label-based directives. The skill instructs the agent to derive the download URL from a browser URL when the user supplies one.

The skill optionally consumes a co-located README.md next to the .ga file (common in IWC workflows) for richer prose than the annotation field provides.

5. Procedure

The skill defines a four-step authoring procedure:

Step 1 — Parse the workflow

Extract from each step:

A distinction is emphasized: step.label is a short identifier suitable for directives, while step.annotation is a long prose description that must not be substituted into directive arguments.

Step 2 — Select which outputs to feature

Not every marked output should appear as a section. The skill encodes a selection heuristic:

Step 3 — Classify selected outputs to directives

A short type → directive table:

Output typeDirective
Image (TIFF, PNG, JPEG)history_dataset_as_image(output="…")
Collection of imageshistory_dataset_as_image(output="…") (same directive)
Tabular / TSV / CSVhistory_dataset_as_table(...) + history_dataset_link(...)
HTML / texthistory_dataset_embedded(output="…")
Unknownhistory_dataset_display(output="…")

For inputs: history_dataset_as_image(input="…") for image inputs; invocation_inputs() otherwise.

Step 4 — Build the report

A fixed section skeleton:

  1. Title + run timestamp (invocation_time()).
  2. Summary — one paragraph synthesized from name, annotation, step annotations; ends with workflow_image().
  3. Inputs — prose plus appropriate input directive.
  4. Key output sections — one per selected output, each with brief conditional prose plus its directive.
  5. Results — present when tabular outputs exist: a markdown table describing expected columns before the data directive, followed by history_dataset_as_table(...) and history_dataset_link(...).
  6. Reproducibilityhistory_link().

Optional sections: job_parameters(step=…, collapse=…) for analytically significant steps; invocation_outputs() when the full output listing is warranted; workflow_display(collapse=…) for the full step breakdown.

6. Authorial Discipline

The skill enforces a “templates are pre-run” stance. Three rules:

Annotations from the workflow definition are used to inform prose; the skill explicitly prohibits verbatim copying.

7. Documented Failure Modes (“Gotchas”)

The skill enumerates a small set of recurring issues and prescribed responses:

IssueResponse
step.label is nullSkip job_parameters(step=…) for that step; use it only where label is non-null.
A step whose output should be reportable has empty workflow_outputsSurface to the user; instruct them to star the output in the Workflow Editor and save. The directive cannot reference unmarked outputs.
An important terminal output (e.g. final column-computation step) is unmarkedName the step and what it produces; do not silently substitute an upstream output.
Step annotations are very longUse as prose source; never copy verbatim into report body.
Multiple image outputs across stagesPrefer the output closest to the final result.

After drafting, the skill requires the agent to explicitly flag any unmarked-but-needed outputs and any label-less steps referenced in prose.

8. Outputs

Two delivery modes:

Either way the deliverable is a self-contained markdown document combining prose, markdown column tables, and Galaxy directive blocks.

9. Example Material

examples/histology-staining.md is a complete worked artifact. It includes:

A second example, tissue-microarray-analysis.md, follows the same pattern for a different imaging workflow.

10. Coverage and Limits

Explicitly handled:

Out of scope:

11. Summary

workflow-reports is a single-purpose, self-contained skill that produces Galaxy markdown report templates from a workflow definition. It:

The skill is reference-heavy on directive syntax and procedure-light; once the input is parsed and outputs are classified, template assembly follows a deterministic skeleton.