project-tiny-context-harness 0.2.39

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.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +399 -0
  3. package/assets/README.md +455 -0
  4. package/assets/README.zh-CN.md +131 -0
  5. package/assets/agents/.gitkeep +1 -0
  6. package/assets/agents/AGENTS_CORE.md +58 -0
  7. package/assets/context_templates/architecture.md +31 -0
  8. package/assets/context_templates/area.md +31 -0
  9. package/assets/context_templates/context.toml +27 -0
  10. package/assets/context_templates/deployment.md +35 -0
  11. package/assets/context_templates/global.md +53 -0
  12. package/assets/context_templates/verification.md +31 -0
  13. package/assets/github/.gitkeep +1 -0
  14. package/assets/github/harness.yml +37 -0
  15. package/assets/make/.gitkeep +1 -0
  16. package/assets/make/sdlc-harness.mk +39 -0
  17. package/assets/skills/context_development_engineer/SKILL.md +86 -0
  18. package/assets/skills/context_full_project_export/SKILL.md +55 -0
  19. package/assets/skills/context_product_plan/SKILL.md +85 -0
  20. package/assets/skills/context_uiux_design/SKILL.md +110 -0
  21. package/assets/tools/validate_context.py +276 -0
  22. package/dist/cli.d.ts +2 -0
  23. package/dist/cli.js +12 -0
  24. package/dist/commands/doctor.d.ts +1 -0
  25. package/dist/commands/doctor.js +16 -0
  26. package/dist/commands/export-context.d.ts +1 -0
  27. package/dist/commands/export-context.js +149 -0
  28. package/dist/commands/index.d.ts +3 -0
  29. package/dist/commands/index.js +33 -0
  30. package/dist/commands/init.d.ts +3 -0
  31. package/dist/commands/init.js +108 -0
  32. package/dist/commands/package-source.d.ts +1 -0
  33. package/dist/commands/package-source.js +24 -0
  34. package/dist/commands/sync.d.ts +1 -0
  35. package/dist/commands/sync.js +14 -0
  36. package/dist/commands/upgrade.d.ts +1 -0
  37. package/dist/commands/upgrade.js +7 -0
  38. package/dist/commands/validate.d.ts +1 -0
  39. package/dist/commands/validate.js +14 -0
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.js +1 -0
  42. package/dist/lib/config.d.ts +5 -0
  43. package/dist/lib/config.js +52 -0
  44. package/dist/lib/constants.d.ts +3 -0
  45. package/dist/lib/constants.js +3 -0
  46. package/dist/lib/context-export.d.ts +21 -0
  47. package/dist/lib/context-export.js +845 -0
  48. package/dist/lib/context-manifest.d.ts +3 -0
  49. package/dist/lib/context-manifest.js +103 -0
  50. package/dist/lib/context-templates.d.ts +5 -0
  51. package/dist/lib/context-templates.js +204 -0
  52. package/dist/lib/design-md.d.ts +2 -0
  53. package/dist/lib/design-md.js +132 -0
  54. package/dist/lib/doctor.d.ts +6 -0
  55. package/dist/lib/doctor.js +41 -0
  56. package/dist/lib/fs.d.ts +8 -0
  57. package/dist/lib/fs.js +56 -0
  58. package/dist/lib/harness-root.d.ts +9 -0
  59. package/dist/lib/harness-root.js +50 -0
  60. package/dist/lib/init.d.ts +5 -0
  61. package/dist/lib/init.js +65 -0
  62. package/dist/lib/managed-file.d.ts +19 -0
  63. package/dist/lib/managed-file.js +21 -0
  64. package/dist/lib/migrations.d.ts +11 -0
  65. package/dist/lib/migrations.js +180 -0
  66. package/dist/lib/package-json-config.d.ts +2 -0
  67. package/dist/lib/package-json-config.js +37 -0
  68. package/dist/lib/package-source.d.ts +8 -0
  69. package/dist/lib/package-source.js +124 -0
  70. package/dist/lib/paths.d.ts +5 -0
  71. package/dist/lib/paths.js +11 -0
  72. package/dist/lib/schema-guard.d.ts +3 -0
  73. package/dist/lib/schema-guard.js +28 -0
  74. package/dist/lib/sync-engine.d.ts +7 -0
  75. package/dist/lib/sync-engine.js +350 -0
  76. package/dist/lib/types.d.ts +21 -0
  77. package/dist/lib/types.js +1 -0
  78. package/dist/lib/upgrade.d.ts +1 -0
  79. package/dist/lib/upgrade.js +21 -0
  80. package/dist/lib/validators.d.ts +5 -0
  81. package/dist/lib/validators.js +459 -0
  82. package/dist/lib/yaml.d.ts +2 -0
  83. package/dist/lib/yaml.js +7 -0
  84. package/migrations/README.md +3 -0
  85. package/package.json +68 -0
  86. package/source-mappings.yaml +25 -0
@@ -0,0 +1,58 @@
1
+ # Minimal Context Harness Protocol
2
+
3
+ 本项目使用 Minimal Context Harness。Harness 只维护上下文质量,不替项目证明产品质量。
4
+
5
+ ## AGENTS.md 定位
6
+
7
+ - `AGENTS.md` 是 agent 启动路由器和硬边界,只放事实源入口、不可违反规则、关键触发器和最短验证入口。
8
+ - 长设计理由默认压缩进 `project_context/**`;若项目已有明确的本地 spec / design 文档,可按项目约定使用。角色流程 / checklist 放 Skills,人类使用说明放 README;新增 AGENTS 规则前优先压缩或替换旧规则,不默认追加。
9
+ - 建议把 AGENTS 主路径保持在约 40-70 行;这是软预算,不是 validator 或 CI gate。
10
+
11
+ ## Context 优先级阶梯
12
+
13
+ 1. 先读 `project_context/global.md`、`project_context/architecture.md` 和 `project_context/context.toml`,再按 graph 读取相关 area / context unit。
14
+ 2. 若任务涉及 Web 页面、前端布局、UI/UX、产品模块边界或信息放置,先做页面产品定位检查,再完成变更分类;若 UI 改动涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或加载/空态/错误态,按产品/UIUX Skill 的控件任务框架做轻量检查。
15
+ 3. 若任务新增、迁移或整理 Context 文件,先做 role placement scan:area 只代表产品域归属;contract / foundation / subdomain / verification / deployment / implementation-index / decision-rationale 等按读取目的拆成 role Context。
16
+ 4. 对产品方案、UI/UX、系统设计、架构边界、API / Schema、状态或运行语义、验证设计等任务,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 声明是否改变长期事实,再写本次 Task Contract。
17
+ 5. `Context Delta: required` 则 context-first;普通 bug fix、局部样式、局部漂移修复、测试修复或 spike 默认 code-first,但一旦产生长期结论必须回写 Context。
18
+ 6. 收尾做 Contract Conformance 和 Context drift check,只报告 `Context: 已更新 ...` 或 `Context: 本次无长期事实变化`;不要把一次性证据、任务契约或实现摘要写入 Context。
19
+
20
+ ## 事实源
21
+
22
+ - 项目全局上下文:`project_context/global.md`
23
+ - 架构上下文:`project_context/architecture.md`(克制、最小,只记录系统边界、组件关系和长期约束)
24
+ - Context 图谱:`project_context/context.toml`(Schema v4 默认事实源;声明产品域 area/context_unit、role、触发条件和按需读取策略)
25
+ - 产品域 / context unit 上下文:`project_context/areas/**/*.md`
26
+ - 产品质量事实:项目自己的代码、测试、smoke、CI、hidden probe 或人工验收
27
+
28
+ ## 工作规则
29
+
30
+ 1. 新会话或继续工作时,先读取 `project_context/global.md`、`project_context/architecture.md` 和 `project_context/context.toml`;按其中 default area 和触发条件读取相关 context。
31
+ 2. 第一处代码编辑前先做轻量变更分类,不按固定时长计时。若任务涉及 Web 页面、前端布局、UI/UX、产品模块边界或信息应该放在哪个页面 / 模块,先做页面产品定位检查,再完成变更分类:用户在这个页面要完成什么判断,产品必须提供哪些信息 / 动作 / 反馈,哪些信息不应常驻,哪些属于下游消费层 / 运维层 / 详情层 / 其他页面,当前布局和信息密度是否匹配页面任务。若 UI 改动涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或加载/空态/错误态,按产品/UIUX Skill 的控件任务框架做轻量检查,识别既有 Context 是否适用以及是否缺少长期页面/控件契约。多页面或多模块归属不清时,先审查全站或相关页面的信息架构,再收窄到代码模块实现。该检查是判断是否需要 context-first 的输入,不等于必须更新 Context,也不要求独立文档或新的 gate。
32
+ 3. 对产品方案、UI/UX、系统设计、架构边界、API / Schema、状态机或运行语义、验证设计等任务,第一处代码编辑前先编译当前任务契约:用 `Context Delta: none|required` 作为唯一正式长期事实判断点,再写本次 Task Contract(目标、边界、状态、反馈、非目标和验收信号)。普通 bug fix、局部样式、小重构、局部漂移修复、测试修复或 spike 不强制编译任务契约。
33
+ 4. 当新增、迁移或整理 `project_context/areas/**` 时,做 role placement scan(软约束,不做 gate):`area` / `domain` 保留产品域归属,`subdomain` 用于产品域内较小 ownership,`contract` 用于 API / schema / event / 跨域接口语义,`foundation` 用于稳定理论 / 词汇 / 背景材料,`verification` / `deployment` 用于可复用执行路径,`implementation-index` 只做代码导航索引,`decision-rationale` 记录稳定设计原因,`archive` 用于非默认读取的历史或外部材料。
34
+ 5. 若任务契约声明 `Context Delta: required`,默认走 context-first:第一处代码编辑前先更新相关 `project_context/**`,写入必要且足以指导实现的长期结论,再按 Context 和 Task Contract 对齐实现、验证和收尾。
35
+ 6. 普通 bug fix、局部样式、局部实现漂移修复、测试修复或探索性 spike 不更新 Context,可先改代码;一旦形成长期结论,继续对齐或交付前必须回写 `project_context/**`。
36
+ 7. `project_context/**` 是项目意图、产品域职责、架构边界、集成方向、允许/禁止依赖、验证关键路径和部署关键路径的权威事实源;代码是当前实现状态的权威事实源。
37
+ 8. 当代码形态、搜索结果或相邻实现与 Context 声明冲突时,把差异视为实现漂移、缺失工作或 Context 过期并显式说明;不要用当前代码形态或关键词搜索结果覆盖 Context 已声明的职责、归属或集成意图。
38
+ 9. 每个有意义的方案或实现变更收尾时做 Contract Conformance 和 Context drift check:对照 Task Contract 区分实现偏差、契约遗漏或长期事实缺失;实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失回 `Context Delta` 并先更新 Context。交付说明只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`;Conformance 证据属于本次交付,不写入 `project_context/**`。
39
+ 10. 长期事实只写入 `project_context/**`;不要默认创建 PRD、tech plan、ADR、implementation doc、review/test/release 文档。
40
+ 11. 用户明确要求“产品方案 / 产品经理 / 产品专家”、“设计稿 / UI/UX 设计方案 / 视觉专家”或“开发工程师 / 技术方案 / 开发方案 / 实现 / 实现方案 / 实施计划 / 技术专家 / 多开agent / subagent”这类角色或强产物名时,使用对应 Context authoring Skill,把长期结论写回 `project_context/**`。
41
+ 12. 用户明确要求“导出尽可能详细的项目全量上下文 / 全量上下文导出 / full project context export / 当前项目代码实现 / 代码级实现导出”时,使用 `context_full_project_export` Skill;默认优先运行 `sdlc-harness export-context --all` 同时生成项目级 Context 汇总和代码级实现快照;只需要单份产物时再用 `--full` 或 `--code`;导出产物只放 `tmp/sdlc/context-exports/**`,不得放入或注册到 `project_context/**` / `project_context/context.toml`。
42
+ 13. 当任务涉及设计稿、重做设计、视觉方案、设计系统、visual polish、frontend redesign 或 frontend styling,且存在可扫描的 UI 代码、页面文件、构建产物目录或本地/远程 URL 时,默认运行 `npx impeccable detect <target>` 做 Impeccable 视觉审查;没有可扫描目标、命令不可用或扫描失败时,说明原因并继续。Impeccable 不是 `validate-context` gate,也不替代截图检查、项目测试或人工判断。
43
+ 14. SDLC / Harness managed surfaces 是生成资产:`AGENTS.md` managed block、`.agent/pjsdlc_managed/**`、`.agent/skills/context_product_plan/**`、`.agent/skills/context_uiux_design/**`、`.agent/skills/context_development_engineer/**` 和 `.agent/skills/context_full_project_export/**` 禁止承载项目特定规则;直接编辑会在 `sync` 时被覆盖或产生漂移。项目本地产品 / UIUX / 开发规则必须新建独立 Skill,例如 `.agent/skills/product_plan/SKILL.md`、`.agent/skills/uiux_design/SKILL.md` 或 `.agent/skills/development_engineer/SKILL.md`;当项目本地 Skill 与默认 Skill 同时适用时,优先使用更具体的项目本地 Skill。项目本地 Skill 的 front matter `description` 触发词应与本文件中的角色触发规则和对应默认 `context_*` Skill 保持一致;新增或收窄关键词时,同步更新本地 Skill 描述和项目级 agent 指引,避免 Skill 触发条件与 SDLC 工作规则漂移。
44
+ 15. ADR 降级为 Context 中的 `Design Rationale`;实现说明优先写成代码注释、测试名或模块 Context 中的关键约束。
45
+ 16. Harness workflow gate 只运行 `validate-context`,用于检查上下文是否可恢复;不检查 context/code 修改顺序。自动化最多提示 context-first 风险,不做阻断。
46
+ 17. 产品质量由项目自己的验证入口证明;Context 只能声明验证 / 部署关键路径,不能伪造“测试已通过”或“部署已成功”。
47
+ 18. Verification / Deployment Role Context 规则:area 是产品域归属;`verification` 和 `deployment` 是 area-owned 的按需读取角色,用来提高关键测试、smoke、CI、部署、云端初始化或运行拓扑路径的重复执行效率。Context 不记录一次性测试日志、完整命令输出、临时 JSON、CI artifact、测试报告、release ledger、secret、token、cookie、device id 或 raw payload;只记录特殊准备、最短命令或路径、预期阶段 / 信号、可接受 warning、已排除的重复探索点。跨产品域路径可放 project-level role Context,普通产品域路径放 owning area 下的 role Context。
48
+ 19. `sync` 只刷新 managed guidance、默认 Skill 和工具;不会合并 Skill override,也不会覆盖用户新建的独立项目本地 Skill。
49
+ 20. 普通项目默认只有一个 `main` area 和一个 `areas/main/verification.md`;monorepo 或 product-family 项目可在 `context.toml` 中增加多个产品域 `area` / `context_unit`,并用 `context_role` 或 manifest role 区分 `area`、`subdomain`、`contract`、`foundation`、`verification`、`deployment`、`archive`、`implementation-index` 和 `decision-rationale` 等不同 Context 类型。
50
+
51
+ ## 常用命令
52
+
53
+ - `make validate-context`:检查 `project_context/**` 是否足够支持 agent 恢复上下文。
54
+ - `make sdlc-sync`:刷新 managed guidance、Context template、默认 Skill 和工具。
55
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --all`:同时导出临时项目级 Context 汇总和代码级实现 Markdown 到 `tmp/sdlc/context-exports/**`。
56
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --full`:导出临时项目级 Context 汇总 Markdown 到 `tmp/sdlc/context-exports/**`。
57
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --code`:导出临时代码级实现 Markdown 到 `tmp/sdlc/context-exports/**`。
58
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness doctor`:临时诊断 canonical SDLC CLI;避免裸 `npx sdlc-harness` 解析到旧包名或旧本地缓存。
@@ -0,0 +1,31 @@
1
+ # Architecture Context
2
+
3
+ This is the restrained architecture context. Keep only facts that help a fresh agent recover system shape, boundaries and durable constraints quickly.
4
+
5
+ ## System Boundary
6
+
7
+ - Describe what is inside this project and what external systems, providers or runtime assumptions sit outside it.
8
+
9
+ ## Component Map
10
+
11
+ - List the smallest useful set of components, areas or context units and how they relate.
12
+
13
+ ## Data / Control Flow
14
+
15
+ - Summarize only the durable request, event, state or data flow that is hard to infer from code alone.
16
+
17
+ ## Design Rationale
18
+
19
+ - Record architecture-level choices that still constrain future work; architecture boundary changes should be captured here before implementation alignment.
20
+
21
+ ## Constraints And Tradeoffs
22
+
23
+ - Capture performance, safety, integration, deployment or maintainability constraints that matter for future changes.
24
+
25
+ ## Verification Implications
26
+
27
+ - List project-specific verification entry points affected by architectural changes; do not claim tests already passed.
28
+
29
+ ## Open Risks
30
+
31
+ - List unresolved architectural risks or unknowns.
@@ -0,0 +1,31 @@
1
+ # Area Context: main
2
+
3
+ ## Responsibility
4
+
5
+ - Describe this product/domain area or context unit's responsibility.
6
+
7
+ ## User / System Contract
8
+
9
+ - Describe the external behavior, API, CLI, UI, screen state, interaction or data contract. Contract changes should be captured here before implementation alignment.
10
+ - For UI/page areas, name the page responsibility, core user judgment, persistent information/actions/feedback, non-persistent information, and what belongs in downstream consumption, ops, detail or other surfaces when those facts are durable.
11
+
12
+ ## Core Data / API / State
13
+
14
+ - Summarize important data structures, APIs, state transitions or rules.
15
+
16
+ ## Key Constraints
17
+
18
+ - List constraints that are not obvious from code alone, including product rules, responsive/a11y needs or visual boundaries.
19
+
20
+ ## Code Entry Points
21
+
22
+ - `src/` or the concrete file/function entry points.
23
+
24
+ ## Related Role Context
25
+
26
+ - Verification paths live in this area's `verification` role Context, such as `project_context/areas/main/verification.md`.
27
+ - Deployment/runtime/bootstrap paths live in this area's optional `deployment` role Context when those facts exist.
28
+
29
+ ## Open Risks
30
+
31
+ - List unresolved risks or blockers.
@@ -0,0 +1,27 @@
1
+ # Schema v4 Minimal Context graph manifest.
2
+ # Keep the default product/domain area for ordinary projects. Role context nodes
3
+ # are read-purpose slices owned by an area or, only when cross-domain, by the project root.
4
+ # When migrating deep files under project_context/areas/**, refine obvious
5
+ # contract/foundation/subdomain/verification/deployment/implementation-index/
6
+ # decision-rationale/archive files into [[context]] entries instead of keeping
7
+ # every Markdown file as an [[areas]] product owner.
8
+
9
+ [[areas]]
10
+ id = "main"
11
+ root = "."
12
+ context = "project_context/areas/main.md"
13
+ kind = "app"
14
+ default = true
15
+
16
+ [[context]]
17
+ path = "project_context/areas/main/verification.md"
18
+ role = "verification"
19
+ read_policy = "default"
20
+ triggers = ["test", "verify", "verification", "smoke", "ci"]
21
+
22
+ # Example optional node:
23
+ # [[context]]
24
+ # path = "project_context/areas/main/deployment.md"
25
+ # role = "deployment"
26
+ # read_policy = "on-demand"
27
+ # triggers = ["deploy", "deployment", "runtime", "cloud", "docker"]
@@ -0,0 +1,35 @@
1
+ # Deployment Context: main
2
+
3
+ This optional role Context records critical repeat-execution paths for deploy, runtime bootstrap, cloud initialization and operational recovery. Keep it minimal and durable.
4
+
5
+ ## Owner
6
+
7
+ - Owning area: `main`.
8
+
9
+ ## Runtime Topology
10
+
11
+ - List durable service distribution only when it matters for rerunning deploy or bootstrap, such as Web/API/worker/Redis/DB/Docker/cloud instance boundaries.
12
+
13
+ ## Deployment Paths
14
+
15
+ - List the shortest deploy, CI/CD, bootstrap, migration, health-check or rollback/degradation command/path.
16
+
17
+ ## Required Preparation
18
+
19
+ - List only durable setup such as cloud resources, env files, compose profiles, secret mounting names or database initialization steps. Do not store secret values.
20
+
21
+ ## Expected Signals
22
+
23
+ - Name health checks, status transitions, URLs, queues, containers or logs-at-a-glance that show the path reached the intended stage.
24
+
25
+ ## Acceptable Warnings
26
+
27
+ - List known benign warnings or slow-start states.
28
+
29
+ ## Excluded Dead Ends
30
+
31
+ - List previously ruled-out deploy/bootstrap paths only when remembering them prevents repeated wasted work.
32
+
33
+ ## Forbidden Content
34
+
35
+ - Do not record one-off logs, full command output, CI artifacts, release ledgers, secrets, tokens, cookies, device ids, raw payloads or claims that deployment already succeeded.
@@ -0,0 +1,53 @@
1
+ # Project / Delivery Context
2
+
3
+ ## Project Goal
4
+
5
+ - Describe the user-visible goal this project is trying to achieve.
6
+
7
+ ## Non-goals / Boundaries
8
+
9
+ - List what this project intentionally does not do.
10
+
11
+ ## Background
12
+
13
+ - Capture the minimum background a fresh agent needs before changing code.
14
+
15
+ ## Design Rationale
16
+
17
+ - Record durable choices that are hard to infer from code or tests. Classify changes before implementation; if a change alters product ownership/plans, module responsibilities, information architecture, API/Schema, state/scheduler semantics, cross-area boundaries, verification role paths or deployment role paths, update Context before code with enough durable context to guide implementation.
18
+
19
+ ## Architecture Context
20
+
21
+ - Link to `project_context/architecture.md`; keep architecture notes minimal and focused on boundaries, components and constraints that are not obvious from code.
22
+
23
+ ## Context Graph
24
+
25
+ - Link to `project_context/context.toml` and keep its default area, role, trigger, read policy and boundary metadata aligned with this Context.
26
+ - When adding or reorganizing files under `project_context/areas/**`, run a soft role placement scan before registering every Markdown file as an area: product ownership stays in `area` / `domain` / `subdomain`; contracts, foundations, verification, deployment, implementation indexes, decision rationale and archives should use role Context when that better fits the reading purpose.
27
+
28
+ ## Product / Delivery Brief
29
+
30
+ - Capture durable product goals, users, core flows, acceptance signals and non-goals.
31
+
32
+ ## UX / Screen Brief
33
+
34
+ - Capture durable screen, flow, interaction, responsive and accessibility facts. Use `DESIGN.md` for visual identity and design tokens when needed.
35
+ - For web/front-end surfaces, record durable page responsibilities, core user judgments, persistent information boundaries and cross-page or cross-layer ownership when they guide future changes.
36
+
37
+ ## Verification Entry Points
38
+
39
+ - Point to the default verification context for repeatable test, smoke, CI or validation paths.
40
+ - Project-level cross-domain verification may live here only as a short index; execution details belong in `verification` role Context.
41
+
42
+ ## Current State
43
+
44
+ - Summarize what is implemented, blocked or risky right now.
45
+
46
+ ## Next Safe Action
47
+
48
+ - State the safest next step for a fresh agent, including whether the next change should update Context before code.
49
+
50
+ ## Context Index
51
+
52
+ - [main](areas/main.md)
53
+ - [main verification](areas/main/verification.md)
@@ -0,0 +1,31 @@
1
+ # Verification Context: main
2
+
3
+ This role Context records critical repeat-execution paths for the owning area. Keep it minimal: enough for a future agent to rerun verification without rediscovering setup, not a test report.
4
+
5
+ ## Owner
6
+
7
+ - Owning area: `main`.
8
+
9
+ ## Verification Paths
10
+
11
+ - `npm test` or the shortest project-specific test, smoke, CI, probe or validation command.
12
+
13
+ ## Required Preparation
14
+
15
+ - List only durable setup such as services, env files, fixtures, local runtimes or external dependencies needed before rerun.
16
+
17
+ ## Expected Signals
18
+
19
+ - Name the stage, health check, status, artifact shape or observable signal that means the path reached the intended point.
20
+
21
+ ## Acceptable Warnings
22
+
23
+ - List warnings that are expected and should not trigger repeated investigation.
24
+
25
+ ## Excluded Dead Ends
26
+
27
+ - List previously ruled-out commands, providers, endpoints or setup paths only when remembering them prevents repeated wasted work.
28
+
29
+ ## Forbidden Content
30
+
31
+ - Do not record one-off logs, full command output, temporary JSON, CI artifacts, test reports, secrets, tokens, cookies, device ids, raw payloads or pass/fail claims.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,37 @@
1
+ # pjsdlc:sdlc-harness:github-workflow:begin
2
+ name: Harness Gates
3
+
4
+ on:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+ workflow_dispatch:
10
+ inputs:
11
+ gate:
12
+ description: "Make target to run"
13
+ required: true
14
+ default: "validate-context"
15
+ type: choice
16
+ options:
17
+ - validate-context
18
+ - validate-harness
19
+
20
+ jobs:
21
+ harness:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - uses: actions/setup-node@v4
26
+ with:
27
+ node-version: "24"
28
+ - name: Prepare source workspace CLI
29
+ if: ${{ hashFiles('packages/sdlc-harness/package.json') != '' }}
30
+ run: |
31
+ npm ci
32
+ npm run build --workspace project-tiny-context-harness
33
+ - name: Run harness gate
34
+ run: make "${HARNESS_GATE}"
35
+ env:
36
+ HARNESS_GATE: ${{ github.event.inputs.gate || 'validate-context' }}
37
+ # pjsdlc:sdlc-harness:github-workflow:end
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,39 @@
1
+ PYTHON ?= python3
2
+ SDLC_HARNESS ?= $(if $(wildcard packages/sdlc-harness/dist/cli.js),node packages/sdlc-harness/dist/cli.js,npx --yes --package project-tiny-context-harness@latest sdlc-harness)
3
+
4
+ .PHONY: help sdlc-doctor sdlc-sync sdlc-upgrade validate-context validate-harness lint test-current-domain test-all build
5
+
6
+ help:
7
+ @echo "Minimal Context Harness commands"
8
+ @echo " make sdlc-doctor Diagnose Harness root, core package and schema version"
9
+ @echo " make sdlc-sync Refresh managed guidance, Context templates, default Skills and tools"
10
+ @echo " make sdlc-upgrade Run safe upgrade migrations and refresh managed assets"
11
+ @echo " make validate-context Check whether project_context/** supports context recovery"
12
+ @echo " make validate-harness Compatibility alias for validate-context"
13
+ @echo " make test-all Run the project regression suite after replacing this placeholder"
14
+
15
+ sdlc-doctor:
16
+ $(SDLC_HARNESS) doctor
17
+
18
+ sdlc-sync:
19
+ $(SDLC_HARNESS) sync
20
+
21
+ sdlc-upgrade:
22
+ $(SDLC_HARNESS) upgrade
23
+
24
+ validate-context:
25
+ $(SDLC_HARNESS) validate-context
26
+
27
+ validate-harness: validate-context
28
+
29
+ lint:
30
+ @echo "No project lint command configured yet. Replace this target with your stack-specific lint command."
31
+
32
+ test-current-domain:
33
+ @echo "No domain test command configured yet. Replace this target with focused tests for the current change."
34
+
35
+ test-all:
36
+ @echo "No full test command configured yet. Replace this target with the project regression suite."
37
+
38
+ build:
39
+ @echo "No build command configured yet. Replace this target with the project build/package command."
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: context_development_engineer
3
+ description: Use when the user explicitly asks for 开发工程师, 软件工程师, 研发工程师, 开发专家, 工程专家, 技术专家, 开发方案, 研发方案, 工程方案, 技术方案, 实现, 实现方案, 实施计划, 多开agent, subagent, software engineer, senior engineer, engineering expert, development plan, engineering plan, or technical implementation plan in a Minimal Context Harness project. Do not trigger for routine coding, bug fixes, small refactors, package/release work, or generic mentions of code, development, or engineering.
4
+ ---
5
+
6
+ # Context Development Engineer
7
+
8
+ ## Package-Managed Boundary
9
+
10
+ This Skill is generated by `sdlc-harness sync` and owned by the Harness package. Do not edit the generated `context_development_engineer` Skill directly.
11
+
12
+ Project-specific engineering rules belong in a separate project-local Skill under `<harnessRoot>/skills/development_engineer/SKILL.md`. When a project-local Skill and this package-managed Skill both apply, use the more specific project-local Skill as the primary instruction source while keeping durable conclusions in `project_context/**`. Keep the project-local Skill front matter `description` trigger keywords aligned with this package-managed Skill and the project `AGENTS.md` role-trigger rule; if the project adds or narrows trigger terms, update both places together so agent activation and SDLC guidance do not drift apart.
13
+
14
+ ## 目标
15
+
16
+ 帮助 agent 以开发工程师 / 技术专家视角完成实现判断,并把长期工程事实压缩进可恢复的 Minimal Context。
17
+
18
+ ## 工作方式
19
+
20
+ 1. 先读取 `project_context/global.md`、`project_context/architecture.md` 和 `project_context/context.toml`,按 default area、triggers、read_when 选择相关 context。
21
+ 2. 先确认用户目标、约束、成功标准、影响产品域、现有验证 / 部署关键路径和风险;能从代码或 Context 发现的事实不要反复询问用户。
22
+ 3. `project_context/**` 决定“应该是什么”:模块职责、归属、架构边界、接口方向、契约语义和禁止依赖;代码决定“现在实现到了哪里”。代码不能静默重定义 Context。
23
+ 4. 第一处代码编辑前,若任务涉及系统设计、技术方案、架构边界、产品域职责、跨域依赖、API / Schema、数据契约、状态机或运行语义、验证关键路径或部署关键路径,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`。
24
+ 5. 普通 bug fix、局部样式、局部实现漂移修复、测试修复或探索性 spike 不更新 Context,可先改代码;一旦形成长期工程结论,继续对齐或交付前必须回写 Context。不要把 Context 机械补成代码改动摘要。
25
+ 6. 如果代码、搜索结果或相邻实现与 Context 冲突,显式标记为实现漂移、缺失工作或 Context 过期,不要用当前代码形态反推模块归属。
26
+ 7. 涉及已有 Context 的实现判断,先做轻量对齐:
27
+ - Context expectation
28
+ - Current code evidence
29
+ - Gap
30
+ - Proposed change
31
+ 8. 涉及 UI surface、表单/配置、输入、选择、搜索、筛选、调度/时间、预算/配额/限流或状态反馈的实现方案时,检查当前代码是否只是暴露字段,还是满足了已有 Context、页面职责和控件任务框架;实现收尾要能给出简短 Context Conformance 证据。
32
+ 9. 实现时保持精准修改,优先遵循仓库现有框架、接口、测试和代码风格。
33
+ 10. 当用户明确要求 / 允许“多开agent”或使用 subagent,且当前会话存在可用 subagent 工具时,积极把可并行的探索、审查或实现拆分交给 subagent;使用前先复用已有相关 agent,没有合适 agent 或并行度不足时再新开。`wait_agent` 只表示取得结果,不释放资源;subagent 完成、空闲或不再需要时必须调用 `close_agent`,收尾前清理已完成 / 空闲 / 不再需要的 subagent,避免占满后续资源。
34
+ 11. 当任务涉及新实现、重构、重复逻辑、模块边界或影响面控制时,先做轻量 abstraction / decomposition scan:
35
+ - 查找相似实现、重复逻辑、紧耦合模块或影响面异常扩散点。
36
+ - 将候选项分为局部重构与长期边界变化,后者按既有 Context-first 规则处理。
37
+ - 对候选点说明当前重复 / 耦合证据、抽象后的边界、收益、风险和是否值得现在做。
38
+ - 默认只实施高收益、低风险、语义稳定的候选项。
39
+ - 不为一次性代码、不稳定语义或纯粹好看的架构做抽象。
40
+ 12. 需要沉淀长期事实时,只更新 `project_context/**`:
41
+ - 全局工程取舍、跨产品域索引或当前状态写入 `global.md`。
42
+ - 产品域 API、数据契约、关键约束、入口和风险写入对应 area / subdomain Context。
43
+ - 跨域接口语义写入 `context_role: contract` 或 manifest role 为 `contract` 的 Context;关键重复验证路径写入 `verification`;关键部署、运行拓扑或云端初始化路径写入 `deployment`;代码入口索引用 `implementation-index`;底层理论源用 `foundation`;历史归档索引用 `archive`。
44
+ - 新 context unit 可新增 `project_context/areas/<unit>.md`,并更新 `global.md#Context Index`;复杂项目同时更新 `project_context/context.toml`。
45
+ - 如果 `upgrade` 自动把深层 `.md` 注册成 area,但语义上更像 foundation / contract / archive,后续应显式调整 manifest role;不要依赖自动迁移判断语义。
46
+ 13. 实现收尾时做 `Contract Conformance` 和 Context drift check:确认代码没有引入未沉淀的长期事实,且 Context 没有退化成普通实现摘要;交付说明只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`。Conformance 说明本次契约满足情况、未满足或延期项和验证入口;一次性证据、截图结果、测试日志、任务契约和实现摘要不写入 Context。
47
+ 14. Context 只能声明验证 / 部署关键路径或验收信号,不能伪造“测试已通过”或“部署已成功”。
48
+ 15. Verification / Deployment Role Context 只记录长期可复用的重复执行路径事实:特殊准备、最短命令或路径、预期阶段 / 信号、可接受 warning、已排除的重复探索点。不要记录一次性测试日志、完整输出、临时 JSON、CI artifact、测试报告、release ledger、secret、token、cookie、device id 或 raw payload。
49
+
50
+ ## UI 实现对齐
51
+
52
+ - UI 实现方案不只检查字段是否接上,还要检查控件是否支持用户任务、输入语义、反馈状态、错误恢复和已有页面/控件契约。
53
+ - 当 current code evidence 显示后端字段、枚举或自由输入直接暴露给用户时,不默认把它当作产品意图;先对照 Context、产品/UIUX Skill 的控件任务框架和项目组件体系判断是否是实现漂移或缺失契约。
54
+ - Contract Conformance 证据应短而具体:命中的已有 Context / 页面契约或 Task Contract、实现如何满足、未满足或延期项、验证入口或手动检查。它属于交付说明,不属于 `project_context/**`。
55
+
56
+ ## 任务契约编译
57
+
58
+ - 任务契约是当前工程任务的编译产物,不是事实源、tech plan、ADR、implementation doc 或长期 Context;默认留在方案、交付说明或 PR 文本中。
59
+ - `Context Delta` 必须先出现,取值为 `none` 或 `required`:
60
+ - `none`:本次只是按既有 Context / 架构原则落地,不新增长期事实。
61
+ - `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
62
+ - `Task Contract` 用短列表说明 capability、owner、upstream / downstream、allowed / forbidden dependency、input / output / state / persistence、failure / retry / timeout / degraded / recovery、observability、performance、security、non-goals 和 verification path。
63
+ - 对长任务、多模块、多 agent、容易发生 `Context Delta` 调头或多轮验证的任务,可以用 `plan.md` 或等价临时计划面暂存 `Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
64
+ - `plan.md` 中出现的长期工程事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
65
+ - `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
66
+ - `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失回 `Context Delta` 并先更新 Context。
67
+ - 不为普通代码修改、bug fix、小重构、package/release 处理、测试修复或探索性 spike 强制编译任务契约。
68
+
69
+ ## 输出边界
70
+
71
+ - 不默认创建 `.work_products/**`、tech plan、ADR、implementation doc、review/test/release 文档。
72
+ - 不要求 lifecycle phase、plan task、phase gate 或阶段 Skill。
73
+ - 如果用户明确要求独立开发方案、技术方案或实现说明,可以临时生成;长期事实仍要提炼回 `project_context/**`。
74
+ - 如果用户只是要求普通代码修改、修 bug、小重构、package/release 处理,或只是泛泛提到“代码 / 开发 / engineering”,不需要触发本 Skill;只有明确角色名或强相关产物名指向工程方案、实现方案、实施计划、技术判断或长期工程事实沉淀时才使用。
75
+
76
+ ## 建议沉淀位置
77
+
78
+ - `global.md#Design Rationale`:跨模块工程取舍。
79
+ - `global.md#Current State`:影响后续恢复的实现状态。
80
+ - `areas/*.md#User / System Contract`:模块可见行为、API、CLI、UI 或数据契约。
81
+ - `areas/*.md#Core Data / API / State`:关键数据结构、接口、状态流或规则。
82
+ - `areas/*.md#Key Constraints`:性能、安全、兼容、集成或维护约束。
83
+ - `areas/*.md#Code Entry Points`:未来 agent 需要快速定位的代码入口。
84
+ - `areas/*/verification.md` 或 role=`verification` Context:关键测试、smoke、CI、probe 或验证重复执行路径。
85
+ - `areas/*/deployment.md` 或 role=`deployment` Context:关键部署、云端初始化、运行拓扑、健康检查或回滚重复执行路径。
86
+ - `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: context_full_project_export
3
+ description: Use when the user explicitly asks to 导出尽可能详细的项目全量上下文, 全量上下文导出, 项目上下文全量导出, full project context export, export full project context, project context export, 当前项目代码实现, 代码级实现导出, or code-level implementation export in a Minimal Context Harness project.
4
+ ---
5
+
6
+ # Context Full Project Export
7
+
8
+ ## Package-Managed Boundary
9
+
10
+ This Skill is generated by `sdlc-harness sync` and owned by the Harness package. Do not edit the generated `context_full_project_export` Skill directly.
11
+
12
+ This Skill creates a temporary export artifact only. It does not author durable Context and does not change `project_context/context.toml`.
13
+
14
+ ## Purpose
15
+
16
+ When the user needs a full project context export, create a temporary Markdown bundle that collects project Context, key agent guidance, architecture/module facts and useful entry points for copying into an external tool or one-off discussion.
17
+
18
+ When the user needs a code-level implementation export, create one temporary Markdown snapshot of current source and engineering configuration files for upload to Web GPT or another external model.
19
+
20
+ ## Workflow
21
+
22
+ 1. Prefer the package CLI to generate both temporary artifacts in one command. Do not hand-write tracked export documents:
23
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --all`
24
+ 2. Use `--full` when only the project Context bundle is needed:
25
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --full`
26
+ 3. Use `--code` when only the code-level implementation snapshot is needed. It generates one Markdown file by default:
27
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --code`
28
+ 4. Custom output paths are allowed only for single-artifact modes and must stay under the temporary export directory. `--all` does not accept `--output`:
29
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --full --output tmp/sdlc/context-exports/my-export.md`
30
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --code --output tmp/sdlc/context-exports/my-code-export.md`
31
+ 5. Use dry-run mode to inspect planned sources before writing:
32
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --all --check`
33
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --full --check`
34
+ - `npx --yes --package project-tiny-context-harness@latest sdlc-harness export-context --code --check`
35
+ 6. After exporting, report artifact paths, source counts and warnings to the user. Do not summarize export contents back into Context.
36
+
37
+ ## Output Boundaries
38
+
39
+ - Export artifacts must remain temporary export artifacts, not Context.
40
+ - `--full` defaults to `tmp/sdlc/context-exports/full-project-context-<timestamp>.md`.
41
+ - `--code` defaults to `tmp/sdlc/context-exports/code-level-implementation-<timestamp>/code-level-implementation.md`.
42
+ - `--all` generates both default artifacts with the same timestamp.
43
+ - `--all` does not accept `--output`; custom filenames are supported only for `--full` or `--code`.
44
+ - `--code` creates one Markdown file, not shards or `all.md`.
45
+ - Do not output to `project_context/**`.
46
+ - Do not modify `project_context/context.toml`.
47
+ - Do not register export artifacts as `[[context]]`, `implementation-index` or any Context graph node.
48
+ - Do not write tracked docs; if the user asks for an ordinary docs path, redirect to `tmp/sdlc/context-exports/**`.
49
+ - Export contents may include redaction warnings; do not bypass secret/token/cookie/password/api_key filtering.
50
+
51
+ ## Handoff
52
+
53
+ - Report `Export: generated <path>` or `Export: check completed; no files written`.
54
+ - If the CLI rejects an output path, explain that this prevents temporary exports from polluting durable fact sources and suggest `tmp/sdlc/context-exports/<name>.md`.
55
+ - Context drift check should be `Context: no durable project facts changed` unless the task also changes Harness rules.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: context_product_plan
3
+ description: Use when the user explicitly asks for 产品方案, 产品经理, 产品专家, 需求方案, 功能方案, 业务规则方案, 用户故事方案, 验收标准方案, 产品规划方案, product plan, product manager, product expert, product spec, or PM spec in a Minimal Context Harness project. Do not trigger for ordinary coding, debugging, package work, or generic mentions of 产品, product, or requirements.
4
+ ---
5
+
6
+ # Context Product Plan
7
+
8
+ ## Package-Managed Boundary
9
+
10
+ This Skill is generated by `sdlc-harness sync` and owned by the Harness package. Do not edit the generated `context_product_plan` Skill directly.
11
+
12
+ Project-specific product planning rules belong in a separate project-local Skill under `<harnessRoot>/skills/product_plan/SKILL.md`. When a project-local Skill and this package-managed Skill both apply, use the more specific project-local Skill as the primary instruction source while keeping durable conclusions in `project_context/**`. Keep the project-local Skill front matter `description` trigger keywords aligned with this package-managed Skill and the project `AGENTS.md` role-trigger rule; if the project adds or narrows trigger terms, update both places together so agent activation and SDLC guidance do not drift apart.
13
+
14
+ ## 目标
15
+
16
+ 帮助 agent 把产品方案收敛成可恢复的 Minimal Context。
17
+
18
+ ## 工作方式
19
+
20
+ 1. 先读取 `project_context/global.md` 和 `project_context/context.toml`,按 default area、triggers、read_when 选择相关 context。
21
+ 2. 和用户澄清或整理:目标用户、产品/页面定位、核心问题、用户需要什么、产品需要提供的内容/能力/反馈、主要流程、验收信号、非目标、约束、风险和受影响模块。
22
+ 3. 涉及 Web 页面、前端布局、UI/UX、产品模块边界或信息放置时,把页面产品定位检查作为前置动作:用户在页面要完成的判断、产品必须提供的信息/动作/反馈、不应常驻的信息、下游消费层/运维层/详情层/其他页面归属、布局和信息密度是否匹配页面任务。多页面或多模块归属不清时,先读取相关 Context 并搜索页面入口,做全站或相关页面的信息架构 sweep,再收窄到具体实现。该检查是下一步变更分类的输入;只有形成长期产品归属、页面职责、信息架构或模块边界结论时才更新 Context。
23
+ 4. 涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或加载/空态/错误态等 UI 控件时,用“控件任务框架”重新理解用户任务和产品反馈;这只是通用判断框架,不是业务处方库。
24
+ 5. 产品意图、模块职责、边界和验收口径以 `project_context/**` 为准;代码和搜索结果只说明当前实现状态。Context 决定“应该是什么”,代码揭示“现在是什么”,代码不能静默重定义 Context。
25
+ 6. 输出产品判断或第一处实现编辑前,若任务涉及产品方案、页面/模块边界、信息架构、API / Schema、验收口径、跨域契约、状态或调度语义,先编译当前任务契约;契约第一段用 `Context Delta: none|required` 完成唯一正式长期事实判断,再写本次 `Task Contract`。
26
+ 7. 普通 bug fix、局部样式、局部实现漂移、测试修复或探索性 spike 不更新 Context;如果过程中形成长期产品结论,应在继续对齐或交付前回写 Context。不要把 Context 机械补成代码改动摘要。
27
+ 8. 如果代码与 Context 冲突,显式标记为实现漂移、缺失工作或 Context 过期。
28
+ 9. 输出产品判断时保持短而具体,避免长篇 PRD 模板。
29
+ 10. 需要沉淀长期事实时,只更新 `project_context/**`:
30
+ - 全局产品目标、边界、背景写入 `global.md`。
31
+ - 产品域用户/系统契约、规则、风险写入对应 area / subdomain Context。
32
+ - 跨域契约写入 `context_role: contract` 或 manifest role 为 `contract` 的 Context;底层理论源写入 `foundation`,关键重复验证路径写入 `verification`,关键部署/运行初始化路径写入 `deployment`,历史索引写入 `archive`,不要伪装成 area。
33
+ - 新 context unit 可新增 `project_context/areas/<unit>.md`,并更新 `global.md#Context Index`;复杂项目同时更新 `project_context/context.toml`。
34
+ - 如果 `upgrade` 自动把深层 `.md` 注册成 area,但语义上更像 foundation / contract / archive,后续应显式调整 manifest role;不要依赖自动迁移判断语义。
35
+ 11. Context 只能声明验证 / 部署关键路径或验收信号,不能伪造“测试已通过”或“部署已成功”。
36
+ 12. Verification / Deployment Role Context 只记录长期可复用的重复执行路径事实:特殊准备、最短命令或路径、预期阶段 / 信号、可接受 warning、已排除的重复探索点。不要记录一次性测试日志、完整输出、临时 JSON、CI artifact、测试报告、release ledger、secret、token、cookie、device id 或 raw payload。
37
+ 13. 收尾时做 `Contract Conformance` 和 Context drift check,只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`。Conformance 说明本次契约满足情况、未满足或延期项和验证入口;一次性证据、测试日志、截图结果、任务契约和实现摘要不写入 Context。
38
+
39
+ ## 任务契约编译
40
+
41
+ - 任务契约是当前任务的编译产物,不是事实源、PRD、ADR 或长期文档;默认留在方案、交付说明或 PR 文本中。
42
+ - `Context Delta` 必须先出现,取值为 `none` 或 `required`:
43
+ - `none`:本次只是按既有 Context / 原则落地,不新增长期事实。
44
+ - `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
45
+ - `Task Contract` 用短列表说明本次产品实现必须满足的目标、用户任务、信息 / 动作 / 状态 / 反馈、边界、非目标和验收信号。
46
+ - 对长任务、多模块、多 agent、容易发生 `Context Delta` 调头或多轮验证的任务,可以用 `plan.md` 或等价临时计划面暂存 `Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
47
+ - `plan.md` 中出现的长期事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
48
+ - `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
49
+ - `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失回 `Context Delta` 并先更新 Context。
50
+ - 不为普通 bug fix、局部样式、小重构、局部实现漂移、测试修复或探索性 spike 强制编译任务契约。
51
+
52
+ ## 产品体验校准
53
+
54
+ - 做页面、模块或入口规划时,先回答产品或页面定位是什么、要解决什么问题、需要提供什么给用户;再回答放什么、放哪里、为什么。这是页面变更前置判断,不是实现后的视觉润色。优先保留能帮助目标用户判断状态、采取行动、定位下一步或理解风险的信息。
55
+ - 信息归属按使用场景决定:高频且跨页面的动作优先考虑系统级区域;模块动作放模块内部;运维、连接、缓存、后台任务等内部状态只有在影响用户判断或行动时才进入主界面,否则放运维/详情区域;低频解释放 Context、文档、帮助或详情,不默认占据主界面。
56
+ - 首页、总览或入口页应服务产品定位下的核心使用路径和核心判断,不要为了证明系统层级完整而重复导航、堆叠入口、保留空指标槽或展示实现来源说明。
57
+ - 产品文案面向真实用户,直白、行动优先;除产品名、协议、字段名、ID、调试 JSON 等必要专有名词外,普通按钮、筛选、状态、空态、警告和说明优先使用用户熟悉的语言。
58
+ - 空态和数据要求真实:没有数据就显示真正空态,筛选无结果与系统无数据要区分,API/连接失败用用户能理解的状态表达,技术细节放到运维或详情里。
59
+
60
+ ## 控件任务框架
61
+
62
+ - 当产品界面涉及输入、选择、搜索、筛选、表单/配置、调度/时间窗口、预算/配额/限流或状态反馈时,先把控件还原成用户任务:用户要判断什么、选择什么、提交什么或规避什么风险。
63
+ - 先判断数据语义,再选交互:自由文本、枚举、实体选择、时间/区间、数量/预算、规则配置和内部开关对应不同的理解成本、错误成本和验证需求。
64
+ - 明确用户确认自己“选对了/填对了/可以继续”的反馈:加载中、无结果、无数据、连接失败、校验失败、保存成功和风险提示要能被用户区分。
65
+ - 对数量、预算、配额、限流、调度和时间类字段,判断是否需要单位、范围、默认值、示例、推荐值、成本/风险/影响说明;只记录稳定业务结论,不把一次性解释写进 Context。
66
+ - 检查用户可见语言是否面向任务,而不是后端字段名、数据库列或内部枚举直出;必要技术细节放到详情、帮助、运维或调试视图。
67
+ - 如果选择自由输入,必须判断错误成本、校验反馈和恢复路径是否可接受;如果不可接受,应形成更明确的输入约束或控件契约。
68
+ - 这些问题是通用产品判断,不是固定控件处方。业务特定答案进入项目 Context 或项目本地 Skill;本次实现如何满足既有约束只写在交付说明。
69
+
70
+ ## 输出边界
71
+
72
+ - 不默认创建 `.work_products/**`、PRD、tech plan、ADR、implementation doc、review/test/release 文档。
73
+ - 不要求 lifecycle phase、plan task、phase gate 或阶段 Skill。
74
+ - 如果用户明确要求独立方案文档,可以临时生成;长期事实仍要提炼回 `project_context/**`。
75
+ - 如果用户只是要求实现功能、修 bug、调整代码、处理 package/release,或只是泛泛提到“产品 / product / requirements”,不需要触发本 Skill;只有明确角色名或强相关产物名指向产品判断、需求整理、验收口径或长期产品事实沉淀时才使用。
76
+
77
+ ## 建议沉淀位置
78
+
79
+ - `global.md#Product / Delivery Brief`:项目级产品目标、用户、核心流程和非目标。
80
+ - `global.md#Design Rationale`:长期产品取舍。
81
+ - `areas/*.md#User / System Contract`:产品域可见行为、API、CLI、UI 或数据契约。
82
+ - `areas/*.md#Key Constraints`:业务规则、边界、风险和不易从代码看出的约束。
83
+ - `areas/*/verification.md` 或 role=`verification` Context:关键测试、smoke、CI、probe 或验证重复执行路径。
84
+ - `areas/*/deployment.md` 或 role=`deployment` Context:关键部署、云端初始化、运行拓扑、健康检查或回滚重复执行路径。
85
+ - `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。