Coding SOP 标志

Coding SOP

社区
wentorai
Coding SOP

Standard operating procedure for research experiments, data analysis, and visualization. Covers Python/R script execution, statistical analysis, data wrangling (pandas/tidyverse), publication-quality figures (matplotlib/plotly/ggplot2), and experiment reproducibility.

Add to TypingMind

概览

发布者wentorai
代码仓库Research-Claw
技能名称Coding SOP
星标数
859
复刻数
117
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 wentorai 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Coding SOP AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/wentorai/Research-Claw/tree/main/skills/coding-sop
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wentorai/Research-Claw.git /tmp/Research-Claw
mkdir -p .claude/skills
cp -r /tmp/Research-Claw/skills/coding-sop .claude/skills/wentorai-coding-sop
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Coding SOP,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Coding SOP。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Coding SOP 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Coding SOP — Research Experiments & Data Analysis

1. Experiment Execution SOP

1.1 Hypothesis → Code → Execute → Verify

  1. Hypothesize: state what you expect and why
  2. Design: define variables, controls, sample size / iteration count
  3. Code: workspace_save to outputs/scripts/; include docstring (hypothesis, expected outcome, dependencies)
  4. Execute: exec in workspace (safe commands — see §5); capture stdout + stderr
  5. Verify: compare against hypothesis; check for NaN/Inf/warnings; save to outputs/reports/
  6. Iterate: if contradicted, revise (do NOT cherry-pick); if confirmed, document

1.2 Script Template

Every script must include: shebang, docstring (experiment title, hypothesis, dependencies, date), seed setting (see §6), and four sections: loading, processing, analysis, output.

2. Data Processing SOP

2.1 Pipeline: Clean → Transform → Analyze

  1. Inspect: df.info(), df.describe(), df.head() — check dtypes, nulls, duplicates
  2. Clean: handle missing values (drop/impute/flag — document choice), fix dtypes, remove duplicates, detect outliers (IQR, z-score, domain rules)
  3. Transform: normalize/standardize, encode categoricals, feature engineering, reshape (pivot, melt, merge)
  4. Validate: assert expected shape, sanity-check stats, save cleaned data via workspace_save("sources/data/<name>_clean.csv")

2.2 Common Libraries

Python: pandas/polars (DataFrames), numpy (numerics), dask (large files), spaCy (text). R: dplyr/tidyr (wrangling), data.table/arrow (large files), stringr/tidytext (text).

Browse analysis/wrangling/ for 10 deep-dive skills (pandas, missing data, survey, text mining).

3. Statistical Analysis Guide

3.1 Test Selection Tree

What is your research question?
│
├── Comparing groups?
│   ├── 2 groups
│   │   ├── Continuous DV, normal → Independent t-test
│   │   ├── Continuous DV, non-normal → Mann-Whitney U
│   │   ├── Paired/matched → Paired t-test / Wilcoxon signed-rank
│   │   └── Categorical DV → Chi-square / Fisher's exact
│   ├── 3+ groups
│   │   ├── 1 factor, normal → One-way ANOVA → post-hoc (Tukey/Bonferroni)
│   │   ├── 1 factor, non-normal → Kruskal-Wallis → post-hoc (Dunn)
│   │   ├── 2+ factors → Two-way / N-way ANOVA (check interactions)
│   │   └── Repeated measures → Repeated-measures ANOVA / Friedman
│   └── Pre/post with control → Mixed ANOVA / DiD
│
├── Predicting an outcome?
│   ├── Continuous outcome → Linear regression (OLS)
│   │   ├── Multiple predictors → Multiple regression
│   │   ├── Non-linear → Polynomial / GAM / splines
│   │   └── Endogeneity → IV / 2SLS (see econometrics skills)
│   ├── Binary outcome → Logistic regression
│   ├── Count/ordinal → Poisson / Ordinal logistic
│   ├── Time-to-event → Cox proportional hazards
│   └── Panel data → Fixed/random effects (see econometrics skills)
│
├── Exploring relationships?
│   ├── 2 continuous vars → Pearson r (normal) / Spearman rho (non-normal)
│   ├── 2 categorical vars → Chi-square test of independence
│   ├── Latent constructs → Factor analysis / SEM
│   └── Dimensionality → PCA / t-SNE
│
└── Estimating causal effects?
    ├── Randomized experiment → t-test / ANOVA with random assignment
    ├── Natural experiment → DiD, RDD, IV
    └── Observational → Propensity score matching, synthetic control

3.2 Reporting Checklist

Every test must report: test name, statistic value (t/F/chi-sq/U/z), df, exact p-value, effect size (Cohen's d / eta-sq / Cramer's V / OR), 95% CI, assumptions checked (normality, homoscedasticity, independence), sample size per group.

3.3 Common Pitfalls

  • Multiple comparisons: Bonferroni, Holm, or FDR correction
  • p-hacking: pre-register hypotheses; never fish for p < 0.05
  • Small samples: exact tests or bootstrap over asymptotic tests
  • Normality: Shapiro-Wilk (n < 50) or Q-Q plot + KS test
  • Confounders: include as covariates or stratify

Deep-dive skills: browse analysis/statistics/ (10 skills: Bayesian, meta-analysis, SEM, survival, power analysis, nonparametric) and analysis/econometrics/ (12 skills: causal inference, panel data, IV, time series).

4. Visualization SOP

4.1 Chart Type Selection

Data patternChart type
Distribution (1 var)Histogram, KDE, box/violin plot
Comparison (categories)Bar chart, grouped bar, dot plot
Trend over timeLine chart, area chart
Relationship (2 vars)Scatter plot, regression plot
Correlation matrixHeatmap
CompositionStacked bar, treemap
GeographicChoropleth, point map
Network / graphForce-directed, adjacency matrix
High-dimensionalPCA biplot, t-SNE, UMAP

4.2 Publication-Quality Standards

Set plt.rcParams for journal figures: figure.dpi: 300, font.family: serif, font.size: 10, savefig.bbox: tight. Key rules:

  1. Resolution: 300 DPI minimum (600 DPI for line art)
  2. Format: PDF/SVG for vector; PNG/TIFF for raster (avoid JPEG)
  3. Color: colorblind-safe palettes (viridis, cividis, Set2)
  4. Labels: every axis labeled with units; legend outside if crowded
  5. Font: 8-12pt, match journal spec (serif or sans-serif)
  6. Size: single column ~3.5in, double column ~7in width
  7. Save: workspace_save("outputs/figures/fig-<desc>.pdf", content)

Deep-dive skills: browse analysis/dataviz/ (14 skills: matplotlib, plotly, D3, publication figures, color accessibility, geospatial, network viz).

5. exec Safety & Patterns

Safe (no approval): python3, Rscript, xelatex, pandoc, jq, wc, grep, find. Requires approval_card: pip install, brew install, curl, wget, anything outside workspace. Full safety rules in Workspace SOP.

Common patterns:

  • exec("python3 outputs/scripts/experiment.py") — run analysis
  • exec("Rscript outputs/scripts/analysis.R") — R script
  • exec("python3 -c \"import pandas; ...\"") — quick inspection

Output paths: All script outputs (figures, data, reports) MUST use workspace-relative paths. Set the working directory to workspace root before execution, and use paths like outputs/figures/, outputs/reports/. Template for Python:

python
import os
os.chdir(os.environ.get('WORKSPACE_ROOT', '.'))

6. Reproducibility Protocol

6.1 Environment Recording

At analysis start, capture Python version, platform, and key package versions (numpy, pandas, scipy, matplotlib, sklearn). Save via workspace_save("outputs/reports/env-snapshot-<date>.json").

6.2 Reproducibility Checklist

  • Random seeds: Set at script top for numpy, random, torch, tensorflow
  • Version locking: Record exact versions (pip freeze / conda list)
  • Data provenance: Source URL, download date, SHA-256 for raw data
  • Execution order: Scripts must run independently (no notebook-state dependency)
  • Relative paths: Use workspace-relative paths, not absolute
  • For ML: log hyperparams, track metrics per step, save checkpoints, record hardware

7. Coding Complexity Delegation

Before writing code, assess complexity:

Simple task (single file, stdlib only, no iteration)
  → RC handles directly via exec
Complex task (multi-file, dependencies, iterative debugging)
  → Check MEMORY.md Environment for installed CLIs (codex, claude, opencode)
    → CLI found → inform user, suggest delegating via exec
      → User agrees → exec the CLI (read claude-code / codex-cli / opencode-cli skill)
      → User wants RC → proceed with RC's own capabilities
    → No CLI → recommend installation, wait for user decision
      → User insists → RC proceeds via repeated workspace_save + exec (slower)

Boundary: "complex coding" = multi-file projects, dependency management, iterative debugging, beamer/multi-chapter LaTeX, interactive visualizations. For these, the Claude Code, Codex CLI, and OpenCode CLI skills provide delegation guidance.

8. RC Local Tools Reference

  • workspace_save: persist code to outputs/scripts/ (or outputs/notebooks/), figures to outputs/figures/, processed data to sources/data/. Commit message prefix: Add: / Update:.
  • workspace_append: add results to an existing report or data file without overwriting. Preferred over read + save for incremental updates.
  • workspace_download: save binary outputs (plots, exports) from URLs.
  • exec: run scripts from workspace root. Default timeout 120s (increase for long-running). Always inspect both stdout and stderr. On failure: fix code, workspace_save again, re-run.

Related Research-Plugins Skills

For detailed methodology beyond this SOP, browse these RP skill indexes:

Index pathSkillsCovers
tools/code-exec/7Jupyter, Colab, Kaggle, reproducibility (Python/R)
analysis/statistics/10Hypothesis testing, Bayesian, meta-analysis, SEM, survival
analysis/econometrics/12Causal inference, panel data, IV, DiD, time series, Stata
analysis/wrangling/10pandas, data cleaning, missing data, survey, text mining
analysis/dataviz/14matplotlib, plotly, D3, publication figures, geospatial, networks
domains/ai-ml/27PyTorch, TensorFlow, LLM eval, experiment tracking, ML pipelines
tools/diagram/9Mermaid, PlantUML, GraphViz, flowcharts, scientific diagrams
domains/14716 disciplines — browse domains/{field}/ for domain-specific analysis methods

常见问题

Coding SOP AI 技能有什么作用?

Standard operating procedure for research experiments, data analysis, and visualization. Covers Python/R script execution, statistical analysis, data wrangling (pandas/tidyverse), publication-quality figures (matplotlib/plotly/ggplot2), and experiment reproducibility.

为什么在 TypingMind 中使用 Coding SOP?

因为您只需安装一次,就能搭配任何模型使用。Coding SOP 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Coding SOP?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/wentorai/Research-Claw/tree/main/skills/coding-sop。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Coding SOP?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Coding SOP 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Coding SOP 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Coding SOP AI 技能免费吗?

wentorai 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇