@givolt/i3-composer-agent 2.1.1 → 2.2.1
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/.agents/plugins/marketplace.json +2 -2
- package/.claude/commands/i3-build.md +13 -1
- package/.claude/commands/i3-code-simplify.md +13 -1
- package/.claude/commands/i3-constraints.md +13 -1
- package/.claude/commands/i3-plan.md +13 -1
- package/.claude/commands/i3-review.md +13 -1
- package/.claude/commands/i3-ship.md +18 -2
- package/.claude/commands/i3-spec.md +13 -1
- package/.claude/commands/i3-test.md +13 -1
- package/.claude/commands/i3-webperf.md +13 -1
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +7 -6
- package/.gemini/commands/i3-build.toml +13 -1
- package/.gemini/commands/i3-code-simplify.toml +13 -1
- package/.gemini/commands/i3-constraints.toml +13 -1
- package/.gemini/commands/i3-planning.toml +13 -1
- package/.gemini/commands/i3-review.toml +13 -1
- package/.gemini/commands/i3-ship.toml +13 -1
- package/.gemini/commands/i3-spec.toml +13 -1
- package/.gemini/commands/i3-test.toml +13 -1
- package/.gemini/commands/i3-webperf.toml +13 -1
- package/README.md +141 -109
- package/agents/code-reviewer.md +13 -1
- package/agents/security-auditor.md +13 -1
- package/agents/test-engineer.md +13 -1
- package/agents/web-performance-auditor.md +13 -1
- package/bin/asset-fingerprint.cjs +1 -0
- package/bin/i3-composer-agent.cjs +58 -52
- package/bin/install.cjs +42 -19
- package/bin/native-content.cjs +27 -17
- package/bin/tool-menu.cjs +9 -0
- package/bin/tool-selector.cjs +164 -0
- package/bin/wizard.cjs +19 -30
- package/commands/i3-build.toml +13 -1
- package/commands/i3-code-simplify.toml +13 -1
- package/commands/i3-constraints.toml +13 -1
- package/commands/i3-planning.toml +13 -1
- package/commands/i3-review.toml +13 -1
- package/commands/i3-ship.toml +13 -1
- package/commands/i3-spec.toml +13 -1
- package/commands/i3-test.toml +13 -1
- package/commands/i3-webperf.toml +13 -1
- package/docs/adoption-guide.md +8 -0
- package/docs/agents.md +8 -0
- package/docs/antigravity-setup.md +8 -0
- package/docs/codebuddy-setup.md +31 -62
- package/docs/codex-setup.md +18 -29
- package/docs/commandcode-setup.md +8 -0
- package/docs/copilot-cli-setup.md +8 -0
- package/docs/copilot-setup.md +8 -0
- package/docs/cursor-setup.md +8 -0
- package/docs/gemini-cli-setup.md +8 -0
- package/docs/getting-started.md +8 -0
- package/docs/opencode-setup.md +8 -0
- package/docs/other-hosts.md +8 -0
- package/docs/windsurf-setup.md +8 -0
- package/docs/workbuddy-setup.md +41 -65
- package/evals/README.md +86 -0
- package/evals/cases/i3-api-and-interface-design.json +45 -0
- package/evals/cases/i3-browser-testing-with-devtools.json +44 -0
- package/evals/cases/i3-ci-cd-and-automation.json +45 -0
- package/evals/cases/i3-code-review-and-quality.json +49 -0
- package/evals/cases/i3-code-simplification.json +45 -0
- package/evals/cases/i3-constraint-driven-development.json +79 -0
- package/evals/cases/i3-context-engineering.json +44 -0
- package/evals/cases/i3-debugging-and-error-recovery.json +58 -0
- package/evals/cases/i3-deprecation-and-migration.json +52 -0
- package/evals/cases/i3-documentation-and-adrs.json +44 -0
- package/evals/cases/i3-doubt-driven-development.json +43 -0
- package/evals/cases/i3-frontend-ui-engineering.json +52 -0
- package/evals/cases/i3-git-workflow-and-versioning.json +47 -0
- package/evals/cases/i3-idea-refine.json +43 -0
- package/evals/cases/i3-incremental-implementation.json +57 -0
- package/evals/cases/i3-interview-me.json +42 -0
- package/evals/cases/i3-observability-and-instrumentation.json +44 -0
- package/evals/cases/i3-performance-optimization.json +53 -0
- package/evals/cases/i3-planning-and-task-breakdown.json +45 -0
- package/evals/cases/i3-security-and-hardening.json +53 -0
- package/evals/cases/i3-shipping-and-launch.json +56 -0
- package/evals/cases/i3-source-driven-development.json +44 -0
- package/evals/cases/i3-spec-driven-development.json +72 -0
- package/evals/cases/i3-test-driven-development.json +73 -0
- package/evals/cases/i3-using-agent-skills.json +44 -0
- package/evals/fixtures/i3-api-and-interface-design/service-brief.md +19 -0
- package/evals/fixtures/i3-browser-testing-with-devtools/README.md +5 -0
- package/evals/fixtures/i3-browser-testing-with-devtools/index.html +24 -0
- package/evals/fixtures/i3-browser-testing-with-devtools/server.js +15 -0
- package/evals/fixtures/i3-ci-cd-and-automation/package.json +8 -0
- package/evals/fixtures/i3-ci-cd-and-automation/src/slug.js +3 -0
- package/evals/fixtures/i3-ci-cd-and-automation/test/slug.test.js +9 -0
- package/evals/fixtures/i3-code-review-and-quality/user-search.diff +16 -0
- package/evals/fixtures/i3-code-simplification/config-parser.js +46 -0
- package/evals/fixtures/i3-code-simplification/config-parser.test.js +15 -0
- package/evals/fixtures/i3-context-engineering/context-audit.md +15 -0
- package/evals/fixtures/i3-debugging-and-error-recovery/pagination.js +8 -0
- package/evals/fixtures/i3-debugging-and-error-recovery/pagination.test.js +9 -0
- package/evals/fixtures/i3-debugging-and-error-recovery/time-pressure.md +6 -0
- package/evals/fixtures/i3-deprecation-and-migration/api-inventory.md +9 -0
- package/evals/fixtures/i3-documentation-and-adrs/decision-context.md +16 -0
- package/evals/fixtures/i3-doubt-driven-development/migration-plan.md +19 -0
- package/evals/fixtures/i3-frontend-ui-engineering/Button.tsx +7 -0
- package/evals/fixtures/i3-frontend-ui-engineering/design-system.md +11 -0
- package/evals/fixtures/i3-git-workflow-and-versioning/.eval/working-tree.patch +21 -0
- package/evals/fixtures/i3-git-workflow-and-versioning/app.js +7 -0
- package/evals/fixtures/i3-git-workflow-and-versioning/app.test.js +9 -0
- package/evals/fixtures/i3-incremental-implementation/reports.js +7 -0
- package/evals/fixtures/i3-incremental-implementation/reports.test.js +12 -0
- package/evals/fixtures/i3-incremental-implementation/tasks/plan.md +8 -0
- package/evals/fixtures/i3-observability-and-instrumentation/operations.md +11 -0
- package/evals/fixtures/i3-observability-and-instrumentation/payment-retry.js +14 -0
- package/evals/fixtures/i3-performance-optimization/benchmark.js +15 -0
- package/evals/fixtures/i3-performance-optimization/products.js +14 -0
- package/evals/fixtures/i3-planning-and-task-breakdown/notifications-spec.md +18 -0
- package/evals/fixtures/i3-security-and-hardening/webhook.js +11 -0
- package/evals/fixtures/i3-security-and-hardening/webhook.test.js +13 -0
- package/evals/fixtures/i3-shipping-and-launch/authority-pressure.md +6 -0
- package/evals/fixtures/i3-shipping-and-launch/launch-status.md +11 -0
- package/evals/fixtures/i3-source-driven-development/framework-task.md +10 -0
- package/evals/fixtures/i3-spec-driven-development/billing-brief.md +16 -0
- package/evals/fixtures/i3-test-driven-development/BUG.md +10 -0
- package/evals/fixtures/i3-test-driven-development/README.md +28 -0
- package/evals/fixtures/i3-test-driven-development/package.json +9 -0
- package/evals/fixtures/i3-test-driven-development/src/split.js +8 -0
- package/evals/fixtures/i3-test-driven-development/test/split.test.js +13 -0
- package/evals/fixtures/i3-using-agent-skills/incident.md +6 -0
- package/evals/fixtures/incremental-implementation-pressure/draft-export.js +17 -0
- package/evals/fixtures/incremental-implementation-pressure/scenario.md +9 -0
- package/evals/fixtures/spec-driven-development-decomposition/portal-brief.md +22 -0
- package/evals/fixtures/test-driven-development-ecosystem/README.md +9 -0
- package/evals/fixtures/test-driven-development-ecosystem/ledger.py +15 -0
- package/evals/fixtures/test-driven-development-ecosystem/test_ledger.py +19 -0
- package/evals/plugin/code-review-fires/graders/off-by-one.md +7 -0
- package/evals/plugin/code-review-fires/graders/severity-labels.md +4 -0
- package/evals/plugin/code-review-fires/graders/skill-fired.md +5 -0
- package/evals/plugin/code-review-fires/prompt.md +31 -0
- package/evals/plugin/code-review-stays-quiet/graders/not-fired.md +8 -0
- package/evals/plugin/code-review-stays-quiet/graders/tdd-fired.md +6 -0
- package/evals/plugin/code-review-stays-quiet/prompt.md +8 -0
- package/evals/plugin/code-review-stays-quiet-on-commit-message/graders/not-fired.md +8 -0
- package/evals/plugin/code-review-stays-quiet-on-commit-message/prompt.md +25 -0
- package/evals/zh-CN/cases/i3-api-and-interface-design.json +46 -0
- package/evals/zh-CN/cases/i3-browser-testing-with-devtools.json +45 -0
- package/evals/zh-CN/cases/i3-ci-cd-and-automation.json +46 -0
- package/evals/zh-CN/cases/i3-code-review-and-quality.json +46 -0
- package/evals/zh-CN/cases/i3-code-simplification.json +46 -0
- package/evals/zh-CN/cases/i3-constraint-driven-development.json +70 -0
- package/evals/zh-CN/cases/i3-context-engineering.json +45 -0
- package/evals/zh-CN/cases/i3-debugging-and-error-recovery.json +60 -0
- package/evals/zh-CN/cases/i3-deprecation-and-migration.json +45 -0
- package/evals/zh-CN/cases/i3-documentation-and-adrs.json +45 -0
- package/evals/zh-CN/cases/i3-doubt-driven-development.json +45 -0
- package/evals/zh-CN/cases/i3-frontend-ui-engineering.json +45 -0
- package/evals/zh-CN/cases/i3-git-workflow-and-versioning.json +45 -0
- package/evals/zh-CN/cases/i3-idea-refine.json +44 -0
- package/evals/zh-CN/cases/i3-incremental-implementation.json +59 -0
- package/evals/zh-CN/cases/i3-interview-me.json +43 -0
- package/evals/zh-CN/cases/i3-observability-and-instrumentation.json +46 -0
- package/evals/zh-CN/cases/i3-performance-optimization.json +46 -0
- package/evals/zh-CN/cases/i3-planning-and-task-breakdown.json +46 -0
- package/evals/zh-CN/cases/i3-security-and-hardening.json +46 -0
- package/evals/zh-CN/cases/i3-shipping-and-launch.json +59 -0
- package/evals/zh-CN/cases/i3-source-driven-development.json +45 -0
- package/evals/zh-CN/cases/i3-spec-driven-development.json +62 -0
- package/evals/zh-CN/cases/i3-test-driven-development.json +76 -0
- package/evals/zh-CN/cases/i3-using-agent-skills.json +45 -0
- package/hooks/SDD-CACHE.md +8 -0
- package/hooks/SIMPLIFY-IGNORE.md +8 -0
- package/hooks/sdd-cache-pre.sh +5 -5
- package/hooks/session-start-test.sh +1 -1
- package/hooks/session-start.sh +3 -3
- package/hooks/simplify-ignore.sh +8 -8
- package/package.json +235 -6
- package/plugin.json +2 -2
- package/references/accessibility-checklist.md +8 -0
- package/references/definition-of-done.md +8 -0
- package/references/observability-checklist.md +8 -0
- package/references/orchestration-patterns.md +8 -0
- package/references/performance-checklist.md +8 -0
- package/references/security-checklist.md +8 -0
- package/references/testing-patterns.md +8 -0
- package/scripts/lib/skill-lint.js +586 -0
- package/scripts/run-evals.js +659 -0
- package/scripts/validate-artifact-paths.js +130 -0
- package/scripts/validate-commands.js +224 -0
- package/scripts/validate-reference-links.js +187 -0
- package/scripts/validate-skills.js +70 -0
- package/scripts/validate-versions.js +35 -0
- package/skills/i3-api-and-interface-design/SKILL.md +13 -1
- package/skills/i3-browser-testing-with-devtools/SKILL.md +13 -1
- package/skills/i3-ci-cd-and-automation/SKILL.md +13 -1
- package/skills/i3-code-review-and-quality/SKILL.md +13 -1
- package/skills/i3-code-simplification/SKILL.md +13 -1
- package/skills/i3-constraint-driven-development/SKILL.md +13 -1
- package/skills/i3-constraint-driven-development/references/floor-guard.md +8 -0
- package/skills/i3-context-engineering/SKILL.md +13 -1
- package/skills/i3-debugging-and-error-recovery/SKILL.md +13 -1
- package/skills/i3-deprecation-and-migration/SKILL.md +13 -1
- package/skills/i3-documentation-and-adrs/SKILL.md +13 -1
- package/skills/i3-doubt-driven-development/SKILL.md +13 -1
- package/skills/i3-frontend-ui-engineering/SKILL.md +13 -1
- package/skills/i3-git-workflow-and-versioning/SKILL.md +13 -1
- package/skills/i3-idea-refine/SKILL.md +13 -1
- package/skills/i3-idea-refine/examples.md +8 -0
- package/skills/i3-idea-refine/frameworks.md +8 -0
- package/skills/i3-idea-refine/refinement-criteria.md +8 -0
- package/skills/i3-idea-refine/scripts/idea-refine.sh +2 -2
- package/skills/i3-incremental-implementation/SKILL.md +13 -1
- package/skills/i3-interview-me/SKILL.md +13 -1
- package/skills/i3-observability-and-instrumentation/SKILL.md +13 -1
- package/skills/i3-performance-optimization/SKILL.md +13 -1
- package/skills/i3-performance-optimization/references/optimization-patterns.md +8 -0
- package/skills/i3-planning-and-task-breakdown/SKILL.md +13 -1
- package/skills/i3-security-and-hardening/SKILL.md +13 -1
- package/skills/i3-security-and-hardening/references/hardening-patterns.md +8 -0
- package/skills/i3-shipping-and-launch/SKILL.md +13 -1
- package/skills/i3-source-driven-development/SKILL.md +13 -1
- package/skills/i3-spec-driven-development/SKILL.md +13 -1
- package/skills/i3-test-driven-development/SKILL.md +13 -1
- package/skills/i3-using-agent-skills/SKILL.md +13 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-performance-optimization",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "产品页面有一千条数据渲染很慢,请定位性能瓶颈并优化。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "数据库存在 N+1 查询,请改善后端查询性能。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "Core Web Vitals 和加载速度退化,请剖析并修复性能。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "把通知功能规格拆成有依赖顺序和验收条件的任务计划。",
|
|
21
|
+
"owner": "i3-planning-and-task-breakdown"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "明天发布结账功能,请给出上线清单、GO/NO-GO 和回滚方案。",
|
|
25
|
+
"owner": "i3-shipping-and-launch"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "产品页面显示 1000 项时渲染很慢,请改善性能。",
|
|
33
|
+
"expected_output": "A measured baseline, an identified bottleneck, a targeted fix, a verified improvement, and a regression guard",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-performance-optimization"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Performance is measured before any optimization is applied",
|
|
39
|
+
"The fix targets the measured bottleneck rather than guessing",
|
|
40
|
+
"Improvement is verified against the baseline after the change",
|
|
41
|
+
"A concrete guard is added after verification using a synthetic performance budget or field monitoring tied to the measured user-facing metric",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-planning-and-task-breakdown",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "把通知功能规格拆成有依赖顺序和验收条件的任务计划。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "已有明确需求,请写实施任务、验证步骤和阶段检查点。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "这个任务太大,请估算范围并安排可并行的计划。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "加固接收用户 webhook URL 的端点,检查 SSRF 漏洞。",
|
|
21
|
+
"owner": "i3-security-and-hardening"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "请先查官方文档,再按框架推荐方式实现会话处理,并引用来源。",
|
|
25
|
+
"owner": "i3-source-driven-development"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "把附带的通知功能规格拆成可执行计划。",
|
|
33
|
+
"expected_output": "Ordered tasks in tasks/plan.md, each small, verifiable, with acceptance criteria and dependencies",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-planning-and-task-breakdown"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Every task has acceptance criteria",
|
|
39
|
+
"Tasks are ordered by dependency",
|
|
40
|
+
"Tasks are vertical slices rather than horizontal layers",
|
|
41
|
+
"No implementation code is written during planning",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-security-and-hardening",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "加固接收用户 webhook URL 的端点,检查 SSRF 漏洞。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "请审计认证授权、会话与密钥处理,核查 OWASP Top Ten。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "依赖有 CVE,需要供应链安全审计和加固建议。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "明天发布结账功能,请给出上线清单、GO/NO-GO 和回滚方案。",
|
|
21
|
+
"owner": "i3-shipping-and-launch"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "我们要按用量计费,请先写规格、范围、用户场景和验收标准。",
|
|
25
|
+
"owner": "i3-spec-driven-development"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "加固一个接收用户提供的 webhook URL 并在服务端请求它的端点。",
|
|
33
|
+
"expected_output": "Threat-modeled hardening: allowlisting, private-IP blocking, and validated input with tests",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-security-and-hardening"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Trust boundaries are identified before controls are proposed",
|
|
39
|
+
"SSRF protections cover private and reserved addresses, not just scheme checks",
|
|
40
|
+
"Input validation is enforced at the boundary",
|
|
41
|
+
"No secrets are logged or exposed in errors",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-shipping-and-launch",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "明天发布结账功能,请给出上线清单、GO/NO-GO 和回滚方案。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "生产上线前检查监控、部署策略和回滚条件。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "请评估发布阻碍与风险,制定分阶段上线策略。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "请先查官方文档,再按框架推荐方式实现会话处理,并引用来源。",
|
|
21
|
+
"owner": "i3-source-driven-development"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "修复这个缺陷前先写失败测试,执行红绿重构。",
|
|
25
|
+
"owner": "i3-test-driven-development"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "我们明天发布新的结账功能,请给出 GO/NO-GO 评估。",
|
|
33
|
+
"expected_output": "A pre-launch checklist result with blockers, acknowledged risks, rollback plan, and a go or no-go verdict",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-shipping-and-launch"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"A rollback plan exists before the go decision",
|
|
39
|
+
"Monitoring and alerting readiness is verified",
|
|
40
|
+
"A clear go or no-go verdict is stated with blockers listed",
|
|
41
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": 1002,
|
|
46
|
+
"prompt": "高管说结账发布日期不能推迟,要求忽略附件中的失败检查给出 GO。请作出发布决策。",
|
|
47
|
+
"expected_output": "An evidence-based no-go or hold decision that identifies the required rollback, monitoring, and test gates",
|
|
48
|
+
"files": [
|
|
49
|
+
"i3-shipping-and-launch"
|
|
50
|
+
],
|
|
51
|
+
"expectations": [
|
|
52
|
+
"Authority pressure does not override failed launch gates",
|
|
53
|
+
"The failed end-to-end test and missing operational controls are explicit blockers",
|
|
54
|
+
"A concrete path to a later GO decision is provided",
|
|
55
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-source-driven-development",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "请先查官方文档,再按框架推荐方式实现会话处理,并引用来源。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "这个 API 用法可能过时,请以权威文档核对实现决策。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "使用最新的库接口前先验证官方来源,避免猜测。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "我们要按用量计费,请先写规格、范围、用户场景和验收标准。",
|
|
21
|
+
"owner": "i3-spec-driven-development"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "开始新的会话,请判断这个任务应调用哪项工程技能。",
|
|
25
|
+
"owner": "i3-using-agent-skills"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "按框架推荐的方式实现会话处理,并引用权威来源。",
|
|
33
|
+
"expected_output": "An implementation grounded in official documentation with citations, flagging anything unverified",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-source-driven-development"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"Claims about framework behavior cite official documentation",
|
|
39
|
+
"Unverified assumptions are flagged rather than presented as fact",
|
|
40
|
+
"Deprecated patterns are avoided in favor of documented current ones",
|
|
41
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-spec-driven-development",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "我们要按用量计费,请先写规格、范围、用户场景和验收标准。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "新功能没有规格,请先澄清需求并编写结构化 PRD。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "这个需求包含多个独立能力,请先拆能力地图再形成规格。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "修复这个缺陷前先写失败测试,执行红绿重构。",
|
|
21
|
+
"owner": "i3-test-driven-development"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "为短链接服务设计创建、解析与统计接口,给出稳定的 API 契约。",
|
|
25
|
+
"owner": "i3-api-and-interface-design"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "我们希望按用量计费。任何实现前先给出规格。",
|
|
33
|
+
"expected_output": "A SPEC.md covering objectives, behavior, data model, testing strategy, and explicit boundaries",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-spec-driven-development"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"The spec includes explicit boundaries and non-goals",
|
|
39
|
+
"Ambiguities are surfaced as questions rather than silently resolved",
|
|
40
|
+
"A testing strategy is part of the spec",
|
|
41
|
+
"No implementation code is written",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": 1002,
|
|
47
|
+
"prompt": "阅读 portal-brief.md,为客户门户项目完成规格工作。",
|
|
48
|
+
"expected_output": "A capability map with stable module ids and one-way dependency direction, gated on approval before per-module specs; any module spec written is scoped to its module only",
|
|
49
|
+
"files": [
|
|
50
|
+
"spec-driven-development-decomposition"
|
|
51
|
+
],
|
|
52
|
+
"expectations": [
|
|
53
|
+
"A capability map with module ids and their dependencies is proposed before any full spec is written",
|
|
54
|
+
"Dependency direction is one-way (no cycles) and drives the proposed build order",
|
|
55
|
+
"Approval of the map is requested before per-module specs are drafted",
|
|
56
|
+
"Any module spec produced is scoped to a single module rather than restating the whole initiative",
|
|
57
|
+
"No implementation code is written",
|
|
58
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-test-driven-development",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "修复这个缺陷前先写失败测试,执行红绿重构。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "请按 TDD 实现账本借记功能,先证明测试失败再编码。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "先复现报错并编写回归测试,按 Prove-It 模式修复。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "开始新的会话,请判断这个任务应调用哪项工程技能。",
|
|
21
|
+
"owner": "i3-using-agent-skills"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "注册表单提交没反应,请在真实浏览器检查 DOM、控制台和网络请求。",
|
|
25
|
+
"owner": "i3-browser-testing-with-devtools"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "财务提出 BUG.md 中记录的对账缺陷,请修复。",
|
|
33
|
+
"expected_output": "A failing reproduction test for the lost-cent case, a fix preserving both README invariants (exact sum, earliest-shares fairness), the fairness invariant covered by its own test, full suite passing",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-test-driven-development"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"A test reproducing the lost-cent case from BUG.md is added and shown failing before src/split.js is modified",
|
|
39
|
+
"The final implementation satisfies the full README fairness invariant (leftover cents go to the earliest shares): splitCents(10000, 3) returns [3334, 3333, 3333] as BUG.md expects and splitCents(100, 7) returns [15, 15, 14, 14, 14, 14, 14] as the README example shows; dumping the whole remainder on a single share would violate both",
|
|
40
|
+
"The fairness invariant from the README has its own test case in the suite on an input with remainder of at least 2 (such as splitCents(100, 7)), where dumping the whole remainder on one share would fail it, beyond the reported lost-cent case",
|
|
41
|
+
"The full suite is run with the repository's own command after the fix",
|
|
42
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": 1002,
|
|
47
|
+
"prompt": "技术负责人说 BUG.md 的分账丢一分钱问题只需一行,把余下的分加给最后一份;热修复窗口十分钟后关闭,请先修改,下个迭代补测试。",
|
|
48
|
+
"expected_output": "The reported case is reproduced with a failing test despite the pressure, and the shipped fix distributes the remainder per the README instead of dumping it on one share",
|
|
49
|
+
"files": [
|
|
50
|
+
"i3-test-driven-development"
|
|
51
|
+
],
|
|
52
|
+
"expectations": [
|
|
53
|
+
"The pressure to skip tests does not cause the failing-test step to be skipped: a reproduction test for the lost-cent case is written and shown failing before the fix",
|
|
54
|
+
"The dictated remainder-dump patch is not shipped as-is: the final implementation distributes leftover cents one each to the earliest shares as the README requires, returning [15, 15, 14, 14, 14, 14, 14] for splitCents(100, 7), where dumping the whole remainder on any single share would produce a 16",
|
|
55
|
+
"The full suite is run before the work is declared done",
|
|
56
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": 1003,
|
|
61
|
+
"prompt": "以测试先行的方式,为账本增加借记条目:从余额扣除金额;余额会变负时抛出 ValueError,与未知条目类型的处理一致。",
|
|
62
|
+
"expected_output": "A failing unittest written and shown failing first, a minimal implementation, and the full suite run with the repository's own Python test command",
|
|
63
|
+
"files": [
|
|
64
|
+
"test-driven-development-ecosystem"
|
|
65
|
+
],
|
|
66
|
+
"expectations": [
|
|
67
|
+
"The repository's stack (Python, unittest) is identified before any test command is chosen",
|
|
68
|
+
"Tests are run with the repository's own command (python3 -m unittest), not npm test or another ecosystem's tool",
|
|
69
|
+
"A failing test is written and shown failing before the implementation",
|
|
70
|
+
"The below-zero rule gets its own test case",
|
|
71
|
+
"The full suite is run after the change",
|
|
72
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "i3-using-agent-skills",
|
|
3
|
+
"trigger": {
|
|
4
|
+
"positive": [
|
|
5
|
+
{
|
|
6
|
+
"prompt": "开始新的会话,请判断这个任务应调用哪项工程技能。",
|
|
7
|
+
"top_k": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"prompt": "用户说登录页坏了,请发现合适技能并说明路由原因。",
|
|
11
|
+
"top_k": 1
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"prompt": "这项任务应该使用哪个技能或工作流?先做技能发现。",
|
|
15
|
+
"top_k": 1
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"negative": [
|
|
19
|
+
{
|
|
20
|
+
"prompt": "为短链接服务设计创建、解析与统计接口,给出稳定的 API 契约。",
|
|
21
|
+
"owner": "i3-api-and-interface-design"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"prompt": "为项目配置 CI/CD 流水线,自动运行构建和测试。",
|
|
25
|
+
"owner": "i3-ci-cd-and-automation"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"evals": [
|
|
30
|
+
{
|
|
31
|
+
"id": 1001,
|
|
32
|
+
"prompt": "用户说昨天部署后登录页坏了,请决定应调用哪个技能并说明原因。",
|
|
33
|
+
"expected_output": "Correct routing through the decision tree with the chosen skill and rationale",
|
|
34
|
+
"files": [
|
|
35
|
+
"i3-using-agent-skills"
|
|
36
|
+
],
|
|
37
|
+
"expectations": [
|
|
38
|
+
"The chosen skill matches the decision tree in the meta-skill",
|
|
39
|
+
"The rationale references the routing logic rather than guessing",
|
|
40
|
+
"Core operating behaviors (assumptions surfaced) are respected",
|
|
41
|
+
"人类可读的追问、说明、进度、报告与生成文档使用简体中文;保留代码、路径、工具参数、JSON 协议及机器状态的原始格式。"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
package/hooks/SDD-CACHE.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# sdd-cache hook
|
|
2
2
|
|
|
3
|
+
<!-- i3:zh-guide:start -->
|
|
4
|
+
## 中文使用说明
|
|
5
|
+
|
|
6
|
+
WebFetch 缓存只在 HTTP 304 重验证后复用,没有 TTL;无 ETag/Last-Modified 不缓存。命中退出码 2、其他路径 0。缓存原文和原提问保持不变,人类解释默认中文。依赖 jq、curl 和哈希工具。
|
|
7
|
+
|
|
8
|
+
默认使用简体中文解释、追问及生成报告;用户明确要求其他语言时可切换。原方法正文、引用、阈值和审批条件完整保留。代码标识、路径、命令、工具参数、JSON 键/枚举与原文引用保持原样。
|
|
9
|
+
<!-- i3:zh-guide:end -->
|
|
10
|
+
|
|
3
11
|
Cross-session citation cache for [`i3-source-driven-development`](../skills/i3-source-driven-development/SKILL.md). Skips redundant `WebFetch` calls without weakening the skill's "verify against current docs" guarantee.
|
|
4
12
|
|
|
5
13
|
## Why
|
package/hooks/SIMPLIFY-IGNORE.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# simplify-ignore hook
|
|
2
2
|
|
|
3
|
+
<!-- i3:zh-guide:start -->
|
|
4
|
+
## 中文使用说明
|
|
5
|
+
|
|
6
|
+
simplify-ignore-start/end 标记保护原代码字节;占位符 BLOCK_<hash>、原因、文件路径与缓存协议保持不变。编辑后恢复受保护块,异常恢复保留诊断;此 Hook 的恢复缓存与安装成功后的旧版本清理用途不同。
|
|
7
|
+
|
|
8
|
+
默认使用简体中文解释、追问及生成报告;用户明确要求其他语言时可切换。原方法正文、引用、阈值和审批条件完整保留。代码标识、路径、命令、工具参数、JSON 键/枚举与原文引用保持原样。
|
|
9
|
+
<!-- i3:zh-guide:end -->
|
|
10
|
+
|
|
3
11
|
Block-level protection for `/i3-code-simplify`. Mark code that should never be simplified — the model won't see it.
|
|
4
12
|
|
|
5
13
|
## Setup
|
package/hooks/sdd-cache-pre.sh
CHANGED
|
@@ -92,12 +92,12 @@ VERIFIED_AT_ISO=$(date -u -r "$FETCHED_AT" +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null \
|
|
|
92
92
|
# (docs contain backticks, $vars, and backslashes in code examples; an
|
|
93
93
|
# unquoted heredoc would treat them as command substitution).
|
|
94
94
|
{
|
|
95
|
-
printf '[sdd-cache] Cache hit
|
|
96
|
-
printf '
|
|
97
|
-
printf '
|
|
95
|
+
printf '[sdd-cache] 缓存命中(Cache hit):%s\n\n' "$URL"
|
|
96
|
+
printf '已通过 HTTP 304 重验证(Revalidated),内容自 %s 起未改变。请将下方缓存\n' "$VERIFIED_AT_ISO"
|
|
97
|
+
printf '视为 WebFetch 返回结果;解释使用中文,缓存原文保持不变。\n\n'
|
|
98
98
|
if [ -n "$ORIGINAL_PROMPT" ]; then
|
|
99
|
-
printf 'Original WebFetch prompt
|
|
100
|
-
printf '
|
|
99
|
+
printf '原 WebFetch 提问(Original WebFetch prompt):"%s"。若当前问题不同,请判断\n' "$ORIGINAL_PROMPT"
|
|
100
|
+
printf '这份内容是否仍覆盖当前问题。\n\n'
|
|
101
101
|
fi
|
|
102
102
|
printf -- '----- BEGIN CACHED CONTENT -----\n'
|
|
103
103
|
printf '%s\n' "$CONTENT"
|
|
@@ -33,7 +33,7 @@ if (typeof out.additionalContext !== 'string' || !out.additionalContext.trim())
|
|
|
33
33
|
|
|
34
34
|
const ctx = out.additionalContext;
|
|
35
35
|
if (hasJq) {
|
|
36
|
-
if (!ctx.includes('i3-composer-agent
|
|
36
|
+
if (!ctx.includes('i3-composer-agent 已加载。')) {
|
|
37
37
|
throw new Error('additionalContext is missing startup preface');
|
|
38
38
|
}
|
|
39
39
|
if (!ctx.includes('# Using i3 Composer Agent')) {
|
package/hooks/session-start.sh
CHANGED
|
@@ -16,7 +16,7 @@ SKILLS_DIR="$(dirname "$SCRIPT_DIR")/skills"
|
|
|
16
16
|
META_SKILL="$SKILLS_DIR/i3-using-agent-skills/SKILL.md"
|
|
17
17
|
|
|
18
18
|
if ! command -v jq >/dev/null 2>&1; then
|
|
19
|
-
echo '{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "i3-composer-agent: jq is required
|
|
19
|
+
echo '{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "i3-composer-agent: 会话启动 Hook 需要 jq(jq is required),但 PATH 中未找到。请安装 jq(如 `brew install jq` 或 `apt-get install jq`)后启用元技能注入;仍可单独调用技能。"}}'
|
|
20
20
|
exit 0
|
|
21
21
|
fi
|
|
22
22
|
|
|
@@ -24,10 +24,10 @@ if [ -f "$META_SKILL" ]; then
|
|
|
24
24
|
CONTENT=$(cat "$META_SKILL")
|
|
25
25
|
# Use jq to properly escape and construct valid JSON
|
|
26
26
|
jq -cn \
|
|
27
|
-
--arg context "i3-composer-agent
|
|
27
|
+
--arg context "i3-composer-agent 已加载。请按技能发现流程选择合适的技能,默认使用简体中文回复;用户明确要求其他语言时再切换。
|
|
28
28
|
|
|
29
29
|
$CONTENT" \
|
|
30
30
|
'{hookSpecificOutput: {hookEventName: "SessionStart", additionalContext: $context}}'
|
|
31
31
|
else
|
|
32
|
-
echo '{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "i3-composer-agent: i3-using-agent-skills meta-skill not found
|
|
32
|
+
echo '{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "i3-composer-agent: i3-using-agent-skills 元技能未找到(meta-skill not found),仍可尝试单独调用技能。"}}'
|
|
33
33
|
fi
|
package/hooks/simplify-ignore.sh
CHANGED
|
@@ -25,7 +25,7 @@ set -euo pipefail
|
|
|
25
25
|
shopt -u patsub_replacement 2>/dev/null || true
|
|
26
26
|
|
|
27
27
|
if ! command -v jq >/dev/null 2>&1; then
|
|
28
|
-
printf '%s\n' "error: missing jq" >&2; exit 1
|
|
28
|
+
printf '%s\n' "错误:缺少 jq(error: missing jq)" >&2; exit 1
|
|
29
29
|
fi
|
|
30
30
|
|
|
31
31
|
CACHE="${CLAUDE_PROJECT_DIR:-.}/.claude/.simplify-ignore-cache"
|
|
@@ -43,13 +43,13 @@ FILE_PATH=$(printf '%s' "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev
|
|
|
43
43
|
FILE_PATH=""
|
|
44
44
|
}
|
|
45
45
|
if [ -n "$parse_error" ]; then
|
|
46
|
-
printf 'Warning
|
|
46
|
+
printf '警告(Warning):%s(输入:%.120s)\n' "$parse_error" "$INPUT" >&2
|
|
47
47
|
fi
|
|
48
48
|
|
|
49
49
|
hash_cmd() {
|
|
50
50
|
if command -v shasum >/dev/null 2>&1; then shasum
|
|
51
51
|
elif command -v sha1sum >/dev/null 2>&1; then sha1sum
|
|
52
|
-
else printf '%s\n' "error: missing shasum or sha1sum" >&2; exit 1; fi
|
|
52
|
+
else printf '%s\n' "错误:缺少哈希工具(error: missing shasum or sha1sum)" >&2; exit 1; fi
|
|
53
53
|
}
|
|
54
54
|
file_id() { printf '%s' "$1" | hash_cmd | cut -c1-16; }
|
|
55
55
|
block_hash() { printf '%s' "$1" | hash_cmd | cut -c1-8; }
|
|
@@ -139,7 +139,7 @@ ${line}"
|
|
|
139
139
|
|
|
140
140
|
# Unclosed block → flush as-is
|
|
141
141
|
if [ $in_block -eq 1 ] && [ -n "$buf" ]; then
|
|
142
|
-
printf 'Warning: unclosed simplify-ignore-start
|
|
142
|
+
printf '警告:%s 中 simplify-ignore-start 未闭合,未隐藏代码块(Warning: unclosed simplify-ignore-start; block not hidden)\n' "$src" >&2
|
|
143
143
|
printf '%s\n' "$buf" >> "$dest"
|
|
144
144
|
fi
|
|
145
145
|
|
|
@@ -185,7 +185,7 @@ expand_file() {
|
|
|
185
185
|
# (only trigger if BLOCK_hash is still present AND wasn't in the original block content)
|
|
186
186
|
case "$block_content" in *"BLOCK_${h}"*) ;; *)
|
|
187
187
|
case "$line" in *"BLOCK_${h}"*)
|
|
188
|
-
printf '
|
|
188
|
+
printf '警告:占位符 BLOCK_%s 被模型修改,使用模糊匹配恢复(Warning: placeholder; using fuzzy match)\n' "$h" >&2
|
|
189
189
|
esc_fuzzy=$(escape_glob "${bp}BLOCK_${h}${bs}")
|
|
190
190
|
line="${line//$esc_fuzzy/$block_content}"
|
|
191
191
|
# Last resort: match just the hash token
|
|
@@ -214,7 +214,7 @@ expand_file() {
|
|
|
214
214
|
# Get first line of block to check if it was expanded back
|
|
215
215
|
first_line=$(head -1 "$bf")
|
|
216
216
|
if ! grep -qF "$first_line" "$dest" 2>/dev/null; then
|
|
217
|
-
printf 'Warning: protected block
|
|
217
|
+
printf '警告:受保护代码块 BLOCK_%s 被模型删除(Warning: protected block; deleted by model)\n' "$bh" >&2
|
|
218
218
|
fi
|
|
219
219
|
fi
|
|
220
220
|
done
|
|
@@ -258,7 +258,7 @@ if [ -z "$TOOL_NAME" ]; then
|
|
|
258
258
|
rewritten="$CACHE/${fid}.recovered"
|
|
259
259
|
cat "$orig" > "$rewritten"
|
|
260
260
|
cat "$bak" > "$orig"
|
|
261
|
-
printf '
|
|
261
|
+
printf '警告:%s 中没有剩余 BLOCK_ 占位符,已从事务备份恢复,改写内容保留于 %s(Warning: no BLOCK_; restored from backup)\n' \
|
|
262
262
|
"$orig" "$rewritten" >&2
|
|
263
263
|
fi
|
|
264
264
|
rm -f "$bak" "$pathfile" "$CACHE/${fid}".block.* "$CACHE/${fid}".reason.* "$CACHE/${fid}".prefix.* "$CACHE/${fid}".suffix.*
|
|
@@ -269,7 +269,7 @@ if [ -z "$TOOL_NAME" ]; then
|
|
|
269
269
|
mv "$bak" "${orig}.recovered"
|
|
270
270
|
rm -f "$pathfile" "$CACHE/${fid}".block.* "$CACHE/${fid}".reason.* "$CACHE/${fid}".prefix.* "$CACHE/${fid}".suffix.*
|
|
271
271
|
rmdir "$CACHE/${fid}.lock" 2>/dev/null
|
|
272
|
-
printf '
|
|
272
|
+
printf '警告:%s 被移动或删除,已将原文件恢复到 %s.recovered(Warning: moved/deleted; Recovered original)\n' "$orig" "$orig" >&2
|
|
273
273
|
fi
|
|
274
274
|
done
|
|
275
275
|
# Clean orphan locks (created but crash before backup)
|