@docyrus/docyrus 0.0.46 → 0.0.50
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/main.js +2095 -1222
- package/main.js.map +4 -4
- package/package.json +1 -1
- package/resources/pi-agent/extensions/server-auto-commit.ts +46 -0
- package/resources/pi-agent/prompts/agent-system.md +5 -4
- package/resources/pi-agent/prompts/coder-system.md +16 -4
- package/resources/pi-agent/skills/changelog-generator/SKILL.md +36 -0
- package/resources/pi-agent/skills/release-manager/SKILL.md +103 -0
- package/server-loader.js +10500 -9794
- package/server-loader.js.map +4 -4
- package/resources/pi-agent/skills/diffity-diff/SKILL.md +0 -28
- package/resources/pi-agent/skills/diffity-resolve/SKILL.md +0 -69
- package/resources/pi-agent/skills/diffity-review/SKILL.md +0 -176
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: diffity-diff
|
|
3
|
-
description: Open the diffity diff viewer in the browser to see your changes
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Diffity Diff Skill
|
|
8
|
-
|
|
9
|
-
You are opening the diffity diff viewer so the user can see their changes in the browser.
|
|
10
|
-
|
|
11
|
-
## Arguments
|
|
12
|
-
|
|
13
|
-
- `ref` (optional): Git ref to diff (e.g. `main..feature`, `HEAD~3`) or a GitHub PR URL (e.g. `https://github.com/owner/repo/pull/123`). Defaults to working tree changes.
|
|
14
|
-
|
|
15
|
-
## Instructions
|
|
16
|
-
|
|
17
|
-
1. Check that `diffity` is available: run `which diffity`. If not found, install it with `npm install -g diffity`.
|
|
18
|
-
2. Run `diffity <ref>` (or just `diffity` if no ref) using the Bash tool with `run_in_background: true`:
|
|
19
|
-
- The CLI handles everything: if an instance is already running for this repo it reuses it and opens the browser, otherwise it starts a new server and opens the browser.
|
|
20
|
-
- Do NOT use `&` or `--quiet` — let the Bash tool handle backgrounding.
|
|
21
|
-
3. Wait 2 seconds, then run `diffity list --json` to get the port.
|
|
22
|
-
4. Tell the user diffity is running. Print the URL and keep it short — don't show session IDs, hashes, or other internals. Example:
|
|
23
|
-
|
|
24
|
-
> Diffity is running at http://localhost:5391
|
|
25
|
-
>
|
|
26
|
-
> When you're ready:
|
|
27
|
-
> - Leave comments on the diff in your browser, then run **/diffity-resolve** to fix them
|
|
28
|
-
> - Or run **/diffity-review** to get an AI code review
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: diffity-resolve
|
|
3
|
-
description: Read open review comments and resolve them by making code fixes
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Diffity Resolve Skill
|
|
8
|
-
|
|
9
|
-
You are reading open review comments and resolving them by making the requested code changes.
|
|
10
|
-
|
|
11
|
-
## Arguments
|
|
12
|
-
|
|
13
|
-
- `thread-id` (optional): Resolve a specific thread by ID instead of all open threads. Example: `/diffity-resolve abc123`
|
|
14
|
-
|
|
15
|
-
## CLI Reference
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
diffity agent diff
|
|
19
|
-
diffity agent list [--status open|resolved|dismissed] [--json]
|
|
20
|
-
diffity agent comment --file <path> --line <n> [--end-line <n>] [--side new|old] --body "<text>"
|
|
21
|
-
diffity agent general-comment --body "<text>"
|
|
22
|
-
diffity agent resolve <id> [--summary "<text>"]
|
|
23
|
-
diffity agent dismiss <id> [--reason "<text>"]
|
|
24
|
-
diffity agent reply <id> --body "<text>"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
- `--file`, `--line`, `--body` are required for `comment`
|
|
28
|
-
- `--end-line` defaults to `--line` (single-line comment)
|
|
29
|
-
- `--side` defaults to `new`
|
|
30
|
-
- `general-comment` creates a diff-level comment not tied to any file or line
|
|
31
|
-
- `<id>` accepts full UUID or 8-char prefix
|
|
32
|
-
|
|
33
|
-
## Prerequisites
|
|
34
|
-
|
|
35
|
-
1. Check that `diffity` is available: run `which diffity`. If not found, install it with `npm install -g diffity`.
|
|
36
|
-
2. Check that a review session exists: run `diffity agent list`. If this fails with "No active review session", tell the user to start diffity first (e.g. `diffity` or **/diffity-diff**).
|
|
37
|
-
|
|
38
|
-
## Instructions
|
|
39
|
-
|
|
40
|
-
1. List open comment threads with full details:
|
|
41
|
-
```
|
|
42
|
-
diffity agent list --status open --json
|
|
43
|
-
```
|
|
44
|
-
If a `thread-id` argument was provided, filter to just that thread. The JSON output includes the full comment body, file path, line numbers, and side for each thread.
|
|
45
|
-
2. If there are no open threads, tell the user there's nothing to resolve.
|
|
46
|
-
3. For each open thread, check the `comments` array and the `author.type` field (`"user"` or `"agent"`) on each comment:
|
|
47
|
-
a. **Skip** general comments (filePath `__general__`) — these are summaries, not actionable code changes.
|
|
48
|
-
b. **Skip** threads where the last comment is an agent reply that asks the user a question (e.g. "Could you clarify...?") and the user hasn't responded yet — the agent is waiting for user input. Still process threads where the agent left the original comment (code suggestion, review feedback, etc.) — those are actionable.
|
|
49
|
-
c. **`[nit]` comments** — these are minor suggestions but still actionable. Resolve them like any other comment.
|
|
50
|
-
d. **`[question]` comments** (from the user) — read the question, examine the relevant code, and resolve the thread with your answer as the summary:
|
|
51
|
-
```
|
|
52
|
-
diffity agent resolve <thread-id> --summary "Your answer here"
|
|
53
|
-
```
|
|
54
|
-
e. Comments phrased as questions without an explicit `[question]` tag (e.g. "should we add X?" or "can we rename this?") are suggestions — treat them as actionable requests and make the change.
|
|
55
|
-
f. Read the comment body from the JSON output and understand what change is requested. Interpret the intent:
|
|
56
|
-
- If the comment suggests a code change, make the change.
|
|
57
|
-
- If the comment suggests adding documentation, add or update the relevant docs.
|
|
58
|
-
- If the comment asks a question that implies an action (e.g. "should we add X?"), treat it as a request to do that action.
|
|
59
|
-
- If the comment is genuinely unclear and you cannot determine what action to take, reply asking for clarification instead of silently skipping:
|
|
60
|
-
```
|
|
61
|
-
diffity agent reply <thread-id> --body "Could you clarify what change you'd like here?"
|
|
62
|
-
```
|
|
63
|
-
g. Read the relevant source file to understand the full context around the commented lines, then make the requested change using the Edit tool.
|
|
64
|
-
h. After making the change, resolve the thread with a summary:
|
|
65
|
-
```
|
|
66
|
-
diffity agent resolve <thread-id> --summary "Fixed: <brief description of what was changed>"
|
|
67
|
-
```
|
|
68
|
-
4. After resolving all applicable threads, run `diffity agent list` to confirm status.
|
|
69
|
-
5. Tell the user to check the browser — resolved status will appear within 2 seconds via polling.
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: diffity-review
|
|
3
|
-
description: Review current diff and leave comments using diffity agent commands
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Diffity Review Skill
|
|
8
|
-
|
|
9
|
-
You are reviewing a diff and leaving inline comments using the `diffity agent` CLI.
|
|
10
|
-
|
|
11
|
-
## Arguments
|
|
12
|
-
|
|
13
|
-
- `ref` (optional): Git ref to review (e.g. `main..feature`, `HEAD~3`). Defaults to working tree changes. When both `ref` and `focus` are provided, use both (e.g. `/diffity-review main..feature security`).
|
|
14
|
-
- `focus` (optional): Focus the review on a specific area. One of: `security`, `performance`, `naming`, `errors`, `types`, `logic`. If omitted, review everything.
|
|
15
|
-
|
|
16
|
-
## CLI Reference
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
diffity agent diff
|
|
20
|
-
diffity agent list [--status open|resolved|dismissed] [--json]
|
|
21
|
-
diffity agent comment --file <path> --line <n> [--end-line <n>] [--side new|old] --body "<text>"
|
|
22
|
-
diffity agent general-comment --body "<text>"
|
|
23
|
-
diffity agent resolve <id> [--summary "<text>"]
|
|
24
|
-
diffity agent dismiss <id> [--reason "<text>"]
|
|
25
|
-
diffity agent reply <id> --body "<text>"
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
- `--file`, `--line`, `--body` are required for `comment`
|
|
29
|
-
- `--end-line` defaults to `--line` (single-line comment)
|
|
30
|
-
- `--side` defaults to `new`
|
|
31
|
-
- `general-comment` creates a diff-level comment not tied to any file or line
|
|
32
|
-
- `<id>` accepts full UUID or 8-char prefix
|
|
33
|
-
|
|
34
|
-
## Prerequisites
|
|
35
|
-
|
|
36
|
-
1. Check that `diffity` is available: run `which diffity`. If not found, install it with `npm install -g diffity`.
|
|
37
|
-
|
|
38
|
-
## Instructions
|
|
39
|
-
|
|
40
|
-
### Step 1: Ensure diffity is running for the correct ref (without opening browser)
|
|
41
|
-
|
|
42
|
-
The review needs a running session whose ref matches the requested ref. A ref mismatch causes "file not in current diff" errors when adding comments.
|
|
43
|
-
|
|
44
|
-
1. Run `diffity list --json` to get all running instances. Parse the JSON output and find the entry whose `repoRoot` matches the current repo.
|
|
45
|
-
2. If a matching entry exists, compare its `ref` field against the requested ref:
|
|
46
|
-
- The registry stores `"work"` for working-tree sessions and the user-provided ref string (e.g. `"main"`, `"HEAD~3"`) for named refs.
|
|
47
|
-
- If refs **match** → reuse the session, note the port, and continue to Step 2.
|
|
48
|
-
- If refs **don't match** → restart: run `diffity <ref> --no-open --new` (or `diffity --no-open --new` if no ref). The `--new` flag kills the old session and starts a fresh one. Use Bash tool with `run_in_background: true`. Wait 2 seconds, then verify with `diffity list --json` and note the port.
|
|
49
|
-
- If **no ref was requested** and the running session's ref is not `"work"` → restart with `diffity --no-open --new` (the running session is for a named ref, but we need working-tree).
|
|
50
|
-
3. If **no session is running** for this repo, start one in the background:
|
|
51
|
-
- Command: `diffity <ref> --no-open` (or `diffity --no-open` if no ref)
|
|
52
|
-
- Use Bash tool with `run_in_background: true`
|
|
53
|
-
- Wait 2 seconds, then verify with `diffity list --json` and note the port.
|
|
54
|
-
|
|
55
|
-
### Step 2: Review the diff
|
|
56
|
-
|
|
57
|
-
1. **Get the unified diff** directly from diffity — this handles merge-base resolution, untracked files, and all ref types automatically:
|
|
58
|
-
```
|
|
59
|
-
diffity agent diff
|
|
60
|
-
```
|
|
61
|
-
This outputs the full unified diff for the current session. Line numbers are in the `@@` hunk headers.
|
|
62
|
-
2. Find and read all relevant CLAUDE.md files — the root CLAUDE.md and any CLAUDE.md files in directories containing modified files. These define project-specific rules that the diff must follow.
|
|
63
|
-
|
|
64
|
-
#### Understand the change before reviewing it
|
|
65
|
-
|
|
66
|
-
3. **Summarize the change first.** Before looking for problems, build a mental model of the diff:
|
|
67
|
-
- What is this change trying to accomplish? (new feature, bug fix, refactor, config change)
|
|
68
|
-
- Which files are structural changes vs. the core logic change?
|
|
69
|
-
- What is the author's intent? Read commit messages (`git log --oneline <args>`) and any linked issues or PR descriptions for context.
|
|
70
|
-
- What are the key decisions the author made, and what constraints were they working within?
|
|
71
|
-
|
|
72
|
-
Understanding intent helps you distinguish intentional behavior from real bugs.
|
|
73
|
-
|
|
74
|
-
4. For each changed file, read the **entire file** (not just the diff hunks) to understand the full context.
|
|
75
|
-
5. **Cross-reference callers and dependents.** For any changed function signature, renamed export, modified return type, or altered behavior: grep for usages across the codebase. A function that looks correct in isolation can break every caller. Check:
|
|
76
|
-
- Who calls this function? Will they handle the new return value / error / null case?
|
|
77
|
-
- Who imports this module? Will the changed export name resolve?
|
|
78
|
-
- Does this type change propagate correctly to consumers?
|
|
79
|
-
6. Analyze the code changes using the techniques below. If a `focus` argument was provided, concentrate on that area. Otherwise, apply all analysis passes and the signal threshold.
|
|
80
|
-
|
|
81
|
-
#### How to analyze
|
|
82
|
-
|
|
83
|
-
The diff tells you *what* changed; the surrounding code tells you whether the change is *correct*. Apply these analysis passes:
|
|
84
|
-
|
|
85
|
-
**Data flow analysis** — Trace values through the changed code. Where does each variable come from? Where does it go? Check:
|
|
86
|
-
- Can a value be null/undefined where the changed code assumes it isn't?
|
|
87
|
-
- Does the changed code handle all branches of an upstream conditional?
|
|
88
|
-
- If a function's return type changed, do all callers handle the new shape?
|
|
89
|
-
- Are there narrowing checks (e.g. `if (x)`) that the diff accidentally moved outside of?
|
|
90
|
-
|
|
91
|
-
**State and lifecycle analysis** — For stateful code (React state, database transactions, streams, event listeners):
|
|
92
|
-
- Does the change create a state that can't be reached or can't be exited?
|
|
93
|
-
- Are resources (listeners, subscriptions, file handles) still cleaned up on all paths?
|
|
94
|
-
- Can concurrent access corrupt shared state?
|
|
95
|
-
- Does the ordering of operations still satisfy invariants (e.g. init before use)?
|
|
96
|
-
|
|
97
|
-
**Contract analysis** — Check the changed code against the contracts it must satisfy:
|
|
98
|
-
- Does the function still satisfy what its callers expect? (Read the callers, don't guess.)
|
|
99
|
-
- If it implements an interface or overrides a base method, does it still conform?
|
|
100
|
-
- Are pre-conditions and post-conditions preserved?
|
|
101
|
-
- For API endpoints: does the response shape match what clients send/expect?
|
|
102
|
-
|
|
103
|
-
**Boundary analysis** — For code at system boundaries (user input, network, file I/O, IPC):
|
|
104
|
-
- Is user-controlled input validated before use?
|
|
105
|
-
- Can malformed external data crash the process or corrupt state?
|
|
106
|
-
- Are there injection vectors (SQL, shell, XSS, path traversal)?
|
|
107
|
-
|
|
108
|
-
**Edge case analysis** — Only for cases that *will* happen in practice, not theoretical ones:
|
|
109
|
-
- Empty arrays/strings, zero, negative numbers — does the code handle them?
|
|
110
|
-
- Off-by-one in loops, slices, or index arithmetic
|
|
111
|
-
- Integer overflow, division by zero where the divisor comes from input
|
|
112
|
-
|
|
113
|
-
#### What to flag
|
|
114
|
-
|
|
115
|
-
Flag real problems that would affect correctness, security, or reliability:
|
|
116
|
-
- Code that will fail to compile, parse, or run (syntax errors, type errors, missing imports, unresolved references)
|
|
117
|
-
- Logic errors that will produce wrong results (clear bugs, off-by-one errors, broken conditions)
|
|
118
|
-
- Security vulnerabilities in changed code (injection, XSS, auth bypass, data exposure)
|
|
119
|
-
- Race conditions or data loss risks you can demonstrate with a concrete scenario
|
|
120
|
-
- CLAUDE.md violations where you can quote the exact rule being broken
|
|
121
|
-
- Broken contracts — a changed function that no longer satisfies what its callers expect
|
|
122
|
-
|
|
123
|
-
Skip style concerns, linter-catchable issues, and pre-existing problems in unchanged code. Focus on the diff, not the whole file.
|
|
124
|
-
|
|
125
|
-
#### Validate before commenting
|
|
126
|
-
|
|
127
|
-
For each finding, verify it's real before posting:
|
|
128
|
-
- Re-read the surrounding code — many apparent bugs disappear in full context
|
|
129
|
-
- For "missing import" or "undefined variable" claims, grep to confirm
|
|
130
|
-
- For broken callers, read the actual call sites
|
|
131
|
-
- For CLAUDE.md violations, confirm the rule is scoped to this file
|
|
132
|
-
|
|
133
|
-
If a repeated pattern appears across files, comment on the first occurrence and mention the pattern in the general summary instead of duplicating comments.
|
|
134
|
-
|
|
135
|
-
### Step 3: Leave comments
|
|
136
|
-
|
|
137
|
-
1. Categorize each finding with a severity prefix in the comment body:
|
|
138
|
-
- `[must-fix]` — Bugs, security issues, data loss risks. Code that will break or produce wrong results.
|
|
139
|
-
- `[suggestion]` — Concrete improvements with a clear reason. Not style preferences — real improvements.
|
|
140
|
-
- `[question]` — Something unclear that needs clarification from the author.
|
|
141
|
-
|
|
142
|
-
2. For each finding, leave an inline comment using:
|
|
143
|
-
```
|
|
144
|
-
diffity agent comment --file <path> --line <n> [--end-line <n>] [--side new] --body "<comment>"
|
|
145
|
-
```
|
|
146
|
-
- Use `--side new` (default) for comments on added/modified code
|
|
147
|
-
- Use `--side old` for comments on removed code
|
|
148
|
-
- Use `--end-line` when the issue spans multiple lines
|
|
149
|
-
- **Lead with the problem**, not background. Be specific and actionable.
|
|
150
|
-
- For small, self-contained fixes, include a code suggestion showing the fix
|
|
151
|
-
- For larger fixes (structural changes, multi-location), describe the issue and suggested approach without a full code block
|
|
152
|
-
- If flagging a CLAUDE.md violation, quote the exact rule being broken
|
|
153
|
-
3. After leaving all inline comments, decide whether a general comment is needed:
|
|
154
|
-
- **No findings → leave a general comment:** "No issues found. Checked for bugs and CLAUDE.md compliance."
|
|
155
|
-
- **1-2 findings → skip the general comment** unless there's a cross-cutting concern the inline comments don't cover.
|
|
156
|
-
- **3+ findings → leave a general comment** summarizing the themes.
|
|
157
|
-
- **Do not use severity prefixes in the general comment** — prefixes are only for inline findings.
|
|
158
|
-
- Lead with the verdict, be direct and concise — no compliments, no filler, no narrating what the code does.
|
|
159
|
-
```
|
|
160
|
-
diffity agent general-comment --body "<overall review summary>"
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### Step 4: Open the browser
|
|
164
|
-
|
|
165
|
-
1. Open the browser now that comments are ready:
|
|
166
|
-
```
|
|
167
|
-
diffity open <ref>
|
|
168
|
-
```
|
|
169
|
-
Pass the ref argument if one was provided (e.g. `diffity open HEAD~3`). Omit it to open the default view.
|
|
170
|
-
2. Tell the user the review is ready and they can check the browser. Example:
|
|
171
|
-
|
|
172
|
-
> Review complete — check your browser.
|
|
173
|
-
>
|
|
174
|
-
> Found: 2 must-fix, 1 suggestion
|
|
175
|
-
>
|
|
176
|
-
> When you're ready, run **/diffity-resolve** to fix them.
|