@fyeeme/pi-review 2.0.0 → 2.1.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 +78 -132
- package/agents/cleaner-altitude.md +18 -0
- package/agents/cleaner-efficiency.md +19 -0
- package/agents/cleaner-reuse.md +16 -0
- package/agents/cleaner-simplification.md +16 -0
- package/agents/finder-conventions.md +23 -0
- package/agents/finder-cross-file.md +21 -0
- package/agents/finder-diff-scan.md +23 -0
- package/agents/finder-language-pitfall.md +21 -0
- package/agents/finder-removed-behavior.md +21 -0
- package/agents/finder-wrapper-proxy.md +23 -0
- package/agents/gap-hunter.md +24 -0
- package/agents/verifier.md +33 -0
- package/index.ts +34 -29
- package/package.json +17 -15
- package/prompts/review.parallel.md +23 -0
- package/prompts/review.single.md +16 -0
- package/prompts/simplify.parallel.md +45 -0
- package/prompts/simplify.single.md +23 -0
- package/skills/code-review/SKILL.md +292 -97
- package/skills/{simplify → code-simplify}/SKILL.md +93 -36
- package/src/config.ts +109 -0
- package/src/diff.ts +306 -0
- package/src/dispatch.ts +301 -0
- package/src/loop.ts +266 -0
- package/src/strategy.ts +76 -0
- package/src/tools/review_report.ts +36 -20
- package/src/commands/code-review.ts +0 -100
- package/src/commands/code-simplify.ts +0 -100
- package/src/tools/subagent.ts +0 -367
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fyeeme/pi-review",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Review & cleanup
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Review & cleanup assets for pi: /code-review and /code-simplify commands dispatching declarative prompt templates (parallel strategy as frontmatter data) plus review methodology skills and finder/verifier agent definitions. Spawning lives in @fyeeme/pi-subagents; this package registers the review_report findings sink and the generic dispatcher.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "fyeeme",
|
|
@@ -9,25 +9,29 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
|
-
"pi-package",
|
|
13
12
|
"pi",
|
|
13
|
+
"pi-package",
|
|
14
14
|
"code-review",
|
|
15
15
|
"simplify",
|
|
16
16
|
"cleanup",
|
|
17
|
-
"subagent",
|
|
18
|
-
"fan-out",
|
|
19
17
|
"review"
|
|
20
18
|
],
|
|
21
19
|
"files": [
|
|
22
20
|
"*.ts",
|
|
23
21
|
"src/**/*.ts",
|
|
24
22
|
"skills/**/*.md",
|
|
23
|
+
"prompts/**/*.md",
|
|
24
|
+
"agents/**/*.md",
|
|
25
25
|
"README.md",
|
|
26
26
|
"LICENSE"
|
|
27
27
|
],
|
|
28
28
|
"pi": {
|
|
29
29
|
"extensions": [
|
|
30
30
|
"./index.ts"
|
|
31
|
+
],
|
|
32
|
+
"skills": [
|
|
33
|
+
"skills/code-review",
|
|
34
|
+
"skills/code-simplify"
|
|
31
35
|
]
|
|
32
36
|
},
|
|
33
37
|
"scripts": {
|
|
@@ -35,20 +39,18 @@
|
|
|
35
39
|
"typecheck": "tsc"
|
|
36
40
|
},
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"@fyeeme/pi-
|
|
42
|
+
"@fyeeme/pi-subagents": "2.1.1"
|
|
39
43
|
},
|
|
40
44
|
"peerDependencies": {
|
|
41
|
-
"@earendil-works/pi-ai": ">=0.84.
|
|
42
|
-
"@earendil-works/pi-coding-agent": ">=0.84.
|
|
43
|
-
"@earendil-works/pi-tui": ">=0.84.
|
|
44
|
-
"
|
|
45
|
-
"typebox": ">=1.0.0",
|
|
46
|
-
"typescript": ">=5.0.0"
|
|
45
|
+
"@earendil-works/pi-ai": ">=0.84.4",
|
|
46
|
+
"@earendil-works/pi-coding-agent": ">=0.84.4",
|
|
47
|
+
"@earendil-works/pi-tui": ">=0.84.4",
|
|
48
|
+
"typebox": ">=1.0.0"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
|
-
"@earendil-works/pi-ai": "0.
|
|
50
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
51
|
-
"@earendil-works/pi-tui": "0.
|
|
51
|
+
"@earendil-works/pi-ai": "0.85.1",
|
|
52
|
+
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
53
|
+
"@earendil-works/pi-tui": "0.85.1",
|
|
52
54
|
"@types/node": "22.19.19",
|
|
53
55
|
"jiti": "2.7.0",
|
|
54
56
|
"typebox": "1.1.38",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "/code-review trigger — xhigh/max deep sweep: finder/verifier/gap-hunt fan-out via the code-review skill"
|
|
3
|
+
vars: [effort, effort-source, extra-args, skill, finder-max-turns, verifier-max-turns, gap-hunt-max-turns, verify]
|
|
4
|
+
---
|
|
5
|
+
Run a code review now. Effective effort: {{effort}} ({{effort-source}}){{extra-args}}.
|
|
6
|
+
|
|
7
|
+
First load the code-review skill with the read tool: {{skill}}. Then follow its
|
|
8
|
+
XHIGH/MAX FLOW exactly — dispatch the finder / verifier / gap-hunter agents it
|
|
9
|
+
calls for through the `subagent` tool (bundled agents: finder-diff-scan,
|
|
10
|
+
finder-removed-behavior, finder-cross-file, finder-language-pitfall,
|
|
11
|
+
finder-wrapper-proxy, cleaner-reuse, cleaner-simplification,
|
|
12
|
+
cleaner-efficiency, cleaner-altitude, finder-conventions, verifier,
|
|
13
|
+
gap-hunter), with `maxTurns: {{finder-max-turns}}` per finder batch,
|
|
14
|
+
`maxTurns: {{verifier-max-turns}}` per verifier and `maxTurns: {{gap-hunt-max-turns}}`
|
|
15
|
+
for the gap-hunt as the skill instructs.
|
|
16
|
+
|
|
17
|
+
The `subagent` tool is a pi extension tool in your session toolset — judge
|
|
18
|
+
its availability from that list, never via `mcp` tool search (which only
|
|
19
|
+
indexes MCP-server tools and cannot see extension tools).
|
|
20
|
+
|
|
21
|
+
Verification guidance (the skill's `--fix` flow consumes it):
|
|
22
|
+
|
|
23
|
+
{{verify}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "/code-review trigger — single-pass main-session review via the code-review skill (low/medium/high)"
|
|
3
|
+
vars: [effort, effort-source, extra-args, skill, verify, loop-note]
|
|
4
|
+
---
|
|
5
|
+
Run a code review now. Effective effort: {{effort}} ({{effort-source}}){{extra-args}}.
|
|
6
|
+
|
|
7
|
+
First load the code-review skill with the read tool: {{skill}}. Then follow its
|
|
8
|
+
SINGLE-PASS FLOW for effort {{effort}}: review the diff yourself in this
|
|
9
|
+
session — read it, surface candidates against the skill's rubric, self-verify
|
|
10
|
+
them (medium/high), and report via the `review_report` tool. No subagent
|
|
11
|
+
fan-out at this level: do NOT dispatch finder or verifier agents, even though
|
|
12
|
+
the `subagent` tool may be in your session toolset.
|
|
13
|
+
{{loop-note}}
|
|
14
|
+
Verification guidance (the skill's `--fix` flow consumes it):
|
|
15
|
+
|
|
16
|
+
{{verify}}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "/code-simplify trigger — PARALLEL mode (4-agent fan-out via the subagent tool)"
|
|
3
|
+
parallel-when:
|
|
4
|
+
context-below: 0.8
|
|
5
|
+
diff-chars-below: 400000
|
|
6
|
+
vars: [target, scope-label, pct, git-command, context-package, skill, verify, simplify-max-turns]
|
|
7
|
+
---
|
|
8
|
+
Clean up the changed code now. Target: {{target}}.
|
|
9
|
+
|
|
10
|
+
Dispatcher decided PARALLEL mode (context {{pct}} full; scope {{scope-label}}).
|
|
11
|
+
Follow the phases IN ORDER — do not launch anything before Phase 0 is done.
|
|
12
|
+
|
|
13
|
+
## Phase 0 — read the diff (visible, before any agent launches)
|
|
14
|
+
|
|
15
|
+
{{context-package}}
|
|
16
|
+
|
|
17
|
+
Run exactly this command (the dispatcher already resolved the scope — do not
|
|
18
|
+
re-derive a different range):
|
|
19
|
+
|
|
20
|
+
{{git-command}}
|
|
21
|
+
|
|
22
|
+
Read the full diff, then write a 2–4 line change-intent summary BEFORE
|
|
23
|
+
launching anything — that summary and your first-hand reading are what you
|
|
24
|
+
will use to merge, dedup, and judge the agents' findings in Phase 2.
|
|
25
|
+
|
|
26
|
+
## Phase 1 — launch the 4 cleanup agents
|
|
27
|
+
|
|
28
|
+
Call the `subagent` tool in parallel mode with 4 tasks, one per agent —
|
|
29
|
+
cleaner-reuse, cleaner-simplification, cleaner-efficiency, cleaner-altitude —
|
|
30
|
+
each task being: "Review the changed code of {{target}} for <angle> findings.
|
|
31
|
+
Run this first to see the diff: {{git-command}}. Report file:line — one-line
|
|
32
|
+
summary — the concrete cost." Set `maxTurns: {{simplify-max-turns}}` on the call (the slowest
|
|
33
|
+
agent pins the wave's wall time; a capped agent still owes partial output).
|
|
34
|
+
The agents' angle guidance rides their own definitions — do not write the
|
|
35
|
+
agent prompts yourself or inline the diff anywhere. The tool's result carries
|
|
36
|
+
the four findings reports.
|
|
37
|
+
|
|
38
|
+
## Phase 2 — apply, verify, report
|
|
39
|
+
|
|
40
|
+
When the tool result arrives, merge/dedup the findings against your Phase 0
|
|
41
|
+
reading, then load {{skill}} via the read tool and follow its Phase 2
|
|
42
|
+
(snapshot → apply → verify → auto-revert on failure → report via
|
|
43
|
+
review_report with `fanned_out: true` — the 4-agent fan-out actually ran).
|
|
44
|
+
Never apply changes the findings don't justify.
|
|
45
|
+
{{verify}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "/code-simplify trigger — SINGLE-PASS mode (angles worked inline, no fan-out)"
|
|
3
|
+
vars: [target, reasons, scope-label, too-large, git-command, context-package, skill, verify]
|
|
4
|
+
---
|
|
5
|
+
Clean up the changed code now. Target: {{target}}.
|
|
6
|
+
|
|
7
|
+
Dispatcher decided SINGLE-PASS mode ({{reasons}}). Scope: {{scope-label}}.
|
|
8
|
+
|
|
9
|
+
## Phase 0 — read the diff first
|
|
10
|
+
|
|
11
|
+
{{context-package}}
|
|
12
|
+
|
|
13
|
+
Run exactly this command (the dispatcher already resolved the scope — do not
|
|
14
|
+
re-derive a different range):
|
|
15
|
+
|
|
16
|
+
{{git-command}}
|
|
17
|
+
|
|
18
|
+
Read the full diff, then write a 2–4 line change-intent summary before
|
|
19
|
+
reviewing.{{too-large}}
|
|
20
|
+
|
|
21
|
+
Then load {{skill}} via the read tool and follow its single-pass body. Work
|
|
22
|
+
the four angles inline — do not fake fan-out.
|
|
23
|
+
{{verify}}
|