@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.
- package/README.md +1 -1
- package/bin/cli.js +53 -23
- package/lib/diff.js +5 -2
- package/lib/init.js +217 -96
- package/lib/install-state.js +18 -3
- package/lib/manifest.js +364 -79
- package/lib/prompt.js +68 -0
- package/lib/resources/index.js +36 -2
- package/lib/update.js +12 -6
- package/package.json +48 -47
- package/templates/.agents/skills/anws-system/SKILL.md +107 -105
- package/templates/.agents/skills/code-reviewer/SKILL.md +171 -115
- package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
- package/templates/.agents/skills/craft-authoring/SKILL.md +186 -183
- package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +42 -0
- package/templates/.agents/skills/design-reviewer/SKILL.md +265 -190
- package/templates/.agents/skills/e2e-testing-guide/SKILL.md +246 -135
- package/templates/.agents/skills/nexus-mapper/SKILL.md +321 -321
- package/templates/.agents/skills/nexus-mapper/references/probe-protocol.md +1 -1
- package/templates/.agents/skills/nexus-query/SKILL.md +1 -1
- package/templates/.agents/skills/output-contract/SKILL.md +37 -0
- package/templates/.agents/skills/runtime-inspector/SKILL.md +150 -99
- package/templates/.agents/skills/sequential-thinking/SKILL.md +222 -225
- package/templates/.agents/skills/spec-writer/SKILL.md +75 -30
- package/templates/.agents/skills/system-architect/SKILL.md +538 -678
- package/templates/.agents/skills/system-designer/SKILL.md +124 -537
- package/templates/.agents/skills/task-planner/SKILL.md +1 -2
- package/templates/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +2 -2
- package/templates/.agents/skills/task-reviewer/SKILL.md +421 -386
- package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
- package/templates/.agents/workflows/blueprint.md +156 -68
- package/templates/.agents/workflows/challenge.md +322 -494
- package/templates/.agents/workflows/change.md +182 -339
- package/templates/.agents/workflows/craft.md +159 -197
- package/templates/.agents/workflows/design-system.md +202 -674
- package/templates/.agents/workflows/explore.md +187 -399
- package/templates/.agents/workflows/forge.md +650 -609
- package/templates/.agents/workflows/genesis.md +438 -351
- package/templates/.agents/workflows/probe.md +215 -240
- package/templates/.agents/workflows/quickstart.md +304 -123
- package/templates/.agents/workflows/upgrade.md +145 -182
- package/templates_en/.agents/skills/anws-system/SKILL.md +110 -0
- package/templates_en/.agents/skills/code-reviewer/SKILL.md +171 -0
- package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
- package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
- package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +42 -0
- package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
- package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
- package/templates_en/.agents/skills/design-reviewer/SKILL.md +264 -0
- package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
- package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
- package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
- package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
- package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
- package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
- package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
- package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
- package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
- package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
- package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
- package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
- package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
- package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
- package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
- package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
- package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
- package/templates_en/.agents/skills/runtime-inspector/SKILL.md +150 -0
- package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
- package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
- package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
- package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
- package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
- package/templates_en/.agents/skills/system-designer/SKILL.md +188 -0
- package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
- package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
- package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
- package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
- package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
- package/templates_en/.agents/skills/task-reviewer/SKILL.md +422 -0
- package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
- package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
- package/templates_en/.agents/workflows/blueprint.md +200 -0
- package/templates_en/.agents/workflows/challenge.md +326 -0
- package/templates_en/.agents/workflows/change.md +182 -0
- package/templates_en/.agents/workflows/craft.md +159 -0
- package/templates_en/.agents/workflows/design-system.md +202 -0
- package/templates_en/.agents/workflows/explore.md +187 -0
- package/templates_en/.agents/workflows/forge.md +651 -0
- package/templates_en/.agents/workflows/genesis.md +438 -0
- package/templates_en/.agents/workflows/probe.md +215 -0
- package/templates_en/.agents/workflows/quickstart.md +305 -0
- package/templates_en/.agents/workflows/upgrade.md +145 -0
- package/templates_en/AGENTS.md +149 -0
- package/templates/.agents/skills/report-template/SKILL.md +0 -92
- package/templates/.agents/skills/report-template/references/REPORT_TEMPLATE.md +0 -100
package/lib/install-state.js
CHANGED
|
@@ -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
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const { getTarget } = require(
|
|
3
|
+
const { getTarget } = require("./adapters");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* RESOURCE_REGISTRY — CLI `anws init` / `anws update` 的唯一「复制来源清单」
|
|
7
7
|
*
|
|
8
|
-
*
|
|
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
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{
|
|
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 (
|
|
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 ===
|
|
339
|
+
if (projectionType === "commands") {
|
|
65
340
|
return `${resource.id}.md`;
|
|
66
341
|
}
|
|
67
|
-
if (projectionType ===
|
|
68
|
-
return targetId ===
|
|
342
|
+
if (projectionType === "prompts") {
|
|
343
|
+
return targetId === "copilot"
|
|
344
|
+
? `${resource.id}.prompt.md`
|
|
345
|
+
: `${resource.id}.md`;
|
|
69
346
|
}
|
|
70
|
-
if (projectionType ===
|
|
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(
|
|
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 = [
|
|
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:
|
|
118
|
-
type:
|
|
119
|
-
source:
|
|
120
|
-
fileName:
|
|
121
|
-
projectionType:
|
|
122
|
-
outputRoot:
|
|
123
|
-
outputPath:
|
|
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(
|
|
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(
|
|
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
|
-
? [
|
|
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 =
|
|
465
|
+
function buildManagedFiles(targetId = "antigravity") {
|
|
178
466
|
return buildManagedManifest(targetId).map((item) => item.outputPath);
|
|
179
467
|
}
|
|
180
468
|
|
|
181
|
-
function buildUserProtectedFiles(targetId =
|
|
469
|
+
function buildUserProtectedFiles(targetId = "antigravity") {
|
|
182
470
|
const target = getTarget(targetId);
|
|
183
|
-
return target.rootAgentFile ? [
|
|
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(
|
|
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(
|
|
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
|
-
|