PG Workflow
Use this skill as the cross-platform orchestration entry point. Claude Code users may use the /pg-* commands; Codex and other agents should invoke this skill directly.
Load
Read these references in order:
../../references/workflow-contract.md../../references/archive-contract.md../../references/intake-checklist.mdwhen starting a new run../../references/supervision-gates.mdbefore approval../../references/pingouin-optimization.mdbefore generating Pingouin code
Use ../../scripts/workflow_engine.py for every state transition. Never edit run-manifest.json status by hand.
Dispatch
- Find the active run under
archive/analysis-runs/, or initialize one withscripts/init_analysis_run.py. - Read the manifest status.
- Execute only the next allowed stage from
workflow-contract.md. - Save the stage artifacts before advancing the state.
- If approval returns
REVISE, repair and return toanalyzed; ifBLOCKED, stop and explain the missing decision or data. - Finish only after
workflow_engine.py check <run>passes atcomplete.
Required Handoff Block
Before each stage, return:
Run: <run-id>
State: <current>
Next: <target state and stage>
Inputs: <files/data available>
Outputs: <files this stage will create>
Guardrail: <highest-risk issue>
Hard Rules
- Do not run inferential analysis before screening artifacts exist.
- Do not report conclusions before an
approvedorapproved_with_notesstate. - Do not claim results from code that has not produced stored numerical output.
- Do not copy raw participant data into an archive unless the user explicitly confirms the privacy handling.
- Keep the S0-S5 audit line in the final handoff.