Data Analysis

hierarchical-clustering-plot

Use when building a sample-level hierarchical clustering dendrogram from a bulk expression matrix and sample annotation table, especially for QC, batch inspection, or sample similarity assessment. Trigger keywords: hierarchical clustering, dendrogram, sample QC, batch inspection, sample similarity. NOT for: differential expression testing, gene clustering heatmaps, single-cell clustering workflows.

91100Total Score
Core Capability
95 / 100
Functional Suitability
12 / 12
Reliability
11 / 12
Performance & Context
8 / 8
Agent Usability
16 / 16
Human Usability
8 / 8
Security
11 / 12
Maintainability
12 / 12
Agent-Specific
17 / 20
Medical Task
24 / 25 Passed
92Default euclidean/complete clustering on 40-sample expression matrix
5/5
90Average linkage with sample ID labels
5/5
86Invalid distance method and missing required group file
5/5
88Manhattan distance and ward.D2 linkage options
5/5
83Timeout behavior and temp workspace cleanup
4/5

Veto GatesRequired pass for any deployment consideration

Skill Veto✓ All 4 gates passed
✓
Operational Stability
System remains stable across varied inputs and edge cases
PASS
✓
Structural Consistency
Output structure conforms to expected skill contract format
PASS
✓
Result Determinism
Equivalent inputs produce semantically equivalent outputs
PASS
✓
System Security
No prompt injection, data leakage, or unsafe tool use detected
PASS
Research Veto✓ PASS — Applicable
DimensionResultDetail
Scientific IntegrityPASS
No fabricated statistics; hierarchical clustering uses base R dist() and hclust(); output is a distance matrix and dendrogram only; no statistical claims generated
Practice BoundariesPASS
No diagnostic conclusions; output is a sample similarity visualization; no medical claims; clearly scoped to QC and batch inspection
Methodological GroundPASS
Complete linkage with Euclidean distance is a methodologically sound default for expression QC; multiple distance and linkage options correctly implemented; no causal claims
Code UsabilityPASS
Script runs successfully in test environment; two full runs completed without error; error paths confirmed; set.seed() present; temp workspace staging is robust

Core Capability95 / 100 — 8 Categories

Functional Suitability
All use cases covered; 6 distance methods and 8 linkage methods; 5 output files; NOT for exclusions precise
12 / 12
100%
Reliability
13 SKILL_* error codes; temp workspace staging prevents partial output; set.seed() present; SKILL_MEMORY_WARNING with gc() reporting; Category 3 Override: hard stops are correct design
11 / 12
92%
Performance & Context
SKILL.md is 278 lines; 15 referenced files well-organized across scripts/ and references/; memory usage reported at each step
8 / 8
100%
Agent Usability
When to Read External Files table maps every concern to the correct script file; step-by-step workflow in SKILL.md references the correct scripts; excellent agent learnability
16 / 16
100%
Human Usability
Trigger keywords listed in description and When to Use; NOT for exclusions prevent misfiring; maximum discoverability
8 / 8
100%
Security
No credentials; no dangerous operations; temp workspace pattern prevents output pollution; file paths from CLI only
11 / 12
92%
Maintainability
Eight-file modular structure; testthat test suite (tests/testthat/test-clustering.R); test runner (tests/run_tests.R); test data bundled; references documented
12 / 12
100%
Agent-Specific
Trigger description precise with keywords and NOT-for; excellent progressive disclosure; escape hatches present; minor composability friction from dual required inputs
17 / 20
85%
Core Capability Total95 / 100

Medical TaskExecution Average: 87.8 / 100 — Assertions: 24/25 Passed

92
Canonical
Default euclidean/complete clustering on 40-sample expression matrix
5/5 ✓
90
Variant A
Average linkage with sample ID labels
5/5 ✓
86
Edge
Invalid distance method and missing required group file
5/5 ✓
88
Variant B
Manhattan distance and ward.D2 linkage options
5/5 ✓
83
Stress
Timeout behavior and temp workspace cleanup
4/5 ✓
92
CanonicalPass
Default euclidean/complete clustering on 40-sample expression matrix

Full execution in < 2 seconds; 40 matched samples, 21 features; all 5 output files confirmed; memory usage logged at each step

Basic 37/40|Specialized 55/60|Total 92/100
A1All five output files created (PDF + 3 CSVs + session_info.txt)
A2Matched samples count and features used reported in INFO log
A3Memory usage reported at each step in MB
A4set.seed(opt$seed) called in run_analysis.R
A5No security issues in 8-file modular structure
Pass rate: 5 / 5
90
Variant APass
Average linkage with sample ID labels

Full execution successful; linkage=average and label_column=sample confirmed in log; all outputs correct

Basic 36/40|Specialized 54/60|Total 90/100
A1--linkage_method average accepted and reflected in execution log
A2--label_column sample overrides default second-column label
A3clustering_order.csv contains plot_order, sample_id, and label columns
A4All five output files present after variant run
A5Analysis completes without error on different linkage method
Pass rate: 5 / 5
86
EdgePass
Invalid distance method and missing required group file

Both error paths tested and confirmed in live execution; SKILL_INVALID_PARAMETER and SKILL_FILE_NOT_FOUND both fire correctly

Basic 34/40|Specialized 52/60|Total 86/100
A1SKILL_INVALID_PARAMETER fires with specific unsupported distance method name
A2Error fires at Step 3 after data loading rather than at argument parsing
A3Script exits after error without writing partial outputs
A4SKILL_FILE_NOT_FOUND fires for nonexistent input file
A5SKILL_INVALID_PARAMETER fires when --group_file is missing
Pass rate: 5 / 5
88
Variant BPass
Manhattan distance and ward.D2 linkage options

All distance and linkage options confirmed in --help and SKILL.md; validation of invalid method confirmed in Edge test; live ward.D2 run not executed

Basic 35/40|Specialized 53/60|Total 88/100
A1All 6 distance methods documented in --help and SKILL.md
A2All 8 linkage methods documented in --help and SKILL.md
A3Validation rejects unsupported methods with SKILL_INVALID_PARAMETER
A4ward.D and ward.D2 both listed as valid linkage options
A5Distance and linkage passed to base R dist() and hclust()
Pass rate: 5 / 5
83
StressPass
Timeout behavior and temp workspace cleanup

Timeout mechanism and temp workspace cleanup confirmed in code; SKILL_TIMEOUT and SKILL_MEMORY_WARNING documented; live timeout test not feasible on small dataset

Basic 33/40|Specialized 50/60|Total 83/100
A1--timeout_seconds argument confirmed and setTimeLimit() called in runtime_utils.R
A2Temp workspace cleanup via on.exit() confirmed in run_analysis.R
A3SKILL_TIMEOUT error code documented in Error Handling table
A4SKILL_MEMORY_WARNING documented with gc() reporting
A5SKILL_TIMEOUT live-tested with 1-second limit
Pass rate: 4 / 5
Medical Task Total87.8 / 100

Key Strengths

  • When to Read External Files table maps every operational concern to the specific script file, making agent-side debugging deterministic
  • Temp workspace staging pattern ensures atomic output: either all files are written or none are
  • 13 distinct SKILL_* error codes including SKILL_MEMORY_WARNING and SKILL_PLOT_ERROR cover edge cases not seen in sibling skills
  • testthat test suite (tests/testthat/test-clustering.R) and test runner enable formal regression testing
  • Memory usage reporting with gc() at each step is unique in the collection and valuable for large datasets