Add local agent profile examples#49
Conversation
📝 WalkthroughWalkthroughAdds a new documentation page defining a draft DevSpace agent profile schema, a README explaining example agent templates, seven example agent profile markdown files (claude-implementer, codex-worker, codex-explorer, copilot-reviewer, cursor-agent-worker, opencode-explorer, pi-reviewer) covering read-only and write-capable configurations, and a package.json update adding "examples" to the published files list. ChangesAgent Profile Schema and Examples
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/agents/pi-reviewer.md`:
- Around line 22-27: The Pi resume example is using the wrong flag for session
restoration, so update the follow-up command in pi-reviewer.md to use the
session-handling option expected by Pi. Keep the existing `pi` command structure
and `-p` placement, but change the resume-related argument from `--session-id`
to `--session` in the example that demonstrates resuming a prior session, using
the surrounding `command:` / `args:` block to locate it.
In `@package.json`:
- Line 16: The package metadata currently ships examples/ but not the schema
document referenced by examples/agents/README.md, so update the files list in
package.json to include docs/agent-profile-schema.md or move that markdown under
the shipped examples tree. Make the change in the package.json files array so
package consumers receive the schema doc alongside the examples and the link
from the README remains valid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5cffe337-4b5a-441f-8372-662af78ae94d
📒 Files selected for processing (10)
docs/agent-profile-schema.mdexamples/agents/README.mdexamples/agents/claude-implementer.mdexamples/agents/codex-explorer.mdexamples/agents/codex-worker.mdexamples/agents/copilot-reviewer.mdexamples/agents/cursor-agent-worker.mdexamples/agents/opencode-explorer.mdexamples/agents/pi-reviewer.mdpackage.json
| command: pi | ||
| args: | ||
| - -p | ||
| - --mode | ||
| - json | ||
| - "<prompt>" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
pi --helpRepository: Waishnav/devspace
Length of output: 195
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files | rg '(^|/)examples/agents/pi-reviewer\.md$|(^|/)pi-reviewer\.md$|(^|/)README\.md$|(^|/)docs/|(^|/)examples/agents/'
printf '\n--- file outline ---\n'
ast-grep outline examples/agents/pi-reviewer.md --view expanded || true
printf '\n--- relevant lines ---\n'
cat -n examples/agents/pi-reviewer.md | sed -n '1,120p'
printf '\n--- search for pi CLI usage ---\n'
rg -n --hidden --glob '!**/node_modules/**' --glob '!**/.git/**' '\bpi\b|--session-id|--mode|-p\b' .Repository: Waishnav/devspace
Length of output: 21513
🌐 Web query:
"@earendil-works/pi-coding-agent pi cli -p --mode json --session-id"
💡 Result:
The command @earendil-works/pi-coding-agent (commonly referred to as "pi") is a minimal terminal-based AI coding agent [1][2]. The specific command structure you requested, pi -p --mode json --session-id, involves a slight syntax error regarding the --session-id flag [3][4][5]. Based on official documentation, the correct flag for targeting a specific session is --session <path|id> [4][5][6]. Here is a breakdown of the valid components: 1. pi: The command to run the coding agent [2][3]. 2. -p (or --print): This flag runs the agent in non-interactive mode, where it prints the response and exits [3][4][5]. It is typically followed by your prompt string [7]. 3. --mode json: This sets the output format to stream events as JSON lines, which is useful for programmatic integration or scripts [1][3][7]. 4. --session <path|id>: This flag is used to resume or fork a specific session file or partial UUID [4][5][6]. A corrected version of your command would look like this: pi -p "your prompt here" --mode json --session For complete details on session management, JSON event structures, and other available flags, you can refer to the official documentation at pi.dev [1][8].
Citations:
- 1: https://pi.dev/
- 2: https://registry.npmjs.org/@earendil-works/pi-coding-agent
- 3: https://github.com/earendil-works/pi/blob/v0.74.1/packages/coding-agent/README.md
- 4: https://registry.npmjs.org/%40mariozechner%2Fpi-coding-agent
- 5: https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/README.md
- 6: https://github.com/badlogic/pi-mono/blob/refs/heads/main/packages/coding-agent/README.md
- 7: https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/quickstart.md
- 8: https://pi.dev/docs/latest
🌐 Web query:
"pi cli --help prompt session-id mode json"
💡 Result:
The Pi coding agent CLI does not have a direct --session-id flag for providing a session ID [1][2][3][4]. Instead, session management is handled through the --session flag, which accepts a path to a session JSONL file or a partial UUID to identify and resume a specific session [1][5][6][7]. Key details regarding your query: - Session Selection: Use --session <path|id> to target a specific session [1][3][8][7]. - JSON Mode: Enable machine-readable output by passing --mode json [1][3][9]. When running in this mode, Pi outputs events as newline-delimited JSON objects [1][9]. The first event emitted is a session header, which includes the session ID (e.g., {"type":"session", "id":"uuid",...}) [6][9][10]. - Prompting: You can pass your prompt as a positional argument [11][4][9]. If you are using --mode json, it is common to also use --print (-p) if you want to perform a one-shot task and exit immediately [1][6][3][8]. Example command usage: pi --session --mode json "Your prompt here" To manage sessions interactively, you can use the /session command within an active session to display the current session ID, file path, and other metadata [1][5][11][4]. If you require a specific session ID for external orchestration, the recommended practice is to parse the session header emitted in JSON mode or use the session management features available in the Pi SDK [6][9][10].
Citations:
- 1: https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/usage.md
- 2: Allow CLI callers to provide session ID earendil-works/pi#4874
- 3: https://github.com/badlogic/pi-mono/blob/main/packages%2Fcoding-agent%2FREADME.md
- 4: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/README.md
- 5: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/sessions.md
- 6: https://takopi.dev/reference/runners/pi/runner/
- 7: https://badlogic-pi-mono.mintlify.app/coding-agent/sessions
- 8: https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/docs/quickstart.md
- 9: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/json.md
- 10: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/session-format.md
- 11: https://pi.dev/docs/latest/usage
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- copilot-reviewer ---'
cat -n examples/agents/copilot-reviewer.md | sed -n '1,120p'
printf '\n%s\n' '--- claude-implementer ---'
cat -n examples/agents/claude-implementer.md | sed -n '1,120p'
printf '\n%s\n' '--- opencode-explorer ---'
cat -n examples/agents/opencode-explorer.md | sed -n '1,120p'
printf '\n%s\n' '--- cursor-agent-worker ---'
cat -n examples/agents/cursor-agent-worker.md | sed -n '1,120p'Repository: Waishnav/devspace
Length of output: 8038
Use --session for Pi resume, not --session-id. (examples/agents/pi-reviewer.md:33-40) -p can stay before the prompt; the followup command is the broken part, because Pi uses --session <path|id> for resuming sessions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/agents/pi-reviewer.md` around lines 22 - 27, The Pi resume example
is using the wrong flag for session restoration, so update the follow-up command
in pi-reviewer.md to use the session-handling option expected by Pi. Keep the
existing `pi` command structure and `-p` placement, but change the
resume-related argument from `--session-id` to `--session` in the example that
demonstrates resuming a prior session, using the surrounding `command:` /
`args:` block to locate it.
| "files": [ | ||
| "dist", | ||
| "docs", | ||
| "examples", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Publish the schema doc alongside the examples.
examples/agents/README.md links to docs/agent-profile-schema.md, but this files list only ships examples/. Package consumers will get a dead link unless the schema doc is also published or moved under the shipped tree.
Suggested fix
"files": [
+ "docs/agent-profile-schema.md",
"examples"
]📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "examples", | |
| "files": [ | |
| "docs/agent-profile-schema.md", | |
| "examples" | |
| ] |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 16, The package metadata currently ships examples/ but
not the schema document referenced by examples/agents/README.md, so update the
files list in package.json to include docs/agent-profile-schema.md or move that
markdown under the shipped examples tree. Make the change in the package.json
files array so package consumers receive the schema doc alongside the examples
and the link from the README remains valid.
|
Closing this PR for now per maintainer request. |
Summary
Validation
Summary by CodeRabbit