moluoxixi-ai-rules 0.2.7 → 0.2.8
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-en.md +59 -11
- package/README.md +60 -12
- package/capabilities/README.md +17 -6
- package/capabilities/common/README.md +14 -2
- package/capabilities/common/skills/hindsight-memory/SKILL.md +9 -1
- package/capabilities/common/skills/hindsight-memory/assets/compose.yaml +23 -0
- package/capabilities/common/skills/hindsight-memory/assets/hindsight.env.example +9 -0
- package/capabilities/common/skills/hindsight-memory/references/visualization.md +78 -0
- package/capabilities/grilling/README.md +5 -0
- package/capabilities/grilling/capability.yaml +12 -0
- package/dist/scripts/lib/types/manifest.d.ts +8 -0
- package/dist/scripts/lib/vendor-staging.js +9 -4
- package/dist/scripts/lib/vendors.js +39 -14
- package/package.json +1 -1
- package/roles/general/README.md +48 -0
- package/roles/general/role.yaml +21 -0
- package/roles/matt/role.yaml +1 -1
- package/roles/moluoxixi/role.yaml +1 -2
- package/roles/trellis/role.yaml +1 -2
package/README-en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](README.md) | English
|
|
4
4
|
|
|
5
|
-
AIRules distributes versioned role capabilities to AI
|
|
5
|
+
AIRules distributes versioned role capabilities to AI hosts. A role combines the shared skills, MCP servers, role CLI, project workflows, agents, hooks, and runtime assets it needs.
|
|
6
6
|
|
|
7
7
|
There are two installation layers:
|
|
8
8
|
|
|
@@ -11,9 +11,50 @@ There are two installation layers:
|
|
|
11
11
|
|
|
12
12
|
The AIRules installer handles user-level package setup, asset distribution, and managed skill/MCP verification, but it does not dispatch agents. The initialized Moluoxixi or Trellis main workflow owns dispatch, hooks inject state and context, and skills perform semantic work and file changes.
|
|
13
13
|
|
|
14
|
+
## `general`
|
|
15
|
+
|
|
16
|
+
For users who need to question plans, remember decisions across sessions, and organize documents. It also provides the shared base for development roles.
|
|
17
|
+
|
|
18
|
+
### Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install --global moluoxixi-ai-rules
|
|
22
|
+
airules install general --host all
|
|
23
|
+
airules verify general --host all
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
`general` selects `common` and `grilling`, providing five skills and the Hindsight memory MCP:
|
|
29
|
+
|
|
30
|
+
| Skill | Purpose |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `grilling` | Question plans, decisions, and assumptions to establish tradeoffs and validation criteria |
|
|
33
|
+
| `hindsight-memory` | Recall and retain confirmed project knowledge and connect memory visualization |
|
|
34
|
+
| `hindsight-docs` | Consult Hindsight API, deployment, and configuration documentation |
|
|
35
|
+
| `create-skill` | Create or revise a reusable agent skill |
|
|
36
|
+
| `spec-organization` | Organize document directories, indexes, and links |
|
|
37
|
+
|
|
38
|
+
The default MCP endpoint is `http://localhost:8888/mcp/`. The official Hindsight console at `http://localhost:9999` shows facts, source documents, and entity relationships. Connect a standalone console to an existing API, or use the bundled Docker Compose assets for a new deployment. Model settings live in the user configuration directory and data persists in a named volume. See [memory visualization](capabilities/common/skills/hindsight-memory/references/visualization.md).
|
|
39
|
+
|
|
40
|
+
`moluoxixi`, `trellis`, and `matt` inherit these capabilities with `extends_roles: [general]`. Installing a development role includes its inherited capabilities. See [General](roles/general/README.md) and [role inheritance](capabilities/README.md#角色继承).
|
|
41
|
+
|
|
42
|
+
### Usage
|
|
43
|
+
|
|
44
|
+
Describe the goal or name a skill directly:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Use grilling to question this plan and check its assumptions and tradeoffs.
|
|
48
|
+
Remember our confirmed decisions, reasoning, and next validation criteria.
|
|
49
|
+
Recall this project's earlier decisions and check whether they still apply.
|
|
50
|
+
Open this project's memory visualization to inspect facts and entity relationships.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Roles share the same Hindsight API and project bank. Start the service using the deployment guide and verify memory reads and writes before using it.
|
|
54
|
+
|
|
14
55
|
## `moluoxixi`
|
|
15
56
|
|
|
16
|
-
For users who want a complete AI development workflow with the native Moluoxixi CLI, project knowledge, multi-domain skills, and controlled multi-agent dispatch.
|
|
57
|
+
For users who want a complete AI development workflow with the native Moluoxixi CLI, project knowledge, multi-domain skills, and controlled multi-agent dispatch. It inherits `general` and adds `coding`, `productivity`, and `frontend`.
|
|
17
58
|
|
|
18
59
|
### Install
|
|
19
60
|
|
|
@@ -43,7 +84,7 @@ npm install --global @moluoxixi/airules-moluoxixi-cli
|
|
|
43
84
|
| Layer | Assets | Responsibility |
|
|
44
85
|
| --- | --- | --- |
|
|
45
86
|
| User-level role | Moluoxixi core, `moluoxixi`/`ml`, `init-project` | Native initialization, update, task, memory, workflow, and channel commands |
|
|
46
|
-
| Shared capabilities | `common`, `coding`, `productivity`, `frontend` | Shared and pinned external skills plus MCP servers |
|
|
87
|
+
| Shared capabilities | Inherited `common`, `grilling`; own `coding`, `productivity`, `frontend` | Shared and pinned external skills plus MCP servers |
|
|
47
88
|
| Native project | `.moluoxixi/workflow.md`, `tasks/`, `spec/`, `scripts/`, `agents/`, host configuration | Workflow state, task artifacts, project rules, and agent definitions |
|
|
48
89
|
| AIRules project extension | `.moluoxixi/knowledge/`, knowledge runtime and hook, `moluoxixi-knowledge` | Source change detection and traceable project knowledge |
|
|
49
90
|
|
|
@@ -75,7 +116,7 @@ Project workflow entries become slash commands or discoverable skills according
|
|
|
75
116
|
| `common` | `hindsight-docs` | Look up Hindsight API, deployment, and advanced configuration |
|
|
76
117
|
| `frontend` | `frontend-design` | Give intentional visual direction when creating or reshaping interfaces |
|
|
77
118
|
| `productivity` | `grill-me` | Start a rigorous interview that turns an idea into an executable plan |
|
|
78
|
-
| `
|
|
119
|
+
| `grilling` | `grilling` | Inherited from `general`; stress-test plans, decisions, and designs |
|
|
79
120
|
| `productivity` | `handoff` | Compress the conversation into a document another agent can resume |
|
|
80
121
|
| `productivity` | `teach` | Run stateful teaching across sessions in the current repository |
|
|
81
122
|
| `productivity` | `to-questionnaire` | Turn unresolved decisions into a questionnaire for an informed person |
|
|
@@ -134,7 +175,7 @@ Role source: [`roles/moluoxixi`](roles/moluoxixi).
|
|
|
134
175
|
|
|
135
176
|
## `matt`
|
|
136
177
|
|
|
137
|
-
For users who want Matt Pocock's engineering and productivity methods
|
|
178
|
+
For users who want Matt Pocock's engineering and productivity methods together with shared grilling and memory capabilities.
|
|
138
179
|
|
|
139
180
|
### Install
|
|
140
181
|
|
|
@@ -148,12 +189,16 @@ airules verify matt --host all
|
|
|
148
189
|
|
|
149
190
|
#### Installed assets
|
|
150
191
|
|
|
151
|
-
`matt`
|
|
192
|
+
`matt` inherits `common` and `grilling` from `general`, then adds its own `engineering` and `productivity` capabilities. Shared skills and the Hindsight MCP are installed with the role and use the same project bank as other roles. See [memory visualization](capabilities/common/skills/hindsight-memory/references/visualization.md) for console setup. Engineering and productivity skills use a pinned upstream revision; the role requires no project initialization.
|
|
152
193
|
|
|
153
194
|
#### Skills
|
|
154
195
|
|
|
155
196
|
| Capability | Skill | Purpose |
|
|
156
197
|
| --- | --- | --- |
|
|
198
|
+
| `common` | `create-skill` | Create or revise a reusable agent skill |
|
|
199
|
+
| `common` | `spec-organization` | Organize document directories, indexes, and links |
|
|
200
|
+
| `common` | `hindsight-memory` | Retain and recall project memory and connect the official console |
|
|
201
|
+
| `common` | `hindsight-docs` | Consult Hindsight API and deployment documentation |
|
|
157
202
|
| `engineering` | `ask-matt` | Explicit router that selects the appropriate Matt skill or flow |
|
|
158
203
|
| `engineering` | `code-review` | Review changes since a baseline against standards and specification |
|
|
159
204
|
| `engineering` | `codebase-design` | Improve module boundaries, interfaces, and testability using deep-module principles |
|
|
@@ -173,7 +218,7 @@ airules verify matt --host all
|
|
|
173
218
|
| `engineering` | `wayfinder` | Plan work larger than one agent session as a decision and ticket map |
|
|
174
219
|
| `engineering` | `wizard` | Generate an interactive Bash wizard for human-only credentials, consoles, or migrations |
|
|
175
220
|
| `productivity` | `grill-me` | Start a rigorous planning interview |
|
|
176
|
-
| `
|
|
221
|
+
| `grilling` | `grilling` | Inherited from `general`; stress-test a plan, decision, or design |
|
|
177
222
|
| `productivity` | `handoff` | Produce a resumable cross-agent handoff |
|
|
178
223
|
| `productivity` | `teach` | Teach across sessions with recorded state |
|
|
179
224
|
| `productivity` | `to-questionnaire` | Turn unknowns into a questionnaire for an informed person |
|
|
@@ -195,13 +240,13 @@ Turn this proposal into a spec, then use to-tickets to split the work.
|
|
|
195
240
|
Implement this behavior with tdd, then run code-review.
|
|
196
241
|
```
|
|
197
242
|
|
|
198
|
-
A typical extended chain is `setup-matt-pocock-skills -> to-spec -> to-tickets -> implement -> code-review`; isolated problems can invoke one skill directly. The host, repository documents, or issue tracker owns state
|
|
243
|
+
A typical extended chain is `setup-matt-pocock-skills -> to-spec -> to-tickets -> implement -> code-review`; isolated problems can invoke one skill directly. The host, repository documents, or issue tracker owns task state. Confirmed reusable decisions can be retained with `hindsight-memory`.
|
|
199
244
|
|
|
200
245
|
Role source: [`roles/matt`](roles/matt).
|
|
201
246
|
|
|
202
247
|
## `trellis`
|
|
203
248
|
|
|
204
|
-
For users who want the native Trellis task-and-specification workflow together with AIRules shared skills, MCP, project knowledge, and multi-agent dispatch.
|
|
249
|
+
For users who want the native Trellis task-and-specification workflow together with AIRules shared skills, MCP, project knowledge, and multi-agent dispatch. It inherits `general` and adds `coding`, `productivity`, and `frontend`.
|
|
205
250
|
|
|
206
251
|
### Install
|
|
207
252
|
|
|
@@ -221,7 +266,7 @@ The role install provides the Trellis CLI and user-level capabilities but does n
|
|
|
221
266
|
| Layer | Assets | Responsibility |
|
|
222
267
|
| --- | --- | --- |
|
|
223
268
|
| User-level role | Trellis CLI and `init-project` | Native `init/update/upgrade/uninstall/mem/workflow/platforms/channel` commands |
|
|
224
|
-
| Shared capabilities | `common`, `coding`, `productivity`, `frontend` | The same shared skills, pinned external skills, and MCP servers as Moluoxixi |
|
|
269
|
+
| Shared capabilities | Inherited `common`, `grilling`; own `coding`, `productivity`, `frontend` | The same shared skills, pinned external skills, and MCP servers as Moluoxixi |
|
|
225
270
|
| Native project | `.trellis/workflow.md`, `tasks/`, `spec/`, `scripts/`, `agents/`, host configuration | Plan/Execute/Finish state, task artifacts, specs, and agent definitions |
|
|
226
271
|
| AIRules project extension | `.trellis/knowledge/`, knowledge runtime and hook, `trellis-knowledge` | Source change detection and bidirectionally traceable knowledge |
|
|
227
272
|
|
|
@@ -251,7 +296,7 @@ Native Trellis projects workflow entries as commands or skills according to host
|
|
|
251
296
|
| `common` | `hindsight-docs` | Look up Hindsight API, deployment, and advanced configuration |
|
|
252
297
|
| `frontend` | `frontend-design` | Guide intentional frontend design and redesign |
|
|
253
298
|
| `productivity` | `grill-me` | Start a rigorous requirements interview |
|
|
254
|
-
| `
|
|
299
|
+
| `grilling` | `grilling` | Inherited from `general`; stress-test plans, decisions, and designs |
|
|
255
300
|
| `productivity` | `handoff` | Produce a cross-agent handoff |
|
|
256
301
|
| `productivity` | `teach` | Teach across sessions with recorded progress |
|
|
257
302
|
| `productivity` | `to-questionnaire` | Turn unresolved questions into a questionnaire |
|
|
@@ -301,10 +346,13 @@ Role source: [`roles/trellis`](roles/trellis).
|
|
|
301
346
|
|
|
302
347
|
Shared skills, MCP catalogs, and vendor declarations live together in `capabilities/<capability>/`, such as `capabilities/common/skills/`. Each capability is a data-only directory containing `capability.yaml`, skills, MCP catalogs, and documentation; roles select capabilities in `role.yaml`. The runtime loader lives in `scripts/lib/capabilities.ts`, composes vendors in declaration order, merges compatible projections, deduplicates identical projections, and rejects source or target conflicts. See [capabilities/README.md](capabilities/README.md) for the layout and complete mapping.
|
|
303
348
|
|
|
349
|
+
`extends_roles` recursively combines parent capabilities before the child's own choices. Shared ancestors and capabilities are deduplicated; missing parents and inheritance cycles are rejected. A parent may be a declaration-only template. The child declares its own role vendor, hosts, and CLI packages. See [role inheritance](capabilities/README.md#角色继承).
|
|
350
|
+
|
|
304
351
|
Host directories, aliases, skill projection switches, and MCP formats are declared in [hosts/hosts.yaml](hosts/hosts.yaml). `scripts/lib/hosts.ts` loads and validates the declaration and resolves paths; declaration types live in `scripts/lib/types/`. Adding a host only requires a YAML entry. See [hosts/README.md](hosts/README.md) for fields and maintenance guidance.
|
|
305
352
|
|
|
306
353
|
```text
|
|
307
354
|
role manifest
|
|
355
|
+
-> role inheritance and capability composition
|
|
308
356
|
-> pinned vendor checkout / package setup
|
|
309
357
|
-> vendor staging
|
|
310
358
|
-> canonical ~/.agents/skills
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
简体中文 | [English](README-en.md)
|
|
4
4
|
|
|
5
|
-
AIRules 为 AI
|
|
5
|
+
AIRules 为 AI 宿主分发带版本的角色能力。一个 role 按需组合共享 skills、MCP servers、角色 CLI、项目工作流、agents、hooks 和运行时资产。
|
|
6
6
|
|
|
7
7
|
先区分两个安装层级:
|
|
8
8
|
|
|
@@ -11,9 +11,50 @@ AIRules 为 AI 编程宿主分发带版本的角色能力。一个 role 不只
|
|
|
11
11
|
|
|
12
12
|
AIRules 安装器负责用户级 package setup、资产分发和受管 skills/MCP 校验,但不调度 agents。agents 的派发权属于初始化后的 Moluoxixi/Trellis 主工作流,hooks 负责注入状态和上下文,skills 才负责语义分析与文件修改。
|
|
13
13
|
|
|
14
|
+
## `general`
|
|
15
|
+
|
|
16
|
+
适合需要计划审问、跨会话记忆和文档整理的用户,也是开发角色共享的基础角色。
|
|
17
|
+
|
|
18
|
+
### 安装
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install --global moluoxixi-ai-rules
|
|
22
|
+
airules install general --host all
|
|
23
|
+
airules verify general --host all
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 功能
|
|
27
|
+
|
|
28
|
+
`general` 选择 `common` 和 `grilling`,提供五项 skills 和 Hindsight 记忆 MCP:
|
|
29
|
+
|
|
30
|
+
| Skill | 做什么 |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `grilling` | 审问计划、决策和假设,明确取舍与验证条件 |
|
|
33
|
+
| `hindsight-memory` | 按项目回忆和保存已确认的信息,连接记忆可视化 |
|
|
34
|
+
| `hindsight-docs` | 查询 Hindsight API、部署和高级配置文档 |
|
|
35
|
+
| `create-skill` | 创建或修订可复用的 agent skill |
|
|
36
|
+
| `spec-organization` | 整理文档目录、索引和链接 |
|
|
37
|
+
|
|
38
|
+
Hindsight MCP 默认连接 `http://localhost:8888/mcp/`。官方控制台默认位于 `http://localhost:9999`,可查看记忆事实、来源文档和实体关系图。已有 API 可单独启动控制台;首次部署可使用随 skill 分发的 Docker Compose,模型配置和数据分别保存在用户配置目录与持久化卷中。步骤见 [记忆可视化](capabilities/common/skills/hindsight-memory/references/visualization.md)。
|
|
39
|
+
|
|
40
|
+
`moluoxixi`、`trellis` 和 `matt` 通过 `extends_roles: [general]` 继承这些通用能力;安装开发角色时会一并安装。声明与规则见 [General](roles/general/README.md) 和 [角色继承](capabilities/README.md#角色继承)。
|
|
41
|
+
|
|
42
|
+
### 用法
|
|
43
|
+
|
|
44
|
+
直接在宿主中描述目标或点名 skill:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
请用 grilling 审问这个计划,逐项检查假设和取舍。
|
|
48
|
+
请记住我们已确认的结论、理由和下一步验证条件。
|
|
49
|
+
回忆这个项目之前的决定,并核对是否仍适用。
|
|
50
|
+
打开当前项目的记忆可视化,查看事实和实体关系图。
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
不同角色使用同一 Hindsight 服务和项目 bank,复用已确认的记忆。使用记忆前按上述部署说明启动服务并验证读写。
|
|
54
|
+
|
|
14
55
|
## `moluoxixi`
|
|
15
56
|
|
|
16
|
-
适合希望获得完整 AI 开发流程,同时需要 Moluoxixi 原生 CLI、项目知识库、多领域 skills 和可控多 agent
|
|
57
|
+
适合希望获得完整 AI 开发流程,同时需要 Moluoxixi 原生 CLI、项目知识库、多领域 skills 和可控多 agent 调度的用户。继承 `general`,再增加 `coding`、`productivity` 和 `frontend`。
|
|
17
58
|
|
|
18
59
|
### 安装
|
|
19
60
|
|
|
@@ -43,7 +84,7 @@ npm install --global @moluoxixi/airules-moluoxixi-cli
|
|
|
43
84
|
| 层级 | 资产 | 作用 |
|
|
44
85
|
| --- | --- | --- |
|
|
45
86
|
| 用户级角色资产 | Moluoxixi core、`moluoxixi`/`ml` CLI、`init-project` | 提供原生项目初始化、更新、任务、memory、workflow 和 channel 命令 |
|
|
46
|
-
| 公共 capability | `common`、`coding`、`productivity`、`frontend` | 组合共享 skills、外部固定版本 skills 和 MCP servers |
|
|
87
|
+
| 公共 capability | 继承的 `common`、`grilling`;自身的 `coding`、`productivity`、`frontend` | 组合共享 skills、外部固定版本 skills 和 MCP servers |
|
|
47
88
|
| 原生项目资产 | `.moluoxixi/workflow.md`、`tasks/`、`spec/`、`scripts/`、`agents/`、宿主配置 | 保存工作流状态、任务工件、项目规范和 agent 定义 |
|
|
48
89
|
| AIRules 项目扩展 | `.moluoxixi/knowledge/`、知识 runtime、宿主 knowledge hook、`moluoxixi-knowledge` | 检测 source 变化,维护可追踪的项目知识库 |
|
|
49
90
|
|
|
@@ -75,7 +116,7 @@ npm install --global @moluoxixi/airules-moluoxixi-cli
|
|
|
75
116
|
| `common` | `hindsight-docs` | 查询 Hindsight API、部署和高级配置文档 |
|
|
76
117
|
| `frontend` | `frontend-design` | 为新 UI 或现有界面重塑提供有明确审美方向的设计指导 |
|
|
77
118
|
| `productivity` | `grill-me` | 启动严格访谈,把模糊想法推进到可执行方案 |
|
|
78
|
-
| `
|
|
119
|
+
| `grilling` | `grilling` | 从 `general` 继承,压力测试计划、决策或设计中的薄弱假设 |
|
|
79
120
|
| `productivity` | `handoff` | 把当前对话压缩为下一位 agent 可接手的交接文档 |
|
|
80
121
|
| `productivity` | `teach` | 在当前仓库中进行可跨会话记录状态的教学 |
|
|
81
122
|
| `productivity` | `to-questionnaire` | 把 agent 无法独立回答的决策转成给知情人的问卷 |
|
|
@@ -141,7 +182,7 @@ SubagentStart
|
|
|
141
182
|
|
|
142
183
|
## `matt`
|
|
143
184
|
|
|
144
|
-
|
|
185
|
+
适合需要 Matt Pocock 工程方法和效率 skills,并希望复用通用审问和记忆能力的用户。
|
|
145
186
|
|
|
146
187
|
### 安装
|
|
147
188
|
|
|
@@ -155,12 +196,16 @@ airules verify matt --host all
|
|
|
155
196
|
|
|
156
197
|
#### 安装后的资产
|
|
157
198
|
|
|
158
|
-
`matt`
|
|
199
|
+
`matt` 继承 `general` 的 `common` 和 `grilling`,再组合自身的 `engineering` 和 `productivity`。通用 skills 和 Hindsight MCP 随角色安装,项目 bank 与其它角色共用;控制台部署见 [记忆可视化](capabilities/common/skills/hindsight-memory/references/visualization.md)。工程和效率 skills 固定上游版本,角色无需项目初始化。
|
|
159
200
|
|
|
160
201
|
#### Skills
|
|
161
202
|
|
|
162
203
|
| Capability | Skill | 做什么 |
|
|
163
204
|
| --- | --- | --- |
|
|
205
|
+
| `common` | `create-skill` | 创建或修订可复用的 agent skill |
|
|
206
|
+
| `common` | `spec-organization` | 整理文档目录、索引和链接 |
|
|
207
|
+
| `common` | `hindsight-memory` | 保存和检索项目记忆,连接官方可视化控制台 |
|
|
208
|
+
| `common` | `hindsight-docs` | 查询 Hindsight API 和部署文档 |
|
|
164
209
|
| `engineering` | `ask-matt` | 根据当前问题选择适合的 Matt skill 或工作流;这是显式调用的路由器 |
|
|
165
210
|
| `engineering` | `code-review` | 从指定基线对改动做 standards 与 spec 双轴审查 |
|
|
166
211
|
| `engineering` | `codebase-design` | 用深模块原则改进模块边界、接口和可测试性 |
|
|
@@ -180,7 +225,7 @@ airules verify matt --host all
|
|
|
180
225
|
| `engineering` | `wayfinder` | 把超出单次会话的大型工作规划成决策与 ticket 地图 |
|
|
181
226
|
| `engineering` | `wizard` | 生成交互式 bash wizard,引导人工完成凭据、控制台或迁移步骤 |
|
|
182
227
|
| `productivity` | `grill-me` | 启动严格访谈,把模糊计划推进到可执行状态 |
|
|
183
|
-
| `
|
|
228
|
+
| `grilling` | `grilling` | 从 `general` 继承,压力测试计划、决策或设计 |
|
|
184
229
|
| `productivity` | `handoff` | 生成下一位 agent 可直接接手的交接文档 |
|
|
185
230
|
| `productivity` | `teach` | 在仓库中进行可记录进度的跨会话教学 |
|
|
186
231
|
| `productivity` | `to-questionnaire` | 把未决问题转成面向知情人的问卷 |
|
|
@@ -202,13 +247,13 @@ airules verify matt --host all
|
|
|
202
247
|
请使用 tdd 实现这个行为,最后运行 code-review。
|
|
203
248
|
```
|
|
204
249
|
|
|
205
|
-
一条典型链路是 `setup-matt-pocock-skills -> to-spec -> to-tickets -> implement -> code-review`;单点问题则直接使用对应 skill
|
|
250
|
+
一条典型链路是 `setup-matt-pocock-skills -> to-spec -> to-tickets -> implement -> code-review`;单点问题则直接使用对应 skill。任务状态由当前宿主、仓库文档或 issue tracker 管理,已确认的可复用结论可通过 `hindsight-memory` 保存。
|
|
206
251
|
|
|
207
252
|
角色源码位于 [`roles/matt`](roles/matt)。
|
|
208
253
|
|
|
209
254
|
## `trellis`
|
|
210
255
|
|
|
211
|
-
适合希望使用原生 Trellis 的任务与规范驱动工作流,同时获得 AIRules 共享 skills、MCP、知识库和多 agent
|
|
256
|
+
适合希望使用原生 Trellis 的任务与规范驱动工作流,同时获得 AIRules 共享 skills、MCP、知识库和多 agent 调度的用户。继承 `general`,再增加 `coding`、`productivity` 和 `frontend`。
|
|
212
257
|
|
|
213
258
|
### 安装
|
|
214
259
|
|
|
@@ -228,7 +273,7 @@ trellis --version
|
|
|
228
273
|
| 层级 | 资产 | 作用 |
|
|
229
274
|
| --- | --- | --- |
|
|
230
275
|
| 用户级角色资产 | Trellis CLI、`init-project` | 提供原生 `init/update/upgrade/uninstall/mem/workflow/platforms/channel` 命令 |
|
|
231
|
-
| 公共 capability | `common`、`coding`、`productivity`、`frontend` | 与 Moluoxixi 相同的共享 skills、外部固定版本 skills 和 MCP servers |
|
|
276
|
+
| 公共 capability | 继承的 `common`、`grilling`;自身的 `coding`、`productivity`、`frontend` | 与 Moluoxixi 相同的共享 skills、外部固定版本 skills 和 MCP servers |
|
|
232
277
|
| 原生项目资产 | `.trellis/workflow.md`、`tasks/`、`spec/`、`scripts/`、`agents/`、宿主配置 | 保存 Plan/Execute/Finish 状态、任务工件、规范和 agent 定义 |
|
|
233
278
|
| AIRules 项目扩展 | `.trellis/knowledge/`、知识 runtime、宿主 hook、`trellis-knowledge` | 自动发现 source 变化并维护双向可追踪知识关系 |
|
|
234
279
|
|
|
@@ -258,7 +303,7 @@ trellis --version
|
|
|
258
303
|
| `common` | `hindsight-docs` | 查询 Hindsight API、部署和高级配置文档 |
|
|
259
304
|
| `frontend` | `frontend-design` | 指导有明确视觉方向的前端设计与重塑 |
|
|
260
305
|
| `productivity` | `grill-me` | 启动严格需求访谈 |
|
|
261
|
-
| `
|
|
306
|
+
| `grilling` | `grilling` | 从 `general` 继承,压力测试计划、决策或设计 |
|
|
262
307
|
| `productivity` | `handoff` | 生成跨 agent 交接文档 |
|
|
263
308
|
| `productivity` | `teach` | 进行可记录进度的跨会话教学 |
|
|
264
309
|
| `productivity` | `to-questionnaire` | 把未决问题转成问卷 |
|
|
@@ -308,19 +353,22 @@ Plan 阶段创建并确认 PRD,复杂任务补齐 design/implement 后 `task.p
|
|
|
308
353
|
|
|
309
354
|
共享 skills、MCP 清单和供应商声明按能力集中在 `capabilities/<能力>/`,例如 `capabilities/common/skills/`。每个能力目录是纯数据目录,只包含 `capability.yaml`、skills、MCP 清单和文档;Role 在 `role.yaml` 中选择 capability。运行时加载器位于 `scripts/lib/capabilities.ts`,负责按声明顺序组合 vendor,合并兼容投影、去重完全相同的 projection,并拒绝来源或目标冲突。目录结构与完整映射见 [capabilities/README.md](capabilities/README.md)。
|
|
310
355
|
|
|
356
|
+
角色通过 `extends_roles` 递归继承父角色的 capabilities,再加入自身能力。共同祖先和重复能力自动去重;缺失父角色与循环继承会报错。父角色可作为纯声明模板;子角色使用自身的 role vendor、宿主和 CLI packages。规则见 [角色继承](capabilities/README.md#角色继承)。
|
|
357
|
+
|
|
311
358
|
宿主目录、别名、skills 投影开关和 MCP 格式统一声明在 [hosts/hosts.yaml](hosts/hosts.yaml)。`scripts/lib/hosts.ts` 负责加载、校验和路径解析,声明类型放在 `scripts/lib/types/`。新增宿主只需更新 YAML;字段与维护说明见 [hosts/README.md](hosts/README.md)。
|
|
312
359
|
|
|
313
360
|
分发链路为:
|
|
314
361
|
|
|
315
362
|
```text
|
|
316
363
|
role manifest
|
|
364
|
+
-> 角色继承与 capabilities 合并
|
|
317
365
|
-> 固定 vendor checkout / package setup
|
|
318
366
|
-> vendor staging
|
|
319
367
|
-> canonical ~/.agents/skills
|
|
320
368
|
-> 宿主 skill 投影与 MCP 合并
|
|
321
369
|
```
|
|
322
370
|
|
|
323
|
-
当前安装 role 的受管 shared layer 会替换上一 role
|
|
371
|
+
当前安装 role 的受管 shared layer 会替换上一 role 不再需要的受管链接,因此多个 role 共用同一个用户级环境。用户已有的同名 MCP 配置优先保留。`airules verify` 检查受管 skills、宿主 links 和 MCP server 名称,不检查项目初始化器生成的 agents/hooks;后者应通过角色工作流自身的检查完成。
|
|
324
372
|
|
|
325
373
|
## 开发
|
|
326
374
|
|
package/capabilities/README.md
CHANGED
|
@@ -24,6 +24,7 @@ capabilities/
|
|
|
24
24
|
│ ├── capability.yaml # Anthropic frontend-design 上游声明
|
|
25
25
|
│ ├── mcps.json # Playwright
|
|
26
26
|
│ └── README.md
|
|
27
|
+
├── grilling/capability.yaml # 仅同步 Matt Pocock grilling
|
|
27
28
|
├── productivity/capability.yaml # Matt Pocock productivity 上游声明
|
|
28
29
|
└── engineering/capability.yaml # Matt Pocock engineering 上游声明
|
|
29
30
|
```
|
|
@@ -41,25 +42,35 @@ AIRules 自有共享 skills 实际存放在 `capabilities/<能力>/skills/`。
|
|
|
41
42
|
| [`frontend`](frontend/README.md) | Anthropic `frontend-design` | Playwright |
|
|
42
43
|
| `productivity` | Matt Pocock productivity skills | 无 |
|
|
43
44
|
| `engineering` | Matt Pocock engineering skills | 无 |
|
|
45
|
+
| [`grilling`](grilling/README.md) | Matt Pocock `grilling` | 无 |
|
|
44
46
|
|
|
45
|
-
| Role | Capabilities |
|
|
46
|
-
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
47
|
+
| Role | 继承 | 自身 Capabilities |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| [`general`](../roles/general/README.md) | 无 | `common`, `grilling` |
|
|
50
|
+
| `trellis` | `general` | `coding`, `productivity`, `frontend` |
|
|
51
|
+
| `moluoxixi` | `general` | `coding`, `productivity`, `frontend` |
|
|
52
|
+
| `matt` | `general` | `engineering`, `productivity` |
|
|
50
53
|
|
|
51
54
|
角色选择示例:
|
|
52
55
|
|
|
53
56
|
```yaml
|
|
54
57
|
# roles/<role>/role.yaml
|
|
58
|
+
extends_roles: [general]
|
|
55
59
|
capabilities:
|
|
56
|
-
- common
|
|
57
60
|
- coding
|
|
58
61
|
- frontend
|
|
59
62
|
```
|
|
60
63
|
|
|
61
64
|
`roles/<role>/role.yaml` 声明角色自身的 `role_vendor`、CLI 安装命令、宿主支持、继承关系和 publishable packages。角色自有的 `init-project`、hooks、agents、packages 等仍放在 `roles/<role>/`,由 `role-assets` 全量同步。旧包若仍带有 `constants/skills.ts`,安装器会在没有 `role.yaml` 时兼容读取它。
|
|
62
65
|
|
|
66
|
+
## 角色继承
|
|
67
|
+
|
|
68
|
+
`extends_roles` 将角色作为可复用的能力模板。`general` 既能独立安装,也作为开发角色的基础:子角色安装时递归读取父角色的 `capabilities`,再加入自己的能力。多层和多父角色按声明顺序合并,共同祖先与相同能力只处理一次。子角色可用 `capabilities: []` 继承整组通用能力。
|
|
69
|
+
|
|
70
|
+
继承范围是 capability 声明及其 skills、MCP 与供应商 setup。子角色的 `role_vendor`、角色专属资产、CLI packages 和 hosts 由自身声明;安装器将继承的第一方能力从子角色的 AIRules 远程 checkout 投影到 vendor。能力模板可只声明 `capabilities` 和 `extends_roles`;独立安装的角色需提供自身 `role_vendor`。
|
|
71
|
+
|
|
72
|
+
缺失父角色、循环继承、单份声明中的重复能力及供应商版本冲突会报错。`grilling` 同时由父角色显式选择、由子角色的 `productivity` namespace 带入时,同一供应商的同一源码只投影一次;不同来源的同名 skill 仍报冲突。
|
|
73
|
+
|
|
63
74
|
## MCP 清单
|
|
64
75
|
|
|
65
76
|
```json
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|---|---|
|
|
11
11
|
| `create-skill` | 创建或修订可复用的 agent skill |
|
|
12
12
|
| `spec-organization` | 整理项目规范文档、索引和链接 |
|
|
13
|
-
| `hindsight-memory` | 通过 Hindsight MCP 回忆历史决定、保存已验证结果,并按项目区分 bank |
|
|
13
|
+
| `hindsight-memory` | 通过 Hindsight MCP 回忆历史决定、保存已验证结果,并按项目区分 bank;连接官方记忆控制台 |
|
|
14
14
|
|
|
15
15
|
上游 `hindsight-docs` skill 按固定 commit 远程同步,用于查询 Hindsight API、部署和高级配置。固定 commit 约束 skill 源码;服务运行包由部署环境单独管理。
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
```powershell
|
|
24
24
|
$env:HINDSIGHT_API_LLM_PROVIDER = 'ollama'
|
|
25
25
|
$env:HINDSIGHT_API_LLM_MODEL = 'llama3.2'
|
|
26
|
-
uvx --from hindsight-api hindsight-local-mcp
|
|
26
|
+
uvx --from hindsight-api==0.10.2 hindsight-local-mcp
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
云模型使用 `HINDSIGHT_API_LLM_API_KEY` 和对应 provider/model 配置。首次启动会下载运行依赖和本地 embedding 模型,默认嵌入式数据库保存在 `~/.pg0/hindsight-mcp/`,重启后保留数据。AIRules 安装时写入连接配置,服务由部署环境启动和维护。
|
|
@@ -31,3 +31,15 @@ uvx --from hindsight-api hindsight-local-mcp
|
|
|
31
31
|
默认 `/mcp/` 为多 bank 模式,工具调用通过 `bank_id` 指定项目。单 bank 可使用 `/mcp/<bank-id>/`;团队共享可连接已部署服务。通过宿主中的同名 `hindsight` 配置覆盖 `url`,AIRules 会保留用户配置;Codex 使用 `[mcp_servers.hindsight]` 的 `url`,OpenCode 使用 `type: "remote"`。
|
|
32
32
|
|
|
33
33
|
连接后验证 `retain`、`recall` 和 `reflect` 是否可用,再保存一条测试事实,在新会话中检索它。完整运行参数见 [官方 Local MCP 文档](https://hindsight.vectorize.io/docs/integrations/local-mcp)。
|
|
34
|
+
|
|
35
|
+
## 记忆可视化
|
|
36
|
+
|
|
37
|
+
已有 Hindsight API 时,独立启动官方控制台,直接查看当前服务的记忆:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx --yes @vectorize-io/hindsight-control-plane@0.10.2 --hostname 127.0.0.1 --port 9999 --api-url http://localhost:8888
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
打开 `http://localhost:9999`,选择 MCP 使用的同一 bank,查看记忆事实、来源文档、实体关系图和异步操作状态。远程服务使用对应的 API 根地址。
|
|
44
|
+
|
|
45
|
+
首次部署可使用 `hindsight-memory` skill 自带的 [Compose](skills/hindsight-memory/assets/compose.yaml),一次启动 API、MCP 和控制台,持久化到固定 Docker volume。部署资产会完整同步到 `~/.agents/skills/hindsight-memory/`;模型配置放在用户配置目录。两种方式的步骤、存储区别与验证方法见 [可视化操作说明](skills/hindsight-memory/references/visualization.md)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hindsight-memory
|
|
3
|
-
description: Recall and retain project decisions, verified fixes, and user preferences through Hindsight MCP. Use when work depends on prior decisions, a completed task produces reusable learnings, or the user asks to remember or
|
|
3
|
+
description: Recall and retain project decisions, verified fixes, and user preferences through Hindsight MCP. Use when work depends on prior decisions, a completed task produces reusable learnings, or the user asks to remember, retrieve, browse, or visualize memory across sessions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Hindsight Memory
|
|
@@ -25,6 +25,14 @@ description: Recall and retain project decisions, verified fixes, and user prefe
|
|
|
25
25
|
|
|
26
26
|
只记录已确认且有复用价值的内容。未验证的推测应明确标注状态;凭据和密钥留在配置系统中。已有同一结果时补充新信息,避免重复写入。若工具返回异步 operation,按工具能力检查状态,只有确认完成后才声称已保存。
|
|
27
27
|
|
|
28
|
+
`grilling` 结束后,用户已确认的结论可按上述规则保存,并附上理由、取舍和下一步验证条件;待验证假设明确保留其状态。
|
|
29
|
+
|
|
30
|
+
## 查看与可视化
|
|
31
|
+
|
|
32
|
+
用户要求浏览记忆、查看实体关系图或部署可视化时,读取 [可视化操作说明](references/visualization.md)。先核对当前 MCP 的 API 地址与 bank,再连接官方 Hindsight 控制台。已有服务使用独立控制台接入同一个 API;首次部署使用随 skill 分发的 Compose 资产。
|
|
33
|
+
|
|
34
|
+
在控制台选择上述同一 bank,查看记忆、来源文档和实体关系;只有页面能访问且测试记忆出现在对应 bank 时,才确认可视化连接成功。部署命令完成或页面可访问本身不能证明记忆读写已成功。
|
|
35
|
+
|
|
28
36
|
## 服务不可用
|
|
29
37
|
|
|
30
38
|
MCP 工具缺失或连接失败时,说明记忆当前不可用,继续可以独立完成的开发工作。使用当前配置的服务恢复连接;不要另起 `hindsight-embed` CLI daemon 来替代 MCP,它可能使用不同数据库和 bank。需要上游 API、部署或高级配置细节时读取 `hindsight-docs` skill;服务安装说明见 [Hindsight Local MCP 官方文档](https://hindsight.vectorize.io/docs/integrations/local-mcp)。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: airules-hindsight
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
hindsight:
|
|
5
|
+
image: ghcr.io/vectorize-io/hindsight:0.10.2
|
|
6
|
+
restart: unless-stopped
|
|
7
|
+
shm_size: 1gb
|
|
8
|
+
ports:
|
|
9
|
+
- '127.0.0.1:8888:8888'
|
|
10
|
+
- '127.0.0.1:9999:9999'
|
|
11
|
+
environment:
|
|
12
|
+
HINDSIGHT_API_LLM_PROVIDER: ${HINDSIGHT_API_LLM_PROVIDER:?Set the LLM provider in hindsight.env}
|
|
13
|
+
HINDSIGHT_API_LLM_MODEL: ${HINDSIGHT_API_LLM_MODEL:?Set the LLM model in hindsight.env}
|
|
14
|
+
HINDSIGHT_API_LLM_API_KEY: ${HINDSIGHT_API_LLM_API_KEY:-}
|
|
15
|
+
HINDSIGHT_API_LLM_BASE_URL: ${HINDSIGHT_API_LLM_BASE_URL:-}
|
|
16
|
+
HINDSIGHT_API_WORKER_ID: airules-hindsight
|
|
17
|
+
HINDSIGHT_CP_DATAPLANE_API_URL: http://localhost:8888
|
|
18
|
+
volumes:
|
|
19
|
+
- memory-data:/home/hindsight/.pg0
|
|
20
|
+
|
|
21
|
+
volumes:
|
|
22
|
+
memory-data:
|
|
23
|
+
name: airules-hindsight-data
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Copy to ~/.config/airules/hindsight/hindsight.env and configure your model.
|
|
2
|
+
HINDSIGHT_API_LLM_PROVIDER=openai
|
|
3
|
+
HINDSIGHT_API_LLM_MODEL=gpt-4o-mini
|
|
4
|
+
HINDSIGHT_API_LLM_API_KEY=
|
|
5
|
+
|
|
6
|
+
# Optional API base URL for your provider. For Ollama running on the Docker
|
|
7
|
+
# Desktop host, set provider=ollama, your installed model, and
|
|
8
|
+
# HINDSIGHT_API_LLM_BASE_URL=http://host.docker.internal:11434/v1
|
|
9
|
+
HINDSIGHT_API_LLM_BASE_URL=
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# 记忆可视化
|
|
2
|
+
|
|
3
|
+
使用官方 Hindsight Control Plane,按 bank 浏览提取的事实、来源文档、实体关系图、mental models 和异步 operations。默认控制台为 `http://localhost:9999`,API 为 `http://localhost:8888`,MCP 为 `http://localhost:8888/mcp/`。
|
|
4
|
+
|
|
5
|
+
先读取宿主当前 `hindsight` MCP 配置,确认 API 与 bank。多 bank endpoint `/mcp/` 的 API 根地址是移除 `/mcp/` 后的服务地址;单 bank endpoint `/mcp/<bank-id>/` 同样使用 API 根地址,控制台中选择对应 bank。经过反向代理的服务应使用部署方提供的 API 根地址。
|
|
6
|
+
|
|
7
|
+
## 已有记忆服务:添加控制台
|
|
8
|
+
|
|
9
|
+
`hindsight-local-mcp` 同时提供完整 API。保留正在使用的服务及其数据,只启动独立控制台并连接当前 API:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx --yes @vectorize-io/hindsight-control-plane@0.10.2 --hostname 127.0.0.1 --port 9999 --api-url http://localhost:8888
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
在浏览器打开 `http://localhost:9999`,选择 MCP 使用的项目 bank。远程服务将 `--api-url` 替换为实际 API 地址,同时核对宿主 MCP 指向同一服务;服务鉴权配置见 [官方安装文档](https://hindsight.vectorize.io/developer/installation)。
|
|
16
|
+
|
|
17
|
+
`hindsight-local-mcp` 的本地数据库默认位于 `~/.pg0/hindsight-mcp/`。独立控制台读写该 API 的现有数据库;下述 Docker 部署使用另一个存储卷,适用于首次部署。需要迁移已有库时先按上游数据库迁移文档处理。
|
|
18
|
+
|
|
19
|
+
## 首次部署:API 与控制台一起启动
|
|
20
|
+
|
|
21
|
+
前提:Docker Compose 可用、Docker daemon 已启动,并有可用的 LLM provider/model。部署资产位于本 skill 的 `assets/`,会完整分发到 `~/.agents/skills/hindsight-memory/`。镜像固定为 `0.10.2`,同时提供 API、MCP 和控制台。
|
|
22
|
+
|
|
23
|
+
配置文件放在用户配置目录,避免 skill 更新覆盖模型设置。以下命令从已安装 skill 读取模板;在仓库内验证时,将 `hindsightSkill` 改为本文件上一级目录。
|
|
24
|
+
|
|
25
|
+
### PowerShell
|
|
26
|
+
|
|
27
|
+
```powershell
|
|
28
|
+
$hindsightSkill = Join-Path $env:USERPROFILE '.agents/skills/hindsight-memory'
|
|
29
|
+
$hindsightConfigDir = Join-Path $env:USERPROFILE '.config/airules/hindsight'
|
|
30
|
+
$hindsightEnvFile = Join-Path $hindsightConfigDir 'hindsight.env'
|
|
31
|
+
New-Item -ItemType Directory -Force $hindsightConfigDir | Out-Null
|
|
32
|
+
if (-not (Test-Path -LiteralPath $hindsightEnvFile)) {
|
|
33
|
+
Copy-Item -LiteralPath "$hindsightSkill/assets/hindsight.env.example" -Destination $hindsightEnvFile
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
编辑 `hindsight.env`,填写 provider、model 和该 provider 所需的 API key。配置就绪后:
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
docker compose --env-file $hindsightEnvFile --file "$hindsightSkill/assets/compose.yaml" config --quiet
|
|
41
|
+
docker compose --env-file $hindsightEnvFile --file "$hindsightSkill/assets/compose.yaml" up --detach
|
|
42
|
+
docker compose --env-file $hindsightEnvFile --file "$hindsightSkill/assets/compose.yaml" logs --tail 60 hindsight
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### macOS / Linux
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
hindsight_skill="$HOME/.agents/skills/hindsight-memory"
|
|
49
|
+
hindsight_config_dir="$HOME/.config/airules/hindsight"
|
|
50
|
+
hindsight_env_file="$hindsight_config_dir/hindsight.env"
|
|
51
|
+
mkdir -p "$hindsight_config_dir"
|
|
52
|
+
if [ ! -f "$hindsight_env_file" ]; then
|
|
53
|
+
cp "$hindsight_skill/assets/hindsight.env.example" "$hindsight_env_file"
|
|
54
|
+
fi
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
编辑 `hindsight.env`,填写模型配置后:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
docker compose --env-file "$hindsight_env_file" --file "$hindsight_skill/assets/compose.yaml" config --quiet
|
|
61
|
+
docker compose --env-file "$hindsight_env_file" --file "$hindsight_skill/assets/compose.yaml" up --detach
|
|
62
|
+
docker compose --env-file "$hindsight_env_file" --file "$hindsight_skill/assets/compose.yaml" logs --tail 60 hindsight
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
云模型填写 provider、model 和 API key;Ollama 可使用 `provider=ollama`、本地已安装的 model,以及 Hindsight 容器可访问的 `HINDSIGHT_API_LLM_BASE_URL`。Docker Desktop 的宿主 Ollama 地址通常为 `http://host.docker.internal:11434/v1`;Linux 使用实际可达的 OpenAI 兼容 API 地址。
|
|
66
|
+
|
|
67
|
+
Compose 将 API 与控制台端口绑定到本机,API 与控制台连接同一数据库。记忆存入固定 named volume `airules-hindsight-data`;skill 路径变化、容器重启与重建后仍复用该卷。停止服务可将 `up --detach` 替换为 `stop`,启动时继续使用同一配置和卷。
|
|
68
|
+
|
|
69
|
+
## 验证当前项目的记忆
|
|
70
|
+
|
|
71
|
+
1. 确认 API 的 `/health` 和控制台可以访问,宿主发现 `retain`、`recall`、`reflect` 工具。
|
|
72
|
+
2. 用 SKILL.md 的规则选定项目 bank。通过 MCP 保存一条用户同意的非敏感测试事实;异步写入等待 operation 完成。
|
|
73
|
+
3. 在控制台选择同一 bank,确认事实及其来源可见;存在实体时查看实体关系图。若页面为空,先检查 API 地址、bank 与 operation 状态。
|
|
74
|
+
4. 在新会话用 `recall` 检索同一事实。以上步骤成功后,才报告记忆读写与可视化已连接。
|
|
75
|
+
|
|
76
|
+
部署问题读取日志,模型连接问题核对 provider/model/base URL;检查配置时使用 `config --quiet`,无需输出 API key。记忆为空时核对服务与 bank,避免启动另一个数据库实例。
|
|
77
|
+
|
|
78
|
+
官方参考:[安装与控制台](https://hindsight.vectorize.io/developer/installation)、[MCP endpoints](https://hindsight.vectorize.io/developer/mcp-server)、[0.10.2 发布](https://github.com/vectorize-io/hindsight/releases/tag/v0.10.2)。
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
capability_id: grilling
|
|
3
|
+
description: Matt Pocock's grilling skill for stress-testing plans and decisions.
|
|
4
|
+
vendors:
|
|
5
|
+
- name: mattpocock
|
|
6
|
+
source: https://github.com/mattpocock/skills.git
|
|
7
|
+
revision: 8b78b531ab965735c5dc74f6f7a219e1e37326df
|
|
8
|
+
projections:
|
|
9
|
+
- kind: skills
|
|
10
|
+
source_base_dir: skills/productivity
|
|
11
|
+
skills:
|
|
12
|
+
- grilling
|
|
@@ -75,3 +75,11 @@ export interface RoleContract {
|
|
|
75
75
|
path: string;
|
|
76
76
|
value: Record<string, unknown>;
|
|
77
77
|
}
|
|
78
|
+
export interface RoleContractData {
|
|
79
|
+
hosts?: unknown;
|
|
80
|
+
packages?: unknown;
|
|
81
|
+
capabilities?: unknown;
|
|
82
|
+
extendsRoles?: unknown;
|
|
83
|
+
roleVendor?: unknown;
|
|
84
|
+
roleVendorPosition?: 'before' | 'after';
|
|
85
|
+
}
|
|
@@ -234,10 +234,16 @@ function requireNoTargetConflicts(assets, label) {
|
|
|
234
234
|
for (const asset of assets) {
|
|
235
235
|
const previous = accepted.find(candidate => conflicts(candidate.target, asset.target));
|
|
236
236
|
if (previous) {
|
|
237
|
+
// A skill selected by a base role can also be included in a child namespace.
|
|
238
|
+
if (previous.vendorId === asset.vendorId && previous.kind === asset.kind
|
|
239
|
+
&& previous.source === asset.source && previous.target === asset.target) {
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
237
242
|
throw new Error(`${label} at "${asset.target}": ${previous.vendorId} conflicts with ${asset.vendorId}`);
|
|
238
243
|
}
|
|
239
244
|
accepted.push(asset);
|
|
240
245
|
}
|
|
246
|
+
return accepted;
|
|
241
247
|
}
|
|
242
248
|
function resolveRoleChild(roleRoot, relativePath, kind) {
|
|
243
249
|
const requested = path.join(roleRoot, portablePath(relativePath));
|
|
@@ -281,8 +287,7 @@ function expandRoleAssets(roleRoot, vendorId) {
|
|
|
281
287
|
});
|
|
282
288
|
}
|
|
283
289
|
}
|
|
284
|
-
requireNoTargetConflicts(roleAssets, 'Canonical role-assets target conflict');
|
|
285
|
-
return roleAssets;
|
|
290
|
+
return requireNoTargetConflicts(roleAssets, 'Canonical role-assets target conflict');
|
|
286
291
|
}
|
|
287
292
|
function buildStagingPlan(manifest, homeDir, role) {
|
|
288
293
|
const ordinary = [];
|
|
@@ -296,13 +301,13 @@ function buildStagingPlan(manifest, homeDir, role) {
|
|
|
296
301
|
ordinary.push(...expandOrdinaryLink(homeDir, vendorId, link));
|
|
297
302
|
}
|
|
298
303
|
}
|
|
299
|
-
requireNoTargetConflicts(ordinary, 'Ordinary vendor target conflict');
|
|
304
|
+
const uniqueOrdinary = requireNoTargetConflicts(ordinary, 'Ordinary vendor target conflict');
|
|
300
305
|
if (roleDeclarations.length > 1) {
|
|
301
306
|
throw new Error('A vendor manifest may declare at most one canonical role-assets source');
|
|
302
307
|
}
|
|
303
308
|
const roleDeclaration = roleDeclarations[0];
|
|
304
309
|
return {
|
|
305
|
-
ordinary,
|
|
310
|
+
ordinary: uniqueOrdinary,
|
|
306
311
|
roleSource: roleDeclaration === undefined
|
|
307
312
|
? undefined
|
|
308
313
|
: resolveRoleSource(homeDir, role, roleDeclaration.vendorId, roleDeclaration.source),
|
|
@@ -4,6 +4,7 @@ import { fileURLToPath, pathToFileURL, URL } from 'node:url';
|
|
|
4
4
|
import { parseDocument } from 'yaml';
|
|
5
5
|
import { CAPABILITY_NAMES, composeCapabilities } from './capabilities.js';
|
|
6
6
|
import { HOST_IDS } from './hosts.js';
|
|
7
|
+
import { resolveRoleManifestPath, roleOverlayOrder } from './roles.js';
|
|
7
8
|
import { flattenedSkillName, flattenedVendorSkillTarget } from './skill-projection.js';
|
|
8
9
|
const vendorNamePattern = /^[A-Za-z0-9][\w-]*$/u;
|
|
9
10
|
const npmPackageNamePattern = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u;
|
|
@@ -216,7 +217,7 @@ export async function loadVendorManifest(manifestPath) {
|
|
|
216
217
|
?? module.default?.roleVendor;
|
|
217
218
|
const vendorTree = roleVendor === undefined
|
|
218
219
|
? (isRoleYaml ? {} : module.vendors ?? module.default?.vendors ?? module.default)
|
|
219
|
-
: composeRoleVendorTree(manifestPath, roleVendor, roleContract);
|
|
220
|
+
: await composeRoleVendorTree(manifestPath, roleVendor, roleContract);
|
|
220
221
|
if (!vendorTree || typeof vendorTree !== 'object') {
|
|
221
222
|
throw new Error(`Vendor manifest "${manifestPath}" must export a "vendors" object or a "roleVendor" definition`);
|
|
222
223
|
}
|
|
@@ -299,6 +300,9 @@ function tryLoadRoleContract(manifestPath) {
|
|
|
299
300
|
}
|
|
300
301
|
return {
|
|
301
302
|
...(capabilities === undefined ? {} : { capabilities }),
|
|
303
|
+
...(record.extends_roles === undefined && record.extendsRoles === undefined
|
|
304
|
+
? {}
|
|
305
|
+
: { extendsRoles: record.extends_roles ?? record.extendsRoles }),
|
|
302
306
|
...(record.hosts === undefined ? {} : { hosts: record.hosts }),
|
|
303
307
|
...(record.packages === undefined ? {} : { packages: record.packages }),
|
|
304
308
|
...(record.role_vendor === undefined && record.roleVendor === undefined
|
|
@@ -307,24 +311,45 @@ function tryLoadRoleContract(manifestPath) {
|
|
|
307
311
|
...(roleVendorPosition === undefined ? {} : { roleVendorPosition }),
|
|
308
312
|
};
|
|
309
313
|
}
|
|
310
|
-
function requireRoleCapabilityContract(manifestPath, contract) {
|
|
311
|
-
const capabilities = contract.capabilities;
|
|
314
|
+
async function requireRoleCapabilityContract(manifestPath, contract) {
|
|
312
315
|
const contractPath = resolveRoleContractPath(manifestPath);
|
|
313
|
-
|
|
314
|
-
|
|
316
|
+
const extendsRoles = contract.extendsRoles ?? [];
|
|
317
|
+
if (!Array.isArray(extendsRoles) || !extendsRoles.every(role => typeof role === 'string')) {
|
|
318
|
+
throw new TypeError(`Role contract "${contractPath}" field "extends_roles" must be a string array`);
|
|
315
319
|
}
|
|
320
|
+
const roleRoot = path.dirname(contractPath);
|
|
321
|
+
const repoRoot = path.resolve(roleRoot, '..', '..');
|
|
322
|
+
const role = path.basename(roleRoot);
|
|
323
|
+
const lineage = extendsRoles.length === 0 ? [role] : await roleOverlayOrder(repoRoot, role);
|
|
324
|
+
const capabilities = [];
|
|
316
325
|
const seen = new Set();
|
|
317
|
-
for (const
|
|
318
|
-
|
|
319
|
-
|
|
326
|
+
for (const ancestor of lineage) {
|
|
327
|
+
const ancestorPath = ancestor === role ? contractPath : resolveRoleManifestPath(repoRoot, ancestor);
|
|
328
|
+
const ancestorContract = ancestor === role ? contract : tryLoadRoleContract(ancestorPath);
|
|
329
|
+
const declared = ancestorContract?.capabilities ?? [];
|
|
330
|
+
if (!Array.isArray(declared)) {
|
|
331
|
+
throw new TypeError(`Role contract "${ancestorPath}" must declare "capabilities" as a list`);
|
|
320
332
|
}
|
|
321
|
-
|
|
322
|
-
|
|
333
|
+
const localSeen = new Set();
|
|
334
|
+
for (const capability of declared) {
|
|
335
|
+
if (typeof capability !== 'string' || !CAPABILITY_NAMES.includes(capability)) {
|
|
336
|
+
throw new Error(`Role contract "${ancestorPath}" references unknown capability "${String(capability)}"`);
|
|
337
|
+
}
|
|
338
|
+
if (localSeen.has(capability)) {
|
|
339
|
+
throw new Error(`Role contract "${ancestorPath}" declares duplicate capability "${capability}"`);
|
|
340
|
+
}
|
|
341
|
+
localSeen.add(capability);
|
|
342
|
+
if (!seen.has(capability)) {
|
|
343
|
+
capabilities.push(capability);
|
|
344
|
+
seen.add(capability);
|
|
345
|
+
}
|
|
323
346
|
}
|
|
324
|
-
|
|
347
|
+
}
|
|
348
|
+
if (capabilities.length === 0) {
|
|
349
|
+
throw new Error(`Role contract "${contractPath}" must declare a non-empty "capabilities" list, directly or through inheritance`);
|
|
325
350
|
}
|
|
326
351
|
return {
|
|
327
|
-
capabilities
|
|
352
|
+
capabilities,
|
|
328
353
|
...(contract.roleVendorPosition === undefined ? {} : { roleVendorPosition: contract.roleVendorPosition }),
|
|
329
354
|
};
|
|
330
355
|
}
|
|
@@ -448,11 +473,11 @@ function normalizeVendorDefinition(value, manifestPath) {
|
|
|
448
473
|
/**
|
|
449
474
|
* 依据 role.yaml 声明的 capabilities,把清单导出的 roleVendor 组合成完整 vendors 列表。
|
|
450
475
|
*/
|
|
451
|
-
function composeRoleVendorTree(manifestPath, roleVendor, roleContract) {
|
|
476
|
+
async function composeRoleVendorTree(manifestPath, roleVendor, roleContract) {
|
|
452
477
|
if (!isVendorEntry(roleVendor)) {
|
|
453
478
|
throw new Error(`Vendor manifest "${manifestPath}" export "roleVendor" must be a vendor definition with name and source`);
|
|
454
479
|
}
|
|
455
|
-
const contract = requireRoleCapabilityContract(manifestPath, roleContract ?? tryLoadRoleContract(manifestPath) ?? {});
|
|
480
|
+
const contract = await requireRoleCapabilityContract(manifestPath, roleContract ?? tryLoadRoleContract(manifestPath) ?? {});
|
|
456
481
|
return composeCapabilities(contract.capabilities, {
|
|
457
482
|
roleVendor: normalizeVendorDefinition(roleVendor, manifestPath),
|
|
458
483
|
...(contract.roleVendorPosition === undefined ? {} : { roleVendorPosition: contract.roleVendorPosition }),
|
package/package.json
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# General
|
|
2
|
+
|
|
3
|
+
`general` 提供计划审问、长期记忆、skill 编写和知识整理等通用能力。角色在 [`role.yaml`](role.yaml) 中选择 `common` 和 `grilling`,资产从远程供应商同步。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --global moluoxixi-ai-rules
|
|
9
|
+
airules install general --host all
|
|
10
|
+
airules verify general --host all
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
安装后可在宿主中直接使用以下能力:
|
|
14
|
+
|
|
15
|
+
| Skill | 用途 |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `grilling` | 逐项审问计划、决策和假设,明确取舍与验证条件 |
|
|
18
|
+
| `hindsight-memory` | 按项目回忆和保存已确认的信息,查看记忆控制台 |
|
|
19
|
+
| `hindsight-docs` | 查询 Hindsight API、部署和高级配置 |
|
|
20
|
+
| `create-skill` | 编写或修订通用 skill |
|
|
21
|
+
| `spec-organization` | 整理文档目录、索引和链接 |
|
|
22
|
+
|
|
23
|
+
唯一 MCP 是 Hindsight,默认地址为 `http://localhost:8888/mcp/`。安装器分发连接配置和可视化部署资产,运行记忆服务需要配置模型。
|
|
24
|
+
|
|
25
|
+
## 使用
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
请用 grilling 审问这个计划,逐项检查假设和取舍。
|
|
29
|
+
请记住我们已确认的结论、理由和下一步验证条件。
|
|
30
|
+
回忆这个项目之前的决定,并核对是否仍适用。
|
|
31
|
+
打开当前项目的记忆可视化,查看保存的事实和实体关系图。
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
记忆控制台默认位于 `http://localhost:9999`。在控制台选择与 MCP 相同的项目 bank,查看事实、来源文档、实体关系图和异步操作状态。已有 Hindsight API 时只需添加控制台;首次部署可使用随 `hindsight-memory` skill 分发的 Docker Compose。操作步骤见 [记忆可视化](../../capabilities/common/skills/hindsight-memory/references/visualization.md)。
|
|
35
|
+
|
|
36
|
+
审问中的候选方案与已确认结论分别标注状态;只有确认保存成功后才报告记忆已写入。
|
|
37
|
+
|
|
38
|
+
## 作为基础角色
|
|
39
|
+
|
|
40
|
+
`moluoxixi`、`trellis` 和 `matt` 通过 `extends_roles: [general]` 继承通用能力。新增开发角色同样可以继承,再选择自身能力:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
extends_roles: [general]
|
|
44
|
+
capabilities:
|
|
45
|
+
- coding
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
多层继承与共同祖先自动合并;规则见 [角色继承](../../capabilities/README.md#角色继承)。
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
role_id: general
|
|
3
|
+
role_version: 0.1.0
|
|
4
|
+
status: stable
|
|
5
|
+
canonical_root: roles/general
|
|
6
|
+
description: Shared skills for grilling plans, organizing knowledge, and persistent memory with the Hindsight console.
|
|
7
|
+
capabilities:
|
|
8
|
+
- common
|
|
9
|
+
- grilling
|
|
10
|
+
hosts: all
|
|
11
|
+
extends_roles: []
|
|
12
|
+
role_vendor:
|
|
13
|
+
name: general-role
|
|
14
|
+
source: https://github.com/moluoxixi/AIRules.git
|
|
15
|
+
projections:
|
|
16
|
+
- kind: role-assets
|
|
17
|
+
source_dir: roles/general
|
|
18
|
+
distribution:
|
|
19
|
+
bootstrap_manifest: role.yaml
|
|
20
|
+
full_role_path_required: true
|
|
21
|
+
npm_embedded_source: false
|
package/roles/matt/role.yaml
CHANGED
|
@@ -9,12 +9,11 @@ assets:
|
|
|
9
9
|
mcp: mcp
|
|
10
10
|
packages: packages
|
|
11
11
|
capabilities:
|
|
12
|
-
- common
|
|
13
12
|
- coding
|
|
14
13
|
- productivity
|
|
15
14
|
- frontend
|
|
16
15
|
hosts: all
|
|
17
|
-
extends_roles: []
|
|
16
|
+
extends_roles: [general]
|
|
18
17
|
role_vendor:
|
|
19
18
|
name: moluoxixi
|
|
20
19
|
source: https://github.com/moluoxixi/AIRules.git
|
package/roles/trellis/role.yaml
CHANGED
|
@@ -8,12 +8,11 @@ assets:
|
|
|
8
8
|
skills: skills
|
|
9
9
|
mcp: mcp
|
|
10
10
|
capabilities:
|
|
11
|
-
- common
|
|
12
11
|
- coding
|
|
13
12
|
- productivity
|
|
14
13
|
- frontend
|
|
15
14
|
hosts: all
|
|
16
|
-
extends_roles: []
|
|
15
|
+
extends_roles: [general]
|
|
17
16
|
role_vendor:
|
|
18
17
|
name: trellis
|
|
19
18
|
source: https://github.com/moluoxixi/AIRules.git
|