ワンクリックで
skill-cslib-vet
Vet completed CSLib tasks against library standards. Invoke for /vet command.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Vet completed CSLib tasks against library standards. Invoke for /vet command.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Orchestrate multi-agent implementation with parallel phase execution. Spawns teammates for independent phases and coordinates dependent phases. Includes debugger teammate for error recovery.
Orchestrate multi-agent planning with parallel plan generation. Spawns 2-3 teammates for diverse planning approaches and synthesizes into final plan with trade-off analysis.
Orchestrate multi-agent research with wave-based parallel execution. Spawns 2-4 teammates for diverse investigation angles and synthesizes findings.
Full structural hard-mode orchestration state machine with per-phase dispatch (H1), adversarial verification (H4), convergence policing (H6), territory contracts (H7), and churn detection (H5). Invoke for /orchestrate --hard.
Autonomous state machine that drives a task through its full lifecycle (research -> plan -> implement -> complete) without user confirmation between phases. Invoke for /orchestrate command.
Execute hard-mode implementation with anti-analysis contracts, per-phase dispatch, and territory-aware execution. Invoke for --hard implementation tasks.
| name | skill-cslib-vet |
| description | Vet completed CSLib tasks against library standards. Invoke for /vet command. |
| allowed-tools | Agent, AskUserQuestion, Bash, Edit, Read, Write |
Thin wrapper that validates CSLib task inputs, identifies changed Lean files via git history,
prepares delegation context, and delegates vetting to cslib-vet-agent subagent. The agent
reads changed files, runs the CI pipeline, checks against all four standards documents, and
creates fix tasks interactively.
This skill activates when:
/vet command is invoked with task numbersValidate that task numbers exist in state.json:
cd /home/benjamin/Projects/cslib
for task_num in $TASK_NUMBERS; do
task_entry=$(jq --argjson num "$task_num" \
'.active_projects[] | select(.project_number == $num)' \
specs/state.json 2>/dev/null)
if [ -z "$task_entry" ]; then
echo "Error: Task $task_num not found in specs/state.json"
# Return failed status
fi
task_name=$(echo "$task_entry" | jq -r '.project_name')
task_type=$(echo "$task_entry" | jq -r '.task_type')
task_status=$(echo "$task_entry" | jq -r '.status')
echo "Task $task_num: $task_name (type=$task_type, status=$task_status)"
done
Generate a session ID if not passed from the command:
session_id="${session_id:-sess_$(date +%s)_$(od -An -N3 -tx1 /dev/urandom | tr -d ' ')}"
Note: The vet skill does NOT change task status. Vetting is orthogonal to the task
lifecycle (not_started -> researching -> researched -> planned -> implementing
-> pr_ready -> completed). Vet operates on tasks in ANY status.
For each task number, identify Lean files changed by that task using git history:
cd /home/benjamin/Projects/cslib
CHANGED_FILES_MAP="{}"
for task_num in $TASK_NUMBERS; do
echo "Finding files changed by task $task_num..."
# Primary: git history via commit messages matching "task N:"
lean_files=$(git log --all --format="%H" --grep="task ${task_num}:" \
| xargs -I{} git show --name-only --format="" {} \
| grep "^Cslib/" \
| sort -u 2>/dev/null)
# Fallback: uncommitted changes if no commits found
if [ -z "$lean_files" ]; then
echo " No commits found for task $task_num — checking uncommitted changes..."
lean_files=$(git diff --name-only HEAD -- Cslib/ 2>/dev/null)
if [ -z "$lean_files" ]; then
lean_files=$(git diff --cached --name-only -- Cslib/ 2>/dev/null)
fi
if [ -z "$lean_files" ]; then
lean_files=$(git status --porcelain -- Cslib/ 2>/dev/null | awk '{print $2}' | grep "^Cslib/")
fi
fi
if [ -z "$lean_files" ]; then
echo " Warning: No Lean files found for task $task_num (no commits matching 'task ${task_num}:' and no uncommitted changes)."
else
file_count=$(echo "$lean_files" | grep -c "." 2>/dev/null || echo 0)
echo " Found $file_count Lean file(s) for task $task_num"
echo "$lean_files" | while read -r f; do
echo " - $f"
done
fi
# Store as newline-separated list per task
CHANGED_FILES_MAP="${CHANGED_FILES_MAP}|${task_num}:${lean_files}"
done
Build the delegation context for cslib-vet-agent:
{
"session_id": "{session_id}",
"delegation_depth": 1,
"delegation_path": ["orchestrator", "vet", "skill-cslib-vet"],
"timeout": 3600,
"task_context": {
"task_numbers": [{task_numbers_array}],
"task_names": [{task_names_array}],
"task_types": [{task_types_array}]
},
"changed_files": {
"{task_num_1}": ["{file_1}", "{file_2}"],
"{task_num_2}": ["{file_3}"]
},
"focus_prompt": "{optional focus from user}",
"cslib_dir": "/home/benjamin/Projects/cslib",
"standards_paths": {
"contributing": "CONTRIBUTING.md",
"notation": "NOTATION.md",
"organisation": "ORGANISATION.md",
"code_of_conduct": "CODE_OF_CONDUCT.md"
},
"metadata_file_path": "specs/270_create_vet_command_skill_agent/.return-meta.json"
}
Note on metadata_file_path: Use the actual task directory for the vetted tasks. For the
vet operation itself, the metadata path should be specs/{NNN}_{SLUG}/.return-meta.json where
NNN/SLUG refer to the vet invocation context (if any). Since /vet is a standalone command
(not tied to a specific task number), the agent writes metadata to the cslib-vet-agent's own
working directory. The skill should set this to a temp path under .claude/tmp/ or use the
first task's directory:
# Use the first task's directory as the metadata home for this vet run
first_task_num=$(echo "$TASK_NUMBERS" | awk '{print $1}')
task_name=$(jq -r --argjson num "$first_task_num" \
'.active_projects[] | select(.project_number == $num) | .project_name' \
/home/benjamin/Projects/cslib/specs/state.json)
task_num_padded=$(printf '%03d' "$first_task_num")
task_dir="/home/benjamin/Projects/cslib/specs/${task_num_padded}_${task_name}"
mkdir -p "$task_dir"
metadata_file_path="specs/${task_num_padded}_${task_name}/.vet-meta.json"
Use Agent tool with subagent_type: "cslib-vet-agent" and pass the delegation context
as a JSON string in the prompt. The agent will:
CRITICAL: If you performed the work above WITHOUT using the Agent tool (i.e., you read
files, analyzed violations, or created tasks directly instead of spawning a subagent), you
MUST write a .return-meta.json file now before proceeding to postflight. Use the appropriate
status value.
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 done by a subagent or inline. Do NOT skip these stages for any reason.
Read the metadata and findings files from the paths set in Stage 3:
if [ -f "$task_dir/.vet-meta.json" ]; then
return_status=$(jq -r '.status' "$task_dir/.vet-meta.json" 2>/dev/null)
violations_found=$(jq -r '.violations_found // 0' "$task_dir/.vet-meta.json" 2>/dev/null)
files_analyzed=$(jq -r '.files_analyzed // 0' "$task_dir/.vet-meta.json" 2>/dev/null)
ci_passed=$(jq -r '.ci_passed // false' "$task_dir/.vet-meta.json" 2>/dev/null)
summary=$(jq -r '.summary // "Vet completed"' "$task_dir/.vet-meta.json" 2>/dev/null)
echo "Vet status: $return_status"
echo "Violations found: $violations_found"
else
echo "Warning: Metadata file not found at $task_dir/.vet-meta.json"
return_status="partial"
fi
Read the findings file written by the agent:
findings_file="$task_dir/.vet-findings.json"
if [ -f "$findings_file" ]; then
echo "Findings file found at $findings_file"
# Read using the Read tool for structured access
else
echo "Warning: Findings file not found — agent may have been interrupted"
# Skip interactive stages, go to Stage 9
fi
If no violations were found (violations_found == 0), display:
Vet complete: No violations found. CI pipeline PASSED.
Skip to Stage 9.
Use AskUserQuestion to present the categorized violations and let the user select which categories should become fix tasks.
First, display a summary of findings:
Vet Results for Task(s) {task_numbers}
=======================================
Files analyzed: {count}
CI pipeline: {PASSED/FAILED}
Violations Found: {total} total
Critical: {N}
High: {N}
Medium: {N}
Low: {N}
Then use AskUserQuestion with multiSelect: true. Build options dynamically from the
categories array in .vet-findings.json. Only include categories that have at least one
violation:
{
"question": "Which violation categories should become fix tasks?",
"header": "Fix",
"multiSelect": true,
"options": [
{
"label": "{category_name} ({severity}) -- {N} issue(s)",
"description": "{brief description of violations in this category}"
}
]
}
Always include a final option:
{
"label": "No fix tasks needed",
"description": "Accept current state without creating fix tasks"
}
If the user selects "No fix tasks needed" or selects nothing:
If the user selects one or more categories, IMMEDIATELY CONTINUE to Stage 7.
Read the suggested_fix_tasks from .vet-findings.json. Filter to only those whose violations
belong to user-selected categories. Present the proposed fix tasks:
Proposed Fix Tasks
==================
{N} fix task(s) will be created:
| # | Title | Type | Severity | Violations |
|---|-------|------|----------|------------|
| 1 | {task_1_title} | cslib | {severity} | {N} |
Use AskUserQuestion (single-select) for final confirmation:
{
"question": "Create these {N} fix task(s) in state.json?",
"header": "Confirm",
"multiSelect": false,
"options": [
{
"label": "Yes, create tasks",
"description": "Create {N} cslib fix task(s) and add to TODO.md"
},
{
"label": "Revise -- go back to selection",
"description": "Return to Stage 6 to modify which categories to fix"
},
{
"label": "Cancel -- no tasks",
"description": "Exit without creating any fix tasks"
}
]
}
For each confirmed fix task from the filtered suggested_fix_tasks, create an entry in
state.json:
cd /home/benjamin/Projects/cslib
now=$(date -u +%Y-%m-%dT%H:%M:%SZ)
# For each fix task:
next_num=$(jq '.next_project_number' specs/state.json)
jq \
--argjson next_num "$next_num" \
--arg slug "$slug" \
--arg title "$title" \
--arg desc "$description" \
--arg tt "cslib" \
--arg now "$now" \
'.next_project_number = ($next_num + 1) |
.active_projects = [{
project_number: $next_num,
project_name: $slug,
status: "not_started",
task_type: $tt,
title: $title,
description: $desc,
created: $now,
last_updated: $now,
next_artifact_number: 1,
artifacts: []
}] + .active_projects' \
specs/state.json > specs/state.json.tmp && mv specs/state.json.tmp specs/state.json
echo "Created fix task #$next_num: $title"
# After all tasks created:
bash .claude/scripts/generate-todo.sh
echo "TODO.md regenerated."
If any fix tasks were created, commit the state changes:
cd /home/benjamin/Projects/cslib
if git status --porcelain specs/state.json specs/TODO.md | grep -q .; then
git add specs/state.json specs/TODO.md
git commit -m "vet task(s) $TASK_NUMBERS: create fix tasks
Session: $session_id"
echo "Fix tasks committed."
else
echo "No state changes to commit (no fix tasks created)."
fi
Return a brief text summary (3-6 bullets):
After the agent returns, this skill MUST NOT:
The postflight phase is LIMITED TO:
Brief text summary (NOT JSON).