一键导入
skill-financial-analysis
Financial analysis with forcing questions and spreadsheet generation
菜单
Financial analysis with forcing questions and spreadsheet generation
Scan codebase for FIX:/NOTE:/TODO:/QUESTION: tags and create structured tasks with interactive selection. Invoke for /fix-it command.
Interactive repository analysis and project-overview.md generation via task creation. Invoke for /project-overview command.
Research blockers and spawn new tasks to overcome them, updating parent task dependencies
Archive completed and abandoned tasks with CHANGE_LOG.md updates and memory harvest suggestions
Execute general implementation tasks following a plan. Invoke for general implementation work.
Create phased implementation plans from research findings. Invoke when a task needs an implementation plan.
| name | skill-financial-analysis |
| description | Financial analysis with forcing questions and spreadsheet generation |
| allowed-tools | Agent, Bash, Edit, Read, Write |
Thin wrapper that routes financial analysis research requests to the financial-analysis-agent.
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.
Reference (do not load eagerly):
.claude/context/formats/return-metadata-file.md - Metadata file schema.claude/context/patterns/jq-escaping-workarounds.md - jq escaping patterns (Issue #1132)Note: This skill is a thin wrapper. Context is loaded by the delegated agent, not this skill.
This skill activates when:
/research on a task with language founder:financial-analysisDo not invoke for:
Validate required inputs:
task_number - Must be provided and exist in state.jsonmode - Optional, one of: REVIEW, DILIGENCE, AUDIT, FORECAST# Lookup task
task_data=$(jq -r --argjson num "$task_number" \
'.active_projects[] | select(.project_number == $num)' \
specs/state.json)
# Validate exists
if [ -z "$task_data" ]; then
return error "Task $task_number not found"
fi
# Extract fields
task_type=$(echo "$task_data" | jq -r '.task_type // "founder"')
status=$(echo "$task_data" | jq -r '.status')
project_name=$(echo "$task_data" | jq -r '.project_name')
description=$(echo "$task_data" | jq -r '.description // ""')
forcing_data=$(echo "$task_data" | jq -r '.forcing_data // null')
bash .claude/scripts/update-task-status.sh preflight "$task_number" research "$session_id"
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-financial-analysis",
"task_number": ${task_number},
"operation": "research",
"reason": "Postflight pending: status update, artifact linking, git commit",
"created": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"stop_hook_active": false
}
EOF
artifact_number=$(jq -r --argjson num "$task_number" \
'.active_projects[] | select(.project_number == $num) | .next_artifact_number // 1' \
specs/state.json)
artifact_padded=$(printf "%02d" "$artifact_number")
{
"session_id": "{session_id}",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "research", "skill-financial-analysis"],
"timeout": 3600,
"task_context": {
"task_number": "{N}",
"task_name": "{project_name}",
"description": "{description}",
"task_type": "{task_type}"
},
"artifact_number": "{artifact_number}",
"mode": "{mode if provided}",
"forcing_data": "{forcing_data from state.json if present}",
"metadata_file_path": "specs/{NNN}_{SLUG}/.return-meta.json"
}
CRITICAL: Use the Agent tool to spawn the subagent.
Tool: Agent (NOT Skill, NOT Plan)
Parameters:
- subagent_type: "financial-analysis-agent"
- prompt: [Include task_context, delegation_context, forcing_data]
- description: "Execute financial analysis for task {N}"
The subagent will:
CRITICAL: If you performed the work above WITHOUT using the Agent tool (i.e., you read files,
wrote artifacts, or updated metadata directly instead of spawning a subagent), you MUST write a
.return-meta.json file now before proceeding to postflight. Use the schema from
return-metadata-file.md with the appropriate status value for this operation.
If you DID use the Agent tool, skip this stage -- the subagent already wrote the metadata.
The following stages MUST execute after work is complete, whether the work was done by a subagent or inline (Stage 5b). Do NOT skip these stages for any reason.
metadata_file="specs/${padded_num}_${project_name}/.return-meta.json"
if [ -f "$metadata_file" ] && jq empty "$metadata_file" 2>/dev/null; then
status=$(jq -r '.status' "$metadata_file")
# Extract artifacts array
else
status="failed"
fi
if [ "$status" = "researched" ]; then
bash .claude/scripts/update-task-status.sh postflight "$task_number" research "$session_id"
# Increment next_artifact_number
jq '(.active_projects[] | select(.project_number == '$task_number')).next_artifact_number =
(((.active_projects[] | select(.project_number == '$task_number')).next_artifact_number // 1) + 1)' \
specs/state.json > specs/tmp/state.json && mv specs/tmp/state.json specs/state.json
fi
Link all artifacts (research report, spreadsheet, metrics JSON) to state.json using two-step jq pattern.
Update TODO.md: Link artifact per @.claude/context/patterns/artifact-linking-todo.md with field_name=**Research**, next_field=**Plan**.
git add -A
git commit -m "task ${task_number}: complete financial analysis research
Session: ${session_id}
rm -f "specs/${padded_num}_${project_name}/.postflight-pending"
rm -f "specs/${padded_num}_${project_name}/.return-meta.json"
Financial analysis research complete for task {N}:
- Mode: {MODE}, forcing questions completed
- Generated XLSX, JSON metrics, and research report
- Status updated to [RESEARCHED]
After the agent returns, this skill MUST NOT:
The postflight phase is LIMITED TO:
update-task-status.sh for status updatesnext_artifact_number via jqReference: @.claude/context/standards/postflight-tool-restrictions.md