用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill ds-implement命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
LLM token logprobs and calibration. Per-decision confidence, ECE, Brier, reliability diagrams, low-confidence triage.
Analyze LLM token logprobs and calibration. Use for per-decision confidence, ECE, Brier scores, reliability diagrams, and low-confidence triage.
回顾最近 N 天的 Claude Code 使用记录——扫描原始会话数据,按主题分组汇总"我都做了什么",并从个人操作系统视角输出模式、风险与增删建议。当用户说 /recap、"看看我这几天做了什么"、"回顾一下我最近的会话"、"这两天我用 claude 干了啥"、"活动回顾" 时使用。
基于 SOC 职业分类
正在显示 SKILL.md
| name | ds-implement |
| description | REQUIRED Phase 3 of /ds workflow. Enforces output-first verification at each step. |
Apply output-first verification at every step of analysis implementation. This is Phase 3 of the /ds workflow.
references/verification-patterns.mdImplement analysis with mandatory visible output at every step. NO TDD - instead, every code step MUST produce and verify output.
## The Iron Law of DS ImplementationEVERY CODE STEP MUST PRODUCE VISIBLE OUTPUT. This is not negotiable.
Before moving to the next step, you MUST:
This applies even when YOU think:
If you're about to write code without outputting results, STOP.
You orchestrate. Subagents analyze. For every task in PLAN.md, use the delegation skill:
Read("${CLAUDE_PLUGIN_ROOT}/lib/skills/ds-delegate/SKILL.md")
This is MANDATORY. ds-delegate contains the Task agent templates, output-first protocol details, methodology review patterns, and rationalization prevention. Do not attempt to summarize or shortcut it.
If you're about to write analysis code directly, STOP and read ds-delegate.
If you wrote analysis code in main chat, DELETE it immediately and dispatch a Task agent instead. Code written in main chat is contaminated by orchestrator context and must not be kept.
| DO | DON'T |
|---|---|
| Print shape after each transform | Chain operations silently |
| Display sample rows | Trust transformations work |
| Show summary stats | Wait until end to check |
| Verify row counts | Assume merges worked |
| Check for unexpected nulls | Skip intermediate checks |
| Plot distributions | Move on without looking |
The Mantra: If not visible, it cannot be trusted.
| Thought | Why It's Wrong | Do Instead |
|---|---|---|
| "I'll check at the end" | STOP - you're letting errors compound silently | Check after every step |
| "This transform is simple" | STOP - simple code can still be wrong | Output and verify |
| "I know merge worked" | STOP - you've assumed this before and been wrong | Check row counts |
| "Data looks fine" | STOP - you're confusing "looks" with verification | Print stats, show samples |
| "I'll batch the outputs" | STOP - you're about to lose your ability to isolate issues | Output per operation |
| "Just a quick plot in main chat" | STOP - you're about to violate delegation | Spawn a Task agent |
After prerequisites pass and PLAN.md verified, check for parallelization potential:
Skip this choice when:
after N with no independent groups)CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS is not availableOtherwise, ask the user:
AskUserQuestion(questions=[{
"question": "How should we implement the analysis tasks in PLAN.md?",
"header": "Strategy",
"options": [
{"label": "Sequential (Default)", "description": "One task at a time with output-first verification. Safest, most DS work is sequential."},
{"label": "Agent team (parallel)", "description": "Spawn analyst per independent task group. Only for truly independent analysis branches (descriptive stats by subgroup, model comparisons). Requires reconciliation."}
],
"multiSelect": false
}])
If Sequential: Proceed to Implementation Process below (current behavior).
If Agent team: Skip to Agent Team Implementation (Parallel).
Read(".claude/PLAN.md")
Read("${CLAUDE_PLUGIN_ROOT}/lib/skills/ds-delegate/SKILL.md")
Follow the task order defined in the plan. Use ds-delegate's templates for every task.
For each task in PLAN.md:
Document every significant step:
## Task N: [Description] - COMPLETE
**Input:** [Describe input state]
**Operation:** [What was done]
**Output:**
- Shape: [final shape]
- Key findings: [observations]
**Verification:** [How you confirmed it worked]
**Next:** [What comes next]
See references/verification-patterns.md for detailed code patterns for:
| Failure | Why It Happens | Prevention |
|---|---|---|
| Silent data loss | Merge drops rows | Print row counts before/after |
| Hidden nulls | Join introduces nulls | Check null counts after joins |
| Wrong aggregation | Groupby logic error | Display sample groups |
| Type coercion | Pandas silent conversion | Verify dtypes after load |
| Off-by-one | Date filtering edge cases | Print min/max dates |
Never hide failures. Bad output documented is better than silent failure.
| Thought | Reality |
|---|---|
| "Task done, should check in with user" | You're wasting context. User wants ALL tasks done. Keep going. |
| "User might want to see intermediate results" | You're assuming wrong. User will see results at the END. Continue. |
| "Natural pause point" | You're making excuses. Only pause when ALL tasks complete or you're blocked. |
| "Should summarize this step" | You're procrastinating. Summarize AFTER all tasks. Keep moving. |
Your pausing between tasks is procrastination disguised as courtesy.
Before spawning any teammates:
Deps column annotationsDeps: — (no dependencies) can run in parallelDeps: after N form dependency chains — keep these sequential within one teammateExample grouping from a PLAN.md:
Task 0: Data cleaning (Deps: —) → Run sequentially FIRST (foundation task)
Task 1: Descriptive stats by region (Deps: after 0) → Teammate A
Task 2: Descriptive stats by year (Deps: after 0) → Teammate B (parallel with A)
Task 3: Logit model (Deps: after 0) → Teammate C (parallel with A, B)
Task 4: Probit model (Deps: after 0) → Teammate D (parallel with A, B, C)
Task 5: Comparison table (Deps: after 3, 4) → Run sequentially AFTER (needs all results)
Foundation tasks (like data cleaning or ETL) that everything depends on must complete BEFORE spawning parallel teammates. Run these sequentially first using normal ds-delegate loops.
Reconciliation tasks (like comparison tables) that need all parallel results must run AFTER teammates complete.
TaskCreate per independent task/group:
Analyze: [Task Name(s)]Each teammate receives this self-contained prompt. Teammates start with a blank conversation and do NOT auto-load skills. The prompt must contain everything they need.
Before spawning, substitute these variables:
TASK_NAME → task name(s) from PLAN.mdTASK_DETAILS → full task text pasted from PLAN.md (not a file reference)SPEC_CONTEXT → relevant section of SPEC.md pasted inline (objective, methodology requirements)DATA_SCOPE → specific datasets/subsets this teammate may use (prevents conflicts)OUTPUT_FILES → specific output files this teammate will create (prevents overwrites)PREVIOUS_WORK → relevant entries from LEARNINGS.md (foundation task results)PLUGIN_ROOT → resolved value of ${CLAUDE_PLUGIN_ROOT}You are implementing one analysis task as part of a data science team. You have EXCLUSIVE
ownership of the data scope and output files listed below. Do not modify outputs outside your scope.
## Your Assignment
Task: {TASK_NAME}
### Task Details (from PLAN.md)
{TASK_DETAILS}
### Analysis Objective (from SPEC.md)
{SPEC_CONTEXT}
### Previous Work (from LEARNINGS.md)
{PREVIOUS_WORK}
## Data Scope (EXCLUSIVE — do not use data outside this scope)
{DATA_SCOPE}
If you discover you need data NOT in your scope, STOP and message the lead:
"Need access to [dataset/subset] which is outside my scope. Reason: [why]."
## Output Files (EXCLUSIVE — do not modify files outside this list)
{OUTPUT_FILES}
If you need to create an output file NOT in this list, STOP and message the lead.
## Iron Law of Output-First Verification (Non-Negotiable)
**EVERY CODE STEP MUST PRODUCE VISIBLE OUTPUT. This is not negotiable.**
Before moving to the next step, you MUST:
1. Run the code
2. See the output (print, display, plot)
3. Verify output is correct/reasonable
4. Document what you observed
5. Only THEN proceed to next step
**If you're about to write code without outputting results, STOP.**
### What Output-First Means
| DO | DON'T |
|-------|----------|
| Print shape after each transform | Chain operations silently |
| Display sample rows | Trust transformations work |
| Show summary stats | Wait until end to check |
| Verify row counts | Assume merges worked |
| Check for unexpected nulls | Skip intermediate checks |
| Plot distributions | Move on without looking |
### Rationalization Prevention
| Thought | Reality |
|---------|---------|
| "I'll check at the end" | STOP — you're letting errors compound silently. Check after every step. |
| "This transform is simple" | STOP — simple code can still be wrong. Output and verify. |
| "I know merge worked" | STOP — you've assumed this before and been wrong. Check row counts. |
| "Data looks fine" | STOP — you're confusing "looks" with verification. Print stats, show samples. |
| "I'll batch the outputs" | STOP — you're about to lose your ability to isolate issues. Output per operation. |
## Step 1: Load Analysis Protocol
Read("{PLUGIN_ROOT}/lib/skills/ds-delegate/SKILL.md")
This contains the detailed output-first protocol and verification patterns.
## Step 2: Implement with Output-First Protocol
For EVERY operation (load, filter, merge, transform, model):
1. **BEFORE:** Print state (shape, head, dtypes)
2. **EXECUTE:** Run operation
3. **AFTER:** Print state (shape, nulls, sample)
4. **VERIFY:** Check output is reasonable
5. **DOCUMENT:** Note what you observed
Example:
```python
print(f"Before merge: df1={df1.shape}, df2={df2.shape}")
df = df1.merge(df2, on='key', how='left')
print(f"After merge: df={df.shape}")
print(f"Nulls introduced: {df.isnull().sum().sum()}")
print(df.head())
| Operation | Required Output |
|---|---|
| Load data | shape, dtypes, head() |
| Filter | shape before/after, % removed |
| Merge/Join | shape, null check, sample |
| Groupby | result shape, sample groups |
| Model fit | metrics, convergence check |
Save all analysis outputs (plots, tables, model objects) to the files in OUTPUT FILES.
Use clear naming:
{OUTPUT_FILES[0]}/plot_distribution.png{OUTPUT_FILES[0]}/table_summary.csv{OUTPUT_FILES[0]}/model_logit.pklAfter completing your analysis, send a message to the lead with:
Finished: {TASK_NAME}
Outputs created:
- [list each file with brief description]
Data quality observations:
- [any nulls, outliers, or data issues found]
- [or "No issues" if clean]
Methodology notes:
- [any assumptions made about statistical approach]
- [or "Standard approach per spec" if straightforward]
Key findings:
- [1-3 bullet points of main results]
The lead uses these messages to check for methodology inconsistencies between teammates. Do NOT message other teammates directly — the lead coordinates all cross-task communication.
Before marking your task complete, verify ALL of the following:
Only mark your task complete after all boxes pass.
### 4. Lead Monitoring
While teammates analyze:
- **Watch the shared task list** for completion status and messages
- **If a teammate reports a methodology question:** Relay the answer to ALL affected teammates (e.g., "Use robust standard errors for all regressions")
- **If a teammate reports data quality issues:** Decide whether to halt parallel work and fix foundation task
- **If a teammate requests out-of-scope data:** Decide whether to expand scope or note as limitation
- **If a teammate has been working significantly longer than others:** Message them for status
- **Do NOT implement any analysis yourself** — your job is coordination and reconciliation
### 5. Reconciliation Protocol (3 Passes)
After ALL teammates mark their tasks complete, the lead performs three passes:
<EXTREMELY-IMPORTANT>
**Pass 1 — Collect & Conflicts:**
1. Read all output files created by teammates
2. Check for file conflicts:
- Did teammates overwrite each other's outputs? (should not happen if scope separation worked)
- Are output file names clear and non-overlapping?
3. Verify all expected outputs exist (cross-check against each teammate's completion message)
4. If outputs are missing or conflict, identify which teammate and request fix
**Pass 2 — Output Verification:**
1. For each teammate's outputs, verify:
- Data shapes are reasonable (no unexpected empty DataFrames)
- Summary statistics make sense (no all-zeros, no suspicious outliers)
- Plots render correctly (no blank images)
- Model convergence achieved (if applicable)
2. Cross-check outputs against SPEC.md requirements:
- Did we get all the analyses requested?
- Are output formats what spec required (tables vs plots)?
3. If outputs look wrong:
- Identify specific issue (e.g., "Model failed to converge", "Plot shows no data")
- Dispatch fix subagent using ds-delegate targeting the specific issue
- Re-verify after fix
**Pass 3 — Methodology Consistency:**
1. Read each teammate's completion message (methodology notes section)
2. Check for methodology conflicts:
- Did teammates make different assumptions about the same thing? (e.g., one used robust SE, another didn't)
- Did teammates use different variable definitions? (e.g., one logged income, another didn't)
- Did teammates handle nulls differently? (one dropped, another imputed)
3. Read SPEC.md methodology requirements — verify all teammates followed spec
4. If methodology conflicts found:
- Document the conflict
- Decide on canonical approach (from spec or user input)
- Dispatch fix subagent to harmonize methodology
- Re-run affected analyses
**If ANY pass fails → fix before proceeding. Do NOT skip reconciliation passes.**
</EXTREMELY-IMPORTANT>
### 6. When to Use Agent Teams
<EXTREMELY-IMPORTANT>
**DS work is MOSTLY sequential. Only use parallel mode for rare cases with true independence.**
**Use agent teams when:**
- 4+ tasks in PLAN.md with at least 2 independent groups
- Independent tasks analyze different datasets OR different subsets of same data
- Tasks create different output files (no overlap)
- Tasks are self-contained (each has own data scope and outputs)
- Examples:
- ✅ Descriptive stats by subgroup (region A, region B, region C)
- ✅ Model comparisons (logit, probit, random forest on same cleaned data)
- ✅ Robustness checks (main spec, alternative spec 1, alternative spec 2)
- ✅ Multiple visualizations (time series plot, scatter plot, correlation heatmap)
**Do NOT use agent teams when:**
- Tasks form a pipeline (clean → merge → transform → model) — this is SEQUENTIAL
- Each task depends on seeing the previous output to decide next step — this is EXPLORATORY
- Multiple tasks modify the same datasets or output files
- Fewer than 4 tasks (overhead exceeds benefit)
- Tasks require shared state that's built incrementally
- Exploratory analysis where you don't know what's needed until you see data
- `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` is not available
**The default is sequential.** Parallel is the exception, not the rule.
</EXTREMELY-IMPORTANT>
### 7. After Reconciliation
After all three reconciliation passes complete successfully:
1. **Log consolidated results to LEARNINGS.md:**
```markdown
## Parallel Analysis Complete
**Tasks executed in parallel:**
- Task N: [Name] - Teammate A
- Task M: [Name] - Teammate B
- Task P: [Name] - Teammate C
**Outputs created:**
- [List all output files across teammates]
**Methodology:**
- [Document canonical approach used across analyses]
**Key findings:**
- [Consolidated findings from all teammates]
**Reconciliation:**
- Pass 1 (Collect): [Any conflicts? How resolved?]
- Pass 2 (Outputs): [Any issues? How fixed?]
- Pass 3 (Methodology): [Any conflicts? How harmonized?]
Before invoking ds-review, execute this gate:
.claude/PLAN.md — list every task by number and name.claude/LEARNINGS.md — find entries for each taskIf ANY task is missing from LEARNINGS.md, implement it before proceeding.
Claiming all tasks are done without checking LEARNINGS.md against PLAN.md is LYING.
After passing the exit gate, IMMEDIATELY invoke:
Read("${CLAUDE_PLUGIN_ROOT}/lib/skills/ds-review/SKILL.md")