@llman-sdd/core 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/archive/freeze.ts +15 -15
- package/src/archive/frozenCard.ts +3 -2
- package/src/change/collect.ts +17 -14
- package/src/change/deps.ts +54 -0
- package/src/change/frontmatter.ts +36 -5
- package/src/change/lifecycle.ts +124 -20
- package/src/change/nextId.ts +14 -6
- package/src/config/changeId.ts +0 -6
- package/src/config/load.ts +2 -2
- package/src/config/schema.ts +3 -1
- package/src/context/indexStore.ts +14 -14
- package/src/context/sddState.ts +1 -13
- package/src/context/tree.ts +9 -19
- package/src/index.ts +25 -9
- package/src/init/defaultConfig.ts +14 -31
- package/src/init/init.ts +25 -27
- package/src/locale.ts +33 -0
- package/src/project/migrations.ts +79 -9
- package/src/report/graph/deps.ts +3 -38
- package/src/report/graph/nodes.ts +13 -19
- package/src/report/graph/types.ts +2 -6
- package/src/report/show.ts +16 -8
- package/src/report/specHelpers.ts +22 -28
- package/src/review/review.ts +18 -30
- package/src/self/completion.ts +206 -0
- package/src/spec/assignSpecIds.ts +9 -1
- package/src/spec/authoring.ts +11 -11
- package/src/spec/parser.ts +3 -1
- package/src/templates/skills.ts +3 -23
- package/src/util/datedId.ts +18 -0
- package/src/util/fsPort.ts +24 -0
- package/src/util/nextNumber.ts +30 -0
- package/src/util/semver.ts +21 -0
- package/src/validation/changeCheck.ts +133 -67
- package/src/validation/crossRoot.ts +86 -0
- package/src/validation/discover.ts +22 -13
- package/src/validation/roots.ts +2 -5
- package/src/validation/validate.ts +4 -9
- package/src/validation/xstateTransitions.ts +0 -32
- package/templates/zh-Hans/skills/llman-sdd-apply-cycle.md +9 -7
- package/templates/zh-Hans/skills/llman-sdd-apply.md +5 -5
- package/templates/zh-Hans/skills/llman-sdd-archive.md +11 -2
- package/templates/zh-Hans/skills/llman-sdd-continue.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-draft.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-explore.md +2 -2
- package/templates/zh-Hans/skills/llman-sdd-ff.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-propose.md +8 -6
- package/templates/zh-Hans/skills/llman-sdd-quick.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-validate.md +1 -1
- package/templates/zh-Hans/skills/llman-sdd-verify.md +2 -2
- package/templates/zh-Hans/skills/llman-sdd-wayfinder.md +1 -1
- package/templates/zh-Hans/units/skills/git-native-flow.md +12 -6
- package/templates/zh-Hans/units/skills/index-fallback.md +1 -0
- package/templates/zh-Hans/units/skills/structured-protocol.md +1 -6
- package/templates/zh-Hans/units/spec/feature-contract.md +5 -33
- package/src/templates/locale.ts +0 -24
- package/templates/en/agents-root-stub.md +0 -9
- package/templates/en/llmanspec-agents-stub.md +0 -6
- package/templates/en/skills/llman-sdd-apply-cycle.md +0 -67
- package/templates/en/skills/llman-sdd-apply.md +0 -117
- package/templates/en/skills/llman-sdd-arch-review.md +0 -58
- package/templates/en/skills/llman-sdd-archive.md +0 -70
- package/templates/en/skills/llman-sdd-continue.md +0 -34
- package/templates/en/skills/llman-sdd-draft.md +0 -53
- package/templates/en/skills/llman-sdd-explore.md +0 -64
- package/templates/en/skills/llman-sdd-ff.md +0 -33
- package/templates/en/skills/llman-sdd-graph.md +0 -56
- package/templates/en/skills/llman-sdd-propose.md +0 -105
- package/templates/en/skills/llman-sdd-quick.md +0 -41
- package/templates/en/skills/llman-sdd-research.md +0 -35
- package/templates/en/skills/llman-sdd-specs-compact.md +0 -41
- package/templates/en/skills/llman-sdd-validate.md +0 -28
- package/templates/en/skills/llman-sdd-verify.md +0 -77
- package/templates/en/skills/llman-sdd-wayfinder.md +0 -83
- package/templates/en/units/skills/cli-footer.md +0 -2
- package/templates/en/units/skills/ethics-governance.md +0 -6
- package/templates/en/units/skills/git-native-flow-brief.md +0 -10
- package/templates/en/units/skills/git-native-flow.md +0 -50
- package/templates/en/units/skills/human-readable-summary.md +0 -9
- package/templates/en/units/skills/stage-guard.md +0 -17
- package/templates/en/units/skills/structured-protocol.md +0 -24
- package/templates/en/units/skills/validation-hints.md +0 -20
- package/templates/en/units/skills/version-drift.md +0 -3
- package/templates/en/units/spec/feature-contract.md +0 -38
- package/templates/en/units/workflow/archive-freeze-guidance.md +0 -9
- package/templates/zh-Hans/units/skills/git-native-flow-brief.md +0 -10
- package/templates/zh-Hans/units/workflow/archive-freeze-guidance.md +0 -10
|
@@ -27,7 +27,7 @@ flowchart LR
|
|
|
27
27
|
- **不得 创建 tasks/design/specs/attach**:只建 `proposal.md` 草案;完整规划归 `llman-sdd-propose`。
|
|
28
28
|
- **不得 判断变更规模**:那是 propose 的职责。用户想开始实现 → 宜转 `llman-sdd-propose`。
|
|
29
29
|
- **适用边界**:描述明显涉及行为合约(需求语义)变更或多文件改动时,宜转 `llman-sdd-propose`——但仍先建草案以免想法丢失。
|
|
30
|
-
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`title`、`blocks`、`branch`、`base_sha`、`needs_specs_change` 等);`title` 必须为非空的一句话概念式标题,不得复读 change id——缺失或为空串时 `llman-sdd validate` 报 ERROR;`status`/`priority`/`author` 等集外字段同样报 ERROR。生命周期阶段是推断量(用 `llman-sdd show`/`list` 查),不得写进 frontmatter。正文不得复读 frontmatter 字段(不得 `## Status` 段);H1 宜保留人类可读标题(freeze 取 title 时 frontmatter 优先、H1 回退),不复读 change id。
|
|
30
|
+
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`title`、`blocks`、`branch`、`base_branch`、`base_sha`、`needs_specs_change` 等);`title` 必须为非空的一句话概念式标题,不得复读 change id——缺失或为空串时 `llman-sdd validate` 报 ERROR;`status`/`priority`/`author` 等集外字段同样报 ERROR。生命周期阶段是推断量(用 `llman-sdd show`/`list` 查),不得写进 frontmatter。正文不得复读 frontmatter 字段(不得 `## Status` 段);H1 宜保留人类可读标题(freeze 取 title 时 frontmatter 优先、H1 回退),不复读 change id。
|
|
31
31
|
|
|
32
32
|
## 步骤
|
|
33
33
|
|
|
@@ -17,7 +17,7 @@ metadata:
|
|
|
17
17
|
|
|
18
18
|
## Pipeline 位置
|
|
19
19
|
|
|
20
|
-
{{ unit("skills/git-native-flow
|
|
20
|
+
{{ unit("skills/git-native-flow") }}
|
|
21
21
|
|
|
22
22
|
```mermaid
|
|
23
23
|
flowchart LR
|
|
@@ -37,7 +37,7 @@ flowchart LR
|
|
|
37
37
|
|
|
38
38
|
## 动作清单
|
|
39
39
|
1. 用 `llman-sdd context --task "<任务>" --paths "<文件>"` 定位匹配 `<paths>` 的 specs,通读其 `direct` 列出的 spec 全文(这些是必须理解的合约)。
|
|
40
|
-
-
|
|
40
|
+
- {{ unit("skills/index-fallback") }}
|
|
41
41
|
2. 澄清目标与约束(问 1–3 个问题)。
|
|
42
42
|
3. **逐问深挖分支(可选,用户显式触发才进入)**:触发词“深挖”“grill”“逐个问”“彻底理清”。进入后一问一答走清决策:
|
|
43
43
|
- 一次只问一个问题,附你的推荐答案,等反馈再问下一个。
|
|
@@ -26,7 +26,7 @@ metadata:
|
|
|
26
26
|
7. 校验:`llman-sdd validate <id> --strict`。
|
|
27
27
|
8. 用 `llman-sdd show <id> --output json` 确认 specs-landed 门绿(`specsLanded`/`needsSpecsChange`)后宜接 `llman-sdd-apply`(未提交前不得提示)。
|
|
28
28
|
|
|
29
|
-
{{ unit("skills/git-native-flow
|
|
29
|
+
{{ unit("skills/git-native-flow") }}
|
|
30
30
|
{{ unit("skills/cli-footer") }}
|
|
31
31
|
{{ unit("skills/validation-hints") }}
|
|
32
32
|
|
|
@@ -29,14 +29,14 @@ flowchart LR
|
|
|
29
29
|
## 硬约束
|
|
30
30
|
|
|
31
31
|
- **change id 非阻塞**:用户给了就用;否则从任务描述推导合法 kebab-case id(动词前缀,过 CLI id 检查,遵循 `llmanspec/AGENTS.md` 命名约定),宣布所用 id 与覆盖方式后继续,不得 等确认——绑定分支前换 id 成本很低。只想先记 idea(不得 id)时转 `llman-sdd-draft`。
|
|
32
|
-
- **specs 是唯一事实来源**:只在绑定分支**之后**、在**绑定的非默认分支**上编辑 `llmanspec/specs
|
|
33
|
-
-
|
|
32
|
+
- **specs 是唯一事实来源**:只在绑定分支**之后**、在**绑定的非默认分支**上编辑 `llmanspec/specs/**`。**不得**在默认分支改 specs。规划文档可短暂留在默认分支。
|
|
33
|
+
- **不得问“是否继续”**:一口气执行完 propose,生成工件并校验。
|
|
34
34
|
{% if extra_skill_continue %}
|
|
35
35
|
- **change 已存在**:STOP。specs-landed 门已绿 → 宜接 `llman-sdd-apply`;否则用 `llman-sdd-continue` 补绑定分支 / 提交 specs 或规划文档。
|
|
36
36
|
{% else %}
|
|
37
37
|
- **change 已存在**:STOP。specs-landed 门已绿 → 宜接 `llman-sdd-apply`;否则补规划文档 / 绑定分支 / 提交 specs(编辑 `llmanspec/changes/<id>/`,或配置 `extra_skills: [llman-sdd-continue]`)。
|
|
38
38
|
{% endif %}
|
|
39
|
-
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`title`、`blocks`、`branch`、`base_sha`、`needs_specs_change` 等);`title` 必须为非空的一句话概念式标题,不得复读 change id——缺失或为空串时 `llman-sdd validate` 报 ERROR;`status`/`priority`/`author` 等集外字段同样报 ERROR。生命周期阶段是推断量(用 `llman-sdd show`/`list` 查),不得写进 frontmatter。正文不得复读 frontmatter 字段;H1 宜保留人类可读标题(freeze 取 title 时 frontmatter 优先、H1 回退),不复读 change id。
|
|
39
|
+
- **frontmatter 有固定 schema**:`proposal.md` 只接受 `llmanspec/AGENTS.md`“Change Proposal Frontmatter SSOT”的合法字段(`depends_on`、`title`、`blocks`、`branch`、`base_branch`、`base_sha`、`needs_specs_change` 等);`title` 必须为非空的一句话概念式标题,不得复读 change id——缺失或为空串时 `llman-sdd validate` 报 ERROR;`status`/`priority`/`author` 等集外字段同样报 ERROR。生命周期阶段是推断量(用 `llman-sdd show`/`list` 查),不得写进 frontmatter。正文不得复读 frontmatter 字段;H1 宜保留人类可读标题(freeze 取 title 时 frontmatter 优先、H1 回退),不复读 change id。
|
|
40
40
|
|
|
41
41
|
## 快速记录分流
|
|
42
42
|
|
|
@@ -56,7 +56,7 @@ flowchart LR
|
|
|
56
56
|
- **元规范变更**(SDD 模板/流程)→ 完整 SDD
|
|
57
57
|
- 不确定选完整 SDD(保守)。
|
|
58
58
|
2. 用 `llman-sdd context --task "<目标>" --paths "<范围>"` 找匹配 `<paths>` 的 specs。
|
|
59
|
-
-
|
|
59
|
+
- {{ unit("skills/index-fallback") }}
|
|
60
60
|
3. 收集输入:简短变更描述;change id(用户给了就用,否则按非阻塞规则推导并宣布);受影响 capability(命名 `specs/<capability>`)。
|
|
61
61
|
|
|
62
62
|
### 2) 确认项目已初始化
|
|
@@ -73,7 +73,7 @@ flowchart LR
|
|
|
73
73
|
- **写 tasks.md 前确认测试边界(seam)**:列出要测的 seam 并与用户确认。seam = 由 `*.feature` GWT 步骤驱动的公共边界(CLI 子进程或公共接口)——必须 复用既有 harness seam,不得 脱离 `.feature` 凭空发明;没有 `.feature` 时,seam = 被测的 CLI 子命令或公共函数边界。
|
|
74
74
|
- `tasks.md` 按**垂直切片**拆(每个 task 打穿 schema→API→UI→tests 一条窄而完整的路径,可独立验证),带 `[blocked-by: <task-id>]` 依赖标记。**大范围重构例外**(一个机械改动扫全库、单点编辑牵动数百处调用):按先加后删排序(新的加在旧的旁边 → 分批迁移调用处 → 删旧的),不强拆垂直切片。**tasks.md 只列实现与验证任务**:收口(`change finalize` / `change archive`)是流水线步骤,不得 列为任务——收口的任务门要求全部任务已勾,列了必然自相矛盾(勾选即虚报、不勾则收口被拒,实施期 `validate --strict` 永红)。前后对比类完成判据(计数、基线)必须 注明在 change 分支上测量(相对 merge-base)——默认分支测得的值通常恒为基线。
|
|
75
75
|
- **先** `llman-sdd change start <change-id>`(推荐;默认分支上工作树干净时;保留当前检出用 `--worktree`,非默认分叉源用 `--base <branch>`(仅本地分支))或手动建分支后 `change attach <change-id>`(attach 缺省按运行时信号推导分叉源,偏离默认分支时输出 WARNING)。
|
|
76
|
-
- **再**在绑定的非默认分支编辑 `llmanspec/specs/<capability>.feature`(扁平,或目录 `llmanspec/specs/<capability>/` 内主文件)并 commit(提交 specs
|
|
76
|
+
- **再**在绑定的非默认分支编辑 `llmanspec/specs/<capability>.feature`(扁平,或目录 `llmanspec/specs/<capability>/` 内主文件)并 commit(提交 specs)。**不得**在 start 前改 specs;**不得**为过干净树门禁把 specs commit 到默认分支。已 attach 不得重复 `start`(specs 丢失用 checkout/重建 + `attach --force` 恢复)。
|
|
77
77
|
- 无合约编辑的 change 设 frontmatter `needs_specs_change: false`。`llman-sdd show <id> --output json` 显示 `stage=full` 且 specs-landed 门通过即可进 apply;`readyToImplement=true`(全门)是 verify/finalize 的完成信号。
|
|
78
78
|
- **破坏性合约变更**(移除/重命名字段、命令、tag 或 stage 值域)必须 规划升级路径:`migrations/v<from>-v<to>/` 下写 README(升级提示;一次性脚本可行时随仓库提供)——写进提案 What Changes。
|
|
79
79
|
|
|
@@ -90,12 +90,14 @@ llman-sdd validate <change-id>
|
|
|
90
90
|
- **不得 静默添加 `specs:` 段**——总是先问。添加它会向全项目声明 BDD 执行入口。
|
|
91
91
|
|
|
92
92
|
### 4b) 单轨 feature 撰写
|
|
93
|
-
-
|
|
93
|
+
- 规划文档可短暂留在默认分支;**不得**在默认分支编辑 `llmanspec/specs/**`。绑定分支后,提交 specs 与实现都在绑定分支上。
|
|
94
94
|
- **单轨**:每个 capability 只有一个 `<capability>.feature`。规范样式为原生 Gherkin 分层:`@req:<id>` 挂 `规则:` 块头,块内嵌套 `场景:`(假如/当/那么 步骤,绑定 runner 步骤代码并被执行——**默认首选形态**);仅当需求无法程序化表达(抽象目标、架构决策、治理/人工约束)或暂不转写时,才留下无嵌套场景的 `规则:` 块(裸规则,描述自由文本)并在 proposal/design 记录理由。历史标签(@executable/@rule/@human/@manual)不再使用。
|
|
95
95
|
- **描述可读性**:`规则:` 描述较长时拆成多行便于审查(官方解析器按行保留);描述行不加 `- ` 列表前缀(会原样进入描述),也不得以 `假如/当/那么/而且`(en `Given/When/Then/And/But`)开头——会被 Gherkin 解析为步骤。
|
|
96
96
|
- **结构化新增首选**:向既有 capability 追加规则/场景,优先 `llman-sdd spec next-req-id`(全局 rN 分配)+ `spec add-req`(追加 `规则:` 块)+ `spec add-scenario`(向规则块插入嵌套 `场景:`)。新建 capability 用 `spec skeleton <capability>`;rN 反查用 `spec resolve-req <rN>`。旧式标签文件先 `spec migrate-native`。手改 `.feature` 保留为逃生门(适合改既有条款)。
|
|
97
97
|
- **可执行场景优先判据**(写新条款前先判定):凡 GWT(假如/当/那么)可表达、绑定步骤代码的自动化判定行为 必须 落成嵌套 `场景:`——纯文字规则无行为守护。用例如下:行为可程序判定(如“当 运行 validate 后,那么 stdout 为 TOON 且退出码为 0”)→ 嵌套 `场景:`;抽象目标/架构决策暂不可程序判定 → 裸 `规则:` 块(无嵌套场景,聚合计数提示,交 specs-compact),并在 proposal/design 记录理由。
|
|
98
98
|
|
|
99
|
+
{{ unit("spec/feature-contract") }}
|
|
100
|
+
|
|
99
101
|
### 5) 总结并宜接的下一步
|
|
100
102
|
- 进入实现:`llman-sdd-apply`;需要再想清楚:`llman-sdd-explore`。
|
|
101
103
|
|
|
@@ -27,7 +27,7 @@ flowchart LR
|
|
|
27
27
|
|
|
28
28
|
## 步骤
|
|
29
29
|
1. 用 `llman-sdd context --task "..." --paths "..."` 确认无匹配 `<paths>` 的 spec 变更。
|
|
30
|
-
-
|
|
30
|
+
- {{ unit("skills/index-fallback") }}
|
|
31
31
|
2. 直接改代码。
|
|
32
32
|
3. 若要动 `llmanspec/specs/**`,STOP——除非已在绑定的非默认 change 分支上(迷你 change:`change start`/`attach` → 编辑 → commit)。不得在默认分支 commit specs,即使 typo 或仅收紧 scope 也不行。优先把 specs 维护路由到 `llman-sdd-propose`。
|
|
33
33
|
4. git commit(message 写明 why)。无需 change 目录,无需 archive。
|
|
@@ -17,7 +17,7 @@ metadata:
|
|
|
17
17
|
- 在**绑定分支**上验证 `.feature` Gherkin 与 `@req` / 双写门禁;`.feature` 是 harness 权威——可执行 GWT 只在其中维护。
|
|
18
18
|
- 生命周期门禁:`change start` / `attach`(绑定分支)、`finalize`(收口;自动提交 `archive(sdd): <id>`,`--no-commit` 跳过)/ `diff`(只读)。
|
|
19
19
|
- `llman-sdd validate --specs` 做结构与合约门禁;配置 `specs.check_command` 时全量 harness 仅经显式 `--check` 执行(缺省跳过,仅结构/状态门),无占位符的命令每次调用至多执行一次。
|
|
20
|
-
- `list --specs --json` 查看 `
|
|
20
|
+
- `list --specs --json` 查看 `requirementCount` 与 `morphology`(requirementBoundCount / requirementUnboundCount / acceptanceCount / featureScenarioCount)。
|
|
21
21
|
- change JSON 状态字段:`stage`(draft/designed/planned/full)/ `specsLanded` / `needsSpecsChange` / `readyToImplement`(`show --output json`)。
|
|
22
22
|
{% endif %}
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ flowchart LR
|
|
|
27
27
|
- **CRITICAL 必须修复**:归档前清零。
|
|
28
28
|
- **亲自复跑门禁**:必须 亲自重跑 `llman-sdd validate <id> --check --strict`(真实 harness 证据)与项目门禁,不得 采信实现者报告的门禁结论;复跑结果与报告不符 → CRITICAL。
|
|
29
29
|
- **harness 证据必须 `--check`**:缺省 `validate` 不执行 harness,声称全量 harness 证据 必须 经显式 `--check`(缺省结构门的通过不是通过);收口会执行已配置的 `specs.check_command`,收口前不必再跑一遍。
|
|
30
|
-
-
|
|
30
|
+
- **不得问“是否继续”**:跑完整验证流程,输出完整报告。
|
|
31
31
|
|
|
32
32
|
{{ unit("skills/stage-guard") }}
|
|
33
33
|
|
|
@@ -66,7 +66,7 @@ flowchart LR
|
|
|
66
66
|
6. 输出简短报告:**CRITICAL**(归档前必须修复)/ **WARNING**(宜修复)/ **SUGGESTION**(可选优化)。
|
|
67
67
|
7. **人审关卡**:报告无 CRITICAL 后、归档前宜跑 `llman-sdd review`:退出码零 → 宜接 `llman-sdd-archive`;非零 = CRITICAL → 用 `llman-sdd-apply` 修复后重跑 review;不得 带 CRITICAL 进入 finalize/archive。
|
|
68
68
|
|
|
69
|
-
{{ unit("skills/git-native-flow
|
|
69
|
+
{{ unit("skills/git-native-flow") }}
|
|
70
70
|
{{ unit("skills/human-readable-summary") }}
|
|
71
71
|
{{ unit("skills/cli-footer") }}
|
|
72
72
|
|
|
@@ -71,7 +71,7 @@ disable-model-invocation: true
|
|
|
71
71
|
### 推进地图
|
|
72
72
|
1. 加载地图(低分辨率视图,不用读每个 ticket 全文)。
|
|
73
73
|
2. 选 ticket(用户指定或取可着手项第一个),先绑定分支(`change start` 或已有分支 `change attach`)占住它。规划文档可短暂在默认分支;ticket 要改 specs 时须在绑定分支提交。
|
|
74
|
-
3. 解决它——按需深入(按 Notes 指名读 ticket 全文,调用 Notes 指定的 skill
|
|
74
|
+
3. 解决它——按需深入(按 Notes 指名读 ticket 全文,调用 Notes 指定的 skill);没把握时用逐问深挖。**不得**在未绑定时改 `llmanspec/specs/**`。
|
|
75
75
|
4. 记录解决:答案写入该 ticket 的 proposal 并关闭它,在地图 Decisions-so-far 追加一行要点 + 指针。
|
|
76
76
|
5. 新增 ticket(先建再接线);答案让模糊点变清晰的,升级为 ticket 并移出尚未清晰区;答案揭示某 ticket 越过目的地的,归入范围外而非在路径上解决。
|
|
77
77
|
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
## Git
|
|
1
|
+
## Git 分支生命周期
|
|
2
2
|
|
|
3
3
|
两层别混:**分支生命周期**(绑定分支 → 提交 specs → `readyToImplement`)与 **skill 导航**(explore→propose→apply→verify→archive)。提交 specs **不是**独立 skill。
|
|
4
4
|
|
|
5
|
+
### 速览
|
|
6
|
+
|
|
7
|
+
1. **先**绑定分支(`change start` / `attach`)→ `stage=full`;**再**在绑定的非默认分支编辑 `llmanspec/specs/**` 并 commit(提交 specs)。
|
|
8
|
+
2. 无合约编辑的 change 设 frontmatter `needs_specs_change: false`。`stage=full` 且 specs-landed 门通过(`specsLanded ∨ needs_specs_change=false`)即可进 apply;`readyToImplement=true`(gateChecks 全过,含 tasks-done)是 verify/finalize 前的完成信号。diff 范围一律现算 merge-base;存储的 `base_sha` 仅审计。
|
|
9
|
+
3. 收口一律 `llman-sdd change finalize <id>`:自动提交 `archive(sdd): <id>`(实现 diff + 改名一笔);`--no-commit` 跳过自动提交。change 分支上提交自由(分段或 finalize 一次收尾均可)。
|
|
10
|
+
4. **不得**为过干净树门禁把 specs commit 到默认分支;已 attach 不得重复 `start`。
|
|
11
|
+
5. worktree(可选):`change start --worktree` 在独立 worktree 建分支、不动当前检出(`--base <branch>` 仅本地分支)记录分叉源;attach 缺省按运行时信号推导分叉源、偏离默认分支时输出 WARNING;finalize 目标即绑定分支时跳过合并就地收口,目标被其他 worktree 持有时自动在该 worktree 内执行(输出标注位置)。
|
|
12
|
+
|
|
13
|
+
### 权威全图
|
|
14
|
+
|
|
5
15
|
```mermaid
|
|
6
16
|
flowchart TB
|
|
7
17
|
subgraph main_ok["可短暂在默认分支"]
|
|
@@ -33,11 +43,7 @@ flowchart TB
|
|
|
33
43
|
F --> G --> H --> I --> J
|
|
34
44
|
```
|
|
35
45
|
|
|
36
|
-
|
|
37
|
-
1. **先** `change start` / `attach` 绑定分支(进入 full);**再**在绑定的非默认分支编辑 `llmanspec/specs/**` 并 commit(提交 specs)。
|
|
38
|
-
2. 无合约编辑的 change 设 frontmatter `needs_specs_change: false`。`stage=full` 且 specs-landed 门通过(specsLanded ∨ needs_specs_change=false)即可进 apply;`readyToImplement=true`(gateChecks 全过,含 tasks-done)是 verify/finalize 前的完成信号。diff 范围一律现算 merge-base;存储的 `base_sha` 仅审计。
|
|
39
|
-
3. 收口一律 `llman-sdd change finalize <id>`:自动提交 `archive(sdd): <id>`(实现 diff + 改名一笔);`--no-commit` 跳过自动提交。change 分支上提交自由(分段或 finalize 一次收尾均可)。
|
|
40
|
-
4. **不得**为过干净树门禁把 specs commit 到默认分支;已 attach 不得重复 `start`。
|
|
46
|
+
上图为权威全图,本单元即其唯一来源(无需另寻根 `AGENTS.md`)。
|
|
41
47
|
|
|
42
48
|
Worktree 决策表:
|
|
43
49
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
context 不可用(含 `quality: "unavailable"`)→ 先 `llman-sdd index check`:stale/缺失则 `llman-sdd index rebuild`(默认 pageindex,免模型)后重试;fresh 仍不可用(`LLMAN_SDD_INDEX_CHAT_MODEL` 未设)→ 改用 `llman-sdd list --specs` + 直读 `.feature`——勿循环 rebuild。
|
|
@@ -16,9 +16,4 @@
|
|
|
16
16
|
## Output Contract
|
|
17
17
|
- 先给人读摘要(结论 / 风险 / 待决策),机器细节随后。
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
- `ethics.risk_level`:low——仅读写本仓库与 `llmanspec/`,无外发动作;正文另有声明时从其声明。
|
|
21
|
-
- `ethics.prohibited_actions`:违反正文“硬约束”的动作;未经用户明确要求的 push / PR / 外部上传。
|
|
22
|
-
- `ethics.required_evidence`:结论须有命令输出或文件路径佐证;门禁状态以 `llman-sdd validate` 为准。
|
|
23
|
-
- `ethics.refusal_contract`:门禁 CRITICAL 未清零 → 拒绝进入下一阶段;自修复达上限 → 报告 blocker。
|
|
24
|
-
- `ethics.escalation_policy`:改动 SDD 合约/模板或执行不可逆动作前,暂停并请用户确认。
|
|
19
|
+
{{ unit("skills/ethics-governance") }}
|
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
## 单轨 Feature 合约规范
|
|
1
|
+
## 单轨 Feature 合约规范
|
|
2
2
|
|
|
3
3
|
每个 capability 只有一个 Gherkin 文件:扁平 `llmanspec/specs/<capability>.feature`(默认)或目录 `llmanspec/specs/<capability>/` 内同名主文件——二选一,同 id 两布局并存算冲突。它是唯一的 spec 工件(不存在 `spec.toon`)。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# purpose: One-line overview.
|
|
10
|
-
|
|
11
|
-
功能: sample
|
|
12
|
-
|
|
13
|
-
@req:r1
|
|
14
|
-
规则: 描述一个需求要点
|
|
15
|
-
需求文本自由书写(不强制 MUST/SHALL 词),较长时拆多行便于人/agent 阅读。
|
|
16
|
-
第二行继续,描述行不得以 假如/当/那么/而且 开头(会被解析为步骤)。
|
|
17
|
-
|
|
18
|
-
场景: 一个可执行示例
|
|
19
|
-
假如 a precondition
|
|
20
|
-
当 a trigger happens
|
|
21
|
-
那么 the outcome is observed
|
|
22
|
-
|
|
23
|
-
@req:r2
|
|
24
|
-
规则: 暂不转写的需求(裸规则,会被聚合计数提示转写)
|
|
25
|
-
描述即现状需求的唯一载体;没有嵌套场景的规则计入裸规则聚合计数,交由
|
|
26
|
-
specs-compact 持续压降。
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
- 头注释:`# language:`(方言)与 `# purpose:`(一句话概述)必填。capability / spec id 由 discover 在实例内从路径分配(扁平或目录式可混搭),`功能:` 标题必须等于该 id。
|
|
30
|
-
- **可执行场景优先**:行为一律以嵌套 `场景:`(假如/当/那么)表达并绑定 BDD 步骤代码、由 runner 执行——默认首选。仅当需求无法程序化表达(抽象目标、架构决策、治理/人工约束)或暂不转写时,才以 `规则:` 块承载,并在 proposal/design 记录理由。
|
|
31
|
-
- `@req:<id>` 挂在 `规则:` 头标签,是全局唯一的需求句柄(resolve-req/next-req-id/条款引用共用);重复或缺失由 validate 判 ERROR。
|
|
32
|
-
- 规则描述为自由文本:不强制 MUST/SHALL 词;较长时拆多行便于审查,不使用 `- ` 列表前缀(会原样进入描述)。
|
|
33
|
-
- 不在任何 `规则:` 内的顶层 `场景:` 是功能级示例(Gherkin 原生允许,无规则句柄、不告警、不参与规则统计);无嵌套场景的 `规则:` 是裸规则(聚合计数 INFO,`--include-info` 可见,review `pending` 信号计量)。
|
|
34
|
-
- 改/删既有 `规则:` 只出 WARNING(报告制,不阻断门禁),用 git 分支对比审视;旧锁定确认元数据 `rules_touched` / `agent_acked` / `@agent` 已删除,无别名无兼容层。
|
|
35
|
-
- 覆盖分级:enforced(含嵌套场景)/ pending(裸规则)——`list --specs` 逐项输出。
|
|
36
|
-
- `规则:` 块是标准容器:嵌套 `场景:` 会被 runner 执行;两空格缩进层级(块 `规则:` 2 格、嵌套 `场景:` 4 格、步骤 6 格)。
|
|
5
|
+
- capability 即 discover 在实例内从路径分配后的 spec id,`功能:` 标题必须等于该 id;不得要求或生成 `# capability:` 头。
|
|
6
|
+
- 头注释 `# language:`(方言)必填:缺失则解析器回退默认方言,条款可能按错误方言解析。
|
|
7
|
+
- 覆盖分级:enforced(`规则:` 含嵌套 `场景:`)/ pending(裸 `规则:`)——`list --specs` 逐项输出;pending 由聚合计数与 specs-compact 承担压降。
|
|
8
|
+
- 缩进层级两空格递进:块 `规则:` 2 格、嵌套 `场景:` 4 格、步骤 6 格。
|
package/src/templates/locale.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Locale normalization + fallback chain (init-generators capability, r18).
|
|
3
|
-
* Port of predecessor config.rs normalize_locale / locale_fallbacks.
|
|
4
|
-
*/
|
|
5
|
-
export function normalizeLocale(value: string): string {
|
|
6
|
-
const trimmed = value.trim();
|
|
7
|
-
if (trimmed === '') return 'en';
|
|
8
|
-
const lower = trimmed.toLowerCase();
|
|
9
|
-
if (lower === 'zh' || lower.startsWith('zh-hans') || lower === 'zh-cn') return 'zh-Hans';
|
|
10
|
-
if (lower.startsWith('en')) return 'en';
|
|
11
|
-
return trimmed;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function localeFallbacks(locale: string): string[] {
|
|
15
|
-
const normalized = normalizeLocale(locale);
|
|
16
|
-
const locales: string[] = [normalized];
|
|
17
|
-
const dash = normalized.indexOf('-');
|
|
18
|
-
if (dash !== -1) {
|
|
19
|
-
const lang = normalized.slice(0, dash);
|
|
20
|
-
if (!locales.includes(lang)) locales.push(lang);
|
|
21
|
-
}
|
|
22
|
-
if (!locales.includes('en')) locales.push('en');
|
|
23
|
-
return locales;
|
|
24
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# LLMAN Spec-Driven Development
|
|
2
|
-
|
|
3
|
-
This project uses llman SDD. Read `llmanspec/config.yaml` for SDD command behavior configuration, and `llmanspec/AGENTS.md` for additional project-specific rules.
|
|
4
|
-
|
|
5
|
-
## SDD Pipeline
|
|
6
|
-
|
|
7
|
-
Use `/llman-sdd-explore` to get started, then follow the pipeline: `/llman-sdd-propose` → `/llman-sdd-apply` → `/llman-sdd-verify` → `/llman-sdd-archive`.
|
|
8
|
-
|
|
9
|
-
Keep this managed block so `llman-sdd init --update` can refresh it.
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "llman-sdd-apply-cycle"
|
|
3
|
-
description: "End-to-end closed loop for one change: implement→test→validate→verify→archive. Manual trigger only; agent must not auto-invoke."
|
|
4
|
-
metadata:
|
|
5
|
-
version: "{{ llman_version }}"
|
|
6
|
-
disable-model-invocation: true
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# LLMAN SDD Apply Cycle
|
|
10
|
-
|
|
11
|
-
End-to-end closed loop for one change (manual). Requires a bound branch and a green specs-landed gate (`specsLanded ∨ needsSpecsChange=false`); `readyToImplement=true` (the completion signal) closes the cycle.
|
|
12
|
-
|
|
13
|
-
**Manual trigger only**: `/skill:llman-sdd-apply-cycle <change-id>`
|
|
14
|
-
|
|
15
|
-
## Workflow
|
|
16
|
-
|
|
17
|
-
### 0) Gate + status
|
|
18
|
-
```bash
|
|
19
|
-
llman-sdd show <change-id> --output json --type change
|
|
20
|
-
```
|
|
21
|
-
> Stage decisions use the `stage` / `readyToImplement` fields; the full decision table lives in llman-sdd-apply.
|
|
22
|
-
|
|
23
|
-
- Must be on the bound non-default branch.
|
|
24
|
-
- specs-landed gate failing → STOP (land specs or `needs_specs_change: false`). Green but `readyToImplement=false` → normal: tasks pending, keep implementing; **finalize only when `readyToImplement=true`**.
|
|
25
|
-
- Track progress via `tasks.md` checkboxes (or `llman-sdd list` task counts); still read `tasks.md`, proposal/design, and `llmanspec/specs/**` on the bound branch (the single source of truth).
|
|
26
|
-
|
|
27
|
-
### 1) Loop: implement → test
|
|
28
|
-
For each incomplete task:
|
|
29
|
-
1. Implement per task + specs (minimal diff)
|
|
30
|
-
2. Run the task's stated verification command when the task text names one
|
|
31
|
-
3. On failure, fix and retry (same self-repair budget as `llman-sdd-apply`: cap 8 rounds)
|
|
32
|
-
4. Check off `tasks.md` as `[x]`
|
|
33
|
-
|
|
34
|
-
### 2) Validate
|
|
35
|
-
```bash
|
|
36
|
-
llman-sdd validate <change-id> --strict
|
|
37
|
-
```
|
|
38
|
-
On failure, fix and retry (cap 8 rounds).
|
|
39
|
-
|
|
40
|
-
### 3) Verify (recommended)
|
|
41
|
-
Prefer `llman-sdd-verify` (or an equivalent dual-axis self-check). CRITICAL → STOP; do not archive.
|
|
42
|
-
|
|
43
|
-
### 4) Archive + commit
|
|
44
|
-
```bash
|
|
45
|
-
llman-sdd change finalize <change-id>
|
|
46
|
-
```
|
|
47
|
-
Dirty tree OK; auto merge (squash default) + rename + **auto commit** `archive(sdd): <change-id>` in one process. `--no-commit` skips the auto commit (manual/CI histories) — then commit with `git add -A && git commit -m "archive(sdd): <change-id>"`. Plain `change archive` stays as a fallback.
|
|
48
|
-
|
|
49
|
-
### 5) Optional cleanup
|
|
50
|
-
```bash
|
|
51
|
-
git branch -D <feature-branch> # after squash the branch is no longer an ancestor of main; -d gets refused
|
|
52
|
-
```
|
|
53
|
-
Push / PR only when the user explicitly asks.
|
|
54
|
-
|
|
55
|
-
## Hard constraints
|
|
56
|
-
- **Never ask** "should I continue" unless blocked.
|
|
57
|
-
- **Never switch** changes until this one is archived and committed.
|
|
58
|
-
- **Do not** author `changes/<id>/specs/`; **no default push/PR**.
|
|
59
|
-
|
|
60
|
-
## Ethics Governance
|
|
61
|
-
- `ethics.risk_level`: medium
|
|
62
|
-
- `ethics.prohibited_actions`: implementing without a bound branch / a green specs-landed gate, archiving without `readyToImplement=true`, switching changes early, writing `changes/<id>/specs/`, committing without validation, default push/PR
|
|
63
|
-
- `ethics.required_evidence`: `readyToImplement=true`, validate --strict pass, all tasks checked, finalize/archive success
|
|
64
|
-
- `ethics.refusal_contract`: after 8 self-repair rounds still failing, report a blocker; never force-archive
|
|
65
|
-
- `ethics.escalation_policy`: if changing SDD workflow specs/templates, pause for user confirmation before archive
|
|
66
|
-
|
|
67
|
-
{{ unit("skills/cli-footer") }}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "llman-sdd-apply"
|
|
3
|
-
description: "Implement a proposed change's tasks in a closed loop: code → test → self-heal → all gates green. Enter after propose, once specs are landed."
|
|
4
|
-
metadata:
|
|
5
|
-
version: "{{ llman_version }}"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# LLMAN SDD Apply
|
|
9
|
-
|
|
10
|
-
Implement all tasks in `llmanspec/changes/<id>/tasks.md` **in one closed loop**: implement → add tests/acceptance → run gates → self-heal and re-run on failure → report when all pass. Unless there is a clear blocker, **do not stop halfway to ask "should I continue?"**
|
|
11
|
-
|
|
12
|
-
## Pipeline Position
|
|
13
|
-
|
|
14
|
-
{{ unit("skills/git-native-flow-brief") }}
|
|
15
|
-
|
|
16
|
-
```mermaid
|
|
17
|
-
flowchart LR
|
|
18
|
-
propose["llman-sdd-propose"] --> apply["★ llman-sdd-apply"]
|
|
19
|
-
apply --> verify["llman-sdd-verify"]
|
|
20
|
-
verify --> archive["llman-sdd-archive"]
|
|
21
|
-
|
|
22
|
-
style apply fill:#fff3cd,stroke:#ffc107,stroke-width:3px
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
> 📍 Entry requires the specs-landed gate green (or `needs_specs_change: false`); `readyToImplement=true` (all gates green) is the completion signal that closes this loop → next `llman-sdd-verify`.
|
|
26
|
-
|
|
27
|
-
## Hard Constraints
|
|
28
|
-
|
|
29
|
-
- **Single-source-of-truth driven**: `proposal.md` / `design.md` / `tasks.md` and `llmanspec/specs/**` on the branch; every behavioral-contract requirement in specs must be fulfilled.
|
|
30
|
-
- **Scope-locked**: only implement the current change's scope; never fix "unrelated issues" on the side; keep changes minimal.
|
|
31
|
-
- **Governing scope**: the SDD flow (change branch, proposal, spec-edit gates) governs the behavior-contract surface only — `llmanspec/**` and its artifact alignment (e.g. `.agents/skills` render freshness). Everything else in the repo (build scripts, CI, general docs, test implementations) follows the project's regular engineering flow with direct edits and commits; no change wrapping required. Return to the corresponding skill flow only when a change reaches behavior-contract semantics.
|
|
32
|
-
- **No guessing**: unclear requirements or specs contradicting reality → STOP and report; don't assume.
|
|
33
|
-
- **No legacy compatibility layers**: if the change requires new behavior, upgrade all call sites directly, unless tasks/proposal explicitly require compatibility.
|
|
34
|
-
- **Close-out**: this loop ends by suggesting `llman-sdd-verify`; finalize/archive belongs to `llman-sdd-archive` (do not finalize inside the self-healing loop).
|
|
35
|
-
|
|
36
|
-
## Commit Policy
|
|
37
|
-
|
|
38
|
-
- **Commits on the change branch are free** (`change finalize` needs no clean tree): segment by task/milestone, or keep the tree dirty and let finalize make one close commit — both are first-class.
|
|
39
|
-
- **Default close-out**: after all tasks pass gates and verify is green, `llman-sdd change finalize <id>` auto-commits `archive(sdd): <change-id>` (uncommitted diff + frontmatter + rename in one commit). Do not run finalize inside the apply loop. `--no-commit` skips the auto commit (manual/CI histories; pre-commit-hook conflicts).
|
|
40
|
-
- **Blocker interrupt**: when you must STOP on a blocker, make ONE WIP commit (e.g. `wip(sdd): <change-id> <summary>`) to preserve the state, then report.
|
|
41
|
-
|
|
42
|
-
## Steps
|
|
43
|
-
|
|
44
|
-
### 0) Preflight (required)
|
|
45
|
-
- Read and obey `llmanspec/config.yaml`, `AGENTS.md` (if present).
|
|
46
|
-
- `git status --porcelain`: if the tree is dirty with changes not belonging to this change → `git stash push -u -m "llman-sdd-apply autopilot backup"` first.
|
|
47
|
-
- `llman-sdd validate --all --strict`: if it fails for reasons unrelated to this change → stop and report (inconsistent artifacts prevent source-of-truth-driven implementation).
|
|
48
|
-
- **Specs list readable**: `llman-sdd list --specs` returns the list without errors; on anomaly → stop and report.
|
|
49
|
-
|
|
50
|
-
### 1) Select the change id and check prerequisites
|
|
51
|
-
- If provided, use it; otherwise infer from context, and if ambiguous run `llman-sdd list --json` and let the user pick. Always announce "Using change: <id>" and how to override.
|
|
52
|
-
- Confirm you are on the non-default branch bound via `llman-sdd change start <id>` or `change attach <id>` (`--force` only to rebind). Specs on the branch are the single source of truth — do not author under `changes/<id>/specs/`.
|
|
53
|
-
{{ unit("skills/stage-guard") }}
|
|
54
|
-
- Use `llman-sdd context --task "<goal from proposal>" --paths "<scope from specs>"` to get relevant specs.
|
|
55
|
-
- Context unavailable → run `llman-sdd index check` first: stale/missing → `llman-sdd index rebuild` and retry; still unavailable on a fresh index (`LLMAN_SDD_INDEX_CHAT_MODEL` unset) → fall back to `llman-sdd list --specs` + reading `.feature` files directly — do not loop on rebuild.
|
|
56
|
-
|
|
57
|
-
### 2) Read the source-of-truth artifacts
|
|
58
|
-
- `llmanspec/changes/<id>/proposal.md`, `design.md` (if present), `tasks.md`
|
|
59
|
-
- `llmanspec/specs/**` (`<capability>.feature`) on the branch
|
|
60
|
-
|
|
61
|
-
Distill proposal/design decisions into a list of inviolable hard constraints; convert tasks.md into a minimal executable step sequence (preserving original order).
|
|
62
|
-
|
|
63
|
-
### 3) Show status
|
|
64
|
-
- Progress "N/M tasks complete" + a brief look at the next 1–3 unchecked tasks.
|
|
65
|
-
|
|
66
|
-
### 4) Implement tasks one by one (closed loop)
|
|
67
|
-
For each unchecked task:
|
|
68
|
-
1. **Implement**: strictly per task description + specs, minimal changes.
|
|
69
|
-
2. **Check the box immediately** after completion: `- [ ]` → `- [x]`. **Close-out is not a task**: `change finalize` / `change archive` are pipeline steps and MUST NOT appear in tasks.md — if one is listed (e.g. "close-out — finalize"), remove it (the close-out task gate requires every task checked).
|
|
70
|
-
3. **Edit, then verify — serially**: verification MUST run after edits land on disk; MUST NOT put edits and tests/validation in the same parallel tool-call batch (the check may read stale files and report a false failure or a false pass).
|
|
71
|
-
4. Task unclear, blocker hit, or specs/design contradict reality → STOP and report; don't assume.
|
|
72
|
-
|
|
73
|
-
### 5) Verification and self-healing loop (after each task or batch)
|
|
74
|
-
- Tests and static gates: run the verification means this repo has declared — as recorded in repo docs and configuration; for repos with `specs.check_command` configured, use the command reported by `llman-sdd config`. If the repo declares none, ask the user; never assume a specific task runner exists.
|
|
75
|
-
- Edit `llmanspec/specs/<capability>.feature` on the branch as needed (flat or directory main file; canonical native layout: `@req:<id>` on the `规则:` block header, nested `场景:` as executable examples); run `llman-sdd validate --specs` after spec edits; commit on the branch freely.
|
|
76
|
-
- SDD validation: `llman-sdd validate <id> --strict`
|
|
77
|
-
|
|
78
|
-
**Verification ladder (opt-in discipline, escalate by cost)**:
|
|
79
|
-
- L1 minimal unit: the fastest declared verification means that loads the changed module directly; covers only the current change point.
|
|
80
|
-
- L2 targeted behavior: run the subset of declared verification means matching the current scenario (prefer targeted `specs.check_command` invocation when configured); reproduce the target behavior only.
|
|
81
|
-
- L3 explicit full harness: `llman-sdd validate --check` (with `specs.check_command` configured; plain `validate` no longer runs the harness).
|
|
82
|
-
- L4 close-out backstop: `change finalize` runs the real harness pre-merge — at least one full run per close-out.
|
|
83
|
-
- Self-heal loops default to L1/L2 for fast reproduction; use L3 only when full-acceptance evidence is needed; avoid paying full-suite cost needlessly.
|
|
84
|
-
|
|
85
|
-
**Gate evidence**:
|
|
86
|
-
- Plain `validate` is structure/state-only and claims no harness evidence; harness evidence MUST come from explicit `--check` or close-out acceptance.
|
|
87
|
-
- Gate verdicts MUST come from the real harness: claiming a harness pass requires `--check` (or close-out); the default structural gate is not a pass; on harness failure, find the root cause first (leaked env vars, nested-invocation guards, wrong cwd …) — MUST NOT label it an "inherent/self-referential property" and bypass it.
|
|
88
|
-
- Before/after criteria (counts, baselines) MUST be measured on the change branch (against the freshly computed merge-base); a value measured on the default branch is usually trivially the baseline and proves nothing.
|
|
89
|
-
- Refactors and bulk replacements: MUST compare the test count before and after; all-green gates with fewer tests is a failure.
|
|
90
|
-
|
|
91
|
-
**On failure → self-heal (don't ask "should I continue?"):**
|
|
92
|
-
1. Parse the failure cause (test / lint / format / validation).
|
|
93
|
-
2. Decide if it's a hard-to-locate bug (cause unclear / intermittent flake / regression not obvious at a glance):
|
|
94
|
-
- **Not hard-to-locate** (clear lint/format/compile/validation error): apply a minimal fix (don't expand scope); re-run the minimum failure-repro command first, then all gates.
|
|
95
|
-
- **Hard-to-locate → escalate to the diagnose sub-flow**:
|
|
96
|
-
1. **First build a command that reproduces the failure** (fast, deterministic, agent-runnable, and goes red on *this* bug) — one that drives the real bug path and asserts the user's exact symptom. **MUST NOT start hypothesizing before such a command exists** (staring at code and guessing is the failure this prevents).
|
|
97
|
-
2. Run it, confirm red → minimize the repro (cut inputs/calls/config/data one at a time, keep only what's load-bearing).
|
|
98
|
-
3. Generate **3–5 ranked hypotheses**, each falsifiable ("if X is the cause, changing Y makes the bug disappear").
|
|
99
|
-
4. Verify one variable at a time; fix once the root cause is found.
|
|
100
|
-
5. If there's no correct seam for a regression test, note the architectural gap (hand off to `llman-sdd-arch-review`; when not enabled, write the gap into this change's `proposal.md` Further Notes section or `design.md`, and MUST NOT break the loop over it).
|
|
101
|
-
3. Re-run the minimum failure-repro command first, then all gates.
|
|
102
|
-
4. Log one self-healing round: `Round N: failure → fix → re-run → pass/fail`.
|
|
103
|
-
|
|
104
|
-
**Self-healing cap: 8 rounds**; exceeding it is a blocker: stop and output a blocker report (last failing command + output summary + what you tried).
|
|
105
|
-
|
|
106
|
-
**Human review gate (after each task batch passes the gates)**: before starting the next batch or emitting the completion report, run `llman-sdd review`: exit code zero → continue; non-zero = CRITICAL findings → STOP, fix, re-run review; MUST NOT enter the next batch or emit the completion report with CRITICAL findings open.
|
|
107
|
-
|
|
108
|
-
### 6) Completion report
|
|
109
|
-
After all tasks complete + all gates green, output a structured report (see Output Contract), then suggest `llman-sdd-verify`.
|
|
110
|
-
|
|
111
|
-
{{ unit("skills/cli-footer") }}
|
|
112
|
-
|
|
113
|
-
{{ unit("skills/version-drift") }}
|
|
114
|
-
|
|
115
|
-
{{ unit("skills/validation-hints") }}
|
|
116
|
-
|
|
117
|
-
{{ unit("skills/structured-protocol") }}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "llman-sdd-arch-review"
|
|
3
|
-
description: "Architecture review: scan for shallow modules (interface ≈ implementation) and surface deepening candidates to improve testability and AI-navigability."
|
|
4
|
-
metadata:
|
|
5
|
-
version: "{{ llman_version }}"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# LLMAN SDD Architecture Review
|
|
9
|
-
|
|
10
|
-
Scan the codebase for architectural friction and surface **deepening opportunities** — turning shallow modules (interface ≈ implementation) into deep ones (lots of behavior behind a small interface). The aim is testability and AI-navigability. Auxiliary tool, not part of the main pipeline; usable at any stage, commonly triggered during explore.
|
|
11
|
-
|
|
12
|
-
## Design vocabulary
|
|
13
|
-
|
|
14
|
-
Words about module shape; MUST NOT substitute "component" / "service" / "API" / "boundary" (broader, less precise):
|
|
15
|
-
|
|
16
|
-
- **Module** — anything with an interface and an implementation (function/class/package/cross-layer slice).
|
|
17
|
-
- **Interface** — everything a caller must know to use it correctly: type signature, plus invariants, ordering constraints, error modes, performance characteristics.
|
|
18
|
-
- **Depth** — the amount of behavior behind the interface. **Deep** = lots of behavior behind a small interface; **shallow** = interface nearly as complex as the implementation (the caller saves nothing). This skill turns shallow into deep.
|
|
19
|
-
- **Seam** — a place where you can swap the implementation without editing call sites (where the interface lives). In llman, seam = the public boundary driven by `*.feature` GWT steps.
|
|
20
|
-
- **Leverage** — what callers get from depth: more capability per unit of interface learned.
|
|
21
|
-
- **Locality** — what maintainers get from depth: changes/bugs/knowledge/verification concentrate in one place.
|
|
22
|
-
|
|
23
|
-
## Steps
|
|
24
|
-
|
|
25
|
-
### 1. Explore (scope first, YAGNI)
|
|
26
|
-
- If the user named a direction (module/subsystem/pain point), accept it; skip inference.
|
|
27
|
-
- Otherwise walk `git log --oneline` for hot spots (files/areas that keep coming up).
|
|
28
|
-
- Prefer reading `<capability>.feature` (the single source of truth) and `design.md` (existing ADRs); MUST NOT create a `CONTEXT.md`.
|
|
29
|
-
- Use the Agent tool (`subagent_type=Explore`) to walk the codebase, noting friction:
|
|
30
|
-
- Does understanding one concept require bouncing between many small modules?
|
|
31
|
-
- Where are modules **shallow** (interface ≈ implementation complexity, callers save nothing)?
|
|
32
|
-
- Where are pure functions extracted only for testability, but real bugs hide in how they're called (no locality)?
|
|
33
|
-
- Which parts are untested or hard to test through their current interface?
|
|
34
|
-
|
|
35
|
-
### 2. Present candidates
|
|
36
|
-
For each candidate:
|
|
37
|
-
- **Files** — which files/modules are involved.
|
|
38
|
-
- **Problem** — why the current architecture causes friction (use depth/leverage/locality).
|
|
39
|
-
- **Solution** — plain-English description of what would change.
|
|
40
|
-
- **Benefits** — locality and leverage improvements; how tests get better.
|
|
41
|
-
- **Recommendation strength** — `Strong` / `Worth exploring` / `Speculative`.
|
|
42
|
-
|
|
43
|
-
**Deletion test**: for any suspected-shallow module, imagine deleting it — does complexity vanish (it's just a pass-through) or reappear across N call sites (it's actually earning its keep)? "Reappears" is the signal you want.
|
|
44
|
-
|
|
45
|
-
**ADR conflicts**: if a candidate contradicts an existing `design.md` decision, surface it only when the friction is real enough to warrant reopening, and mark it in the candidate.
|
|
46
|
-
|
|
47
|
-
### 3. Deep-dive Q&A (after the user picks a candidate)
|
|
48
|
-
Run `llman-sdd-explore`'s **deep-dive Q&A branch** (trigger "deep-dig") to walk the decision tree — constraints, dependencies, the deepened module's shape, what sits behind the seam, which tests survive.
|
|
49
|
-
|
|
50
|
-
- The deepened module uses a concept not in the `.feature`? → update the `.feature` **only** if the change is branch-bound and you are on the bound branch; otherwise STOP and route to `llman-sdd-propose` / `change start` — **never** edit specs on the default branch.
|
|
51
|
-
- User rejects the candidate with a load-bearing reason? → offer an ADR only when "hard to reverse + surprising without context + real trade-off" all hold; record in `design.md`.
|
|
52
|
-
|
|
53
|
-
## Output
|
|
54
|
-
Candidate list (text; optional HTML report written to the OS temp dir, not the repo) + the deep-dive decision record after the user picks one (write back to the proposal; contract edits only after landing on the bound branch into the `.feature`).
|
|
55
|
-
|
|
56
|
-
{{ unit("skills/cli-footer") }}
|
|
57
|
-
|
|
58
|
-
{{ unit("skills/structured-protocol") }}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "llman-sdd-archive"
|
|
3
|
-
description: "Archive a completed change: merge back (squash default), rename docs into archive/, auto-commit the close-out. Run after verify is green."
|
|
4
|
-
metadata:
|
|
5
|
-
version: "{{ llman_version }}"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# LLMAN SDD Archive
|
|
9
|
-
|
|
10
|
-
Archive completed changes. Prerequisites: verify all-green, and the change is branch-bound with specs landed (or `needs_specs_change: false`). `change finalize` **auto-merges** into the base branch (target: `--into` > binding `base_branch` > default branch; when the target is the bound branch itself the merge is skipped for an in-place close-out with a notice in the output; method: `--method` > config `sdd.merge_method`, squash by default — feature diff + rename collapse into ONE commit on the target), **renames** change docs into `changes/archive/`, then **auto-commits** `archive(sdd): <change-id>` (`--no-commit` skips). `git push` / PR are optional.
|
|
11
|
-
|
|
12
|
-
## Pipeline Position
|
|
13
|
-
|
|
14
|
-
```mermaid
|
|
15
|
-
flowchart LR
|
|
16
|
-
verify["llman-sdd-verify"] --> archive["★ llman-sdd-archive"]
|
|
17
|
-
|
|
18
|
-
style archive fill:#fff3cd,stroke:#ffc107,stroke-width:3px
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
> 📍 You are in archive: the last stop of the branch lifecycle. If specs grow too large, run `llman-sdd-specs-compact`.
|
|
22
|
-
|
|
23
|
-
## Hard Constraints
|
|
24
|
-
|
|
25
|
-
- **Verify must be all-green first**; **the change must be branch-bound** (`change start` / `attach`) — otherwise STOP.
|
|
26
|
-
- Every change must pass `llman-sdd validate <id> --strict` before archiving.
|
|
27
|
-
- **Don't ask "should I continue?"**: execute the full batch to completion unless you hit an unresolvable error.
|
|
28
|
-
- **Close-out MUST NOT default to PR/push**: the CLI merges locally (squash default) + one close-out commit. Push / PR only when the user or project explicitly requires remote review — **Agent MUST NOT** push or open a PR by default.
|
|
29
|
-
|
|
30
|
-
## Steps
|
|
31
|
-
|
|
32
|
-
### 0) Preflight
|
|
33
|
-
- `git status --porcelain`: confirm working-tree changes belong to completed changes; handle unexpected ones first (stash or report).
|
|
34
|
-
|
|
35
|
-
### 1) Confirm targets
|
|
36
|
-
- Determine IDs (single or batch, from user input or `llman-sdd list --json`); always announce "Archiving IDs: <id1>, <id2>, ..." and confirm each change is verify all-green.
|
|
37
|
-
|
|
38
|
-
### 2) Archive one by one
|
|
39
|
-
- **Human review gate (before each id, including batches)**: run `llman-sdd review` (plain; `--capability` takes a spec id only). Exit code zero → continue; non-zero = CRITICAL → STOP, fix, re-run; MUST NOT archive with CRITICAL findings open.
|
|
40
|
-
- Validate first: `llman-sdd validate <id> --strict`; failure → STOP and report, never force-archive.
|
|
41
|
-
- Optional preview: `llman-sdd change archive <id> --dry-run`.
|
|
42
|
-
- Execute: `llman-sdd change archive <id>`; **stop immediately on first failure** and report the remaining IDs.
|
|
43
|
-
- **Branch close-out**:
|
|
44
|
-
- Prerequisites: branch bound; still on the bound branch (or on the target branch after the auto merge).
|
|
45
|
-
- `change archive` / `change finalize` run the **auto merge** (target `--into` > `base_branch` > default branch; method squash by default or `ff`; when the target is held by another worktree the merge and commit run in place inside it, with `executed in target worktree <path>` in the output; a dirty holding worktree aborts with disposal options and zero writes), **then** rename into `changes/archive/` — the rename is never rolled back on merge failure and degradation is reported explicitly.
|
|
46
|
-
- **Default: `change finalize` (one-command close)** — gates → merge → rename → **auto commit** `archive(sdd): <change-id>` (no manual `git commit` needed; locked-rule edits are a report-only WARNING — warn, never block):
|
|
47
|
-
```text
|
|
48
|
-
1. Implement specs + code (working tree may stay dirty; commits on the branch are free)
|
|
49
|
-
2. llman-sdd change finalize <id> # gates + merge (squash default) + rename + auto commit
|
|
50
|
-
3. optional: git commit --amend to adjust the message; git branch -D <feature> # after squash the branch is no longer an ancestor; -d gets refused
|
|
51
|
-
```
|
|
52
|
-
`--no-commit` skips the auto commit (CI / pre-commit-hook conflicts): finalize leaves the tree dirty and prints the manual commit command. Idempotent retry: a rerun after a failed auto commit detects the already-archived rename and finishes the commit.
|
|
53
|
-
- **Fallback: plain `change archive <id>`** — same auto merge + rename + close-out commit as finalize (no `--no-commit` here); gates: tasks all checked + clean tree + on the bound non-default branch (`--force` skips the gates). Snapshot review: `change diff`.
|
|
54
|
-
|
|
55
|
-
### 3) Full validation
|
|
56
|
-
- After all archives: `llman-sdd validate --all --strict`; confirm spec artifacts are consistent.
|
|
57
|
-
|
|
58
|
-
### 4) Commit guidance
|
|
59
|
-
- Finalize already auto-committed; with `--no-commit`, commit manually: `git add -A && git commit -m "archive(sdd): <id1>, <id2>"`.
|
|
60
|
-
- Optional: `git branch -D <feature>` after the merge. Push / PR only when explicitly required.
|
|
61
|
-
- **Breaking contract changes** (removed/renamed frontmatter field, command, tag, or stage value) MUST ship an upgrade path under `migrations/v<from>-v<to>/` (README + one-shot script, shipped in-repo) — verify it exists before closing.
|
|
62
|
-
- **Archived `depends_on`**: archive renames the change dir to `archive/YYYY-MM-DD-<id>`; validate treats `depends_on` pointing to archived/frozen ids as INFO (not ERROR), so you do **not** need to update other changes' frontmatter after archive.
|
|
63
|
-
|
|
64
|
-
{{ unit("workflow/archive-freeze-guidance") }}
|
|
65
|
-
|
|
66
|
-
{{ unit("skills/cli-footer") }}
|
|
67
|
-
|
|
68
|
-
{{ unit("skills/validation-hints") }}
|
|
69
|
-
|
|
70
|
-
{{ unit("skills/structured-protocol") }}
|