|
| 1 | +--- |
| 2 | +name: antigravity-guide |
| 3 | +description: "Environment guide for Antigravity server-side agent. High-level CLI for Forge API, Windows environment, common pitfalls. Auto-loaded by all pipeline steps." |
| 4 | +user_invocable: false |
| 5 | +--- |
| 6 | + |
| 7 | +# Antigravity Environment Guide |
| 8 | + |
| 9 | +You are running inside **Antigravity** on a **Windows** host. |
| 10 | + |
| 11 | +## Environment |
| 12 | + |
| 13 | +- **OS**: Windows (`c:\Canaran.Antigravity.Service_Sessions\<sessionId>\`) |
| 14 | +- **Repo**: Cloned into a subdirectory of your session root (not the root itself) |
| 15 | +- **Node.js**: Available |
| 16 | +- **Git**: Available |
| 17 | +- **Shell**: May NOT have Bash — use native file tools (read, write, list) |
| 18 | + |
| 19 | +## Forge API — Use the CLI |
| 20 | + |
| 21 | +**DO NOT use curl.** Use the high-level CLI instead: |
| 22 | + |
| 23 | +``` |
| 24 | +node forge-api.mjs get-issue <documentId> |
| 25 | +node forge-api.mjs update-issue <documentId> --status=confirmed --category=bug |
| 26 | +node forge-api.mjs update-issue <documentId> --plan=@plan.md --status=approved |
| 27 | +node forge-api.mjs update-issue <documentId> --data-file=payload.json |
| 28 | +node forge-api.mjs search-issues "keyword1 keyword2" --exclude=<documentId> --limit=10 |
| 29 | +node forge-api.mjs list-comments <issueDocumentId> --limit=5 |
| 30 | +node forge-api.mjs create-comment <issueDocumentId> --body=@file.md --author=Snorlax |
| 31 | +node forge-api.mjs create-comment <issueDocumentId> --body=@file.md --author=Snorlax --attachments=42,43 |
| 32 | +node forge-api.mjs upload <filepath> |
| 33 | +``` |
| 34 | + |
| 35 | +### Flags |
| 36 | + |
| 37 | +- `--status=`, `--category=`, `--priority=`, `--complexity=` — simple string values, safe inline |
| 38 | +- `--plan=@plan.md`, `--body=@file.md` — read value from file (for long text) |
| 39 | +- `--relations=@relations.json` — read JSON from file |
| 40 | +- `--data-file=payload.json` — read entire update body from JSON file |
| 41 | +- `--attachments=42,43,44` — comma-separated media IDs (from upload command) |
| 42 | + |
| 43 | +### Complex values: always use file-based payloads |
| 44 | + |
| 45 | +For any value containing JSON (relations, sessionContext, arrays, objects), write to a file first and reference it. |
| 46 | + |
| 47 | +**Updating an issue with complex fields:** |
| 48 | +1. Write JSON file: `{ "status": "confirmed", "relations": [...] }` |
| 49 | +2. Pass via `--data-file`: `node forge-api.mjs update-issue <documentId> --data-file=payload.json` |
| 50 | + |
| 51 | +**Creating a comment with long body:** |
| 52 | +1. Write body to `.md` file |
| 53 | +2. `node forge-api.mjs create-comment <issueDocId> --body=@comment.md --author=Snorlax` |
| 54 | + |
| 55 | +### Uploading Files (Screenshots) |
| 56 | + |
| 57 | +``` |
| 58 | +node forge-api.mjs upload screenshot.png |
| 59 | +``` |
| 60 | +Response: `{ "data": { "id": 42, "url": "...", "name": "screenshot.png" } }` |
| 61 | + |
| 62 | +## File Operations |
| 63 | + |
| 64 | +Use native tools, not Unix commands: |
| 65 | +- **Read file**: file read tool (not `cat`) |
| 66 | +- **List directory**: directory listing tool (not `ls`) |
| 67 | +- **Write file**: file write tool (not `echo >`) |
| 68 | + |
| 69 | +## Common Errors |
| 70 | + |
| 71 | +1. **JSON parse error** → write data to a file first, use `--data-file=` or `--field=@file.json` |
| 72 | +2. **"Bash not available"** → use native tools + `node forge-api.mjs` |
| 73 | +3. **API errors** → never use curl, always use the CLI |
| 74 | +4. **"command not found: cat/ls"** → use `type`/`dir` or native tools |
| 75 | +5. **Git fails** → `cd` into repo dir first (not session root), then `git fetch && git pull` |
0 commit comments