Help us improve
Share bugs, ideas, or general feedback.
From claudecode-research-harness-workflow
Executes approved analysis tasks from analysis_plan.md by writing reproducible scripts, running them, saving logs and outputs, and updating task statuses.
npx claudepluginhub maxwell2732/claudecode-research-harness-workflow --plugin claudecode-research-harness-workflowHow this skill is triggered — by the user, by Claude, or both
Slash command
/claudecode-research-harness-workflow:research-harness-work [TASK-ID] [all] [--no-commit][TASK-ID] [all] [--no-commit]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute approved analysis tasks from `analysis_plan.md`. For each task, write a reproducible script, run it, verify the log exists, and update the evidence ledger.
Generates an executable empirical analysis plan from study_spec.md, audit report, and cleaned data structure. Outputs analysis_plan.md for human approval before analysis execution.
Executes pre-registered analysis plans with review checkpoints, validating each step and reporting results. Useful for reproducible data analysis without subagents.
Executes analysis tasks with output-first verification where every step produces visible results. Phase 3 of the /ds workflow, invoked by ds-plan chain.
Share bugs, ideas, or general feedback.
Execute approved analysis tasks from analysis_plan.md. For each task, write a reproducible script, run it, verify the log exists, and update the evidence ledger.
This skill runs after /research-harness-plan (human-approved) and before /research-harness-review.
| Input | Action |
|---|---|
/research-harness-work 1.1 | Execute task 1.1 from analysis_plan.md |
/research-harness-work 2 | Execute all tasks in stage 2 sequentially |
/research-harness-work all | Execute all cc:todo tasks sequentially |
/research-harness-work --no-commit | Execute without committing; leave outputs for review |
Default behavior with no argument: ask the user which task or stage to run. Do not auto-select.
Before executing any task:
analysis_plan.md. If it does not exist, stop and tell the user to run /research-harness-plan first.analysis_plan.md and its status is cc:todo or cc:wip. Do not re-execute cc:done tasks without explicit user instruction.analysis_plan.md exists under data/processed/.cc:blocked status: report the blocking reason and stop. Do not work around a blocked task.From analysis_plan.md, read for the specified task:
If the task has unresolved questions: stop and list them. Ask the user to resolve them before the task runs.
Mark the task cc:wip in analysis_plan.md.
Write the script at the path specified in the task definition.
Script requirements:
study_spec.md §2R template for regression task:
# Study: <study name>
# Task: <task-id> — <task description>
# Identification: <tag from study_spec.md>
# Date: YYYY-MM-DD
# Analyst: Claude Code
library(here)
log_file <- here("analysis", "<stage>", "logs", "<task>.log")
sink(log_file, append = FALSE, split = TRUE)
cat("Task:", "<task-id>", "\n")
cat("Started:", format(Sys.time()), "\n\n")
# Load
df <- read.csv(here("data", "processed", "analysis_ready.csv"))
cat("Loaded:", nrow(df), "rows\n")
# Sample restriction (if task-specific)
n_before <- nrow(df)
df <- df[<restriction>, ]
cat("After restriction:", nrow(df), "rows (dropped:", n_before - nrow(df), ")\n")
# Model
fit <- lm(<formula>, data = df)
cat("\n=== Results ===\n")
print(summary(fit))
# Save output
write.csv(broom::tidy(fit), here("output", "tables", "<task>.csv"), row.names = FALSE)
cat("\nOutput written to: output/tables/<task>.csv\n")
cat("Finished:", format(Sys.time()), "\n")
sink()
Do not hard-code numerical results into the script. The script computes them; the log records them.
Run the script. Capture the exit code and the full log output.
analysis_plan.md under the task. Mark the task cc:blocked. Tell the user what failed and why.Do not continue to the next step if the script did not exit with code 0.
After a successful run, verify:
If any verification fails: do not mark the task cc:done. Report what is missing.
Add an evidence row to the Evidence Ledger in analysis_plan.md:
| Task | Script | Log | Output | Verified | Date |
|---|---|---|---|---|---|
| 1.1 | analysis/descriptive/scripts/table1.R | analysis/descriptive/logs/table1.log | output/tables/table1.csv | YES | YYYY-MM-DD |
Mark the task status cc:done.
Print a task completion summary:
Task 1.1 — Complete
Script: analysis/descriptive/scripts/table1.R
Log: analysis/descriptive/logs/table1.log [exists: YES]
Output: output/tables/table1.csv [exists: YES]
Status: cc:done
Key results from log:
N = <value from log>
[other key stats from log]
Next task: 1.2 or run /research-harness-work 1.2
Do not paraphrase or interpret the results. Quote them from the log.
cc:done unless the log file and output file both existanalysis_plan.md task scope without recording the change under the taskcc:blocked without user instructionanalysis_plan.md without user instructionanalysis_plan.mdcc:done in analysis_plan.mdanalysis_plan.mdanalysis_plan.mdcc:doneIf a task fails after 3 attempts:
analysis_plan.md under the task:
cc:blockedDo not invent output, use estimated values, or continue as if the task completed.
After all approved tasks are complete:
All requested tasks are done. Review
analysis_plan.mdto confirm all expected tasks arecc:done.When ready, run
/research-harness-reviewto check identification, numerical accuracy, and causal claims before release.