@fitlab-ai/agent-infra 0.4.4 → 0.4.5

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 CHANGED
@@ -380,7 +380,7 @@ The generated `.agents/.airc.json` file is the central contract between the boot
380
380
  "project": "my-project",
381
381
  "org": "my-org",
382
382
  "language": "en",
383
- "templateVersion": "v0.4.4",
383
+ "templateVersion": "v0.4.5",
384
384
  "files": {
385
385
  "managed": [
386
386
  ".agents/workspace/README.md",
package/README.zh-CN.md CHANGED
@@ -380,7 +380,7 @@ import-issue #42 从 GitHub Issue 导入任务
380
380
  "project": "my-project",
381
381
  "org": "my-org",
382
382
  "language": "en",
383
- "templateVersion": "v0.4.4",
383
+ "templateVersion": "v0.4.5",
384
384
  "files": {
385
385
  "managed": [
386
386
  ".agents/workspace/README.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fitlab-ai/agent-infra",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Gemini CLI, and OpenCode",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,30 @@
1
+ # General Rules - Commit and PR
2
+
3
+ ## Commit Message Format
4
+
5
+ - Use Conventional Commits: `<type>(<scope>): <subject>`
6
+ - Allowed `type` values: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
7
+ - `scope`: module name (optional)
8
+ - Write the `subject` in concise imperative English
9
+
10
+ ## No Automatic Commits
11
+
12
+ - Never run `git commit` or `git add` automatically
13
+ - Enter the commit workflow only when the user explicitly requests a commit
14
+ - After finishing code changes, remind the user to use the appropriate TUI commit command
15
+
16
+ ## PR Rules
17
+
18
+ Before creating a PR, make sure:
19
+ - all tests pass
20
+ - code checks pass
21
+ - the build succeeds
22
+ - public API documentation is updated when applicable
23
+ - copyright header years are updated when applicable
24
+
25
+ ## Copyright Year Updates
26
+
27
+ - Run `date +%Y` first and do not hardcode the year
28
+ - Update examples:
29
+ - `2024-2025` -> `2024-2026`
30
+ - `2024` -> `2024-2026`
@@ -0,0 +1,30 @@
1
+ # 通用规则 - 提交与 PR
2
+
3
+ ## 提交信息格式
4
+
5
+ - 使用 Conventional Commits:`<type>(<scope>): <subject>`
6
+ - `type` 仅限:`feat`、`fix`、`docs`、`refactor`、`test`、`chore`
7
+ - `scope`:模块名(可省略)
8
+ - `subject` 使用英文祈使语气,保持简洁
9
+
10
+ ## 禁止自动提交
11
+
12
+ - 绝对不要自动执行 `git commit` 或 `git add`
13
+ - 仅在用户明确发起提交命令时才进入提交流程
14
+ - 完成代码修改后,提醒用户使用对应 TUI 的提交命令
15
+
16
+ ## PR 提交规则
17
+
18
+ 创建 PR 前必须确保:
19
+ - 所有测试通过
20
+ - 代码检查通过
21
+ - 构建成功
22
+ - 公共 API 已补充文档(如适用)
23
+ - 版权头年份已更新(如适用)
24
+
25
+ ## 版权年份更新
26
+
27
+ - 先运行 `date +%Y` 获取当前年份,不要硬编码
28
+ - 更新格式示例:
29
+ - `2024-2025` -> `2024-2026`
30
+ - `2024` -> `2024-2026`
@@ -88,12 +88,16 @@ Use this format:
88
88
  <!-- sync-issue:{task-id}:{file-stem} -->
89
89
  ## {artifact-title}
90
90
 
91
+ > **{agent}** · {task-id}
92
+
91
93
  {artifact body}
92
94
 
93
95
  ---
94
- *Generated by AI · Internal tracking: {task-id}*
96
+ *Generated by {agent} · Internal tracking: {task-id}*
95
97
  ```
96
98
 
99
+ `{agent}` is the name of the AI agent currently executing the skill (for example `claude`, `codex`, or `gemini`).
100
+
97
101
  `summary` comments need extra handling:
98
102
  - find an existing `<!-- sync-issue:{task-id}:summary -->` comment ID first
99
103
  - create the comment when none exists
@@ -133,6 +137,8 @@ task.md comment format:
133
137
  <!-- sync-issue:{task-id}:task -->
134
138
  ## Task File
135
139
 
140
+ > **{agent}** · {task-id}
141
+
136
142
  <details><summary>Metadata (frontmatter)</summary>
137
143
 
138
144
  ​```yaml
@@ -146,7 +152,7 @@ task.md comment format:
146
152
  {task.md body after frontmatter}
147
153
 
148
154
  ---
149
- *Generated by AI · Internal tracking: {task-id}*
155
+ *Generated by {agent} · Internal tracking: {task-id}*
150
156
  ```
151
157
 
152
158
  When restoring, extract the frontmatter from the `<details>` block and reassemble with the body to recover the original `task.md`.
@@ -159,6 +165,10 @@ Title mapping:
159
165
  - Scan `task.md`, `analysis*.md`, `plan*.md`, `implementation*.md`, `review*.md`, and `refinement*.md` in the task directory
160
166
  - Check whether each `{file-stem}` was already published by its hidden marker; publish only missing artifacts
161
167
  - Backfill only appends missing comments; never delete or reorder existing comments
168
+ - Resolve `{agent}` for backfilled comments in this order:
169
+ 1. Match the artifact filename in Activity Log (for example `→ analysis.md`) and extract the executor from `by {agent}`
170
+ 2. If no match is found, fall back to `assigned_to` in task.md frontmatter
171
+ 3. If `assigned_to` is also unavailable, use the current backfilling agent
162
172
  - Derive the previous and next neighbors from Activity Log order and add this note below the title:
163
173
 
164
174
  ```markdown
@@ -88,12 +88,16 @@ gh api "repos/{owner}/{repo}/issues/{issue-number}/comments" \
88
88
  <!-- sync-issue:{task-id}:{file-stem} -->
89
89
  ## {artifact-title}
90
90
 
91
+ > **{agent}** · {task-id}
92
+
91
93
  {artifact body}
92
94
 
93
95
  ---
94
- *由 AI 自动生成 · 内部追踪:{task-id}*
96
+ *由 {agent} 自动生成 · 内部追踪:{task-id}*
95
97
  ```
96
98
 
99
+ 其中 `{agent}` 使用当前执行该技能的 AI 代理名称(如 `claude`、`codex`、`gemini`)。
100
+
97
101
  `summary` 评论需要额外处理:
98
102
  - 先查找已有 `<!-- sync-issue:{task-id}:summary -->` 评论的 ID
99
103
  - 不存在则创建
@@ -133,6 +137,8 @@ task.md 评论格式:
133
137
  <!-- sync-issue:{task-id}:task -->
134
138
  ## 任务文件
135
139
 
140
+ > **{agent}** · {task-id}
141
+
136
142
  <details><summary>元数据 (frontmatter)</summary>
137
143
 
138
144
  ​```yaml
@@ -146,7 +152,7 @@ task.md 评论格式:
146
152
  {task.md body after frontmatter}
147
153
 
148
154
  ---
149
- *由 AI 自动生成 · 内部追踪:{task-id}*
155
+ *由 {agent} 自动生成 · 内部追踪:{task-id}*
150
156
  ```
151
157
 
152
158
  还原时,从 `<details>` 块中提取 frontmatter,与正文拼合恢复为原始 `task.md`。
@@ -159,6 +165,10 @@ task.md 评论格式:
159
165
  - 扫描任务目录中的 `task.md`、`analysis*.md`、`plan*.md`、`implementation*.md`、`review*.md`、`refinement*.md`
160
166
  - 对每个 `{file-stem}` 用隐藏标记检查是否已发布;未发布则补发,已发布则跳过
161
167
  - 补发只追加缺失评论,不删除或重排已有评论
168
+ - 补发评论的 `{agent}` 按以下顺序确定:
169
+ 1. 从 Activity Log 中匹配对应产物文件名(如 `→ analysis.md`),提取 `by {agent}` 中的执行者
170
+ 2. 若未匹配到,则回退到 task.md frontmatter 的 `assigned_to`
171
+ 3. 若 `assigned_to` 也不可用,则使用当前执行补发的 agent
162
172
  - 位置说明从 Activity Log 推导时间线中的前后邻居,并加在评论标题下方:
163
173
 
164
174
  ```markdown
@@ -0,0 +1,28 @@
1
+ # General Rules - Task Management
2
+
3
+ ## Task Intent Detection
4
+
5
+ Map user intent to the corresponding workflow command:
6
+ - "analyze issue #123" -> `import-issue`
7
+ - "analyze task TASK-20260306-143022" -> `analyze-task`
8
+ - "design a plan" -> `plan-task`
9
+ - "implement" or "build" -> `implement-task`
10
+ - "review" -> `review-task`
11
+ - "fix review feedback" -> `refine-task`
12
+
13
+ ## Task State Management
14
+
15
+ - Update the corresponding `task.md` immediately after every workflow command
16
+ - At minimum, synchronize `current_step`, `updated_at`, `assigned_to`, and the current-round artifact reference
17
+ - Activity Log entries are append-only and must never overwrite history
18
+
19
+ ## Required State Updates by Command
20
+
21
+ - `import-issue`: update `current_step`, `updated_at`, `assigned_to`
22
+ - `analyze-task`: update `current_step`, `updated_at`, `assigned_to`
23
+ - `plan-task`: update `current_step`, `updated_at`
24
+ - `implement-task`: update `current_step`, `updated_at`
25
+ - `review-task`: update `current_step`, `updated_at`
26
+ - `refine-task`: update `current_step`, `updated_at`
27
+ - `complete-task`: update `status`, `completed_at`, `updated_at`
28
+ - `block-task`: update `status`, `blocked_at`, `blocked_reason`
@@ -0,0 +1,28 @@
1
+ # 通用规则 - 任务管理
2
+
3
+ ## 任务语义识别
4
+
5
+ 根据用户意图自动映射到对应工作流命令:
6
+ - “分析 issue #123” -> `import-issue`
7
+ - “分析任务 TASK-20260306-143022” -> `analyze-task`
8
+ - “设计方案” -> `plan-task`
9
+ - “实施/实现” -> `implement-task`
10
+ - “审查” -> `review-task`
11
+ - “修复审查问题” -> `refine-task`
12
+
13
+ ## 任务状态管理
14
+
15
+ - 每次执行工作流命令后,必须立即更新对应任务的 `task.md`
16
+ - 至少同步 `current_step`、`updated_at`、`assigned_to`,以及本轮产物引用
17
+ - Activity Log 只能追加,不能覆盖历史记录
18
+
19
+ ## 常见命令的状态更新要求
20
+
21
+ - `import-issue`:更新 `current_step`、`updated_at`、`assigned_to`
22
+ - `analyze-task`:更新 `current_step`、`updated_at`、`assigned_to`
23
+ - `plan-task`:更新 `current_step`、`updated_at`
24
+ - `implement-task`:更新 `current_step`、`updated_at`
25
+ - `review-task`:更新 `current_step`、`updated_at`
26
+ - `refine-task`:更新 `current_step`、`updated_at`
27
+ - `complete-task`:更新 `status`、`completed_at`、`updated_at`
28
+ - `block-task`:更新 `status`、`blocked_at`、`blocked_reason`
@@ -57,7 +57,7 @@ const DEFAULTS = {
57
57
  }
58
58
  };
59
59
 
60
- const INSTALLER_VERSION = "v0.4.4";
60
+ const INSTALLER_VERSION = "v0.4.5";
61
61
 
62
62
  function norm(p) { return p.replace(/\\/g, '/'); }
63
63