@leocm/flowcraft 0.0.0-stage → 2.1.0
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/README.md +855 -3
- package/bin/cli.js +108 -0
- package/flowcraft.yaml +30 -0
- package/install.sh +24 -0
- package/lib/args.js +38 -0
- package/lib/config.js +20 -0
- package/lib/copy.js +131 -0
- package/lib/fix.js +110 -0
- package/lib/fsutil.js +104 -0
- package/lib/global.js +229 -0
- package/lib/init.js +43 -0
- package/lib/runtime.js +84 -0
- package/lib/version.js +55 -0
- package/lib/wizard.js +125 -0
- package/package.json +31 -4
- package/presets/backend.yaml +20 -0
- package/presets/default.yaml +15 -0
- package/presets/frontend.yaml +20 -0
- package/presets/quick-fix.yaml +15 -0
- package/setup/.claude/commands/P0.5.md +1 -0
- package/setup/.claude/commands/P0.md +1 -0
- package/setup/.claude/commands/P1.md +1 -0
- package/setup/.claude/commands/P2.md +1 -0
- package/setup/.claude/commands/P3.md +1 -0
- package/setup/.claude/commands/P4.md +1 -0
- package/setup/.claude/commands/P5.md +1 -0
- package/setup/.claude/commands/code-analysis-init.md +1 -0
- package/setup/.claude/commands/code-analysis-rebuild.md +1 -0
- package/setup/.claude/commands/code-analysis-show-memory.md +1 -0
- package/setup/.claude/commands/code-analysis-update.md +1 -0
- package/setup/.claude/hooks/check-phase-advancement.py +180 -0
- package/setup/.claude/hooks/check-phase-test.py +152 -0
- package/setup/.claude/hooks/check-phase-write.py +235 -0
- package/setup/.claude/hooks/dispatch.py +67 -0
- package/setup/.claude/hooks/file-suggestion.py +45 -0
- package/setup/.claude/hooks/flowcraft_env.py +137 -0
- package/setup/.claude/hooks/log_session.py +93 -0
- package/setup/.claude/hooks/permission-request.py +125 -0
- package/setup/.claude/hooks/post-tool-failure.py +36 -0
- package/setup/.claude/hooks/pre-compact.py +66 -0
- package/setup/.claude/hooks/review-runner.py +846 -0
- package/setup/.claude/hooks/session-end.py +184 -0
- package/setup/.claude/hooks/session-start.py +188 -0
- package/setup/.claude/hooks/settings.json +0 -0
- package/setup/.claude/hooks/setup-keys.py +282 -0
- package/setup/.claude/hooks/statusline.py +63 -0
- package/setup/.claude/hooks/stop-check.py +171 -0
- package/setup/.claude/hooks/subagent-start.py +50 -0
- package/setup/.claude/hooks/subagent-stop.py +63 -0
- package/setup/.claude/hooks/task-completed.py +57 -0
- package/setup/.claude/hooks/task_manager.py +592 -0
- package/setup/.claude/hooks/user-prompt-submit.py +85 -0
- package/setup/.claude/project-state.md +109 -0
- package/setup/.claude/settings.json +237 -0
- package/setup/.claude/settings.local.json +13 -0
- package/setup/.claude/skills/P5report/SKILL.md +77 -0
- package/setup/.claude/skills/Pstatus/SKILL.md +68 -0
- package/setup/.claude/skills/archive/SKILL.md +196 -0
- package/setup/.claude/skills/brainstorming/SKILL.md +155 -0
- package/setup/.claude/skills/brainstorming/scripts/frame-template.html +213 -0
- package/setup/.claude/skills/brainstorming/scripts/helper.js +167 -0
- package/setup/.claude/skills/brainstorming/scripts/server.cjs +723 -0
- package/setup/.claude/skills/brainstorming/scripts/start-server.py +245 -0
- package/setup/.claude/skills/brainstorming/scripts/stop-server.py +178 -0
- package/setup/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/setup/.claude/skills/brainstorming/visual-companion.md +298 -0
- package/setup/.claude/skills/checkpoint/SKILL.md +42 -0
- package/setup/.claude/skills/chrome-integration/SKILL.md +67 -0
- package/setup/.claude/skills/code-analysis/SKILL.md +1243 -0
- package/setup/.claude/skills/code-review/SKILL.md +265 -0
- package/setup/.claude/skills/cross-review/SKILL.md +41 -0
- package/setup/.claude/skills/executing-plans/SKILL.md +64 -0
- package/setup/.claude/skills/git-prep/SKILL.md +50 -0
- package/setup/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
- package/setup/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
- package/setup/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
- package/setup/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
- package/setup/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
- package/setup/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
- package/setup/.claude/skills/graphify/SKILL.md +49 -0
- package/setup/.claude/skills/openspec-apply-change/SKILL.md +185 -0
- package/setup/.claude/skills/openspec-archive-change/SKILL.md +182 -0
- package/setup/.claude/skills/openspec-bulk-archive-change/SKILL.md +339 -0
- package/setup/.claude/skills/openspec-continue-change/SKILL.md +118 -0
- package/setup/.claude/skills/openspec-explore/SKILL.md +311 -0
- package/setup/.claude/skills/openspec-ff-change/SKILL.md +113 -0
- package/setup/.claude/skills/openspec-new-change/SKILL.md +77 -0
- package/setup/.claude/skills/openspec-onboard/SKILL.md +573 -0
- package/setup/.claude/skills/openspec-propose/SKILL.md +149 -0
- package/setup/.claude/skills/openspec-sync-specs/SKILL.md +262 -0
- package/setup/.claude/skills/openspec-update-change/SKILL.md +91 -0
- package/setup/.claude/skills/openspec-verify-change/SKILL.md +175 -0
- package/setup/.claude/skills/oss-version-check/SKILL.md +71 -0
- package/setup/.claude/skills/oss-version-check/check_oss_version.py +205 -0
- package/setup/.claude/skills/phase/SKILL.md +63 -0
- package/setup/.claude/skills/playwright/SKILL.md +86 -0
- package/setup/.claude/skills/playwright-cli/SKILL.md +420 -0
- package/setup/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
- package/setup/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/setup/.claude/skills/playwright-cli/references/references/element-attributes.md +23 -0
- package/setup/.claude/skills/playwright-cli/references/references/playwright-tests.md +39 -0
- package/setup/.claude/skills/playwright-cli/references/references/request-mocking.md +87 -0
- package/setup/.claude/skills/playwright-cli/references/references/running-code.md +241 -0
- package/setup/.claude/skills/playwright-cli/references/references/session-management.md +225 -0
- package/setup/.claude/skills/playwright-cli/references/references/storage-state.md +275 -0
- package/setup/.claude/skills/playwright-cli/references/references/test-generation.md +433 -0
- package/setup/.claude/skills/playwright-cli/references/references/tracing.md +139 -0
- package/setup/.claude/skills/playwright-cli/references/references/video-recording.md +143 -0
- package/setup/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
- package/setup/.claude/skills/playwright-cli/references/running-code.md +241 -0
- package/setup/.claude/skills/playwright-cli/references/session-management.md +225 -0
- package/setup/.claude/skills/playwright-cli/references/storage-state.md +275 -0
- package/setup/.claude/skills/playwright-cli/references/test-generation.md +433 -0
- package/setup/.claude/skills/playwright-cli/references/tracing.md +139 -0
- package/setup/.claude/skills/playwright-cli/references/video-recording.md +143 -0
- package/setup/.claude/skills/review/SKILL.md +98 -0
- package/setup/.claude/skills/review-tools/SKILL.md +76 -0
- package/setup/.claude/skills/subagent-driven-development/SKILL.md +94 -0
- package/setup/.claude/skills/task/SKILL.md +26 -0
- package/setup/.claude/skills/test-driven-development/SKILL.md +320 -0
- package/setup/.claude/skills/test-driven-development/writing-good-tests.md +198 -0
- package/setup/.claude/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/setup/.claude/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/setup/.claude/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/setup/.claude/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/setup/.claude/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/setup/.claude/skills/ui-ux-standards/SKILL.md +154 -0
- package/setup/.claude/skills/verification-before-completion/SKILL.md +120 -0
- package/setup/.claude/skills/wiki-read/SKILL.md +190 -0
- package/setup/.claude/skills/writing-plans/SKILL.md +168 -0
- package/setup/.claude/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/setup/.claude/tasks/.last-session +1 -0
- package/setup/.codex/.agents/skills/P5report/SKILL.md +77 -0
- package/setup/.codex/.agents/skills/Pstatus/SKILL.md +30 -0
- package/setup/.codex/.agents/skills/archive/SKILL.md +196 -0
- package/setup/.codex/.agents/skills/brainstorming/SKILL.md +155 -0
- package/setup/.codex/.agents/skills/brainstorming/scripts/frame-template.html +213 -0
- package/setup/.codex/.agents/skills/brainstorming/scripts/helper.js +167 -0
- package/setup/.codex/.agents/skills/brainstorming/scripts/server.cjs +723 -0
- package/setup/.codex/.agents/skills/brainstorming/scripts/start-server.py +245 -0
- package/setup/.codex/.agents/skills/brainstorming/scripts/stop-server.py +178 -0
- package/setup/.codex/.agents/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/setup/.codex/.agents/skills/brainstorming/visual-companion.md +298 -0
- package/setup/.codex/.agents/skills/checkpoint/SKILL.md +42 -0
- package/setup/.codex/.agents/skills/chrome-integration/SKILL.md +67 -0
- package/setup/.codex/.agents/skills/code-analysis/SKILL.md +1243 -0
- package/setup/.codex/.agents/skills/code-review/SKILL.md +265 -0
- package/setup/.codex/.agents/skills/cross-review/SKILL.md +42 -0
- package/setup/.codex/.agents/skills/executing-plans/SKILL.md +64 -0
- package/setup/.codex/.agents/skills/git-prep/SKILL.md +50 -0
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-cli/SKILL.md +67 -0
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-guide/SKILL.md +66 -0
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
- package/setup/.codex/.agents/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
- package/setup/.codex/.agents/skills/graphify/SKILL.md +49 -0
- package/setup/.codex/.agents/skills/openspec-apply-change/SKILL.md +185 -0
- package/setup/.codex/.agents/skills/openspec-archive-change/SKILL.md +182 -0
- package/setup/.codex/.agents/skills/openspec-bulk-archive-change/SKILL.md +339 -0
- package/setup/.codex/.agents/skills/openspec-continue-change/SKILL.md +118 -0
- package/setup/.codex/.agents/skills/openspec-explore/SKILL.md +311 -0
- package/setup/.codex/.agents/skills/openspec-ff-change/SKILL.md +113 -0
- package/setup/.codex/.agents/skills/openspec-new-change/SKILL.md +77 -0
- package/setup/.codex/.agents/skills/openspec-onboard/SKILL.md +573 -0
- package/setup/.codex/.agents/skills/openspec-propose/SKILL.md +149 -0
- package/setup/.codex/.agents/skills/openspec-sync-specs/SKILL.md +262 -0
- package/setup/.codex/.agents/skills/openspec-update-change/SKILL.md +91 -0
- package/setup/.codex/.agents/skills/openspec-verify-change/SKILL.md +175 -0
- package/setup/.codex/.agents/skills/oss-version-check/SKILL.md +71 -0
- package/setup/.codex/.agents/skills/oss-version-check/check_oss_version.py +205 -0
- package/setup/.codex/.agents/skills/phase/SKILL.md +63 -0
- package/setup/.codex/.agents/skills/playwright/SKILL.md +86 -0
- package/setup/.codex/.agents/skills/playwright-cli/SKILL.md +420 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/element-attributes.md +23 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/element-attributes.md +23 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/playwright-tests.md +39 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/request-mocking.md +87 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/running-code.md +241 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/session-management.md +225 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/storage-state.md +275 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/test-generation.md +433 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/tracing.md +139 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/references/video-recording.md +143 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/request-mocking.md +87 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/running-code.md +241 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/session-management.md +225 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/storage-state.md +275 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/test-generation.md +433 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/tracing.md +139 -0
- package/setup/.codex/.agents/skills/playwright-cli/references/video-recording.md +143 -0
- package/setup/.codex/.agents/skills/review/SKILL.md +98 -0
- package/setup/.codex/.agents/skills/review-tools/SKILL.md +76 -0
- package/setup/.codex/.agents/skills/subagent-driven-development/SKILL.md +94 -0
- package/setup/.codex/.agents/skills/task/SKILL.md +27 -0
- package/setup/.codex/.agents/skills/test-driven-development/SKILL.md +320 -0
- package/setup/.codex/.agents/skills/test-driven-development/writing-good-tests.md +198 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/SKILL.md +377 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/setup/.codex/.agents/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/setup/.codex/.agents/skills/ui-ux-standards/SKILL.md +154 -0
- package/setup/.codex/.agents/skills/verification-before-completion/SKILL.md +120 -0
- package/setup/.codex/.agents/skills/wiki-read/SKILL.md +190 -0
- package/setup/.codex/.agents/skills/writing-plans/SKILL.md +168 -0
- package/setup/.codex/.agents/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/setup/.codex/config.toml +10 -0
- package/setup/.codex/hooks/log_session.py +92 -0
- package/setup/.codex/hooks/review-runner.py +851 -0
- package/setup/.codex/hooks/sdlc-codex-hook.cjs +1039 -0
- package/setup/.codex/hooks/setup-keys.py +287 -0
- package/setup/.codex/hooks.json +121 -0
- package/setup/.codex/model-catalog.json +154 -0
- package/setup/.codex/project-state.md +103 -0
- package/setup/AGENTS.md +722 -0
- package/setup/CLAUDE.md +717 -0
- package/setup/install.sh +24 -0
- package/setup/tests/test_decision_timeout.py +241 -0
- package/setup/tests/test_hook_guards.py +357 -0
- package/setup/tests/test_sdlc_bootstrap.py +167 -0
- package/setup/tests/test_task_manager.py +148 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openspec-verify-change
|
|
3
|
+
description: Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
|
|
4
|
+
allowed-tools: Bash(openspec:*)
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires openspec CLI.
|
|
7
|
+
metadata:
|
|
8
|
+
author: openspec
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
> **Auto-install (懒加载自动安装)**: 仅当本技能被调用且 `openspec` 命令缺失时执行:`npm i -g @fission-ai/openspec`,或改用 `npx @fission-ai/openspec {cmd}`(按需下载)。
|
|
12
|
+
|
|
13
|
+
Verify that an implementation matches the change artifacts (specs, tasks, design).
|
|
14
|
+
|
|
15
|
+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
16
|
+
|
|
17
|
+
**Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
18
|
+
|
|
19
|
+
**Steps**
|
|
20
|
+
|
|
21
|
+
1. **Select the change**
|
|
22
|
+
|
|
23
|
+
If a name is provided, use it. Otherwise:
|
|
24
|
+
- Infer from conversation context if the user mentioned a change
|
|
25
|
+
- Auto-select if only one active change exists
|
|
26
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
27
|
+
|
|
28
|
+
When prompting, show changes that have implementation tasks (tasks artifact exists).
|
|
29
|
+
Include the schema used for each change if available.
|
|
30
|
+
Mark changes with incomplete tasks as "(In Progress)".
|
|
31
|
+
|
|
32
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/openspec-verify-change <other>`).
|
|
33
|
+
|
|
34
|
+
2. **Check status to understand the schema**
|
|
35
|
+
```bash
|
|
36
|
+
openspec status --change "<name>" --json
|
|
37
|
+
```
|
|
38
|
+
Parse the JSON to understand:
|
|
39
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
40
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context
|
|
41
|
+
- Which artifacts exist for this change
|
|
42
|
+
|
|
43
|
+
3. **Get planning context and load artifacts**
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
openspec instructions apply --change "<name>" --json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This returns the change directory and `contextFiles` (artifact ID -> array of concrete file paths). Read all available artifacts from `contextFiles`.
|
|
50
|
+
|
|
51
|
+
4. **Initialize verification report structure**
|
|
52
|
+
|
|
53
|
+
Create a report structure with three dimensions:
|
|
54
|
+
- **Completeness**: Track tasks and spec coverage
|
|
55
|
+
- **Correctness**: Track requirement implementation and scenario coverage
|
|
56
|
+
- **Coherence**: Track design adherence and pattern consistency
|
|
57
|
+
|
|
58
|
+
Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
|
|
59
|
+
|
|
60
|
+
5. **Verify Completeness**
|
|
61
|
+
|
|
62
|
+
**Task Completion**:
|
|
63
|
+
- If `contextFiles.tasks` exists, read every file path in it
|
|
64
|
+
- Parse checkboxes: `- [ ]` (incomplete) vs `- [x]` (complete)
|
|
65
|
+
- Count complete vs total tasks
|
|
66
|
+
- If incomplete tasks exist:
|
|
67
|
+
- Add CRITICAL issue for each incomplete task
|
|
68
|
+
- Recommendation: "Complete task: <description>" or "Mark as done if already implemented"
|
|
69
|
+
|
|
70
|
+
**Spec Coverage**:
|
|
71
|
+
- If delta specs exist in `contextFiles.specs`:
|
|
72
|
+
- Extract all requirements (marked with "### Requirement:")
|
|
73
|
+
- For each requirement:
|
|
74
|
+
- Search codebase for keywords related to the requirement
|
|
75
|
+
- Assess if implementation likely exists
|
|
76
|
+
- If requirements appear unimplemented:
|
|
77
|
+
- Add CRITICAL issue: "Requirement not found: <requirement name>"
|
|
78
|
+
- Recommendation: "Implement requirement X: <description>"
|
|
79
|
+
|
|
80
|
+
6. **Verify Correctness**
|
|
81
|
+
|
|
82
|
+
**Requirement Implementation Mapping**:
|
|
83
|
+
- For each requirement from delta specs:
|
|
84
|
+
- Search codebase for implementation evidence
|
|
85
|
+
- If found, note file paths and line ranges
|
|
86
|
+
- Assess if implementation matches requirement intent
|
|
87
|
+
- If divergence detected:
|
|
88
|
+
- Add WARNING: "Implementation may diverge from spec: <details>"
|
|
89
|
+
- Recommendation: "Review <file>:<lines> against requirement X"
|
|
90
|
+
|
|
91
|
+
**Scenario Coverage**:
|
|
92
|
+
- For each scenario in delta specs (marked with "#### Scenario:"):
|
|
93
|
+
- Check if conditions are handled in code
|
|
94
|
+
- Check if tests exist covering the scenario
|
|
95
|
+
- If scenario appears uncovered:
|
|
96
|
+
- Add WARNING: "Scenario not covered: <scenario name>"
|
|
97
|
+
- Recommendation: "Add test or implementation for scenario: <description>"
|
|
98
|
+
|
|
99
|
+
7. **Verify Coherence**
|
|
100
|
+
|
|
101
|
+
**Design Adherence**:
|
|
102
|
+
- If `contextFiles.design` exists:
|
|
103
|
+
- Extract key decisions (look for sections like "Decision:", "Approach:", "Architecture:")
|
|
104
|
+
- Verify implementation follows those decisions
|
|
105
|
+
- If contradiction detected:
|
|
106
|
+
- Add WARNING: "Design decision not followed: <decision>"
|
|
107
|
+
- Recommendation: "Update implementation or revise design.md to match reality"
|
|
108
|
+
- If no design.md: Skip design adherence check, note "No design.md to verify against"
|
|
109
|
+
|
|
110
|
+
**Code Pattern Consistency**:
|
|
111
|
+
- Review new code for consistency with project patterns
|
|
112
|
+
- Check file naming, directory structure, coding style
|
|
113
|
+
- If significant deviations found:
|
|
114
|
+
- Add SUGGESTION: "Code pattern deviation: <details>"
|
|
115
|
+
- Recommendation: "Consider following project pattern: <example>"
|
|
116
|
+
|
|
117
|
+
8. **Generate Verification Report**
|
|
118
|
+
|
|
119
|
+
**Summary Scorecard**:
|
|
120
|
+
```markdown
|
|
121
|
+
## Verification Report: <change-name>
|
|
122
|
+
|
|
123
|
+
### Summary
|
|
124
|
+
| Dimension | Status |
|
|
125
|
+
|--------------|------------------|
|
|
126
|
+
| Completeness | X/Y tasks, N reqs|
|
|
127
|
+
| Correctness | M/N reqs covered |
|
|
128
|
+
| Coherence | Followed/Issues |
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Issues by Priority**:
|
|
132
|
+
|
|
133
|
+
1. **CRITICAL** (Must fix before archive):
|
|
134
|
+
- Incomplete tasks
|
|
135
|
+
- Missing requirement implementations
|
|
136
|
+
- Each with specific, actionable recommendation
|
|
137
|
+
|
|
138
|
+
2. **WARNING** (Should fix):
|
|
139
|
+
- Spec/design divergences
|
|
140
|
+
- Missing scenario coverage
|
|
141
|
+
- Each with specific recommendation
|
|
142
|
+
|
|
143
|
+
3. **SUGGESTION** (Nice to fix):
|
|
144
|
+
- Pattern inconsistencies
|
|
145
|
+
- Minor improvements
|
|
146
|
+
- Each with specific recommendation
|
|
147
|
+
|
|
148
|
+
**Final Assessment**:
|
|
149
|
+
- If CRITICAL issues: "X critical issue(s) found. Fix before archiving."
|
|
150
|
+
- If only warnings: "No critical issues. Y warning(s) to consider. Ready for archive (with noted improvements)."
|
|
151
|
+
- If all clear: "All checks passed. Ready for archive."
|
|
152
|
+
|
|
153
|
+
**Verification Heuristics**
|
|
154
|
+
|
|
155
|
+
- **Completeness**: Focus on objective checklist items (checkboxes, requirements list)
|
|
156
|
+
- **Correctness**: Use keyword search, file path analysis, reasonable inference - don't require perfect certainty
|
|
157
|
+
- **Coherence**: Look for glaring inconsistencies, don't nitpick style
|
|
158
|
+
- **False Positives**: When uncertain, prefer SUGGESTION over WARNING, WARNING over CRITICAL
|
|
159
|
+
- **Actionability**: Every issue must have a specific recommendation with file/line references where applicable
|
|
160
|
+
|
|
161
|
+
**Graceful Degradation**
|
|
162
|
+
|
|
163
|
+
- If only tasks.md exists: verify task completion only, skip spec/design checks
|
|
164
|
+
- If tasks + specs exist: verify completeness and correctness, skip design
|
|
165
|
+
- If full artifacts: verify all three dimensions
|
|
166
|
+
- Always note which checks were skipped and why
|
|
167
|
+
|
|
168
|
+
**Output Format**
|
|
169
|
+
|
|
170
|
+
Use clear markdown with:
|
|
171
|
+
- Table for summary scorecard
|
|
172
|
+
- Grouped lists for issues (CRITICAL/WARNING/SUGGESTION)
|
|
173
|
+
- Code references in format: `file.ts:123`
|
|
174
|
+
- Specific, actionable recommendations
|
|
175
|
+
- No vague suggestions like "consider reviewing"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: oss-version-check
|
|
3
|
+
description: "P1 version verification: verify OSS component versions via Maven Central / GitHub Releases / OSV before recommending (stable + current + vulnerability-checked). | 触发词:版本核验/版本检查/组件版本/推荐版本"
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- Bash
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# oss-version-check — OSS Version Verification (版本核验, mandatory in P1)
|
|
11
|
+
|
|
12
|
+
在 P1 技术栈/版本选择时,必须先核验开源组件的真实最新稳定版本与已知漏洞,再给出版本建议;禁止仅凭模型记忆推荐版本。
|
|
13
|
+
|
|
14
|
+
## Trigger (触发)
|
|
15
|
+
- P1 决策点2(技术栈确认)、新增依赖、组件升级需要给出版本建议时,必须运行本技能
|
|
16
|
+
- 触发词:版本核验 / 版本检查 / 推荐版本 / 组件版本
|
|
17
|
+
|
|
18
|
+
## Workflow (步骤)
|
|
19
|
+
|
|
20
|
+
1. **确定组件坐标**
|
|
21
|
+
- Maven/Java:`groupId:artifactId`(如 `io.jsonwebtoken:jjwt`)
|
|
22
|
+
- GitHub:`owner/repo`(如 `apache/commons-lang`)
|
|
23
|
+
- npm:包名;PyPI:包名
|
|
24
|
+
2. **查询 Maven Central**(Java 组件必查;用辅助脚本或以下命令)
|
|
25
|
+
```bash
|
|
26
|
+
# 最新版本/发布时间
|
|
27
|
+
curl -s "https://search.maven.org/solrsearch/select?q=g:%22<g>%22%20AND%20a:%22<a>%22&rows=5&wt=json"
|
|
28
|
+
# 完整版本列表(排除 SNAPSHOT/预发布)
|
|
29
|
+
curl -s "https://repo1.maven.org/maven2/<g.以/分隔>/<a>/maven-metadata.xml"
|
|
30
|
+
```
|
|
31
|
+
3. **查询 GitHub Releases**(GitHub 托管组件)
|
|
32
|
+
```bash
|
|
33
|
+
curl -s -H "Accept: application/vnd.github+json" "https://api.github.com/repos/<owner>/<repo>/releases/latest"
|
|
34
|
+
curl -s "https://api.github.com/repos/<owner>/<repo>/releases?per_page=10"
|
|
35
|
+
```
|
|
36
|
+
`prerelease=true` 或 `draft` 不算稳定版。
|
|
37
|
+
4. **查询漏洞(OSV,免 key)**
|
|
38
|
+
```bash
|
|
39
|
+
curl -s -X POST "https://api.osv.dev/v1/query" -H "Content-Type: application/json" -d '{"package":{"ecosystem":"Maven","name":"<g>:<a>"}}'
|
|
40
|
+
```
|
|
41
|
+
ecosystem:Maven / npm / PyPI / Go。
|
|
42
|
+
5. **输出版本核验表 + 决策卡,等待用户确认**(SDLC:版本选择必须用户确认)
|
|
43
|
+
|
|
44
|
+
## Output (输出格式)
|
|
45
|
+
|
|
46
|
+
### 版本核验表
|
|
47
|
+
| 组件 | 候选版本 | 最新稳定 | 预发布? | 已知漏洞(fixed) | 建议 |
|
|
48
|
+
|------|---------|---------|--------|----------------|------|
|
|
49
|
+
| io.jsonwebtoken:jjwt | 0.12.6 | 0.12.6 | 否 | 无(OSV) | 推荐 0.12.6 |
|
|
50
|
+
|
|
51
|
+
### 版本选择决策卡(等用户确认)
|
|
52
|
+
**✅ 推荐 · A. 最新稳定版 <x.y.z>**:稳定、无已知漏洞(OSV)
|
|
53
|
+
**🔀 备选 · B. <LTS/兼容版本>**:兼容性优先
|
|
54
|
+
**🔀 备选 · C. 指定版本 <x.y.z>**:团队已有基线
|
|
55
|
+
**选择规则**: 默认最新稳定版;存在已知漏洞且有修复版 → 禁止直接推荐带漏洞版本,给出修复版/升级路径。
|
|
56
|
+
|
|
57
|
+
## Rules (规则)
|
|
58
|
+
- 只推荐:非 SNAPSHOT、非 prerelease、有正式发布时间的「最新稳定版」;除非用户指定 LTS/兼容版本
|
|
59
|
+
- 最新稳定版有已知漏洞且已有 fixed 版本 → 禁止直接推荐,须给修复版本与升级路径
|
|
60
|
+
- OSV 无记录 ≠ 无漏洞 → 标注「OSV 未收录,建议 NVD/人工复核」
|
|
61
|
+
- 网络不可用 → 允许回退知识库推荐,但决策卡必须标注「未核验」,网络恢复后补核验
|
|
62
|
+
- 版本选择结果必须等用户确认后才能写入 pom.xml / package.json 等
|
|
63
|
+
|
|
64
|
+
## Helper script (辅助脚本)
|
|
65
|
+
```bash
|
|
66
|
+
python check_oss_version.py "io.jsonwebtoken:jjwt" # Maven
|
|
67
|
+
python check_oss_version.py --github apache/commons-lang # GitHub
|
|
68
|
+
python check_oss_version.py --npm react # npm
|
|
69
|
+
python check_oss_version.py --pypi requests # PyPI
|
|
70
|
+
```
|
|
71
|
+
输出 JSON 核验结果(latest stable / prerelease / vulns),供生成核验表。
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""oss-version-check: verify OSS component versions via Maven Central / GitHub Releases / OSV.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python check_oss_version.py "<groupId>:<artifactId>" # Maven
|
|
7
|
+
python check_oss_version.py --github owner/repo # GitHub Releases
|
|
8
|
+
python check_oss_version.py --npm <package> # npm
|
|
9
|
+
python check_oss_version.py --pypi <package> # PyPI
|
|
10
|
+
"""
|
|
11
|
+
import argparse
|
|
12
|
+
import json
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
import urllib.parse
|
|
16
|
+
import urllib.request
|
|
17
|
+
import xml.etree.ElementTree as ET
|
|
18
|
+
|
|
19
|
+
UA = {"User-Agent": "sdlc-oss-version-check/1.0", "Accept": "application/json"}
|
|
20
|
+
TIMEOUT = 20
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def http_json(url, method="GET", payload=None, timeout=TIMEOUT):
|
|
24
|
+
data = json.dumps(payload).encode("utf-8") if payload is not None else None
|
|
25
|
+
req = urllib.request.Request(url, data=data, headers=UA, method=method)
|
|
26
|
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
27
|
+
return json.loads(resp.read().decode("utf-8", "replace"))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def http_text(url, timeout=TIMEOUT):
|
|
31
|
+
req = urllib.request.Request(url, headers=UA)
|
|
32
|
+
with urllib.request.urlopen(req, timeout=timeout) as resp:
|
|
33
|
+
return resp.read().decode("utf-8", "replace")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def is_prerelease(version):
|
|
37
|
+
return bool(re.search(r"(?i)(-?SNAPSHOT|[-.]?(alpha|beta|rc|m\\d+|preview|dev|ea|snapshot))", version or ""))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def maven(group, artifact):
|
|
41
|
+
out = {"ecosystem": "Maven", "name": "%s:%s" % (group, artifact)}
|
|
42
|
+
try:
|
|
43
|
+
q = urllib.parse.quote('g:"%s" AND a:"%s"' % (group, artifact))
|
|
44
|
+
d = http_json("https://search.maven.org/solrsearch/select?q=%s&rows=5&wt=json" % q)
|
|
45
|
+
docs = (d.get("response") or {}).get("docs") or []
|
|
46
|
+
if docs:
|
|
47
|
+
out["latestVersion"] = docs[0].get("latestVersion")
|
|
48
|
+
out["timestamp"] = docs[0].get("timestamp")
|
|
49
|
+
out["versionCount"] = docs[0].get("versionCount")
|
|
50
|
+
else:
|
|
51
|
+
out["error_search"] = "component not found on Maven Central"
|
|
52
|
+
except Exception as e:
|
|
53
|
+
out["error_search"] = str(e)
|
|
54
|
+
try:
|
|
55
|
+
path = "%s/%s" % (group.replace(".", "/"), artifact)
|
|
56
|
+
root = ET.fromstring(http_text("https://repo1.maven.org/maven2/%s/maven-metadata.xml" % path))
|
|
57
|
+
versions = [v.text for v in root.findall(".//version") if v.text]
|
|
58
|
+
out["versions"] = versions
|
|
59
|
+
stable = [v for v in versions if not is_prerelease(v)]
|
|
60
|
+
out["latest_stable"] = stable[-1] if stable else None
|
|
61
|
+
except Exception as e:
|
|
62
|
+
out["error_metadata"] = str(e)
|
|
63
|
+
return out
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def github(owner, repo):
|
|
67
|
+
out = {"ecosystem": "GitHub", "name": "%s/%s" % (owner, repo)}
|
|
68
|
+
try:
|
|
69
|
+
d = http_json("https://api.github.com/repos/%s/%s/releases/latest" % (owner, repo))
|
|
70
|
+
out["latest"] = {
|
|
71
|
+
"tag": d.get("tag_name"),
|
|
72
|
+
"prerelease": d.get("prerelease"),
|
|
73
|
+
"published": d.get("published_at"),
|
|
74
|
+
"html": d.get("html_url"),
|
|
75
|
+
}
|
|
76
|
+
except Exception as e:
|
|
77
|
+
out["error_latest"] = str(e)
|
|
78
|
+
try:
|
|
79
|
+
rels = http_json("https://api.github.com/repos/%s/%s/releases?per_page=10" % (owner, repo))
|
|
80
|
+
out["releases"] = [
|
|
81
|
+
{"tag": r.get("tag_name"), "prerelease": r.get("prerelease"), "published": r.get("published_at")}
|
|
82
|
+
for r in rels
|
|
83
|
+
]
|
|
84
|
+
stable = [r for r in rels if not r.get("prerelease") and not r.get("draft")]
|
|
85
|
+
out["latest_stable"] = stable[0].get("tag_name") if stable else None
|
|
86
|
+
except Exception as e:
|
|
87
|
+
out["error_releases"] = str(e)
|
|
88
|
+
return out
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def npm(name):
|
|
92
|
+
out = {"ecosystem": "npm", "name": name}
|
|
93
|
+
try:
|
|
94
|
+
d = http_json("https://registry.npmjs.org/%s" % urllib.parse.quote(name, safe=""))
|
|
95
|
+
out["latest"] = (d.get("dist-tags") or {}).get("latest")
|
|
96
|
+
times = d.get("time") or {}
|
|
97
|
+
if out["latest"]:
|
|
98
|
+
out["published"] = times.get(out["latest"])
|
|
99
|
+
versions = [v for v in (d.get("versions") or {}) if not is_prerelease(v)]
|
|
100
|
+
out["latest_stable"] = versions[-1] if versions else out["latest"]
|
|
101
|
+
except Exception as e:
|
|
102
|
+
out["error"] = str(e)
|
|
103
|
+
return out
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def pypi(name):
|
|
107
|
+
out = {"ecosystem": "PyPI", "name": name}
|
|
108
|
+
try:
|
|
109
|
+
d = http_json("https://pypi.org/pypi/%s/json" % urllib.parse.quote(name, safe=""))
|
|
110
|
+
out["latest"] = (d.get("info") or {}).get("version")
|
|
111
|
+
out["latest_stable"] = out["latest"]
|
|
112
|
+
except Exception as e:
|
|
113
|
+
out["error"] = str(e)
|
|
114
|
+
return out
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def osv(ecosystem, name):
|
|
118
|
+
out = {"vulns": []}
|
|
119
|
+
try:
|
|
120
|
+
d = http_json(
|
|
121
|
+
"https://api.osv.dev/v1/query",
|
|
122
|
+
method="POST",
|
|
123
|
+
payload={"package": {"ecosystem": ecosystem, "name": name}},
|
|
124
|
+
)
|
|
125
|
+
for v in d.get("vulns") or []:
|
|
126
|
+
fixed = set()
|
|
127
|
+
for aff in v.get("affected") or []:
|
|
128
|
+
for rng in aff.get("ranges") or []:
|
|
129
|
+
for ev in rng.get("events") or []:
|
|
130
|
+
if "fixed" in ev:
|
|
131
|
+
fixed.add(ev["fixed"])
|
|
132
|
+
out["vulns"].append(
|
|
133
|
+
{
|
|
134
|
+
"id": v.get("id"),
|
|
135
|
+
"aliases": v.get("aliases") or [],
|
|
136
|
+
"summary": (v.get("summary") or "")[:150],
|
|
137
|
+
"fixed": sorted(fixed),
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
except Exception as e:
|
|
141
|
+
out["error"] = str(e)
|
|
142
|
+
return out
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def print_summary(res):
|
|
146
|
+
print("===== OSS Version Verification (版本核验) =====")
|
|
147
|
+
print("component : %s / %s" % (res.get("ecosystem"), res.get("name")))
|
|
148
|
+
for key, label in (
|
|
149
|
+
("latestVersion", "maven latestVersion"),
|
|
150
|
+
("latest_stable", "latest stable"),
|
|
151
|
+
("latest", "latest"),
|
|
152
|
+
("published", "published"),
|
|
153
|
+
("timestamp", "maven timestamp"),
|
|
154
|
+
("versionCount", "maven versionCount"),
|
|
155
|
+
):
|
|
156
|
+
if key in res and res[key] is not None:
|
|
157
|
+
print("%-20s: %s" % (label, res[key]))
|
|
158
|
+
if isinstance(res.get("latest"), dict):
|
|
159
|
+
lt = res["latest"]
|
|
160
|
+
print("%-20s: %s (prerelease=%s, published=%s)" % ("github latest", lt.get("tag"), lt.get("prerelease"), lt.get("published")))
|
|
161
|
+
vulns = (res.get("osv") or {}).get("vulns") or []
|
|
162
|
+
if vulns:
|
|
163
|
+
print("vulnerabilities (%d):" % len(vulns))
|
|
164
|
+
for v in vulns:
|
|
165
|
+
print(" - %s aliases=%s fixed=%s %s" % (v.get("id"), v.get("aliases"), v.get("fixed"), v.get("summary")))
|
|
166
|
+
else:
|
|
167
|
+
print("vulnerabilities: 0 (OSV 未收录不代表无漏洞)")
|
|
168
|
+
if (res.get("osv") or {}).get("error"):
|
|
169
|
+
print("osv error:", res["osv"]["error"])
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def main():
|
|
173
|
+
ap = argparse.ArgumentParser(description="OSS version verification (Maven Central / GitHub Releases / OSV / npm / PyPI)")
|
|
174
|
+
ap.add_argument("coord", nargs="?", help="Maven coordinate groupId:artifactId")
|
|
175
|
+
ap.add_argument("--github", metavar="owner/repo", help="GitHub repository")
|
|
176
|
+
ap.add_argument("--npm", metavar="name", help="npm package")
|
|
177
|
+
ap.add_argument("--pypi", metavar="name", help="PyPI package")
|
|
178
|
+
ap.add_argument("--json", action="store_true", help="output raw JSON only")
|
|
179
|
+
args = ap.parse_args()
|
|
180
|
+
|
|
181
|
+
if args.github and "/" in args.github:
|
|
182
|
+
owner, repo = args.github.split("/", 1)
|
|
183
|
+
res = github(owner, repo)
|
|
184
|
+
res["osv"] = osv("GitHub", args.github)
|
|
185
|
+
elif args.npm:
|
|
186
|
+
res = npm(args.npm)
|
|
187
|
+
res["osv"] = osv("npm", args.npm)
|
|
188
|
+
elif args.pypi:
|
|
189
|
+
res = pypi(args.pypi)
|
|
190
|
+
res["osv"] = osv("PyPI", args.pypi)
|
|
191
|
+
elif args.coord and ":" in args.coord:
|
|
192
|
+
group, artifact = args.coord.split(":", 1)
|
|
193
|
+
res = maven(group, artifact)
|
|
194
|
+
res["osv"] = osv("Maven", "%s:%s" % (group, artifact))
|
|
195
|
+
else:
|
|
196
|
+
ap.error("provide <groupId:artifactId>, or --github owner/repo, --npm name, --pypi name")
|
|
197
|
+
|
|
198
|
+
if args.json:
|
|
199
|
+
sys.stdout.write(json.dumps(res, ensure_ascii=False, indent=2) + "\n")
|
|
200
|
+
else:
|
|
201
|
+
print_summary(res)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
if __name__ == "__main__":
|
|
205
|
+
main()
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: phase
|
|
3
|
+
description: "SDLC phase management: view/advance/rollback. | 触发词:下一阶段/推进/查看阶段"
|
|
4
|
+
argument-hint: "[next|back|status]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Edit
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Usage: `/phase [next|back|status]`
|
|
13
|
+
|
|
14
|
+
Arguments: $ARGUMENTS
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Decision point format (决策点格式)
|
|
19
|
+
|
|
20
|
+
Present every decision point (requirement method A/B, P0.5 A/B/C, etc.) with the Decision Card format defined in AGENTS.md / CLAUDE.md → "Display Format Standard (展示格式规范) → Decision point format (决策点格式)": bold black title, options labeled A./B./C. in order, ✅ Recommended / 🔀 Alternative marks, features/when-to-use/costs per option; no thin box-drawing characters, no trailing operation hint line.
|
|
21
|
+
|
|
22
|
+
## Current phase (当前阶段)
|
|
23
|
+
Read `.claude/project-state.md` to get the `current_phase` value.
|
|
24
|
+
|
|
25
|
+
## Execution logic (执行逻辑)
|
|
26
|
+
|
|
27
|
+
### No argument or `status`
|
|
28
|
+
Read `.claude/project-state.md` and output: phase number + name, allowed operations, completion conditions, advancement method.
|
|
29
|
+
|
|
30
|
+
### `next` — advance to the next phase
|
|
31
|
+
|
|
32
|
+
1. Read the current phase and check completion conditions
|
|
33
|
+
2. **P1 (advance on user PRD confirmation)**: at P1 start, ask the user to choose requirement method **A. brainstorming (default) / B. openspec** and record it; after the user confirms the PRD (including architecture + prototype) → **first write `plan/<task-name>.md` to save the design** → update `project-state.md` → prompt "entering auto-driven mode (自动驱动模式)"
|
|
34
|
+
3. **P2/P3/P5 (advance on completion, no review)**: before P2, Read `plan/` to confirm the plan file exists; write it first if missing → P2 done (requires [P2-COMPLETION] three-question self-review) → P3; P3 done → P4; P5 done → output the delivery summary report
|
|
35
|
+
4. **P4 (the only formal review)**: auto-run `/review` → pass → P5; fail → auto-fix and re-review (max 3 times)
|
|
36
|
+
|
|
37
|
+
Update fields: `current_phase`, `phase_history`, `last_updated`, `review_retry_count`→0
|
|
38
|
+
|
|
39
|
+
### `back` — roll back to the previous phase
|
|
40
|
+
P0/P1 cannot roll back. Ask for the rollback reason; update `project-state.md` (`current_phase`, `phase_history` including the rollback reason, `last_updated`)
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Auto-driven mode (自动驱动模式)
|
|
45
|
+
|
|
46
|
+
After the user confirms the PRD in P1, P2-P5 run automatically: coding → testing → P4 comprehensive review → delivery. P4 is the only review gate; on failure, auto-fix and retry (max 3 times). The user can intervene anytime: `/phase` to view progress, `/review` for a manual review, `/phase back` to roll back.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## P5 delivery summary report format (P5 交付摘要报告格式, concise)
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
# P5 Delivery Summary (P5 交付摘要)
|
|
54
|
+
|
|
55
|
+
**PRD completed (PRD 完成)**: {n}/{n} (100%) | R1✅ R2✅ R3✅
|
|
56
|
+
**Files (文件)**: {n} | **Tests (测试)**: {n} passed | **Git**: {hash}
|
|
57
|
+
**Review retries (审查重试)**: {n}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Mandatory rules (强制规则, violation = violation)
|
|
61
|
+
- Before entering P2 (coding), must first check whether the `plan/` directory contains a plan file for the current task; output the detailed plan doc to `plan/`
|
|
62
|
+
- If the plan file does not exist, must first write `plan/<task-name>.md` and get user confirmation
|
|
63
|
+
- Creating or modifying code files without a plan file is forbidden
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Playwright Testing Skill
|
|
2
|
+
|
|
3
|
+
> **Note (说明)**: 浏览器交互工具层已由官方 `playwright-cli` 技能取代(R4);本技能保留 E2E 测试框架(@playwright/test)用法。
|
|
4
|
+
|
|
5
|
+
Browser automation and end-to-end testing using Playwright.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -D @playwright/test
|
|
11
|
+
npx playwright install chromium
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Common Commands
|
|
15
|
+
|
|
16
|
+
| Task | Command |
|
|
17
|
+
|------|---------|
|
|
18
|
+
| Install browsers | `npx playwright install` |
|
|
19
|
+
| Run tests | `npx playwright test` |
|
|
20
|
+
| UI mode | `npx playwright test --ui` |
|
|
21
|
+
| Headless | `npx playwright test --headed` |
|
|
22
|
+
| Debug | `npx playwright test --debug` |
|
|
23
|
+
| Record | `npx playwright codegen` |
|
|
24
|
+
|
|
25
|
+
## Test Structure
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { test, expect } from '@playwright/test'
|
|
29
|
+
|
|
30
|
+
test('basic test', async ({ page }) => {
|
|
31
|
+
await page.goto('http://localhost:5173')
|
|
32
|
+
await expect(page.locator('h1')).toContainText('Dashboard')
|
|
33
|
+
})
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Selectors
|
|
37
|
+
|
|
38
|
+
| Type | Example |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| Text | `page.getByText('Submit')` |
|
|
41
|
+
| Role | `page.getByRole('button')` |
|
|
42
|
+
| Label | `page.getByLabel('Email')` |
|
|
43
|
+
| TestId | `page.getByTestId('submit-btn')` |
|
|
44
|
+
|
|
45
|
+
## Common Actions
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// Click
|
|
49
|
+
await page.click('button#submit')
|
|
50
|
+
|
|
51
|
+
// Fill input
|
|
52
|
+
await page.fill('input[name="email"]', 'test@example.com')
|
|
53
|
+
|
|
54
|
+
// Select dropdown
|
|
55
|
+
await page.selectOption('select#country', 'US')
|
|
56
|
+
|
|
57
|
+
// Hover
|
|
58
|
+
await page.hover('.menu-item')
|
|
59
|
+
|
|
60
|
+
// Screenshot
|
|
61
|
+
await page.screenshot({ path: 'screenshot.png' })
|
|
62
|
+
|
|
63
|
+
// Wait for navigation
|
|
64
|
+
await page.waitForURL('**/dashboard')
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Assertions
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
await expect(page.locator('h1')).toHaveText('Welcome')
|
|
71
|
+
await expect(page.locator('.error')).toBeHidden()
|
|
72
|
+
await expect(page.locator('table tr')).toHaveCount(5)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Wait Strategies
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
// Wait for element
|
|
79
|
+
await page.waitForSelector('.loading', { state: 'hidden' })
|
|
80
|
+
|
|
81
|
+
// Wait for response
|
|
82
|
+
await page.waitForResponse('**/api/data')
|
|
83
|
+
|
|
84
|
+
// Network idle
|
|
85
|
+
await page.waitForLoadState('networkidle')
|
|
86
|
+
```
|