@fitlab-ai/agent-infra 0.6.4 → 0.7.0
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.
- package/README.md +63 -27
- package/README.zh-CN.md +61 -25
- package/bin/cli.ts +18 -6
- package/dist/bin/cli.js +20 -6
- package/dist/lib/cp.js +127 -0
- package/dist/lib/defaults.json +1 -0
- package/dist/lib/init.js +3 -0
- package/dist/lib/sandbox/clipboard/bridge.js +23 -4
- package/dist/lib/sandbox/clipboard/index.js +12 -3
- package/dist/lib/sandbox/commands/create.js +11 -2
- package/dist/lib/sandbox/commands/enter.js +29 -6
- package/dist/lib/sandbox/commands/list-running.js +108 -0
- package/dist/lib/sandbox/commands/ls.js +24 -45
- package/dist/lib/sandbox/commands/rebuild.js +15 -7
- package/dist/lib/sandbox/config.js +3 -0
- package/dist/lib/sandbox/index.js +6 -4
- package/dist/lib/sandbox/readme-scaffold.js +148 -0
- package/dist/lib/sandbox/runtimes/ai-tools.dockerfile +12 -6
- package/dist/lib/sandbox/runtimes/base.dockerfile +3 -3
- package/dist/lib/sandbox/tools.js +213 -8
- package/dist/lib/update.js +12 -1
- package/lib/cp.ts +177 -0
- package/lib/defaults.json +1 -0
- package/lib/init.ts +10 -0
- package/lib/sandbox/clipboard/bridge.ts +23 -4
- package/lib/sandbox/clipboard/index.ts +12 -3
- package/lib/sandbox/commands/create.ts +18 -2
- package/lib/sandbox/commands/enter.ts +48 -6
- package/lib/sandbox/commands/list-running.ts +135 -0
- package/lib/sandbox/commands/ls.ts +28 -49
- package/lib/sandbox/commands/rebuild.ts +24 -7
- package/lib/sandbox/config.ts +7 -0
- package/lib/sandbox/index.ts +6 -4
- package/lib/sandbox/readme-scaffold.ts +177 -0
- package/lib/sandbox/runtimes/ai-tools.dockerfile +12 -6
- package/lib/sandbox/runtimes/base.dockerfile +3 -3
- package/lib/sandbox/tools.ts +248 -9
- package/lib/update.ts +15 -1
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.en.md +1 -1
- package/templates/.agents/QUICKSTART.zh-CN.md +1 -1
- package/templates/.agents/README.en.md +79 -2
- package/templates/.agents/README.zh-CN.md +79 -2
- package/templates/.agents/rules/create-issue.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
- package/templates/.agents/rules/create-issue.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.github.en.md +6 -5
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +6 -5
- package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
- package/templates/.agents/rules/no-mid-flow-questions.en.md +57 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +57 -0
- package/templates/.agents/rules/pr-sync.github.en.md +4 -5
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +4 -5
- package/templates/.agents/rules/task-management.en.md +9 -6
- package/templates/.agents/rules/task-management.zh-CN.md +9 -6
- package/templates/.agents/rules/testing-discipline.en.md +2 -2
- package/templates/.agents/rules/testing-discipline.zh-CN.md +2 -2
- package/templates/.agents/scripts/validate-artifact.js +1 -1
- package/templates/.agents/skills/analyze-task/SKILL.en.md +16 -4
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +16 -4
- package/templates/.agents/skills/check-task/SKILL.en.md +43 -32
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +42 -31
- package/templates/.agents/skills/code-task/SKILL.en.md +117 -0
- package/templates/.agents/skills/{implement-task → code-task}/SKILL.zh-CN.md +51 -24
- package/templates/.agents/skills/{implement-task → code-task}/config/verify.en.json +4 -4
- package/templates/.agents/skills/{implement-task → code-task}/config/verify.zh-CN.json +4 -4
- package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.zh-CN.md +2 -2
- package/templates/.agents/skills/{implement-task/reference/implementation-rules.en.md → code-task/reference/code-rules.en.md} +6 -6
- package/templates/.agents/skills/{implement-task/reference/implementation-rules.zh-CN.md → code-task/reference/code-rules.zh-CN.md} +3 -3
- package/templates/.agents/skills/code-task/reference/dual-mode.en.md +69 -0
- package/templates/.agents/skills/code-task/reference/dual-mode.zh-CN.md +69 -0
- package/templates/.agents/skills/{refine-task/reference/fix-workflow.en.md → code-task/reference/fix-mode.en.md} +12 -12
- package/templates/.agents/skills/{refine-task/reference/fix-workflow.zh-CN.md → code-task/reference/fix-mode.zh-CN.md} +8 -8
- package/templates/.agents/skills/code-task/reference/output-template.en.md +20 -0
- package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +20 -0
- package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.en.md +4 -4
- package/templates/.agents/skills/{implement-task → code-task}/reference/report-template.zh-CN.md +3 -3
- package/templates/.agents/skills/code-task/scripts/detect-mode.js +370 -0
- package/templates/.agents/skills/commit/SKILL.en.md +2 -2
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +10 -6
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +10 -6
- package/templates/.agents/skills/complete-task/SKILL.en.md +5 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +17 -1
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +17 -1
- package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +2 -2
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +2 -2
- package/templates/.agents/skills/import-issue/SKILL.en.md +3 -3
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/plan-task/SKILL.en.md +4 -4
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/restore-task/SKILL.en.md +4 -3
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -3
- package/templates/.agents/skills/review-analysis/SKILL.en.md +76 -0
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +102 -0
- package/templates/.agents/skills/review-analysis/config/verify.en.json +51 -0
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +51 -0
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +87 -0
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +87 -0
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +90 -0
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +91 -0
- package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +47 -0
- package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +47 -0
- package/templates/.agents/skills/{review-task → review-code}/SKILL.en.md +11 -9
- package/templates/.agents/skills/{review-task → review-code}/SKILL.zh-CN.md +15 -9
- package/templates/.agents/skills/{review-task → review-code}/config/verify.en.json +7 -5
- package/templates/.agents/skills/{review-task → review-code}/config/verify.zh-CN.json +6 -4
- package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.en.md +21 -17
- package/templates/.agents/skills/{review-task → review-code}/reference/output-templates.zh-CN.md +19 -15
- package/templates/.agents/skills/{review-task → review-code}/reference/report-template.en.md +5 -6
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +91 -0
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +48 -0
- package/templates/.agents/skills/{review-task → review-code}/reference/review-criteria.zh-CN.md +10 -4
- package/templates/.agents/skills/review-plan/SKILL.en.md +76 -0
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +102 -0
- package/templates/.agents/skills/{refine-task → review-plan}/config/verify.en.json +14 -10
- package/templates/.agents/skills/{refine-task → review-plan}/config/verify.zh-CN.json +14 -10
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +87 -0
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +87 -0
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +90 -0
- package/templates/.agents/skills/{review-task → review-plan}/reference/report-template.zh-CN.md +3 -3
- package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +47 -0
- package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +47 -0
- package/templates/.agents/skills/test/SKILL.en.md +2 -2
- package/templates/.agents/skills/test/SKILL.zh-CN.md +13 -31
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +1 -0
- package/templates/.agents/templates/task.en.md +3 -3
- package/templates/.agents/templates/task.zh-CN.md +2 -2
- package/templates/.agents/workflows/bug-fix.en.yaml +126 -80
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +90 -44
- package/templates/.agents/workflows/feature-development.en.yaml +115 -70
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +92 -47
- package/templates/.agents/workflows/refactoring.en.yaml +123 -78
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +89 -44
- package/templates/.claude/commands/code-task.en.md +8 -0
- package/templates/.claude/commands/code-task.zh-CN.md +8 -0
- package/templates/.claude/commands/review-analysis.en.md +8 -0
- package/templates/.claude/commands/review-analysis.zh-CN.md +8 -0
- package/templates/.claude/commands/review-code.en.md +8 -0
- package/templates/.claude/commands/review-code.zh-CN.md +8 -0
- package/templates/.claude/commands/review-plan.en.md +8 -0
- package/templates/.claude/commands/review-plan.zh-CN.md +8 -0
- package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/code-task.en.toml +8 -0
- package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/review-analysis.en.toml +8 -0
- package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/review-code.en.toml +8 -0
- package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +8 -0
- package/templates/.gemini/commands/_project_/review-plan.en.toml +8 -0
- package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +8 -0
- package/templates/.opencode/commands/code-task.en.md +11 -0
- package/templates/.opencode/commands/code-task.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-analysis.en.md +11 -0
- package/templates/.opencode/commands/review-analysis.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-code.en.md +11 -0
- package/templates/.opencode/commands/review-code.zh-CN.md +11 -0
- package/templates/.opencode/commands/review-plan.en.md +11 -0
- package/templates/.opencode/commands/review-plan.zh-CN.md +11 -0
- package/templates/.agents/skills/implement-task/SKILL.en.md +0 -173
- package/templates/.agents/skills/implement-task/reference/output-template.en.md +0 -20
- package/templates/.agents/skills/implement-task/reference/output-template.zh-CN.md +0 -20
- package/templates/.agents/skills/refine-task/SKILL.en.md +0 -153
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +0 -153
- package/templates/.agents/skills/refine-task/reference/report-template.en.md +0 -64
- package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +0 -64
- package/templates/.agents/skills/review-task/reference/review-criteria.en.md +0 -42
- package/templates/.claude/commands/implement-task.en.md +0 -8
- package/templates/.claude/commands/implement-task.zh-CN.md +0 -8
- package/templates/.claude/commands/refine-task.en.md +0 -8
- package/templates/.claude/commands/refine-task.zh-CN.md +0 -8
- package/templates/.claude/commands/review-task.en.md +0 -8
- package/templates/.claude/commands/review-task.zh-CN.md +0 -8
- package/templates/.gemini/commands/_project_/implement-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/refine-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/review-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +0 -8
- package/templates/.opencode/commands/implement-task.en.md +0 -11
- package/templates/.opencode/commands/implement-task.zh-CN.md +0 -11
- package/templates/.opencode/commands/refine-task.en.md +0 -11
- package/templates/.opencode/commands/refine-task.zh-CN.md +0 -11
- package/templates/.opencode/commands/review-task.en.md +0 -11
- package/templates/.opencode/commands/review-task.zh-CN.md +0 -11
- /package/templates/.agents/skills/{implement-task → code-task}/reference/branch-management.en.md +0 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<strong>From issue to merged PR in
|
|
12
|
+
<strong>From issue to merged PR in 11 commands.</strong> Define a requirement, let AI handle analysis, planning, coding, and three-stage review — you only step in when it matters.
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
@@ -66,11 +66,23 @@ Once initialized, open the project in your AI TUI and install the latest skills:
|
|
|
66
66
|
|
|
67
67
|
> AI scans the codebase, identifies `src/auth/login.ts` as the root cause, and writes `analysis.md`.
|
|
68
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
|
+
|
|
69
75
|
```bash
|
|
70
76
|
/plan-task TASK-20260319-100000
|
|
71
77
|
```
|
|
72
78
|
|
|
73
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."*
|
|
74
86
|
>
|
|
75
87
|
> **You review the plan and reply in natural language:**
|
|
76
88
|
|
|
@@ -79,22 +91,22 @@ The plan looks right, but don't change the DB schema.
|
|
|
79
91
|
Just fix it at the application layer in LoginService.
|
|
80
92
|
```
|
|
81
93
|
|
|
82
|
-
> AI
|
|
94
|
+
> AI re-runs `/plan-task` to update the plan accordingly and confirms.
|
|
83
95
|
|
|
84
96
|
```bash
|
|
85
|
-
/
|
|
97
|
+
/code-task TASK-20260319-100000
|
|
86
98
|
```
|
|
87
99
|
|
|
88
100
|
> AI writes the fix, adds a test case for `user+tag@example.com`, and runs all tests — green.
|
|
89
101
|
|
|
90
102
|
```bash
|
|
91
|
-
/review-
|
|
103
|
+
/review-code TASK-20260319-100000
|
|
92
104
|
```
|
|
93
105
|
|
|
94
|
-
> AI reviews its own
|
|
106
|
+
> AI reviews its own code: *"Approved. 0 blockers, 0 major, 1 minor (missing JSDoc)."*
|
|
95
107
|
|
|
96
108
|
```bash
|
|
97
|
-
/
|
|
109
|
+
/code-task TASK-20260319-100000
|
|
98
110
|
```
|
|
99
111
|
|
|
100
112
|
> AI fixes the minor issue and re-validates.
|
|
@@ -107,7 +119,7 @@ Just fix it at the application layer in LoginService.
|
|
|
107
119
|
|
|
108
120
|
> Commit created, PR #43 opened (auto-linked to issue #42), task archived.
|
|
109
121
|
|
|
110
|
-
**
|
|
122
|
+
**11 commands. 1 natural-language correction. From issue to merged PR.** That is the entire SOP — programming can have a standard operating procedure too.
|
|
111
123
|
|
|
112
124
|
Every command above works the same way in Claude Code, Codex, Gemini CLI, and OpenCode. Switch tools mid-task — the workflow state follows.
|
|
113
125
|
|
|
@@ -115,9 +127,9 @@ Every command above works the same way in Claude Code, Codex, Gemini CLI, and Op
|
|
|
115
127
|
|
|
116
128
|
These are not thin command aliases. Each skill encapsulates standardized processes that are tedious and error-prone when done by hand:
|
|
117
129
|
|
|
118
|
-
- **Structured artifacts** — every step produces a templated document (`analysis.md`, `plan.md`, `review.md`) with consistent structure, not free-form notes
|
|
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
|
|
119
131
|
- **Multi-round versioning** — requirements changed? Run `analyze-task` again to get `analysis-r2.md`; the full revision history is preserved
|
|
120
|
-
- **Severity-classified reviews** — `review-
|
|
132
|
+
- **Severity-classified reviews** — `review-code` categorizes findings into Blocker / Major / Minor with file paths and fix suggestions, not a vague "looks good"
|
|
121
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
|
|
122
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
|
|
123
135
|
|
|
@@ -202,9 +214,13 @@ This detects the packaged template version and renders all managed files. The sa
|
|
|
202
214
|
|
|
203
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.
|
|
204
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
|
+
|
|
205
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.
|
|
206
220
|
|
|
207
|
-
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.
|
|
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.
|
|
208
224
|
|
|
209
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.
|
|
210
226
|
|
|
@@ -230,6 +246,11 @@ remove only dirs without an active sandbox container.
|
|
|
230
246
|
Existing sandboxes pick up these mounts after `ai sandbox rm <branch>` and
|
|
231
247
|
`ai sandbox create <branch>`.
|
|
232
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
|
+
|
|
233
254
|
### User-level dotfiles channel
|
|
234
255
|
|
|
235
256
|
`ai sandbox create` also mounts an optional read-only channel for host user preferences:
|
|
@@ -294,6 +315,7 @@ target.
|
|
|
294
315
|
| `.config/opencode/*`, `.local/share/opencode/*` | OpenCode credentials and data use dedicated bind mounts. |
|
|
295
316
|
| `.host-shell-config/*` | agent-infra managed shell and Git configuration. |
|
|
296
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. |
|
|
297
319
|
|
|
298
320
|
Other existing real directories, such as `~/.config/` or `~/.cache/`, are not
|
|
299
321
|
replaced by top-level dotfiles. If a file conflicts with one of those
|
|
@@ -317,7 +339,7 @@ agent-infra is intentionally simple: a bootstrap CLI creates the seed configurat
|
|
|
317
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)
|
|
318
340
|
2. **Initialize** — `ai init` in the project root to generate `.agents/.airc.json` and install the seed command
|
|
319
341
|
3. **Render** — run `update-agent-infra` in any AI TUI to detect the bundled template version and generate all managed files
|
|
320
|
-
4. **Develop** — use built-in skills to drive the full lifecycle: `analysis →
|
|
342
|
+
4. **Develop** — use built-in skills to drive the full lifecycle: `analysis → analysis-review → design → design-review → code → code-review → commit`
|
|
321
343
|
5. **Update** — run `update-agent-infra` again whenever a new template version is available
|
|
322
344
|
|
|
323
345
|
### Layered Architecture
|
|
@@ -514,10 +536,11 @@ agent-infra ships with **a rich set of built-in AI skills**. They are organized
|
|
|
514
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. |
|
|
515
537
|
| `import-issue` | Import a GitHub Issue into the local task workspace. | `issue-number` | Convert an existing Issue into an actionable task folder. |
|
|
516
538
|
| `analyze-task` | Produce a requirement analysis artifact for an existing task. | `task-id` | Capture scope, risks, and impacted files before designing. |
|
|
517
|
-
| `
|
|
518
|
-
| `
|
|
519
|
-
| `review-
|
|
520
|
-
| `
|
|
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. |
|
|
521
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. |
|
|
522
545
|
|
|
523
546
|
<a id="task-status"></a>
|
|
@@ -684,8 +707,8 @@ Supported `invoke` placeholders:
|
|
|
684
707
|
|
|
685
708
|
| Placeholder | Replaced with | Example |
|
|
686
709
|
|-------------|---------------|---------|
|
|
687
|
-
| `${skillName}` | The skill command name, such as `review-
|
|
688
|
-
| `${projectName}` | The `.airc.json` `project` value. Use this for namespaced commands. | `/${projectName}:${skillName}` -> `/agent-infra:review-
|
|
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` |
|
|
689
712
|
|
|
690
713
|
Non-namespaced custom TUI:
|
|
691
714
|
|
|
@@ -722,17 +745,17 @@ Namespaced custom TUI:
|
|
|
722
745
|
|
|
723
746
|
## Prebuilt Workflows
|
|
724
747
|
|
|
725
|
-
agent-infra includes **4 prebuilt workflows**. Three of them share the same gated delivery lifecycle:
|
|
748
|
+
agent-infra includes **4 prebuilt workflows**. Three of them share the same symmetric gated delivery lifecycle:
|
|
726
749
|
|
|
727
|
-
`analysis ->
|
|
750
|
+
`analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit`
|
|
728
751
|
|
|
729
752
|
The fourth, `code-review`, is intentionally smaller and optimized for reviewing an existing PR or branch.
|
|
730
753
|
|
|
731
754
|
| Workflow | Best for | Step chain |
|
|
732
755
|
|----------|----------|------------|
|
|
733
|
-
| `feature-development` | Building a new feature or capability | `analysis ->
|
|
734
|
-
| `bug-fix` | Diagnosing and fixing a defect with regression coverage | `analysis ->
|
|
735
|
-
| `refactoring` | Structural changes that should preserve behavior | `analysis ->
|
|
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` |
|
|
736
759
|
| `code-review` | Reviewing an existing PR or branch | `analysis -> review -> report` |
|
|
737
760
|
|
|
738
761
|
### Example lifecycle
|
|
@@ -748,20 +771,33 @@ import-issue #42 Import task from GitHub Issue
|
|
|
748
771
|
analyze-task T1 Requirement analysis
|
|
749
772
|
|
|
|
750
773
|
v
|
|
751
|
-
|
|
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
|
+
|
|
|
752
788
|
|
|
|
753
789
|
v
|
|
754
|
-
|
|
790
|
+
code-task T1 Write code and tests
|
|
755
791
|
|
|
|
756
792
|
v
|
|
757
|
-
+-> review-
|
|
793
|
+
+-> review-code T1 Automated code review
|
|
758
794
|
| |
|
|
759
795
|
| Issues?
|
|
760
796
|
| +--NO-------+
|
|
761
797
|
| YES |
|
|
762
798
|
| | |
|
|
763
799
|
| v |
|
|
764
|
-
|
|
|
800
|
+
| code-task T1 (fix mode)
|
|
765
801
|
| | |
|
|
766
802
|
+------+ |
|
|
767
803
|
|
|
|
@@ -787,7 +823,7 @@ The generated `.agents/.airc.json` file is the central contract between the boot
|
|
|
787
823
|
"project": "my-project",
|
|
788
824
|
"org": "my-org",
|
|
789
825
|
"language": "en",
|
|
790
|
-
"templateVersion": "v0.6.
|
|
826
|
+
"templateVersion": "v0.6.5",
|
|
791
827
|
"templates": {
|
|
792
828
|
"sources": [
|
|
793
829
|
{ "type": "local", "path": "~/private-templates" }
|
package/README.zh-CN.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<strong>从 Issue 到合并 PR,只需
|
|
12
|
+
<strong>从 Issue 到合并 PR,只需 11 条命令。</strong> 定义需求,让 AI 完成分析、方案设计、编码与三阶段审查 —— 你只需在关键节点介入。
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
@@ -66,11 +66,23 @@ agent-infra 的目标就是把这层共享基础设施标准化。它为所有
|
|
|
66
66
|
|
|
67
67
|
> AI 扫描代码库,定位 `src/auth/login.ts` 为根因,输出 `analysis.md`。
|
|
68
68
|
|
|
69
|
+
```bash
|
|
70
|
+
/review-analysis TASK-20260319-100000
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
> AI 自审分析报告:*"通过。0 阻塞项,0 主要,0 次要 —— 范围与根因清晰,可进入方案设计。"*
|
|
74
|
+
|
|
69
75
|
```bash
|
|
70
76
|
/plan-task TASK-20260319-100000
|
|
71
77
|
```
|
|
72
78
|
|
|
73
79
|
> AI 提出修复方案:*"在 `LoginService.validate()` 中清洗邮箱输入,并添加专项单元测试。"*
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
/review-plan TASK-20260319-100000
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
> AI 自审方案:*"通过且无问题。可进入编码。"*
|
|
74
86
|
>
|
|
75
87
|
> **你审查方案后用自然语言回复:**
|
|
76
88
|
|
|
@@ -79,22 +91,22 @@ agent-infra 的目标就是把这层共享基础设施标准化。它为所有
|
|
|
79
91
|
只在应用层的 LoginService 里修复就行。
|
|
80
92
|
```
|
|
81
93
|
|
|
82
|
-
> AI
|
|
94
|
+
> AI 按你的要求重跑 `/plan-task` 更新方案并确认。
|
|
83
95
|
|
|
84
96
|
```bash
|
|
85
|
-
/
|
|
97
|
+
/code-task TASK-20260319-100000
|
|
86
98
|
```
|
|
87
99
|
|
|
88
100
|
> AI 编写修复代码,添加 `user+tag@example.com` 的测试用例,运行全部测试 —— 通过。
|
|
89
101
|
|
|
90
102
|
```bash
|
|
91
|
-
/review-
|
|
103
|
+
/review-code TASK-20260319-100000
|
|
92
104
|
```
|
|
93
105
|
|
|
94
106
|
> AI 审查自己的实现:*"通过。0 阻塞项,0 主要问题,1 次要问题(缺少 JSDoc)。"*
|
|
95
107
|
|
|
96
108
|
```bash
|
|
97
|
-
/
|
|
109
|
+
/code-task TASK-20260319-100000
|
|
98
110
|
```
|
|
99
111
|
|
|
100
112
|
> AI 修复次要问题并重新验证。
|
|
@@ -107,7 +119,7 @@ agent-infra 的目标就是把这层共享基础设施标准化。它为所有
|
|
|
107
119
|
|
|
108
120
|
> 提交完成,PR #43 已创建(自动关联 Issue #42),任务归档。
|
|
109
121
|
|
|
110
|
-
**
|
|
122
|
+
**11 条命令,1 次自然语言纠正,从 Issue 到合并 PR。** 这就是完整的 SOP —— 编程也可以有标准作业流程。
|
|
111
123
|
|
|
112
124
|
以上每条命令在 Claude Code、Codex、Gemini CLI、OpenCode 中完全通用。任务进行到一半切换工具,工作流状态照常延续。
|
|
113
125
|
|
|
@@ -115,9 +127,9 @@ agent-infra 的目标就是把这层共享基础设施标准化。它为所有
|
|
|
115
127
|
|
|
116
128
|
这些不是简单的命令别名。每个 skill 都封装了手动操作时容易遗漏或不一致的标准化流程:
|
|
117
129
|
|
|
118
|
-
- **结构化产物** — 每个步骤都输出模板化的文档(`analysis.md`、`plan.md`、`review.md`),格式统一,而非自由发挥的散文
|
|
130
|
+
- **结构化产物** — 每个步骤都输出模板化的文档(`analysis.md`、`review-analysis.md`、`plan.md`、`review-plan.md`、`code.md`、`review-code.md`),格式统一,而非自由发挥的散文
|
|
119
131
|
- **多轮版本化** — 需求变了?再执行一次 `analyze-task` 会生成 `analysis-r2.md`,完整修订历史自动保留
|
|
120
|
-
- **分级审查机制** — `review-
|
|
132
|
+
- **分级审查机制** — `review-code` 按 Blocker / Major / Minor 分类问题,附带文件路径和修复建议,而非含糊的"看着没问题"
|
|
121
133
|
- **跨工具状态延续** — `task.md` 记录了谁在什么时间做了什么;Claude 分析、Codex 实现、Gemini 审查——上下文无缝衔接
|
|
122
134
|
- **审计轨迹与联合署名** — 每个步骤自动追加 Activity Log;最终提交包含所有参与 AI 的 `Co-Authored-By` 署名
|
|
123
135
|
|
|
@@ -202,9 +214,13 @@ CLI 会收集项目元数据,向所有支持的 AI TUI 安装 `update-agent-in
|
|
|
202
214
|
|
|
203
215
|
沙箱镜像也会预装 `gh`。如果宿主机上的 `gh auth token` 能成功返回 token,`ai sandbox create` 会把它以 `GH_TOKEN` 环境变量注入容器,让你在沙箱里直接使用 `gh`,无需额外登录配置。
|
|
204
216
|
|
|
217
|
+
`ai sandbox rebuild` 默认保留 Docker build cache,因此会快速重打沙箱镜像,不会刷新每个软件包。需要升级镜像时使用 `ai sandbox rebuild --refresh`:它会向 Docker 传入 `--no-cache --pull`,重新拉取当前 Ubuntu 基础镜像,并重跑 apt、tmux 编译和全局 npm 安装层。容器内 Claude Code 更新已关闭,OpenCode 启动时更新检查也已关闭;`--refresh` 是沙箱托管工具的常规升级入口。手动 `opencode upgrade` 不受该保护覆盖。Ubuntu 24.04 沙箱基础镜像提供的默认 `python3` 是 Python 3.12,因此硬编码 Python 3.10 路径的脚本可能需要调整。
|
|
218
|
+
|
|
205
219
|
`ai sandbox exec` 也会向容器透传一小组终端检测白名单变量(`TERM_PROGRAM`、`TERM_PROGRAM_VERSION`、`LC_TERMINAL`、`LC_TERMINAL_VERSION`)。这样可以让交互式 TUI 保持与宿主终端一致的行为,例如 Claude Code 的 `Shift+Enter` 换行支持,同时避免把整个宿主环境灌入容器。
|
|
206
220
|
|
|
207
|
-
在 macOS 上,交互式 `ai sandbox exec <branch>` 会尽力桥接宿主图片粘贴。当你按下 `Ctrl+V` 且宿主剪贴板当前是图片时,agent-infra 会从宿主剪贴板读取图片,将 PNG 写到 `~/.agent-infra/clipboard/`,再以 bracketed paste 注入容器内路径,让 Claude Code、Codex、Gemini CLI 和 OpenCode 按图片附件处理。宿主剪贴板只读,不会被改写。该能力会自动降级:已有沙箱需要重建后才有 `/clipboard` 挂载;如果可选 pty
|
|
221
|
+
在 macOS 上,交互式 `ai sandbox exec <branch>` 会尽力桥接宿主图片粘贴。当你按下 `Ctrl+V` 且宿主剪贴板当前是图片时,agent-infra 会从宿主剪贴板读取图片,将 PNG 写到 `~/.agent-infra/clipboard/`,再以 bracketed paste 注入容器内路径,让 Claude Code、Codex、Gemini CLI 和 OpenCode 按图片附件处理。宿主剪贴板只读,不会被改写。该能力会自动降级:已有沙箱需要重建后才有 `/clipboard` 挂载;如果可选 pty 依赖或剪贴板探测不可用,会回退到原本的交互进入方式。排查鼠标、滚动或其他输入异常时,可以设置 `AI_SANDBOX_NO_CLIPBOARD_BRIDGE=1` 跳过桥接,直接进入原本的交互路径。
|
|
222
|
+
|
|
223
|
+
当你通过 SSH 在远端 Mac 上运行沙箱时,可先在手边这台 Mac 上执行 `ai cp <ssh-alias>`,把本机剪贴板图片推送到远端 Mac。典型流程是:Cmd+C 复制图片,运行 `ai cp mini`,回到已有 SSH session 后按 `Ctrl+V`;沙箱桥会读取远端 Mac 的 NSPasteboard,并按原路径注入图片。该命令只处理 PNG 图片,并使用基于 ssh key 的非交互 ssh/scp。目前发送端与远端都需为 macOS(远端通过 `osascript` 写入 NSPasteboard),后续可扩展支持其他远端平台。
|
|
208
224
|
|
|
209
225
|
`ai sandbox exec` 和 `ai sandbox refresh` 会在宿主机凭证存储与 `~/.agent-infra/credentials/*` 下的所有沙箱项目副本之间做双向 reconcile。长时间运行的沙箱如果先刷新了 OAuth token,下一次进入或刷新命令会把最新有效副本回写到宿主 Keychain 或 `~/.claude/.credentials.json`;宿主机更新时也会继续覆盖项目副本。如果所有副本都已失效,`ai sandbox refresh` 会尝试 `claude /status` 探活,只有探活无法恢复时才提示重新登录。
|
|
210
226
|
|
|
@@ -220,6 +236,11 @@ CLI 会收集项目元数据,向所有支持的 AI TUI 安装 `update-agent-in
|
|
|
220
236
|
可先用 `ai sandbox prune --dry-run` 查看旧版本或异常中断遗留的孤儿 per-branch 状态目录,再用 `ai sandbox prune` 只删除没有活跃 sandbox 容器对应的目录。
|
|
221
237
|
已有沙箱需要执行 `ai sandbox rm <branch>` 后再执行 `ai sandbox create <branch>`,才能加载新的挂载点。
|
|
222
238
|
|
|
239
|
+
首次执行 `ai sandbox create` 时,agent-infra 会在
|
|
240
|
+
`~/.agent-infra/share/<project>/common/` 以及每个 `branches/<branch>/`
|
|
241
|
+
目录下写入一份中英双语 `README.md`,帮助你发现这些通道。README 是幂等的,
|
|
242
|
+
可以安全删除;scaffold 仅在文件缺失时写入。
|
|
243
|
+
|
|
223
244
|
#### 用户级 dotfiles 通道
|
|
224
245
|
|
|
225
246
|
`ai sandbox create` 还会自动挂载一条可选的只读通道,用于把宿主机用户级偏好带进沙箱:
|
|
@@ -270,6 +291,7 @@ dotfiles 树解引用到
|
|
|
270
291
|
| `.config/opencode/*`, `.local/share/opencode/*` | OpenCode 凭证和数据使用专用 bind mount。 |
|
|
271
292
|
| `.host-shell-config/*` | agent-infra 管理的 shell 和 Git 配置。 |
|
|
272
293
|
| `.gitconfig`, `.gitignore_global`, `.stCommitMsg`, `.bash_aliases` | agent-infra 将这些路径软链到 `.host-shell-config/`,包含 `safe.directory` 和 GPG 同步状态。 |
|
|
294
|
+
| `README.md` | agent-infra 会在 dotfiles 根目录 scaffold 一份发现性 README;link hook 会忽略它,避免遮蔽 `$HOME/README.md`。 |
|
|
273
295
|
|
|
274
296
|
其他已经存在的真实目录(如 `~/.config/`、`~/.cache/`)不会被顶层 dotfile 替换。如果某个文件与这类目录冲突,钩子会打印警告并跳过:
|
|
275
297
|
|
|
@@ -290,7 +312,7 @@ agent-infra 的结构刻意保持简单:引导 CLI 负责生成种子配置,
|
|
|
290
312
|
1. **安装** — `npm install -g @fitlab-ai/agent-infra`(或在 macOS 上使用 `brew install fitlab-ai/tap/agent-infra`,或使用 shell 脚本便捷封装)
|
|
291
313
|
2. **初始化** — 在项目根目录运行 `ai init`,生成 `.agents/.airc.json` 并安装种子命令
|
|
292
314
|
3. **渲染** — 在任意 AI TUI 中执行 `update-agent-infra`,检测当前打包模板版本并生成所有受管理文件
|
|
293
|
-
4. **开发** — 使用内置 skill 驱动完整生命周期:`analysis →
|
|
315
|
+
4. **开发** — 使用内置 skill 驱动完整生命周期:`analysis → analysis-review → design → design-review → code → code-review → commit`
|
|
294
316
|
5. **升级** — 有新模板版本时再次执行 `update-agent-infra` 即可
|
|
295
317
|
|
|
296
318
|
### 分层架构
|
|
@@ -487,10 +509,11 @@ agent-infra 提供 **丰富的内置 AI skills**。它们按使用场景分组
|
|
|
487
509
|
| `create-task` | 根据自然语言请求创建任务骨架,并在平台规则可用时级联创建 Issue。 | `description` | 从零开始记录新功能、缺陷或改进需求。 |
|
|
488
510
|
| `import-issue` | 将 GitHub Issue 导入本地任务工作区。 | `issue-number` | 把已有 Issue 转成可执行的任务目录。 |
|
|
489
511
|
| `analyze-task` | 为已有任务输出需求分析产物。 | `task-id` | 在设计前明确范围、风险和受影响文件。 |
|
|
490
|
-
| `
|
|
491
|
-
| `
|
|
492
|
-
| `review-
|
|
493
|
-
| `
|
|
512
|
+
| `review-analysis` | 审查需求分析产物,并按严重程度分类问题。 | `task-id` | 在设计前确认分析完整可用。 |
|
|
513
|
+
| `plan-task` | 编写技术实施方案,并设置审查检查点。 | `task-id` | 分析获批后定义具体实现路径。 |
|
|
514
|
+
| `review-plan` | 审查技术方案,并按严重程度分类问题。 | `task-id` | 在编码前确认方案可执行。 |
|
|
515
|
+
| `code-task` | 按批准方案实施,或修复代码审查问题,并生成实现报告。 | `task-id` | 在方案获批后编写代码、测试和文档,或处理 review 反馈。 |
|
|
516
|
+
| `review-code` | 审查实现结果,并按严重程度分类问题。 | `task-id` | 合入前执行结构化代码审查。 |
|
|
494
517
|
| `complete-task` | 在所有关卡通过后标记任务完成并归档。 | `task-id` | 测试、审查和提交都完成后收尾。 |
|
|
495
518
|
|
|
496
519
|
<a id="task-status"></a>
|
|
@@ -657,8 +680,8 @@ args: "<task-id>" # 可选
|
|
|
657
680
|
|
|
658
681
|
| 占位符 | 替换为 | 示例 |
|
|
659
682
|
|--------|--------|------|
|
|
660
|
-
| `${skillName}` | skill 命令名,例如 `review-
|
|
661
|
-
| `${projectName}` | `.airc.json` 中的 `project` 值,适用于带命名空间的命令。 | `/${projectName}:${skillName}` -> `/agent-infra:review-
|
|
683
|
+
| `${skillName}` | skill 命令名,例如 `review-code` 或 `commit`。 | `<your-cli> ${skillName}` -> `<your-cli> review-code` |
|
|
684
|
+
| `${projectName}` | `.airc.json` 中的 `project` 值,适用于带命名空间的命令。 | `/${projectName}:${skillName}` -> `/agent-infra:review-code` |
|
|
662
685
|
|
|
663
686
|
不带命名空间的自定义 TUI:
|
|
664
687
|
|
|
@@ -697,15 +720,15 @@ args: "<task-id>" # 可选
|
|
|
697
720
|
|
|
698
721
|
agent-infra 内置 **4 个预置工作流**。其中 3 个共享同一条分阶段交付链路:
|
|
699
722
|
|
|
700
|
-
`analysis ->
|
|
723
|
+
`analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit`
|
|
701
724
|
|
|
702
725
|
第 4 个 `code-review` 则更轻量,专门用于审查已有 PR 或分支。
|
|
703
726
|
|
|
704
727
|
| Workflow | 适用场景 | 步骤链 |
|
|
705
728
|
|----------|----------|--------|
|
|
706
|
-
| `feature-development` | 开发新功能或新能力 | `analysis ->
|
|
707
|
-
| `bug-fix` | 诊断并修复缺陷,同时补回归验证 | `analysis ->
|
|
708
|
-
| `refactoring` | 进行应保持行为稳定的结构性重构 | `analysis ->
|
|
729
|
+
| `feature-development` | 开发新功能或新能力 | `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit` |
|
|
730
|
+
| `bug-fix` | 诊断并修复缺陷,同时补回归验证 | `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit` |
|
|
731
|
+
| `refactoring` | 进行应保持行为稳定的结构性重构 | `analysis -> analysis-review -> design -> design-review -> code -> code-review -> commit` |
|
|
709
732
|
| `code-review` | 审查已有 Pull Request 或分支 | `analysis -> review -> report` |
|
|
710
733
|
|
|
711
734
|
### 生命周期示例
|
|
@@ -721,20 +744,33 @@ import-issue #42 从 GitHub Issue 导入任务
|
|
|
721
744
|
analyze-task T1 需求分析
|
|
722
745
|
|
|
|
723
746
|
v
|
|
724
|
-
|
|
747
|
+
review-analysis T1 审查需求分析
|
|
748
|
+
|
|
|
749
|
+
有问题?
|
|
750
|
+
+--YES----> analyze-task T1
|
|
751
|
+
|
|
|
752
|
+
v
|
|
753
|
+
plan-task T1 设计方案
|
|
754
|
+
|
|
|
755
|
+
v
|
|
756
|
+
review-plan T1 审查技术方案
|
|
757
|
+
|
|
|
758
|
+
有问题?
|
|
759
|
+
+--YES----> plan-task T1
|
|
760
|
+
|
|
|
725
761
|
|
|
|
726
762
|
v
|
|
727
|
-
|
|
763
|
+
code-task T1 编写代码与测试
|
|
728
764
|
|
|
|
729
765
|
v
|
|
730
|
-
+-> review-
|
|
766
|
+
+-> review-code T1 自动代码审查
|
|
731
767
|
| |
|
|
732
768
|
| 有问题?
|
|
733
769
|
| +--NO-------+
|
|
734
770
|
| YES |
|
|
735
771
|
| | |
|
|
736
772
|
| v |
|
|
737
|
-
|
|
|
773
|
+
| code-task T1 (fix mode)
|
|
738
774
|
| | |
|
|
739
775
|
+------+ |
|
|
740
776
|
|
|
|
@@ -760,7 +796,7 @@ import-issue #42 从 GitHub Issue 导入任务
|
|
|
760
796
|
"project": "my-project",
|
|
761
797
|
"org": "my-org",
|
|
762
798
|
"language": "en",
|
|
763
|
-
"templateVersion": "v0.6.
|
|
799
|
+
"templateVersion": "v0.6.5",
|
|
764
800
|
"templates": {
|
|
765
801
|
"sources": [
|
|
766
802
|
{ "type": "local", "path": "~/private-templates" }
|
package/bin/cli.ts
CHANGED
|
@@ -13,12 +13,13 @@ if (major < 22) {
|
|
|
13
13
|
const USAGE = `agent-infra ${VERSION} - bootstrap AI collaboration infrastructure
|
|
14
14
|
|
|
15
15
|
Usage:
|
|
16
|
-
agent-infra
|
|
17
|
-
agent-infra
|
|
18
|
-
agent-infra
|
|
19
|
-
agent-infra
|
|
20
|
-
agent-infra
|
|
21
|
-
agent-infra
|
|
16
|
+
agent-infra cp <ssh-alias> Copy local clipboard image to a remote macOS NSPasteboard
|
|
17
|
+
agent-infra help Show this help message
|
|
18
|
+
agent-infra init Initialize a new project with update-agent-infra seed command
|
|
19
|
+
agent-infra merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
20
|
+
agent-infra sandbox Manage Docker-based AI sandboxes
|
|
21
|
+
agent-infra update Update seed files and sync file registry for an existing project
|
|
22
|
+
agent-infra version Show version
|
|
22
23
|
|
|
23
24
|
Shorthand: ai (e.g. ai init)
|
|
24
25
|
|
|
@@ -96,6 +97,17 @@ switch (command) {
|
|
|
96
97
|
});
|
|
97
98
|
break;
|
|
98
99
|
}
|
|
100
|
+
case 'cp': {
|
|
101
|
+
const imported = await importCommand('../lib/cp.ts');
|
|
102
|
+
if (!imported) break;
|
|
103
|
+
const { cmdCp } = imported;
|
|
104
|
+
const code = await cmdCp(process.argv.slice(3)).catch((e: unknown) => {
|
|
105
|
+
process.stderr.write(`Error: ${errorMessage(e)}\n`);
|
|
106
|
+
return 1;
|
|
107
|
+
});
|
|
108
|
+
if (code) process.exitCode = code;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
99
111
|
case 'version': {
|
|
100
112
|
if (process.argv[3] === '--raw') {
|
|
101
113
|
console.log(VERSION);
|
package/dist/bin/cli.js
CHANGED
|
@@ -17,12 +17,13 @@ if (major < 22) {
|
|
|
17
17
|
const USAGE = `agent-infra ${VERSION} - bootstrap AI collaboration infrastructure
|
|
18
18
|
|
|
19
19
|
Usage:
|
|
20
|
-
agent-infra
|
|
21
|
-
agent-infra
|
|
22
|
-
agent-infra
|
|
23
|
-
agent-infra
|
|
24
|
-
agent-infra
|
|
25
|
-
agent-infra
|
|
20
|
+
agent-infra cp <ssh-alias> Copy local clipboard image to a remote macOS NSPasteboard
|
|
21
|
+
agent-infra help Show this help message
|
|
22
|
+
agent-infra init Initialize a new project with update-agent-infra seed command
|
|
23
|
+
agent-infra merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
24
|
+
agent-infra sandbox Manage Docker-based AI sandboxes
|
|
25
|
+
agent-infra update Update seed files and sync file registry for an existing project
|
|
26
|
+
agent-infra version Show version
|
|
26
27
|
|
|
27
28
|
Shorthand: ai (e.g. ai init)
|
|
28
29
|
|
|
@@ -99,6 +100,19 @@ switch (command) {
|
|
|
99
100
|
});
|
|
100
101
|
break;
|
|
101
102
|
}
|
|
103
|
+
case 'cp': {
|
|
104
|
+
const imported = await importCommand('../lib/cp.ts');
|
|
105
|
+
if (!imported)
|
|
106
|
+
break;
|
|
107
|
+
const { cmdCp } = imported;
|
|
108
|
+
const code = await cmdCp(process.argv.slice(3)).catch((e) => {
|
|
109
|
+
process.stderr.write(`Error: ${errorMessage(e)}\n`);
|
|
110
|
+
return 1;
|
|
111
|
+
});
|
|
112
|
+
if (code)
|
|
113
|
+
process.exitCode = code;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
102
116
|
case 'version': {
|
|
103
117
|
if (process.argv[3] === '--raw') {
|
|
104
118
|
console.log(VERSION);
|