@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fyeeme/pi-review",
3
- "version": "2.0.0",
4
- "description": "Review & cleanup extension for pi. Registers /code-review and /code-simplify commands plus a general-purpose `subagent` tool that spawns parallel pi subprocesses — providing the real fan-out capability the code-review and simplify skills (bundled under `skills/`) need for their multi-agent flows. The /code-simplify handler uses ctx.getContextUsage() to decide parallel vs single-pass mode deterministically.",
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-subagent-core": "^0.3.3"
42
+ "@fyeeme/pi-subagents": "2.1.1"
39
43
  },
40
44
  "peerDependencies": {
41
- "@earendil-works/pi-ai": ">=0.84.1",
42
- "@earendil-works/pi-coding-agent": ">=0.84.1",
43
- "@earendil-works/pi-tui": ">=0.84.1",
44
- "jiti": ">=2.0.0",
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.84.1",
50
- "@earendil-works/pi-coding-agent": "0.84.1",
51
- "@earendil-works/pi-tui": "0.84.1",
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}}