@clawplays/ospec-cli 0.1.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/.ospec/templates/hooks/post-merge +8 -0
- package/.ospec/templates/hooks/pre-commit +8 -0
- package/LICENSE +21 -0
- package/README.md +549 -0
- package/README.zh-CN.md +549 -0
- package/assets/for-ai/en-US/ai-guide.md +98 -0
- package/assets/for-ai/en-US/execution-protocol.md +64 -0
- package/assets/for-ai/zh-CN/ai-guide.md +102 -0
- package/assets/for-ai/zh-CN/execution-protocol.md +68 -0
- package/assets/git-hooks/post-merge +12 -0
- package/assets/git-hooks/pre-commit +12 -0
- package/assets/global-skills/claude/ospec-change/SKILL.md +116 -0
- package/assets/global-skills/codex/ospec-change/SKILL.md +117 -0
- package/assets/global-skills/codex/ospec-change/agents/openai.yaml +7 -0
- package/assets/global-skills/codex/ospec-change/skill.yaml +19 -0
- package/assets/project-conventions/en-US/development-guide.md +32 -0
- package/assets/project-conventions/en-US/naming-conventions.md +51 -0
- package/assets/project-conventions/en-US/skill-conventions.md +40 -0
- package/assets/project-conventions/en-US/workflow-conventions.md +70 -0
- package/assets/project-conventions/zh-CN/development-guide.md +32 -0
- package/assets/project-conventions/zh-CN/naming-conventions.md +51 -0
- package/assets/project-conventions/zh-CN/skill-conventions.md +40 -0
- package/assets/project-conventions/zh-CN/workflow-conventions.md +74 -0
- package/dist/adapters/codex-stitch-adapter.js +420 -0
- package/dist/adapters/gemini-stitch-adapter.js +408 -0
- package/dist/adapters/playwright-checkpoint-adapter.js +2260 -0
- package/dist/advanced/BatchOperations.d.ts +36 -0
- package/dist/advanced/BatchOperations.js +159 -0
- package/dist/advanced/CachingLayer.d.ts +66 -0
- package/dist/advanced/CachingLayer.js +136 -0
- package/dist/advanced/FeatureUpdater.d.ts +46 -0
- package/dist/advanced/FeatureUpdater.js +151 -0
- package/dist/advanced/PerformanceMonitor.d.ts +52 -0
- package/dist/advanced/PerformanceMonitor.js +129 -0
- package/dist/advanced/StatePersistence.d.ts +61 -0
- package/dist/advanced/StatePersistence.js +168 -0
- package/dist/advanced/index.d.ts +14 -0
- package/dist/advanced/index.js +22 -0
- package/dist/cli/commands/config.d.ts +5 -0
- package/dist/cli/commands/config.js +6 -0
- package/dist/cli/commands/feature.d.ts +5 -0
- package/dist/cli/commands/feature.js +6 -0
- package/dist/cli/commands/index.d.ts +5 -0
- package/dist/cli/commands/index.js +6 -0
- package/dist/cli/commands/project.d.ts +5 -0
- package/dist/cli/commands/project.js +6 -0
- package/dist/cli/commands/validate.d.ts +5 -0
- package/dist/cli/commands/validate.js +6 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +1007 -0
- package/dist/commands/ArchiveCommand.d.ts +14 -0
- package/dist/commands/ArchiveCommand.js +241 -0
- package/dist/commands/BaseCommand.d.ts +33 -0
- package/dist/commands/BaseCommand.js +46 -0
- package/dist/commands/BatchCommand.d.ts +5 -0
- package/dist/commands/BatchCommand.js +42 -0
- package/dist/commands/ChangesCommand.d.ts +3 -0
- package/dist/commands/ChangesCommand.js +71 -0
- package/dist/commands/DocsCommand.d.ts +5 -0
- package/dist/commands/DocsCommand.js +118 -0
- package/dist/commands/FinalizeCommand.d.ts +3 -0
- package/dist/commands/FinalizeCommand.js +24 -0
- package/dist/commands/IndexCommand.d.ts +5 -0
- package/dist/commands/IndexCommand.js +57 -0
- package/dist/commands/InitCommand.d.ts +5 -0
- package/dist/commands/InitCommand.js +65 -0
- package/dist/commands/NewCommand.d.ts +11 -0
- package/dist/commands/NewCommand.js +262 -0
- package/dist/commands/PluginsCommand.d.ts +58 -0
- package/dist/commands/PluginsCommand.js +2491 -0
- package/dist/commands/ProgressCommand.d.ts +5 -0
- package/dist/commands/ProgressCommand.js +103 -0
- package/dist/commands/QueueCommand.d.ts +10 -0
- package/dist/commands/QueueCommand.js +147 -0
- package/dist/commands/RunCommand.d.ts +13 -0
- package/dist/commands/RunCommand.js +200 -0
- package/dist/commands/SkillCommand.d.ts +31 -0
- package/dist/commands/SkillCommand.js +1216 -0
- package/dist/commands/SkillsCommand.d.ts +5 -0
- package/dist/commands/SkillsCommand.js +68 -0
- package/dist/commands/StatusCommand.d.ts +6 -0
- package/dist/commands/StatusCommand.js +140 -0
- package/dist/commands/UpdateCommand.d.ts +8 -0
- package/dist/commands/UpdateCommand.js +251 -0
- package/dist/commands/VerifyCommand.d.ts +5 -0
- package/dist/commands/VerifyCommand.js +278 -0
- package/dist/commands/WorkflowCommand.d.ts +12 -0
- package/dist/commands/WorkflowCommand.js +150 -0
- package/dist/commands/index.d.ts +43 -0
- package/dist/commands/index.js +85 -0
- package/dist/core/constants.d.ts +41 -0
- package/dist/core/constants.js +73 -0
- package/dist/core/errors.d.ts +36 -0
- package/dist/core/errors.js +72 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +23 -0
- package/dist/core/types.d.ts +369 -0
- package/dist/core/types.js +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +27 -0
- package/dist/presets/ProjectPresets.d.ts +41 -0
- package/dist/presets/ProjectPresets.js +190 -0
- package/dist/scaffolds/ProjectScaffoldPresets.d.ts +20 -0
- package/dist/scaffolds/ProjectScaffoldPresets.js +151 -0
- package/dist/services/ConfigManager.d.ts +14 -0
- package/dist/services/ConfigManager.js +386 -0
- package/dist/services/FeatureManager.d.ts +5 -0
- package/dist/services/FeatureManager.js +6 -0
- package/dist/services/FileService.d.ts +21 -0
- package/dist/services/FileService.js +152 -0
- package/dist/services/IndexBuilder.d.ts +12 -0
- package/dist/services/IndexBuilder.js +130 -0
- package/dist/services/Logger.d.ts +20 -0
- package/dist/services/Logger.js +48 -0
- package/dist/services/ProjectAssetRegistry.d.ts +12 -0
- package/dist/services/ProjectAssetRegistry.js +96 -0
- package/dist/services/ProjectAssetService.d.ts +49 -0
- package/dist/services/ProjectAssetService.js +223 -0
- package/dist/services/ProjectScaffoldCommandService.d.ts +73 -0
- package/dist/services/ProjectScaffoldCommandService.js +159 -0
- package/dist/services/ProjectScaffoldService.d.ts +44 -0
- package/dist/services/ProjectScaffoldService.js +507 -0
- package/dist/services/ProjectService.d.ts +209 -0
- package/dist/services/ProjectService.js +13239 -0
- package/dist/services/QueueService.d.ts +17 -0
- package/dist/services/QueueService.js +142 -0
- package/dist/services/RunService.d.ts +40 -0
- package/dist/services/RunService.js +420 -0
- package/dist/services/SkillParser.d.ts +30 -0
- package/dist/services/SkillParser.js +88 -0
- package/dist/services/StateManager.d.ts +16 -0
- package/dist/services/StateManager.js +127 -0
- package/dist/services/TemplateEngine.d.ts +43 -0
- package/dist/services/TemplateEngine.js +119 -0
- package/dist/services/TemplateGenerator.d.ts +40 -0
- package/dist/services/TemplateGenerator.js +273 -0
- package/dist/services/ValidationService.d.ts +19 -0
- package/dist/services/ValidationService.js +44 -0
- package/dist/services/Validator.d.ts +5 -0
- package/dist/services/Validator.js +6 -0
- package/dist/services/index.d.ts +52 -0
- package/dist/services/index.js +91 -0
- package/dist/services/templates/ExecutionTemplateBuilder.d.ts +12 -0
- package/dist/services/templates/ExecutionTemplateBuilder.js +300 -0
- package/dist/services/templates/ProjectTemplateBuilder.d.ts +38 -0
- package/dist/services/templates/ProjectTemplateBuilder.js +1897 -0
- package/dist/services/templates/TemplateBuilderBase.d.ts +19 -0
- package/dist/services/templates/TemplateBuilderBase.js +60 -0
- package/dist/services/templates/TemplateInputFactory.d.ts +16 -0
- package/dist/services/templates/TemplateInputFactory.js +298 -0
- package/dist/services/templates/templateTypes.d.ts +90 -0
- package/dist/services/templates/templateTypes.js +3 -0
- package/dist/tools/build-index.js +632 -0
- package/dist/utils/DateUtils.d.ts +18 -0
- package/dist/utils/DateUtils.js +40 -0
- package/dist/utils/PathUtils.d.ts +9 -0
- package/dist/utils/PathUtils.js +66 -0
- package/dist/utils/StringUtils.d.ts +26 -0
- package/dist/utils/StringUtils.js +47 -0
- package/dist/utils/helpers.d.ts +5 -0
- package/dist/utils/helpers.js +6 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +23 -0
- package/dist/utils/logger.d.ts +5 -0
- package/dist/utils/logger.js +6 -0
- package/dist/utils/path.d.ts +5 -0
- package/dist/utils/path.js +6 -0
- package/dist/utils/subcommandHelp.d.ts +11 -0
- package/dist/utils/subcommandHelp.js +119 -0
- package/dist/workflow/ArchiveGate.d.ts +30 -0
- package/dist/workflow/ArchiveGate.js +93 -0
- package/dist/workflow/ConfigurableWorkflow.d.ts +89 -0
- package/dist/workflow/ConfigurableWorkflow.js +186 -0
- package/dist/workflow/HookSystem.d.ts +38 -0
- package/dist/workflow/HookSystem.js +66 -0
- package/dist/workflow/IndexRegenerator.d.ts +49 -0
- package/dist/workflow/IndexRegenerator.js +147 -0
- package/dist/workflow/PluginWorkflowComposer.d.ts +138 -0
- package/dist/workflow/PluginWorkflowComposer.js +239 -0
- package/dist/workflow/SkillUpdateEngine.d.ts +26 -0
- package/dist/workflow/SkillUpdateEngine.js +113 -0
- package/dist/workflow/VerificationSystem.d.ts +24 -0
- package/dist/workflow/VerificationSystem.js +116 -0
- package/dist/workflow/WorkflowEngine.d.ts +15 -0
- package/dist/workflow/WorkflowEngine.js +57 -0
- package/dist/workflow/index.d.ts +19 -0
- package/dist/workflow/index.js +32 -0
- package/package.json +78 -0
- package/scripts/postinstall.js +43 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-skill-conventions
|
|
3
|
+
title: SKILL Conventions
|
|
4
|
+
tags: [conventions, skill, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL Conventions
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
This file fixes the responsibility boundary of layered `SKILL.md` files so AI consistently locates context through the index and then reads the correct knowledge document.
|
|
12
|
+
|
|
13
|
+
## Layered Structure
|
|
14
|
+
|
|
15
|
+
- Root `SKILL.md`: project entry map
|
|
16
|
+
- `docs/SKILL.md`: docs hub
|
|
17
|
+
- `src/SKILL.md`: source map
|
|
18
|
+
- `src/core/SKILL.md`: core platform layer
|
|
19
|
+
- `src/modules/<module>/SKILL.md`: module knowledge unit
|
|
20
|
+
- `tests/SKILL.md`: testing strategy and entry
|
|
21
|
+
|
|
22
|
+
## Authoring Rules
|
|
23
|
+
|
|
24
|
+
- `SKILL.md` documents current facts, not future plans
|
|
25
|
+
- Module `SKILL.md` files should cover responsibility, structure, API, dependencies, and test expectations
|
|
26
|
+
- When APIs or boundaries change, update the relevant `SKILL.md`
|
|
27
|
+
- When a new module is created, add its module `SKILL.md`
|
|
28
|
+
|
|
29
|
+
## Relationship To The Index
|
|
30
|
+
|
|
31
|
+
- `SKILL.index.json` is for discovery, not for replacing `SKILL.md`
|
|
32
|
+
- Rebuild the index after updating `SKILL.md`
|
|
33
|
+
- AI should read the index first and the target `SKILL.md` second
|
|
34
|
+
|
|
35
|
+
## Execution Requirement
|
|
36
|
+
|
|
37
|
+
- Code-only changes without `SKILL.md` updates are not acceptable
|
|
38
|
+
- Do not overload `SKILL.md` with design rationale that belongs in design docs
|
|
39
|
+
- `SKILL.md` explains what exists now, design docs explain why it was designed that way
|
|
40
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-workflow-conventions
|
|
3
|
+
title: Workflow Execution Conventions
|
|
4
|
+
tags: [conventions, workflow, change, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Workflow Execution Conventions
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
This document fixes the OSpec execution flow inside the project so requirements move through planning, implementation, verification, and archive with consistent gates.
|
|
12
|
+
|
|
13
|
+
## Standard Order
|
|
14
|
+
|
|
15
|
+
1. Clarify project context and impact scope
|
|
16
|
+
2. Create or update `proposal.md`
|
|
17
|
+
3. Create or update `tasks.md`
|
|
18
|
+
4. Advance implementation according to `state.json`
|
|
19
|
+
5. Update the relevant `SKILL.md`
|
|
20
|
+
6. Rebuild `SKILL.index.json`
|
|
21
|
+
7. Complete `verification.md`
|
|
22
|
+
8. Archive only after all gates pass
|
|
23
|
+
|
|
24
|
+
## State Constraints
|
|
25
|
+
|
|
26
|
+
- Use `state.json` as the execution status source of truth
|
|
27
|
+
- `verification.md` does not replace `state.json`
|
|
28
|
+
- If state files and execution files disagree, fix state first
|
|
29
|
+
|
|
30
|
+
## Document Language
|
|
31
|
+
|
|
32
|
+
- Keep `proposal.md`, `tasks.md`, `verification.md`, and `review.md` in the project-adopted document language
|
|
33
|
+
- Product UI language may differ from the OSpec change-document language; do not infer one from the other
|
|
34
|
+
- If a change was created in Chinese, continue updating it in Chinese unless project rules explicitly require a switch to English
|
|
35
|
+
|
|
36
|
+
## Optional Steps
|
|
37
|
+
|
|
38
|
+
- Optional-step activation is controlled by `.skillrc.workflow`
|
|
39
|
+
- Proposal flags must remain compatible with the workflow configuration
|
|
40
|
+
- Activated optional steps must appear in `tasks.md` and `verification.md`
|
|
41
|
+
|
|
42
|
+
## Plugin Gates
|
|
43
|
+
|
|
44
|
+
- Plugin capabilities are controlled by `.skillrc.plugins`
|
|
45
|
+
- If the current change activates `stitch_design_review`, inspect `artifacts/stitch/approval.json` first
|
|
46
|
+
- If `approval.json.preview_url` or `submitted_at` is empty, run `ospec plugins run stitch <change-path>` first to generate a preview and send the preview URL to the user for review
|
|
47
|
+
- Treat `.skillrc.plugins.stitch.project.project_id` as the canonical Stitch project for the repository; all UI changes should reuse that same Stitch project
|
|
48
|
+
- If the canonical Stitch project is still empty, the first successful `ospec plugins run stitch <change-path>` should save it into `.skillrc.plugins.stitch.project`, and later runs must reuse it
|
|
49
|
+
- If Stitch returns a different project ID from the canonical one, treat that run as invalid instead of accepting the new project automatically
|
|
50
|
+
- `ospec plugins run stitch <change-path>` uses the configured Stitch provider adapter by default; if the project explicitly overrides `.skillrc.plugins.stitch.runner`, use the custom Stitch bridge / wrapper instead
|
|
51
|
+
- For custom runners, use `token_env` when extra tokens are required; for the built-in Gemini adapter, auth is typically configured under `%USERPROFILE%/.gemini/settings.json` in `mcpServers.stitch`
|
|
52
|
+
- Use `ospec plugins doctor stitch <project-path>` to validate the runner, provider CLI, stitch MCP, and auth-hint readiness
|
|
53
|
+
- For Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup, read the repo-local Stitch spec first; when `docs/stitch-plugin-spec.zh-CN.md` exists, use its config snippets instead of inventing an alternate setup just to satisfy the checks
|
|
54
|
+
- If the repo does not contain a Stitch spec, use the built-in baselines instead: `gemini` edits `%USERPROFILE%/.gemini/settings.json` with `mcpServers.stitch.httpUrl` and `headers.X-Goog-Api-Key`; `codex` edits `%USERPROFILE%/.codex/config.toml` with `[mcp_servers.stitch]`, `type = "http"`, `url = "https://stitch.googleapis.com/mcp"`, and `X-Goog-Api-Key`
|
|
55
|
+
- If the built-in `codex` provider succeeds on read-only calls but local write operations never reach `mcp_tool_call`, first verify the run actually uses `codex exec --dangerously-bypass-approvals-and-sandbox`
|
|
56
|
+
- If the project overrides a custom Codex runner / wrapper, that custom execution path must also pass `--dangerously-bypass-approvals-and-sandbox`
|
|
57
|
+
- When `approval.json.status` is not `approved`, do not claim the change has passed design review or is ready to archive
|
|
58
|
+
- Prefer `ospec plugins approve stitch <change-path>` or `ospec plugins reject stitch <change-path>` when recording review results
|
|
59
|
+
|
|
60
|
+
## Archive Gates
|
|
61
|
+
|
|
62
|
+
- Do not archive when docs are stale
|
|
63
|
+
- Do not archive when the index is stale
|
|
64
|
+
- Do not archive when optional steps have not passed
|
|
65
|
+
- Do not archive when `verification.md` is incomplete
|
|
66
|
+
|
|
67
|
+
## Execution Requirements
|
|
68
|
+
|
|
69
|
+
- Any AI or human advancing a change must read `.skillrc`, `SKILL.index.json`, and the current change files first
|
|
70
|
+
- Any completion claim must match the real file state instead of skipping gates through narration
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-development-guide
|
|
3
|
+
title: 项目开发指南
|
|
4
|
+
tags: [conventions, development, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 项目开发指南
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
本文件用于作为项目采用版的总开发指南,衔接项目规划、知识层、执行层和 AI 协作方式。
|
|
12
|
+
|
|
13
|
+
## 开发基线
|
|
14
|
+
|
|
15
|
+
- 项目级长期知识放在 `docs/project/`
|
|
16
|
+
- 当前事实放在分层 `SKILL.md`
|
|
17
|
+
- 需求执行放在 `changes/active/<change>/`
|
|
18
|
+
- AI 执行入口放在 `for-ai/`
|
|
19
|
+
|
|
20
|
+
## 推荐工作方式
|
|
21
|
+
|
|
22
|
+
1. 先确认项目采用版规范
|
|
23
|
+
2. 再看项目知识层和模块 `SKILL.md`
|
|
24
|
+
3. 再进入当前 change
|
|
25
|
+
4. 实现后同步文档和索引
|
|
26
|
+
|
|
27
|
+
## 不应做的事
|
|
28
|
+
|
|
29
|
+
- 不要让 AI 自行发明命名规范
|
|
30
|
+
- 不要绕开 `changes/` 直接长期开发
|
|
31
|
+
- 不要只改代码不改知识层文档
|
|
32
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-naming-conventions
|
|
3
|
+
title: 项目命名规范
|
|
4
|
+
tags: [conventions, naming, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 项目命名规范
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
本文件是从 OSpec 母版复制到项目中的采用版规范,用于固定项目内的命名方式,避免 AI 或人工在开发过程中临时发明命名风格。
|
|
12
|
+
|
|
13
|
+
## 基本规则
|
|
14
|
+
|
|
15
|
+
- 目录、模块、change 名称统一使用小写短横线
|
|
16
|
+
- flags、optional steps 统一使用小写下划线
|
|
17
|
+
- Markdown 协议文件名使用固定名称,不得自定义变体
|
|
18
|
+
- API 文档文件名优先使用语义化短横线
|
|
19
|
+
|
|
20
|
+
## change 命名
|
|
21
|
+
|
|
22
|
+
- 使用 `changes/active/<change-name>/`
|
|
23
|
+
- 示例:`add-token-refresh`
|
|
24
|
+
- 避免使用日期、中文、空格、大写字母
|
|
25
|
+
|
|
26
|
+
## 模块命名
|
|
27
|
+
|
|
28
|
+
- 模块目录使用语义化英文短横线或单词
|
|
29
|
+
- 示例:`src/modules/auth`、`src/modules/content`
|
|
30
|
+
- 模块 `SKILL.md` 必须放在模块根目录
|
|
31
|
+
|
|
32
|
+
## 文档命名
|
|
33
|
+
|
|
34
|
+
- 项目级文档放在 `docs/project/`
|
|
35
|
+
- 设计文档放在 `docs/design/`
|
|
36
|
+
- 计划文档放在 `docs/planning/`
|
|
37
|
+
- API 文档放在 `docs/api/`
|
|
38
|
+
|
|
39
|
+
## 固定协议文件
|
|
40
|
+
|
|
41
|
+
- `proposal.md`
|
|
42
|
+
- `tasks.md`
|
|
43
|
+
- `state.json`
|
|
44
|
+
- `verification.md`
|
|
45
|
+
- `review.md`
|
|
46
|
+
|
|
47
|
+
## 执行要求
|
|
48
|
+
|
|
49
|
+
- 新增目录、模块、change、flags 时,必须先检查本规范
|
|
50
|
+
- 与本规范冲突时,应优先修正文档和实现,而不是继续扩散不一致命名
|
|
51
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-skill-conventions
|
|
3
|
+
title: SKILL 编写规范
|
|
4
|
+
tags: [conventions, skill, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL 编写规范
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
本文件用于固定项目中分层 `SKILL.md` 的职责边界,确保 AI 始终先通过索引定位,再读取正确层级的知识文档。
|
|
12
|
+
|
|
13
|
+
## 分层结构
|
|
14
|
+
|
|
15
|
+
- 根 `SKILL.md`:项目总导航
|
|
16
|
+
- `docs/SKILL.md`:文档中心导航
|
|
17
|
+
- `src/SKILL.md`:源码结构地图
|
|
18
|
+
- `src/core/SKILL.md`:核心基础层说明
|
|
19
|
+
- `src/modules/<module>/SKILL.md`:模块知识单元
|
|
20
|
+
- `tests/SKILL.md`:测试策略和入口
|
|
21
|
+
|
|
22
|
+
## 编写要求
|
|
23
|
+
|
|
24
|
+
- `SKILL.md` 必须描述当前事实,不写未来计划
|
|
25
|
+
- 模块级 `SKILL.md` 应覆盖职责、结构、API、依赖、测试要求
|
|
26
|
+
- 发生 API 或边界变化时,必须同步更新相关 `SKILL.md`
|
|
27
|
+
- 新增模块时,必须补对应的模块 `SKILL.md`
|
|
28
|
+
|
|
29
|
+
## 与索引的关系
|
|
30
|
+
|
|
31
|
+
- `SKILL.index.json` 只负责定位,不替代 `SKILL.md`
|
|
32
|
+
- 修改 `SKILL.md` 后,必须重建索引
|
|
33
|
+
- AI 在改代码前应先读索引,再读目标 `SKILL.md`
|
|
34
|
+
|
|
35
|
+
## 执行要求
|
|
36
|
+
|
|
37
|
+
- 不允许只改代码不改 `SKILL.md`
|
|
38
|
+
- 不允许把设计文档内容全部塞进 `SKILL.md`
|
|
39
|
+
- `SKILL.md` 描述“现在是什么”,设计文档解释“为什么这样设计”
|
|
40
|
+
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-workflow-conventions
|
|
3
|
+
title: 工作流执行规范
|
|
4
|
+
tags: [conventions, workflow, change, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 工作流执行规范
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
本文档用于固定项目中的 OSpec 执行流程,确保需求从规划到实现、验证、归档都有统一步骤。
|
|
12
|
+
|
|
13
|
+
## 标准顺序
|
|
14
|
+
|
|
15
|
+
1. 明确项目上下文和影响范围
|
|
16
|
+
2. 创建或更新 `proposal.md`
|
|
17
|
+
3. 创建或更新 `tasks.md`
|
|
18
|
+
4. 根据 `state.json` 推进实现
|
|
19
|
+
5. 更新相关 `SKILL.md`
|
|
20
|
+
6. 重建 `SKILL.index.json`
|
|
21
|
+
7. 完成 `verification.md`
|
|
22
|
+
8. 满足门禁后再归档
|
|
23
|
+
|
|
24
|
+
## 状态约束
|
|
25
|
+
|
|
26
|
+
- 以 `state.json` 为当前执行状态依据
|
|
27
|
+
- `verification.md` 不能替代 `state.json`
|
|
28
|
+
- 若状态文件与执行文件冲突,先修正状态再继续
|
|
29
|
+
|
|
30
|
+
## 文档语言
|
|
31
|
+
|
|
32
|
+
- 项目采用中文 protocol 时,`proposal.md`、`tasks.md`、`verification.md`、`review.md` 必须保持中文
|
|
33
|
+
- 产品界面语言可以按业务使用英文,但不得把产品语言自动映射为 OSpec change 文档语言
|
|
34
|
+
- 若当前 change 文档已用中文创建,后续更新必须延续中文,除非项目规则显式要求切换为英文
|
|
35
|
+
|
|
36
|
+
## 可选步骤
|
|
37
|
+
|
|
38
|
+
- 是否启用可选步骤,以 `.skillrc.workflow` 为准
|
|
39
|
+
- proposal 中的 flags 必须与 workflow 配置兼容
|
|
40
|
+
- 被激活的可选步骤必须进入 `tasks.md` 和 `verification.md`
|
|
41
|
+
|
|
42
|
+
## 插件阻断
|
|
43
|
+
|
|
44
|
+
- 是否启用插件能力,以 `.skillrc.plugins` 为准
|
|
45
|
+
- 如果当前 change 激活了 `stitch_design_review`,必须先检查 `artifacts/stitch/approval.json`
|
|
46
|
+
- 如果 `approval.json.preview_url` 为空或 `submitted_at` 为空,先执行 `ospec plugins run stitch <change-path>` 生成预览,再把预览地址发给用户验收
|
|
47
|
+
- `ospec plugins run stitch <change-path>` 默认走已配置的 Stitch provider 适配器;如果项目显式覆写 `.skillrc.plugins.stitch.runner`,则走自定义 Stitch bridge / wrapper
|
|
48
|
+
- 使用自定义 runner 时,可通过 `token_env` 约束额外 token;使用内建 Gemini 适配器时,通常应在 `%USERPROFILE%/.gemini/settings.json` 的 `mcpServers.stitch` 中配置认证信息
|
|
49
|
+
- 可通过 `ospec plugins doctor stitch <project-path>` 检查 runner、provider CLI、stitch MCP 与认证提示状态
|
|
50
|
+
- 涉及 Stitch 安装、provider 切换、doctor 修复、MCP 或认证配置时,先读取仓库内 Stitch 规范;若存在 `docs/stitch-plugin-spec.zh-CN.md`,必须以该文档中的配置片段为准,不得为通过检查而临时拼出另一套配置
|
|
51
|
+
- 如果仓库里没有 Stitch 规范文档,则使用内建基线:`gemini` 改 `%USERPROFILE%/.gemini/settings.json` 的 `mcpServers.stitch.httpUrl` 与 `headers.X-Goog-Api-Key`;`codex` 改 `%USERPROFILE%/.codex/config.toml` 的 `[mcp_servers.stitch]`,并设置 `type = "http"`、`url = "https://stitch.googleapis.com/mcp"`、`X-Goog-Api-Key`
|
|
52
|
+
- 如果内建 `codex` provider 下只读调用正常,但写操作卡在本地未真正进入 `mcp_tool_call`,优先检查是否真正走了 `codex exec --dangerously-bypass-approvals-and-sandbox`
|
|
53
|
+
- 如果项目覆写了自定义 Codex runner / wrapper,自定义运行链也必须显式带上 `--dangerously-bypass-approvals-and-sandbox`
|
|
54
|
+
- 当 `approval.json.status` 不是 `approved` 时,不得继续声称 change 已通过设计审核或可归档
|
|
55
|
+
- 记录审批结果时,优先使用 `ospec plugins approve stitch <change-path>` 或 `ospec plugins reject stitch <change-path>`
|
|
56
|
+
|
|
57
|
+
## 归档约束
|
|
58
|
+
|
|
59
|
+
- 文档未同步时不得归档
|
|
60
|
+
- 索引未重建时不得归档
|
|
61
|
+
- 可选步骤未通过时不得归档
|
|
62
|
+
- `verification.md` 未完成时不得归档
|
|
63
|
+
|
|
64
|
+
## 执行要求
|
|
65
|
+
|
|
66
|
+
- 任何 AI 或人工执行 change 时,都必须先读取 `.skillrc`、`SKILL.index.json` 和当前 change 文件
|
|
67
|
+
- 任何 claim 必须以实际文件状态为准,不得凭口头描述跳过门禁
|
|
68
|
+
|
|
69
|
+
## Stitch Canonical Project
|
|
70
|
+
|
|
71
|
+
- 同一个仓库默认只维护一个 Stitch project,保存在 `.skillrc.plugins.stitch.project`。
|
|
72
|
+
- 第一次成功执行 `ospec plugins run stitch <change-path>` 时,如果还没有 canonical project,应该把返回的 project ID 自动保存到 `.skillrc`。
|
|
73
|
+
- 后续所有 UI change 都必须复用这个 canonical Stitch project,而不是为每个 change 新建一个新 project。
|
|
74
|
+
- 如果 Stitch 返回了不同的 project ID,应视为异常结果,不能直接接受。
|