@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,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-execution-protocol
|
|
3
|
+
title: Execution Protocol
|
|
4
|
+
tags: [ai, protocol, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI Execution Protocol
|
|
8
|
+
|
|
9
|
+
## Read First Every Time You Enter A Project
|
|
10
|
+
|
|
11
|
+
1. `.skillrc`
|
|
12
|
+
2. `SKILL.index.json`
|
|
13
|
+
3. `docs/project/naming-conventions.md`
|
|
14
|
+
4. `docs/project/skill-conventions.md`
|
|
15
|
+
5. `docs/project/workflow-conventions.md`
|
|
16
|
+
6. The current change files: `proposal.md / tasks.md / state.json / verification.md`
|
|
17
|
+
7. If `stitch_design_review` exists, read `artifacts/stitch/approval.json`
|
|
18
|
+
8. If Stitch provider, MCP, or auth config must be changed, read the repo-local Stitch spec first; when `docs/stitch-plugin-spec.zh-CN.md` exists, treat its config snippets as authoritative
|
|
19
|
+
|
|
20
|
+
## Mandatory Rules
|
|
21
|
+
|
|
22
|
+
- Keep `proposal.md`, `tasks.md`, `verification.md`, and `review.md` in the project-adopted document language
|
|
23
|
+
- Do not rewrite change docs into English just because the product UI, site locale, or requirement text is English-first
|
|
24
|
+
- If the current change docs are already Chinese, continue in Chinese unless the project rules explicitly require an English switch
|
|
25
|
+
- Do not skip proposal/tasks and jump straight into implementation
|
|
26
|
+
- Use `state.json` as the execution status source of truth
|
|
27
|
+
- Activated optional steps must appear in `tasks.md` and `verification.md`
|
|
28
|
+
- If `stitch_design_review` is active and `approval.json.preview_url` or `submitted_at` is empty, run `ospec plugins run stitch <change-path>` first to submit a design preview
|
|
29
|
+
- Stitch design review must enforce one canonical layout per route; non-canonical screens under the same route must be explicitly marked as `archive / old / exploration`
|
|
30
|
+
- For `light/dark` theme variants, keep the same canonical layout and only transform the visual theme; do not reorder modules, regroup sections, move CTAs, or alter navigation structure
|
|
31
|
+
- If the matching page already exists, prefer `edit existing screen` or `duplicate existing canonical screen and derive a theme variant`
|
|
32
|
+
- Every Stitch delivery must output `screen mapping` with at least the route, canonical dark/light screen ids, derived relationship, and archived screen ids
|
|
33
|
+
- Old, exploratory, and replaced screens must not remain beside canonical screens as peer main pages
|
|
34
|
+
- If `.skillrc.plugins.stitch.project.project_id` exists, reuse that exact Stitch project ID and do not create a separate Stitch project for this change
|
|
35
|
+
- If the canonical Stitch project is still empty, the first successful Stitch submission becomes the canonical project for the repository
|
|
36
|
+
- Before running Stitch, assume the built-in `stitch` plugin uses the configured provider by default; only treat `.skillrc.plugins.stitch.runner` as authoritative when the project explicitly overrides it
|
|
37
|
+
- If the project uses a custom runner and `token_env` is configured, confirm the matching environment variable is set
|
|
38
|
+
- If the local Stitch bridge, Gemini CLI, Codex CLI, stitch MCP, or auth readiness is unclear, run `ospec plugins doctor stitch <project-path>` first
|
|
39
|
+
- If `plugins doctor stitch` reveals provider, MCP, or auth issues, return to the repo-local Stitch spec first; when `docs/stitch-plugin-spec.zh-CN.md` exists, do not invent an alternate `command` / `args` / `env` or stdio-proxy config outside that spec
|
|
40
|
+
- If the built-in `codex` provider can complete read-only calls but `create_project`, `generate_screen`, or `edit_screens` stalls locally, first verify the run actually uses `codex exec --dangerously-bypass-approvals-and-sandbox`
|
|
41
|
+
- If the project explicitly overrides `.skillrc.plugins.stitch.runner` and still uses Codex for Stitch writes, the custom runner / wrapper must also pass `--dangerously-bypass-approvals-and-sandbox`
|
|
42
|
+
- If `stitch_design_review` is active and `approval.json.status != approved`, do not treat the change as ready for continued implementation, completion, or archive
|
|
43
|
+
- If canonical selection, theme pairing, screen mapping, or duplicate cleanup is missing, do not treat the design review as passed
|
|
44
|
+
- Do not treat the work as complete when `SKILL.md` and the index are out of sync
|
|
45
|
+
|
|
46
|
+
## Project-Adopted Rules First
|
|
47
|
+
|
|
48
|
+
If the project rules differ from the mother spec, the project-adopted rules take precedence.
|
|
49
|
+
|
|
50
|
+
## Stitch Provider Baseline
|
|
51
|
+
|
|
52
|
+
- If the project contains `docs/stitch-plugin-spec.zh-CN.md`, provider / MCP / auth config must follow that spec first.
|
|
53
|
+
- If the project does not contain that spec and the built-in `gemini` provider is used, the baseline config is `%USERPROFILE%/.gemini/settings.json` with `mcpServers.stitch.httpUrl = "https://stitch.googleapis.com/mcp"` and `headers.X-Goog-Api-Key`.
|
|
54
|
+
- If the project does not contain that spec and the built-in `codex` provider is used, the baseline config is `%USERPROFILE%/.codex/config.toml` with `[mcp_servers.stitch]`, `type = "http"`, `url = "https://stitch.googleapis.com/mcp"`, and `X-Goog-Api-Key` in `headers` or `[mcp_servers.stitch.http_headers]`.
|
|
55
|
+
- The built-in `codex` provider should launch Stitch write operations with `--dangerously-bypass-approvals-and-sandbox`; if a custom runner replaces it, that runner must carry the same write-bypass behavior explicitly.
|
|
56
|
+
|
|
57
|
+
## Stitch Theme Variant Prompt Contract
|
|
58
|
+
|
|
59
|
+
- For `light/dark` theme variants, prompts must explicitly include:
|
|
60
|
+
- `Use the existing canonical screen as the base`
|
|
61
|
+
- `Keep the same layout structure`
|
|
62
|
+
- `Do not reorder modules`
|
|
63
|
+
- `Do not create a different composition`
|
|
64
|
+
- `Only transform the visual theme`
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-ai-guide
|
|
3
|
+
title: AI Guide
|
|
4
|
+
tags: [ai, guide, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI 开发指南
|
|
8
|
+
|
|
9
|
+
## 目标
|
|
10
|
+
|
|
11
|
+
本文档是从 OSpec 母版复制到项目中的采用版 AI 指南。AI 必须优先遵循项目内采用版规则,而不是回到母版仓库重新自由发挥。
|
|
12
|
+
|
|
13
|
+
## Working Order
|
|
14
|
+
|
|
15
|
+
1. 读取 `.skillrc`
|
|
16
|
+
2. 读取 `SKILL.index.json`
|
|
17
|
+
3. 读取 `docs/project/` 下的项目采用版规范
|
|
18
|
+
4. 读取相关 `SKILL.md`
|
|
19
|
+
5. 读取当前 change 的执行文件
|
|
20
|
+
6. 如果项目启用了 Stitch,且当前 change 激活了 `stitch_design_review`,优先检查 `artifacts/stitch/approval.json`
|
|
21
|
+
7. 如果要处理 Stitch 的安装、provider 切换、doctor 修复、MCP 或认证配置,先读取仓库内 Stitch 规范;若存在 `docs/stitch-plugin-spec.zh-CN.md`,必须以该文档中的配置片段为准
|
|
22
|
+
|
|
23
|
+
## 必须遵守
|
|
24
|
+
|
|
25
|
+
- 文档语言按项目 adopted protocol 执行;如果项目采用中文协议,则 `proposal.md`、`tasks.md`、`verification.md`、`review.md` 必须保持中文
|
|
26
|
+
- 产品界面文案、站点默认语言或 “English-first” 业务策略,不得自动推导为 change 文档应改成英文
|
|
27
|
+
- 若当前 change 已存在中文内容,后续更新必须延续中文,除非项目规则显式声明文档语言切换为英文
|
|
28
|
+
- 先按索引定位,再读目标知识文件
|
|
29
|
+
- 先看项目采用版规范,再进入实现
|
|
30
|
+
- 如果 `stitch_design_review` 已激活且 `approval.json.preview_url` 为空或 `submitted_at` 为空,先执行 `ospec plugins run stitch <change-path>` 生成预览,再把预览地址发给用户验收
|
|
31
|
+
- 如果 `stitch_design_review` 已激活且 `approval.json.status != approved`,先停在设计审核门禁
|
|
32
|
+
- Stitch 页面评审必须遵守“一 route 一套 canonical layout”;不得让同一路由同时存在多个未标记用途的主 layout
|
|
33
|
+
- 如需补齐 `light/dark`,必须基于同一 canonical screen 做主题变体;不得重排模块、改信息架构、改 CTA 位置或生成新的不同构图
|
|
34
|
+
- 项目中已存在对应页面时,优先 `edit existing screen` 或 `duplicate existing canonical screen and derive a theme variant`
|
|
35
|
+
- 每次 Stitch 交付都必须给出 `screen mapping`,至少包含 route、canonical dark/light screen id、是否由另一主题派生、归档 screen ids
|
|
36
|
+
- 旧稿、探索稿、被替换 screen 必须归档或重命名,不能继续与 canonical screen 并列为主页面
|
|
37
|
+
- 如果缺失 canonical 说明、theme pairing、screen mapping,或仍存在未归档重复 screen,不得把该 review 视为完成
|
|
38
|
+
- `ospec plugins run stitch <change-path>` 默认会走已配置的 Stitch provider 适配器;只有在项目显式覆写 `.skillrc.plugins.stitch.runner` 时才走自定义 runner
|
|
39
|
+
- 如果项目使用自定义 runner 且配置了 `token_env`,运行前必须确认对应环境变量已设置
|
|
40
|
+
- runner、Gemini CLI、Codex CLI、stitch MCP 或认证状态不确定时,先执行 `ospec plugins doctor stitch <project-path>` 自检
|
|
41
|
+
- 若 `plugins doctor stitch` 提示所选 provider 的关键检查不是 PASS,先提示用户安装对应 CLI 并补全相应用户配置中的 stitch MCP / API token 设置
|
|
42
|
+
- 涉及 Stitch 安装、provider 切换、doctor 修复、MCP 或认证配置时,必须先读取仓库内 Stitch 规范;若存在 `docs/stitch-plugin-spec.zh-CN.md`,直接采用其中的 Gemini / Codex 配置片段,不得为了让 `doctor` 通过而自行拼接 `command` / `args` / `env` 或 stdio proxy 配置
|
|
43
|
+
- 如果内建 `codex` provider 下只读调用正常,但 `create_project`、`generate_screen`、`edit_screens` 这类写操作卡在本地,优先检查是否真正走了 `codex exec --dangerously-bypass-approvals-and-sandbox`
|
|
44
|
+
- 如果项目显式覆写 `.skillrc.plugins.stitch.runner` 且仍由 Codex 负责 Stitch 写操作,自定义 runner / wrapper 也必须显式带上 `--dangerously-bypass-approvals-and-sandbox`
|
|
45
|
+
- 修改代码后同步更新 `SKILL.md`
|
|
46
|
+
- 必要时重建 `SKILL.index.json`
|
|
47
|
+
|
|
48
|
+
## 项目采用版优先
|
|
49
|
+
|
|
50
|
+
- 命名规范:`docs/project/naming-conventions.md`
|
|
51
|
+
- SKILL 规范:`docs/project/skill-conventions.md`
|
|
52
|
+
- 工作流规范:`docs/project/workflow-conventions.md`
|
|
53
|
+
- 项目开发指南:`docs/project/development-guide.md`
|
|
54
|
+
|
|
55
|
+
## Stitch Canonical Project
|
|
56
|
+
|
|
57
|
+
- 如 `.skillrc.plugins.stitch.project.project_id` 已存在,必须复用该 Stitch project。
|
|
58
|
+
- 如该字段为空,把第一次成功的 Stitch 运行结果视为仓库 canonical project,并在后续 change 中持续复用。
|
|
59
|
+
- 不要为单个 change 新建新的 Stitch project,除非用户明确要求。
|
|
60
|
+
|
|
61
|
+
## Stitch Provider Baseline
|
|
62
|
+
|
|
63
|
+
- 如果仓库里存在 `docs/stitch-plugin-spec.zh-CN.md`,优先使用文档中的原始配置片段。
|
|
64
|
+
- 如果仓库里没有这份规范,但需要启用内建 Stitch provider,默认基线如下。
|
|
65
|
+
- `gemini`:修改 `%USERPROFILE%/.gemini/settings.json`,使用 `mcpServers.stitch.httpUrl` 和 `headers.X-Goog-Api-Key`。
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"stitch": {
|
|
71
|
+
"httpUrl": "https://stitch.googleapis.com/mcp",
|
|
72
|
+
"headers": {
|
|
73
|
+
"X-Goog-Api-Key": "your-stitch-api-key"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
- `codex`:修改 `%USERPROFILE%/.codex/config.toml`,使用 HTTP transport、固定 Stitch MCP URL,以及 `X-Goog-Api-Key` header。
|
|
81
|
+
- `codex` 内建适配器默认应通过 `codex exec --dangerously-bypass-approvals-and-sandbox` 发起 Stitch 写操作;如果项目改用自定义 runner,该放行参数也必须由自定义 runner 承担。
|
|
82
|
+
|
|
83
|
+
```toml
|
|
84
|
+
[mcp_servers.stitch]
|
|
85
|
+
type = "http"
|
|
86
|
+
url = "https://stitch.googleapis.com/mcp"
|
|
87
|
+
headers = { X-Goog-Api-Key = "your-stitch-api-key" }
|
|
88
|
+
|
|
89
|
+
[mcp_servers.stitch.http_headers]
|
|
90
|
+
X-Goog-Api-Key = "your-stitch-api-key"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Stitch Canonical Layout
|
|
94
|
+
|
|
95
|
+
- 每个业务 route 只能有一个 canonical layout。
|
|
96
|
+
- `Light` 和 `Dark` 必须是一对 theme variants,而不是两个不同 layout。
|
|
97
|
+
- 涉及 theme variant 的 prompt 必须明确包含:
|
|
98
|
+
- `Use the existing canonical screen as the base`
|
|
99
|
+
- `Keep the same layout structure`
|
|
100
|
+
- `Do not reorder modules`
|
|
101
|
+
- `Do not create a different composition`
|
|
102
|
+
- `Only transform the visual theme`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-execution-protocol
|
|
3
|
+
title: Execution Protocol
|
|
4
|
+
tags: [ai, protocol, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AI 执行协议
|
|
8
|
+
|
|
9
|
+
## 每次进入项目时必须先读
|
|
10
|
+
|
|
11
|
+
1. `.skillrc`
|
|
12
|
+
2. `SKILL.index.json`
|
|
13
|
+
3. `docs/project/naming-conventions.md`
|
|
14
|
+
4. `docs/project/skill-conventions.md`
|
|
15
|
+
5. `docs/project/workflow-conventions.md`
|
|
16
|
+
6. 当前 change 的 `proposal.md / tasks.md / state.json / verification.md`
|
|
17
|
+
7. 如存在 `stitch_design_review`,读取 `artifacts/stitch/approval.json`
|
|
18
|
+
8. 如要调整 Stitch provider、MCP 或认证配置,先读取仓库内 Stitch 规范;若存在 `docs/stitch-plugin-spec.zh-CN.md`,必须以该文档中的配置片段为准
|
|
19
|
+
|
|
20
|
+
## 强制规则
|
|
21
|
+
|
|
22
|
+
- 项目 adopted protocol 为中文时,`proposal.md`、`tasks.md`、`verification.md`、`review.md` 必须保持中文
|
|
23
|
+
- 不得因为页面文案是英文、产品默认语言是英文或需求写有 “English-first” 就把 change 文档改写成英文
|
|
24
|
+
- 若当前 change 文档已经是中文,后续续写、修订和补充必须继续使用中文,除非项目规则显式要求切换
|
|
25
|
+
- 不得跳过 proposal/tasks 直接进入实现
|
|
26
|
+
- 必须以 `state.json` 作为执行状态依据
|
|
27
|
+
- 被激活的可选步骤必须进入 `tasks.md` 和 `verification.md`
|
|
28
|
+
- 如果 `stitch_design_review` 已激活且 `approval.json.preview_url` 为空或 `submitted_at` 为空,先运行 `ospec plugins run stitch <change-path>` 提交设计预览
|
|
29
|
+
- Stitch 设计评审必须遵守“一 route 一套 canonical layout”;同一路由下的非 canonical screen 必须明确标记为 `archive / old / exploration`
|
|
30
|
+
- 如需 `light/dark` 主题变体,必须基于同一 canonical layout 做视觉主题转换;不得重排模块、改 section grouping、改 CTA placement、改 navigation structure
|
|
31
|
+
- 如果项目中已经存在对应页面,必须优先 `edit existing screen` 或 `duplicate existing canonical screen and derive a theme variant`
|
|
32
|
+
- 每次 Stitch 交付必须输出 `screen mapping`,至少包含 route、canonical dark/light screen id、derived 关系、archived screen ids
|
|
33
|
+
- 旧稿、探索稿、被替换 screen 不得与 canonical screen 混放为同级主页面
|
|
34
|
+
- 运行 Stitch 前,优先视为走内建 `stitch` 插件的已配置 provider;只有项目显式覆写 `.skillrc.plugins.stitch.runner` 时才按自定义 runner 处理
|
|
35
|
+
- 如项目使用自定义 runner 且配置了 `token_env`,必须确认对应环境变量已设置
|
|
36
|
+
- 若本地 Stitch bridge、Gemini CLI、Codex CLI、stitch MCP 或认证状态不明确,先执行 `ospec plugins doctor stitch <project-path>`
|
|
37
|
+
- 若 `plugins doctor stitch` 暴露 provider / MCP / auth 问题,先回到仓库内 Stitch 规范修正配置;若存在 `docs/stitch-plugin-spec.zh-CN.md`,不得脱离该文档另造一套 `command` / `args` / `env` 或 stdio proxy 配置
|
|
38
|
+
- 如果内建 `codex` provider 下只读调用正常,但 `create_project`、`generate_screen`、`edit_screens` 等写操作在本地卡住,优先检查是否真正走了 `codex exec --dangerously-bypass-approvals-and-sandbox`
|
|
39
|
+
- 如果项目显式覆写 `.skillrc.plugins.stitch.runner` 且仍使用 Codex 发起 Stitch 写操作,自定义 runner / wrapper 也必须显式带上 `--dangerously-bypass-approvals-and-sandbox`
|
|
40
|
+
- 如果 `stitch_design_review` 已激活且 `approval.json.status != approved`,不得把 change 视为可继续实现、可完成或可归档
|
|
41
|
+
- 如果缺失 canonical 说明、theme pairing 说明、screen mapping,或仍存在未归档重复 screen,不得把 change 视为已通过设计审核
|
|
42
|
+
- `SKILL.md` 与索引未同步时不得视为完成
|
|
43
|
+
|
|
44
|
+
## 项目采用版优先
|
|
45
|
+
|
|
46
|
+
如果项目内规范与母版规范存在差异,应以项目内采用版为准。
|
|
47
|
+
|
|
48
|
+
## Stitch Canonical Project
|
|
49
|
+
|
|
50
|
+
- 读取 `.skillrc.plugins.stitch.project.project_id` 作为仓库级固定 Stitch project ID。
|
|
51
|
+
- 如果该字段为空,第一次成功的 Stitch 提交会成为 canonical project。
|
|
52
|
+
- 如果后续运行返回了不同的 project ID,必须停止并提示异常,不能直接写入审批结果。
|
|
53
|
+
|
|
54
|
+
## Stitch Provider Baseline
|
|
55
|
+
|
|
56
|
+
- 如果项目内存在 `docs/stitch-plugin-spec.zh-CN.md`,provider / MCP / auth 配置优先以该文档为准。
|
|
57
|
+
- 如果项目内没有该文档,且走内建 `gemini` provider,默认配置基线是 `%USERPROFILE%/.gemini/settings.json` 中的 `mcpServers.stitch.httpUrl = "https://stitch.googleapis.com/mcp"`,并在 `headers` 中设置 `X-Goog-Api-Key`。
|
|
58
|
+
- 如果项目内没有该文档,且走内建 `codex` provider,默认配置基线是 `%USERPROFILE%/.codex/config.toml` 中的 `[mcp_servers.stitch]`,要求 `type = "http"`、`url = "https://stitch.googleapis.com/mcp"`,并在 `headers` 或 `[mcp_servers.stitch.http_headers]` 中设置 `X-Goog-Api-Key`。
|
|
59
|
+
- 内建 `codex` provider 的 Stitch 写操作默认应带 `--dangerously-bypass-approvals-and-sandbox`;若改用自定义 runner,则该放行参数也必须由自定义 runner 显式承担。
|
|
60
|
+
|
|
61
|
+
## Stitch Theme Variant Prompt Contract
|
|
62
|
+
|
|
63
|
+
- 涉及 `light/dark` 主题变体时,prompt 必须明确包含:
|
|
64
|
+
- `Use the existing canonical screen as the base`
|
|
65
|
+
- `Keep the same layout structure`
|
|
66
|
+
- `Do not reorder modules`
|
|
67
|
+
- `Do not create a different composition`
|
|
68
|
+
- `Only transform the visual theme`
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
if [ -f "build-index-auto.cjs" ]; then
|
|
4
|
+
OSPEC_BUILD_INDEX_SCRIPT="build-index-auto.cjs"
|
|
5
|
+
elif [ -f "build-index-auto.js" ]; then
|
|
6
|
+
OSPEC_BUILD_INDEX_SCRIPT="build-index-auto.js"
|
|
7
|
+
else
|
|
8
|
+
echo "[ospec] build-index-auto.cjs not found, skip hook check"
|
|
9
|
+
exit 0
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
node "$OSPEC_BUILD_INDEX_SCRIPT" hook-check post-merge
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
if [ -f "build-index-auto.cjs" ]; then
|
|
4
|
+
OSPEC_BUILD_INDEX_SCRIPT="build-index-auto.cjs"
|
|
5
|
+
elif [ -f "build-index-auto.js" ]; then
|
|
6
|
+
OSPEC_BUILD_INDEX_SCRIPT="build-index-auto.js"
|
|
7
|
+
else
|
|
8
|
+
echo "[ospec] build-index-auto.cjs not found, skip hook check"
|
|
9
|
+
exit 0
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
node "$OSPEC_BUILD_INDEX_SCRIPT" hook-check pre-commit
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ospec-change
|
|
3
|
+
description: Create or advance an active change inside an OSpec project, from requirement intake through verification and finalize.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# OSpec Change
|
|
7
|
+
|
|
8
|
+
Use this skill when the user says things like "use ospec change to do a requirement".
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
|
|
12
|
+
This skill is the single entry for the full change lifecycle inside an initialized OSpec project:
|
|
13
|
+
- requirement intake
|
|
14
|
+
- change naming or matching
|
|
15
|
+
- explicit queue planning when the user asks for queue behavior
|
|
16
|
+
- proposal and task refinement
|
|
17
|
+
- implementation guidance
|
|
18
|
+
- progress tracking
|
|
19
|
+
- verification
|
|
20
|
+
- archive readiness check
|
|
21
|
+
- finalize closeout
|
|
22
|
+
|
|
23
|
+
## Read Order
|
|
24
|
+
|
|
25
|
+
1. `.skillrc`
|
|
26
|
+
2. `SKILL.index.json`
|
|
27
|
+
3. `for-ai/ai-guide.md`
|
|
28
|
+
4. `for-ai/execution-protocol.md`
|
|
29
|
+
5. If Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup is involved, read the repo-local Stitch plugin spec first. When `docs/stitch-plugin-spec.zh-CN.md` exists, treat it as the source of truth for the config shape.
|
|
30
|
+
6. If the user explicitly asks for queue behavior, inspect `changes/queued/` before creating new queue items.
|
|
31
|
+
7. `changes/active/<change>/proposal.md`
|
|
32
|
+
8. `changes/active/<change>/tasks.md`
|
|
33
|
+
9. `changes/active/<change>/state.json`
|
|
34
|
+
10. `changes/active/<change>/verification.md`
|
|
35
|
+
11. `changes/active/<change>/review.md`
|
|
36
|
+
|
|
37
|
+
## Language
|
|
38
|
+
|
|
39
|
+
- Follow the project-adopted document language from `for-ai/` and existing change docs.
|
|
40
|
+
- Keep Chinese projects in Chinese unless the repo explicitly adopts English.
|
|
41
|
+
|
|
42
|
+
## Plugin Gates
|
|
43
|
+
|
|
44
|
+
After reading `.skillrc`, inspect enabled plugins before advancing the change.
|
|
45
|
+
|
|
46
|
+
### Stitch
|
|
47
|
+
|
|
48
|
+
When `.skillrc.plugins.stitch.enabled = true` and `.skillrc.plugins.stitch.capabilities.page_design_review.enabled = true`:
|
|
49
|
+
|
|
50
|
+
- determine whether the current change activates `stitch_design_review` from proposal `flags` and `tasks.md` / `verification.md` `optional_steps`
|
|
51
|
+
- if activated, read `changes/active/<change>/artifacts/stitch/approval.json`
|
|
52
|
+
- if `approval.json.preview_url` or `submitted_at` is empty, run `ospec plugins run stitch <change-path>` before asking the user to review the design
|
|
53
|
+
- if `.skillrc.plugins.stitch.project.project_id` is already configured, reuse that exact Stitch project instead of creating a new project
|
|
54
|
+
- if `.skillrc.plugins.stitch.project.project_id` is empty, treat the first successful Stitch run as the canonical project and keep using it for later changes
|
|
55
|
+
- treat missing approval or `status != approved` as a blocking gate
|
|
56
|
+
- do not claim the change can continue implementation closeout or archive readiness until Stitch approval is complete
|
|
57
|
+
- treat the built-in `stitch` plugin with the configured provider adapter as the default path unless `.skillrc.plugins.stitch.runner` is explicitly overridden
|
|
58
|
+
- if a custom runner is configured and `token_env` is set but missing, stop and request configuration first
|
|
59
|
+
- if runner readiness, provider CLI, stitch MCP, or auth readiness is unclear, use `ospec plugins doctor stitch <project-path>` before `ospec plugins run stitch <change-path>`
|
|
60
|
+
- if Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup is involved, read the repo-local Stitch plugin spec first; when `docs/stitch-plugin-spec.zh-CN.md` exists, use its documented Gemini / Codex config snippets instead of inventing `command` / `args` / `env` or stdio-proxy settings
|
|
61
|
+
- if the repo-local Stitch spec is missing, use these built-in baselines instead of guessing:
|
|
62
|
+
- `gemini`: `%USERPROFILE%/.gemini/settings.json` -> `mcpServers.stitch.httpUrl = "https://stitch.googleapis.com/mcp"` and `headers.X-Goog-Api-Key`
|
|
63
|
+
- `codex`: `%USERPROFILE%/.codex/config.toml` -> `[mcp_servers.stitch]`, `type = "http"`, `url = "https://stitch.googleapis.com/mcp"`, and `X-Goog-Api-Key` in `headers` or `[mcp_servers.stitch.http_headers]`
|
|
64
|
+
- use `ospec plugins approve stitch <change-path>` or `ospec plugins reject stitch <change-path>` to record the review result
|
|
65
|
+
|
|
66
|
+
## Required Logic
|
|
67
|
+
|
|
68
|
+
1. Inspect repository state first when posture is unclear.
|
|
69
|
+
2. If the repo is not initialized, stop at initialization guidance instead of forcing a change.
|
|
70
|
+
3. If the request is a new requirement, derive a concise kebab-case change name and create it.
|
|
71
|
+
4. If the matching active change already exists, continue it instead of duplicating it.
|
|
72
|
+
5. Default to one active change unless the user explicitly asks to split work into multiple changes, create a queue, or execute a queue.
|
|
73
|
+
6. When queue behavior is explicitly requested, derive an ordered list of concise kebab-case change names. Each name should represent one execution unit, not a mixed bundle.
|
|
74
|
+
7. For explicit queue planning, present the queue as an ordered list first. Use `ospec queue add ...` to create queued changes and `ospec run ...` only when the user explicitly asks to run the queue.
|
|
75
|
+
8. Treat `changes/active/<change>/` as the execution container.
|
|
76
|
+
9. Keep `proposal.md`, `tasks.md`, `state.json`, `verification.md`, and `review.md` aligned with actual execution and with the project's established document language.
|
|
77
|
+
10. Use OSpec closeout commands instead of inventing a parallel process.
|
|
78
|
+
11. Apply plugin gates from `.skillrc` before advancing a change.
|
|
79
|
+
12. If `stitch_design_review` is activated, inspect the Stitch approval artifact before continuing execution.
|
|
80
|
+
13. If the Stitch preview has not been submitted yet, run `ospec plugins run stitch <change-path>` before asking for design review.
|
|
81
|
+
14. If Stitch approval is missing or not approved, stop at the review gate instead of treating the change as ready.
|
|
82
|
+
|
|
83
|
+
## Commands
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
ospec status [path]
|
|
87
|
+
ospec new <change-name> [path]
|
|
88
|
+
ospec changes status [path]
|
|
89
|
+
ospec queue status [path]
|
|
90
|
+
ospec queue add <change-name> [path]
|
|
91
|
+
ospec queue activate <change-name> [path]
|
|
92
|
+
ospec queue next [path]
|
|
93
|
+
ospec run start [path] --profile manual-safe
|
|
94
|
+
ospec run step [path]
|
|
95
|
+
ospec run status [path]
|
|
96
|
+
ospec plugins status [path]
|
|
97
|
+
ospec plugins doctor stitch [path]
|
|
98
|
+
ospec plugins run stitch [changes/active/<change>]
|
|
99
|
+
ospec plugins approve stitch [changes/active/<change>]
|
|
100
|
+
ospec plugins reject stitch [changes/active/<change>]
|
|
101
|
+
ospec progress [changes/active/<change>]
|
|
102
|
+
ospec verify [changes/active/<change>]
|
|
103
|
+
ospec archive [changes/active/<change>] --check
|
|
104
|
+
ospec finalize [changes/active/<change>]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Guardrails
|
|
108
|
+
|
|
109
|
+
- Do not assume dashboard workflows exist.
|
|
110
|
+
- Do not refer to `basic` or `full` structure levels.
|
|
111
|
+
- Do not confuse repository initialization with change execution.
|
|
112
|
+
- Do not enter queue mode unless the user explicitly asks for queue behavior.
|
|
113
|
+
- Do not turn an ordinary single requirement into multiple queued changes unless the user explicitly asks to split it.
|
|
114
|
+
- Do not continue past an active Stitch review gate when approval is missing or not approved.
|
|
115
|
+
- Do not claim completion until implementation, verification notes, and closeout status are aligned.
|
|
116
|
+
- If real project tests exist, run or recommend them separately from `ospec verify`.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ospec-change
|
|
3
|
+
description: Create or advance an active change inside an OSpec project, from requirement intake through verification and finalize.
|
|
4
|
+
tags: [ospec, cli, workflow]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# OSpec Change
|
|
8
|
+
|
|
9
|
+
Use this skill when the user says things like "use ospec change to do a requirement".
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
This skill is the single entry for the full change lifecycle inside an initialized OSpec project:
|
|
14
|
+
- requirement intake
|
|
15
|
+
- change naming or matching
|
|
16
|
+
- explicit queue planning when the user asks for queue behavior
|
|
17
|
+
- proposal and task refinement
|
|
18
|
+
- implementation guidance
|
|
19
|
+
- progress tracking
|
|
20
|
+
- verification
|
|
21
|
+
- archive readiness check
|
|
22
|
+
- finalize closeout
|
|
23
|
+
|
|
24
|
+
## Read Order
|
|
25
|
+
|
|
26
|
+
1. `.skillrc`
|
|
27
|
+
2. `SKILL.index.json`
|
|
28
|
+
3. `for-ai/ai-guide.md`
|
|
29
|
+
4. `for-ai/execution-protocol.md`
|
|
30
|
+
5. If Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup is involved, read the repo-local Stitch plugin spec first. When `docs/stitch-plugin-spec.zh-CN.md` exists, treat it as the source of truth for the config shape.
|
|
31
|
+
6. If the user explicitly asks for queue behavior, inspect `changes/queued/` before creating new queue items.
|
|
32
|
+
7. `changes/active/<change>/proposal.md`
|
|
33
|
+
8. `changes/active/<change>/tasks.md`
|
|
34
|
+
9. `changes/active/<change>/state.json`
|
|
35
|
+
10. `changes/active/<change>/verification.md`
|
|
36
|
+
11. `changes/active/<change>/review.md`
|
|
37
|
+
|
|
38
|
+
## Language
|
|
39
|
+
|
|
40
|
+
- Follow the project-adopted document language from `for-ai/` and existing change docs.
|
|
41
|
+
- Keep Chinese projects in Chinese unless the repo explicitly adopts English.
|
|
42
|
+
|
|
43
|
+
## Plugin Gates
|
|
44
|
+
|
|
45
|
+
After reading `.skillrc`, inspect enabled plugins before advancing the change.
|
|
46
|
+
|
|
47
|
+
### Stitch
|
|
48
|
+
|
|
49
|
+
When `.skillrc.plugins.stitch.enabled = true` and `.skillrc.plugins.stitch.capabilities.page_design_review.enabled = true`:
|
|
50
|
+
|
|
51
|
+
- determine whether the current change activates `stitch_design_review` from proposal `flags` and `tasks.md` / `verification.md` `optional_steps`
|
|
52
|
+
- if activated, read `changes/active/<change>/artifacts/stitch/approval.json`
|
|
53
|
+
- if `approval.json.preview_url` or `submitted_at` is empty, run `ospec plugins run stitch <change-path>` before asking the user to review the design
|
|
54
|
+
- if `.skillrc.plugins.stitch.project.project_id` is already configured, reuse that exact Stitch project instead of creating a new project
|
|
55
|
+
- if `.skillrc.plugins.stitch.project.project_id` is empty, treat the first successful Stitch run as the canonical project and keep using it for later changes
|
|
56
|
+
- treat missing approval or `status != approved` as a blocking gate
|
|
57
|
+
- do not claim the change can continue implementation closeout or archive readiness until Stitch approval is complete
|
|
58
|
+
- treat the built-in `stitch` plugin with the configured provider adapter as the default path unless `.skillrc.plugins.stitch.runner` is explicitly overridden
|
|
59
|
+
- if a custom runner is configured and `token_env` is set but missing, stop and request configuration first
|
|
60
|
+
- if runner readiness, provider CLI, stitch MCP, or auth readiness is unclear, use `ospec plugins doctor stitch <project-path>` before `ospec plugins run stitch <change-path>`
|
|
61
|
+
- if Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup is involved, read the repo-local Stitch plugin spec first; when `docs/stitch-plugin-spec.zh-CN.md` exists, use its documented Gemini / Codex config snippets instead of inventing `command` / `args` / `env` or stdio-proxy settings
|
|
62
|
+
- if the repo-local Stitch spec is missing, use these built-in baselines instead of guessing:
|
|
63
|
+
- `gemini`: `%USERPROFILE%/.gemini/settings.json` -> `mcpServers.stitch.httpUrl = "https://stitch.googleapis.com/mcp"` and `headers.X-Goog-Api-Key`
|
|
64
|
+
- `codex`: `%USERPROFILE%/.codex/config.toml` -> `[mcp_servers.stitch]`, `type = "http"`, `url = "https://stitch.googleapis.com/mcp"`, and `X-Goog-Api-Key` in `headers` or `[mcp_servers.stitch.http_headers]`
|
|
65
|
+
- use `ospec plugins approve stitch <change-path>` or `ospec plugins reject stitch <change-path>` to record the review result
|
|
66
|
+
|
|
67
|
+
## Required Logic
|
|
68
|
+
|
|
69
|
+
1. Inspect repository state first when posture is unclear.
|
|
70
|
+
2. If the repo is not initialized, stop at initialization guidance instead of forcing a change.
|
|
71
|
+
3. If the request is a new requirement, derive a concise kebab-case change name and create it.
|
|
72
|
+
4. If the matching active change already exists, continue it instead of duplicating it.
|
|
73
|
+
5. Default to one active change unless the user explicitly asks to split work into multiple changes, create a queue, or execute a queue.
|
|
74
|
+
6. When queue behavior is explicitly requested, derive an ordered list of concise kebab-case change names. Each name should represent one execution unit, not a mixed bundle.
|
|
75
|
+
7. For explicit queue planning, present the queue as an ordered list first. Use `ospec queue add ...` to create queued changes and `ospec run ...` only when the user explicitly asks to run the queue.
|
|
76
|
+
8. Treat `changes/active/<change>/` as the execution container.
|
|
77
|
+
9. Keep `proposal.md`, `tasks.md`, `state.json`, `verification.md`, and `review.md` aligned with actual execution and with the project's established document language.
|
|
78
|
+
10. Use OSpec closeout commands instead of inventing a parallel process.
|
|
79
|
+
11. Apply plugin gates from `.skillrc` before advancing a change.
|
|
80
|
+
12. If `stitch_design_review` is activated, inspect the Stitch approval artifact before continuing execution.
|
|
81
|
+
13. If the Stitch preview has not been submitted yet, run `ospec plugins run stitch <change-path>` before asking for design review.
|
|
82
|
+
14. If Stitch approval is missing or not approved, stop at the review gate instead of treating the change as ready.
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
ospec status [path]
|
|
88
|
+
ospec new <change-name> [path]
|
|
89
|
+
ospec changes status [path]
|
|
90
|
+
ospec queue status [path]
|
|
91
|
+
ospec queue add <change-name> [path]
|
|
92
|
+
ospec queue activate <change-name> [path]
|
|
93
|
+
ospec queue next [path]
|
|
94
|
+
ospec run start [path] --profile manual-safe
|
|
95
|
+
ospec run step [path]
|
|
96
|
+
ospec run status [path]
|
|
97
|
+
ospec plugins status [path]
|
|
98
|
+
ospec plugins doctor stitch [path]
|
|
99
|
+
ospec plugins run stitch [changes/active/<change>]
|
|
100
|
+
ospec plugins approve stitch [changes/active/<change>]
|
|
101
|
+
ospec plugins reject stitch [changes/active/<change>]
|
|
102
|
+
ospec progress [changes/active/<change>]
|
|
103
|
+
ospec verify [changes/active/<change>]
|
|
104
|
+
ospec archive [changes/active/<change>] --check
|
|
105
|
+
ospec finalize [changes/active/<change>]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Guardrails
|
|
109
|
+
|
|
110
|
+
- Do not assume dashboard workflows exist.
|
|
111
|
+
- Do not refer to `basic` or `full` structure levels.
|
|
112
|
+
- Do not confuse repository initialization with change execution.
|
|
113
|
+
- Do not enter queue mode unless the user explicitly asks for queue behavior.
|
|
114
|
+
- Do not turn an ordinary single requirement into multiple queued changes unless the user explicitly asks to split it.
|
|
115
|
+
- Do not continue past an active Stitch review gate when approval is missing or not approved.
|
|
116
|
+
- Do not claim completion until implementation, verification notes, and closeout status are aligned.
|
|
117
|
+
- If real project tests exist, run or recommend them separately from `ospec verify`.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
|
|
3
|
+
display_name: "OSpec Change"
|
|
4
|
+
|
|
5
|
+
short_description: "Create or advance a change"
|
|
6
|
+
|
|
7
|
+
default_prompt: "Use $ospec-change to create or advance a OSpec change. Read .skillrc, SKILL.index.json, and the current change files first. Default to one active change and do not enter queue mode unless the user explicitly asks to split work into multiple changes, create a queue, or execute a queue. When queue behavior is explicitly requested, derive an ordered kebab-case list of change names, use ospec queue add to create queued changes, and use ospec run manual-safe only when the user explicitly asks to run the queue. Keep protocol execution inside changes/active/<change> and do not confuse bootstrap with change creation. If Stitch is enabled and stitch_design_review is active, inspect artifacts/stitch/approval.json. For Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup, read the repo-local Stitch plugin spec first and use its documented config snippet instead of inventing a replacement. If that spec is missing, use these built-in baselines: Gemini uses %USERPROFILE%/.gemini/settings.json with mcpServers.stitch.httpUrl and headers.X-Goog-Api-Key; Codex uses %USERPROFILE%/.codex/config.toml with [mcp_servers.stitch], type=\"http\", url=\"https://stitch.googleapis.com/mcp\", and X-Goog-Api-Key in headers or [mcp_servers.stitch.http_headers]. If preview_url or submitted_at is empty, run ospec plugins run stitch <change-path> before asking for review."
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: ospec-change
|
|
2
|
+
|
|
3
|
+
title: OSpec Change
|
|
4
|
+
|
|
5
|
+
description: Create or advance an active change inside a OSpec project while respecting workflow files and optional-step activation.
|
|
6
|
+
|
|
7
|
+
version: 5.1.0
|
|
8
|
+
|
|
9
|
+
author: OSpec Team
|
|
10
|
+
|
|
11
|
+
license: MIT
|
|
12
|
+
|
|
13
|
+
interface:
|
|
14
|
+
|
|
15
|
+
display_name: "OSpec Change"
|
|
16
|
+
|
|
17
|
+
short_description: "Create or advance a change"
|
|
18
|
+
|
|
19
|
+
default_prompt: "Use $ospec-change to create or advance a OSpec change. Read .skillrc, SKILL.index.json, and the current change files first. Default to one active change and do not enter queue mode unless the user explicitly asks to split work into multiple changes, create a queue, or execute a queue. When queue behavior is explicitly requested, derive an ordered kebab-case list of change names, use ospec queue add to create queued changes, and use ospec run manual-safe only when the user explicitly asks to run the queue. Keep protocol execution inside changes/active/<change> and do not confuse bootstrap with change creation. If Stitch is enabled and stitch_design_review is active, inspect artifacts/stitch/approval.json. For Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup, read the repo-local Stitch plugin spec first and use its documented config snippet instead of inventing a replacement. If that spec is missing, use these built-in baselines: Gemini uses %USERPROFILE%/.gemini/settings.json with mcpServers.stitch.httpUrl and headers.X-Goog-Api-Key; Codex uses %USERPROFILE%/.codex/config.toml with [mcp_servers.stitch], type=\"http\", url=\"https://stitch.googleapis.com/mcp\", and X-Goog-Api-Key in headers or [mcp_servers.stitch.http_headers]. Reuse .skillrc.plugins.stitch.project.project_id when it already exists; if it is empty, treat the first successful Stitch run as the canonical project. If preview_url or submitted_at is empty, run ospec plugins run stitch <change-path> before asking for review."
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-development-guide
|
|
3
|
+
title: Project Development Guide
|
|
4
|
+
tags: [conventions, development, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project Development Guide
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
This file is the project-adopted development guide that connects project planning, the knowledge layer, the execution layer, and AI collaboration rules.
|
|
12
|
+
|
|
13
|
+
## Baseline
|
|
14
|
+
|
|
15
|
+
- Long-lived project knowledge lives in `docs/project/`
|
|
16
|
+
- Current facts live in layered `SKILL.md`
|
|
17
|
+
- Change execution lives in `changes/active/<change>/`
|
|
18
|
+
- AI execution entry points live in `for-ai/`
|
|
19
|
+
|
|
20
|
+
## Recommended Flow
|
|
21
|
+
|
|
22
|
+
1. Confirm the project-adopted conventions
|
|
23
|
+
2. Read the project knowledge layer and relevant `SKILL.md`
|
|
24
|
+
3. Enter the active change
|
|
25
|
+
4. Sync docs and the index after implementation
|
|
26
|
+
|
|
27
|
+
## Avoid
|
|
28
|
+
|
|
29
|
+
- Do not let AI invent naming conventions on the fly
|
|
30
|
+
- Do not bypass `changes/` for long-running work
|
|
31
|
+
- Do not update code without updating the knowledge layer
|
|
32
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-naming-conventions
|
|
3
|
+
title: Project Naming Conventions
|
|
4
|
+
tags: [conventions, naming, ospec]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Naming Conventions
|
|
8
|
+
|
|
9
|
+
## Goal
|
|
10
|
+
|
|
11
|
+
This file is the project-adopted copy of the OSpec mother spec. It fixes naming rules inside the project so AI and humans do not invent naming patterns ad hoc.
|
|
12
|
+
|
|
13
|
+
## Core Rules
|
|
14
|
+
|
|
15
|
+
- Directories, modules, and change names use lowercase kebab-case
|
|
16
|
+
- Flags and optional steps use lowercase snake_case
|
|
17
|
+
- Workflow protocol files keep their fixed filenames
|
|
18
|
+
- API docs use semantic kebab-case names
|
|
19
|
+
|
|
20
|
+
## Change Names
|
|
21
|
+
|
|
22
|
+
- Use `changes/active/<change-name>/`
|
|
23
|
+
- Example: `add-token-refresh`
|
|
24
|
+
- Avoid dates, spaces, uppercase names, and non-semantic labels
|
|
25
|
+
|
|
26
|
+
## Module Names
|
|
27
|
+
|
|
28
|
+
- Module directories use semantic English names
|
|
29
|
+
- Example: `src/modules/auth`, `src/modules/content`
|
|
30
|
+
- Each module keeps its `SKILL.md` at the module root
|
|
31
|
+
|
|
32
|
+
## Document Names
|
|
33
|
+
|
|
34
|
+
- Project docs live in `docs/project/`
|
|
35
|
+
- Design docs live in `docs/design/`
|
|
36
|
+
- Planning docs live in `docs/planning/`
|
|
37
|
+
- API docs live in `docs/api/`
|
|
38
|
+
|
|
39
|
+
## Fixed Protocol Files
|
|
40
|
+
|
|
41
|
+
- `proposal.md`
|
|
42
|
+
- `tasks.md`
|
|
43
|
+
- `state.json`
|
|
44
|
+
- `verification.md`
|
|
45
|
+
- `review.md`
|
|
46
|
+
|
|
47
|
+
## Execution Requirement
|
|
48
|
+
|
|
49
|
+
- Check this file before adding a new directory, module, change, or workflow flag
|
|
50
|
+
- If implementation diverges from this file, bring the code and docs back into alignment first
|
|
51
|
+
|