@polygraph/claude-plugin 0.4.31 → 0.4.33
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
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<h1 align="center">Polygraph Skills</h1>
|
|
9
9
|
|
|
10
10
|
<p align="center">
|
|
11
|
-
AI agent skills and subagents for <a href="https://
|
|
11
|
+
AI agent skills and subagents for <a href="https://trypolygraph.com/">Polygraph</a> — the meta-harness for maximum agentic autonomy, giving agents visibility across every repo and memory that survives every session.
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
<p align="center">
|
|
@@ -23,7 +23,17 @@
|
|
|
23
23
|
|
|
24
24
|
## What is Polygraph?
|
|
25
25
|
|
|
26
|
-
Polygraph is a
|
|
26
|
+
Polygraph is a meta-harness for maximum agentic autonomy. It works with the agents you already use and gives them what they're missing: visibility across every repo boundary, and memory that survives every session. Agents discover how repositories relate, coordinate changes across them, and hand off or resume work later with repos, branches, PRs, and logs all preserved.
|
|
27
|
+
|
|
28
|
+
## Setup
|
|
29
|
+
|
|
30
|
+
Run the interactive setup and follow the prompts:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
polygraph config
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
It detects your AI agent — Claude Code, Codex, OpenCode, and more — and installs the Polygraph skills and subagents for it. Re-run it any time to add another agent or update an existing install.
|
|
27
37
|
|
|
28
38
|
## Skills
|
|
29
39
|
|
|
@@ -36,66 +46,6 @@ Polygraph is a standalone product for coordinating changes across multiple repos
|
|
|
36
46
|
- **polygraph-init-subagent** — Discovers candidate repositories and initializes a Polygraph session
|
|
37
47
|
- **polygraph-delegate-subagent** — Delegates work to a child agent in another repository, polls for completion
|
|
38
48
|
|
|
39
|
-
## Codex Installer
|
|
40
|
-
|
|
41
|
-
The publishable Codex package now exposes an explicit installer CLI:
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
npx @polygraph/codex-plugin
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
That command copies the packaged Codex plugin into:
|
|
48
|
-
|
|
49
|
-
```text
|
|
50
|
-
~/.agents/plugins/polygraph
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
installs the packaged custom Codex subagents into:
|
|
54
|
-
|
|
55
|
-
```text
|
|
56
|
-
$CODEX_HOME/agents
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
updates the personal Codex marketplace at:
|
|
60
|
-
|
|
61
|
-
```text
|
|
62
|
-
~/.agents/plugins/marketplace.json
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
so the `polygraph` plugin points at `./.agents/plugins/polygraph`, and enables the plugin in:
|
|
66
|
-
|
|
67
|
-
```text
|
|
68
|
-
$CODEX_HOME/config.toml
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
`CODEX_HOME` defaults to `~/.codex` when unset.
|
|
72
|
-
|
|
73
|
-
To verify an install, run:
|
|
74
|
-
|
|
75
|
-
```sh
|
|
76
|
-
npx @polygraph/codex-plugin check
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## OpenCode Plugin
|
|
80
|
-
|
|
81
|
-
The publishable OpenCode package exposes the skills and subagents through OpenCode's native plugin system. Add it to `opencode.json`:
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
{
|
|
85
|
-
"plugin": ["@polygraph/opencode-plugin"]
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
For repeatable installs, pin the npm version:
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"plugin": ["@polygraph/opencode-plugin@0.4.18"]
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The plugin adds its packaged `skills/` directory to OpenCode's skill paths and registers the packaged Markdown agents as `subagent` entries in OpenCode config during startup.
|
|
98
|
-
|
|
99
49
|
## Development
|
|
100
50
|
|
|
101
51
|
```sh
|
|
@@ -118,10 +68,8 @@ For the strictest release flow, do not allow direct `npm publish` for the truste
|
|
|
118
68
|
|
|
119
69
|
## Learn More
|
|
120
70
|
|
|
121
|
-
- **[Polygraph](https://
|
|
71
|
+
- **[Polygraph](https://trypolygraph.com/)** — The meta-harness for maximum agentic autonomy
|
|
122
72
|
- **[@polygraph/mcp](https://www.npmjs.com/package/@polygraph/mcp)** — The MCP server that powers Polygraph tools
|
|
123
|
-
- **[Nx AI Agent Skills](https://github.com/nrwl/nx-ai-agents-config)** — The main Nx AI agent skills repo
|
|
124
|
-
|
|
125
73
|
## License
|
|
126
74
|
|
|
127
75
|
License information is defined in the package metadata.
|
|
@@ -80,7 +80,8 @@ This returns:
|
|
|
80
80
|
- `name`: Repository name
|
|
81
81
|
- `repository`: Full repo name (e.g., `org/repo`)
|
|
82
82
|
- `provider`: VCS provider (e.g., `GITHUB`)
|
|
83
|
-
|
|
83
|
+
|
|
84
|
+
Candidate entries do not include repository descriptions. For natural-language discovery, pass the user's intent in `semanticQuery` so the service can apply semantic matching internally.
|
|
84
85
|
|
|
85
86
|
### Step 2: Select Relevant Repos
|
|
86
87
|
|
|
@@ -90,8 +91,8 @@ If `selectedRepoIds` or exact repo refs were provided by the main agent, use tho
|
|
|
90
91
|
|
|
91
92
|
Otherwise, analyze the candidates using the `userContext` to determine which repos are relevant:
|
|
92
93
|
|
|
93
|
-
1.
|
|
94
|
-
2. Match
|
|
94
|
+
1. Review each repo's `repository`, `name`, `provider`, and any relationship/filter metadata returned by the tool
|
|
95
|
+
2. Match those fields and any requested filters against the `userContext` to identify relevant repos
|
|
95
96
|
3. Select the repos that are relevant to the task
|
|
96
97
|
4. When uncertain, include all candidates
|
|
97
98
|
5. When the user described the task in natural language and the result is large, re-query with `semanticQuery` set to that description
|
|
@@ -140,16 +141,16 @@ Return a structured summary in this format:
|
|
|
140
141
|
|
|
141
142
|
### Repositories in this session
|
|
142
143
|
|
|
143
|
-
| Repo | Repository ID |
|
|
144
|
-
| --- | --- | --- |
|
|
145
|
-
| REPO_FULL_NAME | REPOSITORY_ID |
|
|
144
|
+
| Repo | Repository ID | Relationship |
|
|
145
|
+
| --- | --- | --- |
|
|
146
|
+
| REPO_FULL_NAME | REPOSITORY_ID | DIRECTION (distance: N) |
|
|
146
147
|
|
|
147
148
|
### All Candidates Discovered
|
|
148
149
|
(Only include this section if `list_repos` was called)
|
|
149
150
|
|
|
150
|
-
| Repo | Repository ID |
|
|
151
|
-
| --- | --- | --- |
|
|
152
|
-
| REPO_FULL_NAME | REPOSITORY_ID |
|
|
151
|
+
| Repo | Repository ID | Selected |
|
|
152
|
+
| --- | --- | --- |
|
|
153
|
+
| REPO_FULL_NAME | REPOSITORY_ID | Yes/No |
|
|
153
154
|
```
|
|
154
155
|
|
|
155
156
|
## Important Notes
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ Polygraph functionality is available via both MCP tools and CLI commands. Use wh
|
|
|
21
21
|
|
|
22
22
|
| MCP Tool | CLI Equivalent | Description |
|
|
23
23
|
| --- | --- | --- |
|
|
24
|
-
| `list_repos` | `polygraph repo list` | Discover candidate repositories. |
|
|
24
|
+
| `list_repos` | `polygraph repo list` | Discover candidate repositories. Candidate entries do not include repository descriptions; use `semanticQuery` for natural-language discovery. |
|
|
25
25
|
| `start_session` | `polygraph session start --repo <ids>` | Initialize a Polygraph session with selected repositories |
|
|
26
26
|
| `spawn_agent` | — | Start a new child task or send a follow-up to an active task in another repository. Input: `{ sessionId, repo, instruction, context? }`. Output: `{ taskId, message, status: 'delegated' }`. Follow-up routing is automatic: if the repo already has an active child task, the instruction is delivered to it as a follow-up message; otherwise a new child run starts. A repo has at most one active child at a time. A session resume or reconstruction is read-only context restoration; after resuming, do not use `spawn_agent` to continue changes unless the user explicitly asks for changes. |
|
|
27
27
|
| `show_agent` | — | Poll flat per-child status for the session. Output: `{ children: PolygraphChildStatusItem[] }` where each item exposes `repositoryId`, `repoFullName`, `status`, `lastOutputLines`, `durationMs`, `instruction`, `agentType?`, `inputRequiredQuestion?`. `status` is an AcpRunStatus: `'created' \| 'in-progress' \| 'input-required' \| 'permission-required' \| 'completed' \| 'failed' \| 'cancelled'` (British double-L on `'cancelled'`). `inputRequiredQuestion` is populated only when `status === 'input-required'`. |
|
|
@@ -299,27 +299,9 @@ push_branch(
|
|
|
299
299
|
|
|
300
300
|
### Session Description Policy
|
|
301
301
|
|
|
302
|
-
`description` is user-facing Polygraph session context.
|
|
302
|
+
`description` is user-facing Polygraph session context. It is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (`mark_pr_ready` does not take a description).
|
|
303
303
|
|
|
304
|
-
`description`
|
|
305
|
-
|
|
306
|
-
```text
|
|
307
|
-
Goal: <what the session is trying to accomplish>
|
|
308
|
-
|
|
309
|
-
Current Progress: <what has been completed so far, including PR/session state when relevant>
|
|
310
|
-
|
|
311
|
-
What Worked: <important decisions, approaches, or constraints that future agents should preserve>
|
|
312
|
-
|
|
313
|
-
Next Steps: <clear next implementation steps>
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
- Do not use a one-line feature summary for final handoff or PR creation in a multi-repo session.
|
|
317
|
-
- Keep it concise but durable for a future resumed agent.
|
|
318
|
-
- Prefer high-level state over file-by-file changelogs.
|
|
319
|
-
- Mention unresolved decisions or risks when they matter.
|
|
320
|
-
- In `Next Steps`, include only next implementation steps. Do not list routine operational steps such as pushing branches, watching CI, or marking PRs ready.
|
|
321
|
-
|
|
322
|
-
> **Tip (optional):** The Polygraph UI renders fenced ` ```mermaid ` blocks in the session description as diagrams. If a small diagram would genuinely clarify the session state — for example, cross-repo relationships or a sequence of changes — you may include one. Plain text remains the norm; diagrams are never required.
|
|
304
|
+
**Whenever you write or update a session description, read [`reference/session-description.md`](reference/session-description.md) first.** That reference file holds the full policy: the canonical Markdown-heading template (`## Goal` / `## Current progress` / `## What worked` / `## Next steps`), the dual-audience guidance (humans in the web UI now, agents reconstructing history later), and the formatting building blocks the app renders (callouts, tables, mermaid, links, `link_reference`).
|
|
323
305
|
|
|
324
306
|
### 3. Create Draft PRs
|
|
325
307
|
|
|
@@ -629,15 +611,11 @@ get_ci_logs(
|
|
|
629
611
|
|
|
630
612
|
### Update Session Description
|
|
631
613
|
|
|
632
|
-
Use this when the user asks to summarize progress, update the session description, capture the current state.
|
|
614
|
+
Use this when the user asks to summarize progress, update the session description, or capture the current state.
|
|
633
615
|
|
|
634
|
-
|
|
635
|
-
- Read the current session details.
|
|
636
|
-
- Consider the current conversation, child-agent results, PRs, pushed branches, validation, and unresolved decisions.
|
|
637
|
-
- If appending a new item, read the current/latest description first and write the full replacement description with the existing items plus the new item.
|
|
638
|
-
- If updating or replacing the existing last item, write the resulting state directly.
|
|
616
|
+
Read [`reference/session-description.md`](reference/session-description.md) for the full update procedure (what to read before writing, how to append vs. replace) and the canonical Markdown-heading format. Then call `update_session` with the resulting summary as `description`.
|
|
639
617
|
|
|
640
|
-
|
|
618
|
+
Be liberal about updating the session description when you make changes that affect the scope of the session, how logic flows between repos, or anything else important for posterity. Avoid updating it for small implementation details that are not relevant outside of this session. An up-to-date session description matters for maintainability.
|
|
641
619
|
|
|
642
620
|
### Print Polygraph Session Details
|
|
643
621
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Session Description Reference
|
|
2
|
+
|
|
3
|
+
## Session Description Policy
|
|
4
|
+
|
|
5
|
+
`description` is user-facing Polygraph session context.
|
|
6
|
+
|
|
7
|
+
`description` is required for `push_branch`, `create_pr`, and `associate_pr`, and is the primary input to `update_session` (which takes `title` and/or `description`). (`mark_pr_ready` does not take a description.) The Polygraph web app renders the description as Markdown, so use real Markdown headings — not flat `Label:` lines. Use the canonical structured format:
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
## Goal
|
|
11
|
+
|
|
12
|
+
<what the session is trying to accomplish>
|
|
13
|
+
|
|
14
|
+
## Current progress
|
|
15
|
+
|
|
16
|
+
<what has been completed so far, including PR/session state when relevant>
|
|
17
|
+
|
|
18
|
+
## What worked
|
|
19
|
+
|
|
20
|
+
<important decisions, approaches, or constraints that future agents should preserve>
|
|
21
|
+
|
|
22
|
+
## Next steps
|
|
23
|
+
|
|
24
|
+
<clear next implementation steps>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- Do not use a one-line feature summary for final handoff or PR creation in a multi-repo session.
|
|
28
|
+
- Keep it concise but durable for a future resumed agent.
|
|
29
|
+
- Prefer high-level state over file-by-file changelogs.
|
|
30
|
+
- Mention unresolved decisions or risks when they matter.
|
|
31
|
+
- In `Next steps`, include only next implementation steps. Do not list routine operational steps such as pushing branches, watching CI, or marking PRs ready.
|
|
32
|
+
|
|
33
|
+
## Dual audience: humans now, agents later
|
|
34
|
+
|
|
35
|
+
The description has two readers, and you must write for both:
|
|
36
|
+
|
|
37
|
+
1. **Humans, in the web UI** — this is the primary surface. The app renders the description as Markdown for people scanning session state.
|
|
38
|
+
2. **Agents, later** — the description is also read back by agents reconstructing session history (for example, on resume). They may not have the original working tree, branch, or local environment available.
|
|
39
|
+
|
|
40
|
+
Because of the second audience, write **durably**:
|
|
41
|
+
|
|
42
|
+
- Avoid ephemeral or local references (paths, ports, in-progress scratch state) that won't mean anything to a later reader.
|
|
43
|
+
- Don't assume the original working tree is available — describe *what* changed and *why* at a level that survives without the diff in front of you.
|
|
44
|
+
- Capture decisions and constraints, not just a snapshot of the current terminal.
|
|
45
|
+
|
|
46
|
+
## Formatting building blocks
|
|
47
|
+
|
|
48
|
+
Plain text (headings + prose + lists) remains the norm. The blocks below are available when they genuinely add clarity — reach for them only when they earn their place.
|
|
49
|
+
|
|
50
|
+
### Headings, emphasis, lists
|
|
51
|
+
|
|
52
|
+
Use the `##` headings from the canonical template. Use **bold**/*italic* for emphasis, and bullet or numbered lists for enumerations. Keep nesting shallow.
|
|
53
|
+
|
|
54
|
+
### Callouts (GitHub alert syntax)
|
|
55
|
+
|
|
56
|
+
The app maps each callout to a status color, so pick the right type:
|
|
57
|
+
|
|
58
|
+
- `> [!WARNING]` / `> [!CAUTION]` — risky migrations, destructive operations, or **required manual steps** a reader must not miss.
|
|
59
|
+
- `> [!NOTE]` / `> [!IMPORTANT]` — context, rationale, or a key constraint worth highlighting.
|
|
60
|
+
- `> [!TIP]` — an optional helpful pointer.
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
> [!WARNING]
|
|
64
|
+
> The auth migration must run before deploying the API repo, or existing sessions are invalidated.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Tables (GFM)
|
|
68
|
+
|
|
69
|
+
Use a GitHub-Flavored Markdown table only for genuinely tabular data. The polygraph UI already shows per-PR state so avoid that.
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
| Repo | Change Type |
|
|
73
|
+
| ----------- | ------------------ |
|
|
74
|
+
| org/api | api functionality |
|
|
75
|
+
| org/web | text-only |
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Mermaid diagrams
|
|
79
|
+
|
|
80
|
+
The app renders fenced ` ```mermaid ` blocks as diagrams. Use one only when it genuinely clarifies session state. Good uses:
|
|
81
|
+
|
|
82
|
+
- Control or data flow between logic pieces across repos or system components.
|
|
83
|
+
- A sequence of changes, or migration order.
|
|
84
|
+
- A state machine.
|
|
85
|
+
|
|
86
|
+
> [!IMPORTANT]
|
|
87
|
+
> Do NOT redraw the cross-repo dependency / repository graph. The app already renders the repo-relationship graph for every session, so a repo-relationship diagram in the description is redundant.
|
|
88
|
+
|
|
89
|
+
Plain text remains the norm; diagrams are optional and never required.
|
|
90
|
+
|
|
91
|
+
### Code blocks and task lists
|
|
92
|
+
|
|
93
|
+
Use fenced code blocks for commands, signatures, or short snippets. Use task lists (`- [ ]` / `- [x]`) when tracking discrete remaining work items.
|
|
94
|
+
|
|
95
|
+
### Links
|
|
96
|
+
|
|
97
|
+
- Prefer durable external URLs (e.g. GitHub PRs/issues, Linear tickets).
|
|
98
|
+
- Do NOT put local or dev links in the description: `localhost`, `127.0.0.1`, and `file://` URLs do not resolve in the UI and are useless to later readers.
|
|
99
|
+
- Do NOT put repo-relative file paths (`./foo.ts`, `../bar`) as links — they don't resolve in the UI.
|
|
100
|
+
- To attach supplementary references (PRs, issues, other Polygraph sessions, Linear tickets), use the `link_reference` tool instead of inline links. `link_reference` is **supplementary** to the description, not a replacement for it.
|
|
101
|
+
|
|
102
|
+
## Updating the session description
|
|
103
|
+
|
|
104
|
+
Before writing:
|
|
105
|
+
|
|
106
|
+
- Read the current session details.
|
|
107
|
+
- Consider the current conversation, child-agent results, PRs, pushed branches, validation, and unresolved decisions.
|
|
108
|
+
- If appending a new item, read the current/latest description first and write the full replacement description with the existing items plus the new item.
|
|
109
|
+
- If updating or replacing the existing last item, write the resulting state directly.
|
|
110
|
+
|
|
111
|
+
Write the description using the canonical structured format above. Then call `update_session` or one of the other tools like `create_pr` that take a description as input.
|