Skip to content

Commit 08d66db

Browse files
committed
refactor(cli): 收敛 knowledge-first 命令面
1 parent 9463b67 commit 08d66db

43 files changed

Lines changed: 102 additions & 3916 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/plugins/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aisee-plugin",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"interface": {
55
"displayName": "Aisee Plugin",
66
"description": "Aisee plugin marketplace for OpenSpec and Compound Engineering workflows."

README.en.md

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,10 @@ Compound Engineering = optional implementation / review / test consumer
9595

9696
## Skill Taxonomy
9797

98-
`plugins/aisee-plugin/.codex-plugin/plugin.json` still exposes all 22 public skills through `skills: "./skills/"`, but the default happy path contains only **11 core workflow skills**. The full contract lives in [Skill Taxonomy](plugins/aisee-plugin/references/skill-taxonomy.md).
98+
`plugins/aisee-plugin/.codex-plugin/plugin.json` still exposes all public skills through `skills: "./skills/"`, but the default happy path contains only **10 core workflow skills**. The full contract lives in [Skill Taxonomy](plugins/aisee-plugin/references/skill-taxonomy.md).
9999

100100
Core workflow:
101101

102-
- `aisee:flow`
103102
- `aisee:init`
104103
- `aisee:srs`
105104
- `aisee:ui-content`
@@ -125,7 +124,6 @@ On-demand extensions:
125124
- **Schema-aware change planning**: `aisee:change-plan` maps confirmed inputs into independently deliverable OpenSpec changes.
126125
- **OpenSpec schema pack**: includes app, device, docsite, infra, security, quick-fix, quick-research, and collaboration schemas.
127126
- **Context packs**: `aisee context pack` generates JSON context for implementation, verification, and review.
128-
- **Contract context service**: `aisee contract` exposes service contracts through manifest-first and section-level reads for cross-repository frontend/backend collaboration.
129127
- **Team knowledge guardrails**: `aisee knowledge` retrieves a small number of reviewed engineering lessons through pack/card protocols without turning the knowledge repository into a second specification source.
130128
- **Anchor-aware traceability**: `aisee get`, `aisee trace`, and `aisee index` connect upstream documents, OpenSpec artifacts, tasks, code paths, tests, and evidence through `doc-ref#LOCAL-ID` or alias anchors.
131129
- **Verification and archive guardrails**: `aisee:verify` and `aisee:archive-guard` diagnose gaps and risks before archive.
@@ -255,7 +253,6 @@ Check the project state again:
255253

256254
```bash
257255
aisee doctor --json
258-
aisee flow inspect --json
259256
```
260257

261258
## Documentation
@@ -282,18 +279,16 @@ aisee flow inspect --json
282279
5. openspec validate <change>
283280
6. aisee:implementation-bridge
284281
7. implementation / review / test
285-
8. aisee:verify
286-
9. aisee:archive-guard
287-
10. openspec archive <change>
282+
8. openspec archive <change>
288283
289284
For small, bounded, low-risk work, an abbreviated path is also valid:
290285
291286
```text
292287
quick-fix / quick-research / another lightweight schema
293288
-> change-author
294289
-> implementation-bridge
295-
-> verify
296-
-> archive-guard
290+
-> implementation / review / test
291+
-> archive
297292
```
298293
```
299294
@@ -305,7 +300,6 @@ For existing projects, use `aisee:spec-migrate` to derive OpenSpec baseline spec
305300
306301
| Skill | Purpose |
307302
| --- | --- |
308-
| `aisee:flow` | Inspect the current workflow stage and recommend the next step. |
309303
| `aisee:init` | Initialize or audit `AGENTS.md`, `openspec/project.md`, Aisee docs, memory, and Codex hooks. |
310304
| `aisee:srs` | Clarify software requirements and produce planning-level SRS documents. |
311305
| `aisee:ui-content` | Produce UI content specs for pages, elements, states, flows, permissions, and platform differences. |
@@ -372,11 +366,7 @@ aisee schemas check --json
372366
aisee sources list --json
373367
aisee sources check --json
374368
aisee index --json
375-
aisee flow inspect --json
376-
aisee flow inspect --change <change> --json
377369
aisee change inspect <change> --json
378-
aisee change author-check <change> --json
379-
aisee gaps --change <change> --json
380370
aisee context pack --change <change> --for ce-work --json
381371
aisee context pack --change <change> --for ce-work --knowledge --json
382372
aisee context pack --change <change> --for aisee-verify --json
@@ -391,12 +381,6 @@ aisee knowledge query --from-change <change> --for ce-work --json
391381
aisee knowledge index --json
392382
aisee knowledge index --team-path .aisee/team-knowledge --json
393383
aisee knowledge promote-batch --curation <path> --team-path .aisee/team-knowledge --pack web-app --json
394-
aisee contract manifest --json
395-
aisee contract summary --change <change> --json
396-
aisee contract get --change <change> --artifact service-contract --section capabilities --json
397-
aisee contract serve --host 127.0.0.1 --port 8765
398-
aisee change verify-check <change> --json
399-
aisee change archive-check <change> --json
400384
aisee index --json
401385
aisee get docs/requirements/auth-srs.md#FR-001 --json
402386
aisee trace srs:auth-login#FR-001 --json
@@ -412,29 +396,8 @@ Key CLI rules:
412396
- If `aisee/registry/id-registry.json` still exists, treat it as legacy compatibility data rather than a formal authoring entry point.
413397
- `bootstrap --plan` is a read-only plan and does not perform broad initialization writes.
414398
- `aisee openspec ensure` only bridges OpenSpec initialization and profile setup. It does not replace `aisee:init`.
415-
- `aisee contract serve` is a read-only contract context service, not a mock backend, API gateway, or second API source of truth. It binds to `127.0.0.1` by default; LAN access requires explicit `--host 0.0.0.0` and exposes local contract documents to that network.
416399
- `aisee knowledge query` returns only a small number of guardrails. By default it reads pack manifests and card frontmatter; `--debug` is required for matched card body excerpts.
417400

418-
### Cross-Repository Contract Reads
419-
420-
When frontend and backend are developed in separate repositories, the backend repository, BFF repository, or independent contract repository should own `service-contract.md` and optional machine-readable attachments such as `contracts/openapi.yaml`, `contracts/events.yaml`, `contracts/webhooks.yaml`, or `contracts/proto/*.proto`.
421-
422-
Recommended flow:
423-
424-
```bash
425-
# In the contract provider repository
426-
aisee contract manifest --json
427-
aisee contract summary --change <change> --json
428-
aisee contract serve --host 127.0.0.1 --port 8765
429-
430-
# In the consumer repository AI context, read the manifest first and fetch small sections as needed
431-
curl http://127.0.0.1:8765/manifest
432-
curl http://127.0.0.1:8765/changes/<change>/summary
433-
curl "http://127.0.0.1:8765/changes/<change>/contracts/service-contract/sections/<section>?max_chars=4000"
434-
```
435-
436-
OpenSpec/Aisee artifacts remain the authoritative contract source. The HTTP service reads current files on request and returns a JSON view; it does not persist contract copies and does not expose source code, environment variables, secrets, or full-repository search results.
437-
438401
### Team Knowledge Guardrails
439402

440403
Team knowledge is experimental. It reuses engineering lessons across projects, but it does not replace OpenSpec, `source-map.md`, contracts, tasks, or baseline specs.

README.md

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,10 @@ Compound Engineering = 可选的执行 / 审查 / 测试消费方
104104

105105
## Skill 分层
106106

107-
`plugins/aisee-plugin/.codex-plugin/plugin.json` 继续通过 `skills: "./skills/"` 暴露全部 22 个公开 skill,但默认 happy path 只包含 **11 个核心主流程 skill**。完整分类合同见 [Skill Taxonomy](plugins/aisee-plugin/references/skill-taxonomy.md)
107+
`plugins/aisee-plugin/.codex-plugin/plugin.json` 继续通过 `skills: "./skills/"` 暴露全部公开 skill,但默认 happy path 只包含 **10 个核心主流程 skill**。完整分类合同见 [Skill Taxonomy](plugins/aisee-plugin/references/skill-taxonomy.md)
108108

109109
核心主流程:
110110

111-
- `aisee:flow`
112111
- `aisee:init`
113112
- `aisee:srs`
114113
- `aisee:ui-content`
@@ -134,7 +133,6 @@ Compound Engineering = 可选的执行 / 审查 / 测试消费方
134133
- **Schema-aware change planning**`aisee:change-plan` 将已确认输入映射为可独立交付的 OpenSpec changes。
135134
- **OpenSpec schema pack**:提供 app、device、docsite、infra、security、quick-fix、quick-research、collaboration 等 schema。
136135
- **Context packs**`aisee context pack` 为实现、验证和 review 生成 JSON 上下文。
137-
- **契约上下文服务**`aisee contract` 以 manifest-first、section 级读取方式暴露服务契约,支持前后端跨仓库协作。
138136
- **团队知识 Guardrails**`aisee knowledge` 基于 pack/card 协议按需检索少量已审查工程经验,不把知识库变成第二份规范事实源。
139137
- **Anchor-aware traceability**`aisee get``aisee trace``aisee index` 通过 `doc-ref#LOCAL-ID` / alias anchor 连接上游文档、OpenSpec artifacts、tasks、代码路径、测试和 evidence。
140138
- **验证与归档门禁**`aisee:verify``aisee:archive-guard` 在 archive 前诊断缺口和风险。
@@ -264,7 +262,6 @@ Schema packs 来自 marketplace-installed plugin。`aisee schemas list/check`
264262

265263
```bash
266264
aisee doctor --json
267-
aisee flow inspect --json
268265
```
269266

270267
## 文档
@@ -291,18 +288,16 @@ aisee flow inspect --json
291288
5. openspec validate <change>
292289
6. aisee:implementation-bridge
293290
7. implementation / review / test
294-
8. aisee:verify
295-
9. aisee:archive-guard
296-
10. openspec archive <change>
291+
8. openspec archive <change>
297292
298293
对小范围、边界明确、低风险工作,也可以直接走:
299294
300295
```text
301296
quick-fix / quick-research / 其它轻量 schema
302297
-> change-author
303298
-> implementation-bridge
304-
-> verify
305-
-> archive-guard
299+
-> implementation / review / test
300+
-> archive
306301
```
307302
```
308303
@@ -314,16 +309,13 @@ quick-fix / quick-research / 其它轻量 schema
314309
315310
| Skill | 作用 |
316311
| --- | --- |
317-
| `aisee:flow` | 检查当前工作流阶段并推荐下一步。 |
318312
| `aisee:init` | 初始化或审计 `AGENTS.md`、`openspec/project.md`、Aisee docs、memory 和 Codex hooks。 |
319313
| `aisee:srs` | 澄清软件需求并生成规划级 SRS。 |
320314
| `aisee:ui-content` | 生成页面、元素、状态、流程、权限和平台差异等 UI 内容规格。 |
321315
| `aisee:architecture` | 捕获软件架构上下文、技术约束、可复用能力和 artifact hints。 |
322316
| `aisee:change-plan` | 规划独立 OpenSpec changes 并选择 schema。 |
323317
| `aisee-schema-pack` | 通过 marketplace plugin 提供并维护 OpenSpec schema packs。 |
324318
| `aisee:implementation-bridge` | 生成单个 change 的实现交接 brief 和 context pack 摘要。 |
325-
| `aisee:verify` | 诊断 artifact、task、source-map、ID 和 evidence 缺口。 |
326-
| `aisee:archive-guard` | 在 `openspec archive` 前给出最终归档建议。 |
327319
| `aisee:spec-migrate` | 为已有项目整理 OpenSpec baseline specs。 |
328320
| `aisee:design-spec` | 生成设计规范,不重复 UI 内容规格。 |
329321
| `aisee:design-assets` | 生成或提取视觉参考和设计素材。 |
@@ -382,11 +374,7 @@ aisee schemas check --json
382374
aisee sources list --json
383375
aisee sources check --json
384376
aisee index --json
385-
aisee flow inspect --json
386-
aisee flow inspect --change <change> --json
387377
aisee change inspect <change> --json
388-
aisee change author-check <change> --json
389-
aisee gaps --change <change> --json
390378
aisee context pack --change <change> --for ce-work --json
391379
aisee context pack --change <change> --for ce-work --knowledge --json
392380
aisee context pack --change <change> --for aisee-verify --json
@@ -401,12 +389,6 @@ aisee knowledge query --from-change <change> --for ce-work --json
401389
aisee knowledge index --json
402390
aisee knowledge index --team-path .aisee/team-knowledge --json
403391
aisee knowledge promote-batch --curation <path> --team-path .aisee/team-knowledge --pack web-app --json
404-
aisee contract manifest --json
405-
aisee contract summary --change <change> --json
406-
aisee contract get --change <change> --artifact service-contract --section 能力契约 --json
407-
aisee contract serve --host 127.0.0.1 --port 8765
408-
aisee change verify-check <change> --json
409-
aisee change archive-check <change> --json
410392
aisee index --json
411393
aisee get docs/requirements/auth-srs.md#FR-001 --json
412394
aisee trace srs:auth-login#FR-001 --json
@@ -422,29 +404,8 @@ CLI 关键规则:
422404
- `aisee/registry/id-registry.json` 如仍存在,只视为历史兼容数据,不再作为正式 authoring 入口。
423405
- `bootstrap --plan` 是只读计划,不做大而全初始化写入。
424406
- `aisee openspec ensure` 只桥接 OpenSpec 初始化和 profile 设置,不替代 `aisee:init`
425-
- `aisee contract serve` 是只读契约上下文服务,不是 mock backend、API gateway 或第二份接口事实源;默认只监听 `127.0.0.1`,如需局域网访问必须显式传 `--host 0.0.0.0` 并承担暴露本地契约文档的风险。
426407
- `aisee knowledge query` 只返回少量 guardrails;默认只读 pack manifest 和 card frontmatter,`--debug` 才包含命中 card 的正文摘要。
427408

428-
### 跨仓库接口契约读取
429-
430-
当前后端分离在不同仓库开发时,建议由后端仓库、BFF 仓库或独立契约仓库维护 `service-contract.md` 与可选的机器可读附件,例如 `contracts/openapi.yaml``contracts/events.yaml``contracts/webhooks.yaml``contracts/proto/*.proto`
431-
432-
推荐流程:
433-
434-
```bash
435-
# 在契约提供方仓库
436-
aisee contract manifest --json
437-
aisee contract summary --change <change> --json
438-
aisee contract serve --host 127.0.0.1 --port 8765
439-
440-
# 在消费方仓库的 AI 上下文中,先读 manifest,再按需读取小 section
441-
curl http://127.0.0.1:8765/manifest
442-
curl http://127.0.0.1:8765/changes/<change>/summary
443-
curl "http://127.0.0.1:8765/changes/<change>/contracts/service-contract/sections/<section>?max_chars=4000"
444-
```
445-
446-
契约权威来源仍然是 OpenSpec/Aisee artifacts。HTTP 服务只在请求时读取当前文件并返回 JSON 视图,不持久化契约副本,不暴露源码、环境变量、密钥或全仓库搜索结果。
447-
448409
### 团队知识 Guardrails
449410

450411
团队知识是实验性功能,用于跨项目复用工程经验,但不替代 OpenSpec、`source-map.md`、contracts、tasks 或 baseline specs。

docs/architecture/aisee-cli-context-and-id-registry.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,6 @@ aisee get srs:auth-login#FR-001 --json
117117

118118
它不把缓存或摘要当事实源。
119119

120-
### 3.5 `aisee contract *`
121-
122-
只读暴露 change contracts 和被允许的上下文片段。
123-
124-
支持:
125-
126-
- `manifest`
127-
- `summary`
128-
- `get`
129-
- `serve`
130-
131-
跨项目消费者必须:
132-
133-
1. 先读 manifest
134-
2. 再按 change / artifact / anchor 获取片段
135-
136-
禁止 provider 暴露全仓库任意读取。
137-
138120
## 4. Source Map 规则
139121

140122
`source-map.md` 是当前 change 的路由中心。

docs/architecture/aisee-openspec-compound-integration.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ Compound Engineering
9292

9393
进入实现前使用:
9494

95-
- `aisee change author-check`
96-
- `aisee gaps`
9795
- `aisee context pack --for ce-work`
9896
- `aisee:implementation-bridge`
9997

@@ -166,10 +164,7 @@ srs:auth-login#FR-001
166164

167165
跨仓库消费者通过:
168166

169-
- `aisee contract manifest`
170-
- `aisee contract summary`
171-
- `aisee contract get`
172-
- `aisee contract serve`
167+
不再提供跨项目制品获取命令或本地只读服务;当前项目上下文通过 OpenSpec artifacts、`aisee context pack` 和 knowledge 检索提供。
173168

174169
读取 provider 明确暴露的片段。
175170

docs/best-practices.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Rules:
160160

161161
Before creating tasks, entering implementation, proposing reviewer lenses, or recommending a next step, check existing workflows and skills first:
162162

163-
- When there is no explicit change, use `aisee:flow` or `aisee flow inspect --json` to identify the current stage.
163+
- When there is no explicit change, return to requirements clarification, change-plan, or the current change itself rather than relying on a dedicated flow command.
164164
- When there is an explicit change, read the target context pack first, such as `aisee context pack --change <change> --for ce-work --json`.
165165
- `reusable_workflow_candidates` in the `ce-work` context pack is a routing hint only, not a source of truth.
166166
- Use `ce-plan` only when `requires_ce_plan=true`; its conclusions must be written back to the current schema apply tracks, and only source-map schemas write back to `source-map.md`.
@@ -223,7 +223,7 @@ When `aisee:archive-guard` says archive is not recommended, fix blockers first.
223223
For frontend/backend split work, the contract provider can expose read-only context:
224224

225225
```bash
226-
aisee contract serve --host 127.0.0.1 --port 8765
226+
Read the current project's OpenSpec artifacts directly or use `aisee context pack`
227227
```
228228
229229
Best practices:

docs/best-practices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ aisee context pack --change <change> --for ce-code-review --json
160160

161161
创建任务、进入实现、提出审查角色或推荐下一步前,先检查已有 workflow 和 skill:
162162

163-
- 无明确 change 时,先用 `aisee:flow``aisee flow inspect --json` 判断当前 stage
163+
- 无明确 change 时,先回到需求澄清、change-plan 或当前 change 本身,不再依赖单独的 flow 命令判断阶段
164164
- 有明确 change 时,优先读取目标 context pack,例如 `aisee context pack --change <change> --for ce-work --json`
165165
- `ce-work` context pack 的 `reusable_workflow_candidates` 只是路由提示,不是事实源。
166166
- `requires_ce_plan=true` 时才按需使用 `ce-plan` 细化执行顺序;结论必须回写当前 schema apply tracks,只有 source-map schema 才回写 `source-map.md`
@@ -223,7 +223,7 @@ archive 前应满足:
223223
前后端分离时,推荐 contract provider 暴露只读上下文:
224224

225225
```bash
226-
aisee contract serve --host 127.0.0.1 --port 8765
226+
直接读取当前项目内的 OpenSpec artifacts 或 `aisee context pack` 输出
227227
```
228228

229229
最佳实践:

docs/release.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Aisee 使用 SemVer:
3434

3535
公开契约分层和破坏性变更判断见 [Compatibility Policy](compatibility-policy.md)
3636

37-
## 0.6.0 合同提示
37+
## 0.7.0 合同提示
3838

39-
`0.6.0` 引入的是向后兼容的 CLI JSON 增量字段与执行投影调整
39+
`0.7.0` 引入的是命令面重分层与 CLI 职责收缩
4040

41-
- `aisee context pack --for aisee-verify --json` / `--for ce-work --json` 的 traceability 增加 `intake_sources``mode`
42-
- `aisee context pack --for ce-work --json` 新增 `facts.derived.execution.brief`,并且 ce-work target 不再携带 artifact 正文副本
43-
- schema metadata、schema mismatch、schema installed 状态被提升为 author / implementation blocker
41+
- `aisee flow *``aisee gaps``aisee change author-check``aisee change verify-check``aisee change archive-check``aisee contract *` 已从公开 CLI 命令面删除
42+
- `aisee context pack --for ce-work --json` / `--for aisee-verify --json` 继续保留,但定位为最小上下文投影,不再搭配独立 gate 命令使用
43+
- CLI 重心收敛到 knowledge / memory / bridge / governance;OpenSpec 继续负责 change lifecycle、validate 与 archive authority
4444

4545
发布说明必须同时覆盖两条分发面:
4646

0 commit comments

Comments
 (0)