@nukcole-xinluo9510/pi-critic-guy 0.1.0 â 0.1.2
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 +95 -29
- package/package.json +17 -4
package/README.md
CHANGED
|
@@ -1,6 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ð§ Critic Guy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A pi extension that trusts the model.** Type `critic` in any pi session and get a
|
|
4
|
+
second opinion â from an independent, read-only reviewer you spawn with a single word.
|
|
5
|
+
|
|
6
|
+
No extra tools. No agent files. No configuration. Just say `critic`.
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<img src="https://raw.githubusercontent.com/luoxin9510/pi-critic-guy/main/assets/philosophy.png" alt="Critic Guy â freedom in the middle, rails at the edge" width="840">
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
critic
|
|
14
|
+
critic review the auth code
|
|
15
|
+
critic using claude check for race conditions
|
|
16
|
+
critic model=deepseek-v4-flash review the error handling
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Why it's different â built the pi way
|
|
22
|
+
|
|
23
|
+
pi's core bet is simple: **the model is capable â give it good context and good tools,
|
|
24
|
+
then get out of the way.** Critic Guy is built on exactly that bet.
|
|
25
|
+
|
|
26
|
+
It does **not** wrap reviewing in a rigid tool with fixed modes and schemas. It teaches
|
|
27
|
+
the model a *capability* and hands over the judgment:
|
|
28
|
+
|
|
29
|
+
- **What to review?** The model picks the most valuable target from your conversation â
|
|
30
|
+
you don't have to spell it out.
|
|
31
|
+
- **One critic or several in parallel?** The model decides, splitting large scope into
|
|
32
|
+
focused reviewers however it sees fit.
|
|
33
|
+
|
|
34
|
+
The only thing Critic Guy locks down is the **boundary** â and it locks it down with
|
|
35
|
+
*mechanism*, not by asking the model nicely:
|
|
36
|
+
|
|
37
|
+
- The critic spawns as a fresh `pi -p` session with **read-only tools** (`read`, `grep`,
|
|
38
|
+
`find`, `ls`) â it physically cannot edit files, write files, or run shell commands.
|
|
39
|
+
- `--offline -ne` means the child never hangs on startup network calls and never
|
|
40
|
+
re-loads this extension (so no runaway nesting).
|
|
41
|
+
- Its persona refuses to read credentials, secrets, or dotfiles.
|
|
42
|
+
|
|
43
|
+
> **Freedom in the middle, hard rails at the edge.**
|
|
44
|
+
> Judgment goes to the model; safety is enforced in code.
|
|
45
|
+
|
|
46
|
+
That's the whole philosophy â and it's why Critic Guy stays a tiny prompt injection
|
|
47
|
+
instead of a 1000-line tool. It's the most pi-native way to get a critic.
|
|
48
|
+
|
|
49
|
+
## Highlights
|
|
50
|
+
|
|
51
|
+
- ðŠķ **Zero dependencies, zero config** â no companion extension, no `reviewer.md`,
|
|
52
|
+
nothing to install beyond this package.
|
|
53
|
+
- ð **Safe by construction** â the reviewer is read-only and isolated; the boundary is
|
|
54
|
+
enforced by `--tools`, not by trust.
|
|
55
|
+
- ð§ **Model-driven** â you decide *that* you want a review; the model decides *what* and
|
|
56
|
+
*how*.
|
|
57
|
+
- ðļ **Zero overhead when idle** â instructions are injected **only** on turns where you
|
|
58
|
+
actually type `critic`. Silent the rest of the time.
|
|
59
|
+
- ðŊ **Model-aware** â resolves the reviewer model from your current session, or one you
|
|
60
|
+
name with `using <name>` / `model=<id>`.
|
|
4
61
|
|
|
5
62
|
## Install
|
|
6
63
|
|
|
@@ -8,49 +65,58 @@ Pi extension â spawn a second-opinion code reviewer by typing `critic` into yo
|
|
|
8
65
|
# From npm
|
|
9
66
|
pi add npm:@nukcole-xinluo9510/pi-critic-guy
|
|
10
67
|
|
|
11
|
-
# Or from local
|
|
68
|
+
# Or from a local checkout during development
|
|
12
69
|
pi add /path/to/pi-critic-guy
|
|
13
70
|
```
|
|
14
71
|
|
|
15
|
-
|
|
72
|
+
That's it. No other setup.
|
|
16
73
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
critic
|
|
21
|
-
critic review the auth code
|
|
22
|
-
critic model=deepseek-v4-flash review the error handling
|
|
23
|
-
critic using claude check for security issues
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
The extension injects "Critic Guy" instructions into the system prompt on turns where you mention `critic`. It resolves the model dynamically from your current session, the model registry, or the model you specify via `using <name>` or `model=<id>`.
|
|
27
|
-
|
|
28
|
-
### What it does
|
|
74
|
+
## Usage
|
|
29
75
|
|
|
30
|
-
|
|
31
|
-
- Resolves the reviewer model (your current model, or one you specify)
|
|
32
|
-
- Injects instructions to spawn a subagent via the `subagent` tool
|
|
33
|
-
- Keeps the reviewer on a short leash â read-only tools (`read`, `grep`, `find`, `ls`)
|
|
76
|
+
In any pi session, just mention `critic`:
|
|
34
77
|
|
|
35
|
-
|
|
78
|
+
| You type | What happens |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `critic` | Model picks the most valuable thing from the conversation and reviews it |
|
|
81
|
+
| `critic review the auth code` | Targeted review of what you point at |
|
|
82
|
+
| `critic using claude` | Spawn the critic on a model matching "claude" |
|
|
83
|
+
| `critic model=deepseek-v4-flash` | Spawn the critic on an exact model id |
|
|
36
84
|
|
|
37
|
-
|
|
85
|
+
Word-boundary matching means `critical`, `criticism`, etc. will **not** trigger it â
|
|
86
|
+
only a standalone `critic`.
|
|
38
87
|
|
|
39
88
|
## How it works
|
|
40
89
|
|
|
41
|
-
|
|
90
|
+
Critic Guy hooks `before_agent_start`. On any turn where you mention `critic`:
|
|
42
91
|
|
|
43
|
-
1. It
|
|
44
|
-
2.
|
|
45
|
-
|
|
92
|
+
1. It resolves the reviewer model (your current model, the registry, or one you named).
|
|
93
|
+
2. It appends a short **"Capability: Critic Guy"** section to the system prompt â the
|
|
94
|
+
capability, the resolved model id, and one spawn command with the hard-boundary flags.
|
|
95
|
+
3. The model spawns one or more critics:
|
|
96
|
+
```bash
|
|
97
|
+
pi -p --offline -ne --no-session -nc --model "<resolved>" \
|
|
98
|
+
--tools read,grep,find,ls \
|
|
99
|
+
--append-system-prompt "<reviewer persona>" \
|
|
100
|
+
"Task: review <files> ..."
|
|
101
|
+
```
|
|
102
|
+
4. Each critic reads the named files in its own isolated context and returns a critique,
|
|
103
|
+
which the model relays to you.
|
|
46
104
|
|
|
47
|
-
|
|
105
|
+
If the system prompt is already very large, Critic Guy skips injection that turn and says
|
|
106
|
+
so â it never silently no-ops.
|
|
48
107
|
|
|
49
108
|
## Requirements
|
|
50
109
|
|
|
51
110
|
- pi 0.79+
|
|
52
|
-
|
|
53
|
-
|
|
111
|
+
|
|
112
|
+
(Yes, that's the whole list.)
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm run check # tsc --noEmit
|
|
118
|
+
npm test # node --test (matchModel + parseModelQuery)
|
|
119
|
+
```
|
|
54
120
|
|
|
55
121
|
## License
|
|
56
122
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nukcole-xinluo9510/pi-critic-guy",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Pi extension â spawn a second-opinion reviewer by typing \"critic\"",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"pi-package",
|
|
9
|
+
"pi",
|
|
10
|
+
"critic",
|
|
11
|
+
"review",
|
|
12
|
+
"code-review"
|
|
13
|
+
],
|
|
8
14
|
"license": "MIT",
|
|
9
15
|
"repository": {
|
|
10
16
|
"type": "git",
|
|
@@ -14,12 +20,19 @@
|
|
|
14
20
|
"check": "tsc --noEmit",
|
|
15
21
|
"test": "node --experimental-strip-types --test test/index.test.ts"
|
|
16
22
|
},
|
|
17
|
-
"files": [
|
|
23
|
+
"files": [
|
|
24
|
+
"extensions",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
18
28
|
"publishConfig": {
|
|
19
29
|
"access": "public"
|
|
20
30
|
},
|
|
21
31
|
"pi": {
|
|
22
|
-
"extensions": [
|
|
32
|
+
"extensions": [
|
|
33
|
+
"./extensions"
|
|
34
|
+
],
|
|
35
|
+
"image": "https://raw.githubusercontent.com/luoxin9510/pi-critic-guy/main/assets/philosophy.png"
|
|
23
36
|
},
|
|
24
37
|
"peerDependencies": {
|
|
25
38
|
"@earendil-works/pi-coding-agent": ">=0.79"
|