@haaaiawd/anws 2.3.0 → 2.4.1

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 (95) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +53 -23
  3. package/lib/diff.js +5 -2
  4. package/lib/init.js +217 -96
  5. package/lib/install-state.js +18 -3
  6. package/lib/manifest.js +364 -79
  7. package/lib/prompt.js +68 -0
  8. package/lib/resources/index.js +36 -2
  9. package/lib/update.js +12 -6
  10. package/package.json +48 -47
  11. package/templates/.agents/skills/anws-system/SKILL.md +107 -105
  12. package/templates/.agents/skills/code-reviewer/SKILL.md +171 -115
  13. package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
  14. package/templates/.agents/skills/craft-authoring/SKILL.md +186 -183
  15. package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +42 -0
  16. package/templates/.agents/skills/design-reviewer/SKILL.md +265 -190
  17. package/templates/.agents/skills/e2e-testing-guide/SKILL.md +246 -135
  18. package/templates/.agents/skills/nexus-mapper/SKILL.md +321 -321
  19. package/templates/.agents/skills/nexus-mapper/references/probe-protocol.md +1 -1
  20. package/templates/.agents/skills/nexus-query/SKILL.md +1 -1
  21. package/templates/.agents/skills/output-contract/SKILL.md +37 -0
  22. package/templates/.agents/skills/runtime-inspector/SKILL.md +150 -99
  23. package/templates/.agents/skills/sequential-thinking/SKILL.md +222 -225
  24. package/templates/.agents/skills/spec-writer/SKILL.md +75 -30
  25. package/templates/.agents/skills/system-architect/SKILL.md +538 -678
  26. package/templates/.agents/skills/system-designer/SKILL.md +124 -537
  27. package/templates/.agents/skills/task-planner/SKILL.md +1 -2
  28. package/templates/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +2 -2
  29. package/templates/.agents/skills/task-reviewer/SKILL.md +421 -386
  30. package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
  31. package/templates/.agents/workflows/blueprint.md +156 -68
  32. package/templates/.agents/workflows/challenge.md +322 -494
  33. package/templates/.agents/workflows/change.md +182 -339
  34. package/templates/.agents/workflows/craft.md +159 -197
  35. package/templates/.agents/workflows/design-system.md +202 -674
  36. package/templates/.agents/workflows/explore.md +187 -399
  37. package/templates/.agents/workflows/forge.md +650 -609
  38. package/templates/.agents/workflows/genesis.md +438 -351
  39. package/templates/.agents/workflows/probe.md +215 -240
  40. package/templates/.agents/workflows/quickstart.md +304 -123
  41. package/templates/.agents/workflows/upgrade.md +145 -182
  42. package/templates_en/.agents/skills/anws-system/SKILL.md +110 -0
  43. package/templates_en/.agents/skills/code-reviewer/SKILL.md +171 -0
  44. package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
  45. package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
  46. package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +42 -0
  47. package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
  48. package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
  49. package/templates_en/.agents/skills/design-reviewer/SKILL.md +264 -0
  50. package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
  51. package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
  52. package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
  53. package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
  54. package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  55. package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  56. package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  57. package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  58. package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  59. package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  60. package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
  61. package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
  62. package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
  63. package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
  64. package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
  65. package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
  66. package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
  67. package/templates_en/.agents/skills/runtime-inspector/SKILL.md +150 -0
  68. package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
  69. package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
  70. package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
  71. package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
  72. package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
  73. package/templates_en/.agents/skills/system-designer/SKILL.md +188 -0
  74. package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
  75. package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
  76. package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
  77. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
  78. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
  79. package/templates_en/.agents/skills/task-reviewer/SKILL.md +422 -0
  80. package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
  81. package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
  82. package/templates_en/.agents/workflows/blueprint.md +200 -0
  83. package/templates_en/.agents/workflows/challenge.md +326 -0
  84. package/templates_en/.agents/workflows/change.md +182 -0
  85. package/templates_en/.agents/workflows/craft.md +159 -0
  86. package/templates_en/.agents/workflows/design-system.md +202 -0
  87. package/templates_en/.agents/workflows/explore.md +187 -0
  88. package/templates_en/.agents/workflows/forge.md +651 -0
  89. package/templates_en/.agents/workflows/genesis.md +438 -0
  90. package/templates_en/.agents/workflows/probe.md +215 -0
  91. package/templates_en/.agents/workflows/quickstart.md +305 -0
  92. package/templates_en/.agents/workflows/upgrade.md +145 -0
  93. package/templates_en/AGENTS.md +149 -0
  94. package/templates/.agents/skills/report-template/SKILL.md +0 -92
  95. package/templates/.agents/skills/report-template/references/REPORT_TEMPLATE.md +0 -100
@@ -63,6 +63,17 @@ function dedupeTargets(targets) {
63
63
  return Array.from(map.values()).sort((a, b) => a.targetId.localeCompare(b.targetId));
64
64
  }
65
65
 
66
+ function normalizeTemplateLocale(value) {
67
+ if (value == null || value === '') {
68
+ return 'zh';
69
+ }
70
+ const v = String(value).toLowerCase();
71
+ if (v === 'zh' || v === 'en') {
72
+ return v;
73
+ }
74
+ throw new Error('Invalid install-lock: templateLocale must be "zh" or "en"');
75
+ }
76
+
66
77
  function normalizeInstallLock(input) {
67
78
  const source = ensureObject(input, 'install-lock');
68
79
  const schemaVersion = source.schemaVersion ?? source.lockVersion ?? INSTALL_LOCK_VERSION;
@@ -80,23 +91,26 @@ function normalizeInstallLock(input) {
80
91
  failedTargets: Array.from(new Set(ensureArray(source.lastUpdateSummary.failedTargets || [], 'lastUpdateSummary.failedTargets'))),
81
92
  updatedAt: ensureString(source.lastUpdateSummary.updatedAt, 'lastUpdateSummary.updatedAt')
82
93
  };
94
+ const templateLocale = normalizeTemplateLocale(source.templateLocale);
83
95
 
84
96
  return {
85
97
  schemaVersion,
86
98
  cliVersion,
87
99
  generatedAt,
88
100
  targets,
89
- lastUpdateSummary
101
+ lastUpdateSummary,
102
+ templateLocale
90
103
  };
91
104
  }
92
105
 
93
- function createInstallLock({ cliVersion, generatedAt, targets = [], lastUpdateSummary = null }) {
106
+ function createInstallLock({ cliVersion, generatedAt, targets = [], lastUpdateSummary = null, templateLocale }) {
94
107
  return normalizeInstallLock({
95
108
  schemaVersion: INSTALL_LOCK_VERSION,
96
109
  cliVersion,
97
110
  generatedAt,
98
111
  targets,
99
- lastUpdateSummary
112
+ lastUpdateSummary,
113
+ templateLocale
100
114
  });
101
115
  }
102
116
 
@@ -201,6 +215,7 @@ module.exports = {
201
215
  getInstallLockPath,
202
216
  normalizeInstallLock,
203
217
  normalizeTargetInstallation,
218
+ normalizeTemplateLocale,
204
219
  readInstallLock,
205
220
  summarizeTargetState,
206
221
  writeInstallLock
package/lib/manifest.js CHANGED
@@ -1,56 +1,327 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
- const { getTarget } = require('./adapters');
3
+ const { getTarget } = require("./adapters");
4
4
 
5
5
  /**
6
- * MANAGED_FILES — anws 托管文件清单
6
+ * RESOURCE_REGISTRYCLI `anws init` / `anws update` 的唯一「复制来源清单」
7
7
  *
8
- * 此数组列出 anws 包负责管理的所有文件路径(相对于目标项目根目录)。
8
+ * - 每条 `source` 相对于 **`templates/`** 下的相对路径(见 `lib/resources` 的 `TEMPLATE_ROOT`);校验脚本只验证该根。
9
+ * - **`resolveCanonicalPath(rel, templateLocale)`**:`zh` 读 `templates/`;`en` 优先 `templates_en/` 同源路径,缺失则回退 `templates/`(由 `anws init --locale` / install-lock `templateLocale` 驱动)。
10
+ * - **`templates/` 磁盘上可能存在未在此登记的路径**(遗留或备用);未登记则 **不会** 投影到用户项目。
11
+ * - 发货模板为 **workflow/skill 正文**(与 `RESOURCE_REGISTRY` 登记一致);安装边界与维护约定见
12
+ * **`templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md`**(及 `templates_en/` 镜像)。
9
13
  */
10
14
  const RESOURCE_REGISTRY = [
11
- { id: 'blueprint', type: 'workflow', source: '.agents/workflows/blueprint.md', fileName: 'blueprint.md' },
12
- { id: 'challenge', type: 'workflow', source: '.agents/workflows/challenge.md', fileName: 'challenge.md' },
13
- { id: 'change', type: 'workflow', source: '.agents/workflows/change.md', fileName: 'change.md' },
14
- { id: 'craft', type: 'workflow', source: '.agents/workflows/craft.md', fileName: 'craft.md' },
15
- { id: 'design-system', type: 'workflow', source: '.agents/workflows/design-system.md', fileName: 'design-system.md' },
16
- { id: 'explore', type: 'workflow', source: '.agents/workflows/explore.md', fileName: 'explore.md' },
17
- { id: 'forge', type: 'workflow', source: '.agents/workflows/forge.md', fileName: 'forge.md' },
18
- { id: 'genesis', type: 'workflow', source: '.agents/workflows/genesis.md', fileName: 'genesis.md' },
19
- { id: 'probe', type: 'workflow', source: '.agents/workflows/probe.md', fileName: 'probe.md' },
20
- { id: 'quickstart', type: 'workflow', source: '.agents/workflows/quickstart.md', fileName: 'quickstart.md' },
21
- { id: 'upgrade', type: 'workflow', source: '.agents/workflows/upgrade.md', fileName: 'upgrade.md' },
22
- { id: 'anws-system', type: 'skill', source: '.agents/skills/anws-system/SKILL.md', fileName: 'anws-system/SKILL.md', targets: ['codex', 'trae'] },
23
- { id: 'concept-modeler', type: 'skill', source: '.agents/skills/concept-modeler/SKILL.md', fileName: 'concept-modeler/SKILL.md' },
24
- { id: 'code-reviewer', type: 'skill', source: '.agents/skills/code-reviewer/SKILL.md', fileName: 'code-reviewer/SKILL.md' },
25
- { id: 'design-reviewer', type: 'skill', source: '.agents/skills/design-reviewer/SKILL.md', fileName: 'design-reviewer/SKILL.md' },
26
- { id: 'nexus-mapper', type: 'skill', source: '.agents/skills/nexus-mapper/SKILL.md', fileName: 'nexus-mapper/SKILL.md' },
27
- { id: 'nexus-mapper-language-customization', type: 'skill', source: '.agents/skills/nexus-mapper/references/language-customization.md', fileName: 'nexus-mapper/references/language-customization.md' },
28
- { id: 'nexus-mapper-output-schema', type: 'skill', source: '.agents/skills/nexus-mapper/references/output-schema.md', fileName: 'nexus-mapper/references/output-schema.md' },
29
- { id: 'nexus-mapper-probe-protocol', type: 'skill', source: '.agents/skills/nexus-mapper/references/probe-protocol.md', fileName: 'nexus-mapper/references/probe-protocol.md' },
30
- { id: 'nexus-mapper-extract-ast', type: 'skill', source: '.agents/skills/nexus-mapper/scripts/extract_ast.py', fileName: 'nexus-mapper/scripts/extract_ast.py' },
31
- { id: 'nexus-mapper-git-detective', type: 'skill', source: '.agents/skills/nexus-mapper/scripts/git_detective.py', fileName: 'nexus-mapper/scripts/git_detective.py' },
32
- { id: 'nexus-mapper-languages', type: 'skill', source: '.agents/skills/nexus-mapper/scripts/languages.json', fileName: 'nexus-mapper/scripts/languages.json' },
33
- { id: 'nexus-mapper-query-graph', type: 'skill', source: '.agents/skills/nexus-mapper/scripts/query_graph.py', fileName: 'nexus-mapper/scripts/query_graph.py' },
34
- { id: 'nexus-mapper-requirements', type: 'skill', source: '.agents/skills/nexus-mapper/scripts/requirements.txt', fileName: 'nexus-mapper/scripts/requirements.txt' },
35
- { id: 'report-template', type: 'skill', source: '.agents/skills/report-template/SKILL.md', fileName: 'report-template/SKILL.md' },
36
- { id: 'report-template-reference', type: 'skill', source: '.agents/skills/report-template/references/REPORT_TEMPLATE.md', fileName: 'report-template/references/REPORT_TEMPLATE.md' },
37
- { id: 'runtime-inspector', type: 'skill', source: '.agents/skills/runtime-inspector/SKILL.md', fileName: 'runtime-inspector/SKILL.md' },
38
- { id: 'sequential-thinking', type: 'skill', source: '.agents/skills/sequential-thinking/SKILL.md', fileName: 'sequential-thinking/SKILL.md' },
39
- { id: 'spec-writer', type: 'skill', source: '.agents/skills/spec-writer/SKILL.md', fileName: 'spec-writer/SKILL.md' },
40
- { id: 'spec-writer-prd-template', type: 'skill', source: '.agents/skills/spec-writer/references/prd_template.md', fileName: 'spec-writer/references/prd_template.md' },
41
- { id: 'system-architect', type: 'skill', source: '.agents/skills/system-architect/SKILL.md', fileName: 'system-architect/SKILL.md' },
42
- { id: 'system-architect-rfc-template', type: 'skill', source: '.agents/skills/system-architect/references/rfc_template.md', fileName: 'system-architect/references/rfc_template.md' },
43
- { id: 'system-designer', type: 'skill', source: '.agents/skills/system-designer/SKILL.md', fileName: 'system-designer/SKILL.md' },
44
- { id: 'system-designer-detail-template', type: 'skill', source: '.agents/skills/system-designer/references/system-design-detail-template.md', fileName: 'system-designer/references/system-design-detail-template.md' },
45
- { id: 'system-designer-template', type: 'skill', source: '.agents/skills/system-designer/references/system-design-template.md', fileName: 'system-designer/references/system-design-template.md' },
46
- { id: 'task-planner', type: 'skill', source: '.agents/skills/task-planner/SKILL.md', fileName: 'task-planner/SKILL.md' },
47
- { id: 'task-planner-template-05a', type: 'skill', source: '.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md', fileName: 'task-planner/references/TASK_TEMPLATE_05A.md' },
48
- { id: 'task-planner-template-05b', type: 'skill', source: '.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md', fileName: 'task-planner/references/TASK_TEMPLATE_05B.md' },
49
- { id: 'task-reviewer', type: 'skill', source: '.agents/skills/task-reviewer/SKILL.md', fileName: 'task-reviewer/SKILL.md' },
50
- { id: 'tech-evaluator', type: 'skill', source: '.agents/skills/tech-evaluator/SKILL.md', fileName: 'tech-evaluator/SKILL.md' },
51
- { id: 'tech-evaluator-adr-template', type: 'skill', source: '.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md', fileName: 'tech-evaluator/references/ADR_TEMPLATE.md' },
52
- { id: 'e2e-testing-guide', type: 'skill', source: '.agents/skills/e2e-testing-guide/SKILL.md', fileName: 'e2e-testing-guide/SKILL.md' },
53
- { id: 'craft-authoring', type: 'skill', source: '.agents/skills/craft-authoring/SKILL.md', fileName: 'craft-authoring/SKILL.md' }
15
+ {
16
+ id: "blueprint",
17
+ type: "workflow",
18
+ source: ".agents/workflows/blueprint.md",
19
+ fileName: "blueprint.md",
20
+ },
21
+ {
22
+ id: "challenge",
23
+ type: "workflow",
24
+ source: ".agents/workflows/challenge.md",
25
+ fileName: "challenge.md",
26
+ },
27
+ {
28
+ id: "change",
29
+ type: "workflow",
30
+ source: ".agents/workflows/change.md",
31
+ fileName: "change.md",
32
+ },
33
+ {
34
+ id: "craft",
35
+ type: "workflow",
36
+ source: ".agents/workflows/craft.md",
37
+ fileName: "craft.md",
38
+ },
39
+ {
40
+ id: "design-system",
41
+ type: "workflow",
42
+ source: ".agents/workflows/design-system.md",
43
+ fileName: "design-system.md",
44
+ },
45
+ {
46
+ id: "explore",
47
+ type: "workflow",
48
+ source: ".agents/workflows/explore.md",
49
+ fileName: "explore.md",
50
+ },
51
+ {
52
+ id: "forge",
53
+ type: "workflow",
54
+ source: ".agents/workflows/forge.md",
55
+ fileName: "forge.md",
56
+ },
57
+ {
58
+ id: "genesis",
59
+ type: "workflow",
60
+ source: ".agents/workflows/genesis.md",
61
+ fileName: "genesis.md",
62
+ },
63
+ {
64
+ id: "probe",
65
+ type: "workflow",
66
+ source: ".agents/workflows/probe.md",
67
+ fileName: "probe.md",
68
+ },
69
+ {
70
+ id: "quickstart",
71
+ type: "workflow",
72
+ source: ".agents/workflows/quickstart.md",
73
+ fileName: "quickstart.md",
74
+ },
75
+ {
76
+ id: "upgrade",
77
+ type: "workflow",
78
+ source: ".agents/workflows/upgrade.md",
79
+ fileName: "upgrade.md",
80
+ },
81
+ {
82
+ id: "anws-system",
83
+ type: "skill",
84
+ source: ".agents/skills/anws-system/SKILL.md",
85
+ fileName: "anws-system/SKILL.md",
86
+ targets: ["codex", "trae"],
87
+ },
88
+ {
89
+ id: "concept-modeler",
90
+ type: "skill",
91
+ source: ".agents/skills/concept-modeler/SKILL.md",
92
+ fileName: "concept-modeler/SKILL.md",
93
+ },
94
+ {
95
+ id: "code-reviewer",
96
+ type: "skill",
97
+ source: ".agents/skills/code-reviewer/SKILL.md",
98
+ fileName: "code-reviewer/SKILL.md",
99
+ },
100
+ {
101
+ id: "design-reviewer",
102
+ type: "skill",
103
+ source: ".agents/skills/design-reviewer/SKILL.md",
104
+ fileName: "design-reviewer/SKILL.md",
105
+ },
106
+ {
107
+ id: "nexus-mapper",
108
+ type: "skill",
109
+ source: ".agents/skills/nexus-mapper/SKILL.md",
110
+ fileName: "nexus-mapper/SKILL.md",
111
+ },
112
+ {
113
+ id: "nexus-mapper-language-customization",
114
+ type: "skill",
115
+ source: ".agents/skills/nexus-mapper/references/language-customization.md",
116
+ fileName: "nexus-mapper/references/language-customization.md",
117
+ },
118
+ {
119
+ id: "nexus-mapper-output-schema",
120
+ type: "skill",
121
+ source: ".agents/skills/nexus-mapper/references/output-schema.md",
122
+ fileName: "nexus-mapper/references/output-schema.md",
123
+ },
124
+ {
125
+ id: "nexus-mapper-probe-protocol",
126
+ type: "skill",
127
+ source: ".agents/skills/nexus-mapper/references/probe-protocol.md",
128
+ fileName: "nexus-mapper/references/probe-protocol.md",
129
+ },
130
+ {
131
+ id: "nexus-mapper-extract-ast",
132
+ type: "skill",
133
+ source: ".agents/skills/nexus-mapper/scripts/extract_ast.py",
134
+ fileName: "nexus-mapper/scripts/extract_ast.py",
135
+ },
136
+ {
137
+ id: "nexus-mapper-git-detective",
138
+ type: "skill",
139
+ source: ".agents/skills/nexus-mapper/scripts/git_detective.py",
140
+ fileName: "nexus-mapper/scripts/git_detective.py",
141
+ },
142
+ {
143
+ id: "nexus-mapper-languages",
144
+ type: "skill",
145
+ source: ".agents/skills/nexus-mapper/scripts/languages.json",
146
+ fileName: "nexus-mapper/scripts/languages.json",
147
+ },
148
+ {
149
+ id: "nexus-mapper-query-graph",
150
+ type: "skill",
151
+ source: ".agents/skills/nexus-mapper/scripts/query_graph.py",
152
+ fileName: "nexus-mapper/scripts/query_graph.py",
153
+ },
154
+ {
155
+ id: "nexus-mapper-requirements",
156
+ type: "skill",
157
+ source: ".agents/skills/nexus-mapper/scripts/requirements.txt",
158
+ fileName: "nexus-mapper/scripts/requirements.txt",
159
+ },
160
+ {
161
+ id: "output-contract",
162
+ type: "skill",
163
+ source: ".agents/skills/output-contract/SKILL.md",
164
+ fileName: "output-contract/SKILL.md",
165
+ },
166
+ {
167
+ id: "runtime-inspector",
168
+ type: "skill",
169
+ source: ".agents/skills/runtime-inspector/SKILL.md",
170
+ fileName: "runtime-inspector/SKILL.md",
171
+ },
172
+ {
173
+ id: "sequential-thinking",
174
+ type: "skill",
175
+ source: ".agents/skills/sequential-thinking/SKILL.md",
176
+ fileName: "sequential-thinking/SKILL.md",
177
+ },
178
+ {
179
+ id: "spec-writer",
180
+ type: "skill",
181
+ source: ".agents/skills/spec-writer/SKILL.md",
182
+ fileName: "spec-writer/SKILL.md",
183
+ },
184
+ {
185
+ id: "spec-writer-prd-template",
186
+ type: "skill",
187
+ source: ".agents/skills/spec-writer/references/prd_template.md",
188
+ fileName: "spec-writer/references/prd_template.md",
189
+ },
190
+ {
191
+ id: "system-architect",
192
+ type: "skill",
193
+ source: ".agents/skills/system-architect/SKILL.md",
194
+ fileName: "system-architect/SKILL.md",
195
+ },
196
+ {
197
+ id: "system-architect-rfc-template",
198
+ type: "skill",
199
+ source: ".agents/skills/system-architect/references/rfc_template.md",
200
+ fileName: "system-architect/references/rfc_template.md",
201
+ },
202
+ {
203
+ id: "system-designer",
204
+ type: "skill",
205
+ source: ".agents/skills/system-designer/SKILL.md",
206
+ fileName: "system-designer/SKILL.md",
207
+ },
208
+ {
209
+ id: "system-designer-detail-template",
210
+ type: "skill",
211
+ source:
212
+ ".agents/skills/system-designer/references/system-design-detail-template.md",
213
+ fileName: "system-designer/references/system-design-detail-template.md",
214
+ },
215
+ {
216
+ id: "system-designer-template",
217
+ type: "skill",
218
+ source:
219
+ ".agents/skills/system-designer/references/system-design-template.md",
220
+ fileName: "system-designer/references/system-design-template.md",
221
+ },
222
+ {
223
+ id: "task-planner",
224
+ type: "skill",
225
+ source: ".agents/skills/task-planner/SKILL.md",
226
+ fileName: "task-planner/SKILL.md",
227
+ },
228
+ {
229
+ id: "task-planner-template-05a",
230
+ type: "skill",
231
+ source: ".agents/skills/task-planner/references/TASK_TEMPLATE_05A.md",
232
+ fileName: "task-planner/references/TASK_TEMPLATE_05A.md",
233
+ },
234
+ {
235
+ id: "task-planner-template-05b",
236
+ type: "skill",
237
+ source: ".agents/skills/task-planner/references/TASK_TEMPLATE_05B.md",
238
+ fileName: "task-planner/references/TASK_TEMPLATE_05B.md",
239
+ },
240
+ {
241
+ id: "task-reviewer",
242
+ type: "skill",
243
+ source: ".agents/skills/task-reviewer/SKILL.md",
244
+ fileName: "task-reviewer/SKILL.md",
245
+ },
246
+ {
247
+ id: "tech-evaluator",
248
+ type: "skill",
249
+ source: ".agents/skills/tech-evaluator/SKILL.md",
250
+ fileName: "tech-evaluator/SKILL.md",
251
+ },
252
+ {
253
+ id: "tech-evaluator-adr-template",
254
+ type: "skill",
255
+ source: ".agents/skills/tech-evaluator/references/ADR_TEMPLATE.md",
256
+ fileName: "tech-evaluator/references/ADR_TEMPLATE.md",
257
+ },
258
+ {
259
+ id: "e2e-testing-guide",
260
+ type: "skill",
261
+ source: ".agents/skills/e2e-testing-guide/SKILL.md",
262
+ fileName: "e2e-testing-guide/SKILL.md",
263
+ },
264
+ {
265
+ id: "craft-authoring",
266
+ type: "skill",
267
+ source: ".agents/skills/craft-authoring/SKILL.md",
268
+ fileName: "craft-authoring/SKILL.md",
269
+ },
270
+ {
271
+ id: "craft-authoring-bundle-policy",
272
+ type: "skill",
273
+ source: ".agents/skills/craft-authoring/references/BUNDLE_POLICY.md",
274
+ fileName: "craft-authoring/references/BUNDLE_POLICY.md",
275
+ },
276
+ {
277
+ id: "craft-authoring-prompt-quality-rubric",
278
+ type: "skill",
279
+ source:
280
+ ".agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md",
281
+ fileName: "craft-authoring/references/PROMPT_QUALITY_RUBRIC.md",
282
+ },
283
+ {
284
+ id: "craft-authoring-scorecard-template",
285
+ type: "skill",
286
+ source: ".agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md",
287
+ fileName: "craft-authoring/references/SCORECARD_TEMPLATE.md",
288
+ },
289
+ {
290
+ id: "nexus-query",
291
+ type: "skill",
292
+ source: ".agents/skills/nexus-query/SKILL.md",
293
+ fileName: "nexus-query/SKILL.md",
294
+ },
295
+ {
296
+ id: "nexus-query-extract-ast",
297
+ type: "skill",
298
+ source: ".agents/skills/nexus-query/scripts/extract_ast.py",
299
+ fileName: "nexus-query/scripts/extract_ast.py",
300
+ },
301
+ {
302
+ id: "nexus-query-git-detective",
303
+ type: "skill",
304
+ source: ".agents/skills/nexus-query/scripts/git_detective.py",
305
+ fileName: "nexus-query/scripts/git_detective.py",
306
+ },
307
+ {
308
+ id: "nexus-query-languages",
309
+ type: "skill",
310
+ source: ".agents/skills/nexus-query/scripts/languages.json",
311
+ fileName: "nexus-query/scripts/languages.json",
312
+ },
313
+ {
314
+ id: "nexus-query-query-graph",
315
+ type: "skill",
316
+ source: ".agents/skills/nexus-query/scripts/query_graph.py",
317
+ fileName: "nexus-query/scripts/query_graph.py",
318
+ },
319
+ {
320
+ id: "nexus-query-requirements",
321
+ type: "skill",
322
+ source: ".agents/skills/nexus-query/scripts/requirements.txt",
323
+ fileName: "nexus-query/scripts/requirements.txt",
324
+ },
54
325
  ];
55
326
 
56
327
  function toArray(value) {
@@ -58,16 +329,22 @@ function toArray(value) {
58
329
  }
59
330
 
60
331
  function toProjectionFileName(resource, projectionType, targetId) {
61
- if ((targetId === 'codex' || targetId === 'trae') && projectionType === 'skills' && resource.type === 'workflow') {
332
+ if (
333
+ (targetId === "codex" || targetId === "trae") &&
334
+ projectionType === "skills" &&
335
+ resource.type === "workflow"
336
+ ) {
62
337
  return `anws-system/references/${resource.id}.md`;
63
338
  }
64
- if (projectionType === 'commands') {
339
+ if (projectionType === "commands") {
65
340
  return `${resource.id}.md`;
66
341
  }
67
- if (projectionType === 'prompts') {
68
- return targetId === 'copilot' ? `${resource.id}.prompt.md` : `${resource.id}.md`;
342
+ if (projectionType === "prompts") {
343
+ return targetId === "copilot"
344
+ ? `${resource.id}.prompt.md`
345
+ : `${resource.id}.md`;
69
346
  }
70
- if (projectionType === 'agents') {
347
+ if (projectionType === "agents") {
71
348
  return `${resource.id}.md`;
72
349
  }
73
350
  return resource.fileName;
@@ -87,25 +364,29 @@ function buildProjectionEntries(targetId) {
87
364
  }
88
365
 
89
366
  return toArray(projectionTypes).map((projectionType) => {
90
- const outputFileName = toProjectionFileName(resource, projectionType, target.id);
367
+ const outputFileName = toProjectionFileName(
368
+ resource,
369
+ projectionType,
370
+ target.id,
371
+ );
91
372
  return {
92
373
  ...resource,
93
374
  projectionType,
94
375
  outputRoot: target.projections[projectionType],
95
- outputPath: `${target.projections[projectionType]}/${outputFileName}`
376
+ outputPath: `${target.projections[projectionType]}/${outputFileName}`,
96
377
  };
97
378
  });
98
379
  });
99
380
  }
100
381
 
101
- function buildManagedManifest(targetIds = ['antigravity']) {
382
+ function buildManagedManifest(targetIds = ["antigravity"]) {
102
383
  return toArray(targetIds).flatMap((targetId) => {
103
384
  const target = getTarget(targetId);
104
385
  const entries = buildProjectionEntries(target.id).map((entry) => ({
105
386
  ...entry,
106
387
  targetId: target.id,
107
388
  targetLabel: target.label,
108
- ownershipKey: `${target.id}:${entry.outputPath}`
389
+ ownershipKey: `${target.id}:${entry.outputPath}`,
109
390
  }));
110
391
 
111
392
  if (!target.rootAgentFile) {
@@ -114,23 +395,26 @@ function buildManagedManifest(targetIds = ['antigravity']) {
114
395
 
115
396
  return [
116
397
  {
117
- id: 'root-agents',
118
- type: 'root',
119
- source: 'AGENTS.md',
120
- fileName: 'AGENTS.md',
121
- projectionType: 'rootAgentFile',
122
- outputRoot: '.',
123
- outputPath: 'AGENTS.md',
398
+ id: "root-agents",
399
+ type: "root",
400
+ source: "AGENTS.md",
401
+ fileName: "AGENTS.md",
402
+ projectionType: "rootAgentFile",
403
+ outputRoot: ".",
404
+ outputPath: "AGENTS.md",
124
405
  targetId: target.id,
125
406
  targetLabel: target.label,
126
- ownershipKey: `${target.id}:AGENTS.md`
407
+ ownershipKey: `${target.id}:AGENTS.md`,
127
408
  },
128
- ...entries
409
+ ...entries,
129
410
  ];
130
411
  });
131
412
  }
132
413
 
133
- function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_REGISTRY) {
414
+ function buildProjectionPlan(
415
+ targetIds = ["antigravity"],
416
+ resources = RESOURCE_REGISTRY,
417
+ ) {
134
418
  return toArray(targetIds).map((targetId) => {
135
419
  const target = getTarget(targetId);
136
420
  const typeMap = target.projectionTypes;
@@ -144,7 +428,11 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
144
428
  }
145
429
 
146
430
  return toArray(projectionTypes).map((projectionType) => {
147
- const outputFileName = toProjectionFileName(resource, projectionType, target.id);
431
+ const outputFileName = toProjectionFileName(
432
+ resource,
433
+ projectionType,
434
+ target.id,
435
+ );
148
436
  const outputPath = `${target.projections[projectionType]}/${outputFileName}`;
149
437
  return {
150
438
  ...resource,
@@ -153,13 +441,13 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
153
441
  outputPath,
154
442
  targetId: target.id,
155
443
  targetLabel: target.label,
156
- ownershipKey: `${target.id}:${outputPath}`
444
+ ownershipKey: `${target.id}:${outputPath}`,
157
445
  };
158
446
  });
159
447
  });
160
448
 
161
449
  const managedFiles = target.rootAgentFile
162
- ? ['AGENTS.md', ...projectionEntries.map((item) => item.outputPath)]
450
+ ? ["AGENTS.md", ...projectionEntries.map((item) => item.outputPath)]
163
451
  : projectionEntries.map((item) => item.outputPath);
164
452
 
165
453
  return {
@@ -169,25 +457,25 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
169
457
  managedFiles,
170
458
  userProtectedFiles: buildUserProtectedFiles(target.id),
171
459
  projectionEntries,
172
- ownership: projectionEntries.map((item) => item.ownershipKey)
460
+ ownership: projectionEntries.map((item) => item.ownershipKey),
173
461
  };
174
462
  });
175
463
  }
176
464
 
177
- function buildManagedFiles(targetId = 'antigravity') {
465
+ function buildManagedFiles(targetId = "antigravity") {
178
466
  return buildManagedManifest(targetId).map((item) => item.outputPath);
179
467
  }
180
468
 
181
- function buildUserProtectedFiles(targetId = 'antigravity') {
469
+ function buildUserProtectedFiles(targetId = "antigravity") {
182
470
  const target = getTarget(targetId);
183
- return target.rootAgentFile ? ['AGENTS.md'] : [];
471
+ return target.rootAgentFile ? ["AGENTS.md"] : [];
184
472
  }
185
473
 
186
474
  function findByType(type) {
187
475
  return RESOURCE_REGISTRY.filter((item) => item.type === type);
188
476
  }
189
477
 
190
- const MANAGED_FILES = buildManagedFiles('antigravity');
478
+ const MANAGED_FILES = buildManagedFiles("antigravity");
191
479
 
192
480
  /**
193
481
  * USER_PROTECTED_FILES — 用户保护文件
@@ -195,7 +483,7 @@ const MANAGED_FILES = buildManagedFiles('antigravity');
195
483
  * 这些文件在项目初始化后通常会包含特定于项目的配置。
196
484
  * anws update 默认会跳过这些文件。
197
485
  */
198
- const USER_PROTECTED_FILES = buildUserProtectedFiles('antigravity');
486
+ const USER_PROTECTED_FILES = buildUserProtectedFiles("antigravity");
199
487
 
200
488
  module.exports = {
201
489
  RESOURCE_REGISTRY,
@@ -206,8 +494,5 @@ module.exports = {
206
494
  buildUserProtectedFiles,
207
495
  findByType,
208
496
  MANAGED_FILES,
209
- USER_PROTECTED_FILES
497
+ USER_PROTECTED_FILES,
210
498
  };
211
-
212
-
213
-