swe-workflow-skills 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: git-workflow
3
- description: "Write commit messages, PR descriptions, and manage branching strategy following conventional commits. Triggers: write a commit message, commit this, PR description, pull request, branching strategy, git workflow, squash commits, rebase, conventional commits, how should I commit this, review staged changes."
3
+ description: "Write commit messages, PR descriptions, and manage branching strategy following conventional commits."
4
+ when_to_use: "Triggers: write a commit message, commit this, PR description, pull request, branching strategy, git workflow, squash commits, rebase, conventional commits, how should I commit this, review staged changes."
4
5
  model: haiku
5
6
  allowed-tools: Read, Grep, Glob, Write, Edit
6
7
  ---
@@ -13,11 +14,13 @@ Help write clear commit messages, structured PR descriptions, and manage branchi
13
14
 
14
15
  ### Step 1: Analyze the Changes
15
16
 
16
- Read the staged changes to understand what was done:
17
+ Currently staged (live at skill load; empty when nothing is staged, this isn't a
18
+ git repo, or injection is disabled):
17
19
 
18
- ```bash
19
- git diff --staged
20
- ```
20
+ !`git diff --staged --stat 2>/dev/null || true`
21
+
22
+ If the summary above is empty or not enough to understand the change, run
23
+ `git diff --staged` yourself for the full diff.
21
24
 
22
25
  Identify:
23
26
  - **What changed?** (files modified, functions added/removed, logic altered)
@@ -68,14 +71,17 @@ Before committing, check:
68
71
 
69
72
  ### Step 1: Analyze the Branch
70
73
 
71
- Read the changes in the branch:
74
+ Branch state vs the default branch (live at skill load; tries `main` then
75
+ `master`):
72
76
 
73
- ```bash
74
- git log main..HEAD --oneline
75
- git diff main...HEAD --stat
76
- ```
77
+ !`git log main..HEAD --oneline 2>/dev/null || git log master..HEAD --oneline 2>/dev/null || true`
78
+
79
+ !`git diff main...HEAD --stat 2>/dev/null || git diff master...HEAD --stat 2>/dev/null || true`
77
80
 
78
- Understand the full scope of changes across all commits.
81
+ If the output above is empty or the repo uses a different default branch, run the
82
+ equivalents against the actual base branch. Understand the full scope of changes
83
+ across all commits — run the full `git diff <base>...HEAD` when the stat summary
84
+ isn't enough.
79
85
 
80
86
  ### Step 2: Write the PR Description
81
87
 
@@ -106,9 +112,10 @@ Help set up or improve branching conventions. Ask about team size and release ca
106
112
 
107
113
  **For small teams (1-5 devs) or continuous deployment:**
108
114
  - `main` — always deployable
109
- - `feat/description` — feature branches, short-lived (1-3 days)
110
- - `fix/description`bug fix branches
111
- - Merge to main via PR, deploy from main
115
+ - Branch naming: `feat/<description>`, `fix/<description>` — short-lived (1-3 days)
116
+ - Merge to main via PR **squash-merge by default** (one clean commit per logical
117
+ change on main); one approval is the right review bar at this size
118
+ - Deploy from main
112
119
 
113
120
  **For medium teams (5-15 devs) or scheduled releases:**
114
121
  - `main` — production
@@ -1,13 +1,19 @@
1
1
  ---
2
2
  name: ml-pipeline-design
3
- description: "Design reproducible ML training and data pipelines — ingestion, validation, feature engineering, training, evaluation, continuous training orchestration. Triggers: training pipeline, ML data pipeline, feature engineering, ETL for ML, continuous training, data validation, feature store, preprocessing, notebook to pipeline, orchestrate training, Kubeflow, pipeline DAG, point-in-time features. Analytics/BI ELT and dbt warehouse pipelines data-pipeline-design."
3
+ description: "Design reproducible ML training and data pipelines — ingestion, validation, feature engineering, training, evaluation, continuous training orchestration. Analytics/BI ELT and dbt warehouse pipelines data-pipeline-design; refactoring general analysis/reporting notebooks (no model training) to production codenotebook-to-production."
4
+ when_to_use: "Triggers: training pipeline, ML data pipeline, feature engineering, ETL for ML, continuous training, data validation, feature store, preprocessing, notebook to training pipeline, orchestrate training, Kubeflow, pipeline DAG, point-in-time features."
4
5
  model: opus
5
6
  allowed-tools: Read, Grep, Glob, Write, Edit, Bash
6
7
  ---
7
8
 
8
9
  # ML Pipeline Design
9
10
 
10
- Design reproducible, automated ML pipelines that transform notebooks into production-grade workflows. A pipeline is the difference between "I ran this notebook and got good results" and "this system produces, validates, and deploys models automatically."
11
+ Design reproducible, automated ML pipelines that transform training notebooks into production-grade workflows. A pipeline is the difference between "I ran this notebook and got good results" and "this system produces, validates, and deploys models automatically."
12
+
13
+ Scope check first: if the notebook does NOT train a model — it's analysis,
14
+ KPIs, or reporting — this is not a training pipeline; use the
15
+ `notebook-to-production` skill (modules, tests, parameterization, scheduling)
16
+ instead.
11
17
 
12
18
  ## Why Pipelines Matter
13
19
 
@@ -29,6 +29,16 @@
29
29
  "Recommends the pipeline should FAIL on bad data, not train on it",
30
30
  "Provides concrete implementation (Great Expectations or Pandera)"
31
31
  ]
32
+ },
33
+ {
34
+ "id": 3,
35
+ "prompt": "I have a Jupyter notebook that pulls last month's sales from the warehouse, computes exec KPIs, and emails a report. I want it to run on a schedule instead of me running it by hand — how do I turn this notebook into production code?",
36
+ "expected_output": "Should recognize there is no model training involved — this is a general analysis/reporting notebook — and hand off to the notebook-to-production skill (modules, tests, parameterization, scheduling) rather than designing an ML training pipeline.",
37
+ "assertions": [
38
+ "Recognizes no model training is involved, so this is not an ML training pipeline",
39
+ "Hands off to or invokes the notebook-to-production skill for the refactor",
40
+ "Does not propose ML-specific machinery (feature stores, training DAGs, model evaluation gates) for a reporting notebook"
41
+ ]
32
42
  }
33
43
  ]
34
44
  }
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: notebook-to-production
3
+ description: "Refactor analysis notebooks into production-grade code — triage what deserves productionizing, extract modules with tests, parameterize hardcoded values, pin environments for reproducibility, and schedule unattended runs with alerting. Owns general analysis/reporting notebooks; notebooks that feed model TRAINING (feature engineering + training DAGs, scheduled retraining) → ml-pipeline-design."
4
+ when_to_use: "Triggers: productionize this notebook, notebook to script, notebook to module, refactor my notebook, parameterize notebook, papermill, schedule this analysis, reproducible analysis, notebook is a mess."
5
+ model: opus
6
+ allowed-tools: Read, Grep, Glob, Write, Edit, Bash
7
+ ---
8
+
9
+ # Notebook to Production
10
+
11
+ Turn exploratory notebooks into code that runs unattended, produces the same
12
+ result twice, and fails loudly. The refactor is incremental — the notebook
13
+ keeps working at every step — never a from-scratch rewrite.
14
+
15
+ ## Workflow
16
+
17
+ ### 1. Triage — not every notebook earns this
18
+
19
+ Productionize by **re-run frequency × business impact**. A notebook someone
20
+ re-runs by hand every quarter is the first candidate; a one-off exploration is
21
+ not — **archive it reproducibly instead**: the query or a data snapshot, a
22
+ pinned environment (`pip freeze` at minimum), and a one-line header (question,
23
+ finding, date, author). "Archived" without the data recipe and environment is
24
+ deleted-with-extra-steps.
25
+
26
+ For a backlog of many notebooks, also: extract logic duplicated across them
27
+ into a shared utility package (one fix, not N), and set a lightweight
28
+ convention for future notebooks likely to graduate — imports at top,
29
+ parameters in the first cell, logic in functions — so the next migration is
30
+ cheap.
31
+
32
+ ### 2. Extract logic into modules
33
+
34
+ Move transformations out of cells into importable, typed functions in a real
35
+ package (`src/`), leaving the notebook as a thin driver that imports and
36
+ calls. Separate I/O (load/save) from transformation logic — pure
37
+ transformation functions are what you can test. Restartability check: does it
38
+ run top-to-bottom in a fresh kernel? Hidden execution-order state is the first
39
+ bug this flushes out.
40
+
41
+ ### 3. Parameterize everything hardcoded
42
+
43
+ Dates, paths, connection strings, thresholds → function arguments driven by a
44
+ config file or CLI args (or papermill parameters if the notebook itself stays
45
+ the execution vehicle). The run for "last month" and the backfill for "March
46
+ 2024" must be the same code with different parameters.
47
+
48
+ ### 4. Test the transformations
49
+
50
+ The extracted pure functions get unit tests: known-input → known-output cases,
51
+ plus edge cases the data will eventually throw (empty frame, nulls, duplicate
52
+ keys, timezone boundaries). A small golden sample of real data as a fixture
53
+ catches most regressions. No tests, no schedule — an untested unattended job
54
+ is a silent-corruption machine.
55
+
56
+ ### 5. Pin the environment
57
+
58
+ Reproducibility means the same code AND the same dependencies: a lock file
59
+ (`uv lock`, `poetry.lock`, `pip-compile`) or a container image. Pin the data
60
+ too where possible — snapshot inputs or record query + as-of timestamp, so a
61
+ rerun of last month's report produces last month's numbers.
62
+
63
+ ### 6. Schedule and operate
64
+
65
+ Size the scheduler to the team: cron or a CI schedule (GitHub Actions) first;
66
+ an orchestrator (Airflow/Dagster) only when there are real DAG dependencies
67
+ across jobs. Unattended means operated: fail loudly (alert on failure AND on
68
+ suspicious output — empty result, row count off), log enough to debug a 6am
69
+ failure, and make the job idempotent so a retry can't double-append or
70
+ double-send.
71
+
72
+ ## Principles
73
+
74
+ - **Incremental (KISS)**: extract one section at a time; the notebook keeps
75
+ running throughout.
76
+ - **YAGNI**: no orchestrator, feature store, or microservice for a weekly
77
+ report — cron + a tested module is production.
78
+ - **SRP**: load, transform, and render are separate functions with separate
79
+ tests.
80
+
81
+ ## Cross-skill boundaries
82
+
83
+ - The notebook trains a model (feature engineering, training, evaluation,
84
+ retraining schedule) → **ml-pipeline-design** — training pipelines have
85
+ their own stage/validation/gating design.
86
+ - Recurring ELT into a warehouse feeding many consumers → **data-pipeline-design**.
87
+ - Still figuring out what the analysis should say → **exploratory-data-analysis**.
88
+ - CI mechanics for the scheduled run → **cicd-pipeline**; test design depth →
89
+ **test-suite-design**.
@@ -0,0 +1,42 @@
1
+ {
2
+ "skill_name": "notebook-to-production",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "My analysis notebook pulls monthly sales data, cleans it, computes KPI aggregates, and generates charts for a report. Management wants this delivered automatically every Monday morning. It's 800 lines of cells with hardcoded dates and file paths. How do I productionize it?",
7
+ "expected_output": "Should refactor incrementally: extract the logic into importable modules, parameterize the hardcoded dates/paths, add tests for the transformations, pin the environment for reproducibility, schedule the Monday run with failure alerting — not rewrite from scratch.",
8
+ "assertions": [
9
+ "Extracts notebook logic into importable modules/functions rather than leaving everything in cells",
10
+ "Parameterizes the hardcoded dates and paths (config file, CLI args, or papermill-style notebook parameters)",
11
+ "Adds tests for the extracted transformation logic",
12
+ "Pins the environment for reproducibility (lock file, pinned requirements, or a container)",
13
+ "Sets up scheduling for the Monday run sized to the team (cron or CI schedule before reaching for a heavy orchestrator)",
14
+ "Addresses failure handling and alerting for the unattended run",
15
+ "Proposes an incremental refactor path rather than a from-scratch rewrite"
16
+ ]
17
+ },
18
+ {
19
+ "id": 2,
20
+ "prompt": "Our team has 30+ research notebooks accumulated over two years. Some are one-off explorations, some get re-run every quarter by hand. We can't productionize everything — what should we do?",
21
+ "expected_output": "Should triage rather than migrate everything: productionize the recurring high-impact notebooks first, archive one-offs with enough context to be reproducible, extract shared utilities for duplicated logic, and set a lightweight standard for future notebooks.",
22
+ "assertions": [
23
+ "Triages the notebooks instead of proposing to productionize all 30+ — one-off explorations stay notebooks",
24
+ "Prioritizes by re-run frequency and business impact (the quarterly hand-run ones first)",
25
+ "Recommends archiving one-offs with enough context to reproduce them later (data snapshot or query, pinned environment)",
26
+ "Proposes extracting shared utilities for logic duplicated across notebooks",
27
+ "Suggests a lightweight convention for future notebooks that are likely to need productionizing",
28
+ "Does not propose a big-bang migration of everything"
29
+ ]
30
+ },
31
+ {
32
+ "id": 3,
33
+ "prompt": "I have a notebook that does feature engineering on our user events and trains a ranking model. I want to turn it into a pipeline that retrains automatically every week.",
34
+ "expected_output": "Should recognize this notebook feeds model TRAINING — feature engineering, training, evaluation, scheduled retraining — and hand off to the ml-pipeline-design skill for the training-pipeline DAG, rather than doing a general notebook-to-module refactor.",
35
+ "assertions": [
36
+ "Recognizes the notebook feeds model training and hands off to or invokes the ml-pipeline-design skill",
37
+ "Names training-pipeline concerns (pipeline DAG stages, data validation, evaluation gate, retraining schedule) as ml-pipeline-design territory",
38
+ "Does not respond with only a generic notebook-to-module refactor as the primary answer"
39
+ ]
40
+ }
41
+ ]
42
+ }
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: project-documentation
3
- description: "Write and maintain project docs — README, contributing guides, API docs, changelogs, inline docs. Triggers: write a README, document this project, create documentation, contributing guide, changelog, API docs, how do I document, this needs docs, onboarding docs, JSDoc, docstrings."
3
+ description: "Write and maintain project docs — README, contributing guides, API docs, changelogs, inline docs."
4
+ when_to_use: "Triggers: write a README, document this project, create documentation, contributing guide, changelog, API docs, how do I document, this needs docs, onboarding docs, JSDoc, docstrings."
4
5
  model: haiku
5
6
  allowed-tools: Read, Grep, Glob, Write, Edit
6
7
  ---
@@ -87,9 +88,11 @@ Follow Keep a Changelog conventions:
87
88
 
88
89
  See [templates/changelog.md](templates/changelog.md) for the format.
89
90
 
90
- Accumulate entries under `[Unreleased]` as changes land; promoting them to a version
91
- heading happens at release time version choice, tagging, and automated changelog
92
- generation are `release-management`'s domain.
91
+ Accumulate entries under `[Unreleased]` as changes land. Writing the entries is this
92
+ skill's work even when they must be reconstructed from git history — read the log
93
+ since the last tag, drop trivial commits (merges, typo fixes), and translate the rest
94
+ into user-perspective entries under the sections above. Hand off only the release
95
+ mechanics (version choice, tagging, publish automation) to `release-management`.
93
96
 
94
97
  ## Workflow: Inline Documentation
95
98
 
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  name: project-review
3
- description: "Review a built project's execution health before a milestone — scope alignment, roadmap / execution-plan adherence, implementation maturity (what's production-ready vs stub/deferred), and the evidence it actually works (tests, coverage, validation results, changelog). Triggers: project review, execution review, are we on track, implementation vs roadmap, scope drift, readiness review, what's actually built, validation results review, pre-launch review. Use strategic-review for vision/positioning/market; technical-debt-review for a pure code-health audit."
3
+ description: "Review a built project's execution health before a milestone — scope alignment, roadmap / execution-plan adherence, implementation maturity (what's production-ready vs stub/deferred), and the evidence it actually works (tests, coverage, validation results, changelog). Use strategic-review for vision/positioning/market; technical-debt-review for a pure code-health audit."
4
+ when_to_use: "Triggers: project review, execution review, are we on track, implementation vs roadmap, scope drift, readiness review, what's actually built, validation results review, pre-launch review."
4
5
  model: opus
6
+ context: fork
7
+ agent: general-purpose
5
8
  allowed-tools: Read, Grep, Glob, WebFetch, Write, Edit
6
9
  ---
7
10
 
@@ -90,9 +93,16 @@ Produce ranked, severity-tagged findings, each tied to its evidence:
90
93
  - **An execution scorecard** — maturity, roadmap-adherence, evidence-strength,
91
94
  each rated with a one-line justification, so the reader gets the picture at a glance.
92
95
 
96
+ **Write the full report to a file** — default a gitignored location (e.g.
97
+ `.local/project-review-<date>.md`) unless told otherwise — and state its path in
98
+ your final summary. This skill runs in a forked context: only the summary returns
99
+ to the main conversation, so anything not written to disk is lost. If a judgment
100
+ call needs user input (ambiguous scope boundary, missing baseline docs, which
101
+ milestone to measure against), do **not** guess silently — record it in an
102
+ **Open questions** section of the report and mention it in the summary.
103
+
93
104
  For the rendered deliverable (interactive HTML report, dashboards, sortable
94
- findings table), hand off to `artifact-design`. Default to writing it to a
95
- gitignored location (e.g. `.local/`) unless told otherwise.
105
+ findings table), hand off to `artifact-design`.
96
106
 
97
107
  ## Principles Applied
98
108
 
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  name: security-audit
3
- description: "Comprehensive security analysis — OWASP Top 10, auth/authz flows, injection vulnerabilities, data exposure, secrets detection, dependency CVEs, hardening recommendations. Triggers: security audit, vulnerability, is this secure, security review, pentest prep, OWASP, harden this, check for vulnerabilities, injection, XSS, CSRF, auth security. Reviews EXISTING code/config — design-time analysis of a system not yet built → threat-modeling."
3
+ description: "Comprehensive security analysis — OWASP Top 10, auth/authz flows, injection vulnerabilities, data exposure, secrets detection, dependency CVEs, hardening recommendations. Reviews EXISTING code/config — design-time analysis of a system not yet built → threat-modeling."
4
+ when_to_use: "Triggers: security audit, vulnerability, is this secure, security review, pentest prep, OWASP, harden this, check for vulnerabilities, injection, XSS, CSRF, auth security."
4
5
  model: opus
6
+ context: fork
7
+ agent: general-purpose
5
8
  allowed-tools: Read, Grep, Glob, Write, Edit, WebFetch, WebSearch
6
9
  ---
7
10
 
@@ -31,7 +34,7 @@ Before reviewing code line by line, map what's exposed:
31
34
  - **External integrations**: Third-party APIs, OAuth providers, payment processors
32
35
  - **Infrastructure**: Cloud services, databases, caches, queues
33
36
 
34
- Present the attack surface map to the user. Gaps in understanding here mean gaps in the audit.
37
+ Record the attack surface map as the first section of the report — gaps in understanding here mean gaps in the audit, so anything you could not map (unreachable config, undocumented integrations) goes under Open questions rather than being assumed safe.
35
38
 
36
39
  ### Step 2: Assess by OWASP Top 10
37
40
 
@@ -113,6 +116,14 @@ Suggest using the `dependency-management` skill for remediation planning.
113
116
 
114
117
  Output the audit report using the template at [templates/security-report.md](templates/security-report.md). Organize findings by severity, with Critical and High items first.
115
118
 
119
+ **Write the full report to a file** (default a gitignored location, e.g.
120
+ `.local/security-audit-<date>.md`) and state its path in your final summary — this
121
+ skill runs in a forked context: only the summary returns, everything unwritten is
122
+ lost. The summary must lead with the Critical/High count. Judgment calls that need
123
+ user input (unclear trust boundary, whether a data store is in scope, unverifiable
124
+ control) go in an **Open questions** section of the report — never silently assumed
125
+ safe.
126
+
116
127
  ## What This Skill Does NOT Cover
117
128
 
118
129
  - Runtime penetration testing (requires running the application)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: skill-router
3
- description: "Orchestrator and entry point for the swe-workflow skills library — consult FIRST when starting any non-trivial software task; most skills load name-only and only activate when invoked here. Triggers: starting a feature, planning, an architecture or design decision, implementing, debugging, reviewing, refactoring, testing, security, deployment, an incident, shipping, or unsure which skill fits. Routes intent to the right skill(s) and invokes them by name; shows the Golden Path chains."
3
+ description: "Orchestrator and entry point for the swe-workflow skills library — consult FIRST when starting any non-trivial software task; most skills load name-only and only activate when invoked here. Routes intent to the right skill(s) and invokes them by name; shows the Golden Path chains."
4
+ when_to_use: "Triggers: starting a feature, planning, an architecture or design decision, implementing, debugging, reviewing, refactoring, testing, security, deployment, an incident, shipping, or unsure which skill fits."
4
5
  model: haiku
5
6
  allowed-tools: Read, Grep, Glob, Skill
6
7
  ---
@@ -167,6 +168,11 @@ installed skill by name, regardless of role.
167
168
  - **data-pipeline-design** — batch/streaming ELT, dbt layering, Airflow/Dagster, idempotency, backfill
168
169
  - **data-quality** — dbt tests, expectations, data contracts, freshness, lineage / blast radius
169
170
 
171
+ ### Data Science
172
+ - **exploratory-data-analysis** — profile an unfamiliar dataset: missingness structure, distributions, leakage, hypotheses
173
+ - **statistical-analysis** — hypothesis tests, experiment design/power, confidence intervals, multiple-comparison discipline
174
+ - **notebook-to-production** — refactor analysis notebooks to tested, parameterized, scheduled production code
175
+
170
176
  ## Golden Path workflow chains
171
177
 
172
178
  When work spans phases, chain skills rather than improvising:
@@ -201,6 +207,10 @@ App-store releases (signing, review, staged rollout) → `mobile-release`.
201
207
  `data-pipeline-design` (ELT, layering, orchestration) → `data-modeling`
202
208
  (marts schema) → `data-quality` (tests, contracts, freshness) →
203
209
  `observability-design` (pipeline SLOs, alerting).
210
+ Notebook to production: `exploratory-data-analysis` (understand the data) →
211
+ `statistical-analysis` (test the hypotheses) → `notebook-to-production`
212
+ (modules, tests, scheduling); if the notebook trains a model →
213
+ `ml-pipeline-design` instead.
204
214
 
205
215
  **Pre-public / pre-milestone review**
206
216
  `strategic-review` (vision, positioning, market) → `project-review` (scope,
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: statistical-analysis
3
+ description: "Design and analyze experiments and statistical tests — test selection with stated assumptions, sample size and power, effect sizes and confidence intervals over bare p-values, and pitfall discipline (multiple comparisons, p-hacking, peeking/optional stopping). Owns experiment statistics generally; live A/B evaluation of AI/LLM apps (quality metrics, judges, feedback) → ai-evaluation."
4
+ when_to_use: "Triggers: hypothesis test, t-test, chi-square, p-value, statistical significance, confidence interval, sample size, power analysis, design an experiment, A/B test, multiple comparisons, is this difference real."
5
+ model: opus
6
+ allowed-tools: Read, Grep, Glob, Write, Edit, Bash
7
+ ---
8
+
9
+ # Statistical Analysis
10
+
11
+ Get the statistics of a question right — the test, its assumptions, the
12
+ uncertainty, and the traps — so a decision rests on evidence rather than on a
13
+ lone p-value. The deliverable is a decision-ready answer: effect size,
14
+ uncertainty, assumptions, caveats.
15
+
16
+ ## Workflow
17
+
18
+ ### 1. Frame the question as a hypothesis
19
+
20
+ State the null and alternative in plain words before touching data ("the new
21
+ flow's conversion equals the old flow's"). Identify the unit of analysis
22
+ (user? session? order?) — mismatching it with the randomization unit silently
23
+ breaks independence.
24
+
25
+ ### 2. Design before data (when the experiment hasn't run yet)
26
+
27
+ - Choose the primary metric and **pre-register it** — one primary, the rest
28
+ explicitly secondary/exploratory.
29
+ - Compute **sample size from power**: minimum detectable effect worth acting
30
+ on, α (typically 0.05), power (typically 0.8). Run until n is reached —
31
+ don't stop early on a good-looking result.
32
+ - Randomize at the unit you'll analyze; check the split is balanced on key
33
+ covariates.
34
+
35
+ ### 3. Choose the test and state its assumptions
36
+
37
+ Match the test to the data (two proportions → two-proportion z-test / χ²;
38
+ means → t-test or its nonparametric fallback; counts → Poisson/χ²; paired data
39
+ → paired tests). **Always state the assumptions and check the ones you can**:
40
+ independence of observations (the usual casualty — repeated measures per user,
41
+ network effects, shared fixtures), adequate counts for normal approximations
42
+ (rule of thumb: ≥10 successes and failures per arm), variance assumptions for
43
+ t-tests. If an assumption fails, switch tests rather than pretending.
44
+
45
+ ### 4. Report effect size and interval, not a verdict
46
+
47
+ Work the actual numbers. Report the effect (absolute and relative difference)
48
+ with a **confidence interval**, and the p-value as supporting detail — never a
49
+ bare "significant/not significant". The CI is what the decision needs: a CI of
50
+ [+0.1%, +1.7%] and a CI of [+0.8%, +1.0%] are both "significant" and mean very
51
+ different things.
52
+
53
+ ### 5. Run the pitfall gate
54
+
55
+ Before reporting anything, check:
56
+
57
+ - **Peeking / optional stopping**: was n fixed in advance? Repeatedly testing
58
+ as data arrives inflates false positives badly. If peeking happened, say so
59
+ and treat the result as suggestive (or use sequential methods designed for it).
60
+ - **Multiple comparisons**: k tests at α=0.05 ≈ k/20 false positives expected.
61
+ Correct (Holm/Bonferroni for strict control, Benjamini-Hochberg FDR when many
62
+ metrics), and label post-hoc findings as exploratory — they are hypotheses
63
+ for the *next* experiment, not wins from this one.
64
+ - **Subgroup fishing**: subgroup effects found after the fact need the same
65
+ exploratory label and a confirmatory follow-up.
66
+ - **Survivorship / selection**: does the analyzed sample still represent the
67
+ population the decision is about?
68
+
69
+ ### 6. Translate to the decision
70
+
71
+ Distinguish statistical from practical significance: a real +0.05% lift may
72
+ not pay for the complexity; a non-significant result with a wide CI is "we
73
+ don't know yet", not "no effect". Give the ship/don't-ship framing with the
74
+ caveats attached, and say what additional data would resolve remaining
75
+ uncertainty.
76
+
77
+ ## Principles
78
+
79
+ - **KISS**: a well-checked z-test beats a fancy model with unexamined
80
+ assumptions.
81
+ - **Pre-register or label**: every metric is either declared up front or
82
+ reported as exploratory — no third category.
83
+ - **Uncertainty is the product**: any answer without an interval is opinion
84
+ with extra steps.
85
+
86
+ ## Cross-skill boundaries
87
+
88
+ - Live A/B testing of an AI/LLM app — defining answer quality, LLM-as-judge,
89
+ human feedback loops, eval gates → **ai-evaluation** (this skill still owns
90
+ the underlying experiment statistics if asked).
91
+ - Generating the hypotheses to test → **exploratory-data-analysis**.
92
+ - Tracking and comparing model-training runs → **ml-experiment-tracking**.
93
+ - Defining what business metric to move → **metrics-and-okrs**.
@@ -0,0 +1,43 @@
1
+ {
2
+ "skill_name": "statistical-analysis",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "We ran an experiment: 2,400 users saw the new checkout flow and converted at 6.8%; 2,350 saw the old one and converted at 5.9%. My PM wants to ship it today — is this difference real? How confident can we be?",
7
+ "expected_output": "Should treat this as a two-proportion hypothesis test: state the null, run or outline the test with the actual numbers, report a confidence interval on the difference, ask whether the sample size was fixed in advance (peeking), and separate statistical from practical significance before giving a ship recommendation.",
8
+ "assertions": [
9
+ "Frames the question as a hypothesis test (two-proportion z-test or equivalent) and states the null hypothesis",
10
+ "Works the actual numbers given (or sets up the exact computation) rather than answering qualitatively",
11
+ "Reports uncertainty as a confidence interval on the difference, not only a p-value or a yes/no verdict",
12
+ "Asks or checks whether the sample size was fixed in advance and flags the peeking/optional-stopping problem",
13
+ "Distinguishes statistical significance from practical/business significance",
14
+ "States the assumptions behind the chosen test (independent samples, adequate counts)",
15
+ "Gives a clear ship/don't-ship framing with the statistical caveats attached"
16
+ ]
17
+ },
18
+ {
19
+ "id": 2,
20
+ "prompt": "We measured 20 different metrics in our experiment and 2 came out significant at p < 0.05. Which ones should we report as wins?",
21
+ "expected_output": "Should identify the multiple-comparisons problem (about one false positive is expected by chance at that rate), recommend a correction (Holm/Bonferroni or FDR), distinguish pre-registered primary metrics from exploratory ones, and treat the 2 hits as hypotheses for a confirmatory follow-up — not report them as wins.",
22
+ "assertions": [
23
+ "Identifies the multiple-comparisons problem explicitly — with 20 tests, roughly one false positive at p < 0.05 is expected by chance",
24
+ "Recommends a concrete correction (Bonferroni, Holm, or FDR / Benjamini-Hochberg) and notes the trade-off between them",
25
+ "Warns against reporting the 2 nominal hits as wins (p-hacking / cherry-picking)",
26
+ "Distinguishes pre-registered primary metrics from exploratory findings",
27
+ "Recommends treating the surviving hits as hypotheses for a follow-up confirmatory experiment",
28
+ "Does not simply declare the two significant metrics real effects"
29
+ ]
30
+ },
31
+ {
32
+ "id": 3,
33
+ "prompt": "We're about to launch a new system prompt for our support chatbot and want to A/B test it live against the current one to see which gives better answers. Can you set this up?",
34
+ "expected_output": "Should recognize this as online A/B evaluation of an LLM app and hand off to the ai-evaluation skill for the evaluation design (answer-quality metrics, LLM-as-judge or human feedback, eval gates); statistical-analysis contributes at most the underlying experiment statistics (sample size, significance), not the AI evaluation design.",
35
+ "assertions": [
36
+ "Recognizes this as AI-app evaluation territory and hands off to or invokes the ai-evaluation skill",
37
+ "Raises AI-specific measurement concerns (defining answer quality, LLM-as-judge or human feedback signals) rather than treating it as a pure two-sample statistics problem",
38
+ "Does not respond with only a generic A/B test design ignoring how answer quality gets measured",
39
+ "If it retains anything, retains only the experiment statistics (sample size, significance testing) as this skill's contribution"
40
+ ]
41
+ }
42
+ ]
43
+ }
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  name: strategic-review
3
- description: "Review a project's strategic position before going public, launching, or raising — vision, mission, value proposition, scope positioning, the defensible wedge, and a live competitive / market comparative analysis. Triggers: strategic review, positioning, go public, go-to-market, market analysis, competitive landscape, value proposition, is there a moat, who are our competitors, platform absorption risk, market positioning, comparable products. Use project-review for execution/roadmap/implementation health; delegates deep market scans to deep-research."
3
+ description: "Review a project's strategic position before going public, launching, or raising — vision, mission, value proposition, scope positioning, the defensible wedge, and a live competitive / market comparative analysis. Use project-review for execution/roadmap/implementation health; delegates deep market scans to deep-research."
4
+ when_to_use: "Triggers: strategic review, positioning, go public, go-to-market, market analysis, competitive landscape, value proposition, is there a moat, who are our competitors, platform absorption risk, market positioning, comparable products."
4
5
  model: opus
6
+ context: fork
7
+ agent: general-purpose
5
8
  allowed-tools: Read, Grep, Glob, WebFetch, WebSearch, Write, Edit
6
9
  ---
7
10
 
@@ -60,6 +63,9 @@ Survey the field with current evidence, not memory:
60
63
  absorb the category.
61
64
  - For a deep, multi-source, fact-checked sweep, **delegate to `deep-research`** and
62
65
  fold its cited report in. For a lighter pass, use `WebSearch`/`WebFetch` directly.
66
+ (This skill runs in a forked context — if the `deep-research` skill is not
67
+ invocable from here, do the lighter pass yourself and note under Open questions
68
+ that a deep-research sweep is the recommended follow-up.)
63
69
  - **Tag each comparable** with its relationship: **competitor**, **complement**,
64
70
  or **integration target** — and what it means for this project.
65
71
  - Label every finding confirmed-vs-inferred and date it.
@@ -86,8 +92,16 @@ Integrate the above into a decision instrument:
86
92
  default is options + a recommendation.
87
93
  - **A readiness picture** mapped to the project's own gates, if it has them.
88
94
 
95
+ **Write the full review to a file** — default a gitignored path (e.g.
96
+ `.local/strategic-review-<date>.md`) — and state its path in your final summary.
97
+ This skill runs in a forked context: only the summary returns, everything unwritten
98
+ is lost. The summary leads with the thesis verdict and the top weak point.
99
+ Anything that needs the user's judgment (which strategic fork to take, an
100
+ unverifiable market assumption, missing vision docs) goes in an **Open questions**
101
+ section of the report — never silently decided.
102
+
89
103
  For the rendered deliverable (interactive HTML, scorecards, a forks comparison
90
- panel), hand off to `artifact-design`; default to a gitignored path (e.g. `.local/`).
104
+ panel), hand off to `artifact-design`.
91
105
 
92
106
  ## Principles Applied
93
107
 
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  name: technical-debt-review
3
- description: "Strategic codebase health assessment — identify hotspots, categorize debt, produce remediation roadmap. Triggers: technical debt, tech debt, debt review, codebase health, hotspots, debt assessment, remediation plan, what should we fix first, debt roadmap, code rot, legacy code audit."
3
+ description: "Strategic codebase health assessment — identify hotspots, categorize debt, produce remediation roadmap."
4
+ when_to_use: "Triggers: technical debt, tech debt, debt review, codebase health, hotspots, debt assessment, remediation plan, what should we fix first, debt roadmap, code rot, legacy code audit."
4
5
  model: opus
6
+ context: fork
7
+ agent: general-purpose
5
8
  allowed-tools: Read, Grep, Glob, Write, Edit
6
9
  ---
7
10
 
@@ -34,7 +37,7 @@ Don't try to review everything. Focus on where pain is concentrated.
34
37
  - Tests that only test happy paths (no edge cases, no error cases)
35
38
  - Test files significantly longer than the code they test (over-specified tests that break on refactoring)
36
39
 
37
- Ask the user: Where do engineers slow down? What parts of the codebase do people avoid touching? Where do bugs keep appearing?
40
+ If the request came with team pain points (where engineers slow down, code people avoid touching, where bugs keep appearing), weight those hotspots first. This skill runs in a forked context and cannot ask mid-run — when that input is missing, proceed on the code signals above and list "where does the team actually hurt?" under Open questions in the report.
38
41
 
39
42
  ## Step 2: Categorize by Debt Type and Severity
40
43
 
@@ -99,6 +102,13 @@ Output a prioritized action plan:
99
102
 
100
103
  Use [templates/debt-audit.md](templates/debt-audit.md) for the full audit format.
101
104
 
105
+ **Write the full audit to a file** (default a gitignored location, e.g.
106
+ `.local/debt-review-<date>.md`) and state its path in your final summary — this
107
+ skill runs in a forked context: only the summary returns, everything unwritten is
108
+ lost. Judgment calls that need user input (e.g. which subsystem matters most,
109
+ unknown team pain points) go in an **Open questions** section of the report, never
110
+ guessed silently.
111
+
102
112
  ## Principles Applied
103
113
 
104
114
  - **KISS**: Simplify complexity first — complex code is the root cause of most other debt