@rexeus/agentic 0.3.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.
- package/LICENSE +202 -0
- package/README.md +201 -0
- package/assets/opencode/agents/analyst.md +358 -0
- package/assets/opencode/agents/architect.md +308 -0
- package/assets/opencode/agents/developer.md +311 -0
- package/assets/opencode/agents/lead.md +368 -0
- package/assets/opencode/agents/refiner.md +418 -0
- package/assets/opencode/agents/reviewer.md +285 -0
- package/assets/opencode/agents/scout.md +241 -0
- package/assets/opencode/agents/tester.md +323 -0
- package/assets/opencode/commands/agentic-commit.md +128 -0
- package/assets/opencode/commands/agentic-develop.md +170 -0
- package/assets/opencode/commands/agentic-plan.md +165 -0
- package/assets/opencode/commands/agentic-polish.md +190 -0
- package/assets/opencode/commands/agentic-pr.md +226 -0
- package/assets/opencode/commands/agentic-review.md +119 -0
- package/assets/opencode/commands/agentic-simplify.md +123 -0
- package/assets/opencode/commands/agentic-verify.md +193 -0
- package/bin/agentic.js +139 -0
- package/opencode/config.mjs +453 -0
- package/opencode/doctor.mjs +9 -0
- package/opencode/guardrails.mjs +172 -0
- package/opencode/install.mjs +48 -0
- package/opencode/manifest.mjs +34 -0
- package/opencode/plugin.mjs +53 -0
- package/opencode/uninstall.mjs +64 -0
- package/package.json +69 -0
- package/skills/conventions/SKILL.md +83 -0
- package/skills/git-conventions/SKILL.md +141 -0
- package/skills/quality-patterns/SKILL.md +73 -0
- package/skills/security/SKILL.md +77 -0
- package/skills/setup/SKILL.md +105 -0
- package/skills/testing/SKILL.md +113 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Create or update a Pull Request with a well-crafted title and description."
|
|
3
|
+
agent: "lead"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Generated by pnpm run sync:opencode-commands -->
|
|
7
|
+
|
|
8
|
+
# Pull Request
|
|
9
|
+
|
|
10
|
+
Create a new Pull Request or update an existing one. Analyzes all commits and
|
|
11
|
+
the full diff to generate a Conventional Commits title and a structured
|
|
12
|
+
description that tells reviewers exactly what changed and why.
|
|
13
|
+
|
|
14
|
+
**Usage:**
|
|
15
|
+
|
|
16
|
+
- `/agentic-pr` — create or update a PR for the current branch
|
|
17
|
+
- `/agentic-pr --base develop` — target a specific base branch
|
|
18
|
+
- `/agentic-pr --draft` — create as Draft PR (work in progress, not yet review-ready)
|
|
19
|
+
- `/agentic-pr --update` — force-update an existing PR's title and description
|
|
20
|
+
|
|
21
|
+
## Rules
|
|
22
|
+
|
|
23
|
+
- **Follow Conventional Commits** for the PR title — consistent with `/agentic-commit`.
|
|
24
|
+
- **Never merge.** This command creates or updates PRs. It never merges them.
|
|
25
|
+
- **Never force-push.** If the branch needs pushing, use a normal push.
|
|
26
|
+
- **Respect existing reviews.** When updating a PR that has reviews or comments,
|
|
27
|
+
warn the user before overwriting the description.
|
|
28
|
+
|
|
29
|
+
## Workflow
|
|
30
|
+
|
|
31
|
+
### Step 1: Detect State
|
|
32
|
+
|
|
33
|
+
Run these in parallel:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
git branch --show-current
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git rev-parse --abbrev-ref --symbolic-full-name @{upstream} 2>/dev/null
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
gh pr view --json number,title,body,url,state,reviews,isDraft 2>/dev/null
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Determine:
|
|
52
|
+
|
|
53
|
+
- **Current branch** — if on the default branch, stop: "You're on the default
|
|
54
|
+
branch. Create a feature branch first."
|
|
55
|
+
- **Remote tracking** — is the branch pushed?
|
|
56
|
+
- **Existing PR** — does a PR already exist for this branch?
|
|
57
|
+
- **Default branch** — what is the repo's default branch?
|
|
58
|
+
|
|
59
|
+
### Step 2: Determine Base Branch
|
|
60
|
+
|
|
61
|
+
Use this priority:
|
|
62
|
+
|
|
63
|
+
1. If `$ARGUMENTS` contains `--base <branch>` — use that branch.
|
|
64
|
+
2. If an existing PR exists — use that PR's base branch.
|
|
65
|
+
3. Otherwise — use the repo's default branch.
|
|
66
|
+
|
|
67
|
+
Present the base branch to the user:
|
|
68
|
+
|
|
69
|
+
> "PR targets `main` — does that look right?"
|
|
70
|
+
|
|
71
|
+
Only wait for confirmation if the base branch seems unusual (e.g., not `main`
|
|
72
|
+
or `develop`). For the default branch, proceed unless the user intervenes.
|
|
73
|
+
|
|
74
|
+
### Step 3: Verify Push State
|
|
75
|
+
|
|
76
|
+
Check whether the local branch is up-to-date with its remote:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git rev-parse HEAD
|
|
80
|
+
git rev-parse @{upstream} 2>/dev/null
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**If no upstream exists**, stop and tell the user:
|
|
84
|
+
|
|
85
|
+
> "Branch `feature/token-refresh` has no remote tracking branch.
|
|
86
|
+
> Push it first: `git push -u origin feature/token-refresh`"
|
|
87
|
+
|
|
88
|
+
**If local is ahead of remote** (unpushed commits), stop and tell the user:
|
|
89
|
+
|
|
90
|
+
> "Branch has unpushed commits. Push first: `git push`"
|
|
91
|
+
|
|
92
|
+
**If diverged**, stop and tell the user to reconcile.
|
|
93
|
+
|
|
94
|
+
**Never push.** Pushing is the user's responsibility. Only proceed to Step 4
|
|
95
|
+
when local and remote are in sync.
|
|
96
|
+
|
|
97
|
+
### Step 4: Analyze Changes
|
|
98
|
+
|
|
99
|
+
Run in parallel:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git log <base>..HEAD --oneline
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git log <base>..HEAD --format="%s%n%n%b" --no-merges
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
git diff <base>...HEAD --stat
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
git diff <base>...HEAD
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Read the full diff carefully. Understand:
|
|
118
|
+
|
|
119
|
+
- **What changed** — files created, modified, deleted
|
|
120
|
+
- **Why it changed** — derive intent from commit messages and code context
|
|
121
|
+
- **Scope** — is this a single feature, a bugfix, a refactor, or multiple things?
|
|
122
|
+
- **Breaking changes** — any API changes, removed exports, schema migrations?
|
|
123
|
+
- **Related issues** — any `#123` references in commits or code comments?
|
|
124
|
+
|
|
125
|
+
For large diffs (50+ files), focus on the commit messages and diff stat first,
|
|
126
|
+
then read the most significant file changes.
|
|
127
|
+
|
|
128
|
+
### Step 5: Generate Title and Description
|
|
129
|
+
|
|
130
|
+
**Title** — Conventional Commits format, max 100 characters:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
<type>[optional scope][optional !]: <description>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
- Derive the type from the changes (feat, fix, refactor, docs, chore, etc.)
|
|
137
|
+
- Scope is optional — use it when the changes are focused on one module
|
|
138
|
+
- Imperative mood, lowercase, no period
|
|
139
|
+
|
|
140
|
+
**Description** — structured, scannable, reviewer-friendly:
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
## Summary
|
|
144
|
+
|
|
145
|
+
<1-3 sentences: what this PR does and why. Not how — the diff shows how.>
|
|
146
|
+
|
|
147
|
+
## Changes
|
|
148
|
+
|
|
149
|
+
- <grouped by concern, each bullet is a concrete change>
|
|
150
|
+
- <reference specific files when helpful>
|
|
151
|
+
- <note any non-obvious design decisions>
|
|
152
|
+
|
|
153
|
+
## Breaking Changes
|
|
154
|
+
|
|
155
|
+
<only include this section if there are breaking changes>
|
|
156
|
+
- <what breaks and how to migrate>
|
|
157
|
+
|
|
158
|
+
## Test Plan
|
|
159
|
+
|
|
160
|
+
- <how to verify this works>
|
|
161
|
+
- <what tests were added or should be run>
|
|
162
|
+
- <edge cases covered>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Rules for the description:**
|
|
166
|
+
|
|
167
|
+
- Write for the reviewer, not for yourself. They haven't seen this code before.
|
|
168
|
+
- Lead with the WHY, not the WHAT. The diff shows what changed.
|
|
169
|
+
- Be specific. "Updated auth logic" is useless. "Added token expiry check
|
|
170
|
+
to prevent stale sessions from bypassing rate limits" is useful.
|
|
171
|
+
- If commits reference issues, add them naturally in the Summary
|
|
172
|
+
(e.g., "Fixes #234").
|
|
173
|
+
- Don't pad with filler. If the change is small, the description should be small.
|
|
174
|
+
|
|
175
|
+
### Step 6: Present and Confirm
|
|
176
|
+
|
|
177
|
+
**For a new PR:**
|
|
178
|
+
|
|
179
|
+
Show:
|
|
180
|
+
|
|
181
|
+
1. The full title
|
|
182
|
+
2. The full description
|
|
183
|
+
3. Whether it will be created as a draft
|
|
184
|
+
4. The base branch
|
|
185
|
+
|
|
186
|
+
Wait for approval. The user may edit the title, description, or both.
|
|
187
|
+
|
|
188
|
+
**For an existing PR update:**
|
|
189
|
+
|
|
190
|
+
Show:
|
|
191
|
+
|
|
192
|
+
1. Current title → proposed title
|
|
193
|
+
2. Current description → proposed description (or a summary of what changed)
|
|
194
|
+
3. Whether the PR has existing reviews (warn if so)
|
|
195
|
+
|
|
196
|
+
Wait for approval.
|
|
197
|
+
|
|
198
|
+
### Step 7: Execute
|
|
199
|
+
|
|
200
|
+
**Create new PR:**
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
gh pr create --title "<title>" --body "$(cat <<'EOF'
|
|
204
|
+
<description>
|
|
205
|
+
EOF
|
|
206
|
+
)" [--draft]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**Update existing PR:**
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
gh pr edit <number> --title "<title>" --body "$(cat <<'EOF'
|
|
213
|
+
<description>
|
|
214
|
+
EOF
|
|
215
|
+
)"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Report the result with the PR URL.
|
|
219
|
+
|
|
220
|
+
### Step 8: Follow-up
|
|
221
|
+
|
|
222
|
+
After creating or updating, suggest next steps if relevant:
|
|
223
|
+
|
|
224
|
+
- "PR created: <url>"
|
|
225
|
+
- If draft: "Draft PR created. When ready for review: `gh pr ready`"
|
|
226
|
+
- If the reviewer/tester pipeline hasn't run: suggest `/agentic-review`
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Independent multi-agent code review. Reviews different aspects in parallel with specialized agents."
|
|
3
|
+
agent: "lead"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Generated by pnpm run sync:opencode-commands -->
|
|
7
|
+
|
|
8
|
+
# Review
|
|
9
|
+
|
|
10
|
+
Run an independent, multi-agent code review. Different agents examine different
|
|
11
|
+
aspects of the code in parallel for thorough, unbiased analysis.
|
|
12
|
+
|
|
13
|
+
**When to use this vs `/agentic-verify`:**
|
|
14
|
+
Use **review** when you want a focused code review — finding bugs, security
|
|
15
|
+
issues, and convention violations. Use **verify** when you want a full pre-ship
|
|
16
|
+
quality gate that also runs tests and checks for simplification opportunities.
|
|
17
|
+
|
|
18
|
+
**Usage:**
|
|
19
|
+
|
|
20
|
+
- `/agentic-review` — will ask what to review
|
|
21
|
+
- `/agentic-review 42` — review PR #42
|
|
22
|
+
- `/agentic-review --staged` — review staged changes
|
|
23
|
+
- `/agentic-review --branch` — review current branch vs base
|
|
24
|
+
- `/agentic-review --commits=3` — review the last 3 commits
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
### Step 1: Determine Scope
|
|
29
|
+
|
|
30
|
+
Parse `$ARGUMENTS` to determine what to review:
|
|
31
|
+
|
|
32
|
+
- **Number** → PR review via `gh pr diff <number>`
|
|
33
|
+
- **`--staged`** → staged changes via `git diff --cached`
|
|
34
|
+
- **`--branch`** → branch diff. Detect the default branch dynamically via
|
|
35
|
+
`git symbolic-ref refs/remotes/origin/HEAD`, then `git diff <base>...HEAD`
|
|
36
|
+
- **`--commits=N`** → recent commits via `git diff HEAD~N...HEAD`
|
|
37
|
+
- **No arguments** → Ask the user:
|
|
38
|
+
"What should I review? Options:
|
|
39
|
+
1. A pull request (provide PR number)
|
|
40
|
+
2. Staged changes (--staged)
|
|
41
|
+
3. Current branch vs main (--branch)
|
|
42
|
+
4. Recent commits (--commits=N)"
|
|
43
|
+
|
|
44
|
+
Do NOT guess. If the scope is unclear, ask.
|
|
45
|
+
|
|
46
|
+
### Step 2: Gather Context
|
|
47
|
+
|
|
48
|
+
Collect in parallel:
|
|
49
|
+
|
|
50
|
+
- The diff (from the determined scope)
|
|
51
|
+
- CLAUDE.md files in the repository and affected directories
|
|
52
|
+
- PR description and comments (if reviewing a PR)
|
|
53
|
+
- Recent commit messages for context
|
|
54
|
+
|
|
55
|
+
If the diff is empty, report "Nothing to review." and stop.
|
|
56
|
+
|
|
57
|
+
### Step 3: Parallel Review
|
|
58
|
+
|
|
59
|
+
Launch 3 review agents in parallel, each with the full diff and context:
|
|
60
|
+
|
|
61
|
+
**Agent 1: Correctness Review** (reviewer agent)
|
|
62
|
+
Focus: Logic errors, bugs, null access, race conditions, missing error handling.
|
|
63
|
+
Lens: Correctness + Security + Plan Alignment from the reviewer's review lenses.
|
|
64
|
+
|
|
65
|
+
**Agent 2: Convention Review** (reviewer agent)
|
|
66
|
+
Focus: Naming, structure, patterns, CLAUDE.md compliance, code style.
|
|
67
|
+
Lens: Conventions + Quality Patterns from the reviewer's review lenses.
|
|
68
|
+
|
|
69
|
+
**Agent 3: Test Coverage Assessment** (tester agent, assessment mode)
|
|
70
|
+
Focus: Are the changes adequately tested? What edge cases are missing?
|
|
71
|
+
Mode: Read-only assessment. Do NOT write tests — only assess and report gaps.
|
|
72
|
+
This overrides the tester's default write mode for this specific use case.
|
|
73
|
+
|
|
74
|
+
Each agent scores findings with confidence (0-100). Threshold: 80.
|
|
75
|
+
|
|
76
|
+
### Step 4: Synthesize
|
|
77
|
+
|
|
78
|
+
Collect findings from all 3 agents. Deduplicate (same issue found by
|
|
79
|
+
multiple agents counts once, with the highest confidence score).
|
|
80
|
+
|
|
81
|
+
### Step 5: Output
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
## Code Review
|
|
85
|
+
|
|
86
|
+
**Scope:** <what was reviewed>
|
|
87
|
+
**Files:** <count>
|
|
88
|
+
**Findings:** <count> (<critical> critical, <warnings> warnings, <suggestions> suggestions)
|
|
89
|
+
|
|
90
|
+
### Critical
|
|
91
|
+
**[Critical | 95]** `file:line` — description
|
|
92
|
+
Why: explanation
|
|
93
|
+
|
|
94
|
+
### Warnings
|
|
95
|
+
**[Warning | 85]** `file:line` — description
|
|
96
|
+
Why: explanation
|
|
97
|
+
|
|
98
|
+
### Suggestions
|
|
99
|
+
**[Suggestion | 82]** `file:line` — description
|
|
100
|
+
|
|
101
|
+
### Test Coverage
|
|
102
|
+
- Covered: <what's tested>
|
|
103
|
+
- Gaps: <what's missing>
|
|
104
|
+
- Recommended: <specific tests to add>
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
**Confidence threshold: 80.** Lower-confidence findings were excluded.
|
|
108
|
+
To address findings: `/agentic-develop continue`
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### False Positive Policy
|
|
112
|
+
|
|
113
|
+
Do NOT flag:
|
|
114
|
+
|
|
115
|
+
- Pre-existing issues not in the current diff
|
|
116
|
+
- Style preferences not in CLAUDE.md or conventions skill
|
|
117
|
+
- Issues linters or type checkers catch automatically
|
|
118
|
+
- Runtime-dependent speculative issues
|
|
119
|
+
- Explicitly suppressed issues (ignore comments)
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Simplify existing code. Reduces complexity, improves readability, and removes unnecessary abstractions — without changing behavior."
|
|
3
|
+
agent: "lead"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Generated by pnpm run sync:opencode-commands -->
|
|
7
|
+
|
|
8
|
+
# Simplify
|
|
9
|
+
|
|
10
|
+
Simplify existing code. This command takes working code and distills it
|
|
11
|
+
to its essence — fewer moving parts, same behavior, clearer intent.
|
|
12
|
+
|
|
13
|
+
**Usage:**
|
|
14
|
+
|
|
15
|
+
- `/agentic-simplify src/auth/session.ts` — simplify a specific file
|
|
16
|
+
- `/agentic-simplify src/payments/` — simplify a module
|
|
17
|
+
- `/agentic-simplify the checkout flow` — simplify by concept
|
|
18
|
+
|
|
19
|
+
## Philosophy
|
|
20
|
+
|
|
21
|
+
Elegance is achieved not when there is nothing left to add, but when there
|
|
22
|
+
is nothing left to take away. This command exists to turn working code into
|
|
23
|
+
_inevitable_ code — so clear that no one would think to write it differently.
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
### Step 1: Determine Scope
|
|
28
|
+
|
|
29
|
+
Parse `$ARGUMENTS` to understand what to simplify:
|
|
30
|
+
|
|
31
|
+
- **File path** → simplify that file
|
|
32
|
+
- **Directory** → simplify the module
|
|
33
|
+
- **Concept** → scout for relevant files, then simplify
|
|
34
|
+
- **No arguments** → Ask the user:
|
|
35
|
+
"What should I simplify? Options:
|
|
36
|
+
1. A specific file (provide path)
|
|
37
|
+
2. A module or directory
|
|
38
|
+
3. Recent changes (`--recent` for last commit's files)
|
|
39
|
+
4. Complexity hotspots (`--hotspots` for auto-detection)"
|
|
40
|
+
|
|
41
|
+
If `--recent` is specified, get changed files from `git diff HEAD~1 --name-only`.
|
|
42
|
+
|
|
43
|
+
If `--hotspots` is specified, deploy the **scout** to identify files with
|
|
44
|
+
high nesting, long functions, or excessive complexity.
|
|
45
|
+
|
|
46
|
+
### Step 2: Understand Before Simplifying
|
|
47
|
+
|
|
48
|
+
Deploy the **analyst** to study the target code:
|
|
49
|
+
|
|
50
|
+
- What is this code's purpose?
|
|
51
|
+
- How does data flow through it?
|
|
52
|
+
- What are the dependencies and callers?
|
|
53
|
+
- Where is the accidental complexity vs. essential complexity?
|
|
54
|
+
|
|
55
|
+
This step is critical. You cannot simplify what you do not understand.
|
|
56
|
+
Accidental complexity can be removed. Essential complexity cannot.
|
|
57
|
+
|
|
58
|
+
### Step 3: Establish Baseline
|
|
59
|
+
|
|
60
|
+
Before any changes:
|
|
61
|
+
|
|
62
|
+
1. Run the full test suite — record the result
|
|
63
|
+
2. Note line counts for files in scope
|
|
64
|
+
3. Identify the specific complexities to address
|
|
65
|
+
|
|
66
|
+
If tests are not passing before you start, **stop**. Report the failing
|
|
67
|
+
tests and ask the user how to proceed. Never simplify broken code.
|
|
68
|
+
|
|
69
|
+
### Step 4: Simplify
|
|
70
|
+
|
|
71
|
+
Deploy the **refiner** with:
|
|
72
|
+
|
|
73
|
+
- The analyst's findings (from step 2)
|
|
74
|
+
- The baseline metrics (from step 3)
|
|
75
|
+
- Clear scope boundaries
|
|
76
|
+
|
|
77
|
+
The refiner works incrementally — one simplification at a time,
|
|
78
|
+
verifying tests after each change.
|
|
79
|
+
|
|
80
|
+
### Step 5: Verify
|
|
81
|
+
|
|
82
|
+
Deploy the **tester** to confirm:
|
|
83
|
+
|
|
84
|
+
- All existing tests still pass
|
|
85
|
+
- No behavior has changed
|
|
86
|
+
- Edge cases are still covered
|
|
87
|
+
|
|
88
|
+
If the tester finds regressions, send the refiner back to revert
|
|
89
|
+
the problematic simplification.
|
|
90
|
+
|
|
91
|
+
### Step 6: Summary
|
|
92
|
+
|
|
93
|
+
When complete, present:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
## Simplification Summary
|
|
97
|
+
|
|
98
|
+
### Scope
|
|
99
|
+
<what was simplified>
|
|
100
|
+
|
|
101
|
+
### Before → After
|
|
102
|
+
- Lines: <before> → <after> (<net change>)
|
|
103
|
+
- Files touched: <count>
|
|
104
|
+
|
|
105
|
+
### Simplifications
|
|
106
|
+
1. **<description>** — `path/file.ts`
|
|
107
|
+
<what changed and why it's simpler>
|
|
108
|
+
|
|
109
|
+
2. **<description>** — ...
|
|
110
|
+
|
|
111
|
+
### Preserved
|
|
112
|
+
- All <count> tests passing
|
|
113
|
+
- No behavior changes
|
|
114
|
+
|
|
115
|
+
### Left Alone
|
|
116
|
+
- <areas considered but intentionally untouched, with reasoning>
|
|
117
|
+
|
|
118
|
+
### Next Steps
|
|
119
|
+
- <any follow-up work or deeper simplifications the user could consider>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Suggest running `/agentic-review --staged` to verify the simplifications,
|
|
123
|
+
then `/agentic-commit` to commit them.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Run a multi-agent quality gate on current changes. Checks correctness, complexity, and tests in parallel."
|
|
3
|
+
agent: "lead"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Generated by pnpm run sync:opencode-commands -->
|
|
7
|
+
|
|
8
|
+
# Verify
|
|
9
|
+
|
|
10
|
+
Pre-ship quality gate. Deploys three parallel agents to answer one question:
|
|
11
|
+
**are these changes ready to ship?**
|
|
12
|
+
|
|
13
|
+
**When to use this vs `/agentic-review`:**
|
|
14
|
+
Use **verify** as the final check before committing or creating a PR — it runs
|
|
15
|
+
correctness review, complexity analysis, AND tests together. Use **review** for
|
|
16
|
+
a focused code review without running tests or checking complexity.
|
|
17
|
+
|
|
18
|
+
**Usage:**
|
|
19
|
+
|
|
20
|
+
- `/agentic-verify` — verify all changes on the current branch vs. default branch
|
|
21
|
+
- `/agentic-verify --staged` — verify only staged changes
|
|
22
|
+
- `/agentic-verify --base develop` — verify against a specific base branch
|
|
23
|
+
|
|
24
|
+
## What It Checks
|
|
25
|
+
|
|
26
|
+
Three agents run in parallel, each with a different lens:
|
|
27
|
+
|
|
28
|
+
| Agent | Focus | Mode |
|
|
29
|
+
| -------------------------- | ------------------------------------------------------------- | --------------- |
|
|
30
|
+
| **Reviewer** (correctness) | Bugs, security, conventions | Read-only |
|
|
31
|
+
| **Reviewer** (complexity) | Simplification opportunities, over-engineering, readability | Read-only |
|
|
32
|
+
| **Tester** | Run existing tests — or write tests if none cover the changes | Write or Assess |
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- **Never modify source code.** This command verifies. It does not fix.
|
|
37
|
+
The tester may create test files, but source code is untouched.
|
|
38
|
+
- **Never skip agents.** All three run, every time. A partial quality gate
|
|
39
|
+
is a false quality gate.
|
|
40
|
+
- **Present findings honestly.** Don't soften blocking issues. Don't inflate
|
|
41
|
+
advisory notes. Signal over noise.
|
|
42
|
+
|
|
43
|
+
## Workflow
|
|
44
|
+
|
|
45
|
+
### Step 1: Detect Scope
|
|
46
|
+
|
|
47
|
+
Run in parallel:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git branch --show-current
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 2>/dev/null || echo 'main'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
git diff --stat
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
git diff --cached --stat
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Determine the scope:
|
|
66
|
+
|
|
67
|
+
- If `$ARGUMENTS` contains `--staged` — scope is staged changes only
|
|
68
|
+
(`git diff --cached`)
|
|
69
|
+
- If `$ARGUMENTS` contains `--base <branch>` — scope is diff against
|
|
70
|
+
that branch (`git diff <branch>...HEAD`)
|
|
71
|
+
- Otherwise — scope is diff against the repo's default branch
|
|
72
|
+
(`git diff <default>...HEAD`)
|
|
73
|
+
|
|
74
|
+
If there are no changes in scope, report "Nothing to verify." and stop.
|
|
75
|
+
|
|
76
|
+
### Step 2: Gather Context
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
git diff <scope> --stat
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
git diff <scope>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git log <base>..HEAD --oneline
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Read the full diff. Identify:
|
|
91
|
+
|
|
92
|
+
- Which files changed and how
|
|
93
|
+
- Which test files exist for the changed code
|
|
94
|
+
- Whether the project has a test runner configured (`package.json` scripts,
|
|
95
|
+
test config files)
|
|
96
|
+
|
|
97
|
+
### Step 3: Deploy Agents
|
|
98
|
+
|
|
99
|
+
Launch all three in parallel. Brief each precisely:
|
|
100
|
+
|
|
101
|
+
**Reviewer 1 — Correctness:**
|
|
102
|
+
|
|
103
|
+
> Scope: <changed files>. Diff baseline: <base branch or staged>.
|
|
104
|
+
> Context: <summary of what changed and why, derived from commits>.
|
|
105
|
+
> **Focus: correctness, security, and convention adherence.**
|
|
106
|
+
> Ignore complexity and style preferences — the other reviewer handles that.
|
|
107
|
+
|
|
108
|
+
**Reviewer 2 — Complexity:**
|
|
109
|
+
|
|
110
|
+
> Scope: <changed files>. Diff baseline: <base branch or staged>.
|
|
111
|
+
> Context: <summary of what changed and why, derived from commits>.
|
|
112
|
+
> **Focus: complexity and simplification opportunities.** Flag:
|
|
113
|
+
> over-engineering, unnecessary abstractions, functions that do too much,
|
|
114
|
+
> deep nesting, code that could be simpler without losing clarity.
|
|
115
|
+
> Do NOT flag style preferences. Only flag genuine complexity.
|
|
116
|
+
|
|
117
|
+
**Tester:**
|
|
118
|
+
|
|
119
|
+
Determine mode based on test coverage:
|
|
120
|
+
|
|
121
|
+
- Test files exist for the changed code → `mode: assess` (analyze gaps,
|
|
122
|
+
run existing tests)
|
|
123
|
+
- No test files cover the changed code → `mode: write` (create tests,
|
|
124
|
+
then run them)
|
|
125
|
+
- Mixed (some covered, some not) → `mode: write` (fill the gaps)
|
|
126
|
+
|
|
127
|
+
> Files changed: <list>. Test command: <from package.json or config>.
|
|
128
|
+
> Test framework: <detected>. Mode: <write or assess>.
|
|
129
|
+
> Dev notes: <brief context about what changed>.
|
|
130
|
+
|
|
131
|
+
### Step 4: Synthesize Results
|
|
132
|
+
|
|
133
|
+
When all three agents return:
|
|
134
|
+
|
|
135
|
+
1. **Deduplicate** — If both reviewers flag the same issue, report it once
|
|
136
|
+
with the higher severity.
|
|
137
|
+
|
|
138
|
+
2. **Categorize findings:**
|
|
139
|
+
- **Blocking** — Bugs, security issues, test failures. Must fix before shipping.
|
|
140
|
+
- **Warning** — Significant concerns. Should fix, but not necessarily now.
|
|
141
|
+
- **Advisory** — Suggestions, minor improvements. Nice to fix.
|
|
142
|
+
|
|
143
|
+
3. **Produce the Quality Report:**
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## Quality Report: <scope description>
|
|
147
|
+
|
|
148
|
+
**Verdict:** PASS | FAIL | CONDITIONAL
|
|
149
|
+
|
|
150
|
+
### Blocking
|
|
151
|
+
|
|
152
|
+
- <findings that must be fixed — empty if none>
|
|
153
|
+
|
|
154
|
+
### Warnings
|
|
155
|
+
|
|
156
|
+
- <findings that should be fixed — empty if none>
|
|
157
|
+
|
|
158
|
+
### Advisory
|
|
159
|
+
|
|
160
|
+
- <suggestions and minor improvements — empty if none>
|
|
161
|
+
|
|
162
|
+
### Simplification Opportunities
|
|
163
|
+
|
|
164
|
+
- <complexity reviewer's findings — empty if code is clean>
|
|
165
|
+
|
|
166
|
+
### Test Results
|
|
167
|
+
|
|
168
|
+
- Tests run: <count> passed, <count> failed
|
|
169
|
+
- Tests written: <count new tests, if tester was in write mode>
|
|
170
|
+
- Coverage gaps: <remaining gaps identified>
|
|
171
|
+
|
|
172
|
+
### Verdict Reasoning
|
|
173
|
+
|
|
174
|
+
<1-2 sentences explaining the verdict>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Step 5: Verdict
|
|
178
|
+
|
|
179
|
+
- **PASS** — No blocking findings. Tests green. Ship it.
|
|
180
|
+
- **FAIL** — Blocking findings or test failures. List what needs fixing.
|
|
181
|
+
- **CONDITIONAL** — Warnings only, no blockers. Present findings and let
|
|
182
|
+
the user decide.
|
|
183
|
+
|
|
184
|
+
### Step 6: Suggest Next Steps
|
|
185
|
+
|
|
186
|
+
Based on the verdict:
|
|
187
|
+
|
|
188
|
+
- **PASS** → "All green. Ready for `/agentic-commit` or `/agentic-pr`."
|
|
189
|
+
- **FAIL** → "These findings need fixing. Should I send the developer to
|
|
190
|
+
address them?" (If yes, transition to developer with specific findings.)
|
|
191
|
+
- **CONDITIONAL** → "Warnings but no blockers. Fix now or ship as-is?"
|
|
192
|
+
- **Simplification findings** → "Simplification opportunities detected.
|
|
193
|
+
`/agentic-simplify` can handle these."
|