compound-workflow 0.1.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 (55) hide show
  1. package/.claude-plugin/marketplace.json +11 -0
  2. package/.claude-plugin/plugin.json +12 -0
  3. package/.cursor-plugin/plugin.json +12 -0
  4. package/README.md +155 -0
  5. package/package.json +22 -0
  6. package/scripts/install-cli.mjs +313 -0
  7. package/scripts/sync-into-repo.sh +103 -0
  8. package/src/.agents/agents/research/best-practices-researcher.md +132 -0
  9. package/src/.agents/agents/research/framework-docs-researcher.md +134 -0
  10. package/src/.agents/agents/research/git-history-analyzer.md +62 -0
  11. package/src/.agents/agents/research/learnings-researcher.md +288 -0
  12. package/src/.agents/agents/research/repo-research-analyst.md +146 -0
  13. package/src/.agents/agents/review/agent-native-reviewer.md +299 -0
  14. package/src/.agents/agents/workflow/bug-reproduction-validator.md +87 -0
  15. package/src/.agents/agents/workflow/lint.md +20 -0
  16. package/src/.agents/agents/workflow/spec-flow-analyzer.md +149 -0
  17. package/src/.agents/commands/assess.md +60 -0
  18. package/src/.agents/commands/install.md +53 -0
  19. package/src/.agents/commands/metrics.md +59 -0
  20. package/src/.agents/commands/setup.md +9 -0
  21. package/src/.agents/commands/sync.md +9 -0
  22. package/src/.agents/commands/test-browser.md +393 -0
  23. package/src/.agents/commands/workflow/brainstorm.md +252 -0
  24. package/src/.agents/commands/workflow/compound.md +142 -0
  25. package/src/.agents/commands/workflow/plan.md +737 -0
  26. package/src/.agents/commands/workflow/review-v2.md +148 -0
  27. package/src/.agents/commands/workflow/review.md +110 -0
  28. package/src/.agents/commands/workflow/triage.md +54 -0
  29. package/src/.agents/commands/workflow/work.md +439 -0
  30. package/src/.agents/references/README.md +12 -0
  31. package/src/.agents/references/standards/README.md +9 -0
  32. package/src/.agents/scripts/self-check.mjs +227 -0
  33. package/src/.agents/scripts/sync-opencode.mjs +355 -0
  34. package/src/.agents/skills/agent-browser/SKILL.md +223 -0
  35. package/src/.agents/skills/audit-traceability/SKILL.md +260 -0
  36. package/src/.agents/skills/brainstorming/SKILL.md +250 -0
  37. package/src/.agents/skills/compound-docs/SKILL.md +533 -0
  38. package/src/.agents/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  39. package/src/.agents/skills/compound-docs/assets/resolution-template.md +97 -0
  40. package/src/.agents/skills/compound-docs/references/yaml-schema.md +87 -0
  41. package/src/.agents/skills/compound-docs/schema.project.yaml +18 -0
  42. package/src/.agents/skills/compound-docs/schema.yaml +119 -0
  43. package/src/.agents/skills/data-foundations/SKILL.md +185 -0
  44. package/src/.agents/skills/document-review/SKILL.md +108 -0
  45. package/src/.agents/skills/file-todos/SKILL.md +177 -0
  46. package/src/.agents/skills/file-todos/assets/todo-template.md +106 -0
  47. package/src/.agents/skills/financial-workflow-integrity/SKILL.md +423 -0
  48. package/src/.agents/skills/git-worktree/SKILL.md +268 -0
  49. package/src/.agents/skills/pii-protection-prisma/SKILL.md +629 -0
  50. package/src/.agents/skills/process-metrics/SKILL.md +46 -0
  51. package/src/.agents/skills/process-metrics/assets/daily-template.md +37 -0
  52. package/src/.agents/skills/process-metrics/assets/monthly-template.md +21 -0
  53. package/src/.agents/skills/process-metrics/assets/weekly-template.md +25 -0
  54. package/src/.agents/skills/technical-review/SKILL.md +83 -0
  55. package/src/AGENTS.md +213 -0
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: review-v2
3
+ invocation: workflow:review-v2
4
+ description: Experimental PR/branch review with interactive snippet walkthrough (output-only; no publishing)
5
+ argument-hint: "[PR number, GitHub URL, branch name, or 'current']"
6
+ ---
7
+
8
+ # /workflow:review-v2
9
+
10
+ Experimental code review flow focused on **interactive, snippet-by-snippet walkthrough** and **collected, consolidated comments**.
11
+
12
+ Guardrails (unless explicitly requested):
13
+
14
+ - Do not modify code or documents
15
+ - Do not create commits
16
+ - Do not push branches
17
+ - Do not create pull requests
18
+ - Do not publish GitHub PR reviews (output-only)
19
+
20
+ ## Inputs
21
+
22
+ - Target: `$ARGUMENTS`
23
+ - PR number / GitHub URL (if `gh` is available)
24
+ - branch name
25
+ - `current` (current branch)
26
+
27
+ If empty, default to `current`.
28
+
29
+ ## Execution Workflow
30
+
31
+ ### Phase 0: Resolve Repo Defaults (ALWAYS FIRST)
32
+
33
+ 1. Read `AGENTS.md` and locate the "Repo Config Block" YAML.
34
+ 2. Resolve:
35
+ - `default_branch` (fallback: `main`, then `master`)
36
+ - `lint_command` (optional; only run if configured)
37
+
38
+ State what you resolved or assumed.
39
+
40
+ ### Phase 1: Determine Target + Checkout Strategy
41
+
42
+ Parse `$ARGUMENTS` to resolve:
43
+
44
+ - `target_type`: `pr | branch | current`
45
+ - `base_branch`
46
+ - `head_branch`
47
+ - (if PR) `pr_number`, `pr_title`, `pr_url`
48
+
49
+ Resolution rules:
50
+
51
+ - If `$ARGUMENTS` contains `/pull/`: treat as PR URL.
52
+ - Extract the PR number and run:
53
+ - `gh pr view <number> --json headRefName,baseRefName,number,title,url`
54
+ - If `$ARGUMENTS` is only digits: treat as PR number.
55
+ - Run:
56
+ - `gh pr view <number> --json headRefName,baseRefName,number,title,url`
57
+ - Else if `$ARGUMENTS == "current"` (or empty): review current branch.
58
+ - Else: treat `$ARGUMENTS` as a branch name; `base_branch = default_branch`.
59
+
60
+ Checkout strategy:
61
+
62
+ - Prefer reviewing the **currently checked-out** branch.
63
+ - If the user explicitly targeted a PR/branch that differs from current checkout:
64
+ - Prefer an isolated worktree for review via `skill: git-worktree` (recommended).
65
+ - If you cannot/should not switch branches, fall back to `gh pr diff <number>` (PR only) plus local diffing where possible.
66
+
67
+ ### Phase 2: Gather the Diff + Surface Area
68
+
69
+ 1. Determine changed files using (in order):
70
+ - `@{upstream}...HEAD` when upstream exists
71
+ - `origin/${base_branch}...HEAD`
72
+ - `HEAD~1..HEAD`
73
+ 2. Run:
74
+ - `git diff origin/${base_branch}...HEAD --stat`
75
+ - `git diff origin/${base_branch}...HEAD`
76
+ 3. If PR and `gh` is available, also run:
77
+ - `gh pr diff <number>`
78
+
79
+ Summarize surface area (changed files, hot paths, risk notes).
80
+
81
+ ### Phase 3: Load Local Conventions
82
+
83
+ 1. Read repo root `AGENTS.md` (already done in Phase 0) for workflow defaults and constraints.
84
+ 2. Look for `CLAUDE.md` files:
85
+ - at repo root
86
+ - in directories containing modified files
87
+ 3. Read any found `CLAUDE.md` files and summarize the applicable conventions you will enforce in this review.
88
+
89
+ ### Phase 4: Interactive Snippet-by-Snippet Walkthrough (V2 Core)
90
+
91
+ Instead of dumping the full review at once, walk the user through the diff **snippet by snippet**.
92
+
93
+ Rules:
94
+
95
+ 1. Organize snippets by concern (not file order), usually:
96
+ - foundational types/interfaces/config
97
+ - shared helpers/modules
98
+ - core logic changes
99
+ - integration edges (I/O, DB, network, auth)
100
+ - tests + docs
101
+ 2. Number each snippet (e.g. `Snippet 3/12`) so the user knows progress.
102
+ 3. For each snippet, present:
103
+ - a minimal diff/code block (only the essential lines)
104
+ - plain-language explanation (what/why)
105
+ - what’s good
106
+ - what’s concerning (specific issue → consequence)
107
+ 4. After each snippet, STOP and ask for input:
108
+ - user comment/note → store it as a collected review comment and confirm you noted it
109
+ - user question → answer, then continue
110
+ - user says `next` / `move on` → proceed
111
+
112
+ Collected comment format (maintain internally as you go):
113
+
114
+ - `path:line` (approx is fine until final consolidation)
115
+ - severity: `Critical | Important | Suggestion | Nitpick`
116
+ - comment: rewrite user notes into clear, actionable language
117
+
118
+ ### Phase 5: Common Review Patterns to Watch For
119
+
120
+ Pay special attention to:
121
+
122
+ - Consistency (constants vs hardcodes, patterns across similar files, loose return types like `any[]`)
123
+ - Architecture (duplication, half-wired integrations, silently removed behavior)
124
+ - Naming & types (misleading names, unexplained config values)
125
+ - LLM/agent code (tool success vs orchestrator blocks, missing prompt updates, duplicated context, confusing injected messages)
126
+ - Maintenance (hardcoded registries that should be co-located)
127
+
128
+ ### Phase 6: Consolidate (Output-Only)
129
+
130
+ After all snippets, present the **full collected comment list**, organized by severity:
131
+
132
+ 1. Critical / Important (must address before merge)
133
+ 2. Suggestions (non-blocking improvements)
134
+ 3. Nitpicks (minor consistency/style)
135
+
136
+ For each comment include:
137
+
138
+ - file + line reference (best-effort)
139
+ - description
140
+ - suggested fix (when applicable)
141
+
142
+ Then output:
143
+
144
+ - Summary (1–3 sentences)
145
+ - Verdict: `Ship it | Needs changes | Needs discussion`
146
+
147
+ Do **not** publish to GitHub in V2. If the user wants publishing later, that is a separate command/experiment.
148
+
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: review
3
+ invocation: workflow:review
4
+ description: Review a PR/branch/diff with structured findings. Does not implement fixes unless explicitly requested.
5
+ argument-hint: "[PR number, GitHub URL, branch name, or 'current']"
6
+ ---
7
+
8
+ # /workflow:review
9
+
10
+ Run a structured, evidence-based **code** review. This command produces findings and recommendations; it does not implement fixes by default.
11
+
12
+ **If the user provides a document path** (e.g. a plan or spec): redirect to the `technical-review` skill for technical correctness (no edits), and/or the `document-review` skill to refine the document. This command does not review documents.
13
+
14
+ Guardrails (unless explicitly requested):
15
+
16
+ - Do not modify code or documents
17
+ - Do not create commits
18
+ - Do not push branches
19
+ - Do not create pull requests
20
+
21
+ ## Inputs
22
+
23
+ - Target: `$ARGUMENTS`
24
+ - PR number / GitHub URL (if `gh` is available)
25
+ - branch name
26
+ - `current` (current branch)
27
+
28
+ If empty, default to `current`.
29
+
30
+ ## Execution Workflow
31
+
32
+ ### Phase 0: Resolve Repo Defaults (ALWAYS FIRST)
33
+
34
+ 1. Read `AGENTS.md` and look for the "Repo Config Block" YAML.
35
+ 2. Resolve:
36
+ - `default_branch` (fallback: `main`, then `master`)
37
+ - `lint_command` (used in Phase 3)
38
+
39
+ State what you resolved or assumed.
40
+
41
+ ### Phase 1: Determine Target + Checkout Strategy
42
+
43
+ 1. Determine target type from `$ARGUMENTS`: PR/URL, branch name, or `current`.
44
+ 2. If reviewing a PR and `gh` is available:
45
+ - Fetch title/body/files via `gh pr view --json`
46
+ - Checkout the branch (direct checkout or via worktree)
47
+ 3. If target is a branch (not current):
48
+ - Ensure you are on the correct branch, or offer a worktree via `skill: git-worktree`
49
+ 4. If you are not on the target branch and user requested that target, offer a worktree via `skill: git-worktree`.
50
+
51
+ Prefer reviewing the currently checked-out branch. Only switch branches or create worktrees when the user explicitly requests a different target.
52
+
53
+ Protected artifacts:
54
+
55
+ - Never suggest deleting or ignoring `docs/plans/` or `docs/solutions/`.
56
+
57
+ ### Phase 2: Compute Review Surface Area
58
+
59
+ 1. Determine changed files using (in order):
60
+ - `@{upstream}...HEAD` when upstream exists
61
+ - `origin/${default_branch}...HEAD`
62
+ - `HEAD~1..HEAD`
63
+ 2. Summarize surface area (which files, high-risk areas).
64
+ 3. Infer risk tier for conditional passes:
65
+ - If the branch/PR references a plan file (e.g. in description or linked in changes), and that plan has `fidelity`/`confidence`, use them to decide review depth (high fidelity or low confidence => more scrutiny, more conditional passes).
66
+ - Otherwise infer from scope and domain (security/auth/payments/data migration/infra => higher).
67
+
68
+ ### Phase 3: Parallel Passes
69
+
70
+ **Always run (in parallel when possible):**
71
+
72
+ - `Task learnings-researcher(<target context>)` (related prior solutions)
73
+ - `Task lint(<changed files context>)` only if `lint_command` is configured in the Repo Config Block
74
+
75
+ **Conditional passes** (run when they apply):
76
+
77
+ - If this is a bug report/fix and reproduction steps are available: `Task bug-reproduction-validator(<report>)`
78
+ - If changes touch existing behavior and risk is medium/high: `Task git-history-analyzer(<target context>)`
79
+ - If changes depend on framework/library behavior and version constraints: `Task framework-docs-researcher(<topic>)`
80
+
81
+ Then perform the main review synthesis across:
82
+
83
+ - change summary (surface area, high-risk files)
84
+ - correctness
85
+ - tests/verification adequacy
86
+ - risk and failure modes
87
+ - operational considerations (monitoring, rollback)
88
+ - readability/maintainability
89
+
90
+ ### Phase 4: Synthesis + Verdict
91
+
92
+ Provide:
93
+
94
+ - Review recommendation: `pass | pass-with-notes | fail`
95
+ - Top risks (1–5 bullets)
96
+ - Findings list:
97
+ - severity (`critical | high | medium | low`)
98
+ - evidence (file references or commands/output)
99
+ - recommended action (concise)
100
+ - What ran vs skipped (selected agents/passes)
101
+
102
+ ### Phase 5: Handoff Options
103
+
104
+ Recommend next action:
105
+
106
+ - **Implement fixes:** `/workflow:work` with the relevant plan (or branch) to address findings
107
+ - **Track follow-ups:** use the `file-todos` skill to convert findings into `todos/` items (only if user requests tracked follow-ups)
108
+ - **Capture learning:** if a systemic learning emerged, suggest `/workflow:compound`
109
+
110
+ Optional: If user requests tracked follow-ups, convert findings into `todos/` items using the `file-todos` skill.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: triage
3
+ invocation: workflow:triage
4
+ description: Triage pending todo files into an executable ready queue (priority, dependencies, recommended action)
5
+ argument-hint: "[optional: todo path, issue id, or 'pending' (default)]"
6
+ ---
7
+
8
+ # /workflow:triage
9
+
10
+ Turn `todos/*-pending-*.md` items into an executable queue.
11
+
12
+ This command does not implement fixes. It approves and organizes work so `/workflow:work` can execute without ambiguity.
13
+
14
+ ## Inputs
15
+
16
+ - Default: triage all pending todos under `todos/`
17
+ - Optional: a specific todo file path or issue id
18
+
19
+ ## Preconditions
20
+
21
+ - `todos/` directory exists (create it if missing)
22
+ - `file-todos` skill is available (template + conventions)
23
+
24
+ ## Workflow
25
+
26
+ 1. Identify the target set:
27
+ - all `todos/*-pending-*.md`, or
28
+ - the requested todo
29
+ 2. For each pending todo:
30
+ - read Problem Statement + Findings + Proposed Solutions
31
+ - fill **Recommended Action** (make it executable)
32
+ - set `priority` (`p1|p2|p3`)
33
+ - set `dependencies` (issue_ids)
34
+ - ensure Acceptance Criteria is testable
35
+ - add/update tags for searchability
36
+ - **When multiple todos have `tags: [discussion]`:** (1) List a **concise numbered summary** of the discussion points. (2) Walk through **each point one by one**; for each, discuss and align with the user before approving or deferring; only then move on. Do not resolve all discussion points in one turn.
37
+ - **If the todo has `tags: [discussion]`:** Recommended Action must state the concrete decision task (what info is needed, who decides, done-when). Approve only when the outcome is a clear, executable decision task; otherwise defer.
38
+ - **If the todo has `tags: [spike]`:** Recommended Action must include a timebox and deliverable (e.g. "2–4h spike; deliver: options + recommendation + next build todos"). Set `dependencies` so that any build todos that depend on this spike's outcome list this todo's `issue_id`; when approving, ensure dependent build todos remain blocked until the spike is complete (they depend on the spike's `issue_id`). Approve only when the spike scope and deliverable are clear; otherwise defer.
39
+ 3. Decision:
40
+ - **approve now** -> rename `*-pending-*` -> `*-ready-*` and set frontmatter `status: ready`
41
+ - **defer** -> rename `*-pending-*` -> `*-deferred-*` and set frontmatter `status: deferred` (keep priority, typically `p3`). Ensure Recommended Action, Findings, and Work Log have enough context for future reference. Deferred items are not executed until re-triaged to `ready`.
42
+ 4. Output:
43
+ - list approved `ready` todos (unblocked first)
44
+ - list remaining pending todos
45
+ - list deferred todos (parked for reference; not in executable queue)
46
+ - list blocked todos with missing dependencies
47
+ 5. Next step suggestion:
48
+ - run `/workflow:work <plan-path>` to execute ready items
49
+
50
+ ## Guardrails
51
+
52
+ - Do not modify code.
53
+ - Do not create commits/push/PRs.
54
+ - Prefer explicit dependencies over implicit ordering.