@xcraftmind/mastermind 0.23.1 → 0.25.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.
Files changed (26) hide show
  1. package/README.md +6 -4
  2. package/bin/mastermind.js +4 -0
  3. package/package.json +9 -8
  4. package/share/agents/mastermind-auditor.md +205 -0
  5. package/share/agents/mastermind-critic.md +222 -0
  6. package/share/agents/mastermind-prompt-refiner.md +70 -0
  7. package/share/agents/mastermind-release.md +442 -0
  8. package/share/agents/mastermind-researcher.md +167 -0
  9. package/share/agents/mastermind-task-executor.md +86 -0
  10. package/share/skills/doc-stub-sync/SKILL.md +187 -0
  11. package/share/skills/doc-stub-sync/references/error-handling.md +79 -0
  12. package/share/skills/doc-stub-sync/references/url-patterns.md +83 -0
  13. package/share/skills/doc-stub-sync/scripts/doc_update.py +285 -0
  14. package/share/skills/doc-stub-sync/scripts/requirements.txt +2 -0
  15. package/share/skills/flaky-finder/SKILL.md +75 -0
  16. package/share/skills/mastermind-incident-response/SKILL.md +157 -0
  17. package/share/skills/mastermind-incident-response/references/investigation-playbook.md +173 -0
  18. package/share/skills/mastermind-incident-response/references/postmortem-template.md +184 -0
  19. package/share/skills/mastermind-incident-response/references/triage-checklist.md +117 -0
  20. package/share/skills/mastermind-prompt-refiner/SKILL.md +157 -0
  21. package/share/skills/mastermind-prompt-refiner/references/refining-checklist.md +89 -0
  22. package/share/skills/mastermind-prompt-refiner/references/techniques.md +143 -0
  23. package/share/skills/mastermind-task-executor/SKILL.md +154 -0
  24. package/share/skills/mastermind-task-planning/SKILL.md +337 -0
  25. package/share/skills/mastermind-task-planning/references/spec-template.md +286 -0
  26. package/share/skills/pr-review/SKILL.md +89 -0
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: pr-review
3
+ description: Review a pull request for correctness, security, design issues, and operational risk — staff-engineer style. Use when the user says "review my PR", "audit this diff", "check before merge", or pastes a PR URL.
4
+ metadata:
5
+ version: 0.1.0
6
+ authors:
7
+ - mastermind
8
+ tags:
9
+ - code-review
10
+ model: opus
11
+ requires:
12
+ - gh CLI (for fetching PR diffs from GitHub)
13
+ ---
14
+
15
+ # PR Review
16
+
17
+ Reviews a pull request the way a staff engineer would: operational correctness and blast radius first, line-level style last. The goal is a short, prioritized list of issues, not a wall of nitpicks.
18
+
19
+ ## When to use
20
+
21
+ - User says "review my PR", "audit this diff", "code review", "check before merge"
22
+ - User pastes a GitHub PR URL or a unified diff
23
+ - User asks "what's wrong with this change?"
24
+ - Do NOT use for design review of a system that doesn't exist yet — that's a different kind of review (one that doesn't yet have a paired skill in this repo).
25
+
26
+ ## Prerequisites
27
+
28
+ - `gh` CLI installed and authenticated (only if reviewing from a PR URL)
29
+ - Repo checked out locally (for cross-file context)
30
+
31
+ ## Steps
32
+
33
+ 1. **Get the diff.** If given a URL: `gh pr diff <number>`. If given raw diff: use it as-is.
34
+ 2. **Read the PR description.** What is the author trying to do? If unclear, ask — don't guess.
35
+ 3. **Sort changed files by blast radius.** Migrations, auth, billing, public APIs → top. Tests, docs, internal helpers → bottom.
36
+ 4. **For each file (high-blast first), check in order:**
37
+ - **Correctness** — does it do what the description claims?
38
+ - **Operational risk** — what happens at 10x scale? What if the network is slow? What if this runs concurrently?
39
+ - **Security** — input validation, authz, secret handling, SQL/command injection.
40
+ - **Error paths** — what's caught, what's swallowed, what propagates?
41
+ - **Design** — is this the right place for this code? Does it duplicate something?
42
+ - **Style** — only flag if it actually hurts readability.
43
+ 5. **Compress findings.** Three high-confidence issues beat fifteen maybes. Drop anything you're <70% sure about.
44
+ 6. **Write the report** in the format below.
45
+
46
+ ## Outputs
47
+
48
+ A markdown report:
49
+
50
+ ```markdown
51
+ ## PR Review — <PR title>
52
+
53
+ ### Must fix (blocks merge)
54
+ - **<file:line>** — <issue>. <Why it matters.> <Suggested fix in 1 sentence.>
55
+
56
+ ### Should fix (before merge if possible)
57
+ - **<file:line>** — <issue>. <Why it matters.>
58
+
59
+ ### Consider
60
+ - **<file:line>** — <smaller suggestion>.
61
+
62
+ ### What looks good
63
+ - <1-2 specific things, not generic praise>
64
+ ```
65
+
66
+ If there are no "Must fix" items, say so explicitly — silence reads as "I didn't check."
67
+
68
+ ## Examples
69
+
70
+ **Input:** `gh pr 1247` — a change to the rate limiter
71
+
72
+ **Output:**
73
+ ```markdown
74
+ ## PR Review — Add per-tenant rate limiting
75
+
76
+ ### Must fix
77
+ - **src/limiter.go:88** — Counter is incremented before the limit check, so a request that exceeds the limit still counts toward the bucket. This makes the limit effectively `N-1`. Move the increment inside the `if !exceeded` branch.
78
+ - **src/limiter.go:142** — Redis call has no timeout. If Redis is slow, every request blocks. Add a 50ms context timeout.
79
+
80
+ ### Should fix
81
+ - **src/limiter.go:55** — `tenantID` is read from a header without authentication. A client can spoof another tenant's ID and consume their bucket. Pull the tenant from the authenticated session instead.
82
+
83
+ ### Consider
84
+ - **tests/limiter_test.go** — No test for the concurrent-increment race. Worth adding a `t.Parallel()` test with 100 goroutines.
85
+
86
+ ### What looks good
87
+ - Clean separation between the policy (limits) and the mechanism (Redis ops).
88
+ - The metrics emission at `limiter.go:201` is exactly what oncall will want.
89
+ ```