You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/runtime.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,6 +180,20 @@ forge serve logs
180
180
181
181
The daemon forks `forge run` in the background with `setsid`, writes state to `.forge/serve.json`, and redirects output to `.forge/serve.log`. Passphrase prompting for encrypted secrets happens in the parent process (which has TTY access) before forking.
182
182
183
+
## File Output Directory
184
+
185
+
The runtime configures a `FilesDir` for tool-generated files (e.g., from `file_create`). This directory defaults to `<WorkDir>/.forge/files/` and is injected into the execution context so tools can write files that other tools can reference by path.
The `FilesDir` is set via `LLMExecutorConfig.FilesDir` and made available to tools through `runtime.FilesDirFromContext(ctx)`. See [Tools — File Create](tools.md#file-create) for details.
196
+
183
197
## Conversation Memory
184
198
185
199
For details on session persistence, context window management, compaction, and long-term memory, see [Memory](memory.md).
|`code-review-github`| developer | Post code review results to GitHub PRs | — (binary-backed) |
156
-
|`codegen-react`| developer | Scaffold and iterate on Vite + React apps |`codegen-react-scaffold.sh`, `codegen-react-read.sh`, `codegen-react-write.sh`, `codegen-react-run.sh`|
The `k8s-pod-rightsizer` skill analyzes real workload metrics (Prometheus or metrics-server fallback) and produces policy-constrained CPU/memory rightsizing recommendations:
243
+
244
+
```bash
245
+
forge skills add k8s-pod-rightsizer
246
+
```
247
+
248
+
This skill operates in three modes:
249
+
250
+
| Mode | Purpose | Mutates Cluster |
251
+
|------|---------|-----------------|
252
+
|`dry-run`| Report recommendations only (default) | No |
253
+
|`plan`| Generate strategic merge patch YAMLs | No |
**Apply workflow:** The skill's built-in `mode=apply` handles rollback bundles, strategic merge patches via `kubectl patch`, and rollout verification. Do not manually run `kubectl apply -f` — use `mode=apply` with `i_accept_risk: true` instead.
| 6 | **Environment isolation** | Only `PATH`, `HOME`, `LANG`, explicit passthrough vars, proxy vars, and `OPENAI_ORG_ID` (when set) |
81
82
| 7 | **Output limits** | Configurable max output size (default: 1MB) to prevent memory exhaustion |
82
83
84
+
## File Create
85
+
86
+
The `file_create` tool generates downloadable files that are both written to disk and uploaded to the user's channel (Slack/Telegram).
87
+
88
+
| Field | Description |
89
+
|-------|-------------|
90
+
| `filename` | Name with extension (e.g., `patches.yaml`, `report.json`) |
91
+
| `content` | Full file content as text |
92
+
93
+
**Output JSON** includes `filename`, `content`, `mime_type`, and `path`. The `path` field contains the absolute disk location, allowing other tools (e.g., `kubectl apply -f <path>`) to reference the file.
94
+
95
+
**File location:** Files are written to the agent's `.forge/files/` directory (under `WorkDir`). The runtime injects this path via `FilesDir` in the executor context. When running outside the full runtime (e.g., tests), falls back to `$TMPDIR/forge-files/`.
96
+
97
+
**Allowed extensions:**
98
+
99
+
| Extension | MIME Type |
100
+
|-----------|-----------|
101
+
| `.md` | `text/markdown` |
102
+
| `.json` | `application/json` |
103
+
| `.yaml`, `.yml` | `text/yaml` |
104
+
| `.txt`, `.log` | `text/plain` |
105
+
| `.csv` | `text/csv` |
106
+
| `.sh` | `text/x-shellscript` |
107
+
| `.xml` | `text/xml` |
108
+
| `.html` | `text/html` |
109
+
| `.py` | `text/x-python` |
110
+
| `.ts` | `text/typescript` |
111
+
112
+
Filenames with path separators (`/`, `\`) or traversal patterns (`..`) are rejected.
113
+
83
114
## Memory Tools
84
115
85
116
When [long-term memory](memory.md) is enabled, two additional tools are registered:
0 commit comments