@haaaiawd/anws 1.2.2 → 1.2.4
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/bin/cli.js +5 -0
- package/lib/init.js +14 -25
- package/lib/manifest.js +7 -3
- package/lib/update.js +42 -46
- package/package.json +1 -1
- package/templates/{.agent/rules/agents.md → AGENTS.md} +113 -112
package/bin/cli.js
CHANGED
|
@@ -34,11 +34,16 @@ const { values, positionals } = parseArgs({
|
|
|
34
34
|
options: {
|
|
35
35
|
version: { type: 'boolean', short: 'v', default: false },
|
|
36
36
|
help: { type: 'boolean', short: 'h', default: false },
|
|
37
|
+
yes: { type: 'boolean', short: 'y', default: false },
|
|
37
38
|
},
|
|
38
39
|
strict: false,
|
|
39
40
|
allowPositionals: true,
|
|
40
41
|
});
|
|
41
42
|
|
|
43
|
+
if (values.yes) {
|
|
44
|
+
global.__ANWS_FORCE_YES = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
// ─── 命令路由 ─────────────────────────────────────────────────────────────────
|
|
43
48
|
async function main() {
|
|
44
49
|
if (values.version) {
|
package/lib/init.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('node:fs/promises');
|
|
4
4
|
const path = require('node:path');
|
|
5
|
-
const crypto = require('node:crypto');
|
|
6
5
|
const { copyDir } = require('./copy');
|
|
7
6
|
const { MANAGED_FILES, USER_PROTECTED_FILES } = require('./manifest');
|
|
8
7
|
const { success, warn, info, fileLine, skippedLine, blank, logo } = require('./output');
|
|
@@ -26,7 +25,6 @@ async function init() {
|
|
|
26
25
|
}
|
|
27
26
|
// 仅覆盖托管文件(用户自有文件不受影响)
|
|
28
27
|
const { written: updated, skipped } = await overwriteManaged(srcRoot, cwd);
|
|
29
|
-
await storeAgentsTemplateHash(srcRoot, cwd);
|
|
30
28
|
printSummary(updated, skipped, 'updated');
|
|
31
29
|
return;
|
|
32
30
|
}
|
|
@@ -36,10 +34,18 @@ async function init() {
|
|
|
36
34
|
info('Initializing Antigravity Workflow System...');
|
|
37
35
|
blank();
|
|
38
36
|
|
|
39
|
-
const
|
|
37
|
+
const writtenFiles = await copyDir(srcRoot, destRoot);
|
|
38
|
+
const written = Array.isArray(writtenFiles) ? writtenFiles : [];
|
|
40
39
|
|
|
41
|
-
//
|
|
42
|
-
|
|
40
|
+
// 把外层的 AGENTS.md 拷贝出来
|
|
41
|
+
const srcAgents = path.join(__dirname, '..', 'templates', 'AGENTS.md');
|
|
42
|
+
const destAgents = path.join(cwd, 'AGENTS.md');
|
|
43
|
+
try {
|
|
44
|
+
await fs.copyFile(srcAgents, destAgents);
|
|
45
|
+
written.push(destAgents);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
// 忽略
|
|
48
|
+
}
|
|
43
49
|
|
|
44
50
|
// 打印文件列表
|
|
45
51
|
for (const absPath of written) {
|
|
@@ -74,6 +80,8 @@ async function findConflicts(cwd) {
|
|
|
74
80
|
* @returns {Promise<boolean>}
|
|
75
81
|
*/
|
|
76
82
|
async function askOverwrite(count) {
|
|
83
|
+
if (global.__ANWS_FORCE_YES) return true;
|
|
84
|
+
|
|
77
85
|
// 非 TTY 环境:默认不覆盖,防止 CI 挂起
|
|
78
86
|
if (!process.stdin.isTTY) {
|
|
79
87
|
warn(`${count} managed file(s) already exist. Non-TTY: skipping overwrite.`);
|
|
@@ -160,27 +168,8 @@ function printSummary(files, skipped = [], action) {
|
|
|
160
168
|
function printNextSteps() {
|
|
161
169
|
blank();
|
|
162
170
|
info('Next steps:');
|
|
163
|
-
info(' 1. Read .
|
|
171
|
+
info(' 1. Read AGENTS.md to understand the system');
|
|
164
172
|
info(' 2. Run /quickstart in your AI assistant to analyze and start the workflow');
|
|
165
173
|
}
|
|
166
174
|
|
|
167
|
-
/**
|
|
168
|
-
* 存储 agents.md 模板的 MD5 指纹。
|
|
169
|
-
* 供 `anws update` 检测模板是否在版本间发生了变化。
|
|
170
|
-
* @param {string} srcRoot 模板 .agent/ 目录绝对路径
|
|
171
|
-
* @param {string} cwd 项目根目录
|
|
172
|
-
*/
|
|
173
|
-
async function storeAgentsTemplateHash(srcRoot, cwd) {
|
|
174
|
-
const templatePath = path.join(srcRoot, 'rules', 'agents.md');
|
|
175
|
-
const hashPath = path.join(cwd, '.agent', 'rules', '.agents-template-hash');
|
|
176
|
-
|
|
177
|
-
try {
|
|
178
|
-
const content = await fs.readFile(templatePath, 'utf-8');
|
|
179
|
-
const hash = crypto.createHash('md5').update(content).digest('hex');
|
|
180
|
-
await fs.writeFile(hashPath, hash, 'utf-8');
|
|
181
|
-
} catch {
|
|
182
|
-
// 模板文件不存在时静默失败(不应该发生)
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
175
|
module.exports = init;
|
package/lib/manifest.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* 此数组列出 anws 包负责管理的所有文件路径(相对于目标项目根目录)。
|
|
7
7
|
*/
|
|
8
8
|
const MANAGED_FILES = [
|
|
9
|
-
'.
|
|
9
|
+
'AGENTS.md',
|
|
10
10
|
'.agent/skills/build-inspector/SKILL.md',
|
|
11
11
|
'.agent/skills/complexity-guard/references/anti_patterns.md',
|
|
12
12
|
'.agent/skills/complexity-guard/SKILL.md',
|
|
@@ -14,6 +14,7 @@ const MANAGED_FILES = [
|
|
|
14
14
|
'.agent/skills/concept-modeler/references/ENTITY_EXTRACTION_PROMPT.md',
|
|
15
15
|
'.agent/skills/concept-modeler/scripts/glossary_gen.py',
|
|
16
16
|
'.agent/skills/concept-modeler/SKILL.md',
|
|
17
|
+
'.agent/skills/design-reviewer/SKILL.md',
|
|
17
18
|
'.agent/skills/git-forensics/references/ANALYSIS_METHODOLOGY.md',
|
|
18
19
|
'.agent/skills/git-forensics/scripts/git_forensics.py',
|
|
19
20
|
'.agent/skills/git-forensics/scripts/git_hotspots.py',
|
|
@@ -25,10 +26,12 @@ const MANAGED_FILES = [
|
|
|
25
26
|
'.agent/skills/spec-writer/SKILL.md',
|
|
26
27
|
'.agent/skills/system-architect/references/rfc_template.md',
|
|
27
28
|
'.agent/skills/system-architect/SKILL.md',
|
|
29
|
+
'.agent/skills/system-designer/references/system-design-detail-template.md',
|
|
28
30
|
'.agent/skills/system-designer/references/system-design-template.md',
|
|
29
31
|
'.agent/skills/system-designer/SKILL.md',
|
|
30
32
|
'.agent/skills/task-planner/references/TASK_TEMPLATE.md',
|
|
31
33
|
'.agent/skills/task-planner/SKILL.md',
|
|
34
|
+
'.agent/skills/task-reviewer/SKILL.md',
|
|
32
35
|
'.agent/skills/tech-evaluator/references/ADR_TEMPLATE.md',
|
|
33
36
|
'.agent/skills/tech-evaluator/SKILL.md',
|
|
34
37
|
'.agent/workflows/blueprint.md',
|
|
@@ -39,6 +42,7 @@ const MANAGED_FILES = [
|
|
|
39
42
|
'.agent/workflows/explore.md',
|
|
40
43
|
'.agent/workflows/forge.md',
|
|
41
44
|
'.agent/workflows/genesis.md',
|
|
45
|
+
'.agent/workflows/quickstart.md',
|
|
42
46
|
'.agent/workflows/scout.md'
|
|
43
47
|
];
|
|
44
48
|
|
|
@@ -49,10 +53,10 @@ const MANAGED_FILES = [
|
|
|
49
53
|
* anws update 默认会跳过这些文件。
|
|
50
54
|
*/
|
|
51
55
|
const USER_PROTECTED_FILES = [
|
|
52
|
-
'.
|
|
56
|
+
'AGENTS.md'
|
|
53
57
|
];
|
|
54
58
|
|
|
55
59
|
module.exports = {
|
|
56
60
|
MANAGED_FILES,
|
|
57
61
|
USER_PROTECTED_FILES
|
|
58
|
-
};
|
|
62
|
+
};
|
package/lib/update.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('node:fs/promises');
|
|
4
4
|
const path = require('node:path');
|
|
5
|
-
const crypto = require('node:crypto');
|
|
6
5
|
const { MANAGED_FILES, USER_PROTECTED_FILES } = require('./manifest');
|
|
7
6
|
const { success, warn, error, info, fileLine, skippedLine, blank, logo } = require('./output');
|
|
8
7
|
|
|
@@ -33,10 +32,34 @@ async function update() {
|
|
|
33
32
|
logo();
|
|
34
33
|
// 仅覆盖托管文件;USER_PROTECTED_FILES 永远跳过
|
|
35
34
|
const srcRoot = path.join(__dirname, '..', 'templates', '.agent');
|
|
35
|
+
let skipNewAgentsMd = false;
|
|
36
|
+
|
|
37
|
+
const legacyAgentsPath = path.join(cwd, '.agent', 'rules', 'agents.md');
|
|
38
|
+
const legacyExists = await fs.access(legacyAgentsPath).then(() => true).catch(() => false);
|
|
39
|
+
const rootAgentsPath = path.join(cwd, 'AGENTS.md');
|
|
40
|
+
const rootExists = await fs.access(rootAgentsPath).then(() => true).catch(() => false);
|
|
41
|
+
|
|
42
|
+
if (legacyExists && !rootExists) {
|
|
43
|
+
const migrate = await askMigrate();
|
|
44
|
+
if (!migrate) {
|
|
45
|
+
skipNewAgentsMd = true;
|
|
46
|
+
info('Keeping legacy .agent/rules/agents.md. Will not pull root AGENTS.md.');
|
|
47
|
+
} else {
|
|
48
|
+
blank();
|
|
49
|
+
warn('Please manually copy your custom rules from .agent/rules/agents.md to the new root AGENTS.md');
|
|
50
|
+
warn('After copying, you can safely delete the old .agent/rules/agents.md file.');
|
|
51
|
+
blank();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
36
55
|
const updated = [];
|
|
37
56
|
const skipped = [];
|
|
38
57
|
|
|
39
58
|
for (const rel of MANAGED_FILES) {
|
|
59
|
+
if (skipNewAgentsMd && rel === 'AGENTS.md') {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
|
|
40
63
|
if (USER_PROTECTED_FILES.includes(rel)) {
|
|
41
64
|
skipped.push(rel);
|
|
42
65
|
continue;
|
|
@@ -68,29 +91,18 @@ async function update() {
|
|
|
68
91
|
}
|
|
69
92
|
}
|
|
70
93
|
|
|
71
|
-
// 检查 agents.md 模板是否有变更,提供 .new 文件供用户合并
|
|
72
|
-
const agentsMerged = await checkAgentsTemplate(cwd, srcRoot);
|
|
73
|
-
|
|
74
94
|
blank();
|
|
75
95
|
success(`Done! ${updated.length} file(s) updated${skipped.length > 0 ? `, ${skipped.length} skipped` : ''}.`);
|
|
76
96
|
info('Managed files have been updated to the latest version.');
|
|
77
97
|
info('Your custom files in .agent/ were not touched.');
|
|
78
|
-
|
|
79
|
-
if (agentsMerged) {
|
|
80
|
-
blank();
|
|
81
|
-
warn('agents.md template has changed!');
|
|
82
|
-
info('A new template has been saved to:');
|
|
83
|
-
info(' .agent/rules/agents.md.new');
|
|
84
|
-
blank();
|
|
85
|
-
info('Please review and merge the changes into your agents.md.');
|
|
86
|
-
info('After merging, delete agents.md.new.');
|
|
87
|
-
}
|
|
88
98
|
}
|
|
89
99
|
|
|
90
100
|
/**
|
|
91
101
|
* 交互式确认更新操作(默认 N)。
|
|
92
102
|
*/
|
|
93
103
|
async function askUpdate() {
|
|
104
|
+
if (global.__ANWS_FORCE_YES) return true;
|
|
105
|
+
|
|
94
106
|
if (!process.stdin.isTTY) {
|
|
95
107
|
warn('Non-TTY environment detected. Skipping update to avoid accidental overwrites.');
|
|
96
108
|
return false;
|
|
@@ -111,43 +123,27 @@ async function askUpdate() {
|
|
|
111
123
|
}
|
|
112
124
|
|
|
113
125
|
/**
|
|
114
|
-
*
|
|
115
|
-
* 用 hash 文件记录上次模板指纹,与新模板比较。
|
|
116
|
-
* 如果有变化 → 写入 agents.md.new + 更新 hash。
|
|
117
|
-
*
|
|
118
|
-
* @param {string} cwd 项目根目录
|
|
119
|
-
* @param {string} srcRoot 模板 .agent/ 目录
|
|
120
|
-
* @returns {Promise<boolean>} 是否产生了 .new 文件
|
|
126
|
+
* 询问用户是否同意迁移 agents.md
|
|
121
127
|
*/
|
|
122
|
-
async function
|
|
123
|
-
|
|
124
|
-
const hashPath = path.join(cwd, '.agent', 'rules', '.agents-template-hash');
|
|
125
|
-
const newPath = path.join(cwd, '.agent', 'rules', 'agents.md.new');
|
|
126
|
-
|
|
127
|
-
const templateExists = await fs.access(templatePath).then(() => true).catch(() => false);
|
|
128
|
-
if (!templateExists) return false;
|
|
129
|
-
|
|
130
|
-
const templateContent = await fs.readFile(templatePath, 'utf-8');
|
|
131
|
-
const newHash = crypto.createHash('md5').update(templateContent).digest('hex');
|
|
132
|
-
|
|
133
|
-
// 读取上次存储的 hash
|
|
134
|
-
let oldHash = null;
|
|
135
|
-
try {
|
|
136
|
-
oldHash = (await fs.readFile(hashPath, 'utf-8')).trim();
|
|
137
|
-
} catch {
|
|
138
|
-
// hash 文件不存在(首次 update 或旧版本安装)
|
|
139
|
-
}
|
|
128
|
+
async function askMigrate() {
|
|
129
|
+
if (global.__ANWS_FORCE_YES) return true;
|
|
140
130
|
|
|
141
|
-
if (
|
|
142
|
-
return false;
|
|
131
|
+
if (!process.stdin.isTTY) {
|
|
132
|
+
return false;
|
|
143
133
|
}
|
|
144
134
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// 更新 hash 记录
|
|
148
|
-
await fs.writeFile(hashPath, newHash, 'utf-8');
|
|
135
|
+
const readline = require('node:readline');
|
|
136
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
149
137
|
|
|
150
|
-
return
|
|
138
|
+
return new Promise((resolve) => {
|
|
139
|
+
rl.question(
|
|
140
|
+
'\n\u26a0 Legacy .agent/rules/agents.md detected. Do you want to migrate to root AGENTS.md? [y/N] ',
|
|
141
|
+
(answer) => {
|
|
142
|
+
rl.close();
|
|
143
|
+
resolve(answer.trim().toLowerCase() === 'y');
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
});
|
|
151
147
|
}
|
|
152
148
|
|
|
153
149
|
module.exports = update;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haaaiawd/anws",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "A spec-driven workflow framework for AI-assisted development. Empowers prompt engineers to build production-ready software through structured PRD → Architecture → Task decomposition. Designed for Antigravity to enforce design-first principles and prevent architectural drift in vibe coding.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antigravity",
|
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
# AGENTS.md - AI 协作协议
|
|
2
|
-
|
|
3
|
-
> **"如果你正在阅读此文档,你就是那个智能体 (The Intelligence)。"**
|
|
4
|
-
>
|
|
5
|
-
> 这个文件是你的**锚点 (Anchor)**。它定义了项目的法则、领地的地图,以及记忆协议。
|
|
6
|
-
> 当你唤醒(开始新会话)时,**请首先阅读此文件**。
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 🧠 30秒恢复协议 (Quick Recovery)
|
|
11
|
-
|
|
12
|
-
**当你开始新会话或感到"迷失"时,立即执行**:
|
|
13
|
-
|
|
14
|
-
1.
|
|
15
|
-
2. **查看下方"当前状态"** → 找到最新架构版本
|
|
16
|
-
3. **读取 `genesis/v{N}/05_TASKS.md`** → 了解当前待办
|
|
17
|
-
4. **开始工作**
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 🗺️ 地图 (领地感知)
|
|
22
|
-
|
|
23
|
-
以下是这个项目的组织方式:
|
|
24
|
-
|
|
25
|
-
| 路径 | 描述 | 访问协议 |
|
|
26
|
-
|------|------|----------|
|
|
27
|
-
| `src/` | **实现层**。实际的代码库。 | 通过 Task 读/写。 |
|
|
28
|
-
| `genesis/` | **设计演进史**。版本化架构状态 (v1, v2...)。 | **只读**(旧版) / **写一次**(新版)。 |
|
|
29
|
-
| `genesis/v{N}/` | **当前真理**。最新的架构定义。 | 永远寻找最大的 `v{N}`。 |
|
|
30
|
-
| `.agent/workflows/` | **工作流**。`/genesis`, `/blueprint` 等。 | 通过 `view_file` 阅读。 |
|
|
31
|
-
| `.agent/skills/` | **技能库**。原子能力。 | 通过 `view_file` 调用。 |
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 📍 当前状态 (由 Workflow 自动更新)
|
|
36
|
-
|
|
37
|
-
> **注意**: 此部分由 `/genesis`、`/blueprint` 和 `/forge` 自动维护。
|
|
38
|
-
|
|
39
|
-
- **最新架构版本**: `尚未初始化`
|
|
40
|
-
- **活动任务清单**: `尚未生成`
|
|
41
|
-
- **待办任务数**: -
|
|
42
|
-
- **最近一次更新**: `-`
|
|
43
|
-
|
|
44
|
-
### 🌊 Wave 1 — 待 /blueprint 或 /forge 设置
|
|
45
|
-
_尚未开始执行_
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## 🌳 项目结构 (Project Tree)
|
|
50
|
-
|
|
51
|
-
> **注意**: 此部分由 `/genesis` 维护。
|
|
52
|
-
|
|
53
|
-
```text
|
|
54
|
-
(等待 Genesis 初始化结构树...)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## 🧭 导航指南 (Navigation Guide)
|
|
60
|
-
|
|
61
|
-
> **注意**: 此部分由 `/genesis` 维护。
|
|
62
|
-
|
|
63
|
-
- **在新架构就绪前**: 请勿大规模修改代码。
|
|
64
|
-
- **遇到架构问题**: 请查阅 `genesis/v{N}/03_ADR/`。
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## 🛠️ 工作流注册表
|
|
69
|
-
|
|
70
|
-
| 工作流 | 触发时机 | 产出 |
|
|
71
|
-
|--------|---------|------|
|
|
72
|
-
| `/quickstart` | 新用户入口 / 不知道从哪开始 | 编排其他工作流 |
|
|
73
|
-
| `/genesis` | 新项目 / 重大重构 | PRD, Architecture, ADRs |
|
|
74
|
-
| `/scout` | 变更前 / 接手项目 | `genesis/v{N}/00_SCOUT_REPORT.md` |
|
|
75
|
-
| `/design-system` | genesis 后 | 04_SYSTEM_DESIGN/*.md |
|
|
76
|
-
| `/blueprint` | genesis 后 | 05_TASKS.md +
|
|
77
|
-
| `/change` | 微调已有任务 | 更新 TASKS + SYSTEM_DESIGN (仅修改) + CHANGELOG |
|
|
78
|
-
| `/explore` | 调研时 | 探索报告 |
|
|
79
|
-
| `/challenge` | 决策前质疑 | 07_CHALLENGE_REPORT.md (含问题总览目录) |
|
|
80
|
-
| `/forge` | 编码执行 | 代码 + 更新
|
|
81
|
-
| `/craft` | 创建工作流/技能/提示词 | Workflow / Skill / Prompt 文档 |
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 📜 宪法 (The Constitution)
|
|
86
|
-
|
|
87
|
-
1. **版本即法律**: 不"修补"架构文档,只"演进"。变更必须创建新版本。
|
|
88
|
-
2. **显式上下文**: 决策写入 ADR,不留在"聊天记忆"里。
|
|
89
|
-
3. **交叉验证**: 编码前对照 `05_TASKS.md`。我在做计划好的事吗?
|
|
90
|
-
4. **美学**: 文档应该是美的。善用 Markdown 和 Emoji。
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
## 🔄 Auto-Updated Context
|
|
94
|
-
|
|
95
|
-
<!-- AUTO:BEGIN — 由工作流自动维护,请勿手动编辑此区块 -->
|
|
96
|
-
|
|
97
|
-
### 技术栈决策
|
|
98
|
-
- [由 genesis/tech-evaluator 自动填充]
|
|
99
|
-
|
|
100
|
-
### 系统边界
|
|
101
|
-
- [由 genesis/system-architect 自动填充]
|
|
102
|
-
|
|
103
|
-
### 活跃 ADR
|
|
104
|
-
- [由 genesis 自动填充 ADR 摘要]
|
|
105
|
-
|
|
106
|
-
### 当前任务状态
|
|
107
|
-
- [由 blueprint/forge 自动更新]
|
|
108
|
-
|
|
109
|
-
<!-- AUTO:END -->
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
> **状态自检**: 准备好了?提醒用户运行 `/quickstart` 开始吧。
|
|
1
|
+
# AGENTS.md - AI 协作协议
|
|
2
|
+
|
|
3
|
+
> **"如果你正在阅读此文档,你就是那个智能体 (The Intelligence)。"**
|
|
4
|
+
>
|
|
5
|
+
> 这个文件是你的**锚点 (Anchor)**。它定义了项目的法则、领地的地图,以及记忆协议。
|
|
6
|
+
> 当你唤醒(开始新会话)时,**请首先阅读此文件**。
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🧠 30秒恢复协议 (Quick Recovery)
|
|
11
|
+
|
|
12
|
+
**当你开始新会话或感到"迷失"时,立即执行**:
|
|
13
|
+
|
|
14
|
+
1. **读取根目录的 AGENTS.md** → 获取项目地图
|
|
15
|
+
2. **查看下方"当前状态"** → 找到最新架构版本
|
|
16
|
+
3. **读取 `genesis/v{N}/05_TASKS.md`** → 了解当前待办
|
|
17
|
+
4. **开始工作**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 🗺️ 地图 (领地感知)
|
|
22
|
+
|
|
23
|
+
以下是这个项目的组织方式:
|
|
24
|
+
|
|
25
|
+
| 路径 | 描述 | 访问协议 |
|
|
26
|
+
|------|------|----------|
|
|
27
|
+
| `src/` | **实现层**。实际的代码库。 | 通过 Task 读/写。 |
|
|
28
|
+
| `genesis/` | **设计演进史**。版本化架构状态 (v1, v2...)。 | **只读**(旧版) / **写一次**(新版)。 |
|
|
29
|
+
| `genesis/v{N}/` | **当前真理**。最新的架构定义。 | 永远寻找最大的 `v{N}`。 |
|
|
30
|
+
| `.agent/workflows/` | **工作流**。`/genesis`, `/blueprint` 等。 | 通过 `view_file` 阅读。 |
|
|
31
|
+
| `.agent/skills/` | **技能库**。原子能力。 | 通过 `view_file` 调用。 |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 📍 当前状态 (由 Workflow 自动更新)
|
|
36
|
+
|
|
37
|
+
> **注意**: 此部分由 `/genesis`、`/blueprint` 和 `/forge` 自动维护。
|
|
38
|
+
|
|
39
|
+
- **最新架构版本**: `尚未初始化`
|
|
40
|
+
- **活动任务清单**: `尚未生成`
|
|
41
|
+
- **待办任务数**: -
|
|
42
|
+
- **最近一次更新**: `-`
|
|
43
|
+
|
|
44
|
+
### 🌊 Wave 1 — 待 /blueprint 或 /forge 设置
|
|
45
|
+
_尚未开始执行_
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🌳 项目结构 (Project Tree)
|
|
50
|
+
|
|
51
|
+
> **注意**: 此部分由 `/genesis` 维护。
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
(等待 Genesis 初始化结构树...)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🧭 导航指南 (Navigation Guide)
|
|
60
|
+
|
|
61
|
+
> **注意**: 此部分由 `/genesis` 维护。
|
|
62
|
+
|
|
63
|
+
- **在新架构就绪前**: 请勿大规模修改代码。
|
|
64
|
+
- **遇到架构问题**: 请查阅 `genesis/v{N}/03_ADR/`。
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 🛠️ 工作流注册表
|
|
69
|
+
|
|
70
|
+
| 工作流 | 触发时机 | 产出 |
|
|
71
|
+
|--------|---------|------|
|
|
72
|
+
| `/quickstart` | 新用户入口 / 不知道从哪开始 | 编排其他工作流 |
|
|
73
|
+
| `/genesis` | 新项目 / 重大重构 | PRD, Architecture, ADRs |
|
|
74
|
+
| `/scout` | 变更前 / 接手项目 | `genesis/v{N}/00_SCOUT_REPORT.md` |
|
|
75
|
+
| `/design-system` | genesis 后 | 04_SYSTEM_DESIGN/*.md |
|
|
76
|
+
| `/blueprint` | genesis 后 | 05_TASKS.md + AGENTS.md 初始 Wave |
|
|
77
|
+
| `/change` | 微调已有任务 | 更新 TASKS + SYSTEM_DESIGN (仅修改) + CHANGELOG |
|
|
78
|
+
| `/explore` | 调研时 | 探索报告 |
|
|
79
|
+
| `/challenge` | 决策前质疑 | 07_CHALLENGE_REPORT.md (含问题总览目录) |
|
|
80
|
+
| `/forge` | 编码执行 | 代码 + 更新 AGENTS.md Wave 块 |
|
|
81
|
+
| `/craft` | 创建工作流/技能/提示词 | Workflow / Skill / Prompt 文档 |
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 📜 宪法 (The Constitution)
|
|
86
|
+
|
|
87
|
+
1. **版本即法律**: 不"修补"架构文档,只"演进"。变更必须创建新版本。
|
|
88
|
+
2. **显式上下文**: 决策写入 ADR,不留在"聊天记忆"里。
|
|
89
|
+
3. **交叉验证**: 编码前对照 `05_TASKS.md`。我在做计划好的事吗?
|
|
90
|
+
4. **美学**: 文档应该是美的。善用 Markdown 和 Emoji。
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
## 🔄 Auto-Updated Context
|
|
94
|
+
|
|
95
|
+
<!-- AUTO:BEGIN — 由工作流自动维护,请勿手动编辑此区块 -->
|
|
96
|
+
|
|
97
|
+
### 技术栈决策
|
|
98
|
+
- [由 genesis/tech-evaluator 自动填充]
|
|
99
|
+
|
|
100
|
+
### 系统边界
|
|
101
|
+
- [由 genesis/system-architect 自动填充]
|
|
102
|
+
|
|
103
|
+
### 活跃 ADR
|
|
104
|
+
- [由 genesis 自动填充 ADR 摘要]
|
|
105
|
+
|
|
106
|
+
### 当前任务状态
|
|
107
|
+
- [由 blueprint/forge 自动更新]
|
|
108
|
+
|
|
109
|
+
<!-- AUTO:END -->
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
> **状态自检**: 准备好了?提醒用户运行 `/quickstart` 开始吧。
|
|
113
|
+
\n# TEST NEW CONTENT\n
|