@haaaiawd/anws 2.2.6 → 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.
- package/README.md +1 -1
- package/bin/cli.js +52 -22
- package/lib/diff.js +5 -2
- package/lib/init.js +217 -96
- package/lib/install-state.js +18 -3
- package/lib/manifest.js +510 -213
- 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 +108 -108
- package/templates/.agents/skills/code-reviewer/SKILL.md +170 -103
- package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
- package/templates/.agents/skills/craft-authoring/SKILL.md +112 -49
- package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +61 -0
- package/templates/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +99 -0
- package/templates/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +64 -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/output-contract/SKILL.md +37 -0
- package/templates/.agents/skills/report-template/SKILL.md +92 -92
- 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 +601 -601
- package/templates/.agents/skills/task-planner/SKILL.md +1 -2
- package/templates/.agents/skills/task-reviewer/SKILL.md +428 -388
- package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
- package/templates/.agents/workflows/blueprint.md +166 -43
- package/templates/.agents/workflows/challenge.md +331 -497
- package/templates/.agents/workflows/change.md +182 -339
- package/templates/.agents/workflows/craft.md +159 -236
- package/templates/.agents/workflows/design-system.md +202 -674
- package/templates/.agents/workflows/explore.md +187 -399
- package/templates/.agents/workflows/forge.md +650 -550
- package/templates/.agents/workflows/genesis.md +439 -351
- package/templates/.agents/workflows/probe.md +219 -241
- package/templates/.agents/workflows/quickstart.md +302 -123
- package/templates/.agents/workflows/upgrade.md +145 -182
- package/templates_en/.agents/skills/anws-system/SKILL.md +108 -0
- package/templates_en/.agents/skills/code-reviewer/SKILL.md +170 -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 +60 -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 +265 -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/report-template/SKILL.md +85 -0
- package/templates_en/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
- package/templates_en/.agents/skills/runtime-inspector/SKILL.md +101 -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 +534 -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 +428 -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 +331 -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 +439 -0
- package/templates_en/.agents/workflows/probe.md +219 -0
- package/templates_en/.agents/workflows/quickstart.md +303 -0
- package/templates_en/.agents/workflows/upgrade.md +145 -0
- package/templates_en/AGENTS.md +149 -0
package/lib/manifest.js
CHANGED
|
@@ -1,213 +1,510 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const { getTarget } = require(
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { getTarget } = require("./adapters");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* RESOURCE_REGISTRY — CLI `anws init` / `anws update` 的唯一「复制来源清单」
|
|
7
|
+
*
|
|
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 镜像)。
|
|
13
|
+
*/
|
|
14
|
+
const RESOURCE_REGISTRY = [
|
|
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
|
+
},
|
|
337
|
+
];
|
|
338
|
+
|
|
339
|
+
function toArray(value) {
|
|
340
|
+
return Array.isArray(value) ? value : [value];
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function toProjectionFileName(resource, projectionType, targetId) {
|
|
344
|
+
if (
|
|
345
|
+
(targetId === "codex" || targetId === "trae") &&
|
|
346
|
+
projectionType === "skills" &&
|
|
347
|
+
resource.type === "workflow"
|
|
348
|
+
) {
|
|
349
|
+
return `anws-system/references/${resource.id}.md`;
|
|
350
|
+
}
|
|
351
|
+
if (projectionType === "commands") {
|
|
352
|
+
return `${resource.id}.md`;
|
|
353
|
+
}
|
|
354
|
+
if (projectionType === "prompts") {
|
|
355
|
+
return targetId === "copilot"
|
|
356
|
+
? `${resource.id}.prompt.md`
|
|
357
|
+
: `${resource.id}.md`;
|
|
358
|
+
}
|
|
359
|
+
if (projectionType === "agents") {
|
|
360
|
+
return `${resource.id}.md`;
|
|
361
|
+
}
|
|
362
|
+
return resource.fileName;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function buildProjectionEntries(targetId) {
|
|
366
|
+
const target = getTarget(targetId);
|
|
367
|
+
const typeMap = target.projectionTypes;
|
|
368
|
+
|
|
369
|
+
return RESOURCE_REGISTRY.flatMap((resource) => {
|
|
370
|
+
if (resource.targets && !resource.targets.includes(target.id)) {
|
|
371
|
+
return [];
|
|
372
|
+
}
|
|
373
|
+
const projectionTypes = typeMap[resource.type];
|
|
374
|
+
if (!projectionTypes) {
|
|
375
|
+
return [];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return toArray(projectionTypes).map((projectionType) => {
|
|
379
|
+
const outputFileName = toProjectionFileName(
|
|
380
|
+
resource,
|
|
381
|
+
projectionType,
|
|
382
|
+
target.id,
|
|
383
|
+
);
|
|
384
|
+
return {
|
|
385
|
+
...resource,
|
|
386
|
+
projectionType,
|
|
387
|
+
outputRoot: target.projections[projectionType],
|
|
388
|
+
outputPath: `${target.projections[projectionType]}/${outputFileName}`,
|
|
389
|
+
};
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function buildManagedManifest(targetIds = ["antigravity"]) {
|
|
395
|
+
return toArray(targetIds).flatMap((targetId) => {
|
|
396
|
+
const target = getTarget(targetId);
|
|
397
|
+
const entries = buildProjectionEntries(target.id).map((entry) => ({
|
|
398
|
+
...entry,
|
|
399
|
+
targetId: target.id,
|
|
400
|
+
targetLabel: target.label,
|
|
401
|
+
ownershipKey: `${target.id}:${entry.outputPath}`,
|
|
402
|
+
}));
|
|
403
|
+
|
|
404
|
+
if (!target.rootAgentFile) {
|
|
405
|
+
return entries;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return [
|
|
409
|
+
{
|
|
410
|
+
id: "root-agents",
|
|
411
|
+
type: "root",
|
|
412
|
+
source: "AGENTS.md",
|
|
413
|
+
fileName: "AGENTS.md",
|
|
414
|
+
projectionType: "rootAgentFile",
|
|
415
|
+
outputRoot: ".",
|
|
416
|
+
outputPath: "AGENTS.md",
|
|
417
|
+
targetId: target.id,
|
|
418
|
+
targetLabel: target.label,
|
|
419
|
+
ownershipKey: `${target.id}:AGENTS.md`,
|
|
420
|
+
},
|
|
421
|
+
...entries,
|
|
422
|
+
];
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function buildProjectionPlan(
|
|
427
|
+
targetIds = ["antigravity"],
|
|
428
|
+
resources = RESOURCE_REGISTRY,
|
|
429
|
+
) {
|
|
430
|
+
return toArray(targetIds).map((targetId) => {
|
|
431
|
+
const target = getTarget(targetId);
|
|
432
|
+
const typeMap = target.projectionTypes;
|
|
433
|
+
const projectionEntries = resources.flatMap((resource) => {
|
|
434
|
+
if (resource.targets && !resource.targets.includes(target.id)) {
|
|
435
|
+
return [];
|
|
436
|
+
}
|
|
437
|
+
const projectionTypes = typeMap[resource.type];
|
|
438
|
+
if (!projectionTypes) {
|
|
439
|
+
return [];
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return toArray(projectionTypes).map((projectionType) => {
|
|
443
|
+
const outputFileName = toProjectionFileName(
|
|
444
|
+
resource,
|
|
445
|
+
projectionType,
|
|
446
|
+
target.id,
|
|
447
|
+
);
|
|
448
|
+
const outputPath = `${target.projections[projectionType]}/${outputFileName}`;
|
|
449
|
+
return {
|
|
450
|
+
...resource,
|
|
451
|
+
projectionType,
|
|
452
|
+
outputRoot: target.projections[projectionType],
|
|
453
|
+
outputPath,
|
|
454
|
+
targetId: target.id,
|
|
455
|
+
targetLabel: target.label,
|
|
456
|
+
ownershipKey: `${target.id}:${outputPath}`,
|
|
457
|
+
};
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
const managedFiles = target.rootAgentFile
|
|
462
|
+
? ["AGENTS.md", ...projectionEntries.map((item) => item.outputPath)]
|
|
463
|
+
: projectionEntries.map((item) => item.outputPath);
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
target,
|
|
467
|
+
targetId: target.id,
|
|
468
|
+
targetLabel: target.label,
|
|
469
|
+
managedFiles,
|
|
470
|
+
userProtectedFiles: buildUserProtectedFiles(target.id),
|
|
471
|
+
projectionEntries,
|
|
472
|
+
ownership: projectionEntries.map((item) => item.ownershipKey),
|
|
473
|
+
};
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function buildManagedFiles(targetId = "antigravity") {
|
|
478
|
+
return buildManagedManifest(targetId).map((item) => item.outputPath);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function buildUserProtectedFiles(targetId = "antigravity") {
|
|
482
|
+
const target = getTarget(targetId);
|
|
483
|
+
return target.rootAgentFile ? ["AGENTS.md"] : [];
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function findByType(type) {
|
|
487
|
+
return RESOURCE_REGISTRY.filter((item) => item.type === type);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const MANAGED_FILES = buildManagedFiles("antigravity");
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* USER_PROTECTED_FILES — 用户保护文件
|
|
494
|
+
*
|
|
495
|
+
* 这些文件在项目初始化后通常会包含特定于项目的配置。
|
|
496
|
+
* anws update 默认会跳过这些文件。
|
|
497
|
+
*/
|
|
498
|
+
const USER_PROTECTED_FILES = buildUserProtectedFiles("antigravity");
|
|
499
|
+
|
|
500
|
+
module.exports = {
|
|
501
|
+
RESOURCE_REGISTRY,
|
|
502
|
+
buildManagedManifest,
|
|
503
|
+
buildProjectionPlan,
|
|
504
|
+
buildManagedFiles,
|
|
505
|
+
buildProjectionEntries,
|
|
506
|
+
buildUserProtectedFiles,
|
|
507
|
+
findByType,
|
|
508
|
+
MANAGED_FILES,
|
|
509
|
+
USER_PROTECTED_FILES,
|
|
510
|
+
};
|