@fitlab-ai/agent-infra 0.5.7 → 0.5.9

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 (132) hide show
  1. package/README.md +44 -4
  2. package/README.zh-CN.md +44 -4
  3. package/lib/defaults.json +4 -2
  4. package/lib/init.js +18 -1
  5. package/lib/sandbox/commands/vm.js +7 -1
  6. package/lib/sandbox/constants.js +3 -0
  7. package/lib/sandbox/engine.js +57 -3
  8. package/lib/sandbox/runtimes/base.dockerfile +9 -2
  9. package/lib/sandbox/shell.js +36 -2
  10. package/lib/update.js +14 -3
  11. package/package.json +6 -4
  12. package/templates/.agents/QUICKSTART.en.md +2 -2
  13. package/templates/.agents/QUICKSTART.zh-CN.md +2 -2
  14. package/templates/.agents/README.en.md +1 -1
  15. package/templates/.agents/README.zh-CN.md +1 -1
  16. package/templates/.agents/rules/create-issue.en.md +5 -0
  17. package/templates/.agents/rules/create-issue.github.en.md +178 -0
  18. package/templates/.agents/rules/create-issue.github.zh-CN.md +178 -0
  19. package/templates/.agents/rules/create-issue.zh-CN.md +5 -0
  20. package/templates/.agents/rules/issue-pr-commands.github.en.md +60 -0
  21. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +60 -0
  22. package/templates/.agents/rules/issue-sync.en.md +14 -0
  23. package/templates/.agents/rules/issue-sync.github.en.md +15 -1
  24. package/templates/.agents/rules/issue-sync.github.zh-CN.md +15 -1
  25. package/templates/.agents/rules/issue-sync.zh-CN.md +14 -0
  26. package/templates/.agents/rules/label-milestone-setup.github.en.md +10 -0
  27. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +10 -0
  28. package/templates/.agents/rules/milestone-inference.github.en.md +2 -2
  29. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +2 -2
  30. package/templates/.agents/rules/release-commands.github.en.md +16 -0
  31. package/templates/.agents/rules/release-commands.github.zh-CN.md +16 -0
  32. package/templates/.agents/scripts/platform-adapters/find-existing-task.github.js +272 -0
  33. package/templates/.agents/scripts/platform-adapters/find-existing-task.js +5 -0
  34. package/templates/.agents/scripts/platform-adapters/platform-sync.github.js +134 -9
  35. package/templates/.agents/scripts/platform-adapters/platform-sync.js +7 -0
  36. package/templates/.agents/skills/analyze-task/SKILL.en.md +3 -3
  37. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -3
  38. package/templates/.agents/skills/analyze-task/config/verify.json +3 -1
  39. package/templates/.agents/skills/block-task/config/verify.json +2 -1
  40. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  41. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  42. package/templates/.agents/skills/cancel-task/config/verify.json +2 -1
  43. package/templates/.agents/skills/close-codescan/SKILL.en.md +2 -2
  44. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +2 -2
  45. package/templates/.agents/skills/commit/SKILL.en.md +1 -1
  46. package/templates/.agents/skills/commit/SKILL.zh-CN.md +1 -1
  47. package/templates/.agents/skills/commit/config/verify.json +2 -1
  48. package/templates/.agents/skills/complete-task/SKILL.en.md +1 -1
  49. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -1
  50. package/templates/.agents/skills/complete-task/config/verify.json +2 -1
  51. package/templates/.agents/skills/create-pr/SKILL.en.md +2 -2
  52. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +2 -2
  53. package/templates/.agents/skills/create-pr/config/verify.json +2 -1
  54. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +7 -17
  55. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +27 -37
  56. package/templates/.agents/skills/create-release-note/SKILL.en.md +9 -9
  57. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +9 -9
  58. package/templates/.agents/skills/create-task/SKILL.en.md +70 -12
  59. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +71 -13
  60. package/templates/.agents/skills/create-task/config/verify.json +6 -1
  61. package/templates/.agents/skills/implement-task/SKILL.en.md +1 -1
  62. package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +1 -1
  63. package/templates/.agents/skills/implement-task/config/verify.json +3 -1
  64. package/templates/.agents/skills/implement-task/reference/implementation-rules.en.md +7 -12
  65. package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +7 -12
  66. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  67. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  68. package/templates/.agents/skills/import-issue/SKILL.en.md +40 -10
  69. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +40 -10
  70. package/templates/.agents/skills/init-labels/SKILL.en.md +9 -9
  71. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -9
  72. package/templates/.agents/skills/init-milestones/SKILL.en.md +7 -7
  73. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +7 -7
  74. package/templates/.agents/skills/plan-task/SKILL.en.md +1 -1
  75. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
  76. package/templates/.agents/skills/plan-task/config/verify.json +3 -1
  77. package/templates/.agents/skills/refine-task/SKILL.en.md +1 -1
  78. package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +1 -1
  79. package/templates/.agents/skills/refine-task/config/verify.json +3 -1
  80. package/templates/.agents/skills/refine-task/reference/fix-workflow.en.md +2 -2
  81. package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +2 -2
  82. package/templates/.agents/skills/restore-task/SKILL.en.md +13 -64
  83. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +13 -64
  84. package/templates/.agents/skills/review-task/SKILL.en.md +1 -1
  85. package/templates/.agents/skills/review-task/SKILL.zh-CN.md +1 -1
  86. package/templates/.agents/skills/review-task/config/verify.json +3 -1
  87. package/templates/.agents/skills/test/SKILL.en.md +45 -6
  88. package/templates/.agents/skills/test/SKILL.zh-CN.md +45 -6
  89. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -0
  90. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -0
  91. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +56 -5
  92. package/templates/.claude/commands/import-issue.en.md +1 -1
  93. package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
  94. package/templates/.claude/commands/init-labels.en.md +1 -1
  95. package/templates/.claude/commands/init-labels.zh-CN.md +1 -1
  96. package/templates/.claude/commands/init-milestones.en.md +1 -1
  97. package/templates/.claude/commands/init-milestones.zh-CN.md +1 -1
  98. package/templates/.claude/commands/restore-task.en.md +1 -1
  99. package/templates/.claude/commands/restore-task.zh-CN.md +1 -1
  100. package/templates/.claude/hooks/check-version-format.sh +1 -1
  101. package/templates/.gemini/commands/_project_/import-issue.en.toml +1 -1
  102. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
  103. package/templates/.gemini/commands/_project_/init-labels.en.toml +2 -2
  104. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +2 -2
  105. package/templates/.gemini/commands/_project_/init-milestones.en.toml +2 -2
  106. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +2 -2
  107. package/templates/.gemini/commands/_project_/restore-task.en.toml +1 -1
  108. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +1 -1
  109. package/templates/{.github/hooks → .git-hooks}/check-version-format.sh +2 -2
  110. package/templates/.github/workflows/pr-label.yml +1 -1
  111. package/templates/.opencode/commands/import-issue.en.md +1 -1
  112. package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
  113. package/templates/.opencode/commands/init-labels.en.md +1 -1
  114. package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
  115. package/templates/.opencode/commands/init-milestones.en.md +1 -1
  116. package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
  117. package/templates/.opencode/commands/restore-task.en.md +1 -1
  118. package/templates/.opencode/commands/restore-task.zh-CN.md +1 -1
  119. package/templates/.agents/skills/create-issue/SKILL.en.md +0 -118
  120. package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +0 -118
  121. package/templates/.agents/skills/create-issue/config/verify.json +0 -29
  122. package/templates/.agents/skills/create-issue/reference/label-and-type.en.md +0 -71
  123. package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +0 -71
  124. package/templates/.agents/skills/create-issue/reference/template-matching.en.md +0 -45
  125. package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +0 -45
  126. package/templates/.claude/commands/create-issue.en.md +0 -8
  127. package/templates/.claude/commands/create-issue.zh-CN.md +0 -8
  128. package/templates/.gemini/commands/_project_/create-issue.en.toml +0 -8
  129. package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +0 -8
  130. package/templates/.opencode/commands/create-issue.en.md +0 -11
  131. package/templates/.opencode/commands/create-issue.zh-CN.md +0 -11
  132. /package/templates/{.github/hooks → .git-hooks}/pre-commit +0 -0
@@ -57,29 +57,30 @@ const DEFAULTS = {
57
57
  ".claude/commands/",
58
58
  ".claude/hooks/",
59
59
  ".gemini/commands/",
60
- ".github/hooks/check-version-format.sh",
60
+ ".git-hooks/check-version-format.sh",
61
61
  ".github/scripts/",
62
62
  ".opencode/commands/"
63
63
  ],
64
64
  "merged": [
65
+ "**/post-release.*",
65
66
  "**/release.*",
66
67
  "**/test-integration.*",
67
68
  "**/test.*",
68
69
  "**/upgrade-dependency.*",
70
+ ".agents/skills/post-release/SKILL.*",
69
71
  ".agents/skills/release/SKILL.*",
70
72
  ".agents/skills/test-integration/SKILL.*",
71
73
  ".agents/skills/test/SKILL.*",
72
74
  ".agents/skills/upgrade-dependency/SKILL.*",
73
75
  ".claude/settings.json",
74
76
  ".gemini/settings.json",
75
- ".github/hooks/pre-commit",
77
+ ".git-hooks/pre-commit",
76
78
  ".gitignore"
77
79
  ],
78
80
  "ejected": []
79
81
  }
80
82
  };
81
83
 
82
- const INSTALLER_VERSION = "v0.5.7";
83
84
  const PACKAGE_NAME = '@fitlab-ai/agent-infra';
84
85
  // Add a new identifier here only after shipping matching .{platform}. template variants.
85
86
  const KNOWN_PLATFORMS = new Set(['github']);
@@ -102,6 +103,16 @@ function isInsideProject(projectRoot, relativePath) {
102
103
  return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
103
104
  }
104
105
 
106
+ function isPathOwnedByOtherPlatform(relativePath, platformType) {
107
+ const normalized = norm(relativePath).replace(/^\.\//, '');
108
+ const top = normalized.split('/')[0];
109
+ if (!top.startsWith('.')) return false;
110
+
111
+ const candidate = top.slice(1);
112
+ if (!KNOWN_PLATFORMS.has(candidate)) return false;
113
+ return candidate !== platformType;
114
+ }
115
+
105
116
  function globMatch(pattern, filePath) {
106
117
  const p = norm(pattern), f = norm(filePath);
107
118
  const globstarDir = '__GLOBSTAR_DIR__';
@@ -141,6 +152,12 @@ function removeEmptyDirs(dir) {
141
152
  }
142
153
  }
143
154
 
155
+ function resolveVersionFromTemplateRoot(tplRoot) {
156
+ const pkgPath = path.join(path.dirname(tplRoot), 'package.json');
157
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
158
+ return 'v' + pkg.version;
159
+ }
160
+
144
161
  function parseSkillFrontmatter(filePath) {
145
162
  const content = fs.readFileSync(filePath, 'utf8');
146
163
  const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
@@ -945,7 +962,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
945
962
  };
946
963
  }
947
964
  }
948
- const version = INSTALLER_VERSION;
965
+ const version = resolveVersionFromTemplateRoot(templateRoot);
949
966
  const hadTemplateSource = Object.prototype.hasOwnProperty.call(cfg, 'templateSource');
950
967
 
951
968
  const { project, org, language: lang = 'en' } = cfg;
@@ -970,7 +987,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
970
987
  errors: [],
971
988
  conflicts: []
972
989
  },
973
- managed: { written: [], created: [], unchanged: [], skippedMerged: [], removed: [] },
990
+ managed: { written: [], created: [], unchanged: [], skippedMerged: [], skippedPlatform: [], removed: [] },
974
991
  custom: {
975
992
  detected: [],
976
993
  generated: [],
@@ -996,9 +1013,11 @@ function syncTemplates(projectRoot, templateRootOverride) {
996
1013
 
997
1014
  const known = new Set([...managed, ...merged, ...ejected]);
998
1015
  for (const e of (DEFAULTS.files.managed || [])) {
1016
+ if (isPathOwnedByOtherPlatform(e, platformType)) continue;
999
1017
  if (!known.has(e)) { managed.push(e); known.add(e); report.registryAdded.push({ entry: e, list: 'managed' }); }
1000
1018
  }
1001
1019
  for (const e of (DEFAULTS.files.merged || [])) {
1020
+ if (isPathOwnedByOtherPlatform(e, platformType)) continue;
1002
1021
  if (!known.has(e)) { merged.push(e); known.add(e); report.registryAdded.push({ entry: e, list: 'merged' }); }
1003
1022
  }
1004
1023
 
@@ -1007,7 +1026,34 @@ function syncTemplates(projectRoot, templateRootOverride) {
1007
1026
  const { mergedRels, sourceMap } = mergeTemplateSources(templateRoot, templateSources, report);
1008
1027
  const allRels = mergedRels;
1009
1028
  const allSet = new Set(allRels);
1029
+
1030
+ for (const entry of [...managed, ...merged, ...ejected]) {
1031
+ if (!isPathOwnedByOtherPlatform(entry, platformType)) continue;
1032
+
1033
+ if (entry.endsWith('/')) {
1034
+ const dir = path.join(projectRoot, entry);
1035
+ if (!fs.existsSync(dir)) continue;
1036
+
1037
+ for (const filePath of walkDir(dir)) {
1038
+ fs.unlinkSync(filePath);
1039
+ report.managed.removed.push(norm(path.relative(projectRoot, filePath)));
1040
+ }
1041
+ removeEmptyDirs(dir);
1042
+ continue;
1043
+ }
1044
+
1045
+ const target = path.join(projectRoot, renderPathname(entry, project));
1046
+ if (!fs.existsSync(target)) continue;
1047
+ fs.unlinkSync(target);
1048
+ report.managed.removed.push(norm(path.relative(projectRoot, target)));
1049
+ }
1050
+
1010
1051
  for (const entry of managed) {
1052
+ if (isPathOwnedByOtherPlatform(entry, platformType)) {
1053
+ report.managed.skippedPlatform.push(entry);
1054
+ continue;
1055
+ }
1056
+
1011
1057
  const isDir = entry.endsWith('/');
1012
1058
  let entryRels;
1013
1059
  const expectedTargets = isDir ? new Set() : null;
@@ -1116,6 +1162,11 @@ function syncTemplates(projectRoot, templateRootOverride) {
1116
1162
 
1117
1163
  const mergedMap = new Map();
1118
1164
  for (const entry of merged) {
1165
+ if (isPathOwnedByOtherPlatform(entry, platformType)) {
1166
+ report.managed.skippedPlatform.push(entry);
1167
+ continue;
1168
+ }
1169
+
1119
1170
  if (entry.includes('*')) {
1120
1171
  const hits = allRels.filter(r => {
1121
1172
  const t = norm(renderPathname(stripLangVariant(r), project));
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Import a GitHub Issue and create a task"
2
+ description: "Import an Issue and create a task"
3
3
  usage: "/import-issue <issue-number>"
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "从 GitHub Issue 导入并创建任务"
2
+ description: "从 Issue 导入并创建任务"
3
3
  usage: "/import-issue <issue-number>"
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Initialize the repository's standard GitHub Labels taxonomy"
2
+ description: "Initialize the repository's standard labels taxonomy"
3
3
  disable-model-invocation: true
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "初始化仓库的 GitHub Labels 体系"
2
+ description: "初始化仓库的 labels 体系"
3
3
  disable-model-invocation: true
4
4
  ---
5
5
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Initialize the repository's standard GitHub Milestones taxonomy"
2
+ description: "Initialize the repository's standard milestones taxonomy"
3
3
  usage: "/init-milestones [--history]"
4
4
  disable-model-invocation: true
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "初始化仓库的 GitHub Milestones 体系"
2
+ description: "初始化仓库的 milestones 体系"
3
3
  usage: "/init-milestones [--history]"
4
4
  disable-model-invocation: true
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Restore local task files from GitHub Issue comments"
2
+ description: "Restore local task files from Issue comments"
3
3
  usage: "/restore-task <issue-number> [task-id]"
4
4
  disable-model-invocation: true
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "从 GitHub Issue 评论还原本地任务文件"
2
+ description: "从 Issue 评论还原本地任务文件"
3
3
  usage: "/restore-task <issue-number> [task-id]"
4
4
  disable-model-invocation: true
5
5
  ---
@@ -29,7 +29,7 @@ repo_root=$(
29
29
  CDPATH= cd -- "$script_dir/../.." && pwd
30
30
  )
31
31
 
32
- if sh "$repo_root/.github/hooks/check-version-format.sh"; then
32
+ if sh "$repo_root/.git-hooks/check-version-format.sh"; then
33
33
  echo "Claude hook: version check passed."
34
34
  exit 0
35
35
  else
@@ -1,4 +1,4 @@
1
- description = "Import a GitHub Issue and create a task"
1
+ description = "Import an Issue and create a task"
2
2
  prompt = """
3
3
  Import Issue #{{args}}.
4
4
 
@@ -1,4 +1,4 @@
1
- description = "从 GitHub Issue 导入并创建任务"
1
+ description = "从 Issue 导入并创建任务"
2
2
  prompt = """
3
3
  导入 Issue #{{args}}。
4
4
 
@@ -1,6 +1,6 @@
1
- description = "Initialize the repository's standard GitHub Labels taxonomy"
1
+ description = "Initialize the repository's standard labels taxonomy"
2
2
  prompt = """
3
- Initialize GitHub Labels for {{project}}.
3
+ Initialize labels for {{project}}.
4
4
 
5
5
  Read and execute the init-labels skill from `.agents/skills/init-labels/SKILL.md`.
6
6
 
@@ -1,6 +1,6 @@
1
- description = "初始化仓库的 GitHub Labels 体系"
1
+ description = "初始化仓库的 labels 体系"
2
2
  prompt = """
3
- 为 {{project}} 初始化 GitHub Labels
3
+ 为 {{project}} 初始化 labels
4
4
 
5
5
  读取并执行 `.agents/skills/init-labels/SKILL.md` 中的 init-labels 技能。
6
6
 
@@ -1,8 +1,8 @@
1
- description = "Initialize the repository's standard GitHub Milestones taxonomy"
1
+ description = "Initialize the repository's standard milestones taxonomy"
2
2
  prompt = """
3
3
  Initialize milestones: {{args}}
4
4
 
5
- Initialize GitHub Milestones for {{project}}.
5
+ Initialize milestones for {{project}}.
6
6
 
7
7
  Read and execute the init-milestones skill from `.agents/skills/init-milestones/SKILL.md`.
8
8
 
@@ -1,8 +1,8 @@
1
- description = "初始化仓库的 GitHub Milestones 体系"
1
+ description = "初始化仓库的 milestones 体系"
2
2
  prompt = """
3
3
  初始化里程碑:{{args}}
4
4
 
5
- 为 {{project}} 初始化 GitHub Milestones
5
+ 为 {{project}} 初始化 milestones
6
6
 
7
7
  读取并执行 `.agents/skills/init-milestones/SKILL.md` 中的 init-milestones 技能。
8
8
 
@@ -1,4 +1,4 @@
1
- description = "Restore local task files from GitHub Issue comments"
1
+ description = "Restore local task files from Issue comments"
2
2
  prompt = """
3
3
  Restore task from Issue: {{args}}
4
4
 
@@ -1,4 +1,4 @@
1
- description = "从 GitHub Issue 评论还原本地任务文件"
1
+ description = "从 Issue 评论还原本地任务文件"
2
2
  prompt = """
3
3
  从 Issue 还原任务:{{args}}
4
4
 
@@ -5,7 +5,7 @@ script_dir=$(
5
5
  CDPATH= cd -- "$(dirname -- "$0")" && pwd
6
6
  )
7
7
  repo_root=$(
8
- CDPATH= cd -- "$script_dir/../.." && pwd
8
+ CDPATH= cd -- "$script_dir/.." && pwd
9
9
  )
10
10
 
11
11
  airc_file="$repo_root/.agents/.airc.json"
@@ -21,7 +21,7 @@ template_version=$(
21
21
  exit 1
22
22
  }
23
23
 
24
- if ! printf '%s\n' "$template_version" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
24
+ if ! printf '%s\n' "$template_version" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$'; then
25
25
  echo "Error: .agents/.airc.json templateVersion must use v-prefixed semver (found: $template_version)."
26
26
  exit 1
27
27
  fi
@@ -26,7 +26,7 @@ jobs:
26
26
  PR_NUMBER: ${{ github.event.pull_request.number }}
27
27
  run: |
28
28
  changed_files=$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/files" \
29
- --paginate --jq '[.[].filename]')
29
+ --paginate --jq '.[].filename' | jq -Rn '[inputs]')
30
30
 
31
31
  should_labels=$(jq -rn \
32
32
  --argjson files "$changed_files" \
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Import a GitHub Issue and create a task"
2
+ description: "Import an Issue and create a task"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "从 GitHub Issue 导入并创建任务"
2
+ description: "从 Issue 导入并创建任务"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Initialize the repository's standard GitHub Labels taxonomy"
2
+ description: "Initialize the repository's standard labels taxonomy"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "初始化仓库的 GitHub Labels 体系"
2
+ description: "初始化仓库的 labels 体系"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Initialize the repository's standard GitHub Milestones taxonomy"
2
+ description: "Initialize the repository's standard milestones taxonomy"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "初始化仓库的 GitHub Milestones 体系"
2
+ description: "初始化仓库的 milestones 体系"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "Restore local task files from GitHub Issue comments"
2
+ description: "Restore local task files from Issue comments"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: "从 GitHub Issue 评论还原本地任务文件"
2
+ description: "从 Issue 评论还原本地任务文件"
3
3
  agent: general
4
4
  subtask: false
5
5
  ---
@@ -1,118 +0,0 @@
1
- ---
2
- name: create-issue
3
- description: "Create a GitHub Issue from a task file"
4
- ---
5
-
6
- # Create Issue
7
-
8
- Create the base GitHub Issue from `task.md` and write `issue_number` back to the task.
9
-
10
- ## Boundary / Critical Rules
11
-
12
- - Build the Issue title and body from `task.md` only
13
- - Issue title format: `type(scope): description` - map `type` from task.md (`feature` -> `feat`, `bugfix` -> `fix`, `refactor` -> `refactor`, `docs` -> `docs`, `chore` -> `chore`), infer scope from the affected module (omit it if unclear), and use the task title from task.md verbatim for the description (do not translate or rewrite)
14
- - Do not read `analysis.md`, `plan.md`, `implementation.md`, or review artifacts
15
- - The only durable outputs are the GitHub Issue and the `issue_number` update in task.md
16
- - After executing this skill, you **must** immediately update task.md
17
-
18
- ## Steps
19
-
20
- ### 1. Verify Prerequisites
21
-
22
- Check:
23
- - `.agents/workspace/active/{task-id}/task.md`
24
- - read `.agents/rules/issue-pr-commands.md` first, then follow its prerequisite steps to complete authentication and code-hosting platform detection
25
-
26
- If `issue_number` already exists and is not empty or `N/A`, confirm with the user before creating a replacement Issue.
27
-
28
- ### 2. Extract Task Information
29
-
30
- Extract the title, `## Description`, `## Requirements`, `type`, and `milestone` from task.md. Build the Issue title by mapping task.md `type` to a Conventional Commits type, inferring scope, and formatting it as `cc_type(scope): task_title` or `cc_type: task_title` when scope is unclear. If task.md does not provide an explicit `milestone` field, infer it by following "Phase 1: `create-issue`" in `.agents/rules/milestone-inference.md`.
31
-
32
- ### 3. Build Issue Content
33
-
34
- Detect `.github/ISSUE_TEMPLATE` files and decide whether to use a matched template path or the fallback path.
35
-
36
- > Template detection, field mapping for `textarea`, `input`, `dropdown`, and `checkboxes`, and the fallback body rules live in `reference/template-matching.md`. Read `reference/template-matching.md` before building the body.
37
-
38
- > Label filtering, Issue Type fallback, `issue-types` API handling, `milestone` logic, `--milestone`, and `in:` label rules live in `reference/label-and-type.md`. Read `reference/label-and-type.md` before creating the Issue.
39
-
40
- ### 4. Create the Issue
41
-
42
- Create and enrich the Issue by following the "Create Issue" and "Set the Issue Type" sections in `.agents/rules/issue-pr-commands.md`. Omit label arguments when nothing valid remains.
43
-
44
- Handle labels, milestone, Issue Type, and assignee behavior by following the permission-degradation rules in `.agents/rules/issue-pr-commands.md` and `.agents/rules/issue-sync.md`.
45
-
46
- ### 5. Update Task Status
47
-
48
- Get the current time:
49
-
50
- ```bash
51
- date "+%Y-%m-%d %H:%M:%S%:z"
52
- ```
53
-
54
- Write back `issue_number`, update `updated_at`, and append the Create Issue Activity Log entry.
55
-
56
- ### 5.1 Backfill Existing Artifacts
57
-
58
- If artifact files already exist in the task directory, backfill them in this order:
59
-
60
- 1. `task.md` -> `<!-- sync-issue:{task-id}:task -->` comment (idempotent create or update)
61
- 2. Backfill existing `analysis*.md`, `plan*.md`, `implementation*.md`, `review*.md`, and `refinement*.md` files in filename order
62
-
63
- Every backfill action must follow the raw publishing, task.md sync, and chunking rules in `.agents/rules/issue-sync.md`.
64
-
65
- ### 6. Verification Gate
66
-
67
- Run the verification gate to confirm the task artifact and sync state are valid:
68
-
69
- ```bash
70
- node .agents/scripts/validate-artifact.js gate create-issue .agents/workspace/active/{task-id} --format text
71
- ```
72
-
73
- Handle the result as follows:
74
- - exit code 0 (all checks passed) -> continue to the "Inform User" step
75
- - exit code 1 (validation failed) -> fix the reported issues and run the gate again
76
- - exit code 2 (network blocked) -> stop and tell the user that human intervention is required
77
-
78
- Keep the gate output in your reply as fresh evidence. Do not claim completion without output from this run.
79
-
80
- ### 7. Inform User
81
-
82
- > Execute this step only after the verification gate passes.
83
-
84
- > **IMPORTANT**: All TUI command formats listed below must be output in full. Do not show only the format for the current AI agent. If `.agents/.airc.json` configures custom TUIs (via `customTUIs`), read each tool's `name` and `invoke`, then add the matching command line in the same format (`${skillName}` becomes the skill name and `${projectName}` becomes the project name).
85
-
86
- Show the Issue number, URL, labels, Issue Type, milestone result, confirm that `issue_number` was written back, and include the next-step commands in every TUI format:
87
-
88
- ```
89
- Next step - run requirements analysis:
90
- - Claude Code / OpenCode: /analyze-task {task-id}
91
- - Gemini CLI: /{{project}}:analyze-task {task-id}
92
- - Codex CLI: $analyze-task {task-id}
93
- ```
94
-
95
- ## Completion Checklist
96
-
97
- - [ ] Created the GitHub Issue
98
- - [ ] Used `task.md` as the only content source
99
- - [ ] Recorded `issue_number` in task.md
100
- - [ ] Updated `updated_at` and appended the Activity Log entry
101
- - [ ] Included all TUI formats, including any custom TUIs, for the next-step commands
102
-
103
- ## STOP
104
-
105
- Stop after the checklist. Do not start detailed progress sync here.
106
-
107
- ## Notes
108
-
109
- - `create-issue` creates the base Issue; later status, comments, and checkboxes are maintained by workflow skills and GitHub Actions
110
- - If no valid labels survive filtering, create the Issue without labels instead of failing
111
- - If Issue Type or milestone setup fails, continue and record the fallback outcome
112
-
113
- ## Error Handling
114
-
115
- - Task not found: `Task {task-id} not found`
116
- - GitHub CLI unavailable or unauthenticated
117
- - Empty description in task.md
118
- - Issue creation failure
@@ -1,118 +0,0 @@
1
- ---
2
- name: create-issue
3
- description: "从任务文件创建 GitHub Issue"
4
- ---
5
-
6
- # 创建 Issue
7
-
8
- 仅从 `task.md` 创建基础 GitHub Issue,并把 `issue_number` 回写到任务文件。
9
-
10
- ## 行为边界 / 关键规则
11
-
12
- - Issue 标题和正文只能来自 `task.md`
13
- - Issue 标题格式为 `type(scope): 描述`——type 从 task.md 的 `type` 字段映射(feature→feat, bugfix→fix, refactor→refactor, docs→docs, chore→chore),scope 从受影响模块推断(无法确定时省略),描述使用 task.md 中的任务标题原文(不要翻译或改写)
14
- - 不要读取 `analysis.md`、`plan.md`、`implementation.md` 或审查产物
15
- - 持久产物只有 GitHub Issue 本身,以及 task.md 中的 `issue_number` 更新
16
- - 执行本技能后,你**必须**立即更新 task.md
17
-
18
- ## 执行步骤
19
-
20
- ### 1. 验证前置条件
21
-
22
- 检查:
23
- - `.agents/workspace/active/{task-id}/task.md`
24
- - 执行前先读取 `.agents/rules/issue-pr-commands.md`,并按其中的前置步骤完成认证和代码托管平台检测
25
-
26
- 如果 `issue_number` 已存在且既不为空也不为 `N/A`,创建前必须先与用户确认。
27
-
28
- ### 2. 提取任务信息
29
-
30
- 从 task.md 提取标题、`## Description`、`## Requirements`、`type` 和 `milestone`。构造 Issue 标题:将 task.md 的 `type` 映射为 Conventional Commits type,推断 scope,拼接为 `cc_type(scope): task_title` 或 `cc_type: task_title`(scope 不确定时省略)。如果 task.md 没有显式 `milestone` 字段,按 `.agents/rules/milestone-inference.md` 的「阶段 1:`create-issue`」推断。
31
-
32
- ### 3. 构建 Issue 内容
33
-
34
- 检测 `.github/ISSUE_TEMPLATE`,决定使用模板路径还是 fallback 路径。
35
-
36
- > 模板识别、`textarea`、`input`、`dropdown`、`checkboxes` 字段映射,以及 fallback 正文规则见 `reference/template-matching.md`。构建正文前先读取 `reference/template-matching.md`。
37
-
38
- > `labels:` 过滤、Issue Type fallback、`issue-types` API、`milestone` 逻辑、`--milestone` 和 `in:` label 规则见 `reference/label-and-type.md`。创建 Issue 前先读取 `reference/label-and-type.md`。
39
-
40
- ### 4. 创建 Issue
41
-
42
- 按 `.agents/rules/issue-pr-commands.md` 中的 “创建 Issue” 与 “Issue Type 设置” 规则创建并补充 Issue;如果没有有效 label,就省略 label 参数。
43
-
44
- Label、milestone、Issue Type 和 assignee 的具体处理方式,都按 `.agents/rules/issue-pr-commands.md` 与 `.agents/rules/issue-sync.md` 中的权限降级规则执行。
45
-
46
- ### 5. 更新任务状态
47
-
48
- 获取当前时间:
49
-
50
- ```bash
51
- date "+%Y-%m-%d %H:%M:%S%:z"
52
- ```
53
-
54
- 回写 `issue_number`,更新 `updated_at`,并追加 Create Issue 的 Activity Log。
55
-
56
- ### 5.1 补发已有产物
57
-
58
- 如果任务目录中已存在产物文件,按以下顺序补发:
59
-
60
- 1. `task.md` → `<!-- sync-issue:{task-id}:task -->` 评论(幂等创建或更新)
61
- 2. 按文件名排序补发已存在的 `analysis*.md`、`plan*.md`、`implementation*.md`、`review*.md`、`refinement*.md`
62
-
63
- 所有补发动作都必须遵循 `.agents/rules/issue-sync.md` 的原文发布、task.md 同步和分片规则。
64
-
65
- ### 6. 完成校验
66
-
67
- 运行完成校验,确认任务产物和同步状态符合规范:
68
-
69
- ```bash
70
- node .agents/scripts/validate-artifact.js gate create-issue .agents/workspace/active/{task-id} --format text
71
- ```
72
-
73
- 处理结果:
74
- - 退出码 0(全部通过)-> 继续到「告知用户」步骤
75
- - 退出码 1(校验失败)-> 根据输出修复问题后重新运行校验
76
- - 退出码 2(网络中断)-> 停止执行并告知用户需要人工介入
77
-
78
- 将校验输出保留在回复中作为当次验证输出。没有当次校验输出,不得声明完成。
79
-
80
- ### 7. 告知用户
81
-
82
- > 仅在校验通过后执行本步骤。
83
-
84
- > **重要**:以下「下一步」中列出的所有 TUI 命令格式必须完整输出,不要只展示当前 AI 代理对应的格式。如果 `.agents/.airc.json` 中配置了自定义 TUI(`customTUIs`),读取每个工具的 `name` 和 `invoke`,按同样格式补充对应命令行(`${skillName}` 替换为技能名,`${projectName}` 替换为项目名)。
85
-
86
- 展示 Issue 编号、URL、labels、Issue Type、milestone 结果,确认 `issue_number` 已回写,并完整输出所有 TUI 里的下一步命令:
87
-
88
- ```
89
- 下一步 - 执行需求分析:
90
- - Claude Code / OpenCode:/analyze-task {task-id}
91
- - Gemini CLI:/agent-infra:analyze-task {task-id}
92
- - Codex CLI:$analyze-task {task-id}
93
- ```
94
-
95
- ## 完成检查清单
96
-
97
- - [ ] 已创建 GitHub Issue
98
- - [ ] 已仅使用 `task.md` 作为内容来源
99
- - [ ] 已在 task.md 中记录 `issue_number`
100
- - [ ] 已更新 `updated_at` 并追加 Activity Log
101
- - [ ] 已输出所有 TUI 格式的下一步命令(含自定义 TUI)
102
-
103
- ## 停止
104
-
105
- 完成检查清单后立即停止。不要在本技能里继续做详细进度同步。
106
-
107
- ## 注意事项
108
-
109
- - `create-issue` 只负责创建基础 Issue;后续状态、评论和复选框由工作流技能与 GitHub Actions 维护
110
- - 如果过滤后没有有效 label,允许不带 label 创建 Issue
111
- - 如果 Issue Type 或 milestone 设置失败,继续执行并记录结果
112
-
113
- ## 错误处理
114
-
115
- - 任务未找到:`Task {task-id} not found`
116
- - GitHub CLI 不可用或未认证
117
- - task.md 的描述为空
118
- - 创建 Issue 失败
@@ -1,29 +0,0 @@
1
- {
2
- "skill": "create-issue",
3
- "checks": {
4
- "task-meta": {
5
- "required_fields": [
6
- "id",
7
- "type",
8
- "workflow",
9
- "status",
10
- "created_at",
11
- "updated_at",
12
- "current_step",
13
- "assigned_to"
14
- ],
15
- "require_issue_number": true
16
- },
17
- "activity-log": {
18
- "expected_action_pattern": "Create Issue",
19
- "freshness_minutes": 30
20
- },
21
- "platform-sync": {
22
- "when": "issue_number_exists",
23
- "issue_must_exist": true,
24
- "verify_task_comment_content": true,
25
- "verify_issue_type": true,
26
- "verify_milestone": true
27
- }
28
- }
29
- }