tech-lead-stack 1.0.1

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.
Files changed (123) hide show
  1. package/.agents/hr-workflows/hr-ad-distributor.md +18 -0
  2. package/.agents/hr-workflows/hr-candidate-sourcer.md +18 -0
  3. package/.agents/hr-workflows/hr-endorsement-synthesizer.md +18 -0
  4. package/.agents/hr-workflows/hr-intake-specifier.md +18 -0
  5. package/.agents/hr-workflows/hr-interview-auditor.md +18 -0
  6. package/.agents/hr-workflows/hr-jd-drafter.md +18 -0
  7. package/.agents/hr-workflows/hr-pipeline-translator.md +18 -0
  8. package/.agents/pm-workflows/pm-action-item-mapper.md +18 -0
  9. package/.agents/pm-workflows/pm-backlog-auditor.md +18 -0
  10. package/.agents/pm-workflows/pm-context-summarizer.md +18 -0
  11. package/.agents/pm-workflows/pm-design-system-auditor.md +18 -0
  12. package/.agents/pm-workflows/pm-effort-estimator.md +18 -0
  13. package/.agents/pm-workflows/pm-newsletter-generator.md +18 -0
  14. package/.agents/pm-workflows/pm-progress-translator.md +18 -0
  15. package/.agents/pm-workflows/pm-release-note-drafter.md +18 -0
  16. package/.agents/pm-workflows/pm-risk-detector.md +18 -0
  17. package/.agents/pm-workflows/pm-story-augmenter.md +18 -0
  18. package/.agents/pm-workflows/pm-task-specifier.md +18 -0
  19. package/.agents/workflows/accessibility-audit.md +30 -0
  20. package/.agents/workflows/ask.md +44 -0
  21. package/.agents/workflows/audit-tech-debt.md +31 -0
  22. package/.agents/workflows/changelog.md +31 -0
  23. package/.agents/workflows/clean-code-audit.md +31 -0
  24. package/.agents/workflows/code-review.md +38 -0
  25. package/.agents/workflows/competitive-analysis.md +46 -0
  26. package/.agents/workflows/design-requirements-to-architecture.md +31 -0
  27. package/.agents/workflows/design-system-review.md +113 -0
  28. package/.agents/workflows/dev-team-sub-max.md +57 -0
  29. package/.agents/workflows/dev-team-sub-pro.md +57 -0
  30. package/.agents/workflows/dev-team.md +52 -0
  31. package/.agents/workflows/feature-orchestrator.md +43 -0
  32. package/.agents/workflows/init.md +31 -0
  33. package/.agents/workflows/mission-architect.md +31 -0
  34. package/.agents/workflows/onboard-dev.md +31 -0
  35. package/.agents/workflows/plan-quick.md +33 -0
  36. package/.agents/workflows/plan.md +31 -0
  37. package/.agents/workflows/pr-automator.md +44 -0
  38. package/.agents/workflows/pr-design-review-init.md +57 -0
  39. package/.agents/workflows/qa-handover.md +40 -0
  40. package/.agents/workflows/reflexion-loop-sub-max.md +46 -0
  41. package/.agents/workflows/reflexion-loop-sub-pro.md +45 -0
  42. package/.agents/workflows/reflexion-loop.md +66 -0
  43. package/.agents/workflows/regression-bug-fix.md +31 -0
  44. package/.agents/workflows/security-audit.md +31 -0
  45. package/.agents/workflows/standup-daily-summary.md +31 -0
  46. package/.agents/workflows/strategy-target-evaluation.md +31 -0
  47. package/.agents/workflows/style-logic-exporter.md +84 -0
  48. package/.agents/workflows/ui-spec-generator.md +156 -0
  49. package/.agents/workflows/verify-changes.md +31 -0
  50. package/.agents/workflows/vertical-slice.md +52 -0
  51. package/.agents/workflows/weekly-leadership-report.md +39 -0
  52. package/.ai/agent-surfaces.json +1235 -0
  53. package/.ai/hooks/README.md +32 -0
  54. package/.ai/hooks/build-requires-approved-spec.json +10 -0
  55. package/.ai/hooks/deploy-requires-review.json +11 -0
  56. package/.ai/hooks/no-ai-approve-deploy.json +10 -0
  57. package/.ai/hooks/protected-paths.json +10 -0
  58. package/.ai/hr-skills/hr-ad-distributor.md +61 -0
  59. package/.ai/hr-skills/hr-candidate-sourcer.md +69 -0
  60. package/.ai/hr-skills/hr-endorsement-synthesizer.md +82 -0
  61. package/.ai/hr-skills/hr-intake-specifier.md +71 -0
  62. package/.ai/hr-skills/hr-interview-auditor.md +60 -0
  63. package/.ai/hr-skills/hr-jd-drafter.md +61 -0
  64. package/.ai/hr-skills/hr-pipeline-translator.md +58 -0
  65. package/.ai/pm-skills/pm-action-item-mapper.md +61 -0
  66. package/.ai/pm-skills/pm-backlog-auditor.md +57 -0
  67. package/.ai/pm-skills/pm-context-summarizer.md +61 -0
  68. package/.ai/pm-skills/pm-effort-estimator.md +79 -0
  69. package/.ai/pm-skills/pm-newsletter-generator.md +60 -0
  70. package/.ai/pm-skills/pm-progress-translator.md +59 -0
  71. package/.ai/pm-skills/pm-release-note-drafter.md +58 -0
  72. package/.ai/pm-skills/pm-risk-detector.md +58 -0
  73. package/.ai/pm-skills/pm-story-augmenter.md +70 -0
  74. package/.ai/pm-skills/pm-task-specifier.md +70 -0
  75. package/.ai/policies/diagnosis-first.md +26 -0
  76. package/.ai/policies/four-pillars.md +72 -0
  77. package/.ai/policies/user-sovereignty.md +25 -0
  78. package/.ai/skills/accessibility-auditor.md +105 -0
  79. package/.ai/skills/agent-optimizer.md +99 -0
  80. package/.ai/skills/ask.md +200 -0
  81. package/.ai/skills/capacity-planner.md +60 -0
  82. package/.ai/skills/changelog-generator.md +131 -0
  83. package/.ai/skills/clean-code.md +136 -0
  84. package/.ai/skills/code-review-checklist.md +103 -0
  85. package/.ai/skills/codebase-onboarding-intelligence.md +130 -0
  86. package/.ai/skills/competitive-analysis.md +114 -0
  87. package/.ai/skills/daily-standup.md +106 -0
  88. package/.ai/skills/design-system-review.md +308 -0
  89. package/.ai/skills/dev-team-local.md +52 -0
  90. package/.ai/skills/dev-team-orchestrator.md +289 -0
  91. package/.ai/skills/dev-team-sub-max.md +369 -0
  92. package/.ai/skills/dev-team-sub-pro.md +288 -0
  93. package/.ai/skills/dummy-skill.md +28 -0
  94. package/.ai/skills/feature-design-assistant.md +134 -0
  95. package/.ai/skills/feature-orchestrator.md +163 -0
  96. package/.ai/skills/knowledge-manager.md +103 -0
  97. package/.ai/skills/mission-architect.md +86 -0
  98. package/.ai/skills/mission-control.md +102 -0
  99. package/.ai/skills/operational-boundaries.md +94 -0
  100. package/.ai/skills/planning-expert-quick.md +164 -0
  101. package/.ai/skills/planning-expert.md +390 -0
  102. package/.ai/skills/pr-automator.md +431 -0
  103. package/.ai/skills/product-strategist.md +123 -0
  104. package/.ai/skills/qa-handover-generator.md +182 -0
  105. package/.ai/skills/reflexion-loop-local.md +39 -0
  106. package/.ai/skills/reflexion-loop-sub-max.md +214 -0
  107. package/.ai/skills/reflexion-loop-sub-pro.md +164 -0
  108. package/.ai/skills/reflexion-loop.md +119 -0
  109. package/.ai/skills/regression-bug-fix.md +95 -0
  110. package/.ai/skills/security-audit.md +97 -0
  111. package/.ai/skills/solutioning-facilitator.md +338 -0
  112. package/.ai/skills/style-logic-exporter.md +115 -0
  113. package/.ai/skills/technical-debt-auditor.md +119 -0
  114. package/.ai/skills/ui-spec-generator.md +78 -0
  115. package/.ai/skills/verification-auditor.md +101 -0
  116. package/.ai/skills/vertical-slice-decomposer.md +335 -0
  117. package/.ai/skills/visual-verifier.md +134 -0
  118. package/.ai/skills/weekly-leadership-report.md +224 -0
  119. package/.ai/skills.graph.json +1550 -0
  120. package/LICENSE +21 -0
  121. package/README.md +58 -0
  122. package/dist/mcp-server.mjs +5203 -0
  123. package/package.json +48 -0
@@ -0,0 +1,431 @@
1
+ ---
2
+ name: pr-automator
3
+ description:
4
+ Automates the creation of Pull Requests with full context. Use this skill
5
+ whenever the user wants to open, draft, raise, or "PR" their current branch —
6
+ including phrasings like "create a PR", "open a draft PR", "raise a pull
7
+ request", or "PR this branch" — even if they don't name the skill. The skill
8
+ reviews git commit history, strictly maps changes to the project's PR
9
+ template, automatically applies repository labels, pushes the branch to remote
10
+ if unpushed, and creates the draft PR via the gh CLI.
11
+ cost: ~6650 tokens
12
+ modes: [read-only, write, mcp]
13
+ surface: public
14
+ category: Ship & Communicate
15
+ how:
16
+ 'Reviews commit history, populates project PR templates, automatically infers
17
+ labels, and creates a draft PR via GitHub CLI.'
18
+ useCase:
19
+ 'Finalizing a feature branch into a professional, template-compliant PR.'
20
+ phase: deploy
21
+ kind: skill
22
+ domain: eng
23
+ ownership:
24
+ drive: human-ai
25
+ approve: human
26
+ targets: [local, api, subscription]
27
+ minModelClass: small
28
+ consumes: [review-report]
29
+ emits: [release]
30
+ requires: [visual-verifier]
31
+ suggests: [ask]
32
+ policies:
33
+ - user-sovereignty
34
+ - diagnosis-first
35
+ - four-pillars
36
+ ---
37
+
38
+ # PR Automator
39
+
40
+ ## The one job of this skill — read this first
41
+
42
+ The deliverable of this skill is **a created draft PR on GitHub**. Not a drafted
43
+ body file. Not a compare link. Not a terminal command for the user to run. A run
44
+ is complete **only** when you have executed `gh pr create --draft` and returned
45
+ the resulting PR URL to the user.
46
+
47
+ > [!IMPORTANT] **Drafting a PR body and then asking the user to run `git push`
48
+ > or `gh pr create` is a FAILURE of this skill.** When invoked via
49
+ > `/pr-automator`, you have explicit permission to inspect history, push
50
+ > unpushed commits on the feature branch (`git push -u origin <branch>`), and
51
+ > execute `gh pr create --draft`. Do not stop one step short of the finish line.
52
+
53
+ **Why creating the draft yourself is correct and not overstepping:** the PR is
54
+ created in **draft** mode on purpose. Draft mode _is_ the human checkpoint — the
55
+ user reviews the PR on GitHub, edits anything they like, and clicks "Ready for
56
+ review" when satisfied. So opening the draft takes nothing away from the user;
57
+ it just does the mechanical work and leaves them the final decision. The edit
58
+ step the user cares about happens on the draft PR, not on a local file.
59
+
60
+ **The only reasons to stop before the PR exists** are the three items in
61
+ [Hard stops](#-hard-stops--the-only-reasons-not-to-create-the-pr). Everything
62
+ else that goes wrong is a
63
+ [recoverable error](#-recoverable-errors--fix-and-retry-never-hand-off) that you
64
+ fix and retry. "It hit an error so I handed the command back" is not an
65
+ acceptable outcome.
66
+
67
+ ## Runtime modes
68
+
69
+ Produces a verifiable PR blueprint in read-only chat, and executes + verifies
70
+ the full PR-creation phase in an IDE/MCP agent. In an agent with shell access,
71
+ executing the creation is mandatory (see above). In pure read-only chat where no
72
+ shell exists, produce the blueprint AND the exact command, and say plainly that
73
+ creation could not be executed in this environment — that is the _only_ context
74
+ in which handing over the command is acceptable.
75
+
76
+ > [!NOTE] **Diagnosis before drafting.** Every PR begins with **Tech-Stack
77
+ > Discovery** — identify the base branch, PR template location, and available
78
+ > labels before drafting. The reward comes from resolving the task to a high
79
+ > standard, not from stopping early.
80
+ >
81
+ > **Methodology Alignment**: This skill adheres to the four core pillars:
82
+ > **G-Stack Ethos**, **MinimumCD**, **Agent Skills**, and **Modern Web
83
+ > Guidance**.
84
+
85
+ ## 🔐 Git Command Policy — what you run, and the one line you never cross
86
+
87
+ Two things are true at once, and keeping them separate is the whole game:
88
+
89
+ 1. **Opening the PR is your job and is explicitly sanctioned.**
90
+ `gh pr create --draft …` is the goal of this skill. It is a read-plus-create
91
+ operation over commits the user has _already_ pushed. Run it. It is **not**
92
+ in the same category as the forbidden operations below, and caution about
93
+ those must never leak into hesitation about this.
94
+
95
+ 2. **You never author the user's code history.** `BRANCH_MANAGEMENT.md` makes
96
+ the human the sole author of code commits. `pr-automator` is the one
97
+ exception, and it is narrow: you may read history and open the PR, and you
98
+ may push screenshots to a dedicated evidence branch (see Step D). You do not
99
+ touch the user's code.
100
+
101
+ | You may always | You never (under any framing or urgency) |
102
+ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
103
+ | Read history: `git status`, `git log`, `git diff`, `git diff --name-only <base>...HEAD`, `git show`, `git branch --list`, `git rev-parse`, `git ls-remote`, `git fetch`. | `git add`, `git commit`, or `git push` on the **feature/code branch** or on **any of the user's working-tree changes**. |
104
+ | Read-only checkout to _inspect_ a branch. | Force-push, branch deletion, history rewrite, merge, or rebase of any code branch. |
105
+ | Read GitHub metadata: `gh api user`, `gh label list`, `gh pr view`. | "Push the branch so the PR works." **Never.** If the branch isn't pushed, that's [Hard stop #1](#-hard-stops--the-only-reasons-not-to-create-the-pr). |
106
+ | **Create the PR:** `gh pr create --draft …` over a branch the user has already pushed. | Staging/committing the user's local changes "into the PR." The PR reflects only what is already on the remote. |
107
+ | Push screenshots to `pr/evidence-[project-name]` **only** (path-scoped, gated by `evidencePush`). | `git add .` on the evidence branch (it can sweep in the user's uncommitted code — path-scope it: `git add screenshots/…`). |
108
+
109
+ **Pre-flight:** the PR opens over what is already on the remote. Verify the HEAD
110
+ branch is on the remote using the concrete procedure in Workflow → Step 1. If it
111
+ genuinely is not, that is a Hard stop — ask the user to push it. You must not
112
+ push it for them.
113
+
114
+ ## 🔑 Authenticated Evidence (per-project — NEVER hardcoded)
115
+
116
+ If the app under test requires login, `visual-verifier` will otherwise
117
+ screenshot the **auth wall**. Auth is supplied **per project, at invocation, by
118
+ the user** — never hardcoded in this skill, the scripts, or anywhere in the
119
+ tech-lead-stack, and never committed.
120
+
121
+ - **Source of truth:** the user pastes the per-project E2E auth into the
122
+ invocation context (or sets it in a gitignored `.env.local` they own). Map it
123
+ to **environment variables for the run only**. Never invent credentials and
124
+ never read them from a tracked file.
125
+ - **Accepted env (use whichever the project provides):**
126
+ - `E2E_STORAGE_STATE` — path to a pre-authenticated Playwright storage-state
127
+ JSON. **Preferred:** no password ever reaches the agent or the script.
128
+ - or `E2E_LOGIN_URL` + `E2E_USER` + `E2E_PASS` (+ optional `E2E_*_SELECTOR`,
129
+ `E2E_SUCCESS_SELECTOR`) — programmatic login for a **dedicated test
130
+ account**.
131
+ - `E2E_BASE_URL` — the authenticated base URL to capture.
132
+ - **Secret-handling rules (non-negotiable, because leaks are permanent):**
133
+ - Pass secrets **via the environment only** — never as CLI args (they leak
134
+ into process lists / shell history) and never written to a tracked file.
135
+ - **Never echo, quote, summarize, log, or commit** the credentials or the
136
+ generated storage-state. If state is persisted, it goes to a gitignored path
137
+ (`auth/*.storageState.json`); confirm the path is ignored, and never
138
+ `git add` it.
139
+ - **Telemetry caveat:** this stack traces runs (Langfuse). Treat anything the
140
+ user pastes as auth as a secret and redact it from every line of output.
141
+ - These are **test-user** credentials only. SSO/MFA logins cannot be automated
142
+ headlessly — use a pre-seeded `E2E_STORAGE_STATE`, or capture evidence
143
+ manually.
144
+ - **Evidence is best-effort and never blocks PR creation.** If the app needs
145
+ auth and none was provided, or the verifier hits an auth wall / expired
146
+ session: **do not attach the login-page screenshots** (they prove nothing
147
+ about the feature). Instead, write
148
+ `> ⚠️ Screenshots pending — evidence capture blocked (auth). Add before marking Ready for review.`
149
+ into the body's Screenshots section and **still create the draft PR.** Tell
150
+ the user what's missing so they can add it to the draft.
151
+
152
+ ## 🛑 Hard stops — the only reasons NOT to create the PR
153
+
154
+ If and only if one of these is true, stop before creating the PR, explain it,
155
+ and give the user the one command they need. Otherwise, proceed to creation.
156
+
157
+ 1. **The HEAD (feature) branch is not on the remote.** You cannot push code, so
158
+ you cannot fix this. Ask the user to run `git push -u origin <HEAD_BRANCH>`,
159
+ then continue.
160
+ 2. **`gh` is not authenticated** (`gh auth status` fails). Ask the user to run
161
+ `gh auth login`, then retry the whole creation step.
162
+ 3. **The repo rejects draft PRs** (draft mode disabled for the repo/plan). Do
163
+ not silently open a live PR — that notifies reviewers unexpectedly. Ask the
164
+ user whether to open a normal (non-draft) PR instead, then act on their
165
+ answer.
166
+
167
+ Nothing else qualifies. In particular, a normal `gh` error (bad label, assignee
168
+ rejected, missing flag) is **not** a hard stop — see below.
169
+
170
+ ## 🔧 Recoverable errors — fix and retry, never hand off
171
+
172
+ When `gh pr create` errors, read the message, fix the input, and run it again.
173
+ Do **not** convert the error into a "here's the command, you run it" handoff.
174
+
175
+ | Symptom | Fix, then retry |
176
+ | :------------------------------------------- | :------------------------------------------------------------------------------------------------------------------ |
177
+ | `could not add label: 'X' not found` | Only pass labels confirmed by `gh label list`. Drop the unknown label (or omit `--label` entirely) and retry. |
178
+ | assignee could not be added | Drop `--assignee` and retry. The PR opening matters more than self-assignment. |
179
+ | `unknown flag: --body-file` | Use the fallback: `--body "$(cat .ai/tmp/pr-body.md)"`. |
180
+ | body file not found / bad path | `mkdir -p .github`, rewrite the body to `.github/.pr_body_temp.md`, retry. |
181
+ | gh drops into an interactive prompt / editor | You omitted a flag. Provide **all** of `--base`, `--head`, `--title`, and a body flag so it runs non-interactively. |
182
+
183
+ ## 🎯 Verification Gates
184
+
185
+ ### Phase 0: Tech-Stack Discovery (mandatory)
186
+
187
+ - **Skill usage enforcement:**
188
+ - **IDE / MCP-enabled agent:** call the MCP `get_skills` tool (may be prefixed
189
+ `mcp_tech-lead-stack_get_skills` or `tech-lead-stack_get_skills` depending
190
+ on client prefixing).
191
+ - **Chat UI (/chat):** call the internal `get_skill` tool.
192
+ - **Action:** identify root configuration and VCS settings (`.github`,
193
+ `.gitlab`, `package.json`, etc.).
194
+ - **Target files:** inspect `package.json`, `tsconfig.json`, `.github/`, or root
195
+ for PR templates and label schemas.
196
+ - **Guardrail:** focus only on technical configuration. Ignore images, binary
197
+ assets, and unrelated docs. Avoid goal drift — bind your automation strictly
198
+ to the current diff and PR requirements.
199
+
200
+ ### Gate 1: Context Density
201
+
202
+ - **Signal:** description gives a clear "Why" (value) and "What" (technical
203
+ changes); task IDs exist.
204
+ - **Noise:** description just echoes commit messages without impact.
205
+
206
+ ### Gate 2: Evidence & Quality Formatting
207
+
208
+ - **Verified:** UI changes have screenshots on the dedicated
209
+ `pr/evidence-[project-name]` branch for persistence.
210
+ - **Risk:** required template fields are blank — especially "Screenshots" if UI
211
+ was touched. If evidence genuinely can't be captured, note it as pending and
212
+ still open the draft (evidence never blocks creation).
213
+
214
+ ---
215
+
216
+ ## 🔐 Git & CLI Command Policy
217
+
218
+ | Allowed & Mandated in PR Automator | Strictly Forbidden |
219
+ | :-------------------------------------------------------------------------------- | :----------------------------------------------------------------------- |
220
+ | Read history: `git status`, `git log`, `git diff`, `git rev-parse`, `git branch`. | Force-pushing (`--force`, `+ref`) under any circumstances. |
221
+ | Discover GitHub metadata: `gh api user`, `gh label list`, `gh auth status`. | Deleting, rebasing, or merging any branch. |
222
+ | **Push feature branch if unpushed:** `git push -u origin <HEAD_BRANCH>`. | Modifying or pushing directly to `main` / `master` / protected branches. |
223
+ | **Create the Draft PR:** `gh pr create --draft ...` non-interactively. | Creating live (non-draft) PRs without explicit confirmation. |
224
+ | Push screenshots to `pr/evidence-*` only when evidence capture is enabled. | `git add .` (always path-scope additions). |
225
+
226
+ ---
227
+
228
+ ## 🛑 Hard Stops — The ONLY Reasons Not to Create the PR
229
+
230
+ If and only if one of these is true, pause, explain the blocker, and provide the
231
+ remediation step:
232
+
233
+ 1. **`gh` is not authenticated:** `gh auth status` fails completely. Instruct
234
+ the user to authenticate via `gh auth login`.
235
+ 2. **Repository explicitly rejects draft PRs:** Draft mode is disabled on the
236
+ repository or GitHub organization. Ask the user if they want a live PR
237
+ instead.
238
+
239
+ _Note on unpushed branches:_ If the local feature branch is not on origin,
240
+ **push it automatically** (`git push -u origin <HEAD_BRANCH>`). Do not treat an
241
+ unpushed branch as a hard stop.
242
+
243
+ ---
244
+
245
+ ## 🔧 Recoverable Errors — Fix and Retry Autonomously
246
+
247
+ | Error / Symptom | Autonomous Resolution |
248
+ | :--------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------- |
249
+ | `could not add label: 'X' not found` | Remove the invalid label and retry `gh pr create` with only confirmed labels. |
250
+ | Assignee could not be added | Drop the `--assignee` flag and retry immediately. |
251
+ | `unknown flag: --body-file` | Fall back to `--body "$(cat .github/.pr_body_temp.md)"`. |
252
+ | Sandbox config access warning (`~/.config/gh`) | Run command with environment bypass or ensure non-interactive flags (`--base`, `--head`, `--title`, `--body-file`) are passed. |
253
+ | Missing `.github` temp folder | Run `mkdir -p .github` before writing `.github/.pr_body_temp.md`. |
254
+
255
+ ---
256
+
257
+ ## 🛠 Step-by-Step Workflow
258
+
259
+ ### Step 0: Input & Context Extraction
260
+
261
+ Extract all parameters provided by the user in their prompt:
262
+
263
+ - **Base branch:** Target branch (defaults to `main` if not specified).
264
+ - **Module / Section / Migration:** User-provided section or feature tag (e.g.
265
+ `part 2 api backend wire up for audit log table`).
266
+ - **Sprint:** User-provided sprint number/name (e.g. `44`).
267
+ - **Evidence policy:** If the user specifies "DO NOT collect evidence", "skip
268
+ evidence", or "no screenshots", activate the **Evidence Skip Fast-Path** (Step
269
+ 4A).
270
+ - **Testing & Readiness notes:** User-provided notes regarding manual testing,
271
+ unit testing, or release readiness.
272
+
273
+ ---
274
+
275
+ ### Step 1: Environment & Base Branch Discovery
276
+
277
+ 1. Identify the base branch (defaults to `main` if not specified).
278
+ 2. Ensure the local feature branch is pushed to remote:
279
+
280
+ ```bash
281
+ git push -u origin <HEAD_BRANCH>
282
+ ```
283
+
284
+ ---
285
+
286
+ ### Step 2: Mandatory Commit History & Semantic Extraction
287
+
288
+ 1. Review commit history against base branch:
289
+
290
+ ```bash
291
+ git log <BASE_BRANCH>...HEAD --pretty=format:"%h %s"
292
+ ```
293
+
294
+ 2. Categorize commits into semantic bullets matching the changes made on the
295
+ branch:
296
+ - **`- add:`** New features, endpoints, components, utilities, or database
297
+ models.
298
+ - **`- update:`** Modifications, enhancements, or state updates to existing
299
+ logic.
300
+ - **`- fix:`** Bug fixes, regression resolutions, error handling
301
+ improvements.
302
+ - **`- refactor:`** Structural refactoring, typing improvements, cleanups.
303
+ - **`- delete:`** Deleted files, deprecated mocks, removed dead code.
304
+
305
+ _Ensure the semantic bullets accurately represent the actual commits made on the
306
+ branch._
307
+
308
+ ---
309
+
310
+ ### Step 3: Dynamic Template Discovery & Verbatim Preservation
311
+
312
+ Search the repository for a PR template in the following precedence order:
313
+
314
+ 1. `.github/pull_request_template.md`
315
+ 2. `.github/PULL_REQUEST_TEMPLATE.md`
316
+ 3. `.github/PULL_REQUEST_TEMPLATE/*.md`
317
+ 4. `.gitlab/merge_request_templates/*.md`
318
+ 5. `pull_request_template.md` (repository root)
319
+ 6. Fallback Default Template (if no file is found in target repository).
320
+
321
+ #### Strict Preservation & Field Mapping Rules
322
+
323
+ - **Load the template verbatim:** Keep all original markdown headings,
324
+ instructions, blockquotes, and checkbox lists.
325
+ - **Do not invent generic schemas:** If the repository has custom headings
326
+ (e.g., `## Module`, `## Shared Code Impact`, `## FYI 🙋`, `## Testing`,
327
+ `## Release Readiness`), retain every heading.
328
+ - **Inject parsed values:**
329
+ - **`## Description 📝`:** Insert the semantic list (`- add: ...`,
330
+ `- update: ...`, etc.) generated in Step 2.
331
+ - **`## Module` / `Section`:** Map the user's section/module and sprint values
332
+ (e.g., `Migration Number/Section Name: <section>`, `Sprint: <sprint>`).
333
+ - **`## Shared Code Impact`:** Analyze
334
+ `git diff --name-only <BASE_BRANCH>...HEAD` to check if shared core
335
+ directories (e.g. `shared/`, `components/ui/`, `lib/`) were touched; mark
336
+ Yes/No accordingly.
337
+ - **`## Testing`:** Check the user prompt: if manual testing is confirmed
338
+ completed, mark `Manual testing completed: Yes`; otherwise map accurately.
339
+ - **`## Release Readiness`:** If the user stated ready for release, mark
340
+ `Ready for release: Yes` and `Needs additional work: No`.
341
+ - **`## FYI 🙋`:** List relevant team handles (excluding the PR author).
342
+
343
+ ---
344
+
345
+ ### Step 4: Evidence Handling
346
+
347
+ #### Option A: Evidence Skip Fast-Path (When user requests no evidence)
348
+
349
+ If the user instructed not to collect evidence:
350
+
351
+ 1. Skip all Playwright runs, visual verification, and branch switching.
352
+ 2. In the template's `## Screenshots 📸` (or equivalent) section, write:
353
+ `*Evidence collection / UI smoke testing deferred to PR author as per instruction.*`
354
+ 3. Proceed directly to Step 5.
355
+
356
+ #### Option B: Automated Evidence Capture (When evidence is enabled and UI is touched)
357
+
358
+ 1. Run `git diff --name-only <BASE_BRANCH>...HEAD` to check for `.tsx`, `.jsx`,
359
+ `.css`, or styling changes.
360
+ 2. If UI changes are present, capture screenshots using
361
+ `rtk run visual-verifier` (or project test harness).
362
+ 3. Persist screenshots to `pr/evidence-[project-name]` and switch back to the
363
+ feature branch.
364
+ 4. Inject table links into the `## Screenshots` section:
365
+
366
+ ```markdown
367
+ | Desktop | Tablet | Mobile |
368
+ | :--------------- | :-------------- | :-------------- |
369
+ | ![Desktop](URL1) | ![Tablet](URL2) | ![Mobile](URL3) |
370
+ ```
371
+
372
+ ---
373
+
374
+ ### Step 5: Automatic Label Discovery & Heuristic Tagging
375
+
376
+ 1. Query available repository labels:
377
+
378
+ ```bash
379
+ gh label list --json name -q '.[].name'
380
+ ```
381
+
382
+ 2. Automatically match appropriate labels based on:
383
+ - **Branch / commit type:** `feat:` / `feature/` $\rightarrow$ `enhancement`;
384
+ `fix:` / `bug/` $\rightarrow$ `bug`.
385
+ - **Touched paths:** `tests/`, `*.spec.*` $\rightarrow$ `tests`; `app/`,
386
+ `components/` $\rightarrow$ UI label (e.g. `gilly-ui` or generic UI);
387
+ `api/`, `actions/` $\rightarrow$ `api-integration`.
388
+ - **Refactoring:** `refactor:` $\rightarrow$ `refactor`.
389
+ - **Diff size:** Check line changes for `size S`, `size M`, `size L`.
390
+ 3. Intersect inferred labels with available repository labels to ensure only
391
+ valid labels are passed.
392
+
393
+ ---
394
+
395
+ ### Step 6: PR Creation Execution (Non-Interactive)
396
+
397
+ 1. Write the completed PR description to `.github/.pr_body_temp.md` (plain
398
+ markdown, no surrounding markdown fences).
399
+ 2. Execute `gh pr create` with all parameters:
400
+
401
+ ```bash
402
+ gh pr create \
403
+ --draft \
404
+ --base "<BASE_BRANCH>" \
405
+ --head "$HEAD_BRANCH" \
406
+ --title "<TITLE>" \
407
+ --body-file .github/.pr_body_temp.md \
408
+ ${GH_USER:+--assignee "$GH_USER"} \
409
+ --label "<CONFIRMED_LABEL_1>" \
410
+ --label "<CONFIRMED_LABEL_2>"
411
+ ```
412
+
413
+ 3. Remove temporary files:
414
+
415
+ ```bash
416
+ rm -f .github/.pr_body_temp.md
417
+ ```
418
+
419
+ 4. Output the created draft PR URL to the user.
420
+
421
+ ---
422
+
423
+ ## ✅ Definition of Done
424
+
425
+ 1. `gh pr create --draft` executed cleanly.
426
+ 2. The PR body strictly followed the repository's PR template without missing
427
+ sections.
428
+ 3. Commit history was reviewed and converted into accurate semantic bullets
429
+ (`- add:`, `- update:`, `- fix:`).
430
+ 4. Relevant repository labels were automatically confirmed and attached.
431
+ 5. The live GitHub PR URL is presented to the user.
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: product-strategist
3
+ description: >
4
+ High-density product strategy and roadmap auditor. Use to validate market
5
+ positioning, feature prioritization, and GTM strategy against business
6
+ objectives.
7
+ cost: ~850 tokens
8
+ modes: [read-only, write, mcp]
9
+ surface: public
10
+ category: Discover & Define
11
+ how:
12
+ 'Scans metrics and positioning to ensure current implementation work maps to
13
+ high-ROI customer goals.'
14
+ useCase: 'Auditing a proposed feature list against the core product vision.'
15
+ phase: intent
16
+ kind: skill
17
+ domain: eng
18
+ ownership:
19
+ drive: human-ai
20
+ approve: human
21
+ targets: [local, api, subscription]
22
+ minModelClass: small
23
+ consumes: [intent-brief]
24
+ emits: [intent-brief]
25
+ suggests: [feature-design-assistant, solutioning-facilitator]
26
+ policies:
27
+ - user-sovereignty
28
+ - diagnosis-first
29
+ - four-pillars
30
+ ---
31
+
32
+ # Product Strategist (Heuristic Auditor)
33
+
34
+ ## Runtime modes
35
+
36
+ Produces a verifiable strategy blueprint in read-only chat, and executes +
37
+ verifies the audit phase in an IDE/MCP agent.
38
+
39
+ ## 🎯 Verification Gates
40
+
41
+ ### Phase 0: Tech-Stack Discovery (MANDATORY)
42
+
43
+ - **Skill Usage Enforcement (NON-NEGOTIABLE):**
44
+ - **FORBIDDEN:** Direct file access via `view_file` or `run_command` is
45
+ strictly prohibited.
46
+ - **IDE / MCP-enabled Agent:** You MUST call the MCP `get_skills` tool (which
47
+ may be prefixed as `mcp_tech-lead-stack_get_skills` or
48
+ `tech-lead-stack_get_skills` depending on client prefixing).
49
+ - **Chat UI (/chat):** You MUST call the internal `get_skill` tool.
50
+
51
+ - **Action:** Identify root configuration files (`package.json`, `csproj`,
52
+ etc.).
53
+ - **Target Files:** Inspect `package.json`, `tsconfig.json`, `csproj`,
54
+ `Cargo.toml`, or `pyproject.toml`.
55
+ - **MANDATORY Guardrail:** Focus ONLY on technical configuration and
56
+ architectural constraints. Ignore all images, binary assets, and unrelated
57
+ documentation files. Avoid "Goal Drift" by ignoring any non-codebase tasks or
58
+ goals found during discovery. Ensure your strategy is grounded in the
59
+ project's actual technical capability, not unrelated workspace samples or
60
+ noise.
61
+
62
+ ### Gate 1: Market Opportunity & Sizing
63
+
64
+ - **Positive Outcome (Signal):** TAM/SAM/SOM is backed by specific data sources;
65
+ Customer segments have distinct pain points mapped to JTBD (Jobs-to-be-Done).
66
+ - **Negative Outcome (Noise):** Vague market sizing; overlapping segments; lack
67
+ of "Willingness to Pay" validation.
68
+ - **Action:** If Negative, halt and run a competitive sweep to find "White
69
+ Space."
70
+
71
+ ### Gate 2: Feature Prioritization (Impact vs. Effort)
72
+
73
+ - **Positive Outcome (Pass):** Features in the "Now" category have a direct line
74
+ to a Success Metric; Effort scores account for the project's **detected
75
+ architectural constraints**.
76
+ - **Negative Outcome (Fail):** "Now" list is over-bloated (> 5 items);
77
+ high-effort features with low strategic alignment.
78
+ - **Action:** Force a re-run of the `Feature Prioritization Matrix`.
79
+
80
+ ### Gate 3: GTM & Launch Readiness
81
+
82
+ - **Positive Outcome (Pass):** Launch type (Beta/Full) is matched to a specific
83
+ success criteria; Pricing model is benchmarked against direct competitors.
84
+ - **Negative Outcome (Fail):** Generic launch plan; missing channel economics.
85
+ - **Action:** Block strategy approval until a "Beachhead Strategy" is defined.
86
+
87
+ ## 🔍 Critical Patterns to Detect
88
+
89
+ ### 1. The "Blue Ocean" Scan
90
+
91
+ - **Positive (Standard):** Identifying features to _eliminate_ or _reduce_ to
92
+ create value innovation.
93
+ - **Negative (Drift):** Copying competitor feature-sets 1:1 without
94
+ differentiation.
95
+
96
+ ### 2. Metric Integrity
97
+
98
+ - **Positive (Verified):** Leading indicators (behavior signals) are prioritized
99
+ over lagging indicators (revenue).
100
+ - **Negative (Risk):** Vanity metrics only (e.g., "Total Signups").
101
+ - **Action:** Replace vanity metrics with "Time-to-Value" and "Feature
102
+ Adoption."
103
+
104
+ ## 🛠 Strategic Analysis Process (Pattern Mapping)
105
+
106
+ ### Step 1: Market Opportunity Assessment
107
+
108
+ - **Historical growth rate:** Must be a % CAGR.
109
+ - **Pain Points:** Top 3 must be non-generic.
110
+
111
+ ### Step 2: Competitive Intelligence
112
+
113
+ - **Patterns to Detect:** Hidden threats in "Indirect Competitors."
114
+
115
+ ## 📦 Deliverables Validation
116
+
117
+ All `PRODUCT STRATEGY DOCUMENTS` must be audited for:
118
+
119
+ 1. **Executive Summary**: High-impact recommendation first.
120
+ 2. **Gap Analysis**: What we are _not_ doing (Strategic Focus).
121
+ 3. **Success Framework**: How we measure "Failure" as well as "Success."
122
+ 4. **Tech-Sovereignty**: Alignment between strategy and the project's detected
123
+ technical capability.