project-tiny-context-harness 0.2.54 → 0.2.56
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/LICENSE +21 -21
- package/README.md +266 -243
- package/assets/README.md +302 -279
- package/assets/README.zh-CN.md +8 -6
- package/assets/agents/.gitkeep +1 -1
- package/assets/agents/AGENTS_CORE.md +56 -55
- package/assets/context_templates/architecture.md +31 -31
- package/assets/context_templates/area.md +24 -24
- package/assets/context_templates/context.toml +27 -27
- package/assets/context_templates/deployment.md +35 -35
- package/assets/context_templates/global.md +53 -53
- package/assets/context_templates/product-surface-contract.md +60 -0
- package/assets/context_templates/verification.md +28 -28
- package/assets/github/.gitkeep +1 -1
- package/assets/github/harness.yml +19 -19
- package/assets/make/.gitkeep +1 -1
- package/assets/make/ty-context.mk +48 -0
- package/assets/skills/context_development_engineer/SKILL.md +69 -66
- package/assets/skills/context_full_project_export/SKILL.md +25 -25
- package/assets/skills/context_harness_upgrade/SKILL.md +9 -9
- package/assets/skills/context_product_plan/SKILL.md +73 -70
- package/assets/skills/context_surface_contract/SKILL.md +168 -0
- package/assets/skills/context_uiux_design/SKILL.md +113 -110
- package/assets/skills/plan_acceptance_checklist_compiler/SKILL.md +427 -0
- package/assets/tools/validate_context.py +276 -276
- package/dist/cli.js +1 -1
- package/dist/commands/check-modularity.js +1 -1
- package/dist/commands/export-context.js +6 -6
- package/dist/commands/index.js +3 -3
- package/dist/commands/init.js +1 -1
- package/dist/commands/package-source.js +2 -2
- package/dist/commands/upgrade.js +1 -1
- package/dist/lib/config.js +2 -2
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/constants.js +1 -1
- package/dist/lib/context-export.js +5 -5
- package/dist/lib/harness-root.d.ts +5 -0
- package/dist/lib/harness-root.js +32 -4
- package/dist/lib/legacy-managed-scan.d.ts +2 -0
- package/dist/lib/legacy-managed-scan.js +79 -0
- package/dist/lib/legacy-sdlc-migration.d.ts +2 -0
- package/dist/lib/legacy-sdlc-migration.js +189 -0
- package/dist/lib/managed-file.d.ts +18 -12
- package/dist/lib/managed-file.js +25 -14
- package/dist/lib/migrations.js +4 -2
- package/dist/lib/package-json-config.js +3 -3
- package/dist/lib/paths.d.ts +2 -2
- package/dist/lib/paths.js +2 -2
- package/dist/lib/sync-engine.js +33 -31
- package/dist/lib/validators.js +2 -2
- package/migrations/README.md +3 -3
- package/package.json +68 -68
- package/source-mappings.yaml +21 -21
- package/assets/make/sdlc-harness.mk +0 -48
|
@@ -1,32 +1,32 @@
|
|
|
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
|
-
|
|
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
9
|
## Verification Paths
|
|
10
10
|
|
|
11
11
|
- `npm test` or the shortest project-specific test, smoke, CI, probe or validation command.
|
|
12
12
|
- Verification paths are reusable execution instances, not independent definitions of the verification target. For capability, metric or acceptance claims, first use the owning module's design Context to decide what claim should be proven, then choose the command or probe.
|
|
13
|
-
|
|
14
|
-
## Required Preparation
|
|
15
|
-
|
|
16
|
-
- List only durable setup such as services, env files, fixtures, local runtimes or external dependencies needed before rerun.
|
|
17
|
-
|
|
18
|
-
## Expected Signals
|
|
19
|
-
|
|
20
|
-
- Name the stage, health check, status, artifact shape or observable signal that means the path reached the intended point.
|
|
21
|
-
|
|
22
|
-
## Acceptable Warnings
|
|
23
|
-
|
|
24
|
-
- List warnings that are expected and should not trigger repeated investigation.
|
|
25
|
-
|
|
26
|
-
## Excluded Dead Ends
|
|
27
|
-
|
|
28
|
-
- List previously ruled-out commands, providers, endpoints or setup paths only when remembering them prevents repeated wasted work.
|
|
29
|
-
|
|
30
|
-
## Forbidden Content
|
|
31
|
-
|
|
32
|
-
- 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.
|
|
13
|
+
|
|
14
|
+
## Required Preparation
|
|
15
|
+
|
|
16
|
+
- List only durable setup such as services, env files, fixtures, local runtimes or external dependencies needed before rerun.
|
|
17
|
+
|
|
18
|
+
## Expected Signals
|
|
19
|
+
|
|
20
|
+
- Name the stage, health check, status, artifact shape or observable signal that means the path reached the intended point.
|
|
21
|
+
|
|
22
|
+
## Acceptable Warnings
|
|
23
|
+
|
|
24
|
+
- List warnings that are expected and should not trigger repeated investigation.
|
|
25
|
+
|
|
26
|
+
## Excluded Dead Ends
|
|
27
|
+
|
|
28
|
+
- List previously ruled-out commands, providers, endpoints or setup paths only when remembering them prevents repeated wasted work.
|
|
29
|
+
|
|
30
|
+
## Forbidden Content
|
|
31
|
+
|
|
32
|
+
- 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.
|
package/assets/github/.gitkeep
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
#
|
|
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:
|
|
1
|
+
# ty-context: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
17
|
- validate-context
|
|
18
18
|
- validate-code-modularity
|
|
19
19
|
- validate-harness
|
|
@@ -29,7 +29,7 @@ jobs:
|
|
|
29
29
|
with:
|
|
30
30
|
node-version: "24"
|
|
31
31
|
- name: Prepare source workspace CLI
|
|
32
|
-
if: ${{ hashFiles('packages/
|
|
32
|
+
if: ${{ hashFiles('packages/ty-context/package.json') != '' }}
|
|
33
33
|
run: |
|
|
34
34
|
npm ci
|
|
35
35
|
npm run build --workspace project-tiny-context-harness
|
|
@@ -37,5 +37,5 @@ jobs:
|
|
|
37
37
|
run: make "${HARNESS_GATE}"
|
|
38
38
|
env:
|
|
39
39
|
HARNESS_GATE: ${{ github.event.inputs.gate || 'validate-harness' }}
|
|
40
|
-
|
|
41
|
-
#
|
|
40
|
+
TY_CONTEXT_MODULARITY_BASE: ${{ github.event_name == 'pull_request' && format('origin/{0}', github.base_ref) || github.event.before || '' }}
|
|
41
|
+
# ty-context:github-workflow:end
|
package/assets/make/.gitkeep
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
PYTHON ?= python3
|
|
2
|
+
TY_CONTEXT ?= $(if $(wildcard packages/ty-context/dist/cli.js),node packages/ty-context/dist/cli.js,npx --yes --package project-tiny-context-harness@latest ty-context)
|
|
3
|
+
TY_CONTEXT_MODULARITY_SCOPE = $(if $(TY_CONTEXT_MODULARITY_BASE),--base $(TY_CONTEXT_MODULARITY_BASE),--touched)
|
|
4
|
+
|
|
5
|
+
.PHONY: help ty-context-doctor ty-context-sync ty-context-upgrade ty-context-check-modularity validate-context validate-code-modularity validate-harness lint test-current-domain test-all build
|
|
6
|
+
|
|
7
|
+
help:
|
|
8
|
+
@echo "Minimal Context Harness commands"
|
|
9
|
+
@echo " make ty-context-doctor Diagnose Harness root, core package and schema version"
|
|
10
|
+
@echo " make ty-context-sync Refresh managed assets; refuses when upgrade migrations are pending"
|
|
11
|
+
@echo " make ty-context-upgrade Run safe upgrade migrations, sync managed assets and doctor"
|
|
12
|
+
@echo " make ty-context-check-modularity Warn on oversized touched handwritten source files"
|
|
13
|
+
@echo " make validate-context Check whether project_context/** supports context recovery"
|
|
14
|
+
@echo " make validate-code-modularity Fail on oversized touched handwritten source files"
|
|
15
|
+
@echo " make validate-harness Run validate-context and validate-code-modularity"
|
|
16
|
+
@echo " make test-all Run the project regression suite after replacing this placeholder"
|
|
17
|
+
|
|
18
|
+
ty-context-doctor:
|
|
19
|
+
$(TY_CONTEXT) doctor
|
|
20
|
+
|
|
21
|
+
ty-context-sync:
|
|
22
|
+
$(TY_CONTEXT) sync
|
|
23
|
+
|
|
24
|
+
ty-context-upgrade:
|
|
25
|
+
$(TY_CONTEXT) upgrade
|
|
26
|
+
|
|
27
|
+
ty-context-check-modularity:
|
|
28
|
+
$(TY_CONTEXT) check-modularity $(TY_CONTEXT_MODULARITY_SCOPE)
|
|
29
|
+
|
|
30
|
+
validate-context:
|
|
31
|
+
$(TY_CONTEXT) validate-context
|
|
32
|
+
|
|
33
|
+
validate-code-modularity:
|
|
34
|
+
$(TY_CONTEXT) check-modularity $(TY_CONTEXT_MODULARITY_SCOPE) --fail-on-warning
|
|
35
|
+
|
|
36
|
+
validate-harness: validate-context validate-code-modularity
|
|
37
|
+
|
|
38
|
+
lint:
|
|
39
|
+
@echo "No project lint command configured yet. Replace this target with your stack-specific lint command."
|
|
40
|
+
|
|
41
|
+
test-current-domain:
|
|
42
|
+
@echo "No domain test command configured yet. Replace this target with focused tests for the current change."
|
|
43
|
+
|
|
44
|
+
test-all:
|
|
45
|
+
@echo "No full test command configured yet. Replace this target with the project regression suite."
|
|
46
|
+
|
|
47
|
+
build:
|
|
48
|
+
@echo "No build command configured yet. Replace this target with the project build/package command."
|
|
@@ -1,39 +1,41 @@
|
|
|
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 `
|
|
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
|
|
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。
|
|
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 `ty-context 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 Tiny Context 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
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
|
|
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
31
|
8. 涉及模块原则、模块逻辑、设计原因、API / Schema、状态语义、验证设计或 capability / metric / acceptance claim 时,先做 Module Principle / Design Gate:列出命中的模块设计上下文来源,说明这些原则 / 逻辑控制本次哪些实现或验证选择,再选择实现路径、验证 claim、probe 参数或 fallback。命令、probe 和当前实现形态是执行实例,不能反推或覆盖模块设计目标。
|
|
32
|
-
9. 涉及 UI
|
|
32
|
+
9. 涉及 Product Surface(Web 页面、移动/桌面屏幕、游戏 UI/HUD/菜单、CLI/TUI 输出、扩展或设备界面)、表单/配置、输入、选择、搜索、筛选、调度/时间、预算/配额/限流或状态反馈的实现方案时,检查当前代码是否只是暴露字段,还是满足了已有 Context、Surface Contract、页面职责和控件任务框架;实现收尾要能给出简短 Surface/Context Conformance 证据。
|
|
33
|
+
- 若存在 Product Surface Contract,Task Contract 必须包含 Surface Contract Hit、main allows/forbids、drilldown ownership、long-task state requirement、implementation drift 和 verification。
|
|
34
|
+
- 若缺失且本任务创建 durable surface responsibility,设置 `Context Delta: required`,先用 `context_surface_contract` 或项目 Context 写入具体 surface 职责,再继续实现。
|
|
33
35
|
10. 实现时保持精准修改,优先遵循仓库现有框架、接口、测试和代码风格。
|
|
34
36
|
11. 当用户明确要求 / 允许“多开agent”或使用 subagent,且当前会话存在可用 subagent 工具时,积极把可并行的探索、审查或实现拆分交给 subagent;使用前先复用已有相关 agent,没有合适 agent 或并行度不足时再新开。`wait_agent` 只表示取得结果,不释放资源;subagent 完成、空闲或不再需要时必须调用 `close_agent`,收尾前清理已完成 / 空闲 / 不再需要的 subagent,避免占满后续资源。
|
|
35
37
|
12. 当任务涉及新实现、重构、重复逻辑、模块边界或影响面控制时,先做轻量 abstraction / decomposition scan:
|
|
36
|
-
- 工程 / RFC / 实现类 Task Contract 包含 `Modularity Check: none|required|exception`;可用 `
|
|
38
|
+
- 工程 / RFC / 实现类 Task Contract 包含 `Modularity Check: none|required|exception`;可用 `ty-context check-modularity --file <path> --limit 300` 审计计划编辑文件,用 `make validate-code-modularity` 或 `ty-context check-modularity --touched --limit 300 --fail-on-warning` 做交付前硬审计。若项目本地 Skill 定义了不同 limit,使用项目本地值。
|
|
37
39
|
- 发现超限 touched file 后,不只记录行数;判断本次是否在该文件加入新职责,并回到本节拆分原则选择产品面、hook、model、adapter、component、service / facade 或 verification helper 等边界。避免只按行数机械拆分、但耦合和职责仍留在原处。
|
|
38
40
|
- 如果本次不拆,`Modularity Check` 取 `exception`,必须有 `<harnessRoot>/config.yaml` 的 `modularity.waivers` 记录(`path`、收窄 `category`、`reason`、`future_split_boundary`);交付说明只能补充说明,不是机器豁免。若项目设置 `modularity.policy: strict_except_generated`,legacy waiver 不可用,超限手写源码必须拆分或停止触碰。已豁免历史债也不得继续塞新职责,除非本次任务就是拆分 / 迁移。
|
|
39
41
|
- 查找相似实现、重复逻辑、紧耦合模块或影响面异常扩散点。
|
|
@@ -52,29 +54,30 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
52
54
|
15. 实现收尾时做 `Contract Conformance` 和 Context drift check:确认代码没有引入未沉淀的长期事实,且 Context 没有退化成普通实现摘要;交付说明只报告轻量状态:`Context: 已更新 ...` 或 `Context: 本次无长期事实变化`。Conformance 说明本次契约满足情况、未满足或延期项和验证入口;一次性证据、截图结果、测试日志、任务契约和实现摘要不写入 Context。
|
|
53
55
|
16. Context 只能声明验证 / 部署关键路径或验收信号,不能伪造“测试已通过”或“部署已成功”。
|
|
54
56
|
17. Verification / Deployment Role Context 只记录长期可复用的重复执行路径事实:特殊准备、最短命令或路径、预期阶段 / 信号、可接受 warning、已排除的重复探索点。不要记录一次性测试日志、完整输出、临时 JSON、CI artifact、测试报告、release ledger、secret、token、cookie、device id 或 raw payload。
|
|
55
|
-
|
|
56
|
-
## UI 实现对齐
|
|
57
|
-
|
|
58
|
-
- UI 实现方案不只检查字段是否接上,还要检查控件是否支持用户任务、输入语义、反馈状态、错误恢复和已有页面/控件契约。
|
|
59
|
-
- 当 current code evidence 显示后端字段、枚举或自由输入直接暴露给用户时,不默认把它当作产品意图;先对照 Context、产品/UIUX Skill 的控件任务框架和项目组件体系判断是否是实现漂移或缺失契约。
|
|
60
|
-
- Contract Conformance 证据应短而具体:命中的已有 Context / 页面契约或 Task Contract、实现如何满足、未满足或延期项、验证入口或手动检查。它属于交付说明,不属于 `project_context/**`。
|
|
61
|
-
|
|
62
|
-
## 任务契约编译
|
|
63
|
-
|
|
64
|
-
- 任务契约是当前工程任务的编译产物,不是事实源、tech plan、ADR、implementation doc 或长期 Context;默认留在方案、交付说明或 PR 文本中。
|
|
65
|
-
- `Context Delta` 必须先出现,取值为 `none` 或 `required`:
|
|
66
|
-
- `none`:本次只是按既有 Context / 架构原则落地,不新增长期事实。
|
|
67
|
-
- `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
|
|
57
|
+
|
|
58
|
+
## UI 实现对齐
|
|
59
|
+
|
|
60
|
+
- UI 实现方案不只检查字段是否接上,还要检查控件是否支持用户任务、输入语义、反馈状态、错误恢复和已有页面/控件契约。
|
|
61
|
+
- 当 current code evidence 显示后端字段、枚举或自由输入直接暴露给用户时,不默认把它当作产品意图;先对照 Context、产品/UIUX Skill 的控件任务框架和项目组件体系判断是否是实现漂移或缺失契约。
|
|
62
|
+
- Contract Conformance 证据应短而具体:命中的已有 Context / 页面契约或 Task Contract、实现如何满足、未满足或延期项、验证入口或手动检查。它属于交付说明,不属于 `project_context/**`。
|
|
63
|
+
|
|
64
|
+
## 任务契约编译
|
|
65
|
+
|
|
66
|
+
- 任务契约是当前工程任务的编译产物,不是事实源、tech plan、ADR、implementation doc 或长期 Context;默认留在方案、交付说明或 PR 文本中。
|
|
67
|
+
- `Context Delta` 必须先出现,取值为 `none` 或 `required`:
|
|
68
|
+
- `none`:本次只是按既有 Context / 架构原则落地,不新增长期事实。
|
|
69
|
+
- `required`:说明长期事实类型、应写入的 Context / role、需要沉淀的事实,以及明确不写入 Context 的一次性内容。
|
|
68
70
|
- `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。
|
|
71
|
+
- 触及 Product Surface 时,`Task Contract` 同时说明 surface platform、primary user question、main allows/forbids、drilldown ownership、long-task state requirement、implementation drift 和 conformance verification。
|
|
69
72
|
- 工程 / RFC / 实现类任务的 `Task Contract` 必须包含 `Modularity Check: none|required|exception`:
|
|
70
73
|
- `none`:没有超限计划 / touched 手写源码文件,或本次没有向超限文件增加新职责。
|
|
71
74
|
- `required`:拆分是本次验收条件,应按 abstraction / decomposition scan 的职责边界完成。
|
|
72
75
|
- `exception`:本次触碰超限文件但暂不拆;只有默认 `modularity.policy: scoped_waivers` 允许此路径,且必须已有或同步新增 `<harnessRoot>/config.yaml` `modularity.waivers` 记录文件、收窄分类、原因和后续拆分边界。若项目设置 `modularity.policy: strict_except_generated`,不得用 legacy waiver 绕过超限手写源码,交付说明只记录本次是否新增职责以及为什么没有拆。
|
|
73
76
|
- `Applicable Module Design` 是高风险任务的前置字段:列出命中的 Context / Skill 来源、适用的 Principles、Design Logic 和 Design Rationale,以及它们控制的当前实现或验证选择。
|
|
74
77
|
- `Principle Decision Gate` 要写明首选执行路径、fallback / degraded path 的进入条件,以及什么证据不能证明本次目标。涉及 capability、metric 或 acceptance claim 时,先声明要证明的 claim,再选择命令或 probe。
|
|
75
|
-
- 对长任务、多模块、多 agent、容易发生 `Context Delta` 调头或多轮验证的任务,可以用 `plan.md` 或等价临时计划面暂存 `Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
|
|
76
|
-
- `plan.md` 中出现的长期工程事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
|
|
77
|
-
- `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
|
|
78
|
+
- 对长任务、多模块、多 agent、容易发生 `Context Delta` 调头或多轮验证的任务,可以用 `plan.md` 或等价临时计划面暂存 `Context Delta`、`Task Contract`、`Implementation Steps` 和 `Contract Conformance`;它只是临时执行缓存。
|
|
79
|
+
- `plan.md` 中出现的长期工程事实必须提炼回 `project_context/**`;否则不要把临时计划当作事实源、交付产物或后续引用依据。
|
|
80
|
+
- `Context Delta: required` 时先更新 `project_context/**`,再继续实现;`none` 时直接按 Task Contract 实现。
|
|
78
81
|
- `Contract Conformance` 是交付前的软检查:实现偏差修实现,契约遗漏回 Task Contract,长期事实缺失回 `Context Delta` 并先更新 Context。
|
|
79
82
|
- 不为普通代码修改、bug fix、小重构、package/release 处理、测试修复或探索性 spike 强制编译任务契约。
|
|
80
83
|
|
|
@@ -84,22 +87,22 @@ Project-specific engineering rules belong in a separate project-local Skill unde
|
|
|
84
87
|
- `Principles` 写稳定执行约束;`Design Logic` 写模块如何判断、选择、降级或组合能力;`Design Rationale` 只写会改变后续判断的原因。
|
|
85
88
|
- `Current Standard`、`Verification Paths`、阈值、命令和 probe 参数是当前执行实例,不是永久原则;规则变化时更新对应 Context,而不是让旧命令继续定义目标。
|
|
86
89
|
- 一次性证据、历史过程、完整日志、临时 JSON、raw payload、测试报告和任务契约不进入高频模块原则段。
|
|
87
|
-
|
|
88
|
-
## 输出边界
|
|
89
|
-
|
|
90
|
-
- 不默认创建 `.work_products/**`、tech plan、ADR、implementation doc、review/test/release 文档。
|
|
91
|
-
- 不要求 lifecycle phase、plan task、phase gate 或阶段 Skill。
|
|
92
|
-
- 如果用户明确要求独立开发方案、技术方案或实现说明,可以临时生成;长期事实仍要提炼回 `project_context/**`。
|
|
93
|
-
- 如果用户只是要求普通代码修改、修 bug、小重构、package/release 处理,或只是泛泛提到“代码 / 开发 / engineering”,不需要触发本 Skill;只有明确角色名或强相关产物名指向工程方案、实现方案、实施计划、技术判断或长期工程事实沉淀时才使用。
|
|
94
|
-
|
|
95
|
-
## 建议沉淀位置
|
|
96
|
-
|
|
97
|
-
- `global.md#Design Rationale`:跨模块工程取舍。
|
|
98
|
-
- `global.md#Current State`:影响后续恢复的实现状态。
|
|
99
|
-
- `areas/*.md#User / System Contract`:模块可见行为、API、CLI、UI 或数据契约。
|
|
100
|
-
- `areas/*.md#Core Data / API / State`:关键数据结构、接口、状态流或规则。
|
|
101
|
-
- `areas/*.md#Key Constraints`:性能、安全、兼容、集成或维护约束。
|
|
102
|
-
- `areas/*.md#Code Entry Points`:未来 agent 需要快速定位的代码入口。
|
|
103
|
-
- `areas/*/verification.md` 或 role=`verification` Context:关键测试、smoke、CI、probe 或验证重复执行路径。
|
|
104
|
-
- `areas/*/deployment.md` 或 role=`deployment` Context:关键部署、云端初始化、运行拓扑、健康检查或回滚重复执行路径。
|
|
105
|
-
- `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。
|
|
90
|
+
|
|
91
|
+
## 输出边界
|
|
92
|
+
|
|
93
|
+
- 不默认创建 `.work_products/**`、tech plan、ADR、implementation doc、review/test/release 文档。
|
|
94
|
+
- 不要求 lifecycle phase、plan task、phase gate 或阶段 Skill。
|
|
95
|
+
- 如果用户明确要求独立开发方案、技术方案或实现说明,可以临时生成;长期事实仍要提炼回 `project_context/**`。
|
|
96
|
+
- 如果用户只是要求普通代码修改、修 bug、小重构、package/release 处理,或只是泛泛提到“代码 / 开发 / engineering”,不需要触发本 Skill;只有明确角色名或强相关产物名指向工程方案、实现方案、实施计划、技术判断或长期工程事实沉淀时才使用。
|
|
97
|
+
|
|
98
|
+
## 建议沉淀位置
|
|
99
|
+
|
|
100
|
+
- `global.md#Design Rationale`:跨模块工程取舍。
|
|
101
|
+
- `global.md#Current State`:影响后续恢复的实现状态。
|
|
102
|
+
- `areas/*.md#User / System Contract`:模块可见行为、API、CLI、UI 或数据契约。
|
|
103
|
+
- `areas/*.md#Core Data / API / State`:关键数据结构、接口、状态流或规则。
|
|
104
|
+
- `areas/*.md#Key Constraints`:性能、安全、兼容、集成或维护约束。
|
|
105
|
+
- `areas/*.md#Code Entry Points`:未来 agent 需要快速定位的代码入口。
|
|
106
|
+
- `areas/*/verification.md` 或 role=`verification` Context:关键测试、smoke、CI、probe 或验证重复执行路径。
|
|
107
|
+
- `areas/*/deployment.md` 或 role=`deployment` Context:关键部署、云端初始化、运行拓扑、健康检查或回滚重复执行路径。
|
|
108
|
+
- `project_context/context.toml`:复杂项目的产品域 area/context_unit、role、触发词、按需读取策略和可选边界规则。
|
|
@@ -1,16 +1,16 @@
|
|
|
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 `
|
|
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
|
-
|
|
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 `ty-context 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
14
|
## Purpose
|
|
15
15
|
|
|
16
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.
|
|
@@ -20,36 +20,36 @@ When the user needs a code-level implementation export, create one temporary Mar
|
|
|
20
20
|
## Workflow
|
|
21
21
|
|
|
22
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
|
|
23
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --all`
|
|
24
24
|
2. Use `--full` when only the project Context bundle is needed:
|
|
25
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
25
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --full`
|
|
26
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
|
|
27
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --code`
|
|
28
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
|
|
30
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
29
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --full --output tmp/ty-context/context-exports/my-export.md`
|
|
30
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --code --output tmp/ty-context/context-exports/my-code-export.md`
|
|
31
31
|
5. Use dry-run mode to inspect planned sources before writing:
|
|
32
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
33
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
34
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
32
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --all --check`
|
|
33
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --full --check`
|
|
34
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context export-context --code --check`
|
|
35
35
|
6. After exporting, report artifact paths, source counts and warnings to the user. Do not summarize export contents back into Context.
|
|
36
36
|
|
|
37
37
|
## Output Boundaries
|
|
38
38
|
|
|
39
39
|
- Export artifacts must remain temporary export artifacts, not Context.
|
|
40
|
-
- `--full` defaults to `tmp/
|
|
41
|
-
- `--code` defaults to `tmp/
|
|
40
|
+
- `--full` defaults to `tmp/ty-context/context-exports/full-project-context-<timestamp>.md`.
|
|
41
|
+
- `--code` defaults to `tmp/ty-context/context-exports/code-level-implementation-<timestamp>/code-level-implementation.md`.
|
|
42
42
|
- `--all` generates both default artifacts with the same timestamp.
|
|
43
43
|
- `--all` does not accept `--output`; custom filenames are supported only for `--full` or `--code`.
|
|
44
44
|
- `--code` creates one Markdown file, not shards or `all.md`.
|
|
45
45
|
- Do not output to `project_context/**`.
|
|
46
46
|
- Do not modify `project_context/context.toml`.
|
|
47
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/
|
|
48
|
+
- Do not write tracked docs; if the user asks for an ordinary docs path, redirect to `tmp/ty-context/context-exports/**`.
|
|
49
49
|
- Export contents may include redaction warnings; do not bypass secret/token/cookie/password/api_key filtering.
|
|
50
50
|
|
|
51
51
|
## Handoff
|
|
52
52
|
|
|
53
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/
|
|
54
|
+
- If the CLI rejects an output path, explain that this prevents temporary exports from polluting durable fact sources and suggest `tmp/ty-context/context-exports/<name>.md`.
|
|
55
55
|
- Context drift check should be `Context: no durable project facts changed` unless the task also changes Harness rules.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: context_harness_upgrade
|
|
3
|
-
description: Use when the user asks to upgrade Tiny Context, update Tiny Context, use the Tiny Context upgrade skill to upgrade this project, upgrade project-tiny-context-harness, run
|
|
3
|
+
description: Use when the user asks to upgrade Tiny Context, update Tiny Context, use the Tiny Context upgrade skill to upgrade this project, upgrade project-tiny-context-harness, run ty-context upgrade, run make ty-context-upgrade, Project Tiny Context Harness upgrade, 用 Tiny Context upgrade skill 升级这个项目, 升级 tiny context, 升级tiny context, or 更新 project-tiny-context-harness in a Minimal Context Harness project.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Context Harness Upgrade
|
|
7
7
|
|
|
8
8
|
## Package-Managed Boundary
|
|
9
9
|
|
|
10
|
-
This Skill is generated by `
|
|
10
|
+
This Skill is generated by `ty-context sync` and owned by the Harness package. Do not edit the generated `context_harness_upgrade` Skill directly.
|
|
11
11
|
|
|
12
12
|
This Skill handles Harness package upgrade and migration orchestration only. It does not author product facts, refactor business code, replace project tests or prove application quality.
|
|
13
13
|
|
|
@@ -24,20 +24,20 @@ When the user asks to upgrade Tiny Context / Project Tiny Context Harness in an
|
|
|
24
24
|
- `project_context/context.toml`
|
|
25
25
|
2. Inspect the working tree with `git status --short`. Do not revert unrelated user changes.
|
|
26
26
|
3. Prefer project wrappers when present:
|
|
27
|
-
- `make
|
|
28
|
-
- `make
|
|
27
|
+
- `make ty-context-upgrade`
|
|
28
|
+
- `make ty-context-doctor`
|
|
29
29
|
- `make validate-context`
|
|
30
30
|
4. If no wrapper exists, use the package CLI explicitly:
|
|
31
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
32
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
33
|
-
- `npx --yes --package project-tiny-context-harness@latest
|
|
31
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context upgrade --check`
|
|
32
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context upgrade`
|
|
33
|
+
- `npx --yes --package project-tiny-context-harness@latest ty-context doctor`
|
|
34
34
|
5. Do not run standalone `sync` before `upgrade`. `upgrade` is the default path after an npm package update because it plans migrations, applies safe migrations, refreshes managed assets and runs diagnostics.
|
|
35
35
|
6. Do not run standalone `sync` after a successful `upgrade` unless release notes say the update is `sync-only`, the project wrapper did not run sync, or the user explicitly asks for a managed-asset refresh.
|
|
36
36
|
7. If `upgrade --check` or `upgrade` reports only `safe_pending` items and the command succeeds, do not invent additional manual cleanup.
|
|
37
37
|
8. If the report includes `manual_required` or `blocked`, handle only the listed migration scope. Use `project_context/context.toml`, role placement scan and the existing area graph to decide placement. Do not guess product or business semantics.
|
|
38
38
|
9. If the report includes `blocked`, treat it as a write preflight failure: resolve the blocked migration scope and rerun `upgrade` before expecting safe migrations or managed asset sync to have been applied.
|
|
39
39
|
10. Run diagnostics after migration-scoped follow-up:
|
|
40
|
-
- `make
|
|
40
|
+
- `make ty-context-doctor` or the CLI `doctor`
|
|
41
41
|
- `make validate-context`
|
|
42
42
|
11. Report commands run, migration status, diagnostics, files changed and any remaining manual items. Use `Context: no durable project facts changed` unless the upgrade exposed or required a real long-term project fact change.
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ When the user asks to upgrade Tiny Context / Project Tiny Context Harness in an
|
|
|
45
45
|
|
|
46
46
|
- `manual_required` means the Harness detected a migration-scoped item but cannot safely choose the project meaning. Fix it only when the existing Context or file structure proves the intended placement.
|
|
47
47
|
- `blocked` means the safe target already exists or another conflict prevents a mechanical write. Do not overwrite. Compare source and target, preserve user content and ask for direction if the conflict cannot be resolved from project facts.
|
|
48
|
-
- Deprecated override Skills under `
|
|
48
|
+
- Deprecated override Skills under `ty-context-managed/override_skills/**` should be migrated to standalone project-local Skills only when their content is still relevant. Do not merge them into package-managed default Skills.
|
|
49
49
|
- Ambiguous Context roles should not be guessed from filenames like `api.md`, `notes.md` or `main.md` alone. Register a role only when the manifest, path convention or durable content makes it clear.
|
|
50
50
|
- If `upgrade` creates default `project_context/areas/main.md` or `project_context/areas/main/verification.md` but `project_context/context.toml` already declares real project areas and does not register `main`, remove those generated defaults instead of preserving them as durable project facts. If `main` is registered or contains user-authored facts, do not delete it automatically.
|
|
51
51
|
|