ai-delivery-workflow 0.2.2
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 -0
- package/README.md +112 -0
- package/bin/ai-delivery.mjs +138 -0
- package/bin/validate-skills.mjs +12 -0
- package/docs/DUAL-REPOSITORY-WORKSPACE.zh-CN.md +125 -0
- package/docs/EVOLUTION-MAINTENANCE.zh-CN.md +75 -0
- package/docs/EVOLUTION-USER-GUIDE.zh-CN.md +160 -0
- package/docs/FILE-REFERENCE.zh-CN.md +503 -0
- package/docs/PROJECT-MANUAL.zh-CN.md +931 -0
- package/docs/STATE-CLI-MAINTENANCE.zh-CN.md +135 -0
- package/docs/STATE-CLI-USER-GUIDE.zh-CN.md +186 -0
- package/docs/VIEWER-MAINTENANCE.zh-CN.md +373 -0
- package/docs/VIEWER-USER-GUIDE.zh-CN.md +235 -0
- package/lib/delivery-state.mjs +1220 -0
- package/lib/evolution.mjs +971 -0
- package/lib/project-bootstrap.mjs +927 -0
- package/lib/project-installer.mjs +1184 -0
- package/lib/skill-validator.mjs +154 -0
- package/lib/toml-hooks.mjs +97 -0
- package/lib/workspace.mjs +302 -0
- package/lib/yaml-runtime.mjs +18 -0
- package/package.json +39 -0
- package/skills/ai-delivery-assemble-release/SKILL.md +27 -0
- package/skills/ai-delivery-assemble-release/agents/openai.yaml +4 -0
- package/skills/ai-delivery-assemble-release/assets/release-candidate-manifest.yaml +22 -0
- package/skills/ai-delivery-assemble-release/assets/release-git-plan.yaml +9 -0
- package/skills/ai-delivery-assemble-release/assets/release-material-index.csv +2 -0
- package/skills/ai-delivery-assemble-release/assets/version-inclusion.csv +2 -0
- package/skills/ai-delivery-assemble-release/references/release-assembly-contract.md +7 -0
- package/skills/ai-delivery-assemble-release/scripts/plan-release.mjs +298 -0
- package/skills/ai-delivery-bootstrap/SKILL.md +59 -0
- package/skills/ai-delivery-bootstrap/agents/openai.yaml +4 -0
- package/skills/ai-delivery-bootstrap/references/bootstrap-contract.md +70 -0
- package/skills/ai-delivery-checkpoint-task/SKILL.md +63 -0
- package/skills/ai-delivery-checkpoint-task/agents/openai.yaml +4 -0
- package/skills/ai-delivery-checkpoint-task/assets/codex-hook-config.toml +92 -0
- package/skills/ai-delivery-checkpoint-task/assets/runtime-template/resume.md +15 -0
- package/skills/ai-delivery-checkpoint-task/assets/runtime-template/task.json +30 -0
- package/skills/ai-delivery-checkpoint-task/assets/runtime-template/version-archive.json +10 -0
- package/skills/ai-delivery-checkpoint-task/references/checkpoint-contract.md +95 -0
- package/skills/ai-delivery-checkpoint-task/references/checkpoint-recovery.zh-CN.md +111 -0
- package/skills/ai-delivery-checkpoint-task/scripts/hook-event.mjs +131 -0
- package/skills/ai-delivery-checkpoint-task/scripts/task-state.mjs +1073 -0
- package/skills/ai-delivery-close-version/SKILL.md +33 -0
- package/skills/ai-delivery-close-version/agents/openai.yaml +4 -0
- package/skills/ai-delivery-close-version/assets/line-advance-record.yaml +12 -0
- package/skills/ai-delivery-close-version/assets/version-lineage.yaml +12 -0
- package/skills/ai-delivery-close-version/assets/version-manifest.yaml +20 -0
- package/skills/ai-delivery-close-version/references/version-closeout-contract.md +20 -0
- package/skills/ai-delivery-define-product/SKILL.md +76 -0
- package/skills/ai-delivery-define-product/agents/openai.yaml +4 -0
- package/skills/ai-delivery-define-product/assets/product-template/acceptance-criteria.csv +1 -0
- package/skills/ai-delivery-define-product/assets/product-template/discovery-baseline.md +19 -0
- package/skills/ai-delivery-define-product/assets/product-template/feature-detail.md +19 -0
- package/skills/ai-delivery-define-product/assets/product-template/feature-terminals.csv +1 -0
- package/skills/ai-delivery-define-product/assets/product-template/features.csv +1 -0
- package/skills/ai-delivery-define-product/assets/product-template/product-baseline.yaml +8 -0
- package/skills/ai-delivery-define-product/assets/product-template/product-manual.md +24 -0
- package/skills/ai-delivery-define-product/assets/product-template/terminals.csv +1 -0
- package/skills/ai-delivery-define-product/assets/product-template/user-stories.csv +1 -0
- package/skills/ai-delivery-define-product/references/product-contract.md +57 -0
- package/skills/ai-delivery-deploy-production/SKILL.md +45 -0
- package/skills/ai-delivery-deploy-production/agents/openai.yaml +4 -0
- package/skills/ai-delivery-deploy-production/references/deployment-contract.md +7 -0
- package/skills/ai-delivery-design-architecture/SKILL.md +67 -0
- package/skills/ai-delivery-design-architecture/agents/openai.yaml +4 -0
- package/skills/ai-delivery-design-architecture/assets/architecture-template/architecture-baseline.md +25 -0
- package/skills/ai-delivery-design-architecture/assets/architecture-template/architecture-gate.yaml +15 -0
- package/skills/ai-delivery-design-architecture/assets/architecture-template/prototype-architecture-validation.yaml +58 -0
- package/skills/ai-delivery-design-architecture/references/architecture-contract.md +32 -0
- package/skills/ai-delivery-design-experience/SKILL.md +71 -0
- package/skills/ai-delivery-design-experience/agents/openai.yaml +4 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/canvas-catalog.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/canvas-pages.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/component-state-matrix.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/design-tokens.json +19 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/experience-baseline.yaml +17 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/experience-change-domains.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/experience-change-set.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/feature-screen-coverage.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/formal-ui-confirmation.yaml +33 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/interaction-contract.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/low-fidelity-confirmation.yaml +32 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/page-catalog.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/page-component-map.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/product-prototype-reconciliation.yaml +28 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-adjustment-log.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-confirmation.yaml +99 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-file-terminals.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-files.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-impact-assessment.yaml +25 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-manifest.yaml +74 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-product-coverage.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-comments.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-decision.yaml +29 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-review-sessions.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-set.yaml +22 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-tool-candidates.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-tool-selection.yaml +22 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/prototype-traceability.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/requirement-change-set.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/screen-states.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-framework-candidates.csv +1 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-framework-selection.yaml +18 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/ui-handoff.yaml +44 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-direction.yaml +16 -0
- package/skills/ai-delivery-design-experience/assets/experience-template/visual-system-confirmation.yaml +31 -0
- package/skills/ai-delivery-design-experience/references/experience-contract.md +82 -0
- package/skills/ai-delivery-design-experience/references/prototype-management-contract.md +68 -0
- package/skills/ai-delivery-design-tests/SKILL.md +56 -0
- package/skills/ai-delivery-design-tests/agents/openai.yaml +4 -0
- package/skills/ai-delivery-design-tests/assets/test-design-template/iteration-test-contract.md +19 -0
- package/skills/ai-delivery-design-tests/assets/test-design-template/prototype-test-scope.csv +1 -0
- package/skills/ai-delivery-design-tests/assets/test-design-template/prototype-test-validation.yaml +73 -0
- package/skills/ai-delivery-design-tests/references/test-design-contract.md +31 -0
- package/skills/ai-delivery-develop-iteration/SKILL.md +66 -0
- package/skills/ai-delivery-develop-iteration/agents/openai.yaml +4 -0
- package/skills/ai-delivery-develop-iteration/assets/development-template/task-experience-change-traceability.csv +1 -0
- package/skills/ai-delivery-develop-iteration/assets/development-template/task-prototype-traceability.csv +1 -0
- package/skills/ai-delivery-develop-iteration/references/development-contract.md +39 -0
- package/skills/ai-delivery-evolve-workflow/SKILL.md +57 -0
- package/skills/ai-delivery-evolve-workflow/agents/openai.yaml +4 -0
- package/skills/ai-delivery-evolve-workflow/references/evolution-contract.md +42 -0
- package/skills/ai-delivery-execute-test/SKILL.md +34 -0
- package/skills/ai-delivery-execute-test/agents/openai.yaml +4 -0
- package/skills/ai-delivery-execute-test/references/test-execution-contract.md +7 -0
- package/skills/ai-delivery-execute-work-package/SKILL.md +53 -0
- package/skills/ai-delivery-execute-work-package/agents/openai.yaml +4 -0
- package/skills/ai-delivery-execute-work-package/references/work-package-contract.md +20 -0
- package/skills/ai-delivery-manage-git/SKILL.md +60 -0
- package/skills/ai-delivery-manage-git/agents/openai.yaml +4 -0
- package/skills/ai-delivery-manage-git/references/git-policy.md +42 -0
- package/skills/ai-delivery-manage-standards/SKILL.md +44 -0
- package/skills/ai-delivery-manage-standards/agents/openai.yaml +4 -0
- package/skills/ai-delivery-manage-standards/assets/standards-template/standard.md +25 -0
- package/skills/ai-delivery-manage-standards/references/standards-contract.md +20 -0
- package/skills/ai-delivery-orchestrate/SKILL.md +105 -0
- package/skills/ai-delivery-orchestrate/agents/openai.yaml +4 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.codex/config.toml +92 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.gitattributes +6 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/artifact-registry.yaml +3 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/project.yaml +6 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/standards-baseline.yaml +8 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/delivery/workflow-state.yaml +34 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/evolution/decisions/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/evolution/experiments/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/evolution/feedback/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/evolution/index.yaml +7 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/evolution/promotion/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/evolution/proposals/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/extensions/.gitkeep +0 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/standards/STD-ARTIFACT-PATH-001.md +47 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/standards/STD-DOC-LANG-001.md +62 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/standards/STD-TEST-LOCATION-001.md +23 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/standards/index.yaml +36 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/bootstrap/bootstrap.mjs +33 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/evolution/evolve.mjs +15 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/hooks/hook-event.mjs +131 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/state/state.mjs +21 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/app.js +546 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/index.html +199 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/public/styles.css +529 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/server.mjs +780 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.cmd +4 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.ps1 +2 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/viewer/start.sh +4 -0
- package/skills/ai-delivery-orchestrate/assets/project-template/AGENTS.md +44 -0
- package/skills/ai-delivery-orchestrate/references/formal-state-contract.md +64 -0
- package/skills/ai-delivery-orchestrate/references/workflow-model.md +29 -0
- package/skills/ai-delivery-orchestrate-release/SKILL.md +33 -0
- package/skills/ai-delivery-orchestrate-release/agents/openai.yaml +4 -0
- package/skills/ai-delivery-orchestrate-release/assets/release-request.yaml +9 -0
- package/skills/ai-delivery-orchestrate-release/assets/version-selection.yaml +16 -0
- package/skills/ai-delivery-orchestrate-release/references/release-workflow-contract.md +11 -0
- package/skills/ai-delivery-plan-iteration/SKILL.md +57 -0
- package/skills/ai-delivery-plan-iteration/agents/openai.yaml +4 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/backlog.csv +1 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/slice-dependencies.csv +1 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/slice-experience-change-traceability.csv +1 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/slice-prototype-traceability.csv +1 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/slice-sources.csv +1 -0
- package/skills/ai-delivery-plan-iteration/assets/planning-template/vertical-slices.csv +1 -0
- package/skills/ai-delivery-plan-iteration/references/planning-contract.md +40 -0
- package/skills/ai-delivery-prepare-platform/SKILL.md +49 -0
- package/skills/ai-delivery-prepare-platform/agents/openai.yaml +4 -0
- package/skills/ai-delivery-prepare-platform/assets/platform-template/environment-ledger.csv +1 -0
- package/skills/ai-delivery-prepare-platform/references/platform-contract.md +18 -0
- package/skills/ai-delivery-prepare-release/SKILL.md +47 -0
- package/skills/ai-delivery-prepare-release/agents/openai.yaml +4 -0
- package/skills/ai-delivery-prepare-release/assets/release-template/delivery-items.csv +1 -0
- package/skills/ai-delivery-prepare-release/assets/release-template/release-manifest.yaml +18 -0
- package/skills/ai-delivery-prepare-release/references/release-contract.md +21 -0
- package/skills/ai-delivery-review-change/SKILL.md +40 -0
- package/skills/ai-delivery-review-change/agents/openai.yaml +4 -0
- package/skills/ai-delivery-review-change/references/review-contract.md +20 -0
- package/skills/ai-delivery-triage-failure/SKILL.md +45 -0
- package/skills/ai-delivery-triage-failure/agents/openai.yaml +4 -0
- package/skills/ai-delivery-triage-failure/references/failure-routing-contract.md +13 -0
- package/skills/ai-delivery-validate-artifacts/SKILL.md +37 -0
- package/skills/ai-delivery-validate-artifacts/agents/openai.yaml +4 -0
- package/skills/ai-delivery-validate-artifacts/references/artifact-contract.md +44 -0
- package/skills/ai-delivery-verify-candidate/SKILL.md +56 -0
- package/skills/ai-delivery-verify-candidate/agents/openai.yaml +4 -0
- package/skills/ai-delivery-verify-candidate/assets/verification-template/defect-artifacts.csv +1 -0
- package/skills/ai-delivery-verify-candidate/assets/verification-template/defects.csv +1 -0
- package/skills/ai-delivery-verify-candidate/assets/verification-template/test-work-packages.csv +1 -0
- package/skills/ai-delivery-verify-candidate/references/candidate-verification-contract.md +23 -0
- package/skills/ai-delivery-verify-production/SKILL.md +50 -0
- package/skills/ai-delivery-verify-production/agents/openai.yaml +4 -0
- package/skills/ai-delivery-verify-production/assets/production-verification-template/production-verification.md +15 -0
- package/skills/ai-delivery-verify-production/references/production-verification-contract.md +14 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# STD-ARTIFACT-PATH-001 研发文档默认输出到 .workflow
|
|
2
|
+
|
|
3
|
+
## 元数据
|
|
4
|
+
|
|
5
|
+
- 版本:1.0.0
|
|
6
|
+
- 状态:approved
|
|
7
|
+
- 生效日期:2026-07-16
|
|
8
|
+
- 适用范围:工作流状态、研发过程文档、结构化交付物、审阅材料和验证证据
|
|
9
|
+
|
|
10
|
+
## 规则
|
|
11
|
+
|
|
12
|
+
1. AI 生成的研发流程文档默认写入项目根目录 `.workflow/`,不得散落在项目根目录或源码目录。
|
|
13
|
+
2. 工作流控制文件使用 `.workflow/delivery/`:
|
|
14
|
+
- `project.yaml`
|
|
15
|
+
- `workflow-state.yaml`
|
|
16
|
+
- `artifact-registry.yaml`
|
|
17
|
+
- `standards-baseline.yaml`
|
|
18
|
+
- `bootstrap/`
|
|
19
|
+
- `runtime/`
|
|
20
|
+
3. 项目规范使用 `.workflow/standards/`。
|
|
21
|
+
4. 长期产品、架构和体验基线,以及迭代节点交付物,必须位于 `.workflow/` 内;推荐使用:
|
|
22
|
+
- `.workflow/product/`
|
|
23
|
+
- `.workflow/architecture/`
|
|
24
|
+
- `.workflow/experience/`
|
|
25
|
+
- `.workflow/iterations/<iteration-id>/<node-id>/`
|
|
26
|
+
5. Markdown、CSV、YAML、JSON、JSONL、图表、原型清单、评审记录、测试报告、发布清单、部署记录和验证证据均属于本规范所称的研发文档。
|
|
27
|
+
6. 文档中的路径引用应使用相对项目根目录的 `.workflow/...` 路径,并在正式产物注册表中记录稳定 ID、版本和 checksum。
|
|
28
|
+
7. `.workflow/` 默认纳入版本控制;只有 `.workflow/delivery/runtime/` 属于本地运行时并加入 Git 忽略。
|
|
29
|
+
|
|
30
|
+
## 明确例外
|
|
31
|
+
|
|
32
|
+
以下文件或目录因工具发现、执行或制品管理要求保留原位置:
|
|
33
|
+
|
|
34
|
+
- 根目录 `AGENTS.md` 和 `.gitignore`;
|
|
35
|
+
- `.agents/skills/`;
|
|
36
|
+
- `.codex/config.toml`;
|
|
37
|
+
- 应用源码、自动化测试源码、依赖清单和仓库配置;
|
|
38
|
+
- 编译输出、容器镜像、发布二进制和其他非文档制品,其位置由构建与制品契约决定。
|
|
39
|
+
|
|
40
|
+
即使非文档制品位于 `.workflow/` 外,描述其身份、digest、部署、验证和回滚的文档仍必须位于 `.workflow/`。
|
|
41
|
+
|
|
42
|
+
## 验证
|
|
43
|
+
|
|
44
|
+
- 新项目安装后必须存在 `.workflow/delivery/` 和 `.workflow/standards/`。
|
|
45
|
+
- `.gitignore` 必须忽略 `.workflow/delivery/runtime/`,不得忽略整个 `.workflow/`。
|
|
46
|
+
- 节点交接前,验证所有新产生的研发文档路径均位于 `.workflow/` 或属于上述明确例外。
|
|
47
|
+
- 发现根目录或源码目录中的未授权流程文档时,节点不得放行;应迁移到 `.workflow/` 并更新所有引用和 checksum。
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: STD-DOC-LANG-001
|
|
3
|
+
title: 研发文档默认使用中文
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: approved
|
|
6
|
+
scope:
|
|
7
|
+
- documentation
|
|
8
|
+
- delivery-artifacts
|
|
9
|
+
- human-facing-output
|
|
10
|
+
effective_from: "2026-07-15"
|
|
11
|
+
supersedes: null
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# 规则
|
|
15
|
+
|
|
16
|
+
所有新建或修订的面向人阅读的研发文档、交付说明、评审报告、风险说明和决策结论默认使用简体中文。
|
|
17
|
+
|
|
18
|
+
# 适用范围
|
|
19
|
+
|
|
20
|
+
- Markdown、纯文本、产品手册、需求说明、架构说明、体验说明、测试方案、测试报告、评审报告、发布说明、部署记录和生产验证报告。
|
|
21
|
+
- CSV、YAML、JSON 等结构化产物中的人类可读标题、描述、理由、风险、结论和备注字段。
|
|
22
|
+
- AI 向用户输出的流程状态、交接摘要和异常说明。
|
|
23
|
+
|
|
24
|
+
# 排除项
|
|
25
|
+
|
|
26
|
+
- 源代码标识符、命令、参数、文件路径、环境变量、稳定 ID、哈希、版本号和日志原文。
|
|
27
|
+
- 既定 CSV/YAML/JSON 字段名、API 路径、协议字段、Schema、枚举值和第三方系统要求的固定文本。
|
|
28
|
+
- 外部专有名词、标准名称和引用标题;保留原文,并在必要时补充中文解释。
|
|
29
|
+
- 已批准、已发布或已归档的不可变历史产物,不因本规范追溯改写。
|
|
30
|
+
- 用户在当前任务中明确指定其他语言的输出。
|
|
31
|
+
|
|
32
|
+
# 正确示例
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
# 发布风险
|
|
36
|
+
|
|
37
|
+
本版本新增任务创建接口。主要风险是进程重启后内存数据丢失,该限制已在 V1 产品范围中接受。
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
release_id: REL-V1
|
|
42
|
+
decision: released
|
|
43
|
+
summary: "生产验证通过,版本可以归档。"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
# 错误示例
|
|
47
|
+
|
|
48
|
+
在没有外部格式要求或用户语言要求时,产品说明、架构结论和风险分析全部使用英文叙述。
|
|
49
|
+
|
|
50
|
+
# 验证
|
|
51
|
+
|
|
52
|
+
- 产出节点在交接前检查标题、正文、结论、风险和备注是否以中文为默认语言。
|
|
53
|
+
- 下游验证节点检查技术原文是否被错误翻译,以及人类可读叙述是否无理由使用其他语言。
|
|
54
|
+
- 产物 Schema 允许时,在基线或清单元数据中记录 `document_language: zh-CN`。
|
|
55
|
+
|
|
56
|
+
# 例外
|
|
57
|
+
|
|
58
|
+
用户明确要求其他语言、外部系统强制固定语言,或为了保持协议兼容性必须使用原文时可以例外。例外必须记录原因和影响范围,不得扩展到无关文档。
|
|
59
|
+
|
|
60
|
+
# 违规处理
|
|
61
|
+
|
|
62
|
+
行为:`return`。下游节点将不符合规范的文档退回原产出节点修订;不得由验证节点静默翻译或修改正式产物。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# STD-TEST-LOCATION-001 应用测试遵循代码仓库原生约定
|
|
2
|
+
|
|
3
|
+
## 元数据
|
|
4
|
+
|
|
5
|
+
- 版本:1.1.0
|
|
6
|
+
- 状态:approved
|
|
7
|
+
- 生效日期:2026-07-18
|
|
8
|
+
- 适用范围:应用自动化测试、测试入口、测试辅助代码、测试运行输出
|
|
9
|
+
|
|
10
|
+
## 规则
|
|
11
|
+
|
|
12
|
+
1. 应用测试必须存放在 `.workflow/config/workspace.yaml` 中 `code_repository.path` 所指代码仓库,并遵循该代码仓库已有框架、命名和目录约定。
|
|
13
|
+
2. 不得为了满足工作流而强制创建固定的 `test/` 目录;已有 `tests/`、`__tests__/`、模块同目录测试或框架默认目录均可继续使用。
|
|
14
|
+
3. 测试源码、夹具和测试配置不得写入 `.workflow/`;`.workflow/` 只记录测试计划、追踪关系、命令、结果摘要和证据引用。
|
|
15
|
+
4. 测试运行生成的缓存、日志、覆盖率、临时数据库和环境副本按代码仓库现有规则忽略,不得登记为正式交付物。
|
|
16
|
+
5. 候选验证与发布物料必须引用实际测试命令、代码 commit、证据路径和 checksum,不能依赖未受版本管理的临时输出证明通过。
|
|
17
|
+
6. 新增、移动或删除应用测试时,同步更新代码仓库测试命令和受影响的工作流追踪物料。
|
|
18
|
+
|
|
19
|
+
## 验证
|
|
20
|
+
|
|
21
|
+
- 架构和开发工作包声明的测试命令必须在代码仓库中可执行。
|
|
22
|
+
- `.workflow/` 中不得出现应用测试源码或测试运行缓存。
|
|
23
|
+
- 候选验证必须能从正式证据追溯到对应代码 commit 和测试命令。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
standards:
|
|
2
|
+
- id: STD-DOC-LANG-001
|
|
3
|
+
title: 研发文档默认使用中文
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
status: approved
|
|
6
|
+
scope:
|
|
7
|
+
- documentation
|
|
8
|
+
- delivery-artifacts
|
|
9
|
+
- human-facing-output
|
|
10
|
+
effective_from: "2026-07-15"
|
|
11
|
+
superseded_id: null
|
|
12
|
+
path: STD-DOC-LANG-001.md
|
|
13
|
+
- id: STD-ARTIFACT-PATH-001
|
|
14
|
+
title: 研发文档默认输出到 .workflow
|
|
15
|
+
version: 1.0.0
|
|
16
|
+
status: approved
|
|
17
|
+
scope:
|
|
18
|
+
- documentation
|
|
19
|
+
- delivery-artifacts
|
|
20
|
+
- workflow-state
|
|
21
|
+
- human-facing-output
|
|
22
|
+
effective_from: "2026-07-16"
|
|
23
|
+
superseded_id: null
|
|
24
|
+
path: STD-ARTIFACT-PATH-001.md
|
|
25
|
+
- id: STD-TEST-LOCATION-001
|
|
26
|
+
title: 应用测试遵循代码仓库原生约定
|
|
27
|
+
version: 1.1.0
|
|
28
|
+
status: approved
|
|
29
|
+
scope:
|
|
30
|
+
- application-tests
|
|
31
|
+
- test-entrypoints
|
|
32
|
+
- test-helpers
|
|
33
|
+
- test-runtime-output
|
|
34
|
+
effective_from: "2026-07-18"
|
|
35
|
+
superseded_id: null
|
|
36
|
+
path: STD-TEST-LOCATION-001.md
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { bootstrapProject, inspectProjectState } from "./project-bootstrap.mjs";
|
|
5
|
+
|
|
6
|
+
function usage() {
|
|
7
|
+
return [
|
|
8
|
+
"Usage:",
|
|
9
|
+
" node .workflow/tools/bootstrap/bootstrap.mjs inspect [project]",
|
|
10
|
+
" node .workflow/tools/bootstrap/bootstrap.mjs bootstrap [project] [--dry-run]",
|
|
11
|
+
].join("\n");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const command = args[0] || "inspect";
|
|
17
|
+
if (command === "--help" || command === "help") {
|
|
18
|
+
process.stdout.write(`${usage()}\n`);
|
|
19
|
+
} else {
|
|
20
|
+
const projectArg = args.find((value, index) => index > 0 && !value.startsWith("--"));
|
|
21
|
+
const target = path.resolve(projectArg || process.cwd());
|
|
22
|
+
const result = command === "inspect"
|
|
23
|
+
? inspectProjectState(target)
|
|
24
|
+
: command === "bootstrap"
|
|
25
|
+
? bootstrapProject(null, target, { dryRun: args.includes("--dry-run") })
|
|
26
|
+
: null;
|
|
27
|
+
if (!result) throw new Error(`Unknown command: ${command}\n\n${usage()}`);
|
|
28
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
process.stderr.write(`ai-delivery-bootstrap: ${error.message}\n`);
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
}
|
package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/evolution/evolve.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { parse, stringify } from "../state/vendor/yaml/dist/index.js";
|
|
4
|
+
import { executeEvolutionCommand } from "./evolution-runtime.mjs";
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const result = executeEvolutionCommand(process.argv.slice(2), {
|
|
8
|
+
yaml: { parse, stringify: (value, options) => stringify(value, options) },
|
|
9
|
+
});
|
|
10
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
11
|
+
if (result?.ok === false) process.exitCode = 1;
|
|
12
|
+
} catch (error) {
|
|
13
|
+
process.stderr.write(`ai-delivery evolve: ${error.message}\n`);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
}
|
package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/hooks/hook-event.mjs
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
const SECRET_KEY = /^(authorization|cookie|set-cookie|password|passwd|secret|access[_-]?token|refresh[_-]?token|api[_-]?key|private[_-]?key)$/i;
|
|
6
|
+
const MAX_STRING = 8_192;
|
|
7
|
+
const MAX_EVENT = 64 * 1024;
|
|
8
|
+
|
|
9
|
+
function now() {
|
|
10
|
+
return new Date().toISOString();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function findUp(start, relative) {
|
|
14
|
+
let current = path.resolve(start);
|
|
15
|
+
while (true) {
|
|
16
|
+
const candidate = path.join(current, relative);
|
|
17
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
18
|
+
const parent = path.dirname(current);
|
|
19
|
+
if (parent === current) return null;
|
|
20
|
+
current = parent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function redact(value, key = "") {
|
|
25
|
+
if (SECRET_KEY.test(key)) return "[REDACTED]";
|
|
26
|
+
if (typeof value === "string") {
|
|
27
|
+
return value
|
|
28
|
+
.replace(/Bearer\s+[A-Za-z0-9._~+\/-]+=*/gi, "Bearer [REDACTED]")
|
|
29
|
+
.replace(/\bsk-[A-Za-z0-9_-]{12,}\b/g, "[REDACTED_TOKEN]")
|
|
30
|
+
.slice(0, MAX_STRING);
|
|
31
|
+
}
|
|
32
|
+
if (Array.isArray(value)) return value.slice(0, 100).map((item) => redact(item));
|
|
33
|
+
if (value && typeof value === "object") {
|
|
34
|
+
return Object.fromEntries(Object.entries(value).slice(0, 200).map(([name, item]) => [name, redact(item, name)]));
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function safeId(value) {
|
|
40
|
+
return String(value || "unassigned").replace(/[^A-Za-z0-9._-]/g, "_").slice(0, 128);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function atomicWrite(file, value) {
|
|
44
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
45
|
+
const temp = `${file}.${process.pid}.${Date.now()}.tmp`;
|
|
46
|
+
fs.writeFileSync(temp, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
47
|
+
fs.renameSync(temp, file);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function readStdin() {
|
|
51
|
+
const chunks = [];
|
|
52
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
53
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const currentProjectFile = findUp(process.cwd(), path.join(".workflow", "delivery", "project.yaml"));
|
|
58
|
+
const legacyProjectFile = currentProjectFile
|
|
59
|
+
? null
|
|
60
|
+
: findUp(process.cwd(), path.join("delivery", "project.yaml"));
|
|
61
|
+
const projectFile = currentProjectFile || legacyProjectFile;
|
|
62
|
+
if (!projectFile) process.exit(0);
|
|
63
|
+
const projectRoot = currentProjectFile
|
|
64
|
+
? path.dirname(path.dirname(path.dirname(projectFile)))
|
|
65
|
+
: path.dirname(path.dirname(projectFile));
|
|
66
|
+
const markerFile = path.join(projectRoot, ".workflow", "delivery", "runtime", "active-task.json");
|
|
67
|
+
const marker = fs.existsSync(markerFile) ? JSON.parse(fs.readFileSync(markerFile, "utf8")) : null;
|
|
68
|
+
const raw = await readStdin();
|
|
69
|
+
const input = raw.trim() ? JSON.parse(raw) : {};
|
|
70
|
+
const taskId = safeId(process.env.AI_DELIVERY_TASK_ID || marker?.task_id || input.turn_id || input.session_id);
|
|
71
|
+
const stateRoot = path.resolve(process.env.AI_DELIVERY_STATE_ROOT || marker?.state_root || projectRoot);
|
|
72
|
+
const workflowRoot = fs.existsSync(path.join(stateRoot, ".workflow", "delivery", "project.yaml"))
|
|
73
|
+
? path.join(stateRoot, ".workflow")
|
|
74
|
+
: stateRoot;
|
|
75
|
+
if (input.schema_version === 1 && typeof input.event_type === "string") {
|
|
76
|
+
const evolutionProjectRoot = path.basename(workflowRoot) === ".workflow"
|
|
77
|
+
? path.dirname(workflowRoot)
|
|
78
|
+
: projectRoot;
|
|
79
|
+
const evolutionCli = path.join(evolutionProjectRoot, ".workflow", "tools", "evolution", "evolve.mjs");
|
|
80
|
+
if (!fs.existsSync(evolutionCli)) throw new Error(`Evolution CLI is missing: ${evolutionCli}`);
|
|
81
|
+
const dispatched = spawnSync(process.execPath, [
|
|
82
|
+
evolutionCli,
|
|
83
|
+
"hook", "dispatch", "--input", "-", "--project", evolutionProjectRoot,
|
|
84
|
+
], {
|
|
85
|
+
cwd: evolutionProjectRoot,
|
|
86
|
+
input: raw,
|
|
87
|
+
encoding: "utf8",
|
|
88
|
+
timeout: 15_000,
|
|
89
|
+
windowsHide: true,
|
|
90
|
+
});
|
|
91
|
+
if (dispatched.error || dispatched.status !== 0) {
|
|
92
|
+
throw new Error(dispatched.error?.message || dispatched.stderr || `Evolution Hook exited ${dispatched.status}`);
|
|
93
|
+
}
|
|
94
|
+
process.stdout.write(dispatched.stdout);
|
|
95
|
+
const outcome = JSON.parse(dispatched.stdout);
|
|
96
|
+
process.exit(outcome.decision === "block" ? 2 : 0);
|
|
97
|
+
}
|
|
98
|
+
const runtime = path.join(workflowRoot, "delivery", "runtime");
|
|
99
|
+
const event = redact({
|
|
100
|
+
at: now(),
|
|
101
|
+
task_id: taskId,
|
|
102
|
+
event_name: input.hook_event_name || input.hookEventName || "unknown",
|
|
103
|
+
session_id: input.session_id || null,
|
|
104
|
+
turn_id: input.turn_id || null,
|
|
105
|
+
agent_id: input.agent_id || null,
|
|
106
|
+
agent_type: input.agent_type || null,
|
|
107
|
+
tool_name: input.tool_name || null,
|
|
108
|
+
input_fields: Object.keys(input).sort(),
|
|
109
|
+
tool_input_fields: input.tool_input && typeof input.tool_input === "object"
|
|
110
|
+
? Object.keys(input.tool_input).sort()
|
|
111
|
+
: [],
|
|
112
|
+
});
|
|
113
|
+
let line = JSON.stringify(event);
|
|
114
|
+
if (Buffer.byteLength(line, "utf8") > MAX_EVENT) {
|
|
115
|
+
line = JSON.stringify({ at: event.at, task_id: taskId, event_name: event.event_name, truncated: true });
|
|
116
|
+
}
|
|
117
|
+
const eventFile = path.join(runtime, "events", `${taskId}.jsonl`);
|
|
118
|
+
fs.mkdirSync(path.dirname(eventFile), { recursive: true });
|
|
119
|
+
fs.appendFileSync(eventFile, `${line}\n`, "utf8");
|
|
120
|
+
atomicWrite(path.join(runtime, "heartbeats", `${taskId}.json`), {
|
|
121
|
+
task_id: taskId,
|
|
122
|
+
updated_at: event.at,
|
|
123
|
+
event_name: event.event_name,
|
|
124
|
+
session_id: event.session_id,
|
|
125
|
+
turn_id: event.turn_id,
|
|
126
|
+
tool_name: event.tool_name,
|
|
127
|
+
});
|
|
128
|
+
} catch (error) {
|
|
129
|
+
process.stderr.write(`ai-delivery hook logger: ${error.message}\n`);
|
|
130
|
+
process.exitCode = 1;
|
|
131
|
+
}
|
package/skills/ai-delivery-orchestrate/assets/project-template/.workflow/tools/state/state.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import yamlPackage from "./vendor/yaml/dist/index.js";
|
|
4
|
+
import { executeDeliveryStateCommand } from "./delivery-state.mjs";
|
|
5
|
+
import { dispatchEvolutionHookEvent } from "../evolution/evolution-runtime.mjs";
|
|
6
|
+
|
|
7
|
+
const yaml = {
|
|
8
|
+
parse: yamlPackage.parse,
|
|
9
|
+
stringify: (value) => yamlPackage.stringify(value, { lineWidth: 0 }),
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
const result = executeDeliveryStateCommand(process.argv.slice(2), {
|
|
14
|
+
yaml,
|
|
15
|
+
onLifecycleEvent: (event) => dispatchEvolutionHookEvent(event.scope.project_root, event, { yaml }),
|
|
16
|
+
});
|
|
17
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
18
|
+
} catch (error) {
|
|
19
|
+
process.stderr.write(`ai-delivery-state: ${error.message}\n`);
|
|
20
|
+
process.exitCode = 1;
|
|
21
|
+
}
|