Research skill for epidemiology study design and analysis planning. Invoke for epi/epi:study research tasks.
name skill-epi-research description Research skill for epidemiology study design and analysis planning. Invoke for epi/epi:study research tasks. allowed-tools Task, Bash, Edit, Read, Write, AskUserQuestion Epi Research Skill Thin wrapper that delegates epidemiology research to epi-research-agent subagent. IMPORTANT : This skill implements the skill-internal postflight pattern. After the subagent returns, this skill handles all postflight operations (status update, artifact linking, git commit) before returning. Context References Reference (do not load eagerly): Path: .claude/context/formats/return-metadata-file.md
else
return
error
"Task
$task_number
is not an epi task (task_type=
$task_type
)"
fi
Stage 2: Preflight Status Update
state.json status
TODO.md marker
researching
[RESEARCHING]
jq --arg ts
"
$(date -u +%Y-%m-%dT%H:%M:%SZ)
"
--arg status
"researching"
--arg sid
"
$session_id
"
'(.active_projects[] | select(.project_number == '
$task_number
')) |= . + {
status: $status,
last_updated: $ts,
session_id: $sid
}'
specs/state.json > specs/tmp/state.json &&
mv
specs/tmp/state.json specs/state.json
Stage 3: Create Postflight Marker
padded_num=$(
printf
"%03d"
"
$task_number
"
)
mkdir
-p
"specs/
${padded_num}
_
${project_name}
"
cat
"specs/ ${padded_num} _ ${project_name} /.postflight-pending" << EOF { "session_id": "${session_id}", "skill": "skill-epi-research", "task_number": ${task_number}, "operation": "epi_research", "reason": "Postflight pending: status update, artifact linking, git commit", "created": "$(date -u +%Y-%m-%dT%H:%M:%SZ)", "stop_hook_active": false } EOF Stage 4: Prepare Delegation Context { "session_id" : "sess_{timestamp}{random}" , "delegation_depth" : 1 , "delegation_path" : [ "orchestrator" , "research" , "skill-epi-research" ] , "timeout" : 3600 , "task_context" : { "task_number" : N , "task_name" : "{project_name}" , "description" : "{description}" , "task_type" : "{task_type}" } , "workflow_type" : "epi_research" , "forcing_data" : "{from state.json task metadata: study_design, data_paths, etc.}" , "metadata_file_path" : "specs/{NNN}{SLUG}/.return-meta.json" } Stage 5: Invoke Subagent CRITICAL : Use the Task tool to spawn the subagent. Tool: Task (NOT Skill) Parameters:
Session: ${session_id} " Stage 10: Cleanup rm -f "specs/ ${padded_num} _ ${project_name} /.postflight-pending" rm -f "specs/ ${padded_num} _ ${project_name} /.postflight-loop-guard" rm -f "specs/ ${padded_num} _ ${project_name} /.return-meta.json" Stage 11: Return Brief Summary Research Success : Epi research completed for task {N}: