pm-claude-skills 43.0.0 → 44.0.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.
- package/README.md +38 -10
- package/bin/chain.mjs +113 -0
- package/bin/cli.mjs +45 -1
- package/bin/council.mjs +94 -0
- package/bin/init.mjs +111 -0
- package/bin/install.mjs +179 -0
- package/bin/lib/providers.mjs +64 -0
- package/bin/migrate.mjs +88 -0
- package/bin/reckoning.mjs +112 -0
- package/bin/verify.mjs +56 -0
- package/connectors/mcp-pairings.md +13 -0
- package/exports/README.md +1 -1
- package/exports/aider/README.md +4 -1
- package/exports/aider/pm-calculators/cohort-curve-model/cohort-curve-model.md +44 -0
- package/exports/aider/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +44 -0
- package/exports/aider/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +44 -0
- package/exports/chatgpt/README.md +4 -1
- package/exports/chatgpt/pm-calculators/cohort-curve-model/SYSTEM_PROMPT.md +44 -0
- package/exports/chatgpt/pm-calculators/pricing-sensitivity-model/SYSTEM_PROMPT.md +44 -0
- package/exports/chatgpt/pm-calculators/runway-monte-carlo/SYSTEM_PROMPT.md +44 -0
- package/exports/cline/README.md +4 -1
- package/exports/cline/pm-calculators/cohort-curve-model/cohort-curve-model.md +44 -0
- package/exports/cline/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +44 -0
- package/exports/cline/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +44 -0
- package/exports/continue/README.md +4 -1
- package/exports/continue/pm-calculators/cohort-curve-model/cohort-curve-model.md +49 -0
- package/exports/continue/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +49 -0
- package/exports/continue/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +49 -0
- package/exports/cursor/README.md +4 -1
- package/exports/cursor/pm-calculators/cohort-curve-model/cohort-curve-model.mdc +50 -0
- package/exports/cursor/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.mdc +50 -0
- package/exports/cursor/pm-calculators/runway-monte-carlo/runway-monte-carlo.mdc +50 -0
- package/exports/gemini/README.md +4 -1
- package/exports/gemini/pm-calculators/cohort-curve-model/GEM_INSTRUCTIONS.md +48 -0
- package/exports/gemini/pm-calculators/pricing-sensitivity-model/GEM_INSTRUCTIONS.md +48 -0
- package/exports/gemini/pm-calculators/runway-monte-carlo/GEM_INSTRUCTIONS.md +48 -0
- package/exports/kilocode/README.md +4 -1
- package/exports/kilocode/pm-calculators/cohort-curve-model/cohort-curve-model.md +44 -0
- package/exports/kilocode/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +44 -0
- package/exports/kilocode/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +44 -0
- package/exports/obsidian/README.md +4 -1
- package/exports/obsidian/pm-calculators/cohort-curve-model/cohort-curve-model.md +59 -0
- package/exports/obsidian/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +59 -0
- package/exports/obsidian/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +59 -0
- package/exports/roo/README.md +4 -1
- package/exports/roo/pm-calculators/cohort-curve-model/cohort-curve-model.md +44 -0
- package/exports/roo/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +44 -0
- package/exports/roo/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +44 -0
- package/exports/windsurf/README.md +4 -1
- package/exports/windsurf/pm-calculators/cohort-curve-model/cohort-curve-model.md +49 -0
- package/exports/windsurf/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +49 -0
- package/exports/windsurf/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +49 -0
- package/exports/zed/README.md +4 -1
- package/exports/zed/pm-calculators/cohort-curve-model/cohort-curve-model.md +44 -0
- package/exports/zed/pm-calculators/pricing-sensitivity-model/pricing-sensitivity-model.md +44 -0
- package/exports/zed/pm-calculators/runway-monte-carlo/runway-monte-carlo.md +44 -0
- package/mcp/README.md +5 -0
- package/mcp/server.mjs +69 -0
- package/package.json +1 -1
- package/skills/cohort-curve-model/SKILL.md +49 -0
- package/skills/cohort-curve-model/scripts/cohort_model.py +148 -0
- package/skills/pricing-sensitivity-model/SKILL.md +49 -0
- package/skills/pricing-sensitivity-model/scripts/van_westendorp.py +168 -0
- package/skills/runway-monte-carlo/SKILL.md +49 -0
- package/skills/runway-monte-carlo/scripts/runway_sim.py +159 -0
- package/templates/apprentice/README.md +26 -0
- package/templates/apprentice/index.mjs +65 -0
- package/templates/apprentice/package.json +10 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# 🧠 PM Skills —
|
|
1
|
+
# 🧠 PM Skills — 454 Professional Agent Skills for Claude, ChatGPT, Gemini, Cursor, Codex & Hermes
|
|
2
2
|
|
|
3
3
|
[](#-quick-install-2-minutes)
|
|
4
4
|
[](https://github.com/mohitagw15856/pm-claude-skills/stargazers)
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://github.com/mohitagw15856/pm-claude-skills#-use-it-anywhere--the-ai-ecosystem)
|
|
10
10
|
[](mcp-remote/)
|
|
11
11
|
[](https://smithery.ai/servers/mohit15856/pm-skills)
|
|
12
|
-
[](https://github.com/mohitagw15856/pm-claude-skills)
|
|
13
13
|
[](https://mohitagw15856.github.io/pm-claude-skills/leaderboard.html)
|
|
14
14
|
[](agents/)
|
|
15
15
|
[](commands/)
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
<p align="center">
|
|
27
27
|
<a href="https://mohitagw15856.github.io/pm-claude-skills/">
|
|
28
|
-
<img src="https://readme-typing-svg.demolab.com?font=Inter&weight=600&size=24&pause=900&color=D97757¢er=true&vCenter=true&width=720&lines=
|
|
28
|
+
<img src="https://readme-typing-svg.demolab.com?font=Inter&weight=600&size=24&pause=900&color=D97757¢er=true&vCenter=true&width=720&lines=454+pro+AI+skills;PRDs%2C+roadmaps%2C+launches+%E2%80%94+done+right;Run+any+one+free+in+your+browser" alt="PM Skills" />
|
|
29
29
|
</a>
|
|
30
30
|
</p>
|
|
31
31
|
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
</details>
|
|
75
75
|
|
|
76
76
|
> **PM stands for Professional, not just Product Management.**
|
|
77
|
-
>
|
|
77
|
+
> 454 professional skills + 4 agent templates across 65 bundles covering 25 professions. Built for Claude Code — and now portable to ChatGPT, Gemini, and Hermes Agent. Built by a PM, used by everyone.
|
|
78
78
|
|
|
79
79
|
A community-built library of professional skills for every field — product management, engineering, customer success, marketing, social media, writers, design, legal, finance, HR, sales, operations, research, and more. Each skill is a structured `SKILL.md` file that teaches an AI assistant how to produce professional-grade outputs for your workflows. Skills run natively in **Claude Code** and **Hermes Agent** (same open `SKILL.md` standard), and ship as ready-to-paste exports for **ChatGPT** and **Gemini** — see [Works With](#-works-with--cross-tool-compatibility).
|
|
80
80
|
|
|
81
|
-
**🆕
|
|
81
|
+
**🆕 v44.0.0 — the legendary release:** 🗺 **[Campaign mode](https://mohitagw15856.github.io/pm-claude-skills/campaign.html)** — one story across every arena where your real scores write the plot, 📖 **[The Professional Work Handbook](https://mohitagw15856.github.io/pm-claude-skills/handbook.html)** — the library as a printable book with the **2,237-rule Anti-Pattern Almanac**, ⚖️ **[The Reckoning](https://mohitagw15856.github.io/pm-claude-skills/reckoning.html)** — your prediction ledger with a calibration curve & Brier score, 📦 **`npx pm-claude-skills install <owner/repo>`** — the ecosystem package manager (security-scanned, SkillSpec-graded, integrity-locked with `verify`), 🧪 **zero-key `run_skill` via MCP sampling**, ⛓ **`chain`** (multi-skill pipelines ending in real Office files), 🧰 **[`pm-skills-tools`](tools-pkg/)** on npm (454 skills as OpenAI/Vercel-AI tools), 🛡 **the live [SkillSpec badge](skillspec/README.md#the-badge)**, 🌍 **[The State of Agent Skills census](docs/reports/)**, 🧑🎓 **[The Apprentice](templates/apprentice/)** Agent SDK starter, ⚖️ `council` (cross-vendor adversarial review), 📥 `migrate`, ☀️ the chief-of-staff hook, 🧮 **computed skills** (Monte Carlo runway, cohort curve fitting, Van Westendorp — real .xlsx with live formulas), `init`, `doctor`, `reckoning` — and the full **🔏 chain of trust** (sha256 pinning → lockfile → provenance). *Earlier — v43, the local-first & learning wave:* the 🗂 workspace bridge, Boardroom replay links & bench packs, 🎤 The Panel, 🎓 The Academy, 🎁 Wrapped, the evolution loop & pm-method. *Earlier — v42:* depth (`references/` + `templates/`) on all Production-Ready skills, 🔊 Theatre voices, Firm calibration & the CI smoke suite. *Earlier — v41, the modern skills wave:* two new domains — **🤖 [`pm-agentnative`](plugins/pm-agentnative)** (build for non-human users: [`mcp-server-spec`](skills/mcp-server-spec/SKILL.md), [`agent-readiness-audit`](skills/agent-readiness-audit/SKILL.md), [`agent-era-pricing`](skills/agent-era-pricing/SKILL.md), [`human-in-the-loop-design`](skills/human-in-the-loop-design/SKILL.md), [`voice-agent-design`](skills/voice-agent-design/SKILL.md)) and **🧑💼 [`pm-aiwork`](plugins/pm-aiwork)** (the questions every manager has this year: [`ai-roi-audit`](skills/ai-roi-audit/SKILL.md), [`role-redesign-for-ai`](skills/role-redesign-for-ai/SKILL.md), [`ai-usage-policy`](skills/ai-usage-policy/SKILL.md), [`ai-assisted-performance-review`](skills/ai-assisted-performance-review/SKILL.md), [`ai-content-audit`](skills/ai-content-audit/SKILL.md)) — plus 5 singles ([`ai-code-review`](skills/ai-code-review/SKILL.md), [`synthetic-user-research`](skills/synthetic-user-research/SKILL.md), [`async-decision-memo`](skills/async-decision-memo/SKILL.md), [`brand-impersonation-response`](skills/brand-impersonation-response/SKILL.md), [`feature-sunset-plan`](skills/feature-sunset-plan/SKILL.md)). Also: 🌠 Galaxy shooting stars + a 🎲 Warp button, 🎓 frameable [certificates](web/export-doc.js) from the arena pages, and 🔌 [MCP pairings](connectors/mcp-pairings.md) — skills that act through your connected servers. *Earlier — v40: [The Firm](https://mohitagw15856.github.io/pm-claude-skills/firm.html). v39 (three waves):* ⚡ *Superpowers:* [SkillBench](skillbench/) (the professional-work benchmark for models) · the [community registry](community/) (npm-for-skills) · the [Interview Gauntlet](https://mohitagw15856.github.io/pm-claude-skills/gauntlet.html) · [CI recipes](action/examples/) + [ambient hooks](hooks/) · Hugging Face [dataset publishing](dataset/) · [localization to 8 languages](i18n/). 🤯 *Breathtaking:* [living artifacts](https://mohitagw15856.github.io/pm-claude-skills/), [Document X-ray](https://mohitagw15856.github.io/pm-claude-skills/xray.html), [The Gym](https://mohitagw15856.github.io/pm-claude-skills/gym.html), [`pm-vision`](plugins/pm-vision), [`style-fingerprint`](skills/style-fingerprint/SKILL.md), [`evidence-lock`](skills/evidence-lock/SKILL.md). ✨ *Revamped:* the playground command bar + Galaxy 2.0 with a guided Sky tour. **454 skills · 65 bundles · 25 professions.** → [CHANGELOG](CHANGELOG.md) · [all releases](https://github.com/mohitagw15856/pm-claude-skills/releases).
|
|
82
82
|
|
|
83
83
|
### ▶ See it in action — [try the live Skill Playground](https://mohitagw15856.github.io/pm-claude-skills/)
|
|
84
84
|
|
|
@@ -134,7 +134,7 @@ In Claude Code, [`/firm`](commands/firm.md) runs the same session natively — g
|
|
|
134
134
|
<tr>
|
|
135
135
|
<td width="50%">
|
|
136
136
|
<a href="https://mohitagw15856.github.io/pm-claude-skills/"><img src="web/docs-assets/showcase/cmdbar.png" alt="The command bar — describe your task in plain words and get matched to the right skill instantly" /></a>
|
|
137
|
-
<b>🪄 <a href="https://mohitagw15856.github.io/pm-claude-skills/">The command bar</a></b> — don't browse
|
|
137
|
+
<b>🪄 <a href="https://mohitagw15856.github.io/pm-claude-skills/">The command bar</a></b> — don't browse 454 cards; just say it: <i>"a blameless postmortem for Friday's outage"</i> → the top three skills, instantly, locally, before you've even entered a key. Enter opens the best match.
|
|
138
138
|
</td>
|
|
139
139
|
<td width="50%">
|
|
140
140
|
<a href="https://mohitagw15856.github.io/pm-claude-skills/galaxy.html"><img src="web/docs-assets/showcase/galaxy.png" alt="Skill Galaxy — the library as a living star map with a guided sky tour" /></a>
|
|
@@ -228,7 +228,7 @@ Generic AI forgets everything between sessions, so you re-paste context forever
|
|
|
228
228
|
<details>
|
|
229
229
|
<summary>Read more ↓</summary>
|
|
230
230
|
|
|
231
|
-
These
|
|
231
|
+
These 454 skills aren't a random catalog — they cover the **full arc of professional work**, end to end. Wherever you are in the loop, there's a skill for it:
|
|
232
232
|
|
|
233
233
|
```mermaid
|
|
234
234
|
flowchart LR
|
|
@@ -349,6 +349,34 @@ Connect the Firm or the Boardroom to a **real folder on disk** (the 🗂 chip, C
|
|
|
349
349
|
|
|
350
350
|
---
|
|
351
351
|
|
|
352
|
+
### 🗺 The Campaign, the Book, and the Ledger
|
|
353
|
+
|
|
354
|
+
- **[Your First 90 Days](https://mohitagw15856.github.io/pm-claude-skills/campaign.html)** — campaign mode: one story across every arena. You join a fictional Series A startup, and your *real* arena scores write the plot — lose the Gym negotiation and the account churns; get fooled in the Panel and the bad hire haunts Week 10. Replayable, saves locally, certificate at Day 90.
|
|
355
|
+
- **[The Professional Work Handbook](https://mohitagw15856.github.io/pm-claude-skills/handbook.html)** — the library as a book: 11 chapters of craft (the Production-Ready tier in full) + **the Anti-Pattern Almanac: 2,237 rules of professional judgment** from all 454 skills. Printable ([PDF](web/docs-assets/handbook.pdf)), free, regenerated every release.
|
|
356
|
+
- **[The Reckoning](https://mohitagw15856.github.io/pm-claude-skills/reckoning.html)** — your prediction ledger: confidences, due dates, resurfacing, and a personal **calibration curve with a Brier score**. Also in the CLI: `npx pm-claude-skills reckoning`. When you say 80%, does it happen 80% of the time? Now you'll know.
|
|
357
|
+
- **🔏 The chain of trust** — security scan → [sha256 content pinning](community/README.md#-trust--integrity--the-full-chain) in the registry → install lockfile + `npx pm-claude-skills verify` drift detection → npm provenance. Verifiable end to end, no trust in us required.
|
|
358
|
+
|
|
359
|
+
### 🌐 Infrastructure for the whole ecosystem
|
|
360
|
+
|
|
361
|
+
- **[`pm-skills-tools`](tools-pkg/)** — all 454 skills as **agent tools**: OpenAI function schemas, Vercel AI SDK adapters, `pick()`/`search()` runtime. `npm i pm-skills-tools` and your agent wields the library.
|
|
362
|
+
- **[The SkillSpec badge](skillspec/README.md#the-badge)** — any skills repo can wear its live-graded conformance level: ``.
|
|
363
|
+
- **[The State of Agent Skills](docs/reports/)** — the census of the public SKILL.md ecosystem (counts, conformance pyramid, security hits), regenerated from GitHub code search. The observatory, not just a participant.
|
|
364
|
+
- **[Every protocol](connectors/mcp-pairings.md#every-protocol-one-library)** — MCP (with zero-key sampling) · A2A · AGENTS.md · function calling · REST.
|
|
365
|
+
- **[The Apprentice](templates/apprentice/)** — a ready-to-run Agent SDK agent grounded in your brain and your skills' Quality Checks. Fork it.
|
|
366
|
+
- **`council`** (cross-vendor adversarial review) · **`migrate`** (convert prompt libraries into skills) · **[chief-of-staff hook](hooks/)** (every session opens with your predictions due and latest verdicts).
|
|
367
|
+
|
|
368
|
+
### 📦 The ecosystem toolchain — beyond this library
|
|
369
|
+
|
|
370
|
+
- **`npx pm-claude-skills install <owner/repo>`** — install skills from **any public GitHub repo**, security-scanned and [SkillSpec](SKILLSPEC.md)-graded on the way in; flagged skills are never installed. The package manager for the whole skills ecosystem, with auditing as the value add.
|
|
371
|
+
- **`npx pm-claude-skills chain <workflow>`** — run a whole recipe headless (`chain --list`): each skill feeds the next, and `--deck`/`--doc` finish with a **real .pptx/.docx**. Raw notes in, board-ready deck out, one command.
|
|
372
|
+
- **`npx pm-claude-skills init`** — the 60-second professional workspace: `brain/`, standing context, arena folders, CLAUDE.md wiring. Then `doctor` keeps it healthy.
|
|
373
|
+
- **`run_skill` over MCP with zero API key** — the [MCP server](mcp/) executes skills via **MCP sampling**: the generation runs on your client's model, no key needed by anyone.
|
|
374
|
+
- **[`skillspec-check`](skillspec/)** — the eslint for SKILL.md, as a standalone npm package + [pre-commit hook](.pre-commit-hooks.yaml): lint ANY repo's skills against the standard (`--min-level 2` as a CI gate).
|
|
375
|
+
- **[Boardroom doc review in CI](action/examples/doc-review-boardroom.yml)** — PRs touching docs get a CFO/CTO/CCO critique with a 🟢/🟡/🔴 Chair verdict as a PR comment. Documents get code review.
|
|
376
|
+
- **🧮 Skills that do math** — [`cohort-curve-model`](skills/cohort-curve-model/SKILL.md), [`runway-monte-carlo`](skills/runway-monte-carlo/SKILL.md), [`pricing-sensitivity-model`](skills/pricing-sensitivity-model/SKILL.md): each ships a stdlib script that **computes** (curve fitting, 5,000-path simulation, survey crossings) and emits a **real .xlsx with live formulas**.
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
352
380
|
## 🧠 Skill Memory — set your context once, every skill uses it
|
|
353
381
|
|
|
354
382
|
<details>
|
|
@@ -429,7 +457,7 @@ Most skill repos are a folder of prompts. This one is a **system** — measured,
|
|
|
429
457
|
|
|
430
458
|
| | **PM Skills** | Typical skill repo |
|
|
431
459
|
|---|:---:|:---:|
|
|
432
|
-
| Skills | **
|
|
460
|
+
| Skills | **454**, across 25 professions | a handful → dozens, usually one domain |
|
|
433
461
|
| Quality | **eval-scored** on a rubric + a public [benchmark](https://mohitagw15856.github.io/pm-claude-skills/benchmark.html) | trust the README |
|
|
434
462
|
| Improves itself | ✅ eval → critique → rewrite (kept only if it scores higher) | ✗ |
|
|
435
463
|
| Grounded in frameworks | ✅ each cites its source (RICE, JTBD, Pyramid Principle…) | rarely |
|
|
@@ -907,7 +935,7 @@ More templates will follow. If you want to contribute one, see the [template con
|
|
|
907
935
|
<details>
|
|
908
936
|
<summary>Read more ↓</summary>
|
|
909
937
|
|
|
910
|
-
**Latest:
|
|
938
|
+
**Latest: v44.0.0 — the legendary release: Campaign mode, the Professional Work Handbook (2,237-rule Anti-Pattern Almanac), the Reckoning calibration ledger, the ecosystem package manager (`install`/`verify`), zero-key MCP sampling, `pm-skills-tools` on npm, the live SkillSpec badge, the State of Agent Skills census, the Apprentice, and skills that do math (454 skills, 65 bundles)** · *v43:* the workspace bridge, replay links & bench packs, The Panel, The Academy, Wrapped, the evolution loop & pm-method · *v42:* depth on all Production-Ready skills, arena voices, Firm calibration & the web-tests safety net · *v41, modern skills:* [`pm-agentnative`](plugins/pm-agentnative) + [`pm-aiwork`](plugins/pm-aiwork) (15 skills for the agent era), Galaxy cosmic events, 🎓 certificates & [MCP pairings](connectors/mcp-pairings.md) · *v40: [The Firm](https://mohitagw15856.github.io/pm-claude-skills/firm.html) · v39, three waves:* [SkillBench](skillbench/), the [community registry](community/), the [Interview Gauntlet](https://mohitagw15856.github.io/pm-claude-skills/gauntlet.html), [living artifacts](https://mohitagw15856.github.io/pm-claude-skills/), [Document X-ray](https://mohitagw15856.github.io/pm-claude-skills/xray.html), [The Gym](https://mohitagw15856.github.io/pm-claude-skills/gym.html), pm-vision, i18n, HF publishing, CI recipes & the Galaxy Sky tour. 454 skills across 65 bundles, 25 professions. Every tagged release has complete notes on the **[Releases page](https://github.com/mohitagw15856/pm-claude-skills/releases)**.
|
|
911
939
|
|
|
912
940
|
Full [Keep a Changelog](https://keepachangelog.com/)-format history — every release back to the start — is in **[CHANGELOG.md](CHANGELOG.md)**.
|
|
913
941
|
|
|
@@ -1018,7 +1046,7 @@ Every skill, grouped by profession. **[Browse the full per-skill catalog → SKI
|
|
|
1018
1046
|
<details>
|
|
1019
1047
|
<summary>Read more ↓</summary>
|
|
1020
1048
|
|
|
1021
|
-
Building and maintaining
|
|
1049
|
+
Building and maintaining 454 skills across 65 bundles takes real time — testing skills against new model releases, building new ones from community requests, writing the article series, and keeping documentation current.
|
|
1022
1050
|
|
|
1023
1051
|
If these skills save you time at work — or you're a company that wants your logo in front of the PMs, engineers, and operators who use them daily — **[become a sponsor →](https://github.com/sponsors/mohitagw15856)** (or [☕ buy me a coffee](https://www.buymeacoffee.com/mohit15856)).
|
|
1024
1052
|
|
package/bin/chain.mjs
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// `pm-claude-skills chain <workflow>` — run a whole workflow recipe headless:
|
|
2
|
+
// every skill in the chain executes in order, each output carried forward as
|
|
3
|
+
// context for the next. Raw notes in, a folder of finished artifacts out —
|
|
4
|
+
// optionally including REAL Office files via the stdlib document tools.
|
|
5
|
+
//
|
|
6
|
+
// pm-claude-skills chain --list
|
|
7
|
+
// pm-claude-skills chain run-discovery --input notes.txt
|
|
8
|
+
// pm-claude-skills chain ship-a-feature --text "referral program for B2B" --out-dir ./artifacts
|
|
9
|
+
// cat notes.md | pm-claude-skills chain close-the-quarter --deck # + a real .pptx at the end
|
|
10
|
+
//
|
|
11
|
+
// Needs ANTHROPIC_API_KEY (your key, one call per step). Pure Node + optional
|
|
12
|
+
// python3 only for --deck/--doc (the same zero-dependency scripts the document
|
|
13
|
+
// skills ship).
|
|
14
|
+
import { readFileSync, existsSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
15
|
+
import { join, dirname } from 'node:path';
|
|
16
|
+
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import { spawnSync } from 'node:child_process';
|
|
18
|
+
import { complete, parseSkill } from './lib/anthropic.mjs';
|
|
19
|
+
|
|
20
|
+
const PKG_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
21
|
+
const getArg = (argv, name, def) => { const i = argv.indexOf('--' + name); return i !== -1 && argv[i + 1] ? argv[i + 1] : def; };
|
|
22
|
+
|
|
23
|
+
const SUFFIX =
|
|
24
|
+
'\n\n---\nExecute this skill now on the material below and produce the complete output. ' +
|
|
25
|
+
'Do not ask follow-up questions — work with what is given and note any reasonable assumptions.';
|
|
26
|
+
|
|
27
|
+
async function readStdin() {
|
|
28
|
+
if (process.stdin.isTTY) return '';
|
|
29
|
+
const chunks = [];
|
|
30
|
+
for await (const c of process.stdin) chunks.push(c);
|
|
31
|
+
return Buffer.concat(chunks).toString('utf8').trim();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function loadWorkflows() {
|
|
35
|
+
try { return JSON.parse(readFileSync(join(PKG_ROOT, 'workflows.json'), 'utf8')).workflows || []; }
|
|
36
|
+
catch { return []; }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function run(argv) {
|
|
40
|
+
const workflows = loadWorkflows();
|
|
41
|
+
const id = argv[0] && !argv[0].startsWith('--') ? argv[0] : '';
|
|
42
|
+
|
|
43
|
+
if (argv.includes('--list') || (!id && !argv.includes('--help'))) {
|
|
44
|
+
console.log('Workflow chains — run several skills as one pipeline, each output feeding the next:\n');
|
|
45
|
+
for (const w of workflows) console.log(` ${w.id.padEnd(22)} ${w.steps.map((s) => s.skill).join(' → ')}`);
|
|
46
|
+
console.log('\nRun one: pm-claude-skills chain <id> --text "…" | --input <file> | stdin [--out-dir <dir>] [--model <m>] [--deck] [--doc]');
|
|
47
|
+
console.log('--deck / --doc additionally produce a real .pptx / .docx from the final artifact (needs python3, no pip installs).');
|
|
48
|
+
return id ? 0 : (argv.includes('--list') ? 0 : 1);
|
|
49
|
+
}
|
|
50
|
+
if (argv.includes('--help') || argv.includes('-h')) return run(['--list']);
|
|
51
|
+
|
|
52
|
+
const w = workflows.find((x) => x.id === id);
|
|
53
|
+
if (!w) { console.error(`Unknown chain "${id}". See them all: pm-claude-skills chain --list`); return 1; }
|
|
54
|
+
|
|
55
|
+
const apiKey = process.env.ANTHROPIC_API_KEY || '';
|
|
56
|
+
if (!apiKey) { console.error('Set ANTHROPIC_API_KEY to run a chain (one API call per step).'); return 1; }
|
|
57
|
+
|
|
58
|
+
let input = getArg(argv, 'text', '');
|
|
59
|
+
const inFile = getArg(argv, 'input');
|
|
60
|
+
if (!input && inFile) {
|
|
61
|
+
if (!existsSync(inFile)) { console.error(`Input file not found: ${inFile}`); return 1; }
|
|
62
|
+
input = readFileSync(inFile, 'utf8');
|
|
63
|
+
}
|
|
64
|
+
if (!input) input = await readStdin();
|
|
65
|
+
if (!input.trim()) { console.error('No input. Provide --text "…", --input <file>, or pipe via stdin.'); return 1; }
|
|
66
|
+
|
|
67
|
+
const model = getArg(argv, 'model', 'claude-sonnet-4-6');
|
|
68
|
+
const outDir = getArg(argv, 'out-dir', `./${w.id}-artifacts`);
|
|
69
|
+
mkdirSync(outDir, { recursive: true });
|
|
70
|
+
|
|
71
|
+
console.error(`⛓ ${w.name} — ${w.steps.length} steps, model ${model}\n ${w.steps.map((s) => s.skill).join(' → ')}\n`);
|
|
72
|
+
let carried = `THE ORIGINAL BRIEF / RAW MATERIAL:\n\n${input}`;
|
|
73
|
+
const outputs = [];
|
|
74
|
+
|
|
75
|
+
for (let i = 0; i < w.steps.length; i++) {
|
|
76
|
+
const step = w.steps[i];
|
|
77
|
+
const file = join(PKG_ROOT, 'skills', step.skill, 'SKILL.md');
|
|
78
|
+
if (!existsSync(file)) { console.error(` ✗ step ${i + 1}: skill "${step.skill}" not found — skipping`); continue; }
|
|
79
|
+
const { body } = parseSkill(readFileSync(file, 'utf8'));
|
|
80
|
+
process.stderr.write(` ${i + 1}/${w.steps.length} ${step.skill} … `);
|
|
81
|
+
const t0 = Date.now();
|
|
82
|
+
const out = await complete({ apiKey, model, system: body + SUFFIX, messages: [{ role: 'user', content: carried }], maxTokens: 8192 });
|
|
83
|
+
const fname = `${String(i + 1).padStart(2, '0')}-${step.skill}.md`;
|
|
84
|
+
writeFileSync(join(outDir, fname), out + '\n');
|
|
85
|
+
outputs.push({ skill: step.skill, file: fname, out });
|
|
86
|
+
console.error(`✔ ${((Date.now() - t0) / 1000).toFixed(1)}s → ${fname}`);
|
|
87
|
+
// Carry forward: the original material + this step's artifact (the chain's contract).
|
|
88
|
+
carried += `\n\n---\nOUTPUT OF THE PREVIOUS STEP (${step.skill} — ${step.produces}):\n\n${out}`;
|
|
89
|
+
if (carried.length > 150000) carried = carried.slice(-150000); // context hygiene on long chains
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!outputs.length) { console.error('\nNo steps ran.'); return 1; }
|
|
93
|
+
const last = outputs[outputs.length - 1];
|
|
94
|
+
|
|
95
|
+
// ── Optional: real Office files from the final artifact (stdlib python) ────
|
|
96
|
+
for (const [flag, script, ext, label] of [
|
|
97
|
+
['--deck', join(PKG_ROOT, 'skills', 'slide-deck', 'scripts', 'pptx_tool.py'), 'pptx', 'deck'],
|
|
98
|
+
['--doc', join(PKG_ROOT, 'skills', 'word-document', 'scripts', 'docx_tool.py'), 'docx', 'document'],
|
|
99
|
+
]) {
|
|
100
|
+
if (!argv.includes(flag)) continue;
|
|
101
|
+
if (!existsSync(script)) { console.error(` (${flag}: tool script missing — skipped)`); continue; }
|
|
102
|
+
const target = join(outDir, `${w.id}.${ext}`);
|
|
103
|
+
const args = ext === 'pptx'
|
|
104
|
+
? [script, 'build', target, '--outline-file', join(outDir, last.file)]
|
|
105
|
+
: [script, 'create', target, '--text-file', join(outDir, last.file)];
|
|
106
|
+
const r = spawnSync('python3', args, { encoding: 'utf8' });
|
|
107
|
+
if (r.status === 0) console.error(` 📎 real ${label}: ${target}`);
|
|
108
|
+
else console.error(` (${flag} failed: ${(r.stderr || r.stdout || '').split('\n')[0]})`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
console.error(`\n✅ ${outputs.length} artifacts in ${outDir}/ — final: ${last.file}`);
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
package/bin/cli.mjs
CHANGED
|
@@ -246,6 +246,13 @@ Usage:
|
|
|
246
246
|
npx pm-claude-skills add --agent <claude|hermes|codex|openclaw|cursor|windsurf|aider> [--target <path>] [--link] [--dry-run]
|
|
247
247
|
npx pm-claude-skills run <skill> [--text "…" | --input <file>] [--model <m>] [--out <file>]
|
|
248
248
|
npx pm-claude-skills search [query…] [--json] [--limit <n>]
|
|
249
|
+
npx pm-claude-skills install <owner/repo> # install skills from ANY GitHub repo — security-scanned + SkillSpec-graded
|
|
250
|
+
npx pm-claude-skills verify # integrity check: detect drift in anything "install" brought in
|
|
251
|
+
npx pm-claude-skills chain <workflow> # run a whole multi-skill pipeline (chain --list to see them)
|
|
252
|
+
npx pm-claude-skills council <skill> # author -> cross-vendor critique -> arbiter (2+ provider keys)
|
|
253
|
+
npx pm-claude-skills migrate <dir> # convert a folder of prompts/SOPs into SkillSpec skills
|
|
254
|
+
npx pm-claude-skills init # scaffold the professional workspace here (brain/, context, arena folders)
|
|
255
|
+
npx pm-claude-skills reckoning # your prediction ledger: due calls, hit rate, calibration curve, Brier score
|
|
249
256
|
npx pm-claude-skills doctor # checkup: what's installed, what's stale, what to fix (read-only)
|
|
250
257
|
npx pm-claude-skills list
|
|
251
258
|
npx pm-claude-skills --version
|
|
@@ -261,6 +268,8 @@ Examples:
|
|
|
261
268
|
|
|
262
269
|
npx pm-claude-skills run prd-template --text "a referral program for B2B users" # run a skill (needs ANTHROPIC_API_KEY)
|
|
263
270
|
cat notes.txt | npx pm-claude-skills run meeting-notes --out summary.md # pipe input, write the artifact
|
|
271
|
+
cat notes.txt | npx pm-claude-skills chain run-discovery --deck # notes → 4 artifacts + a real .pptx
|
|
272
|
+
npx pm-claude-skills install acme/their-skills --dry-run # audit a third-party skill repo
|
|
264
273
|
npx pm-claude-skills generate --from <url|file> # turn your docs into a SKILL.md (needs ANTHROPIC_API_KEY)
|
|
265
274
|
|
|
266
275
|
${STAR}
|
|
@@ -269,10 +278,45 @@ ${STAR}
|
|
|
269
278
|
const opts = parse(process.argv.slice(2));
|
|
270
279
|
const cmd = opts._[0];
|
|
271
280
|
if (opts.version) console.log(VERSION);
|
|
272
|
-
else if (!cmd || cmd === 'help' || (opts.help &&
|
|
281
|
+
else if (!cmd || cmd === 'help' || (opts.help && !['run', 'generate', 'install', 'chain', 'init', 'reckoning', 'council', 'migrate'].includes(cmd))) console.log(HELP);
|
|
273
282
|
else if (cmd === 'list') list();
|
|
274
283
|
else if (cmd === 'search') search(opts);
|
|
275
284
|
else if (cmd === 'add') add(opts);
|
|
285
|
+
else if (cmd === 'migrate') {
|
|
286
|
+
const { run } = await import('./migrate.mjs');
|
|
287
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
288
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
289
|
+
}
|
|
290
|
+
else if (cmd === 'council') {
|
|
291
|
+
const { run } = await import('./council.mjs');
|
|
292
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
293
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
294
|
+
}
|
|
295
|
+
else if (cmd === 'verify') {
|
|
296
|
+
const { run } = await import('./verify.mjs');
|
|
297
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
298
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
299
|
+
}
|
|
300
|
+
else if (cmd === 'reckoning') {
|
|
301
|
+
const { run } = await import('./reckoning.mjs');
|
|
302
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
303
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
304
|
+
}
|
|
305
|
+
else if (cmd === 'init') {
|
|
306
|
+
const { run } = await import('./init.mjs');
|
|
307
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
308
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
309
|
+
}
|
|
310
|
+
else if (cmd === 'chain') {
|
|
311
|
+
const { run } = await import('./chain.mjs');
|
|
312
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
313
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
314
|
+
}
|
|
315
|
+
else if (cmd === 'install') {
|
|
316
|
+
const { run } = await import('./install.mjs');
|
|
317
|
+
try { process.exit(await run(process.argv.slice(3))); }
|
|
318
|
+
catch (e) { console.error(`Error: ${e.message}`); process.exit(1); }
|
|
319
|
+
}
|
|
276
320
|
else if (cmd === 'doctor') {
|
|
277
321
|
const { run } = await import('./doctor.mjs');
|
|
278
322
|
try { process.exit(await run()); }
|
package/bin/council.mjs
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// `pm-claude-skills council <skill>` — the second-opinion machine. One model
|
|
2
|
+
// AUTHORS the artifact, a DIFFERENT vendor's model CRITIQUES it against the
|
|
3
|
+
// skill's own Quality Checks and Anti-Patterns, and a third (or the first)
|
|
4
|
+
// ARBITRATES, producing the final artifact with the critique addressed.
|
|
5
|
+
//
|
|
6
|
+
// Cross-provider adversarial review: vendor blind spots don't overlap, so the
|
|
7
|
+
// critic catches what the author's family reliably misses.
|
|
8
|
+
//
|
|
9
|
+
// pm-claude-skills council prd-template --text "usage-based pricing for the API tier"
|
|
10
|
+
// pm-claude-skills council exec-summary --input notes.md --models anthropic,openai,gemini
|
|
11
|
+
// pm-claude-skills council prd-template --text "…" --dry-run # plan only, no calls
|
|
12
|
+
//
|
|
13
|
+
// Keys from env: ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY (needs ≥2
|
|
14
|
+
// providers to be a council; 3 calls total). Output → stdout or --out <file>.
|
|
15
|
+
import { readFileSync, existsSync, writeFileSync } from 'node:fs';
|
|
16
|
+
import { join, dirname } from 'node:path';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
import { complete, available, provider } from './lib/providers.mjs';
|
|
19
|
+
|
|
20
|
+
const PKG_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
21
|
+
const getArg = (argv, n, d) => { const i = argv.indexOf('--' + n); return i >= 0 && argv[i + 1] ? argv[i + 1] : d; };
|
|
22
|
+
|
|
23
|
+
async function readStdin() {
|
|
24
|
+
if (process.stdin.isTTY) return '';
|
|
25
|
+
const chunks = []; for await (const c of process.stdin) chunks.push(c);
|
|
26
|
+
return Buffer.concat(chunks).toString('utf8').trim();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function run(argv) {
|
|
30
|
+
const skill = argv[0] && !argv[0].startsWith('--') ? argv[0] : '';
|
|
31
|
+
if (!skill || argv.includes('--help')) {
|
|
32
|
+
console.log(`The Council — cross-provider adversarial review. Author → critic (different vendor) → arbiter.
|
|
33
|
+
|
|
34
|
+
Usage: pm-claude-skills council <skill> [--text "…" | --input <file> | stdin] [--models a,b,c] [--out <file>] [--dry-run]
|
|
35
|
+
Providers by env key: ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY (≥2 required; 3 API calls total).`);
|
|
36
|
+
return skill ? 0 : 1;
|
|
37
|
+
}
|
|
38
|
+
const file = join(PKG_ROOT, 'skills', skill, 'SKILL.md');
|
|
39
|
+
if (!existsSync(file)) { console.error(`Unknown skill "${skill}" — see: pm-claude-skills list`); return 1; }
|
|
40
|
+
const text = readFileSync(file, 'utf8');
|
|
41
|
+
const body = (text.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?([\s\S]*)$/) || [, text])[1].trim();
|
|
42
|
+
const qc = (body.match(/##\s*Quality Checks\s*\n([\s\S]*?)(?=\n##\s|$)/i) || [, '(none declared)'])[1].trim();
|
|
43
|
+
const ap = (body.match(/##\s*Anti-Patterns\s*\n([\s\S]*?)(?=\n##\s|$)/i) || [, '(none declared)'])[1].trim();
|
|
44
|
+
|
|
45
|
+
let input = getArg(argv, 'text', '');
|
|
46
|
+
const inFile = getArg(argv, 'input');
|
|
47
|
+
if (!input && inFile && existsSync(inFile)) input = readFileSync(inFile, 'utf8');
|
|
48
|
+
if (!input) input = await readStdin();
|
|
49
|
+
if (!input.trim()) { console.error('No input. Provide --text, --input <file>, or pipe via stdin.'); return 1; }
|
|
50
|
+
|
|
51
|
+
const wanted = (getArg(argv, 'models', '') || '').split(',').map((s) => s.trim()).filter(Boolean);
|
|
52
|
+
const avail = available();
|
|
53
|
+
const roster = wanted.length ? wanted : avail;
|
|
54
|
+
const dryRun = argv.includes('--dry-run');
|
|
55
|
+
|
|
56
|
+
if (roster.length < 2) {
|
|
57
|
+
console.error(`The Council needs ≥2 providers; ${avail.length ? 'available: ' + avail.join(', ') : 'no provider keys set'}.` +
|
|
58
|
+
' Set at least two of ANTHROPIC_API_KEY / OPENAI_API_KEY / GEMINI_API_KEY.' + (dryRun ? '' : ' (--dry-run works without keys.)'));
|
|
59
|
+
if (!dryRun) return 1;
|
|
60
|
+
}
|
|
61
|
+
const [author, critic, arbiter] = [roster[0] || 'anthropic', roster[1] || 'openai', roster[2] || roster[0] || 'anthropic'];
|
|
62
|
+
console.error(`⚖️ The Council on "${skill}" — author: ${author} · critic: ${critic} · arbiter: ${arbiter}`);
|
|
63
|
+
|
|
64
|
+
if (dryRun) {
|
|
65
|
+
console.error(`[dry-run] 3 calls would run:
|
|
66
|
+
1. ${author} (${provider(author).defaultModel}) authors the artifact from the skill (${body.length} chars of instructions).
|
|
67
|
+
2. ${critic} (${provider(critic).defaultModel}) critiques it against the skill's OWN bar — Quality Checks (${qc.split('\n').length} items) + Anti-Patterns (${ap.split('\n').length} items) — verdict per check, quoting the draft.
|
|
68
|
+
3. ${arbiter} arbitrates: final artifact with every upheld objection addressed, and a changelog of what the critique changed.
|
|
69
|
+
No API calls made.`);
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// 1. Author
|
|
74
|
+
console.error(` 1/3 ${author} authoring…`);
|
|
75
|
+
const draft = await complete(author, { system: body + '\n\n---\nExecute this skill now on the input and produce the complete artifact. No questions; state assumptions.', user: input, maxTokens: 8192 });
|
|
76
|
+
|
|
77
|
+
// 2. Cross-vendor critique against the skill's own bar
|
|
78
|
+
console.error(` 2/3 ${critic} critiquing…`);
|
|
79
|
+
const critique = await complete(critic, {
|
|
80
|
+
system: `You are the adversarial reviewer on a council. A DIFFERENT model produced a draft using a skill; judge the draft strictly against that skill's OWN declared bar — nothing else.\n\nTHE SKILL'S QUALITY CHECKS:\n${qc}\n\nTHE SKILL'S ANTI-PATTERNS:\n${ap}\n\nFor each quality check: PASS/FAIL + one line quoting the draft. For each anti-pattern: CLEAN/VIOLATED + where. End with "## Priority repairs" — the 3 fixes that most improve the artifact. Be specific; no praise padding.`,
|
|
81
|
+
user: `THE ORIGINAL INPUT:\n${input.slice(0, 8000)}\n\nTHE DRAFT UNDER REVIEW:\n${draft}`, maxTokens: 3000 });
|
|
82
|
+
|
|
83
|
+
// 3. Arbitration → final
|
|
84
|
+
console.error(` 3/3 ${arbiter} arbitrating…`);
|
|
85
|
+
const final = await complete(arbiter, {
|
|
86
|
+
system: body + '\n\n---\nYou are the arbiter of a council. Below: the original input, a draft, and a cross-examination of that draft against this skill\'s own quality bar. Produce the FINAL artifact: keep what survived, repair every upheld objection, ignore critiques that misread the input. Then append "## Council changelog" — 3-6 bullets on what the critique changed.',
|
|
87
|
+
user: `INPUT:\n${input.slice(0, 8000)}\n\nDRAFT (${author}):\n${draft}\n\nCRITIQUE (${critic}):\n${critique}`, maxTokens: 8192 });
|
|
88
|
+
|
|
89
|
+
const outFile = getArg(argv, 'out');
|
|
90
|
+
const full = final + `\n\n---\n*Council: ${author} authored · ${critic} critiqued · ${arbiter} arbitrated — pm-claude-skills*\n`;
|
|
91
|
+
if (outFile) { writeFileSync(outFile, full); console.error(`✅ ${outFile}`); }
|
|
92
|
+
else process.stdout.write(full);
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
package/bin/init.mjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// `pm-claude-skills init` — scaffold the 60-second professional workspace in the
|
|
2
|
+
// current directory: the brain, your standing context, the arena folders the web
|
|
3
|
+
// tools write into, and a CLAUDE.md section that wires it all together. Doctor
|
|
4
|
+
// diagnoses; init prescribes and executes.
|
|
5
|
+
//
|
|
6
|
+
// npx pm-claude-skills init # scaffold (never overwrites anything)
|
|
7
|
+
// npx pm-claude-skills init --dry-run # show what would be created
|
|
8
|
+
//
|
|
9
|
+
// Idempotent by design: every file is create-if-missing; existing files are
|
|
10
|
+
// left untouched and reported. Pure Node, writes only inside the current dir.
|
|
11
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, appendFileSync, cpSync } from 'node:fs';
|
|
12
|
+
import { join, dirname } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
|
|
15
|
+
const PKG_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
16
|
+
const STAR = '⭐ Find this useful? Star the repo: https://github.com/mohitagw15856/pm-claude-skills';
|
|
17
|
+
|
|
18
|
+
const CLAUDE_MD_SECTION = `
|
|
19
|
+
## PM Skills — this project's professional setup
|
|
20
|
+
|
|
21
|
+
- **Standing context**: read \`brain/context.md\` before professional-writing tasks (audience, voice, metrics). Honour the provenance tags in \`brain/\` — strongest to weakest: \`[data] [interview] [external] [verbal] [hunch]\`.
|
|
22
|
+
- **Durable memory**: \`brain/\` holds decisions, hypotheses, stakeholders, and knowledge. After significant outcomes, append a dated line to the right file rather than letting the fact evaporate.
|
|
23
|
+
- **Web arena artifacts**: \`firm-minutes/\` and \`boardroom/\` receive minutes, verdicts, and transcripts written by the pm-skills web tools (workspace bridge). Treat them as inputs — e.g. read the latest Boardroom verdict before revising the document it judged.
|
|
24
|
+
- **Skills**: if the pm-skills library is installed (\`npx pm-claude-skills add --agent claude\`), prefer its skills for professional artifacts (PRDs, updates, postmortems…) over improvising structure.
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
const AGENTS_MD = `# AGENTS.md
|
|
28
|
+
|
|
29
|
+
Guidance for AI coding agents (Codex, Jules, and anything that reads this file) working in this repository.
|
|
30
|
+
|
|
31
|
+
## Professional context
|
|
32
|
+
|
|
33
|
+
- Read \`brain/context.md\` before drafting any professional artifact — it holds the company, audience, voice, and the metrics that matter. Honour the provenance tags in \`brain/\` (strongest → weakest): \`[data] [interview] [external] [verbal] [hunch]\`.
|
|
34
|
+
- Durable memory lives in \`brain/\` (decisions, hypotheses, stakeholders, knowledge). Append dated lines after significant outcomes.
|
|
35
|
+
|
|
36
|
+
## Skills
|
|
37
|
+
|
|
38
|
+
- Professional skills (PRDs, updates, postmortems, models…) are available via the pm-claude-skills library. Discover and apply them instead of improvising document structure:
|
|
39
|
+
- CLI: \`npx pm-claude-skills search <task>\` then \`npx pm-claude-skills run <skill> --input <file>\`
|
|
40
|
+
- MCP: the \`pm-skills\` server exposes \`search_skills\` / \`get_skill\` / \`run_skill\`
|
|
41
|
+
- A skill's Quality Checks and Anti-Patterns sections are the acceptance criteria for its output — verify against them before declaring done.
|
|
42
|
+
|
|
43
|
+
## Artifacts
|
|
44
|
+
|
|
45
|
+
- \`firm-minutes/\` and \`boardroom/\` contain minutes, verdicts, and transcripts written by the pm-skills web arenas. Treat them as inputs: read the latest Boardroom verdict before revising the document it judged.
|
|
46
|
+
- Predictions live in \`brain/predictions/\` — settle due ones honestly (\`npx pm-claude-skills reckoning\`).
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
export async function run(argv) {
|
|
50
|
+
const dryRun = argv.includes('--dry-run');
|
|
51
|
+
const cwd = process.cwd();
|
|
52
|
+
const made = [], kept = [];
|
|
53
|
+
|
|
54
|
+
const mk = (rel, content) => {
|
|
55
|
+
const p = join(cwd, rel);
|
|
56
|
+
if (existsSync(p)) { kept.push(rel); return; }
|
|
57
|
+
if (!dryRun) { mkdirSync(dirname(p), { recursive: true }); writeFileSync(p, content); }
|
|
58
|
+
made.push(rel);
|
|
59
|
+
};
|
|
60
|
+
const mkdir = (rel) => {
|
|
61
|
+
const p = join(cwd, rel);
|
|
62
|
+
if (existsSync(p)) { kept.push(rel + '/'); return; }
|
|
63
|
+
if (!dryRun) mkdirSync(p, { recursive: true });
|
|
64
|
+
made.push(rel + '/');
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
console.log(`${dryRun ? '[dry-run] ' : ''}Scaffolding the professional workspace in ${cwd}\n`);
|
|
68
|
+
|
|
69
|
+
// ── The brain: durable memory the skills read and write ────────────────────
|
|
70
|
+
const brainTpl = join(PKG_ROOT, 'templates', 'brain');
|
|
71
|
+
if (existsSync(brainTpl)) {
|
|
72
|
+
if (existsSync(join(cwd, 'brain'))) kept.push('brain/');
|
|
73
|
+
else { if (!dryRun) cpSync(brainTpl, join(cwd, 'brain'), { recursive: true }); made.push('brain/ (context, knowledge/, decisions/, hypotheses, stakeholders, entities — from templates)'); }
|
|
74
|
+
} else {
|
|
75
|
+
mk('brain/context.md', '# context.md — the standing facts every skill should know\n\n## Company / product\n- **Company:** <one line>\n- **Product:** <one line>\n\n## Audience & voice\n- **Primary readers:** <who>\n- **Tone:** <crisp/direct/…>\n\n## Metrics that matter\n- <the 3 numbers leadership actually tracks>\n');
|
|
76
|
+
for (const s of ['decisions', 'knowledge']) mkdir('brain/' + s);
|
|
77
|
+
for (const f of ['hypotheses', 'stakeholders', 'entities']) mk('brain/' + f + '.md', `# ${f}\n\n<!-- append dated, provenance-tagged lines: - [data] 2026-07-06 … -->\n`);
|
|
78
|
+
}
|
|
79
|
+
mkdir('brain/predictions');
|
|
80
|
+
|
|
81
|
+
// ── Standing context for the skills (pm-context.md, the older single-file form)
|
|
82
|
+
const ctxTpl = join(PKG_ROOT, 'templates', 'pm-context.example.md');
|
|
83
|
+
mk('pm-context.md', existsSync(ctxTpl) ? readFileSync(ctxTpl, 'utf8') : '# pm-context.md\n\nFill in who you are, your product, audience, and voice.\n');
|
|
84
|
+
|
|
85
|
+
// ── Arena folders the web workspace bridge writes into ─────────────────────
|
|
86
|
+
mkdir('firm-minutes');
|
|
87
|
+
mkdir('boardroom');
|
|
88
|
+
|
|
89
|
+
// ── AGENTS.md (--agents-md, or always create if missing alongside CLAUDE.md) ──
|
|
90
|
+
if (argv.includes('--agents-md') || !existsSync(join(cwd, 'AGENTS.md'))) mk('AGENTS.md', AGENTS_MD);
|
|
91
|
+
|
|
92
|
+
// ── CLAUDE.md wiring (append a section; never rewrite an existing file) ────
|
|
93
|
+
const claudeMd = join(cwd, 'CLAUDE.md');
|
|
94
|
+
if (!existsSync(claudeMd)) { mk('CLAUDE.md', '# Project notes for Claude\n' + CLAUDE_MD_SECTION); }
|
|
95
|
+
else if (readFileSync(claudeMd, 'utf8').includes('## PM Skills — this project')) kept.push('CLAUDE.md (section already present)');
|
|
96
|
+
else { if (!dryRun) appendFileSync(claudeMd, '\n' + CLAUDE_MD_SECTION); made.push('CLAUDE.md (PM Skills section appended)'); }
|
|
97
|
+
|
|
98
|
+
// ── Report ──────────────────────────────────────────────────────────────────
|
|
99
|
+
for (const m of made) console.log(` ✔ ${dryRun ? 'would create' : 'created'} ${m}`);
|
|
100
|
+
for (const k of kept) console.log(` ↷ kept ${k}`);
|
|
101
|
+
|
|
102
|
+
console.log(`\nNext steps:
|
|
103
|
+
1. Fill in brain/context.md (2 minutes) — every skill output gets sharper.
|
|
104
|
+
2. Install the skills: npx pm-claude-skills add --agent claude
|
|
105
|
+
3. Wire the ambient hooks: see hooks/settings.example.json in the repo (session briefs, skill suggestions, doc quality gate).
|
|
106
|
+
4. Point the web arenas here: open the Firm or Boardroom → 🗂 Connect a folder → choose THIS directory.
|
|
107
|
+
5. Checkup anytime: npx pm-claude-skills doctor
|
|
108
|
+
|
|
109
|
+
${STAR}`);
|
|
110
|
+
return 0;
|
|
111
|
+
}
|