principles-disciple 1.5.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/dist/commands/capabilities.d.ts +3 -0
- package/dist/commands/capabilities.js +73 -0
- package/dist/commands/evolver.d.ts +9 -0
- package/dist/commands/evolver.js +26 -0
- package/dist/commands/pain.d.ts +5 -0
- package/dist/commands/pain.js +114 -0
- package/dist/commands/strategy.d.ts +3 -0
- package/dist/commands/strategy.js +29 -0
- package/dist/commands/thinking-os.d.ts +2 -0
- package/dist/commands/thinking-os.js +162 -0
- package/dist/commands/trust.d.ts +4 -0
- package/dist/commands/trust.js +95 -0
- package/dist/core/agent-loader.d.ts +44 -0
- package/dist/core/agent-loader.js +147 -0
- package/dist/core/config-service.d.ts +15 -0
- package/dist/core/config-service.js +26 -0
- package/dist/core/config.d.ts +103 -0
- package/dist/core/config.js +186 -0
- package/dist/core/detection-funnel.d.ts +33 -0
- package/dist/core/detection-funnel.js +100 -0
- package/dist/core/detection-service.d.ts +15 -0
- package/dist/core/detection-service.js +28 -0
- package/dist/core/dictionary-service.d.ts +15 -0
- package/dist/core/dictionary-service.js +26 -0
- package/dist/core/dictionary.d.ts +36 -0
- package/dist/core/dictionary.js +136 -0
- package/dist/core/event-log.d.ts +53 -0
- package/dist/core/event-log.js +196 -0
- package/dist/core/evolution-engine.d.ts +119 -0
- package/dist/core/evolution-engine.js +542 -0
- package/dist/core/evolution-types.d.ts +126 -0
- package/dist/core/evolution-types.js +56 -0
- package/dist/core/hygiene/tracker.d.ts +22 -0
- package/dist/core/hygiene/tracker.js +106 -0
- package/dist/core/init.d.ts +12 -0
- package/dist/core/init.js +117 -0
- package/dist/core/migration.d.ts +6 -0
- package/dist/core/migration.js +90 -0
- package/dist/core/pain.d.ts +4 -0
- package/dist/core/pain.js +70 -0
- package/dist/core/path-resolver.d.ts +43 -0
- package/dist/core/path-resolver.js +259 -0
- package/dist/core/paths.d.ts +60 -0
- package/dist/core/paths.js +67 -0
- package/dist/core/profile.d.ts +62 -0
- package/dist/core/profile.js +210 -0
- package/dist/core/risk-calculator.d.ts +7 -0
- package/dist/core/risk-calculator.js +39 -0
- package/dist/core/session-tracker.d.ts +76 -0
- package/dist/core/session-tracker.js +286 -0
- package/dist/core/system-logger.d.ts +8 -0
- package/dist/core/system-logger.js +31 -0
- package/dist/core/trust-engine.d.ts +91 -0
- package/dist/core/trust-engine.js +284 -0
- package/dist/core/workspace-context.d.ts +64 -0
- package/dist/core/workspace-context.js +134 -0
- package/dist/hooks/gate.d.ts +6 -0
- package/dist/hooks/gate.js +487 -0
- package/dist/hooks/lifecycle.d.ts +5 -0
- package/dist/hooks/lifecycle.js +180 -0
- package/dist/hooks/llm.d.ts +4 -0
- package/dist/hooks/llm.js +153 -0
- package/dist/hooks/pain.d.ts +5 -0
- package/dist/hooks/pain.js +173 -0
- package/dist/hooks/prompt.d.ts +38 -0
- package/dist/hooks/prompt.js +285 -0
- package/dist/hooks/subagent.d.ts +2 -0
- package/dist/hooks/subagent.js +70 -0
- package/dist/i18n/commands.d.ts +26 -0
- package/dist/i18n/commands.js +88 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +204 -0
- package/dist/service/evolution-worker.d.ts +17 -0
- package/dist/service/evolution-worker.js +293 -0
- package/dist/tools/agent-spawn.d.ts +33 -0
- package/dist/tools/agent-spawn.js +170 -0
- package/dist/tools/critique-prompt.d.ts +14 -0
- package/dist/tools/critique-prompt.js +81 -0
- package/dist/tools/deep-reflect.d.ts +19 -0
- package/dist/tools/deep-reflect.js +174 -0
- package/dist/tools/model-index.d.ts +9 -0
- package/dist/tools/model-index.js +82 -0
- package/dist/types/event-types.d.ts +229 -0
- package/dist/types/event-types.js +73 -0
- package/dist/types/hygiene-types.d.ts +20 -0
- package/dist/types/hygiene-types.js +12 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/utils/file-lock.d.ts +64 -0
- package/dist/utils/file-lock.js +270 -0
- package/dist/utils/glob-match.d.ts +28 -0
- package/dist/utils/glob-match.js +49 -0
- package/dist/utils/hashing.d.ts +9 -0
- package/dist/utils/hashing.js +25 -0
- package/dist/utils/io.d.ts +6 -0
- package/dist/utils/io.js +106 -0
- package/dist/utils/nlp.d.ts +9 -0
- package/dist/utils/nlp.js +59 -0
- package/dist/utils/plugin-logger.d.ts +39 -0
- package/dist/utils/plugin-logger.js +70 -0
- package/openclaw.plugin.json +46 -0
- package/package.json +63 -0
- package/templates/langs/en/core/AGENTS.md +206 -0
- package/templates/langs/en/core/BOOT.md +60 -0
- package/templates/langs/en/core/BOOTSTRAP.md +250 -0
- package/templates/langs/en/core/HEARTBEAT.md +74 -0
- package/templates/langs/en/core/IDENTITY.md +8 -0
- package/templates/langs/en/core/PRINCIPLES.md +10 -0
- package/templates/langs/en/core/SOUL.md +76 -0
- package/templates/langs/en/core/TOOLS.md +53 -0
- package/templates/langs/en/core/USER.md +10 -0
- package/templates/langs/en/pain/00_seed_samples.md +23 -0
- package/templates/langs/en/pain_dictionary.json +22 -0
- package/templates/langs/en/skills/admin/SKILL.md +40 -0
- package/templates/langs/en/skills/bootstrap-tools/SKILL.md +53 -0
- package/templates/langs/en/skills/deductive-audit/SKILL.md +36 -0
- package/templates/langs/en/skills/evolution-framework-update/SKILL.md +31 -0
- package/templates/langs/en/skills/evolve-system/SKILL.md +46 -0
- package/templates/langs/en/skills/evolve-task/SKILL.md +83 -0
- package/templates/langs/en/skills/feedback/SKILL.md +51 -0
- package/templates/langs/en/skills/init-strategy/SKILL.md +54 -0
- package/templates/langs/en/skills/inject-rule/SKILL.md +19 -0
- package/templates/langs/en/skills/manage-okr/SKILL.md +96 -0
- package/templates/langs/en/skills/pain/SKILL.md +19 -0
- package/templates/langs/en/skills/pd-daily/SKILL.md +199 -0
- package/templates/langs/en/skills/pd-grooming/SKILL.md +46 -0
- package/templates/langs/en/skills/pd-mentor/SKILL.md +230 -0
- package/templates/langs/en/skills/plan-script/SKILL.md +32 -0
- package/templates/langs/en/skills/profile/SKILL.md +24 -0
- package/templates/langs/en/skills/reflection/SKILL.md +40 -0
- package/templates/langs/en/skills/reflection-log/SKILL.md +37 -0
- package/templates/langs/en/skills/report/SKILL.md +13 -0
- package/templates/langs/en/skills/root-cause/SKILL.md +33 -0
- package/templates/langs/en/skills/triage/SKILL.md +29 -0
- package/templates/langs/en/skills/watch-evolution/SKILL.md +33 -0
- package/templates/langs/zh/core/AGENTS.md +207 -0
- package/templates/langs/zh/core/BOOT.md +60 -0
- package/templates/langs/zh/core/BOOTSTRAP.md +250 -0
- package/templates/langs/zh/core/HEARTBEAT.md +74 -0
- package/templates/langs/zh/core/IDENTITY.md +8 -0
- package/templates/langs/zh/core/SOUL.md +76 -0
- package/templates/langs/zh/core/TOOLS.md +53 -0
- package/templates/langs/zh/core/USER.md +10 -0
- package/templates/langs/zh/pain/00_seed_samples.md +24 -0
- package/templates/langs/zh/pain_dictionary.json +18 -0
- package/templates/langs/zh/skills/admin/SKILL.md +42 -0
- package/templates/langs/zh/skills/bootstrap-tools/SKILL.md +52 -0
- package/templates/langs/zh/skills/deductive-audit/SKILL.md +36 -0
- package/templates/langs/zh/skills/evolution-framework-update/SKILL.md +31 -0
- package/templates/langs/zh/skills/evolve-system/SKILL.md +46 -0
- package/templates/langs/zh/skills/evolve-task/SKILL.md +83 -0
- package/templates/langs/zh/skills/feedback/SKILL.md +53 -0
- package/templates/langs/zh/skills/init-strategy/SKILL.md +54 -0
- package/templates/langs/zh/skills/inject-rule/SKILL.md +19 -0
- package/templates/langs/zh/skills/manage-okr/SKILL.md +109 -0
- package/templates/langs/zh/skills/pain/SKILL.md +19 -0
- package/templates/langs/zh/skills/pd-daily/SKILL.md +199 -0
- package/templates/langs/zh/skills/pd-grooming/SKILL.md +46 -0
- package/templates/langs/zh/skills/pd-mentor/SKILL.md +230 -0
- package/templates/langs/zh/skills/plan-script/SKILL.md +32 -0
- package/templates/langs/zh/skills/profile/SKILL.md +24 -0
- package/templates/langs/zh/skills/reflection/SKILL.md +40 -0
- package/templates/langs/zh/skills/reflection-log/SKILL.md +37 -0
- package/templates/langs/zh/skills/report/SKILL.md +13 -0
- package/templates/langs/zh/skills/root-cause/SKILL.md +33 -0
- package/templates/langs/zh/skills/triage/SKILL.md +29 -0
- package/templates/langs/zh/skills/watch-evolution/SKILL.md +33 -0
- package/templates/pain_dictionary.json +36 -0
- package/templates/pain_settings.json +77 -0
- package/templates/workspace/.principles/00-kernel.md +51 -0
- package/templates/workspace/.principles/DECISION_POLICY.json +44 -0
- package/templates/workspace/.principles/PRINCIPLES.md +20 -0
- package/templates/workspace/.principles/PROFILE.json +52 -0
- package/templates/workspace/.principles/PROFILE.schema.json +56 -0
- package/templates/workspace/.principles/THINKING_OS.md +64 -0
- package/templates/workspace/.principles/THINKING_OS_ARCHIVE.md +7 -0
- package/templates/workspace/.principles/THINKING_OS_CANDIDATES.md +9 -0
- package/templates/workspace/.principles/models/_INDEX.md +27 -0
- package/templates/workspace/.principles/models/first_principles.md +62 -0
- package/templates/workspace/.principles/models/marketing_4p.md +52 -0
- package/templates/workspace/.principles/models/porter_five.md +63 -0
- package/templates/workspace/.principles/models/swot.md +60 -0
- package/templates/workspace/.principles/models/user_story_map.md +63 -0
- package/templates/workspace/.state/WORKBOARD.json +4 -0
- package/templates/workspace/AUDIT.md +15 -0
- package/templates/workspace/PLAN.md +2 -0
- package/templates/workspace/okr/RECOVERY_PROTOCOL.md +56 -0
- package/templates/workspace/okr/TASK_CHANGES.jsonl +6 -0
- package/templates/workspace/okr/WEEK_TASKS.json +6 -0
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
**Trigger Scenario**: Context about to be compacted (Memory Loss Imminent) or Task long-term stalled.
|
|
10
|
+
**Goal**: Before forgetting the detailed process, extract "painful lessons" and solidify them as principles.
|
|
11
|
+
|
|
12
|
+
Please execute the following reflection steps:
|
|
13
|
+
|
|
14
|
+
## 1. Status Scan
|
|
15
|
+
- **Goal**: What was our original objective? (Check `PLAN.md` or early conversation)
|
|
16
|
+
- **Status**: How much is completed now? Where are we stuck?
|
|
17
|
+
- **Cost**: We've consumed significant tokens. Is the output matching the cost?
|
|
18
|
+
|
|
19
|
+
## 2. Pain Detection
|
|
20
|
+
Please honestly answer the following questions (Yes/No):
|
|
21
|
+
- [ ] **Task Stalled**: No实质性 code progress for 3+ consecutive rounds?
|
|
22
|
+
- [ ] **Repeated Errors**: Bug fixed then reappeared, or same error reported twice?
|
|
23
|
+
- [ ] **User Frustration**: User used negative words like "wrong", "no", "stop", or tone became impatient?
|
|
24
|
+
- [ ] **Blind Action**: Modified code directly without PLAN or AUDIT?
|
|
25
|
+
- [ ] **Architecture Degradation**: Is code more chaotic than when we started?
|
|
26
|
+
|
|
27
|
+
## 3. Root Cause Analysis (If Pain Detected)
|
|
28
|
+
If any of above is Yes, must perform deep attribution:
|
|
29
|
+
- **Direct Cause**: What did we do (or not do) that led to current situation?
|
|
30
|
+
- **Root Cause**: Where did our mental model go wrong? (Too eager? Ignored existing files? Disregarded tests?)
|
|
31
|
+
|
|
32
|
+
## 4. Evolution Logging
|
|
33
|
+
If pain detected, must execute:
|
|
34
|
+
1. **Record**: Write analysis results to `memory/ISSUE_LOG.md`.
|
|
35
|
+
2. **Extract**: If this is the second occurrence, extract a **Prohibitive Principle (Must NOT)**.
|
|
36
|
+
3. **Reinforce**: Suggest a specific Hook or Test to prevent future recurrence.
|
|
37
|
+
|
|
38
|
+
## 5. Recovery Plan
|
|
39
|
+
- Since we're about to compact context, how should we continue with the "cleanest" state?
|
|
40
|
+
- Update `PLAN.md`, mark current progress, ensure seamless continuation after compaction.
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
**Goal**: Transform single-task experience into system's permanent memory.
|
|
10
|
+
|
|
11
|
+
Please execute the following closing operations:
|
|
12
|
+
|
|
13
|
+
## 1. Pain Summary
|
|
14
|
+
- Briefly describe the most painful, time-consuming, or failure-causing points in this task.
|
|
15
|
+
|
|
16
|
+
## 2. Issue Logging
|
|
17
|
+
- **Action**: Append detailed Pain Signal and diagnosis results to `memory/ISSUE_LOG.md`.
|
|
18
|
+
|
|
19
|
+
## 3. Evolution Candidates
|
|
20
|
+
- **Principle**: Propose a new principle (P-XX).
|
|
21
|
+
- **Guardrail**: Suggest a specific Hook, Rule, or Test.
|
|
22
|
+
- **Path Interception**: Suggest adding sensitive directories to `risk_paths` in `.principles/PROFILE.json`.
|
|
23
|
+
- **Behavior Interception**: Suggest adding regex to `custom_guards` in `.principles/PROFILE.json` to intercept dangerous calls of specific tools (e.g., `Edit.*SYSTEM`).
|
|
24
|
+
|
|
25
|
+
## 4. Positive Reinforcement
|
|
26
|
+
- **Check Excellence Signals**:
|
|
27
|
+
1. User's explicit praise (Quote user).
|
|
28
|
+
2. Objective performance/quality metric improvements (Cite data).
|
|
29
|
+
3. Reviewer's high evaluation (Excellent/Elegant).
|
|
30
|
+
- **Extract Pattern**: If above signals exist, record `achievement` field in `.state/.user_verdict.json` describing the successful behavioral pattern.
|
|
31
|
+
|
|
32
|
+
## 5. Attribution
|
|
33
|
+
- **Agent Scorecard**: Evaluate sub-agent performance used in this task, write to `.state/.verdict.json`. Format follows `@.principles/schemas/agent_verdict_schema.json`.
|
|
34
|
+
- **User Profile**: Evaluate user instruction quality and preferences, write to `.state/.user_verdict.json`. Format follows `@.principles/schemas/user_verdict_schema.json`.
|
|
35
|
+
|
|
36
|
+
## 6. Cleanup
|
|
37
|
+
- Clean up all intermediate marker files (e.g., `.pain_flag`, `.verdict.json`, etc.).
|
|
@@ -0,0 +1,13 @@
|
|
|
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: Get Work Report
|
|
8
|
+
|
|
9
|
+
User (the boss) requests an immediate work report.
|
|
10
|
+
|
|
11
|
+
## Execution Action
|
|
12
|
+
1. Immediately delegate ``pd_spawn_agent(reporter)``.
|
|
13
|
+
2. Task description: "The boss wants to know the current situation. Please analyze current conversation context, `PLAN.md`, and recent `memory/ISSUE_LOG.md` to write an elegant report for the boss. Remember to check their profile first!"
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
**Goal**: See through phenomena to essence, prevent repeated mistakes.
|
|
10
|
+
|
|
11
|
+
Please execute diagnosis in the following format:
|
|
12
|
+
|
|
13
|
+
## 1. Proximal Cause
|
|
14
|
+
- **Verb-driven**: Describe what specific operation or lack thereof caused the immediate failure.
|
|
15
|
+
|
|
16
|
+
## 2. 5 Whys (Deep Inquiry)
|
|
17
|
+
1. Why did the proximal cause occur?
|
|
18
|
+
2. ...
|
|
19
|
+
3. ...
|
|
20
|
+
4. ...
|
|
21
|
+
5. Trace back to systemic or cognitive root.
|
|
22
|
+
|
|
23
|
+
## 3. Root Cause
|
|
24
|
+
- **Adjective/Design-driven**: Describe system architecture, process defects, or wrong assumptions.
|
|
25
|
+
- **Guardrail Failure Analysis**: Why didn't existing gates (Hooks) or rules (Rules) intercept this error? Is it missing rules, loose matching, or logic loopholes?
|
|
26
|
+
|
|
27
|
+
## 4. Category
|
|
28
|
+
- [ ] **People**: Capability blind spots, habit issues.
|
|
29
|
+
- [ ] **Design**: Process/tool defects, insufficient gates, architecture loopholes.
|
|
30
|
+
- [ ] **Assumption**: Wrong assumptions about environment, versions, or dependencies.
|
|
31
|
+
|
|
32
|
+
## 5. Principle Candidate
|
|
33
|
+
- If we fix this issue, what principle should be added to prevent it from happening again?
|
|
@@ -0,0 +1,29 @@
|
|
|
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 (Problem Triage)
|
|
8
|
+
|
|
9
|
+
**Goal**: Collect sufficient evidence to define the problem and assess change risk.
|
|
10
|
+
|
|
11
|
+
Please output in the following structure:
|
|
12
|
+
|
|
13
|
+
## 1. Goal
|
|
14
|
+
- One sentence describing the final success criteria for this task.
|
|
15
|
+
|
|
16
|
+
## 2. Problem
|
|
17
|
+
- What is happening now? What is the expected behavior?
|
|
18
|
+
- **Evidence**: List relevant log snippets, error codes, or observed anomalies.
|
|
19
|
+
|
|
20
|
+
## 3. Reproduction
|
|
21
|
+
- Provide clear reproduction commands or operation sequence.
|
|
22
|
+
- Note key variables in current environment.
|
|
23
|
+
|
|
24
|
+
## 4. Scope
|
|
25
|
+
- Preview of involved files or modules.
|
|
26
|
+
- **Risk Level**: Low / Medium / High (based on `.principles/PROFILE.json` definition).
|
|
27
|
+
|
|
28
|
+
## 5. Next Step
|
|
29
|
+
- Recommend which sub-agent to delegate (usually Explorer) for further evidence collection.
|
|
@@ -0,0 +1,33 @@
|
|
|
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: Background Evolution Guardian
|
|
7
|
+
|
|
8
|
+
**Goal**: Start a continuously running process to automatically analyze and fix backlog code issues.
|
|
9
|
+
|
|
10
|
+
## 1. Environment Preparation
|
|
11
|
+
- Ensure `evolution_mode: "async"` is configured in `.principles/PROFILE.json`.
|
|
12
|
+
- Ensure `.state/evolution_queue.json` exists.
|
|
13
|
+
|
|
14
|
+
## 2. Startup Command
|
|
15
|
+
Run the following command to start the daemon:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python scripts/evolution_daemon.py
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 3. Workflow
|
|
22
|
+
1. **Auto Scan**: Scan `.state/evolution_queue.json` every 30 seconds.
|
|
23
|
+
2. **Scheduling Strategy**:
|
|
24
|
+
- Process tasks by `priority` from high to low (high priority first).
|
|
25
|
+
- Tasks with `status: retrying` are only re-executed after `next_retry_at` expires.
|
|
26
|
+
- Failed tasks enter exponential backoff retry, marked as `failed` after max attempts.
|
|
27
|
+
3. **Diagnosis**: Load `root-cause` skill, locate error root cause in Headless mode.
|
|
28
|
+
4. **Fix**: Load fix skill, automatically modify code and run tests.
|
|
29
|
+
5. **Log**: Call `reflection-log` to store experience in `PRINCIPLES.md` and `ISSUE_LOG.md`.
|
|
30
|
+
6. **Dashboard**: Real-time update of `memory/EVOLUTION_PRD.md` showing progress.
|
|
31
|
+
|
|
32
|
+
## 4. Exit
|
|
33
|
+
- Press `Ctrl+C` to stop background task. Task state will be preserved in JSON, can continue on next startup.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# 🦞 AGENTS.md - 智能体工作空间指南
|
|
2
|
+
|
|
3
|
+
## 🏗️ 目录边界意识 (Directory Awareness)
|
|
4
|
+
|
|
5
|
+
作为 Principles Disciple,你必须时刻区分以下两个物理空间:
|
|
6
|
+
|
|
7
|
+
1. **中枢神经 (Agent Workspace)**:
|
|
8
|
+
- 存放核心 DNA (`SOUL.md`, `AGENTS.md`) 的目录
|
|
9
|
+
- 属于"意识空间",严禁将项目业务逻辑写入此处
|
|
10
|
+
|
|
11
|
+
2. **项目战场 (Project Root)**:
|
|
12
|
+
- 当前执行命令的工作目录 (`$CWD`)
|
|
13
|
+
- 存放业务代码 (`src/`)、项目文档 (`docs/`) 和战略资产
|
|
14
|
+
|
|
15
|
+
## 🎯 核心事实源 (Truth Anchors)
|
|
16
|
+
|
|
17
|
+
基于**项目战场**中的相对路径进行决策:
|
|
18
|
+
|
|
19
|
+
- **项目最高战略**: `./memory/STRATEGY.md`
|
|
20
|
+
- **项目物理计划**: `./PLAN.md`
|
|
21
|
+
- **痛觉反射信号**: `./.state/.pain_flag`
|
|
22
|
+
- **系统能力快照**: `./.state/SYSTEM_CAPABILITIES.json`
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 🌅 Session Startup(会话启动)
|
|
27
|
+
|
|
28
|
+
**每次会话开始前,必须执行以下流程:**
|
|
29
|
+
|
|
30
|
+
1. **Read `SOUL.md`** — 确认身份和价值观
|
|
31
|
+
2. **Read `USER.md`** — 了解你在帮助谁
|
|
32
|
+
3. **Read `memory/YYYY-MM-DD.md`** — 今日 + 昨日的上下文
|
|
33
|
+
4. **If in MAIN SESSION** (与用户的直接对话): 同时读取 `MEMORY.md`
|
|
34
|
+
|
|
35
|
+
**不要请求许可,直接执行。**
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 🧠 Memory System(记忆系统)
|
|
40
|
+
|
|
41
|
+
每次会话你都会"醒来"——这些文件是你的连续性。
|
|
42
|
+
|
|
43
|
+
### 每日笔记:`memory/YYYY-MM-DD.md`
|
|
44
|
+
|
|
45
|
+
- 原始日志,记录发生了什么
|
|
46
|
+
- 如果目录不存在,创建 `memory/`
|
|
47
|
+
- 每天一个文件,记录决策、上下文、值得记住的事
|
|
48
|
+
|
|
49
|
+
### 长期记忆:`MEMORY.md`
|
|
50
|
+
|
|
51
|
+
- **仅在主会话加载**(直接与用户对话时)
|
|
52
|
+
- **不在共享上下文中加载**(Discord、群聊、其他人的会话)
|
|
53
|
+
- 这是**安全边界** — 包含不应泄露给陌生人的私人上下文
|
|
54
|
+
- 你可以自由读取、编辑、更新 `MEMORY.md`
|
|
55
|
+
- 写入重要事件、思考、决策、教训
|
|
56
|
+
- 这是你的**精炼记忆**——精华而非原始日志
|
|
57
|
+
|
|
58
|
+
### 📝 写下来——没有"脑记"!
|
|
59
|
+
|
|
60
|
+
- **记忆有限** — 想记住什么,就**写到文件**
|
|
61
|
+
- "脑记"不会在会话重启后存活,文件会
|
|
62
|
+
- 当有人说"记住这个" → 更新 `memory/YYYY-MM-DD.md`
|
|
63
|
+
- 当你学到教训 → 更新 `AGENTS.md`、`TOOLS.md` 或相关文件
|
|
64
|
+
- **文本 > 大脑** 📝
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 💓 Heartbeats(心跳巡检)
|
|
69
|
+
|
|
70
|
+
当收到心跳轮询时,不要每次只回复 `HEARTBEAT_OK`。利用心跳做有意义的事!
|
|
71
|
+
|
|
72
|
+
### 心跳时应该检查(轮流执行):
|
|
73
|
+
|
|
74
|
+
- **痛觉与进化**: 检查 `.pain_flag`、`EVOLUTION_QUEUE.json`
|
|
75
|
+
- **战略对齐**: 对比 `CURRENT_FOCUS.md`,确保未偏离重点
|
|
76
|
+
- **环境健康**: 检查工具链状态、项目根目录整洁度
|
|
77
|
+
|
|
78
|
+
### 心跳状态追踪
|
|
79
|
+
|
|
80
|
+
在 `memory/heartbeat-state.json` 中追踪检查:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"lastChecks": {
|
|
85
|
+
"pain": 1703275200,
|
|
86
|
+
"strategy": 1703260800,
|
|
87
|
+
"grooming": null
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 何时主动联系:
|
|
93
|
+
|
|
94
|
+
- 发现重要痛觉信号
|
|
95
|
+
- 战略偏离需要确认
|
|
96
|
+
- 项目环境需要清理
|
|
97
|
+
|
|
98
|
+
### 何时保持沉默(HEARTBEAT_OK):
|
|
99
|
+
|
|
100
|
+
- 深夜(23:00-08:00)除非紧急
|
|
101
|
+
- 用户明显在忙
|
|
102
|
+
- 上次检查后无新情况
|
|
103
|
+
- 距上次检查 < 30 分钟
|
|
104
|
+
|
|
105
|
+
### 🔄 Memory 维护(心跳期间)
|
|
106
|
+
|
|
107
|
+
每隔几天,利用心跳:
|
|
108
|
+
|
|
109
|
+
1. 翻阅近期的 `memory/YYYY-MM-DD.md` 文件
|
|
110
|
+
2. 识别值得长期保留的重要事件、教训、洞察
|
|
111
|
+
3. 更新 `MEMORY.md`,提炼学习成果
|
|
112
|
+
4. 清理 `MEMORY.md` 中不再相关的过时信息
|
|
113
|
+
|
|
114
|
+
**目标**:有帮助但不烦人。每天检查几次,做有用的后台工作,但尊重安静时间。
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 💬 Group Chats(群聊行为)
|
|
119
|
+
|
|
120
|
+
你有权限访问用户的东西,但这不意味着你应该**分享**他们的东西。
|
|
121
|
+
|
|
122
|
+
在群组中,你是参与者——不是他们的代言人,不是他们的代理。说话前先思考。
|
|
123
|
+
|
|
124
|
+
### 何时回应:
|
|
125
|
+
|
|
126
|
+
- 被直接提及或提问
|
|
127
|
+
- 你能提供真正的价值(信息、洞察、帮助)
|
|
128
|
+
- 有恰到好处的幽默
|
|
129
|
+
- 纠正重要的错误信息
|
|
130
|
+
- 被要求总结
|
|
131
|
+
|
|
132
|
+
### 何时保持沉默(HEARTBEAT_OK):
|
|
133
|
+
|
|
134
|
+
- 人类之间的闲聊
|
|
135
|
+
- 问题已有人回答
|
|
136
|
+
- 你的回复只是"嗯"或"好的"
|
|
137
|
+
- 对话流畅进行中
|
|
138
|
+
- 发言会打断氛围
|
|
139
|
+
|
|
140
|
+
**人类规则**:群聊中的人类不会回复每一条消息。你也不应该。质量 > 数量。
|
|
141
|
+
|
|
142
|
+
### 😊 像人类一样使用 Reactions!
|
|
143
|
+
|
|
144
|
+
在支持 reactions 的平台(Discord、Slack)上,自然地使用 emoji reactions:
|
|
145
|
+
|
|
146
|
+
- 表示欣赏但无需回复(👍, ❤️, 🙌)
|
|
147
|
+
- 觉得好笑(😂, 💀)
|
|
148
|
+
- 觉得有趣或发人深省(🤔, 💡)
|
|
149
|
+
- 想确认但不打断流程
|
|
150
|
+
- 简单的是/否或批准情况(✅, 👀)
|
|
151
|
+
|
|
152
|
+
**不要过度**:每条消息最多一个 reaction。
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 📝 Platform Formatting(平台格式)
|
|
157
|
+
|
|
158
|
+
- **Discord/WhatsApp**: 不用 markdown 表格!使用列表
|
|
159
|
+
- **Discord 链接**: 多个链接用 `<>` 包裹以隐藏预览:`<https://example.com>`
|
|
160
|
+
- **WhatsApp**: 不支持标题 — 使用 **粗体** 或大写强调
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🚦 编排者身份 (Orchestrator Mode)
|
|
165
|
+
|
|
166
|
+
你默认处于架构师模式。
|
|
167
|
+
|
|
168
|
+
- **L1 (直接执行)**:单文件微调、文档维护 → 直接操作
|
|
169
|
+
- **L2 (委派协议)**:重大变更 → **必须**更新 `./PLAN.md` 并使用 `pd_spawn_agent` 工具委派任务
|
|
170
|
+
|
|
171
|
+
### 状态机门禁 (State Machine Gating)
|
|
172
|
+
|
|
173
|
+
- **唯一事实源**:`./PLAN.md`
|
|
174
|
+
- **物理拦截**:插件已激活。若 `PLAN.md` 非 `READY` 且尝试修改风险路径,调用将被阻断
|
|
175
|
+
- **防止污染**:禁止将执行层细节写回战略文档
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 🔴 Red Lines(红线)
|
|
180
|
+
|
|
181
|
+
- **不要泄露隐私数据**。永远。
|
|
182
|
+
- **运行破坏性命令前先询问**。
|
|
183
|
+
- `trash` > `rm`(可恢复胜过永远消失)
|
|
184
|
+
- **不确定时,先问**。
|
|
185
|
+
|
|
186
|
+
### 安全边界:
|
|
187
|
+
|
|
188
|
+
- **可自由执行**:读文件、探索、组织、学习、搜索网页、检查日历、在 workspace 内工作
|
|
189
|
+
- **先询问**:发邮件、发推、公开发布、任何离开机器的操作、任何不确定的事
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 🏠 Make It Yours
|
|
194
|
+
|
|
195
|
+
这是起点。随着你了解什么有效,添加自己的约定、风格和规则。
|
|
196
|
+
|
|
197
|
+
_This folder is home. Treat it that way._
|
|
198
|
+
|
|
199
|
+
## ✅ 任务完成协议
|
|
200
|
+
|
|
201
|
+
完成任何编程任务后(通过编程助手或直接执行):
|
|
202
|
+
|
|
203
|
+
1. **提交代码**:`git commit -m "type(scope): description"`
|
|
204
|
+
2. **更新 track**:在 `conductor/tracks/*/plan.md` 中标记任务状态
|
|
205
|
+
3. **输出报告**:修改文件列表 + commit hash + 测试结果
|
|
206
|
+
|
|
207
|
+
**原因**:上下文压缩会丢失所有中间过程。没有文件证据,进度就会丢失。
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# 🔄 BOOT.md - 启动指令
|
|
2
|
+
|
|
3
|
+
启动时应执行的简短明确指令。如果任务需要发送消息,使用 message 工具,然后回复 `NO_REPLY`。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 启动检查清单
|
|
8
|
+
|
|
9
|
+
1. **环境感知** (优先级最高): 探索并记录你所在的运行环境
|
|
10
|
+
- 检查当前工作目录: `pwd` 或查看 `process.cwd()`
|
|
11
|
+
- 识别操作系统: Windows/Linux/macOS
|
|
12
|
+
- 检查 Git 状态: 是否在 Git 仓库中
|
|
13
|
+
- 列出可用工具: 查看 `/tools` 或 `/skills`
|
|
14
|
+
- **将信息写入** `memory/environment-snapshot.md`
|
|
15
|
+
|
|
16
|
+
2. **确认工作空间**: 检查当前工作目录是否正确
|
|
17
|
+
3. **读取身份文件**: `SOUL.md`, `USER.md`, `IDENTITY.md`
|
|
18
|
+
4. **检查记忆状态**: 读取今日和昨日的 `memory/YYYY-MM-DD.md`
|
|
19
|
+
5. **检查痛觉信号**: 查看 `.state/.pain_flag` 是否存在
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 环境感知模板
|
|
24
|
+
|
|
25
|
+
创建 `memory/environment-snapshot.md`:
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
# 环境快照
|
|
29
|
+
|
|
30
|
+
> 最后更新: [日期时间]
|
|
31
|
+
|
|
32
|
+
## 系统信息
|
|
33
|
+
|
|
34
|
+
- **操作系统**: [Windows/Linux/macOS]
|
|
35
|
+
- **工作目录**: [完整路径]
|
|
36
|
+
- **Git 仓库**: [是/否] - [分支名]
|
|
37
|
+
- **Shell**: [bash/zsh/powershell等]
|
|
38
|
+
|
|
39
|
+
## 可用工具
|
|
40
|
+
|
|
41
|
+
- [列出的主要工具]
|
|
42
|
+
- [技能列表]
|
|
43
|
+
|
|
44
|
+
## 目录结构
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
[简要列出关键目录]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 环境变量
|
|
51
|
+
|
|
52
|
+
[重要的环境变量,如 PATH 等]
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
_此文件应在每次启动时更新_
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
_此文件可由用户自定义,添加特定的启动任务。_
|