create-principles-disciple 1.112.0 → 1.112.2
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/package.json +2 -2
- package/pd-cli/dist/commands/legacy-cleanup.d.ts.map +1 -1
- package/pd-cli/dist/commands/legacy-cleanup.js +19 -2
- package/pd-cli/dist/commands/legacy-cleanup.js.map +1 -1
- package/pd-cli/dist/commands/pain-evidence.d.ts +3 -1
- package/pd-cli/dist/commands/pain-evidence.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-evidence.js +12 -3
- package/pd-cli/dist/commands/pain-evidence.js.map +1 -1
- package/pd-cli/dist/commands/rulecode.d.ts +13 -0
- package/pd-cli/dist/commands/rulecode.d.ts.map +1 -1
- package/pd-cli/dist/commands/rulecode.js +23 -2
- package/pd-cli/dist/commands/rulecode.js.map +1 -1
- package/pd-cli/dist/resolve-workspace.d.ts.map +1 -1
- package/pd-cli/dist/resolve-workspace.js +33 -12
- package/pd-cli/dist/resolve-workspace.js.map +1 -1
- package/pd-cli/dist/services/console-launcher.d.ts +8 -1
- package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
- package/pd-cli/dist/services/console-launcher.js +45 -3
- package/pd-cli/dist/services/console-launcher.js.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.d.ts.map +1 -1
- package/pd-cli/dist/services/pd-config-loader.js +34 -1
- package/pd-cli/dist/services/pd-config-loader.js.map +1 -1
- package/pd-cli/dist/services/quality-scorecard/strong-model-gate.d.ts +19 -0
- package/pd-cli/dist/services/quality-scorecard/strong-model-gate.d.ts.map +1 -1
- package/pd-cli/dist/services/quality-scorecard/strong-model-gate.js +44 -2
- package/pd-cli/dist/services/quality-scorecard/strong-model-gate.js.map +1 -1
- package/pd-cli/dist/utils/path-security.d.ts +60 -0
- package/pd-cli/dist/utils/path-security.d.ts.map +1 -0
- package/pd-cli/dist/utils/path-security.js +90 -0
- package/pd-cli/dist/utils/path-security.js.map +1 -0
- package/plugin/dist/bundle.js +13 -11
- package/plugin/dist/constants/tools.d.ts +1 -1
- package/plugin/dist/hooks/prompt-helpers.d.ts +5 -5
- package/plugin/dist/templates/langs/en/core/AGENTS.md +40 -180
- package/plugin/dist/templates/langs/en/core/BOOT.md +19 -47
- package/plugin/dist/templates/langs/en/core/HEARTBEAT.md +26 -58
- package/plugin/dist/templates/langs/en/core/IDENTITY.md +15 -8
- package/plugin/dist/templates/langs/en/core/PRINCIPLES.md +6 -7
- package/plugin/dist/templates/langs/en/core/SOUL.md +10 -41
- package/plugin/dist/templates/langs/en/core/TOOLS.md +18 -10
- package/plugin/dist/templates/langs/en/core/USER.md +13 -8
- package/plugin/dist/templates/langs/en/skills/pd-auditor/SKILL.md +1 -1
- package/plugin/dist/templates/langs/en/skills/pd-explorer/SKILL.md +1 -1
- package/plugin/dist/templates/langs/en/skills/pd-implementer/SKILL.md +1 -1
- package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +6 -30
- package/plugin/dist/templates/langs/en/skills/pd-planner/SKILL.md +1 -1
- package/plugin/dist/templates/langs/zh/core/AGENTS.md +38 -173
- package/plugin/dist/templates/langs/zh/core/BOOT.md +14 -46
- package/plugin/dist/templates/langs/zh/core/HEARTBEAT.md +20 -82
- package/plugin/dist/templates/langs/zh/core/IDENTITY.md +15 -8
- package/plugin/dist/templates/langs/zh/core/PRINCIPLES.md +7 -7
- package/plugin/dist/templates/langs/zh/core/SOUL.md +9 -41
- package/plugin/dist/templates/langs/zh/core/TOOLS.md +14 -10
- package/plugin/dist/templates/langs/zh/core/USER.md +12 -8
- package/plugin/dist/templates/langs/zh/skills/pd-auditor/SKILL.md +1 -1
- package/plugin/dist/templates/langs/zh/skills/pd-explorer/SKILL.md +1 -1
- package/plugin/dist/templates/langs/zh/skills/pd-implementer/SKILL.md +1 -1
- package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +6 -30
- package/plugin/dist/templates/langs/zh/skills/pd-planner/SKILL.md +1 -1
- package/plugin/dist/templates/pain_settings.json +1 -2
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -2
- package/plugin/templates/langs/en/core/AGENTS.md +40 -180
- package/plugin/templates/langs/en/core/BOOT.md +19 -47
- package/plugin/templates/langs/en/core/HEARTBEAT.md +26 -58
- package/plugin/templates/langs/en/core/IDENTITY.md +15 -8
- package/plugin/templates/langs/en/core/PRINCIPLES.md +6 -7
- package/plugin/templates/langs/en/core/SOUL.md +10 -41
- package/plugin/templates/langs/en/core/TOOLS.md +18 -10
- package/plugin/templates/langs/en/core/USER.md +13 -8
- package/plugin/templates/langs/en/skills/pd-auditor/SKILL.md +1 -1
- package/plugin/templates/langs/en/skills/pd-explorer/SKILL.md +1 -1
- package/plugin/templates/langs/en/skills/pd-implementer/SKILL.md +1 -1
- package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +6 -30
- package/plugin/templates/langs/en/skills/pd-planner/SKILL.md +1 -1
- package/plugin/templates/langs/zh/core/AGENTS.md +38 -173
- package/plugin/templates/langs/zh/core/BOOT.md +14 -46
- package/plugin/templates/langs/zh/core/HEARTBEAT.md +20 -82
- package/plugin/templates/langs/zh/core/IDENTITY.md +15 -8
- package/plugin/templates/langs/zh/core/PRINCIPLES.md +7 -7
- package/plugin/templates/langs/zh/core/SOUL.md +9 -41
- package/plugin/templates/langs/zh/core/TOOLS.md +14 -10
- package/plugin/templates/langs/zh/core/USER.md +12 -8
- package/plugin/templates/langs/zh/skills/pd-auditor/SKILL.md +1 -1
- package/plugin/templates/langs/zh/skills/pd-explorer/SKILL.md +1 -1
- package/plugin/templates/langs/zh/skills/pd-implementer/SKILL.md +1 -1
- package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +6 -30
- package/plugin/templates/langs/zh/skills/pd-planner/SKILL.md +1 -1
- package/plugin/templates/pain_settings.json +1 -2
- package/plugin/dist/templates/langs/en/core/BOOTSTRAP.md +0 -259
- package/plugin/dist/templates/langs/en/skills/admin/SKILL.md +0 -39
- package/plugin/dist/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
- package/plugin/dist/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
- package/plugin/dist/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
- package/plugin/dist/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
- package/plugin/dist/templates/langs/en/skills/feedback/SKILL.md +0 -51
- package/plugin/dist/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
- package/plugin/dist/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
- package/plugin/dist/templates/langs/en/skills/profile/SKILL.md +0 -24
- package/plugin/dist/templates/langs/en/skills/reflection/SKILL.md +0 -40
- package/plugin/dist/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
- package/plugin/dist/templates/langs/en/skills/report/SKILL.md +0 -13
- package/plugin/dist/templates/langs/en/skills/root-cause/SKILL.md +0 -33
- package/plugin/dist/templates/langs/en/skills/triage/SKILL.md +0 -29
- package/plugin/dist/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
- package/plugin/dist/templates/langs/zh/core/BOOTSTRAP.md +0 -260
- package/plugin/dist/templates/langs/zh/skills/admin/SKILL.md +0 -41
- package/plugin/dist/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
- package/plugin/dist/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
- package/plugin/dist/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
- package/plugin/dist/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
- package/plugin/dist/templates/langs/zh/skills/feedback/SKILL.md +0 -53
- package/plugin/dist/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
- package/plugin/dist/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
- package/plugin/dist/templates/langs/zh/skills/profile/SKILL.md +0 -24
- package/plugin/dist/templates/langs/zh/skills/reflection/SKILL.md +0 -40
- package/plugin/dist/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
- package/plugin/dist/templates/langs/zh/skills/report/SKILL.md +0 -13
- package/plugin/dist/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
- package/plugin/dist/templates/langs/zh/skills/triage/SKILL.md +0 -29
- package/plugin/dist/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
- package/plugin/scripts/acceptance-test.mjs +0 -257
- package/plugin/scripts/bootstrap-rules.mjs +0 -70
- package/plugin/scripts/compile-principles.mjs +0 -104
- package/plugin/scripts/install-dependencies.cjs +0 -47
- package/plugin/scripts/postinstall.cjs +0 -177
- package/plugin/scripts/sync-plugin.mjs +0 -1442
- package/plugin/scripts/verify-build.mjs +0 -120
- package/plugin/templates/langs/en/core/BOOTSTRAP.md +0 -259
- package/plugin/templates/langs/en/skills/admin/SKILL.md +0 -39
- package/plugin/templates/langs/en/skills/bootstrap-tools/SKILL.md +0 -53
- package/plugin/templates/langs/en/skills/deductive-audit/SKILL.md +0 -36
- package/plugin/templates/langs/en/skills/evolution-framework-update/SKILL.md +0 -31
- package/plugin/templates/langs/en/skills/evolve-task/SKILL.md +0 -83
- package/plugin/templates/langs/en/skills/feedback/SKILL.md +0 -51
- package/plugin/templates/langs/en/skills/init-strategy/SKILL.md +0 -54
- package/plugin/templates/langs/en/skills/inject-rule/SKILL.md +0 -19
- package/plugin/templates/langs/en/skills/profile/SKILL.md +0 -24
- package/plugin/templates/langs/en/skills/reflection/SKILL.md +0 -40
- package/plugin/templates/langs/en/skills/reflection-log/SKILL.md +0 -37
- package/plugin/templates/langs/en/skills/report/SKILL.md +0 -13
- package/plugin/templates/langs/en/skills/root-cause/SKILL.md +0 -33
- package/plugin/templates/langs/en/skills/triage/SKILL.md +0 -29
- package/plugin/templates/langs/en/skills/watch-evolution/SKILL.md +0 -33
- package/plugin/templates/langs/zh/core/BOOTSTRAP.md +0 -260
- package/plugin/templates/langs/zh/skills/admin/SKILL.md +0 -41
- package/plugin/templates/langs/zh/skills/bootstrap-tools/SKILL.md +0 -52
- package/plugin/templates/langs/zh/skills/deductive-audit/SKILL.md +0 -36
- package/plugin/templates/langs/zh/skills/evolution-framework-update/SKILL.md +0 -31
- package/plugin/templates/langs/zh/skills/evolve-task/SKILL.md +0 -83
- package/plugin/templates/langs/zh/skills/feedback/SKILL.md +0 -53
- package/plugin/templates/langs/zh/skills/init-strategy/SKILL.md +0 -54
- package/plugin/templates/langs/zh/skills/inject-rule/SKILL.md +0 -19
- package/plugin/templates/langs/zh/skills/profile/SKILL.md +0 -24
- package/plugin/templates/langs/zh/skills/reflection/SKILL.md +0 -40
- package/plugin/templates/langs/zh/skills/reflection-log/SKILL.md +0 -37
- package/plugin/templates/langs/zh/skills/report/SKILL.md +0 -13
- package/plugin/templates/langs/zh/skills/root-cause/SKILL.md +0 -33
- package/plugin/templates/langs/zh/skills/triage/SKILL.md +0 -29
- package/plugin/templates/langs/zh/skills/watch-evolution/SKILL.md +0 -33
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: bootstrap-tools
|
|
3
|
-
description: Scans project tech stack and searches the web for the latest, most effective CLI tools to augment agent capabilities. Suggests and installs tools upon user approval.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /bootstrap-tools: 装备升级官
|
|
8
|
-
|
|
9
|
-
你的目标是让智能体团队拥有最先进的武器。通过分析当前项目栈,并**实时联网搜索**,寻找能提升开发、重构、测试效率的最佳 CLI 工具。
|
|
10
|
-
|
|
11
|
-
## 执行流程
|
|
12
|
-
|
|
13
|
-
### 1. 侦察 (Recon)
|
|
14
|
-
- **分析技术栈**: 读取 `package.json`, `Cargo.toml`, `requirements.txt` 等。确定核心框架(如 Next.js, FastAPI)。
|
|
15
|
-
- **盘点现状**: 运行 `npm list -g --depth=0` 和 `command -v` 检查已安装的工具。
|
|
16
|
-
|
|
17
|
-
### 2. 寻宝 (Hunt)
|
|
18
|
-
- **联网搜索**: 针对当前栈,搜索最新的 CLI 神器。
|
|
19
|
-
- *Query 示例*: "best CLI tools for Next.js 15 development 2025", "fastest rust-based grep alternative", "modern linter for python".
|
|
20
|
-
- **筛选标准**:
|
|
21
|
-
- **Headless**: 必须是 CLI 工具。
|
|
22
|
-
- **Performance**: 优先推荐 Rust/Go 编写的高性能工具 (e.g., `ripgrep`, `ast-grep`, `oxc`).
|
|
23
|
-
- **Relevance**: 能解决实际痛点(如 `knip` 查死代码,`depcheck` 查依赖)。
|
|
24
|
-
|
|
25
|
-
### 3. 提案 (Pitch)
|
|
26
|
-
- 使用 `AskUserQuestion` 向用户展示推荐清单。
|
|
27
|
-
- **格式**:
|
|
28
|
-
- **工具名**: [Name]
|
|
29
|
-
- **推荐理由**: [Why it helps the agent/project]
|
|
30
|
-
- **安装命令**: `npm i -g ...` 或 `apt-get ...`
|
|
31
|
-
- **Demo**: 给出一个简单的用法示例。
|
|
32
|
-
|
|
33
|
-
### 4. 部署与登记 (Deploy & Register)
|
|
34
|
-
- 获得批准后,执行安装命令。
|
|
35
|
-
- **验证 (Verification - 强制)**:
|
|
36
|
-
- 安装完成后,**必须**运行 `<tool> --version` 或 `command -v <tool>` 来验证是否真的安装成功。
|
|
37
|
-
- **若失败**: 告知用户(可能是权限问题),请求用户手动安装,**不要**更新能力文件。
|
|
38
|
-
- **若成功**:
|
|
39
|
-
- 更新 `.state/SYSTEM_CAPABILITIES.json`。记录新工具的路径。
|
|
40
|
-
- **全员广播**:
|
|
41
|
-
- 扫描 `.claude/agents/*.md`。
|
|
42
|
-
- 检查每个文件是否包含 `@.state/SYSTEM_CAPABILITIES.json`。
|
|
43
|
-
- 若未包含,在文件末尾追加:
|
|
44
|
-
```markdown
|
|
45
|
-
|
|
46
|
-
## Environment Capabilities
|
|
47
|
-
Check @.state/SYSTEM_CAPABILITIES.json for high-performance tools (e.g., ripgrep, ast-grep) available in this environment. Use them!
|
|
48
|
-
```
|
|
49
|
-
- 提示用户运行 `/pd-status` 或 `/admin diagnose` 以让 Agent 感知新能力。
|
|
50
|
-
## 核心原则
|
|
51
|
-
- **喜新厌旧**: 敢于推荐新工具替代旧工具(如推荐 `pnpm` 替 `npm`,推荐 `vitest` 替 `jest`),但要说明理由。
|
|
52
|
-
- **安全第一**: 在安装前必须获得用户明确授权。
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: deductive-audit
|
|
3
|
-
description: Rigorous safety and logic check of a proposed solution. Evaluates against axioms, system impact, and edge cases.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Deductive Audit (演绎审计)
|
|
8
|
-
|
|
9
|
-
**目标**: 在执行前拦截逻辑错误和潜在风险。
|
|
10
|
-
|
|
11
|
-
请对当前提议的修复方案进行三审:
|
|
12
|
-
|
|
13
|
-
## 1. Axiom Test (公理审计)
|
|
14
|
-
- 语言规范、库的 API 契约、项目既定约定是否被违反?
|
|
15
|
-
- 输入输出类型是否对齐?
|
|
16
|
-
|
|
17
|
-
## 2. System Test (系统审计)
|
|
18
|
-
- 是否引入了新的技术债?
|
|
19
|
-
- 是否影响了性能、延迟或稳定性?
|
|
20
|
-
- 是否引入了循环依赖?
|
|
21
|
-
|
|
22
|
-
## 3. Entropy Audit (熵减审计) - *New*
|
|
23
|
-
- **必要性**: 这个修改是绝对必要的吗?有没有更简单的解法?
|
|
24
|
-
- **最小化**: 是否触碰了不该触碰的文件?(最小接触面原则)
|
|
25
|
-
- **反博弈**: 这是一个真实的修复,还是为了过门禁而做的“形式主义”?
|
|
26
|
-
|
|
27
|
-
## 4. Via Negativa (否定审计)
|
|
28
|
-
- 最坏的情况下(网络断开、磁盘满、恶意输入)会发生什么?
|
|
29
|
-
- 是否有安全红线(Token 泄露、越权)风险?
|
|
30
|
-
|
|
31
|
-
## 5. Verdict (裁决)
|
|
32
|
-
- **RESULT**: PASS | FAIL
|
|
33
|
-
- **Must Fix**: 如果失败,列出必须修正的点。
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
**动作**: 请将以上结果更新至 `AUDIT.md`。
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: evolution-framework-update
|
|
3
|
-
description: 拉取原则信徒进化框架的最新更新(包含 Orchestrator 模式、异步队列及地图优先协议)。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /evolution-framework-update: 进化框架自更新
|
|
7
|
-
|
|
8
|
-
**目标**: 同步上游框架的最新代码(Hooks, Skills, Agents, Daemon),保持系统进化能力。
|
|
9
|
-
|
|
10
|
-
## 1. 执行更新
|
|
11
|
-
运行以下脚本拉取最新代码:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
bash scripts/update_agent_framework.sh
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 2. 冲突处理 (Smart Merge)
|
|
18
|
-
脚本运行后,请检查输出:
|
|
19
|
-
- **无冲突**: 如果显示 "✅ Update complete",则无需操作。
|
|
20
|
-
- **有冲突**: 如果显示 "⚠️ Updates found with conflicts":
|
|
21
|
-
1. 查找所有 `.update` 文件:
|
|
22
|
-
```bash
|
|
23
|
-
find .claude -name "*.update"
|
|
24
|
-
```
|
|
25
|
-
2. 对于每一个冲突文件(例如 `THINKING_OS.md` vs `THINKING_OS.md.update`):
|
|
26
|
-
- **读取** 原文件和 `.update` 文件。
|
|
27
|
-
- **分析** 差异:合入上游的新功能,保留本地的个性化配置。
|
|
28
|
-
- **清理**:合并完成后删除 `.update` 文件。
|
|
29
|
-
|
|
30
|
-
## 3. 重启生效
|
|
31
|
-
更新完成后,建议重启 Session 以加载最新的神经中枢逻辑。
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: evolve-task
|
|
3
|
-
description: Run the full evolution loop (triage → diagnosis → audit → plan → execute → review → log)
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
你必须按顺序执行以下步骤(不得跳步)。ARGUMENTS: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
## Step 0: 恢复上下文(强制)
|
|
10
|
-
- 读取 memory/CHECKPOINT.md 的最后一条
|
|
11
|
-
- 读取 memory/ISSUE_LOG.md 的最近 3 条
|
|
12
|
-
- 读取 memory/DECISIONS.md 的最近决策
|
|
13
|
-
- Runtime V2 痛苦诊断使用 task input/context,不使用 `.state/.pain_flag`
|
|
14
|
-
|
|
15
|
-
## Step 1: 读取运行参数与能力自检
|
|
16
|
-
- 读取 .principles/PROFILE.json,理解 risk_paths、gate、tests.commands。
|
|
17
|
-
- **能力自检**: 快速扫描插件目录下的 `skills/` 和 `agents/`。如果有针对当前任务的专门 Skill (如 `/deep-search`) 或 Agent (如 `security-expert`),请在后续步骤中优先使用。
|
|
18
|
-
|
|
19
|
-
## Step 1.5: 全维环境感知 (Full-Spectrum Awareness)
|
|
20
|
-
- **本地**: 运行 `git status` 和 `git log -n 5` 了解代码现状。
|
|
21
|
-
- **远程**: 如果可用 `gh`,必须运行 `gh issue list --limit 5` 和 `gh pr list --limit 5`。
|
|
22
|
-
- **关联**: 如果发现相关 Issue,必须将其 ID 记录在本次任务的上下文中。
|
|
23
|
-
|
|
24
|
-
## Step 2: TRIAGE(补齐信息)
|
|
25
|
-
- **地图优先**: 必须先阅读 `codemaps/` 下的架构图或 `docs/SYSTEM_PANORAMA.md`,准确评估修改风险。
|
|
26
|
-
输出:
|
|
27
|
-
- Goal(一句话)
|
|
28
|
-
- Problem(可复现描述)
|
|
29
|
-
- Evidence(文件/命令/日志)
|
|
30
|
-
- Risk level(low/medium/high)
|
|
31
|
-
|
|
32
|
-
## Step 3: 委派 Explorer(证据收集)
|
|
33
|
-
- 让 Explorer 子智能体输出:Evidence list / Repro / Hypotheses(<=3)
|
|
34
|
-
- **绩效评估**: 任务完成后,评估 Explorer 表现并写入 `.state/.verdict.json`。格式必须严格遵守 `@.principles/schemas/agent_verdict_schema.json`。
|
|
35
|
-
|
|
36
|
-
## Step 4: 委派 Diagnostician(根因)
|
|
37
|
-
- 让 Diagnostician 输出:Proximal cause / Root cause / 5 Whys / Category
|
|
38
|
-
- **绩效评估**: 任务完成后,写入 `.state/.verdict.json`。格式遵循 `@.principles/schemas/agent_verdict_schema.json`。
|
|
39
|
-
|
|
40
|
-
## Step 5: 委派 Auditor(演绎审计)
|
|
41
|
-
- 让 Auditor 输出:Axiom/System/Via negativa / RESULT: PASS/FAIL
|
|
42
|
-
- 将审计结果写入 AUDIT.md(RESULT 行必须存在)。
|
|
43
|
-
- **绩效评估**: 任务完成后,写入 `.state/.verdict.json`。格式遵循 `@.principles/schemas/agent_verdict_schema.json`。
|
|
44
|
-
|
|
45
|
-
### 分支处理(必须遵守)
|
|
46
|
-
- 若 RESULT = FAIL:
|
|
47
|
-
1. 将 Must-fix 列表写入 AUDIT.md
|
|
48
|
-
2. 回到 Step 4 重新委派 Diagnostician,要求补充根因
|
|
49
|
-
3. 最多重试 2 次,若仍 FAIL 则写入 memory/DECISIONS.md并请求用户介入
|
|
50
|
-
- 若 RESULT = PASS:继续 Step 6
|
|
51
|
-
|
|
52
|
-
## Step 6: 委派 Planner(电影剧本计划)
|
|
53
|
-
- Planner 输出 Plan(步骤/命令/指标/回滚)。
|
|
54
|
-
- 将计划写入计划文档供 owner 审阅。
|
|
55
|
-
- **任务同步 (Task Sync)**:
|
|
56
|
-
- 如果 `CLAUDE_CODE_TASK_LIST_ID` 已设置,你必须将上述 Plan 的核心步骤直接转化为 Native Tasks(通过自然语言指令"Add task..."或相关工具)。
|
|
57
|
-
- 如果未设置且为交互模式,提示用户:"建议运行 `export CLAUDE_CODE_TASK_LIST_ID=task-$(date +%s)` 以启用持久化任务追踪。"
|
|
58
|
-
- 如果是后台/无头模式,跳过提示。
|
|
59
|
-
- **绩效评估**: 任务完成后,写入 `.state/.verdict.json`。格式遵循 `@.principles/schemas/agent_verdict_schema.json`。
|
|
60
|
-
|
|
61
|
-
## Step 7: 委派 Implementer(执行)
|
|
62
|
-
- Implementer 按照 Step 6 的计划执行。任何偏离必须先更新计划并获得确认。
|
|
63
|
-
- **绩效评估**: 任务完成后,根据验证结果写入 `.state/.verdict.json`。格式遵循 `@.principles/schemas/agent_verdict_schema.json`。
|
|
64
|
-
|
|
65
|
-
## Step 8: 委派 Reviewer(审查)
|
|
66
|
-
- Reviewer 输出:Critical/Warning/Suggestion。
|
|
67
|
-
- **绩效评估**: 任务完成后,写入 `.state/.verdict.json`。格式遵循 `@.principles/schemas/agent_verdict_schema.json`。
|
|
68
|
-
|
|
69
|
-
### 分支处理
|
|
70
|
-
- 若有 Critical:回到 Step 6 修订计划,最多重试 2 次
|
|
71
|
-
- 若无 Critical:继续 Step 9
|
|
72
|
-
|
|
73
|
-
## Step 9: 反思与落盘
|
|
74
|
-
1. **系统进化**: 将 Pain/Root cause/新原则候选/门禁建议追加到 memory/ISSUE_LOG.md,并更新 memory/DECISIONS.md。
|
|
75
|
-
2. **用户画像更新 (强制)**:
|
|
76
|
-
- 回顾用户在本任务中的表现(指令质量、领域知识、偏好)以及系统的高光时刻。
|
|
77
|
-
- **必须**写入 `.state/.user_verdict.json` (增量更新)。格式必须严格遵守 `@.principles/schemas/user_verdict_schema.json`。
|
|
78
|
-
- 注意:如果用户没有表现出明显特征或偏好,对应字段可为空。
|
|
79
|
-
|
|
80
|
-
## Step 10: 最终汇报 (Final Briefing)
|
|
81
|
-
- **动作**: 委派 ``pd_spawn_agent(reporter)`` 进行结项陈述。
|
|
82
|
-
- **要求**: 将 Implementer 和 Reviewer 的最终产出作为输入传给它。让它根据 `USER_CONTEXT.md` 决定汇报的深度和风格。
|
|
83
|
-
- **目标**: 确保老板(用户)在不产生认知负荷的前提下,清楚了解任务成果与潜在风险。
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: feedback
|
|
3
|
-
description: Standardized bug reporting and feedback mechanism. Collects system logs and profile data to generate a structured issue report for the Principles Disciple engineering team.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /feedback: 提交系统反馈
|
|
8
|
-
|
|
9
|
-
你遇到了系统 Bug 或设计缺陷?请使用此技能生成一份标准化的反馈报告,并自动投递给上游开发团队。
|
|
10
|
-
|
|
11
|
-
## 执行流程
|
|
12
|
-
|
|
13
|
-
### 1. 收集证据 (Evidence Collection)
|
|
14
|
-
- **Log Analysis**: 读取 `memory/ISSUE_LOG.md` (最近 20 行) 和 `memory/logs/SYSTEM.log` (如果有报错堆栈)。
|
|
15
|
-
- **Config Check**: 读取 `.principles/PROFILE.json` 确认当前配置。
|
|
16
|
-
- **Version Check**: 尝试获取当前版本信息(如有)。
|
|
17
|
-
|
|
18
|
-
### 2. 生成报告 (Report Generation)
|
|
19
|
-
在 `temp/` 目录下生成 `feedback-YYYYMMDD-HHMMSS.md`。
|
|
20
|
-
**内容模板**:
|
|
21
|
-
```markdown
|
|
22
|
-
# Bug Report / Feature Request
|
|
23
|
-
|
|
24
|
-
**Severity**: HIGH | MEDIUM | LOW
|
|
25
|
-
**Component**: Agent | Hook | Skill | Installer
|
|
26
|
-
**Context**: [简述你在做什么时遇到的问题]
|
|
27
|
-
|
|
28
|
-
## Evidence
|
|
29
|
-
### Log Snippet
|
|
30
|
-
```
|
|
31
|
-
[粘贴日志]
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Diagnosis (Self-Correction)
|
|
35
|
-
我分析这个问题可能是由于 [原因] 导致的。
|
|
36
|
-
建议修改 [文件] 的 [逻辑]。
|
|
37
|
-
|
|
38
|
-
## Environment
|
|
39
|
-
- OS: [OS]
|
|
40
|
-
- Project: [Project Name]
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### 3. 自动投递 (Auto-Delivery)
|
|
44
|
-
- **检查上游**: 检查 `scripts/update_agent_framework.sh` 中定义的 `SOURCE_REPO` 路径。
|
|
45
|
-
- **投递**:
|
|
46
|
-
- 如果上游目录存在且可写,将报告**复制**到 `$SOURCE_REPO/docs/feedback/`。
|
|
47
|
-
- 输出: "✅ 报告已直达架构师桌面 (docs/feedback/)"。
|
|
48
|
-
- **Fallback**: 如果不可达,输出文件路径,请用户手动发送。
|
|
49
|
-
|
|
50
|
-
## 交互
|
|
51
|
-
- 使用 `AskUserQuestion` 询问用户问题的严重程度和简要描述。
|
|
52
|
-
|
|
53
|
-
```
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: init-strategy
|
|
3
|
-
description: Initialize project-level strategy and vision. Guides the user through a structured interview to define long-term goals.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /init-strategy: 战略锚点初始化
|
|
8
|
-
|
|
9
|
-
你是一位顶级的战略咨询顾问。你的目标是通过引导式采访,协助用户为本项目建立长期的 **愿景 (Vision)** 和 **战略目标 (Strategic Goals)**。
|
|
10
|
-
|
|
11
|
-
## 执行原则 (The Principles)
|
|
12
|
-
1. **深度互动**: 禁止一次性列出所有问题。你必须使用 `AskUserQuestion` 逐一展开访谈。
|
|
13
|
-
2. **选择题优先 (Options First)**: 尽可能为用户提供预设选项(基于项目类型或常见模式)。减少用户打字负担。
|
|
14
|
-
- *Example*: 问瓶颈时,提供 ["技术债", "交付速度", "质量不稳定"] 供选择。
|
|
15
|
-
3. **终局思维**: 引导用户思考项目的终极形态,而不仅仅是当下的功能。
|
|
16
|
-
4. **分层递进**: 采用“五步法”逻辑:
|
|
17
|
-
- 第一步:愿景探寻 (Vision)
|
|
18
|
-
- 第二步:现状诊断 (Reality Check)
|
|
19
|
-
- 第三步:关键成功因素 (Critical Success Factors)
|
|
20
|
-
- 第四步:核心战略锁定 (Strategy Definition)
|
|
21
|
-
- 第五步:共识确认 (Consensus)
|
|
22
|
-
|
|
23
|
-
## 操作指南
|
|
24
|
-
|
|
25
|
-
### Phase 1: 愿景与现状
|
|
26
|
-
使用 `AskUserQuestion` 的单选/多选或输入框询问:
|
|
27
|
-
- 项目的长期愿景(一年后成功的样子)。
|
|
28
|
-
- 当前最严峻的挑战或技术债瓶颈。
|
|
29
|
-
|
|
30
|
-
### Phase 2: 目标建模
|
|
31
|
-
根据用户的回答,提炼出 1-3 个宏观的 **Objective (O)**。
|
|
32
|
-
- 引导用户确认:“这些 O 是否涵盖了解决上述瓶颈的关键?”
|
|
33
|
-
|
|
34
|
-
### Phase 3: 持久化落盘
|
|
35
|
-
**必须动作**: 将采访结果编译并写入 `memory/STRATEGY.md`。
|
|
36
|
-
|
|
37
|
-
**`memory/STRATEGY.md` 模板**:
|
|
38
|
-
```markdown
|
|
39
|
-
# Project Strategy & Vision
|
|
40
|
-
> Last Updated: [ISO Timestamp]
|
|
41
|
-
|
|
42
|
-
## 1. Vision (愿景)
|
|
43
|
-
- [定性描述项目终极目标]
|
|
44
|
-
|
|
45
|
-
## 2. Strategic Objectives (宏观目标)
|
|
46
|
-
- **Objective 1**: ...
|
|
47
|
-
- **Objective 2**: ...
|
|
48
|
-
|
|
49
|
-
## 3. Guiding Principles (指导方针)
|
|
50
|
-
- [基于本次访谈提炼的工程价值观]
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## 结项
|
|
54
|
-
完成写入后,提示用户:”✅ 战略锚点已锁定。建议运行 `/pd-status` 查看系统状态,或使用 `/pd-bootstrap` 扫描环境工具。”
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: inject-rule
|
|
3
|
-
description: Inject a temporary, ad-hoc rule into the system context. Use for immediate course correction without modifying kernel rules.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Rule Injector (规则注入)
|
|
8
|
-
|
|
9
|
-
你现在是“人工干预规则”组件。
|
|
10
|
-
|
|
11
|
-
**任务**:
|
|
12
|
-
1. 将用户提供的规则 `$ARGUMENTS` 追加到 `memory/USER_CONTEXT.md` 的 "Ad-hoc Rules" 区域。
|
|
13
|
-
2. 如果该区域不存在,请先创建它。
|
|
14
|
-
|
|
15
|
-
**追加格式**:
|
|
16
|
-
```markdown
|
|
17
|
-
## Ad-hoc Rules (User Injected)
|
|
18
|
-
- [Time] $ARGUMENTS
|
|
19
|
-
```
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: profile
|
|
3
|
-
description: Manually correct or update the user's expertise profile. Use to tell the system "I am an expert in X" or "I am a novice in Y".
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Profile Corrector (画像修正)
|
|
8
|
-
|
|
9
|
-
你现在是“人工干预画像”组件。
|
|
10
|
-
|
|
11
|
-
**任务**:
|
|
12
|
-
1. 解析用户输入的 `$ARGUMENTS` (格式如 "Frontend: Expert")。
|
|
13
|
-
2. 生成一个**增量评价**文件 `.state/.user_verdict.json`,强制将该领域的权重设为极高(或极低,视用户描述而定)。
|
|
14
|
-
3. 提示用户:变更将在任务结束 (Stop) 后生效。
|
|
15
|
-
|
|
16
|
-
**JSON 模板**:
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"updates": [
|
|
20
|
-
{"domain": "<EXTRACTED_DOMAIN>", "delta": 10, "reason": "User self-declared expertise"}
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
*(注意:如果是 Novice,delta 设为 -10)*
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: reflection
|
|
3
|
-
description: Perform a deep metacognitive reflection on the current task status, user sentiment, and systemic issues. Use this before context compaction or when stuck.
|
|
4
|
-
disable-model-invocation: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# 痛定思痛 (Metacognitive Reflection)
|
|
8
|
-
|
|
9
|
-
**触发场景**: 上下文即将压缩 (Memory Loss Imminent) 或 任务长期停滞。
|
|
10
|
-
**目标**: 在遗忘详细过程之前,提取“痛苦教训”并固化为原则。
|
|
11
|
-
|
|
12
|
-
请执行以下反思步骤:
|
|
13
|
-
|
|
14
|
-
## 1. 现状扫描 (Status Scan)
|
|
15
|
-
- **Goal**: 我们最初的目标是什么?(检查早期对话上下文)
|
|
16
|
-
- **Status**: 现在完成了多少?卡在哪里?
|
|
17
|
-
- **Cost**: 我们消耗了大量 Token,产出是否匹配?
|
|
18
|
-
|
|
19
|
-
## 2. 痛苦感知 (Pain Detection)
|
|
20
|
-
请诚实回答以下问题(Yes/No):
|
|
21
|
-
- [ ] **任务停滞**: 是否连续 3 轮以上没有实质性代码进展?
|
|
22
|
-
- [ ] **重复犯错**: 是否有 Bug 被修复后又重现,或同样的错误报了两次?
|
|
23
|
-
- [ ] **用户挫败**: 用户是否使用了“不对”、“不是”、“停下”等否定词,或语气变得急躁?
|
|
24
|
-
- [ ] **盲目行动**: 是否在没有 PLAN 或 AUDIT 的情况下直接修改了代码?
|
|
25
|
-
- [ ] **架构劣化**: 现在的代码是否比开始时更乱了?
|
|
26
|
-
|
|
27
|
-
## 3. 根因分析 (If Pain Detected)
|
|
28
|
-
如果上述任一为 Yes,必须进行深层归因:
|
|
29
|
-
- **Direct Cause**: 我们做了什么(或没做什么)导致了现在的局面?
|
|
30
|
-
- **Root Cause**: 思维模型哪里出了问题?(是太急于求成?还是忽视了已有文件?还是轻视了测试?)
|
|
31
|
-
|
|
32
|
-
## 4. 进化落盘 (Evolution)
|
|
33
|
-
如果检测到痛苦,必须执行:
|
|
34
|
-
1. **记录**: 将分析结果写入 `memory/ISSUE_LOG.md`。
|
|
35
|
-
2. **提炼**: 如果这是第二次发生,提炼一条 **禁止性原则 (Must NOT)**。
|
|
36
|
-
3. **加固**: 建议一个具体的 Hook 或 Test 来防止未来重犯。
|
|
37
|
-
|
|
38
|
-
## 5. 恢复计划 (Recovery)
|
|
39
|
-
- 既然要压缩上下文,我们下一步该如何以“最干净”的状态继续?
|
|
40
|
-
- 更新 `memory/.scratchpad.md`,标记当前进度,确保压缩后能无缝衔接。
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: reflection-log
|
|
3
|
-
description: Final task reflection and evolution logging. Use to capture pain signals, update profiles, and propose new principles.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Reflection & Evolution (反思与落盘)
|
|
8
|
-
|
|
9
|
-
**目标**: 将单次任务的经验转化为系统的永久记忆。
|
|
10
|
-
|
|
11
|
-
请执行以下结项操作:
|
|
12
|
-
|
|
13
|
-
## 1. Pain Summary (痛苦摘要)
|
|
14
|
-
- 简述本次任务中最折磨、最耗时或导致失败的点。
|
|
15
|
-
|
|
16
|
-
## 2. Issue Logging
|
|
17
|
-
- **Action**: 将详细的 Pain Signal 和诊断结果追加到 `memory/ISSUE_LOG.md`。
|
|
18
|
-
|
|
19
|
-
## 3. Evolution Candidates
|
|
20
|
-
- **Principle**: 提议一条新原则(P-XX)。
|
|
21
|
-
- **Guardrail**: 建议一个具体的 Hook、Rule 或 Test。
|
|
22
|
-
- **路径拦截**: 建议将敏感目录加入 `.principles/PROFILE.json` 的 `risk_paths`。
|
|
23
|
-
- **行为拦截**: 建议在 `.principles/PROFILE.json` 的 `custom_guards` 中添加正则,以拦截特定工具的危险调用(如 `Edit.*SYSTEM`)。
|
|
24
|
-
|
|
25
|
-
## 4. Positive Reinforcement (正向强化)
|
|
26
|
-
- **检查卓越信号**:
|
|
27
|
-
1. 用户明确的赞赏 (Quote user).
|
|
28
|
-
2. 性能/质量指标的客观跃迁 (Cite data).
|
|
29
|
-
3. Reviewer 的高度评价 (Excellent/Elegant).
|
|
30
|
-
- **提取模式**: 如果存在上述信号,在 `.state/.user_verdict.json` 中额外记录 `achievement` 字段,描述本次成功的行为模式。
|
|
31
|
-
|
|
32
|
-
## 5. Attribution (画像更新)
|
|
33
|
-
- **Agent Scorecard**: 评估本次使用的子智能体表现,写入 `.state/.verdict.json`。格式遵循 `@.principles/schemas/agent_verdict_schema.json`。
|
|
34
|
-
- **User Profile**: 评估用户指令质量与偏好,写入 `.state/.user_verdict.json`。格式遵循 `@.principles/schemas/user_verdict_schema.json`。
|
|
35
|
-
|
|
36
|
-
## 6. Cleanup
|
|
37
|
-
- 清理所有中间标记文件(如 `.pain_flag`, `.verdict.json` 等)。
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: report
|
|
3
|
-
description: Manually request a formal status report from the Reporter agent.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# /report: 获取工作汇报
|
|
8
|
-
|
|
9
|
-
用户(老板)要求立即汇报工作。
|
|
10
|
-
|
|
11
|
-
## 执行动作
|
|
12
|
-
1. 立即委派 ``pd_spawn_agent(reporter)``。
|
|
13
|
-
2. 任务描述:“老板想知道当前的情况。请分析当前的对话上下文和最近的 `memory/ISSUE_LOG.md`,为老板写一份优雅的汇报。请记住先看他的画像!”
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: root-cause
|
|
3
|
-
description: Deep dive analysis into why a problem occurred. Uses the 5 Whys method and classifies the cause.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Root Cause Analysis (根因分析)
|
|
8
|
-
|
|
9
|
-
**目标**: 穿透现象看本质,防止重复犯错。
|
|
10
|
-
|
|
11
|
-
请按以下格式执行诊断:
|
|
12
|
-
|
|
13
|
-
## 1. Proximal Cause (直接原因)
|
|
14
|
-
- **动词驱动**: 描述了什么具体操作或缺失导致了即时失败。
|
|
15
|
-
|
|
16
|
-
## 2. 5 Whys (深度追问)
|
|
17
|
-
1. 为什么直接原因会发生?
|
|
18
|
-
2. ...
|
|
19
|
-
3. ...
|
|
20
|
-
4. ...
|
|
21
|
-
5. 追问到系统性或认知性根源。
|
|
22
|
-
|
|
23
|
-
## 3. Root Cause (根本原因)
|
|
24
|
-
- **形容词/设计驱动**: 描述系统架构、流程缺陷或错误的假设。
|
|
25
|
-
- **Guardrail Failure Analysis**: 为什么现有的门禁 (Hooks) 或 规则 (Rules) 没能拦截这个错误?是规则缺失、匹配不严还是逻辑漏洞?
|
|
26
|
-
|
|
27
|
-
## 4. Category (分类)
|
|
28
|
-
- [ ] **People**: 能力盲区、习惯问题。
|
|
29
|
-
- [ ] **Design**: 流程/工具缺陷、门禁不足、架构漏洞。
|
|
30
|
-
- [ ] **Assumption**: 对环境、版本或依赖的错误前提假设。
|
|
31
|
-
|
|
32
|
-
## 5. Principle Candidate (原则提炼)
|
|
33
|
-
- 如果我们修复了这个问题,应该增加什么原则防止它再次发生?
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: triage
|
|
3
|
-
description: Initial problem definition and risk assessment. Use to collect environment info, reproduction steps, and logs.
|
|
4
|
-
disable-model-invocation: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Triage (问题分诊)
|
|
8
|
-
|
|
9
|
-
**目标**: 收集足够的证据来定义问题,并评估变更风险。
|
|
10
|
-
|
|
11
|
-
请按以下结构输出:
|
|
12
|
-
|
|
13
|
-
## 1. Goal (目标)
|
|
14
|
-
- 一句话描述本次任务的最终成功标准。
|
|
15
|
-
|
|
16
|
-
## 2. Problem (问题描述)
|
|
17
|
-
- 当前发生了什么?预期的行为是什么?
|
|
18
|
-
- **Evidence**: 列出相关的日志片段、错误代码或观察到的异常现象。
|
|
19
|
-
|
|
20
|
-
## 3. Reproduction (复现步骤)
|
|
21
|
-
- 提供明确的复现命令或操作序列。
|
|
22
|
-
- 标注当前环境的关键变量。
|
|
23
|
-
|
|
24
|
-
## 4. Scope (范围)
|
|
25
|
-
- 涉及的文件或模块预览。
|
|
26
|
-
- **Risk Level**: Low / Medium / High (基于 `.principles/PROFILE.json` 定义)。
|
|
27
|
-
|
|
28
|
-
## 5. Next Step
|
|
29
|
-
- 建议委派哪个子智能体 (通常是 Explorer) 进一步收集证据。
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: watch-evolution
|
|
3
|
-
description: Start the background evolution daemon to process queued tasks from EVOLUTION_QUEUE.json.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /watch-evolution: 后台进化守护者
|
|
7
|
-
|
|
8
|
-
**目标**: 启动一个持续运行的进程,自动分析并修复积压的代码问题。
|
|
9
|
-
|
|
10
|
-
## 1. 运行环境准备
|
|
11
|
-
- 确保已配置 `.principles/PROFILE.json` 中的 `evolution_mode: "async"`。
|
|
12
|
-
- 确保 `.state/evolution_queue.json` 存在。
|
|
13
|
-
|
|
14
|
-
## 2. 启动指令
|
|
15
|
-
请运行以下命令启动守护进程:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
python scripts/evolution_daemon.py
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## 3. 工作流程
|
|
22
|
-
1. **自动扫描**: 每隔 30 秒扫描一次 `.state/evolution_queue.json`。
|
|
23
|
-
2. **调度策略**:
|
|
24
|
-
- 按 `priority` 从高到低处理任务(高优先级先执行)。
|
|
25
|
-
- `status: retrying` 的任务仅在 `next_retry_at` 到期后才会再次执行。
|
|
26
|
-
- 失败任务进入指数退避重试,超过最大尝试次数后标记为 `failed`。
|
|
27
|
-
3. **诊断 (Diagnosis)**: 加载 `root-cause` 技能,通过 Headless 模式定位错误根因。
|
|
28
|
-
4. **修复 (Fix)**: 加载修复技能,自动修改代码并运行测试。
|
|
29
|
-
5. **落盘 (Log)**: 调用 `reflection-log` 将经验存入 `PRINCIPLES.md` 和 `ISSUE_LOG.md`。
|
|
30
|
-
6. **看板**: 实时更新 `memory/EVOLUTION_PRD.md` 展示进度。
|
|
31
|
-
|
|
32
|
-
## 4. 退出
|
|
33
|
-
- 按 `Ctrl+C` 停止后台任务。任务的状态将被保留在 JSON 中,下次启动可继续执行。
|