Skip to content

Commit a089f2c

Browse files
committed
docs: document pi-assistant prompt file management
Add a Pi Assistant section to both AGENTS.md and CONTRIBUTING.md explaining: - the prompt lives in .github/prompts/pi-assistant.md, not in the YAML - the {{dot.notation.path}} placeholder syntax (context.* and env.*) - when an explicit env: entry is needed vs available automatically - how to add new placeholders if required
1 parent 44971af commit a089f2c

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,36 @@ Several services are singletons (e.g., `OAuthAuthManager`, `CooldownManager`, `D
145145

146146
---
147147

148+
## Pi Assistant (AI Agent Workflow)
149+
150+
The `/pi` trigger in issue and PR comments is handled by `.github/workflows/pi-assistant.yml`,
151+
which invokes `mcowger/pi-coding-agent-action`.
152+
153+
### Prompt file
154+
155+
The agent's system prompt lives at **`.github/prompts/pi-assistant.md`** — edit that file
156+
to change what the agent is instructed to do. Do not put prompt text inside the workflow YAML.
157+
158+
The prompt file supports `{{dot.notation.path}}` placeholders resolved at runtime against
159+
two namespaces:
160+
161+
| Namespace | Contents | Example |
162+
|-----------|----------|---------|
163+
| `context.*` | The full `@actions/github` context — event payload, actor, SHA, ref, repo, etc. | `{{context.payload.comment.body}}` |
164+
| `env.*` | All environment variables, including `GITHUB_*` / `RUNNER_*` runner vars and any values passed via the step's `env:` block | `{{env.INITIAL_COMMENT_ID}}` |
165+
166+
Most GitHub context data is available automatically via `context.*`. The only value
167+
currently passed explicitly via `env:` is `INITIAL_COMMENT_ID`, because it is derived
168+
from a previous workflow step output and is not part of the event payload.
169+
170+
### Workflow env: block
171+
172+
If a new placeholder is needed that cannot be sourced from `context.*`, add it to the
173+
`env:` block on the **Run Pi agent** step in `pi-assistant.yml` and reference it as
174+
`{{env.YOUR_VAR_NAME}}` in the prompt file. Do not add it to any other step.
175+
176+
---
177+
148178
## Frontend
149179

150180
### Tailwind CSS v4

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ The project uses separate Drizzle ORM config files for each database dialect:
4949

5050
When running Drizzle Kit commands, specify the appropriate config file with `--config`.
5151

52+
## Pi Assistant Prompt
53+
54+
The system prompt for the `/pi` AI agent lives at **`.github/prompts/pi-assistant.md`**.
55+
Edit that file directly — do not put prompt text inside the workflow YAML.
56+
57+
The file supports `{{dot.notation.path}}` placeholders that are substituted at runtime:
58+
59+
- `{{context.payload.comment.body}}` — the triggering comment's text
60+
- `{{context.payload.issue.number}}` — issue/PR number
61+
- `{{context.actor}}` — the GitHub actor who triggered the run
62+
- `{{env.GITHUB_SHA}}` — any `GITHUB_*` / `RUNNER_*` runner environment variable
63+
- `{{env.INITIAL_COMMENT_ID}}` — a value passed explicitly via the step's `env:` block
64+
65+
Anything reachable from the [`@actions/github` context object](https://github.com/actions/toolkit/tree/main/packages/github)
66+
is available under `context.*` without any extra wiring. Values that come from
67+
previous step outputs (like `INITIAL_COMMENT_ID`) must be added to the `env:` block
68+
on the **Run Pi agent** step in `.github/workflows/pi-assistant.yml`.
69+
5270
## Code Style
5371

5472
All code must be formatted with Biome before committing:

0 commit comments

Comments
 (0)