@haaaiawd/anws 2.3.0 → 2.4.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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +52 -22
  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 +376 -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 +108 -108
  12. package/templates/.agents/skills/code-reviewer/SKILL.md +170 -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 +61 -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/output-contract/SKILL.md +37 -0
  20. package/templates/.agents/skills/report-template/SKILL.md +92 -92
  21. package/templates/.agents/skills/sequential-thinking/SKILL.md +222 -225
  22. package/templates/.agents/skills/spec-writer/SKILL.md +75 -30
  23. package/templates/.agents/skills/system-architect/SKILL.md +538 -678
  24. package/templates/.agents/skills/system-designer/SKILL.md +601 -601
  25. package/templates/.agents/skills/task-planner/SKILL.md +1 -2
  26. package/templates/.agents/skills/task-reviewer/SKILL.md +428 -388
  27. package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
  28. package/templates/.agents/workflows/blueprint.md +157 -69
  29. package/templates/.agents/workflows/challenge.md +331 -497
  30. package/templates/.agents/workflows/change.md +182 -339
  31. package/templates/.agents/workflows/craft.md +159 -197
  32. package/templates/.agents/workflows/design-system.md +202 -674
  33. package/templates/.agents/workflows/explore.md +187 -399
  34. package/templates/.agents/workflows/forge.md +650 -609
  35. package/templates/.agents/workflows/genesis.md +439 -351
  36. package/templates/.agents/workflows/probe.md +219 -241
  37. package/templates/.agents/workflows/quickstart.md +302 -123
  38. package/templates/.agents/workflows/upgrade.md +145 -182
  39. package/templates_en/.agents/skills/anws-system/SKILL.md +108 -0
  40. package/templates_en/.agents/skills/code-reviewer/SKILL.md +170 -0
  41. package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
  42. package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
  43. package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +60 -0
  44. package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
  45. package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
  46. package/templates_en/.agents/skills/design-reviewer/SKILL.md +265 -0
  47. package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
  48. package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
  49. package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
  50. package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
  51. package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  52. package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  53. package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  54. package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  55. package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  56. package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  57. package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
  58. package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
  59. package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
  60. package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
  61. package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
  62. package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
  63. package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
  64. package/templates_en/.agents/skills/report-template/SKILL.md +85 -0
  65. package/templates_en/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
  66. package/templates_en/.agents/skills/runtime-inspector/SKILL.md +101 -0
  67. package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
  68. package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
  69. package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
  70. package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
  71. package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
  72. package/templates_en/.agents/skills/system-designer/SKILL.md +534 -0
  73. package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
  74. package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
  75. package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
  76. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
  77. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
  78. package/templates_en/.agents/skills/task-reviewer/SKILL.md +428 -0
  79. package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
  80. package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
  81. package/templates_en/.agents/workflows/blueprint.md +200 -0
  82. package/templates_en/.agents/workflows/challenge.md +331 -0
  83. package/templates_en/.agents/workflows/change.md +182 -0
  84. package/templates_en/.agents/workflows/craft.md +159 -0
  85. package/templates_en/.agents/workflows/design-system.md +202 -0
  86. package/templates_en/.agents/workflows/explore.md +187 -0
  87. package/templates_en/.agents/workflows/forge.md +651 -0
  88. package/templates_en/.agents/workflows/genesis.md +439 -0
  89. package/templates_en/.agents/workflows/probe.md +219 -0
  90. package/templates_en/.agents/workflows/quickstart.md +303 -0
  91. package/templates_en/.agents/workflows/upgrade.md +145 -0
  92. package/templates_en/AGENTS.md +149 -0
@@ -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,339 @@
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` 相对于 canonical **`templates/`**(见 `lib/resources` 的 `TEMPLATE_ROOT`)。
9
+ * - 默认 `resolveCanonicalSource` / `resolveCanonicalPath(..., 'zh')` 只读该根目录;**不会**自动包含 `templates_alpha*`。英文包见 `resolveCanonicalPath(..., 'en')` + `templates_en/`(由 `anws init --locale` / install-lock `templateLocale` 驱动)。
10
+ * - **`templates/` 磁盘上可能存在未在此登记的路径**(遗留或备用);未登记则 **不会** 投影到用户项目。
11
+ * - **Alpha overlay**(`templates_alpha/`、`templates_alpha_en/`)整树 **默认不在登记范围内**;语义与合并决策见
12
+ * **`templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md`**(及 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: "report-template",
168
+ type: "skill",
169
+ source: ".agents/skills/report-template/SKILL.md",
170
+ fileName: "report-template/SKILL.md",
171
+ },
172
+ {
173
+ id: "report-template-reference",
174
+ type: "skill",
175
+ source: ".agents/skills/report-template/references/REPORT_TEMPLATE.md",
176
+ fileName: "report-template/references/REPORT_TEMPLATE.md",
177
+ },
178
+ {
179
+ id: "runtime-inspector",
180
+ type: "skill",
181
+ source: ".agents/skills/runtime-inspector/SKILL.md",
182
+ fileName: "runtime-inspector/SKILL.md",
183
+ },
184
+ {
185
+ id: "sequential-thinking",
186
+ type: "skill",
187
+ source: ".agents/skills/sequential-thinking/SKILL.md",
188
+ fileName: "sequential-thinking/SKILL.md",
189
+ },
190
+ {
191
+ id: "spec-writer",
192
+ type: "skill",
193
+ source: ".agents/skills/spec-writer/SKILL.md",
194
+ fileName: "spec-writer/SKILL.md",
195
+ },
196
+ {
197
+ id: "spec-writer-prd-template",
198
+ type: "skill",
199
+ source: ".agents/skills/spec-writer/references/prd_template.md",
200
+ fileName: "spec-writer/references/prd_template.md",
201
+ },
202
+ {
203
+ id: "system-architect",
204
+ type: "skill",
205
+ source: ".agents/skills/system-architect/SKILL.md",
206
+ fileName: "system-architect/SKILL.md",
207
+ },
208
+ {
209
+ id: "system-architect-rfc-template",
210
+ type: "skill",
211
+ source: ".agents/skills/system-architect/references/rfc_template.md",
212
+ fileName: "system-architect/references/rfc_template.md",
213
+ },
214
+ {
215
+ id: "system-designer",
216
+ type: "skill",
217
+ source: ".agents/skills/system-designer/SKILL.md",
218
+ fileName: "system-designer/SKILL.md",
219
+ },
220
+ {
221
+ id: "system-designer-detail-template",
222
+ type: "skill",
223
+ source:
224
+ ".agents/skills/system-designer/references/system-design-detail-template.md",
225
+ fileName: "system-designer/references/system-design-detail-template.md",
226
+ },
227
+ {
228
+ id: "system-designer-template",
229
+ type: "skill",
230
+ source:
231
+ ".agents/skills/system-designer/references/system-design-template.md",
232
+ fileName: "system-designer/references/system-design-template.md",
233
+ },
234
+ {
235
+ id: "task-planner",
236
+ type: "skill",
237
+ source: ".agents/skills/task-planner/SKILL.md",
238
+ fileName: "task-planner/SKILL.md",
239
+ },
240
+ {
241
+ id: "task-planner-template-05a",
242
+ type: "skill",
243
+ source: ".agents/skills/task-planner/references/TASK_TEMPLATE_05A.md",
244
+ fileName: "task-planner/references/TASK_TEMPLATE_05A.md",
245
+ },
246
+ {
247
+ id: "task-planner-template-05b",
248
+ type: "skill",
249
+ source: ".agents/skills/task-planner/references/TASK_TEMPLATE_05B.md",
250
+ fileName: "task-planner/references/TASK_TEMPLATE_05B.md",
251
+ },
252
+ {
253
+ id: "task-reviewer",
254
+ type: "skill",
255
+ source: ".agents/skills/task-reviewer/SKILL.md",
256
+ fileName: "task-reviewer/SKILL.md",
257
+ },
258
+ {
259
+ id: "tech-evaluator",
260
+ type: "skill",
261
+ source: ".agents/skills/tech-evaluator/SKILL.md",
262
+ fileName: "tech-evaluator/SKILL.md",
263
+ },
264
+ {
265
+ id: "tech-evaluator-adr-template",
266
+ type: "skill",
267
+ source: ".agents/skills/tech-evaluator/references/ADR_TEMPLATE.md",
268
+ fileName: "tech-evaluator/references/ADR_TEMPLATE.md",
269
+ },
270
+ {
271
+ id: "e2e-testing-guide",
272
+ type: "skill",
273
+ source: ".agents/skills/e2e-testing-guide/SKILL.md",
274
+ fileName: "e2e-testing-guide/SKILL.md",
275
+ },
276
+ {
277
+ id: "craft-authoring",
278
+ type: "skill",
279
+ source: ".agents/skills/craft-authoring/SKILL.md",
280
+ fileName: "craft-authoring/SKILL.md",
281
+ },
282
+ {
283
+ id: "craft-authoring-bundle-policy",
284
+ type: "skill",
285
+ source: ".agents/skills/craft-authoring/references/BUNDLE_POLICY.md",
286
+ fileName: "craft-authoring/references/BUNDLE_POLICY.md",
287
+ },
288
+ {
289
+ id: "craft-authoring-prompt-quality-rubric",
290
+ type: "skill",
291
+ source:
292
+ ".agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md",
293
+ fileName: "craft-authoring/references/PROMPT_QUALITY_RUBRIC.md",
294
+ },
295
+ {
296
+ id: "craft-authoring-scorecard-template",
297
+ type: "skill",
298
+ source: ".agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md",
299
+ fileName: "craft-authoring/references/SCORECARD_TEMPLATE.md",
300
+ },
301
+ {
302
+ id: "nexus-query",
303
+ type: "skill",
304
+ source: ".agents/skills/nexus-query/SKILL.md",
305
+ fileName: "nexus-query/SKILL.md",
306
+ },
307
+ {
308
+ id: "nexus-query-extract-ast",
309
+ type: "skill",
310
+ source: ".agents/skills/nexus-query/scripts/extract_ast.py",
311
+ fileName: "nexus-query/scripts/extract_ast.py",
312
+ },
313
+ {
314
+ id: "nexus-query-git-detective",
315
+ type: "skill",
316
+ source: ".agents/skills/nexus-query/scripts/git_detective.py",
317
+ fileName: "nexus-query/scripts/git_detective.py",
318
+ },
319
+ {
320
+ id: "nexus-query-languages",
321
+ type: "skill",
322
+ source: ".agents/skills/nexus-query/scripts/languages.json",
323
+ fileName: "nexus-query/scripts/languages.json",
324
+ },
325
+ {
326
+ id: "nexus-query-query-graph",
327
+ type: "skill",
328
+ source: ".agents/skills/nexus-query/scripts/query_graph.py",
329
+ fileName: "nexus-query/scripts/query_graph.py",
330
+ },
331
+ {
332
+ id: "nexus-query-requirements",
333
+ type: "skill",
334
+ source: ".agents/skills/nexus-query/scripts/requirements.txt",
335
+ fileName: "nexus-query/scripts/requirements.txt",
336
+ },
54
337
  ];
55
338
 
56
339
  function toArray(value) {
@@ -58,16 +341,22 @@ function toArray(value) {
58
341
  }
59
342
 
60
343
  function toProjectionFileName(resource, projectionType, targetId) {
61
- if ((targetId === 'codex' || targetId === 'trae') && projectionType === 'skills' && resource.type === 'workflow') {
344
+ if (
345
+ (targetId === "codex" || targetId === "trae") &&
346
+ projectionType === "skills" &&
347
+ resource.type === "workflow"
348
+ ) {
62
349
  return `anws-system/references/${resource.id}.md`;
63
350
  }
64
- if (projectionType === 'commands') {
351
+ if (projectionType === "commands") {
65
352
  return `${resource.id}.md`;
66
353
  }
67
- if (projectionType === 'prompts') {
68
- return targetId === 'copilot' ? `${resource.id}.prompt.md` : `${resource.id}.md`;
354
+ if (projectionType === "prompts") {
355
+ return targetId === "copilot"
356
+ ? `${resource.id}.prompt.md`
357
+ : `${resource.id}.md`;
69
358
  }
70
- if (projectionType === 'agents') {
359
+ if (projectionType === "agents") {
71
360
  return `${resource.id}.md`;
72
361
  }
73
362
  return resource.fileName;
@@ -87,25 +376,29 @@ function buildProjectionEntries(targetId) {
87
376
  }
88
377
 
89
378
  return toArray(projectionTypes).map((projectionType) => {
90
- const outputFileName = toProjectionFileName(resource, projectionType, target.id);
379
+ const outputFileName = toProjectionFileName(
380
+ resource,
381
+ projectionType,
382
+ target.id,
383
+ );
91
384
  return {
92
385
  ...resource,
93
386
  projectionType,
94
387
  outputRoot: target.projections[projectionType],
95
- outputPath: `${target.projections[projectionType]}/${outputFileName}`
388
+ outputPath: `${target.projections[projectionType]}/${outputFileName}`,
96
389
  };
97
390
  });
98
391
  });
99
392
  }
100
393
 
101
- function buildManagedManifest(targetIds = ['antigravity']) {
394
+ function buildManagedManifest(targetIds = ["antigravity"]) {
102
395
  return toArray(targetIds).flatMap((targetId) => {
103
396
  const target = getTarget(targetId);
104
397
  const entries = buildProjectionEntries(target.id).map((entry) => ({
105
398
  ...entry,
106
399
  targetId: target.id,
107
400
  targetLabel: target.label,
108
- ownershipKey: `${target.id}:${entry.outputPath}`
401
+ ownershipKey: `${target.id}:${entry.outputPath}`,
109
402
  }));
110
403
 
111
404
  if (!target.rootAgentFile) {
@@ -114,23 +407,26 @@ function buildManagedManifest(targetIds = ['antigravity']) {
114
407
 
115
408
  return [
116
409
  {
117
- id: 'root-agents',
118
- type: 'root',
119
- source: 'AGENTS.md',
120
- fileName: 'AGENTS.md',
121
- projectionType: 'rootAgentFile',
122
- outputRoot: '.',
123
- outputPath: 'AGENTS.md',
410
+ id: "root-agents",
411
+ type: "root",
412
+ source: "AGENTS.md",
413
+ fileName: "AGENTS.md",
414
+ projectionType: "rootAgentFile",
415
+ outputRoot: ".",
416
+ outputPath: "AGENTS.md",
124
417
  targetId: target.id,
125
418
  targetLabel: target.label,
126
- ownershipKey: `${target.id}:AGENTS.md`
419
+ ownershipKey: `${target.id}:AGENTS.md`,
127
420
  },
128
- ...entries
421
+ ...entries,
129
422
  ];
130
423
  });
131
424
  }
132
425
 
133
- function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_REGISTRY) {
426
+ function buildProjectionPlan(
427
+ targetIds = ["antigravity"],
428
+ resources = RESOURCE_REGISTRY,
429
+ ) {
134
430
  return toArray(targetIds).map((targetId) => {
135
431
  const target = getTarget(targetId);
136
432
  const typeMap = target.projectionTypes;
@@ -144,7 +440,11 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
144
440
  }
145
441
 
146
442
  return toArray(projectionTypes).map((projectionType) => {
147
- const outputFileName = toProjectionFileName(resource, projectionType, target.id);
443
+ const outputFileName = toProjectionFileName(
444
+ resource,
445
+ projectionType,
446
+ target.id,
447
+ );
148
448
  const outputPath = `${target.projections[projectionType]}/${outputFileName}`;
149
449
  return {
150
450
  ...resource,
@@ -153,13 +453,13 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
153
453
  outputPath,
154
454
  targetId: target.id,
155
455
  targetLabel: target.label,
156
- ownershipKey: `${target.id}:${outputPath}`
456
+ ownershipKey: `${target.id}:${outputPath}`,
157
457
  };
158
458
  });
159
459
  });
160
460
 
161
461
  const managedFiles = target.rootAgentFile
162
- ? ['AGENTS.md', ...projectionEntries.map((item) => item.outputPath)]
462
+ ? ["AGENTS.md", ...projectionEntries.map((item) => item.outputPath)]
163
463
  : projectionEntries.map((item) => item.outputPath);
164
464
 
165
465
  return {
@@ -169,25 +469,25 @@ function buildProjectionPlan(targetIds = ['antigravity'], resources = RESOURCE_R
169
469
  managedFiles,
170
470
  userProtectedFiles: buildUserProtectedFiles(target.id),
171
471
  projectionEntries,
172
- ownership: projectionEntries.map((item) => item.ownershipKey)
472
+ ownership: projectionEntries.map((item) => item.ownershipKey),
173
473
  };
174
474
  });
175
475
  }
176
476
 
177
- function buildManagedFiles(targetId = 'antigravity') {
477
+ function buildManagedFiles(targetId = "antigravity") {
178
478
  return buildManagedManifest(targetId).map((item) => item.outputPath);
179
479
  }
180
480
 
181
- function buildUserProtectedFiles(targetId = 'antigravity') {
481
+ function buildUserProtectedFiles(targetId = "antigravity") {
182
482
  const target = getTarget(targetId);
183
- return target.rootAgentFile ? ['AGENTS.md'] : [];
483
+ return target.rootAgentFile ? ["AGENTS.md"] : [];
184
484
  }
185
485
 
186
486
  function findByType(type) {
187
487
  return RESOURCE_REGISTRY.filter((item) => item.type === type);
188
488
  }
189
489
 
190
- const MANAGED_FILES = buildManagedFiles('antigravity');
490
+ const MANAGED_FILES = buildManagedFiles("antigravity");
191
491
 
192
492
  /**
193
493
  * USER_PROTECTED_FILES — 用户保护文件
@@ -195,7 +495,7 @@ const MANAGED_FILES = buildManagedFiles('antigravity');
195
495
  * 这些文件在项目初始化后通常会包含特定于项目的配置。
196
496
  * anws update 默认会跳过这些文件。
197
497
  */
198
- const USER_PROTECTED_FILES = buildUserProtectedFiles('antigravity');
498
+ const USER_PROTECTED_FILES = buildUserProtectedFiles("antigravity");
199
499
 
200
500
  module.exports = {
201
501
  RESOURCE_REGISTRY,
@@ -206,8 +506,5 @@ module.exports = {
206
506
  buildUserProtectedFiles,
207
507
  findByType,
208
508
  MANAGED_FILES,
209
- USER_PROTECTED_FILES
509
+ USER_PROTECTED_FILES,
210
510
  };
211
-
212
-
213
-