swe-workflow-skills 0.2.0 → 0.4.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.
@@ -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
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: writing-skills
3
- description: "Use when authoring, editing, or reviewing a skill in this library — a new SKILL.md, one that under-triggers, or hardening an existing one. Covers description and listing-budget rules, frontmatter, progressive disclosure, the 3-eval rule, and pressure-testing against rationalizations. Triggers: write a skill, new skill, edit a skill, skill isn't triggering."
3
+ description: "Use when authoring, editing, or reviewing a skill in this library — a new SKILL.md, one that under-triggers, or hardening an existing one. Covers description and listing-budget rules, frontmatter, progressive disclosure, the 3-eval rule, and pressure-testing against rationalizations."
4
+ when_to_use: "Triggers: write a skill, new skill, edit a skill, skill isn't triggering."
4
5
  model: sonnet
5
6
  allowed-tools: Read, Grep, Glob, Write, Edit, Bash
6
7
  ---
@@ -51,24 +52,31 @@ description over the body, so get it right.
51
52
  - **Write WHEN to use, not WHAT it does.** A description that summarizes the
52
53
  internal workflow ("reviews code in two passes") triggers worse than one that
53
54
  lists situations ("review this PR, check my code before commit").
54
- - **Our format is a compliant hybrid:** `<when/purpose>. Triggers: <keywords>. <boundary>`.
55
- The `Triggers:` list *is* the when-to-use expressed as the phrases a user
56
- actually types keep casting that net wide.
57
- - **Keep the hybrid format for now** (don't move triggers to `when_to_use` yet):
58
- the catalog builder reads only `description`, so the router would lose the
59
- trigger phrases. The `when_to_use` migration is a coordinated roadmap change
60
- (builder + skills + routing re-baseline together).
61
- - **~350 chars** for `description` (listing-budget constraint; hard cap 1024).
62
- Over budget, the *least-invoked* skills' descriptions drop silently — `/doctor`
63
- reports it. See AUTHORING.md "Listing Budget".
55
+ - **The listing is `description` + `when_to_use`.** The `Triggers:` list *is* the
56
+ when-to-use expressed as the phrases a user actually types — keep casting that
57
+ net wide. **New skills put it in `when_to_use`; existing skills migrate lazily**
58
+ (whenever next touched). A migration must be a **pure move**: triggers go to
59
+ `when_to_use`, the **boundary/delegation instructions STAY in `description`**
60
+ (they're what steers haiku routing EVALS.md). The catalog builder concatenates
61
+ both fields check with `node scripts/build-plugins.mjs` + `git diff
62
+ catalog.json` that content is unchanged (a trailing boundary reorders ahead of
63
+ the triggers; that's fine). No re-baseline needed.
64
+ - **~350 chars** combined listing target (hard caps: `description` 1024, combined
65
+ 1536 — the builder errors above either). Over the listing budget, the
66
+ *least-invoked* skills' descriptions drop silently — `/doctor` reports it. See
67
+ AUTHORING.md "Listing Budget".
64
68
  - **Anti-pattern:** describing mechanics/steps instead of triggering situations.
65
69
 
66
70
  ## Structure and budget (brief — see AUTHORING.md for detail)
67
71
 
68
- - Frontmatter: `name`, `description`, `model` (haiku/sonnet/opus by reasoning
69
- need), `allowed-tools`. Newer fields where they fit: `when_to_use`,
70
- `context: fork` + `agent` (heavy read-only skills), `paths` (file-scoped),
71
- `disable-model-invocation` (deliberate-only workflows), `effort`.
72
+ - Frontmatter: `name`, `description`, `when_to_use`, `model` (haiku/sonnet/opus
73
+ by reasoning need), `allowed-tools`. Newer fields where they fit:
74
+ `context: fork` + `agent` (heavy report-producing skills must write the full
75
+ report to a file and put anything needing user input in an "Open questions"
76
+ section, since a fork returns only a summary and can't ask the user),
77
+ `paths` (file-scoped), `disable-model-invocation` (deliberate-only workflows),
78
+ `effort`. Dynamic `` !`cmd` `` injection: cheap `--stat`-style commands only,
79
+ `|| true` failure-tolerant — see AUTHORING.md's injection rules.
72
80
  - Progressive disclosure: keep SKILL.md tight (aim < 300 lines); push deep
73
81
  domain knowledge to `references/`, output formats to `templates/`. On
74
82
  compaction only a skill's first ~5k tokens are re-attached — front-load the
@@ -89,11 +97,19 @@ Apply rigor where mistakes are expensive; keep freedom where judgment matters.
89
97
  architecture exploration, UX, estimation, proposals. Rigidity there produces
90
98
  worse outcomes, not better ones.
91
99
 
92
- ## Retiring skills
93
-
94
- As base models improve, a skill can become pure overhead. Periodically re-run a
95
- skill's evals RED (without the skill); if RED GREEN, slim or retire it rather
96
- than letting it spend listing budget and re-attachment tokens.
100
+ ## Retiring skills (obsolescence review)
101
+
102
+ As base models improve, a skill can become pure overhead. Once per release cycle
103
+ or on a major base-model update re-run the skill's 3 evals RED on shipping
104
+ models via `evals/workflow-runner.mjs`; re-sample ×3 on borderline scores and
105
+ read the judge journal before calling a result variance (a "flaky" case is often
106
+ a real content gap the skill causes). If RED ≈ GREEN across all 3 evals (0/0
107
+ tool-dependent assertion pairs don't count), **slim first** — cut what the model
108
+ does unaided; keep the Iron Law, boundaries, and cross-skill references — then
109
+ re-run GREEN (gate: GREEN ≥ RED per case). Retire only after a slimmed skill
110
+ stays RED ≈ GREEN a full cycle later, with a deprecation notice in
111
+ CHANGELOG/ROLES.md first (removal is user-visible to role and plugin consumers).
112
+ Full policy: docs/AUTHORING.md § Obsolescence review.
97
113
 
98
114
  ## See also
99
115
 
package/uninstall.mjs CHANGED
@@ -12,7 +12,7 @@
12
12
  // node uninstall.mjs --global # remove from the user config dir
13
13
  // node uninstall.mjs --dir DIR --dry-run
14
14
 
15
- import { existsSync, statSync, readdirSync, rmSync, rmdirSync } from "node:fs";
15
+ import { existsSync, statSync, readdirSync, readFileSync, rmSync, rmdirSync } from "node:fs";
16
16
  import { dirname, join, resolve } from "node:path";
17
17
  import { fileURLToPath } from "node:url";
18
18
  import { homedir } from "node:os";
@@ -96,16 +96,38 @@ if (!isDir(claudeDir)) {
96
96
 
97
97
  const settingsLocal = join(claudeDir, "settings.local.json");
98
98
 
99
- // Build the removal list: only library skills present on disk, plus the machinery.
100
- const libSkills = readdirSync(SKILLS_DIR)
101
- .filter((s) => isDir(join(SKILLS_DIR, s)) && isDir(join(dest, s)))
102
- .sort();
99
+ // Build the removal list: only library skills THIS installer created, plus the
100
+ // machinery. The provenance manifest is authoritative when present, so a user's own
101
+ // custom skill that shares a library name is never removed. Pre-manifest installs
102
+ // have no manifest — fall back to matching source-tree skill names (the historical
103
+ // behavior) so they can still be uninstalled.
104
+ const manifestPath = join(dest, ".swe-workflow-manifest.json");
105
+ let manifestSkills = null;
106
+ if (existsSync(manifestPath)) {
107
+ try {
108
+ const m = JSON.parse(readFileSync(manifestPath, "utf-8"));
109
+ if (Array.isArray(m.skills)) manifestSkills = m.skills;
110
+ } catch {
111
+ /* unreadable manifest -> fall back to name-match below */
112
+ }
113
+ }
114
+
115
+ let libSkills;
116
+ if (manifestSkills !== null) {
117
+ const srcSkills = new Set(readdirSync(SKILLS_DIR).filter((s) => isDir(join(SKILLS_DIR, s))));
118
+ libSkills = manifestSkills.filter((s) => srcSkills.has(s) && isDir(join(dest, s))).sort();
119
+ } else {
120
+ libSkills = readdirSync(SKILLS_DIR)
121
+ .filter((s) => isDir(join(SKILLS_DIR, s)) && isDir(join(dest, s)))
122
+ .sort();
123
+ }
103
124
 
104
125
  const targets = [...libSkills.map((s) => join(dest, s))];
105
126
  for (const f of [
106
127
  join(dest, ".roles.json"),
107
128
  join(dest, ".catalog.json"),
108
129
  join(dest, ".active-role"),
130
+ join(dest, ".swe-workflow-manifest.json"),
109
131
  join(claudeDir, "hooks", "resolve.mjs"),
110
132
  join(claudeDir, "hooks", "session-start.mjs"),
111
133
  join(claudeDir, "commands", "role.md"),