@fitlab-ai/agent-infra 0.7.2 → 0.7.4

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.
Files changed (126) hide show
  1. package/README.md +35 -787
  2. package/README.zh-CN.md +37 -762
  3. package/bin/cli.ts +1 -1
  4. package/dist/bin/cli.js +1 -1
  5. package/dist/lib/defaults.json +0 -1
  6. package/dist/lib/init.js +0 -3
  7. package/dist/lib/sandbox/commands/create.js +44 -3
  8. package/dist/lib/sandbox/commands/enter.js +13 -15
  9. package/dist/lib/sandbox/commands/list-running.js +36 -1
  10. package/dist/lib/sandbox/commands/ls.js +9 -4
  11. package/dist/lib/sandbox/commands/rm.js +99 -19
  12. package/dist/lib/sandbox/commands/start.js +36 -0
  13. package/dist/lib/sandbox/index.js +11 -1
  14. package/dist/lib/sandbox/readme-scaffold.js +6 -6
  15. package/dist/lib/table.js +11 -2
  16. package/dist/lib/task/artifacts.js +58 -0
  17. package/dist/lib/task/commands/cat.js +38 -0
  18. package/dist/lib/task/commands/files.js +47 -0
  19. package/dist/lib/task/commands/grep.js +143 -0
  20. package/dist/lib/task/commands/log.js +75 -0
  21. package/dist/lib/task/commands/ls.js +1 -1
  22. package/dist/lib/task/commands/show.js +5 -114
  23. package/dist/lib/task/commands/status.js +239 -0
  24. package/dist/lib/task/index.js +37 -0
  25. package/dist/lib/task/resolve-ref.js +150 -0
  26. package/dist/lib/task/short-id.js +10 -0
  27. package/dist/lib/update.js +25 -8
  28. package/lib/defaults.json +0 -1
  29. package/lib/init.ts +0 -10
  30. package/lib/sandbox/commands/create.ts +47 -4
  31. package/lib/sandbox/commands/enter.ts +33 -14
  32. package/lib/sandbox/commands/list-running.ts +43 -1
  33. package/lib/sandbox/commands/ls.ts +12 -4
  34. package/lib/sandbox/commands/rm.ts +128 -19
  35. package/lib/sandbox/commands/start.ts +61 -0
  36. package/lib/sandbox/index.ts +11 -1
  37. package/lib/sandbox/readme-scaffold.ts +6 -6
  38. package/lib/table.ts +14 -2
  39. package/lib/task/artifacts.ts +72 -0
  40. package/lib/task/commands/cat.ts +39 -0
  41. package/lib/task/commands/files.ts +53 -0
  42. package/lib/task/commands/grep.ts +147 -0
  43. package/lib/task/commands/log.ts +80 -0
  44. package/lib/task/commands/ls.ts +1 -1
  45. package/lib/task/commands/show.ts +5 -117
  46. package/lib/task/commands/status.ts +302 -0
  47. package/lib/task/index.ts +37 -0
  48. package/lib/task/resolve-ref.ts +160 -0
  49. package/lib/task/short-id.ts +10 -0
  50. package/lib/update.ts +28 -10
  51. package/package.json +1 -1
  52. package/templates/.agents/README.en.md +1 -0
  53. package/templates/.agents/README.zh-CN.md +1 -0
  54. package/templates/.agents/hooks/auto-resume.sh +21 -4
  55. package/templates/.agents/rules/README.en.md +41 -0
  56. package/templates/.agents/rules/README.zh-CN.md +40 -0
  57. package/templates/.agents/rules/debugging-guide.en.md +25 -0
  58. package/templates/.agents/rules/debugging-guide.zh-CN.md +25 -0
  59. package/templates/.agents/rules/next-step-output.en.md +6 -3
  60. package/templates/.agents/rules/next-step-output.zh-CN.md +6 -3
  61. package/templates/.agents/rules/pr-checks-commands.en.md +5 -0
  62. package/templates/.agents/rules/pr-checks-commands.github.en.md +62 -0
  63. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +62 -0
  64. package/templates/.agents/rules/pr-checks-commands.zh-CN.md +5 -0
  65. package/templates/.agents/rules/pr-sync.github.en.md +7 -0
  66. package/templates/.agents/rules/pr-sync.github.zh-CN.md +7 -0
  67. package/templates/.agents/skills/analyze-task/SKILL.en.md +1 -1
  68. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +1 -1
  69. package/templates/.agents/skills/block-task/SKILL.en.md +8 -1
  70. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +8 -1
  71. package/templates/.agents/skills/cancel-task/SKILL.en.md +8 -1
  72. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +8 -1
  73. package/templates/.agents/skills/check-task/SKILL.en.md +1 -1
  74. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -1
  75. package/templates/.agents/skills/close-codescan/SKILL.en.md +8 -1
  76. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +8 -1
  77. package/templates/.agents/skills/close-dependabot/SKILL.en.md +8 -1
  78. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +8 -1
  79. package/templates/.agents/skills/code-task/SKILL.en.md +3 -1
  80. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -1
  81. package/templates/.agents/skills/commit/SKILL.en.md +2 -3
  82. package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -3
  83. package/templates/.agents/skills/commit/reference/task-status-update.en.md +31 -23
  84. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +31 -23
  85. package/templates/.agents/skills/complete-task/SKILL.en.md +36 -3
  86. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +36 -3
  87. package/templates/.agents/skills/create-pr/SKILL.en.md +16 -7
  88. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +16 -7
  89. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -0
  90. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -0
  91. package/templates/.agents/skills/create-task/SKILL.en.md +1 -1
  92. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +1 -1
  93. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  94. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  95. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  96. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  97. package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
  98. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
  99. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
  100. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
  101. package/templates/.agents/skills/review-analysis/SKILL.en.md +1 -1
  102. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +1 -1
  103. package/templates/.agents/skills/review-code/SKILL.en.md +1 -1
  104. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +1 -1
  105. package/templates/.agents/skills/review-plan/SKILL.en.md +1 -1
  106. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +1 -1
  107. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +0 -1
  108. package/templates/.agents/skills/watch-pr/SKILL.en.md +131 -0
  109. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +131 -0
  110. package/templates/.agents/skills/watch-pr/config/verify.json +22 -0
  111. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +43 -0
  112. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +43 -0
  113. package/templates/.agents/templates/task.en.md +1 -0
  114. package/templates/.agents/templates/task.zh-CN.md +1 -0
  115. package/templates/.agents/workflows/bug-fix.en.yaml +6 -4
  116. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +5 -4
  117. package/templates/.agents/workflows/feature-development.en.yaml +6 -4
  118. package/templates/.agents/workflows/feature-development.zh-CN.yaml +5 -4
  119. package/templates/.agents/workflows/refactoring.en.yaml +6 -4
  120. package/templates/.agents/workflows/refactoring.zh-CN.yaml +5 -4
  121. package/templates/.claude/commands/watch-pr.en.md +8 -0
  122. package/templates/.claude/commands/watch-pr.zh-CN.md +8 -0
  123. package/templates/.gemini/commands/_project_/watch-pr.en.toml +8 -0
  124. package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +8 -0
  125. package/templates/.opencode/commands/watch-pr.en.md +11 -0
  126. package/templates/.opencode/commands/watch-pr.zh-CN.md +11 -0
package/README.md CHANGED
@@ -26,20 +26,14 @@
26
26
  <strong>English</strong> · <a href="./README.zh-CN.md">中文</a>
27
27
  </p>
28
28
 
29
- <a id="why-agent-infra"></a>
30
-
31
29
  ## Why agent-infra?
32
30
 
33
31
  Teams increasingly mix Claude Code, Codex, Gemini CLI, OpenCode, and other AI TUIs in the same repository, but each tool tends to introduce its own commands, prompts, and local conventions. Without a shared layer, the result is fragmented workflows, duplicated setup, and task history that is difficult to audit.
34
32
 
35
33
  agent-infra standardizes that shared infrastructure. It gives every supported AI TUI the same task lifecycle, the same skill vocabulary, the same project governance files, isolated development sandboxes, and the same upgrade path, so teams can switch tools without rebuilding process from scratch.
36
34
 
37
- <a id="see-it-in-action"></a>
38
-
39
35
  ## See it in Action
40
36
 
41
- ### Install & Initialize
42
-
43
37
  <p align="center">
44
38
  <img src="./assets/demo-init.gif" alt="CLI install and initialize demo" width="100%" style="max-width: 720px;">
45
39
  </p>
@@ -55,35 +49,13 @@ Once initialized, open the project in your AI TUI and install the latest skills:
55
49
  **Scenario**: Issue #42 reports *"Login API returns 500 when email contains a plus sign"*. Here is the full fix lifecycle — AI does the heavy lifting, you stay in control:
56
50
 
57
51
  ```bash
58
- /import-issue 42
59
- ```
60
-
61
- > AI reads the issue, creates `TASK-20260319-100000`, and extracts requirements.
62
-
63
- ```bash
64
- /analyze-task TASK-20260319-100000
65
- ```
66
-
67
- > AI scans the codebase, identifies `src/auth/login.ts` as the root cause, and writes `analysis.md`.
68
-
69
- ```bash
70
- /review-analysis TASK-20260319-100000
71
- ```
72
-
73
- > AI self-reviews the analysis: *"Approved. 0 blockers, 0 major, 0 minor — scope and root cause are clear, proceed to design."*
74
-
75
- ```bash
76
- /plan-task TASK-20260319-100000
52
+ /import-issue 42 # AI reads the issue, creates a task, extracts requirements
53
+ /analyze-task <task-id> # AI scans the codebase, finds the root cause, writes analysis.md
54
+ /review-analysis <task-id> # AI self-reviews: "Approved. 0 blockers — proceed to design."
55
+ /plan-task <task-id> # AI proposes a fix plan
56
+ /review-plan <task-id> # AI self-reviews the plan: "Approved. Ready for implementation."
77
57
  ```
78
58
 
79
- > AI proposes a fix plan: *"Sanitize the email input in `LoginService.validate()` and add a dedicated unit test."*
80
-
81
- ```bash
82
- /review-plan TASK-20260319-100000
83
- ```
84
-
85
- > AI self-reviews the plan: *"Approved with no findings. Ready for implementation."*
86
- >
87
59
  > **You review the plan and reply in natural language:**
88
60
 
89
61
  ```
@@ -94,46 +66,17 @@ Just fix it at the application layer in LoginService.
94
66
  > AI re-runs `/plan-task` to update the plan accordingly and confirms.
95
67
 
96
68
  ```bash
97
- /code-task TASK-20260319-100000
98
- ```
99
-
100
- > AI writes the fix, adds a test case for `user+tag@example.com`, and runs all tests — green.
101
-
102
- ```bash
103
- /review-code TASK-20260319-100000
104
- ```
105
-
106
- > AI reviews its own code: *"Approved. 0 blockers, 0 major, 1 minor (missing JSDoc)."*
107
-
108
- ```bash
109
- /code-task TASK-20260319-100000
110
- ```
111
-
112
- > AI fixes the minor issue and re-validates.
113
-
114
- ```bash
69
+ /code-task <task-id> # AI writes the fix, adds a test for user+tag@example.com — green
70
+ /review-code <task-id> # AI reviews its own code: "0 blockers, 1 minor (missing JSDoc)."
71
+ /code-task <task-id> # AI fixes the minor issue and re-validates
115
72
  /commit
116
- /create-pr TASK-20260319-100000
117
- /complete-task TASK-20260319-100000
73
+ /create-pr <task-id> # PR opened, auto-linked to issue #42
74
+ /complete-task <task-id> # task archived
118
75
  ```
119
76
 
120
- > Commit created, PR #43 opened (auto-linked to issue #42), task archived.
121
-
122
77
  **11 commands. 1 natural-language correction. From issue to merged PR.** That is the entire SOP — programming can have a standard operating procedure too.
123
78
 
124
- Every command above works the same way in Claude Code, Codex, Gemini CLI, and OpenCode. Switch tools mid-task — the workflow state follows.
125
-
126
- ### What each skill does behind the scenes
127
-
128
- These are not thin command aliases. Each skill encapsulates standardized processes that are tedious and error-prone when done by hand:
129
-
130
- - **Structured artifacts** — every step produces a templated document (`analysis.md`, `review-analysis.md`, `plan.md`, `review-plan.md`, `code.md`, `review-code.md`) with consistent structure, not free-form notes
131
- - **Multi-round versioning** — requirements changed? Run `analyze-task` again to get `analysis-r2.md`; the full revision history is preserved
132
- - **Severity-classified reviews** — `review-code` categorizes findings into Blocker / Major / Minor with file paths and fix suggestions, not a vague "looks good"
133
- - **Cross-tool state continuity** — `task.md` records who did what and when; Claude can analyze, Codex can implement, Gemini can review — context transfers seamlessly
134
- - **Audit trail and co-authorship** — every step appends to the Activity Log; the final commit includes `Co-Authored-By` lines for all participating AI agents
135
-
136
- <a id="key-features"></a>
79
+ Every command above works the same way in Claude Code, Codex, Gemini CLI, and OpenCode. Switch tools mid-task — the workflow state follows. For what each skill does under the hood, see [Built-in AI Skills](./docs/en/skills.md).
137
80
 
138
81
  ## Key Features
139
82
 
@@ -143,8 +86,6 @@ These are not thin command aliases. Each skill encapsulates standardized process
143
86
  - **Template-source architecture**: `templates/` mirrors the rendered project structure
144
87
  - **AI-assisted updates**: template changes can be merged while preserving project-specific customization
145
88
 
146
- <a id="quick-start"></a>
147
-
148
89
  ## Quick Start
149
90
 
150
91
  ### 1. Install agent-infra
@@ -165,6 +106,9 @@ curl -fsSL https://raw.githubusercontent.com/fitlab-ai/agent-infra/main/install.
165
106
  **Option C - Homebrew (macOS)**
166
107
 
167
108
  ```bash
109
+ # Newer Homebrew refuses to load formulae from third-party taps until trusted,
110
+ # which silently blocks upgrades. Trust the tap once before installing.
111
+ brew trust fitlab-ai/tap
168
112
  brew install fitlab-ai/tap/agent-infra
169
113
  ```
170
114
 
@@ -208,300 +152,19 @@ Open the project in any AI TUI and run `update-agent-infra`:
208
152
 
209
153
  This detects the packaged template version and renders all managed files. The same command is used both for first-time setup and for future template upgrades.
210
154
 
211
- ### Sandbox aliases and GitHub CLI
212
-
213
- `ai sandbox create` now bootstraps the host-side aliases file at `~/.agent-infra/aliases/sandbox.sh` on first run. The generated file includes ready-to-edit yolo shortcuts for Claude, Codex, Gemini CLI, and OpenCode, and every sandbox syncs that file into `/home/devuser/.bash_aliases`.
214
-
215
- The sandbox image also preinstalls `gh`. When `gh auth token` succeeds on the host, `ai sandbox create` injects the token into the container as `GH_TOKEN`, so `gh` commands work inside the sandbox without extra setup.
216
-
217
- `ai sandbox rebuild` keeps Docker's build cache by default, so it quickly retags the sandbox image without refreshing every package. Use `ai sandbox rebuild --refresh` when you want to upgrade the image: it passes `--no-cache --pull` to Docker, pulls the current Ubuntu base image, and reruns the apt, tmux build, and global npm install layers. Claude Code updates are disabled inside the container, and OpenCode startup update checks are disabled; `--refresh` is the routine upgrade path for sandbox-managed tools. Manual `opencode upgrade` remains outside this guard. The default `python3` provided by the Ubuntu 24.04 sandbox base is Python 3.12, so scripts that hard-code Python 3.10 paths may need adjustment.
218
-
219
- `ai sandbox exec` also forwards a small terminal-detection whitelist (`TERM_PROGRAM`, `TERM_PROGRAM_VERSION`, `LC_TERMINAL`, `LC_TERMINAL_VERSION`) into the container. This keeps interactive TUIs aligned with the host terminal for behaviors such as Claude Code's Shift+Enter newline support, without passing through the full host environment.
220
-
221
- On macOS, interactive `ai sandbox exec <branch>` sessions can bridge image paste into the sandbox. When you press `Ctrl+V` and the host clipboard currently holds an image, agent-infra reads the image from the host clipboard, writes a PNG under `~/.agent-infra/clipboard/`, and injects the container path as bracketed paste so Claude Code, Codex, Gemini CLI, and OpenCode can attach it. The host clipboard is only read, never rewritten. The bridge is best-effort: existing sandboxes must be rebuilt to receive the `/clipboard` mount, and if the optional pty dependency or clipboard probe is unavailable the session falls back to the normal interactive path. Set `AI_SANDBOX_NO_CLIPBOARD_BRIDGE=1` to skip the bridge and enter the normal interactive path directly when diagnosing mouse, scrolling, or other input issues.
222
-
223
- When you run the sandbox from a remote Mac over SSH, use `ai cp <ssh-alias>` on the Mac in front of you to push the local clipboard image to that remote Mac first. Copy an image with Cmd+C, run `ai cp mini`, then return to the existing SSH session and press `Ctrl+V`; the sandbox bridge reads the remote Mac's NSPasteboard and injects the image as usual. This command handles PNG images only and uses non-interactive ssh/scp with key-based authentication. For now both the sender and the remote must be macOS—the remote NSPasteboard is written via `osascript`—but the remote-write step is the natural extension point for other platforms later.
224
-
225
- `ai sandbox exec` and `ai sandbox refresh` reconcile Claude Code credentials in both directions across the host credential store and every sandbox project copy under `~/.agent-infra/credentials/*`. When a long-running sandbox refreshes OAuth tokens first, the next entry or refresh command writes the freshest valid copy back to the host Keychain or `~/.claude/.credentials.json`; when the host is fresher, it updates the project copies. If every copy is stale, `ai sandbox refresh` probes `claude /status` and asks you to log in only when the probe cannot recover credentials.
226
-
227
- ### Host-sandbox file exchange
228
-
229
- `ai sandbox create` mounts two writable directories for dropping files between
230
- the host and the sandbox without polluting the git worktree:
231
-
232
- - `/share/common` <- `~/.agent-infra/share/<project>/common/` - visible to every
233
- sandbox of the same project, regardless of branch.
234
- - `/share/branch` <- `~/.agent-infra/share/<project>/branches/<branch>/` -
235
- exclusive to the current branch sandbox.
236
- - `/clipboard` <- `~/.agent-infra/clipboard/` - read-only image paste bridge
237
- storage on macOS.
238
-
239
- These paths are intentionally hardcoded; there is no `.airc.json` knob. Both
240
- host directories are created automatically on first `create`. When you
241
- `ai sandbox rm <branch>` or `ai sandbox rm --all`, you will be prompted (default
242
- yes) to clean up the corresponding share dirs alongside the worktrees.
243
- Use `ai sandbox prune --dry-run` to inspect orphaned per-branch state dirs left
244
- behind by older versions or interrupted cleanup, then `ai sandbox prune` to
245
- remove only dirs without an active sandbox container.
246
- Existing sandboxes pick up these mounts after `ai sandbox rm <branch>` and
247
- `ai sandbox create <branch>`.
248
-
249
- On first `ai sandbox create`, agent-infra writes a bilingual `README.md` into
250
- `~/.agent-infra/share/<project>/common/` and each `branches/<branch>/`
251
- directory to help you discover these channels. The READMEs are idempotent and
252
- can be safely deleted; the scaffold only writes them when missing.
253
-
254
- ### User-level dotfiles channel
255
-
256
- `ai sandbox create` also mounts an optional read-only channel for host user preferences:
257
-
258
- - `/dotfiles` <- `~/.agent-infra/dotfiles/` - read-only, host-owned source.
259
-
260
- The host tree mirrors the expected paths under the container `$HOME`, in the
261
- same style as GNU stow or chezmoi:
262
-
263
- ```text
264
- ~/.agent-infra/dotfiles/
265
- ├── .tmux.conf
266
- └── .config/
267
- ├── lazygit/config.yml
268
- └── yazi/yazi.toml
269
- ```
270
-
271
- On each sandbox entry, `sandbox-dotfiles-link` links every file to
272
- `$HOME/<relative-path>` with `ln -sfn`, overriding image defaults. If the host
273
- directory does not exist, the mount and link step are skipped.
274
-
275
- To add future preferences such as `starship.toml` or `.gitconfig.local`, put
276
- files in `~/.agent-infra/dotfiles/`; no Dockerfile or `ai sandbox create`
277
- changes are needed.
155
+ ## Core Commands
278
156
 
279
- #### Symlinks as pointers to host files
157
+ The most-used lifecycle commands, in delivery order. The command prefix varies by TUI (`/skill` in Claude Code/OpenCode, `$skill` in Codex, `/{{project}}:skill` in Gemini CLI); the workflow semantics stay the same.
280
158
 
281
- You can place symlinks inside `~/.agent-infra/dotfiles/` to point at real files
282
- on your host:
283
-
284
- ```bash
285
- ln -s ~/.tmux.conf ~/.agent-infra/dotfiles/.tmux.conf
286
- ln -s ~/.config/lazygit ~/.agent-infra/dotfiles/.config/lazygit
287
- ```
288
-
289
- Before each `ai sandbox create` and `ai sandbox enter`, agent-infra
290
- dereferences the dotfiles tree into
291
- `~/.agent-infra/.cache/dotfiles-resolved/<project>/` and mounts that snapshot
292
- into the container. Editing the host source file, then re-entering the sandbox,
293
- is enough to pick up the latest content.
294
-
295
- Dangling symlinks are skipped with a stderr warning. Symlink cycles and deeply
296
- nested directories beyond 32 levels are also skipped with a warning. Symlinks
297
- pointing outside `$HOME` are accepted as long as the host user can read the
298
- target.
299
-
300
- > **Do not put secrets in `~/.agent-infra/dotfiles/`.** The mount is read-only
301
- > inside the container, but the full preference tree is linked into every
302
- > project sandbox. Do not place `.ssh/`, `.aws/credentials`, `.netrc`,
303
- > `.gnupg/`, `.npmrc` files containing `_authToken`, AI tool OAuth/access token
304
- > files, or `.gitconfig` there. Use the dedicated SSH and credential channels,
305
- > and prefer `.gitconfig.local` with `[include]` for local Git preferences.
306
-
307
- **Protected paths** are ignored by the hook even if they appear under
308
- `~/.agent-infra/dotfiles/`:
309
-
310
- | Path pattern | Reason |
311
- |---|---|
312
- | `.ssh/*` | Host SSH credentials are managed by the read-only SSH mount. |
313
- | `.gnupg/*` | GPG private material is managed by `gpg-agent`. |
314
- | `.claude/*`, `.codex/*`, `.gemini/*` | AI tool credentials use dedicated bind mounts. |
315
- | `.config/opencode/*`, `.local/share/opencode/*` | OpenCode credentials and data use dedicated bind mounts. |
316
- | `.host-shell-config/*` | agent-infra managed shell and Git configuration. |
317
- | `.gitconfig`, `.gitignore_global`, `.stCommitMsg`, `.bash_aliases` | agent-infra symlinks these to `.host-shell-config/`, including `safe.directory` and GPG sync state. |
318
- | `README.md` | agent-infra scaffolds a discoverability README at the dotfiles root on first create; the link hook ignores it so `$HOME/README.md` is not shadowed. |
319
-
320
- Other existing real directories, such as `~/.config/` or `~/.cache/`, are not
321
- replaced by top-level dotfiles. If a file conflicts with one of those
322
- directories, the hook prints a warning and skips it:
323
-
324
- ```text
325
- sandbox-dotfiles-link: skipping /home/devuser/.config (existing directory; use nested path like .config/<file> instead)
326
- ```
327
-
328
- Use nested paths such as `~/.agent-infra/dotfiles/.config/lazygit/config.yml`
329
- instead of treating `.config` as a top-level file.
330
-
331
- <a id="architecture-overview"></a>
332
-
333
- ## Architecture Overview
334
-
335
- agent-infra is intentionally simple: a bootstrap CLI creates the seed configuration, then AI skills and workflows take over.
336
-
337
- ### End-to-End Flow
338
-
339
- 1. **Install** — `npm install -g @fitlab-ai/agent-infra` (or `brew install fitlab-ai/tap/agent-infra` on macOS, or use the shell script wrapper)
340
- 2. **Initialize** — `ai init` in the project root to generate `.agents/.airc.json` and install the seed command
341
- 3. **Render** — run `update-agent-infra` in any AI TUI to detect the bundled template version and generate all managed files
342
- 4. **Develop** — use built-in skills to drive the full lifecycle: `analysis → analysis-review → design → design-review → code → code-review → commit`
343
- 5. **Update** — run `update-agent-infra` again whenever a new template version is available
344
-
345
- ### Layered Architecture
346
-
347
- ```text
348
- ┌───────────────────────────────────────────────────────┐
349
- │ AI TUI Layer │
350
- │ Claude Code · Codex · Gemini CLI · OpenCode │
351
- └──────────────────────────┬────────────────────────────┘
352
- │ slash commands
353
-
354
- ┌───────────────────────────────────────────────────────┐
355
- │ Shared Layer │
356
- │ Skills · Workflows · Templates │
357
- └──────────────────────────┬────────────────────────────┘
358
- │ renders into
359
-
360
- ┌───────────────────────────────────────────────────────┐
361
- │ Project Layer │
362
- │ .agents/ · AGENTS.md │
363
- └───────────────────────────────────────────────────────┘
364
- ```
365
-
366
- <a id="platform-support"></a>
367
-
368
- ## Platform Support
369
-
370
- agent-infra runs on macOS, Linux, and Windows. The CLI itself only needs Node.js (>=22); container-related features (`ai sandbox *`) additionally need Docker.
371
-
372
- ### Sandbox engine selection
373
-
374
- `sandbox.engine` in `.agents/.airc.json` selects the container engine. When it is `null` or omitted, agent-infra uses the platform default:
375
-
376
- - Linux: `native`
377
- - macOS: `colima`
378
- - Windows: `wsl2`
379
-
380
- You can override the engine in `.agents/.airc.json`. Valid engines are platform-specific:
381
-
382
- - Linux: `native`, `docker-desktop`
383
- - macOS: `colima`, `orbstack`, `docker-desktop`
384
- - Windows: `wsl2`, `native`, `docker-desktop`
385
-
386
- ### macOS
387
-
388
- - `ai init`, `ai sync`, etc.: works out of the box after `npm install -g @fitlab-ai/agent-infra` (or Homebrew).
389
- - `ai sandbox *`: requires Colima, OrbStack, or Docker Desktop. Colima is the default engine on macOS — when it is selected and the `colima` command is missing, agent-infra auto-installs and starts Colima via Homebrew on first run. To use OrbStack or Docker Desktop instead, set `sandbox.engine` in `.agents/.airc.json`.
390
-
391
- #### Engine resource configuration
392
-
393
- | Engine | `vm.cpu` | `vm.memory` | `vm.disk` | Apply mode | Notes |
394
- |--------|----------|-------------|-----------|------------|-------|
395
- | Colima | applied | applied | applied | on-start | VM must be restarted (`ai sandbox vm stop && ai sandbox vm start`) for changes to take effect. |
396
- | OrbStack | applied | applied | warned | hot | Applied via `orb config set` on every invocation. OrbStack manages disk via thin provisioning. |
397
- | Docker Desktop | warned | warned | warned | manual | Resources must be set in Docker Desktop GUI (Settings -> Resources). |
398
-
399
- `vm.memory` and `--memory` values are expressed in GiB.
400
-
401
- #### SSH / locked keychain
402
-
403
- On macOS over SSH, the login keychain may be locked and reject non-interactive reads or writes with `errSecInteractionNotAllowed`. You can unlock it on the host and re-run `ai sandbox refresh`:
404
-
405
- ```bash
406
- security unlock-keychain ~/Library/Keychains/login.keychain-db
407
- ai sandbox refresh
408
- ```
409
-
410
- For long-lived SSH sessions or CI, bypass the keychain with `AGENT_INFRA_CLAUDE_CREDENTIALS_FILE`. macOS stores Claude Code credentials in the keychain by default, so seed the override file once from a session where the keychain is unlocked:
411
-
412
- ```bash
413
- security unlock-keychain ~/Library/Keychains/login.keychain-db
414
- umask 077 && mkdir -p "$HOME/.agent-infra" && \
415
- security find-generic-password -s "Claude Code-credentials" -w \
416
- > "$HOME/.agent-infra/claude-credentials.json"
417
- chmod 600 "$HOME/.agent-infra/claude-credentials.json"
418
- ```
419
-
420
- Then on the SSH / CI side:
421
-
422
- ```bash
423
- export AGENT_INFRA_CLAUDE_CREDENTIALS_FILE="$HOME/.agent-infra/claude-credentials.json"
424
- ai sandbox refresh
425
- ```
426
-
427
- After that, sandbox create, exec, and refresh use the file instead of the keychain for Claude Code credential reads and writes.
428
-
429
- ### Linux
430
-
431
- - `ai init`, `ai sync`, etc.: works out of the box after `npm install -g @fitlab-ai/agent-infra`.
432
- - `ai sandbox *`: requires Docker Engine on the host. Quick setup:
433
-
434
- ```bash
435
- # 1. Install Docker Engine — see https://docs.docker.com/engine/install/
436
- # 2. Start the daemon and enable on boot
437
- sudo systemctl enable --now docker
438
- # 3. Skip 'sudo' for docker: add yourself to the docker group
439
- sudo usermod -aG docker $USER && newgrp docker
440
- ```
441
-
442
- Validate with `docker info` — it should succeed without sudo.
443
-
444
- GPG signing works when the host `gpg-agent` and signing key are available; if key sync fails, `ai sandbox create` falls back to a sanitized Git config so commits still work without host signing state.
445
-
446
- #### Engine resource configuration
447
-
448
- Linux uses native Docker on the host kernel, so there is no managed VM. `sandbox.vm.*` and the `--cpu / --memory` flags do not apply. To cap container resources, use `docker run --cpus / --memory` per container or configure host cgroups.
449
-
450
- #### Rootless Docker (optional)
451
-
452
- **Skip this section if you followed the Quick setup above.** The Quick setup installs the default rootful Docker, which works out of the box with `ai sandbox` — no extra configuration is required.
453
-
454
- Rootless Docker is a separate Docker installation where the daemon runs as your normal user instead of `root`. It is typically chosen on shared hosts, multi-tenant servers, or when a security policy forbids a root-owned daemon. If you have intentionally installed rootless Docker (or plan to), follow the steps below; otherwise stay with rootful.
455
-
456
- To install and verify rootless Docker:
457
-
458
- ```bash
459
- sudo apt install -y uidmap slirp4netns dbus-user-session
460
- dockerd-rootless-setuptool.sh install
461
- systemctl --user enable --now docker
462
- export DOCKER_HOST="unix:///run/user/$(id -u)/docker.sock"
463
- docker info
464
- ```
159
+ | Command | Purpose |
160
+ |---------|---------|
161
+ | `create-task` / `import-issue` | Start a task from a description or a GitHub Issue |
162
+ | `analyze-task` → `review-analysis` | Capture scope and risks, then review the analysis |
163
+ | `plan-task` `review-plan` | Design the approach, then review the plan |
164
+ | `code-task` `review-code` | Implement and test, then run a structured code review |
165
+ | `commit` → `create-pr` → `complete-task` | Commit, open a PR, and archive the task |
465
166
 
466
- Add the `DOCKER_HOST` export to your shell startup file after validation.
467
-
468
- When rootless Docker is detected, agent-infra builds the sandbox image with `HOST_UID=0` and `HOST_GID=0`. Inside the container the sandbox user can read bind mounts such as `~/.ssh` without relaxing host file permissions. On the host, the daemon and container processes still run under the current user, so this does not grant host root privileges.
469
-
470
- Known rootless differences:
471
-
472
- - Networking uses slirp4netns by default and can be slower than rootful bridge networking.
473
- - Processes run as UID 0 inside the container, unlike rootful Docker where agent-infra mirrors the host UID.
474
- - The CI rootless matrix is initially allowed to fail while runner stability is observed.
475
-
476
- Troubleshooting:
477
-
478
- - If `docker info` fails, check `systemctl --user status docker` and confirm `DOCKER_HOST` points at `$XDG_RUNTIME_DIR/docker.sock`.
479
- - If SSH files are still unreadable inside the sandbox, confirm the shell has not overridden `DOCKER_HOST` or Docker build arguments.
480
-
481
- #### Known limitations on Linux
482
-
483
- These configurations are not actively tested in this release:
484
-
485
- - **Podman** instead of Docker: Works on Fedora 40+ and other `dnf`-based RHEL family distros (RHEL, CentOS Stream, Rocky, Alma) via the `podman-docker` shim (`sudo dnf install podman podman-docker`; optionally `sudo touch /etc/containers/nodocker` to silence its per-command notice).
486
- - **SELinux-enforcing** hosts (Fedora / RHEL): `ai sandbox create` automatically labels bind mounts with Docker's shared `:z` flag — no setup required. Set `AGENT_INFRA_SELINUX_DISABLE=1` to opt out for debugging.
487
- - `ai sandbox vm` is a no-op on Linux. Linux uses native Docker directly with no VM to manage; use `ai sandbox create`, `ai sandbox exec`, `ai sandbox refresh`, `ai sandbox ls`, `ai sandbox rebuild`, `ai sandbox rm`, and `ai sandbox prune` directly.
488
-
489
- ### Windows
490
-
491
- - `ai init`, `ai sync`, etc.: should work after `npm install -g @fitlab-ai/agent-infra` (Node.js >= 22). Not actively tested in this release.
492
- - `ai sandbox *`: supported on Windows via WSL2 + Docker Desktop.
493
-
494
- Before running `ai sandbox create`, install Windows 11 with WSL2, configure a default Linux distribution, install Docker Desktop, and enable Docker Desktop's WSL integration for that distribution.
495
-
496
- You can run the CLI from PowerShell or Git Bash, but the project path must be visible from WSL, such as `C:\Users\you\project` or another drive mounted under `/mnt/<drive>`. UNC paths are not supported for sandbox mounts. If the Windows entrypoint cannot reach Docker through WSL2, run the same command from inside the WSL distribution as a fallback.
497
-
498
- `ai sandbox vm` manages only the macOS Colima VM. On Windows, manage Docker Desktop and WSL2 with their native tools.
499
-
500
- #### Engine resource configuration
501
-
502
- WSL2 is the default sandbox engine on Windows. `sandbox.vm.cpu`, `sandbox.vm.memory`, and `--cpu / --memory` flags are not applied automatically when using WSL2 — configure CPU and memory limits in Docker Desktop (Settings → Resources) instead. `sandbox.vm.disk` is not applicable to WSL2. `vm.memory` and `--memory` values are expressed in GiB.
503
-
504
- <a id="what-you-get"></a>
167
+ See the full catalog task status, release, security, and project-maintenance skills — in [Built-in AI Skills](./docs/en/skills.md).
505
168
 
506
169
  ## What You Get
507
170
 
@@ -521,439 +184,24 @@ my-project/
521
184
  └── AGENTS.md # Universal AI agent instructions
522
185
  ```
523
186
 
524
- <a id="built-in-ai-skills"></a>
525
-
526
- ## Built-in AI Skills
527
-
528
- agent-infra ships with **a rich set of built-in AI skills**. They are organized by use case, but they all share the same design goal: every AI TUI should be able to execute the same workflow vocabulary in the same repository.
529
-
530
- <a id="task-lifecycle"></a>
531
-
532
- ### Task Lifecycle
533
-
534
- | Skill | Description | Parameters | Recommended use case |
535
- |-------|-------------|------------|----------------------|
536
- | `create-task` | Create a task scaffold from a natural-language request and cascade Issue creation through the platform rule when available. | `description` | Start a new feature, bug-fix, or improvement from scratch. |
537
- | `import-issue` | Import a GitHub Issue into the local task workspace. | `issue-number` | Convert an existing Issue into an actionable task folder. |
538
- | `analyze-task` | Produce a requirement analysis artifact for an existing task. | `task-id` | Capture scope, risks, and impacted files before designing. |
539
- | `review-analysis` | Review the requirement analysis and classify findings by severity. | `task-id` | Confirm the analysis is complete before design. |
540
- | `plan-task` | Write the technical plan with a review checkpoint. | `task-id` | Define the approach after analysis approval. |
541
- | `review-plan` | Review the technical plan and classify findings by severity. | `task-id` | Confirm the design is actionable before coding. |
542
- | `code-task` | Implement the approved plan or fix code review findings, producing a code report. | `task-id` | Write code, tests, and docs after plan approval, or handle review feedback. |
543
- | `review-code` | Review the code and classify findings by severity. | `task-id` | Run a structured code review before merging. |
544
- | `complete-task` | Mark the task complete and archive it after all gates pass. | `task-id` | Close out a task after review, tests, and commit are done. |
545
-
546
- <a id="task-status"></a>
547
-
548
- ### Task Status
549
-
550
- | Skill | Description | Parameters | Recommended use case |
551
- |-------|-------------|------------|----------------------|
552
- | `check-task` | Inspect the current task status, workflow progress, and next step. | `task-id` | Check progress without modifying task state. |
553
- | `block-task` | Move a task to blocked state and record the blocker reason. | `task-id`, `reason` (optional) | Pause work when an external dependency or decision is missing. |
554
- | `restore-task` | Restore local task files from GitHub Issue sync comments. | `issue-number`, `task-id` (optional) | Recover a task workspace after switching machines or clearing local state. |
555
-
556
- <a id="issue-and-pr"></a>
557
-
558
- ### Issue and PR
559
-
560
- | Skill | Description | Parameters | Recommended use case |
561
- |-------|-------------|------------|----------------------|
562
- | `create-pr` | Open a Pull Request to an inferred or explicit target branch. | `task-id` (optional), `target-branch` (optional) | Publish reviewed changes for merge, with optional explicit task linkage after a fresh session. |
563
-
564
- <a id="code-quality"></a>
565
-
566
- ### Code Quality
567
-
568
- | Skill | Description | Parameters | Recommended use case |
569
- |-------|-------------|------------|----------------------|
570
- | `commit` | Create a Git commit with task updates and copyright-year checks. | None | Finalize a coherent change set after tests pass. |
571
- | `test` | Run the standard project validation flow. | None | Validate compile checks and unit tests after a change. |
572
- | `test-integration` | Run integration or end-to-end validation. | None | Verify cross-module or workflow-level behavior. |
573
-
574
- <a id="release-skills"></a>
575
-
576
- ### Release
577
-
578
- | Skill | Description | Parameters | Recommended use case |
579
- |-------|-------------|------------|----------------------|
580
- | `release` | Execute the version release workflow. | `version` (`X.Y.Z`) | Publish a new project release. |
581
- | `create-release-note` | Generate release notes from PRs and commits. | `version`, `previous-version` (optional) | Prepare a changelog before shipping. |
582
- | `post-release` | Run post-release follow-up tasks (version bump, artifact rebuild, optional demo capture). | None | Finalize the release cycle after pushing a release tag. |
583
-
584
- <a id="security-skills"></a>
585
-
586
- ### Security
587
-
588
- | Skill | Description | Parameters | Recommended use case |
589
- |-------|-------------|------------|----------------------|
590
- | `import-dependabot` | Import a Dependabot alert and create a remediation task. | `alert-number` | Convert a dependency security alert into a tracked fix. |
591
- | `close-dependabot` | Close a Dependabot alert with a documented rationale. | `alert-number` | Record why an alert does not require action. |
592
- | `import-codescan` | Import a Code Scanning alert and create a remediation task. | `alert-number` | Triage CodeQL findings through the normal task workflow. |
593
- | `close-codescan` | Close a Code Scanning alert with a documented rationale. | `alert-number` | Record why a scanning alert can be safely dismissed. |
594
-
595
- <a id="project-maintenance"></a>
596
-
597
- ### Project Maintenance
598
-
599
- | Skill | Description | Parameters | Recommended use case |
600
- |-------|-------------|------------|----------------------|
601
- | `upgrade-dependency` | Upgrade a dependency from one version to another and verify it. | `package`, `old-version`, `new-version` | Perform controlled dependency maintenance. |
602
- | `refine-title` | Rewrite an Issue or PR title into Conventional Commits format. | `number` | Normalize inconsistent GitHub titles. |
603
- | `init-labels` | Initialize the repository's standard GitHub label set. | None | Bootstrap labels in a new repository. |
604
- | `init-milestones` | Initialize the repository's milestone structure. | None | Bootstrap milestone tracking in a new repository. |
605
- | `archive-tasks` | Archive completed tasks into a date-organized directory with a manifest index. | `[--days N \| --before DATE \| TASK-ID...]` | Periodically clean up the `completed/` directory. |
606
- | `update-agent-infra` | Update the project's collaboration infrastructure to the latest template version. | None | Refresh shared AI tooling without rebuilding local conventions. |
607
-
608
- > Every skill works across supported AI TUIs. The command prefix changes, but the workflow semantics stay the same.
609
-
610
- <a id="custom-skills"></a>
611
-
612
- ## Custom Skills
613
-
614
- Built-in skills cover the standard delivery lifecycle, but teams often need project-specific instructions such as coding standards, deployment checks, or internal review rules. agent-infra supports that through **custom skills**.
615
-
616
- ### Create a custom skill in the project
617
-
618
- Create a directory under `.agents/skills/<name>/` and add a `SKILL.md` file:
619
-
620
- ```text
621
- .agents/skills/
622
- enforce-style/
623
- SKILL.md
624
- reference/
625
- style-guide.md
626
- ```
627
-
628
- Minimum frontmatter:
629
-
630
- ```yaml
631
- ---
632
- name: enforce-style
633
- description: "Apply team style checks before submitting code"
634
- args: "<task-id>" # optional
635
- ---
636
- ```
637
-
638
- - `name`: user-facing skill name
639
- - `description`: used when generating editor command metadata
640
- - `args`: optional argument hint; agent-infra uses it when generating slash commands for supported AI TUIs
187
+ ## Documentation
641
188
 
642
- After adding the skill, run `update-agent-infra` again:
189
+ In-depth guides live under [`docs/en/`](./docs/en/README.md):
643
190
 
644
- | TUI | Command |
645
- |-----|---------|
646
- | Claude Code | `/update-agent-infra` |
647
- | Codex | `$update-agent-infra` |
648
- | Gemini CLI | `/{{project}}:update-agent-infra` |
649
- | OpenCode | `/update-agent-infra` |
650
-
651
- That refresh detects non-built-in skill directories in `.agents/skills/` and generates matching commands for Claude Code, Gemini CLI, and OpenCode automatically.
652
-
653
- ### Sync custom skills from shared sources
654
-
655
- If you maintain reusable team skills outside the repository, declare them in `.agents/.airc.json`:
656
-
657
- ```json
658
- {
659
- "skills": {
660
- "sources": [
661
- { "type": "local", "path": "~/private-skills" },
662
- { "type": "local", "path": "~/team-skills" }
663
- ]
664
- }
665
- }
666
- ```
667
-
668
- Expected source layout:
669
-
670
- ```text
671
- ~/private-skills/
672
- enforce-style/
673
- SKILL.md
674
- release-check/
675
- SKILL.md
676
- reference/
677
- checklist.md
678
- ```
679
-
680
- Behavior:
681
-
682
- - Sources are applied in list order; later sources overwrite earlier custom sources when they define the same file
683
- - `type: "local"` is the only supported source type today; the structure leaves room for future source types
684
- - `~` in source paths is expanded to the current user's home directory
685
-
686
- ### Sync behavior and conflict rules
687
-
688
- When `update-agent-infra` runs:
689
-
690
- - Manually created custom skills in `.agents/skills/` are protected from managed-file cleanup
691
- - Files synced from external custom sources are copied into `.agents/skills/`
692
- - For synced skills that still exist in a configured source, files removed from the source are also removed locally during the next sync
693
- - Built-in skills always win over custom sources; if a source defines a skill with the same name as a built-in skill, agent-infra skips that custom source skill instead of overriding the built-in one
694
- - If you truly need to replace a built-in skill or command, use the existing `ejected` mechanism and own that file in the project
695
-
696
- ## Custom TUI Configuration
697
-
698
- Use the top-level `.agents/.airc.json` `customTUIs` array when your team uses an AI TUI that is not one of the built-in command targets. This config lets agent-infra show the correct next-step commands and generate command files for project custom skills by learning from an existing command in the custom TUI directory.
699
-
700
- | Field | Required | Meaning |
701
- |-------|----------|---------|
702
- | `name` | Yes | Display name shown in reports and next-step guidance, for example `<your-tui-name>`. |
703
- | `dir` | Yes | Command directory relative to the project root, for example `.<your-tui>/commands`. The path must stay inside the project root. |
704
- | `invoke` | Yes | User-facing command template used in next-step guidance. |
705
-
706
- Supported `invoke` placeholders:
707
-
708
- | Placeholder | Replaced with | Example |
709
- |-------------|---------------|---------|
710
- | `${skillName}` | The skill command name, such as `review-code` or `commit`. | `<your-cli> ${skillName}` -> `<your-cli> review-code` |
711
- | `${projectName}` | The `.airc.json` `project` value. Use this for namespaced commands. | `/${projectName}:${skillName}` -> `/agent-infra:review-code` |
712
-
713
- Non-namespaced custom TUI:
714
-
715
- ```json
716
- {
717
- "customTUIs": [
718
- {
719
- "name": "<your-tui-name>",
720
- "dir": ".<your-tui>/commands",
721
- "invoke": "<your-cli> ${skillName}"
722
- }
723
- ]
724
- }
725
- ```
726
-
727
- Namespaced custom TUI:
728
-
729
- ```json
730
- {
731
- "project": "agent-infra",
732
- "customTUIs": [
733
- {
734
- "name": "<your-tui-name>",
735
- "dir": ".<your-tui>/commands",
736
- "invoke": "/${projectName}:${skillName}"
737
- }
738
- ]
739
- }
740
- ```
741
-
742
- `customTUIs` should contain one entry per custom TUI. To let `update-agent-infra` generate command files for custom skills, keep at least one existing command file in `dir` that references a built-in skill path such as `.agents/skills/analyze-task/SKILL.md`; agent-infra uses that file as the format reference.
743
-
744
- <a id="prebuilt-workflows"></a>
745
-
746
- ## Prebuilt Workflows
747
-
748
- agent-infra includes **4 prebuilt workflows**. Three of them share the same symmetric gated delivery lifecycle:
749
-
750
- `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit`
751
-
752
- The fourth, `code-review`, is intentionally smaller and optimized for reviewing an existing PR or branch.
753
-
754
- | Workflow | Best for | Step chain |
755
- |----------|----------|------------|
756
- | `feature-development` | Building a new feature or capability | `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit` |
757
- | `bug-fix` | Diagnosing and fixing a defect with regression coverage | `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit` |
758
- | `refactoring` | Structural changes that should preserve behavior | `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit` |
759
- | `code-review` | Reviewing an existing PR or branch | `analysis -> review -> report` |
760
-
761
- ### Example lifecycle
762
-
763
- The simplest end-to-end delivery loop looks like this:
764
-
765
- ```text
766
- import-issue #42 Import task from GitHub Issue
767
- (or: create-task "add dark mode") Or create a task from a description; Issue creation cascades when the platform rule supports it
768
- |
769
- | --> get task ID, e.g. T1
770
- v
771
- analyze-task T1 Requirement analysis
772
- |
773
- v
774
- review-analysis T1 Review analysis
775
- |
776
- Issues?
777
- +--YES----> analyze-task T1
778
- |
779
- v
780
- plan-task T1 Design solution
781
- |
782
- v
783
- review-plan T1 Review plan
784
- |
785
- Issues?
786
- +--YES----> plan-task T1
787
- |
788
- |
789
- v
790
- code-task T1 Write code and tests
791
- |
792
- v
793
- +-> review-code T1 Automated code review
794
- | |
795
- | Issues?
796
- | +--NO-------+
797
- | YES |
798
- | | |
799
- | v |
800
- | code-task T1 (fix mode)
801
- | | |
802
- +------+ |
803
- |
804
- +-----------+
805
- |
806
- v
807
- commit Commit final code
808
- |
809
- v
810
- complete-task T1 Archive and finish
811
- ```
812
-
813
- <a id="configuration-reference"></a>
814
-
815
- ## Configuration Reference
816
-
817
- The generated `.agents/.airc.json` file is the central contract between the bootstrap CLI, templates, and future updates.
818
-
819
- ### Example `.agents/.airc.json`
820
-
821
- ```json
822
- {
823
- "project": "my-project",
824
- "org": "my-org",
825
- "language": "en",
826
- "templateVersion": "v0.6.5",
827
- "templates": {
828
- "sources": [
829
- { "type": "local", "path": "~/private-templates" }
830
- ]
831
- },
832
- "skills": {
833
- "sources": [
834
- { "type": "local", "path": "~/private-skills" }
835
- ]
836
- },
837
- "customTUIs": [
838
- {
839
- "name": "<your-tui-name>",
840
- "dir": ".<your-tui>/commands",
841
- "invoke": "<your-cli> ${skillName}"
842
- }
843
- ],
844
- "files": {
845
- "managed": [
846
- ".agents/workspace/README.md",
847
- ".agents/skills/",
848
- ".agents/templates/",
849
- ".agents/workflows/",
850
- ".claude/commands/",
851
- ".gemini/commands/",
852
- ".opencode/commands/"
853
- ],
854
- "merged": [
855
- ".agents/README.md",
856
- ".gitignore",
857
- "AGENTS.md"
858
- ],
859
- "ejected": []
860
- }
861
- }
862
- ```
863
-
864
- ### Field reference
865
-
866
- | Field | Meaning |
867
- |-------|---------|
868
- | `project` | Project name used when rendering commands, paths, and templates. |
869
- | `org` | GitHub organization or owner used by generated metadata and links. |
870
- | `language` | Primary project language or locale used by rendered templates. |
871
- | `templateVersion` | Installed template version for future upgrades and drift tracking. |
872
- | `templates` | Optional external template overlay configuration. |
873
- | `templates.sources` | Optional ordered list of external template sources. Only `type: "local"` is supported today. |
874
- | `skills` | Optional custom skill sync configuration. |
875
- | `skills.sources` | Optional ordered list of external custom skill sources. Only `type: "local"` is supported today. |
876
- | `customTUIs` | Optional top-level list of custom AI TUI adapters. |
877
- | `files` | Per-path update strategy configuration for managed, merged, and ejected files. |
878
-
879
- ### External template and skill sources
880
-
881
- Use external sources when your team maintains private platform templates, private rules, or shared custom skills outside this repository. You can configure them during `agent-infra init` or later by editing `.agents/.airc.json`:
882
-
883
- ```json
884
- {
885
- "templates": {
886
- "sources": [
887
- { "type": "local", "path": "~/private-templates" },
888
- { "type": "local", "path": "~/team-overrides/templates" }
889
- ]
890
- },
891
- "skills": {
892
- "sources": [
893
- { "type": "local", "path": "~/private-skills" }
894
- ]
895
- }
896
- }
897
- ```
898
-
899
- Template source precedence is built-in templates first, then external sources as supplements. External files with the same path as built-in templates are ignored and reported in `templateSources.conflicts`; between external sources, later entries override earlier entries and conflicts are also reported. Skill sources use the same local-source shape, but custom skills cannot replace built-in skills.
900
-
901
- External template files and skill scripts can include executable JavaScript or shell commands that AI workflows may run. Only use trusted local paths.
902
-
903
- <a id="file-management-strategies"></a>
904
-
905
- ## File Management Strategies
906
-
907
- Each generated path is assigned an update strategy. That strategy determines how `update-agent-infra` treats the file later.
908
-
909
- | Strategy | Meaning | Update behavior |
910
- |----------|---------|-----------------|
911
- | **managed** | agent-infra fully controls the file | Re-rendered and overwritten on update |
912
- | **merged** | Template content and user customizations coexist | AI-assisted merge preserves local additions where possible |
913
- | **ejected** | Generated once and then owned by the project | Never touched again by future updates |
914
-
915
- ### Example strategy configuration
916
-
917
- ```json
918
- {
919
- "files": {
920
- "managed": [
921
- ".agents/skills/",
922
- ".agents/workspace/README.md"
923
- ],
924
- "merged": [
925
- ".gitignore",
926
- "AGENTS.md"
927
- ],
928
- "ejected": [
929
- "docs/architecture.md"
930
- ]
931
- }
932
- }
933
- ```
934
-
935
- ### Moving a file from `managed` to `ejected`
936
-
937
- 1. Remove the path from the `managed` array in `.agents/.airc.json`.
938
- 2. Add the same path to the `ejected` array.
939
- 3. Run `update-agent-infra` again so future updates stop managing that file.
940
-
941
- Use this when a file starts as template-owned but later becomes project-specific enough that automatic updates would create more noise than value.
942
-
943
- <a id="version-management"></a>
944
-
945
- ## Version Management
946
-
947
- agent-infra uses semantic versioning through Git tags and GitHub releases. The installed template version is recorded in `.agents/.airc.json` as `templateVersion`, which gives both humans and AI tools a stable reference point for upgrades.
948
-
949
- <a id="contributing"></a>
191
+ - [Architecture Overview](./docs/en/architecture.md) bootstrap CLI, end-to-end flow, layered architecture
192
+ - [Platform Support](./docs/en/platform-support.md) — macOS, Linux, Windows; sandbox engines and resources
193
+ - [Sandbox](./docs/en/sandbox.md) sandbox aliases, host-sandbox file exchange, user-level dotfiles channel
194
+ - [Built-in AI Skills](./docs/en/skills.md) — the full skill catalog by use case
195
+ - [Custom Skills](./docs/en/custom-skills.md) create and sync project-specific skills
196
+ - [Custom TUI Configuration](./docs/en/custom-tui.md) — adapt agent-infra to non-built-in AI TUIs
197
+ - [Prebuilt Workflows](./docs/en/workflows.md) — the gated delivery lifecycle and example flow
198
+ - [Configuration Reference](./docs/en/configuration.md) `.agents/.airc.json`, external sources, version management
199
+ - [File Management Strategies](./docs/en/file-management.md) — managed / merged / ejected update strategies
950
200
 
951
201
  ## Contributing
952
202
 
953
203
  See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
954
204
 
955
- <a id="license"></a>
956
-
957
205
  ## License
958
206
 
959
207
  [MIT](License.txt)