.cursor/skills/add-step/SKILL.md
Add or insert a new numbered pipeline step in the p2cs_project, following the standardized Step/DataFile/explore notebook patterns and safely renumbering subsequent steps (code, data, figures, tests, config, dependencies, and imports) when inserting in the middle of the pipeline. Use when creating a new step_* directory, inserting a step between existing ones, or updating step numbers across the project.
npx skillsauth add segal-noam/p2cs_project add-stepInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when:
code/step_{N}_{name}/.explore.ipynb, and wiring dependencies/config.This skill is project-specific to p2cs_project and assumes the architecture described in the root README.md.
Each numbered step follows the same high-level pattern:
code/step_{N}_{snake_name}/
step.py: main Step{N}{CamelName} class inheriting from base.Step.data_classes.py: data classes inheriting from DataFile subclasses (when the step has new artifacts).__init__.py: re-exports the main step class (and sometimes helper symbols).README.md: step-specific documentation (inputs, outputs, substeps, external tools).explore.ipynb: exploration notebook following the standard notebook structure from the root README.md.1_*.py, 2_*.py, etc., each implementing focused logic.data/step_{N}_{snake_name}/ and figures in figures/step_{N}_{snake_name}/ are routed via base.paths.pipeline_config.yaml under steps: step_{N}_{snake_name}: ...code/tests/test_step_{N}.py.Good templates to copy from:
step_4_prepare_pairs/step_2_organism_distance/step_6_train_model/, step_7_crosstalk_estimation/Determine the new step index and name
code/step_*.N_max be the largest index (currently 8 for step_8_generate_paper).N_new = N_max + 1step_{N_new}_{snake_name}Step{N_new}{CamelName}Create the step directory
code/step_{N_new}_{snake_name}/ with at least:
__init__.py (re-export the main step class).step.py (main step implementation).README.md (step documentation).explore.ipynb (exploration notebook).1_*.py, 2_*.py, etc.data_classes.py and/or config.json if this step defines new data types or config.step_4_prepare_pairs/) and rename/trim to match the new step’s responsibilities.Implement the main step class
step.py:
Step and path helpers from code/base/step.py and code/base/paths.py.class Step{N_new}{CamelName}(Step):name and description properties (or class attributes).dependencies property returning a List[str] of upstream steps, using canonical IDs like "step_1_get_p2cs_data".get_input_paths() and get_output_paths() using data classes and get_step_input_path / get_step_output_path.run() orchestrating any substeps via self.run_substeps(...).Define data classes (if needed)
data_classes.py:
DataFile subclasses (e.g., PickleDataFile, CSVDataFile, NumpyDataFile).get_input_paths() / get_output_paths() and in substeps.Create numbered substeps
1_*.py, 2_*.py, etc. inside the new step directory.paths helpers.run() calls self.run_substeps(...) with:
step_numbers=[1, 2, ...]descriptions=[...]on_failure mode ("strict" or "warning").Create the step README
README.md, mirror the structure used in other steps:
Create the explore.ipynb notebook
README.md:
# Imports (path setup + step/data class imports).# Load Data
## Load Inputs (using step.get_input_paths() + data classes).## Load Outputs.# Plot
# Notes (short list of exploration ideas).Wire the step into pipeline_config.yaml
steps:, add a new entry:
step_{N_new}_{snake_name}:enabled, description, overwrite_outputs, optional fast_plots, and substeps:.substeps: section keyed by the filenames (without .py), matching patterns in other steps.Add tests
code/tests/test_step_{N_new}.py by copying a nearby test (e.g., test_step_4.py) and adjusting:
Run tests / pipeline checks
pytest code/tests/test_step_{N_new}.py.cd code && python run_pipeline.py --step step_{N_new}_{snake_name}Use this when inserting a new step between existing steps (e.g., between step_3_embed_proteins and step_4_prepare_pairs).
Identify current step order
code/step_* directories and their indices (including step_0_draw_theoretical).Choose insertion point
N_insert_after = index of the step before the new one.N_new = N_insert_after + 1.> N_insert_after must be shifted up by 1:
k → new k + 1 for all k > N_insert_after.Decide the new step’s ID
step_{N_new}_{snake_name}.Step{N_new}{CamelName}.Perform renaming from highest index down to N_insert_after + 1 to avoid collisions.
For each step index k in descending order where k > N_insert_after:
Compute new index
k_new = k + 1.Rename step directories
code/step_{k}_{name}/ → code/step_{k_new}_{name}/.data/step_{k}_{name}/ → data/step_{k_new}_{name}/ (if exists).figures/step_{k}_{name}/ → figures/step_{k_new}_{name}/ (if exists).Rename tests
code/tests/test_step_{k}.py → code/tests/test_step_{k_new}.py.Update configuration keys
pipeline_config.yaml, change:
step_{k}_{name}: → step_{k_new}_{name}:.Update string references and imports
step_{k}_{name} and test_step_{k} across the repo and update to the new IDs:
from step_{k}_{name}....dependencies properties (e.g., return ["step_{k}_{name}", ...]).step_{k}_{name}.Update doc references
README.md files and notebooks, update any textual references to the old step name or number, if present.After all affected steps k > N_insert_after have been shifted to k + 1:
Create code/step_{N_new}_{snake_name}/
step.py and data_classes.py.README.md.explore.ipynb.Wire into pipeline_config.yaml
steps: add:
step_{N_new}_{snake_name}: with its configuration and substeps.Update dependencies
dependencies to the upstream steps, using the renumbered IDs.dependencies properties:
Add test file
code/tests/test_step_{N_new}.py following neighboring step tests.Sanity check references
step_{k}_{name} where k was renumbered) and ensure:
Run targeted tests
cd code && pytest tests/test_step_{N_new}.pytest_step_{k_new}.py.Run a dry pipeline
cd code && python run_pipeline.py --list-steps to confirm updated IDs and ordering.cd code && python run_pipeline.py --step step_{N_new}_{snake_name} to test the new step in context.When creating or editing explore.ipynb for a step:
# Imports# Load Data
## Load Inputs## Load Outputs# Plot# Notes# Plot; additional exploratory plots come after.When asked to add a new step:
step_{N}_{snake_name}, test_step_{N}.py.pipeline_config.yaml step and substep entries.explore.ipynb structure and data class usage.development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.