@dsmm/dsmm 0.1.9 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -58
- package/agent-presets/dsmm-builder/agent.cordis.yml +91 -186
- package/agent-presets/dsmm-builder/preset.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +120 -17
- package/agent-presets/dsmm-clarifier/preset.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +72 -17
- package/agent-presets/dsmm-code-search/preset.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +169 -0
- package/agent-presets/dsmm-coding/preset.yml +3 -0
- package/agent-presets/dsmm-complex/agent.cordis.yml +154 -0
- package/agent-presets/dsmm-complex/preset.yml +3 -0
- package/agent-presets/dsmm-creative/agent.cordis.yml +122 -15
- package/agent-presets/dsmm-creative/preset.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +179 -0
- package/agent-presets/dsmm-cross-cutting/preset.yml +3 -0
- package/agent-presets/dsmm-deep/agent.cordis.yml +189 -0
- package/agent-presets/dsmm-deep/preset.yml +3 -0
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +72 -17
- package/agent-presets/dsmm-doc-search/preset.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +168 -0
- package/agent-presets/dsmm-documenting/preset.yml +3 -0
- package/agent-presets/dsmm-frontend/agent.cordis.yml +161 -0
- package/agent-presets/dsmm-frontend/preset.yml +3 -0
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +153 -0
- package/agent-presets/dsmm-hard-reasoning/preset.yml +3 -0
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +72 -17
- package/agent-presets/dsmm-media-reader/preset.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +127 -0
- package/agent-presets/dsmm-normal-task/preset.yml +3 -0
- package/agent-presets/dsmm-oracle/agent.cordis.yml +109 -15
- package/agent-presets/dsmm-oracle/preset.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +109 -15
- package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +174 -190
- package/agent-presets/dsmm-orchestrator/preset.yml +1 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +102 -16
- package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +134 -15
- package/agent-presets/dsmm-planner/preset.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +132 -0
- package/agent-presets/dsmm-quick/preset.yml +3 -0
- package/agent-presets/dsmm-research/agent.cordis.yml +156 -0
- package/agent-presets/dsmm-research/preset.yml +3 -0
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +108 -16
- package/agent-presets/dsmm-reviewer/preset.yml +1 -1
- package/cordis.patch.yml +1 -5
- package/docs/agent-presets.md +48 -15
- package/docs/compatibility.md +58 -68
- package/docs/deferred-native-approval-risk.md +19 -0
- package/docs/design.md +43 -2
- package/docs/lsp.md +12 -12
- package/docs/migration-from-ocmm.md +10 -2
- package/docs/model-routing.md +84 -59
- package/docs/native-permissions.md +35 -0
- package/docs/profiles.md +43 -64
- package/docs/releasing.md +159 -8
- package/docs/roadmap.md +77 -17
- package/docs/runtime-recovery.md +12 -0
- package/docs/safety-guards.md +7 -3
- package/docs/settings-status.md +46 -40
- package/docs/skill-sync.md +89 -14
- package/lib/child-admission-contract.d.ts +37 -0
- package/lib/child-admission-contract.js +2 -0
- package/lib/child-admission.d.ts +42 -0
- package/lib/child-admission.js +162 -0
- package/lib/child-capture.d.ts +81 -0
- package/lib/child-capture.js +203 -0
- package/lib/child-evidence.d.ts +17 -0
- package/lib/child-evidence.js +43 -0
- package/lib/client/ChildrenPanel.d.ts +43 -0
- package/lib/client/ChildrenPanel.js +82 -0
- package/lib/client/DeploymentPage.d.ts +18 -0
- package/lib/client/DeploymentPage.js +127 -0
- package/lib/client/EditableChoice.d.ts +17 -0
- package/lib/client/EditableChoice.js +49 -0
- package/lib/client/PermissionsPanel.d.ts +14 -0
- package/lib/client/PermissionsPanel.js +46 -0
- package/lib/client/ProfilesSection.js +32 -15
- package/lib/client/RoleAvailability.d.ts +7 -0
- package/lib/client/RoleAvailability.js +19 -0
- package/lib/client/SessionProfiles.js +27 -9
- package/lib/client/StructuredEditor.js +15 -7
- package/lib/client/children-controller.d.ts +98 -0
- package/lib/client/children-controller.js +296 -0
- package/lib/client/children-locales.d.ts +367 -0
- package/lib/client/children-locales.js +69 -0
- package/lib/client/controller.d.ts +6 -1
- package/lib/client/controller.js +14 -8
- package/lib/client/deployment-controller.d.ts +50 -0
- package/lib/client/deployment-controller.js +193 -0
- package/lib/client/deployment-data.d.ts +17 -0
- package/lib/client/deployment-data.js +138 -0
- package/lib/client/deployment-locales.d.ts +70 -0
- package/lib/client/deployment-locales.js +81 -0
- package/lib/client/diagnostics.d.ts +14 -0
- package/lib/client/diagnostics.js +53 -0
- package/lib/client/index.d.ts +4 -0
- package/lib/client/index.js +145 -1
- package/lib/client/locales.d.ts +58 -0
- package/lib/client/locales.js +38 -18
- package/lib/client/permission-client.d.ts +16 -0
- package/lib/client/permission-client.js +38 -0
- package/lib/client/permission-controller.d.ts +62 -0
- package/lib/client/permission-controller.js +149 -0
- package/lib/client/permission-locales.d.ts +114 -0
- package/lib/client/permission-locales.js +75 -0
- package/lib/client/plugins-contract.d.ts +27 -0
- package/lib/client/plugins-contract.js +2 -0
- package/lib/client/session-labels.js +4 -4
- package/lib/client/structured.js +19 -5
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +36 -0
- package/lib/client.js +6724 -1604
- package/lib/commands.js +3 -0
- package/lib/config-file-store.d.ts +23 -0
- package/lib/config-file-store.js +67 -0
- package/lib/core-permission-authority.d.ts +18 -0
- package/lib/core-permission-authority.js +255 -0
- package/lib/core-permissions.d.ts +8 -0
- package/lib/core-permissions.js +33 -0
- package/lib/delivery-authority.d.ts +68 -0
- package/lib/delivery-authority.js +260 -0
- package/lib/deployment-config.d.ts +60 -0
- package/lib/deployment-config.js +205 -0
- package/lib/deployment-permission-rules.d.ts +55 -0
- package/lib/deployment-permission-rules.js +306 -0
- package/lib/dsh-home.d.ts +3 -0
- package/lib/dsh-home.js +10 -0
- package/lib/dsh-types.d.ts +22 -69
- package/lib/guards.d.ts +3 -2
- package/lib/guards.js +44 -6
- package/lib/host-llm-startup.d.ts +41 -0
- package/lib/host-llm-startup.js +65 -0
- package/lib/host-llm.d.ts +92 -0
- package/lib/host-llm.js +325 -0
- package/lib/index.d.ts +23 -5
- package/lib/index.js +383 -40
- package/lib/legacy-child-policy.d.ts +51 -0
- package/lib/legacy-child-policy.js +123 -0
- package/lib/legacy-read-composition.d.ts +20 -0
- package/lib/legacy-read-composition.js +144 -0
- package/lib/legacy-read-contracts.d.ts +157 -0
- package/lib/legacy-read-contracts.js +39 -0
- package/lib/legacy-read-host.d.ts +19 -0
- package/lib/legacy-read-host.js +67 -0
- package/lib/legacy-read-integration.d.ts +121 -0
- package/lib/legacy-read-integration.js +522 -0
- package/lib/legacy-read-proxy.d.ts +26 -0
- package/lib/legacy-read-proxy.js +237 -0
- package/lib/live-pi-ai-owner.d.ts +18 -0
- package/lib/live-pi-ai-owner.js +144 -0
- package/lib/llm-runtime.d.ts +11 -0
- package/lib/llm-runtime.js +21 -0
- package/lib/lsp.d.ts +13 -0
- package/lib/lsp.js +60 -0
- package/lib/managed-settings.d.ts +5 -0
- package/lib/managed-settings.js +14 -0
- package/lib/mode.js +42 -47
- package/lib/model-parameter-policy.d.ts +11 -0
- package/lib/model-parameter-policy.js +27 -0
- package/lib/model-routing.js +33 -19
- package/lib/modules.d.ts +35 -0
- package/lib/modules.js +37 -0
- package/lib/native-child-evidence.d.ts +42 -0
- package/lib/native-child-evidence.js +133 -0
- package/lib/native-pi-ai-wire.d.ts +37 -0
- package/lib/native-pi-ai-wire.js +261 -0
- package/lib/native-scope.d.ts +9 -0
- package/lib/native-scope.js +20 -0
- package/lib/permission-bash.d.ts +6 -0
- package/lib/permission-bash.js +7 -0
- package/lib/permission-control.d.ts +73 -0
- package/lib/permission-control.js +205 -0
- package/lib/permission-controller.d.ts +68 -0
- package/lib/permission-controller.js +317 -0
- package/lib/permission-errors.d.ts +7 -0
- package/lib/permission-errors.js +21 -0
- package/lib/permission-fs-search.d.ts +5 -0
- package/lib/permission-fs-search.js +7 -0
- package/lib/permission-fs.d.ts +5 -0
- package/lib/permission-fs.js +7 -0
- package/lib/permission-native-access.d.ts +11 -0
- package/lib/permission-native-access.js +6 -0
- package/lib/permission-native-command.d.ts +10 -0
- package/lib/permission-native-command.js +93 -0
- package/lib/permission-native-rules.d.ts +75 -0
- package/lib/permission-native-rules.js +278 -0
- package/lib/permission-pwsh.d.ts +6 -0
- package/lib/permission-pwsh.js +7 -0
- package/lib/permission-remote.d.ts +26 -0
- package/lib/permission-remote.js +53 -0
- package/lib/permission-rpc.d.ts +29 -0
- package/lib/permission-rpc.js +152 -0
- package/lib/permission-rules.d.ts +115 -0
- package/lib/permission-rules.js +256 -0
- package/lib/permission-settings.d.ts +45 -0
- package/lib/permission-settings.js +48 -0
- package/lib/permission-shell.d.ts +38 -0
- package/lib/permission-shell.js +150 -0
- package/lib/permission-web.d.ts +5 -0
- package/lib/permission-web.js +7 -0
- package/lib/plan-validation.js +6 -44
- package/lib/preset-materializer.js +2 -0
- package/lib/preset-registry.d.ts +1 -1
- package/lib/preset-registry.js +38 -24
- package/lib/preset-skills.d.ts +4 -1
- package/lib/preset-skills.js +60 -19
- package/lib/profile-diagnostics.d.ts +45 -0
- package/lib/profile-diagnostics.js +148 -0
- package/lib/profile-locale.d.ts +3 -0
- package/lib/profile-locale.js +2 -0
- package/lib/profile-remote.d.ts +22 -0
- package/lib/profile-remote.js +344 -27
- package/lib/profile-rpc.d.ts +25 -1
- package/lib/profile-rpc.js +143 -3
- package/lib/profile-runtime.d.ts +63 -0
- package/lib/profile-runtime.js +496 -77
- package/lib/profile-store.d.ts +56 -1
- package/lib/profile-store.js +377 -111
- package/lib/profile-types.d.ts +125 -1
- package/lib/profile-types.js +1 -0
- package/lib/profiles.d.ts +16 -2
- package/lib/profiles.js +156 -79
- package/lib/prompt-content.d.ts +25 -0
- package/lib/prompt-content.js +27 -0
- package/lib/prompts.d.ts +45 -4
- package/lib/prompts.js +157 -43
- package/lib/recovery-policy.js +20 -7
- package/lib/role-control-remote.d.ts +38 -0
- package/lib/role-control-remote.js +211 -0
- package/lib/role-control-rpc.d.ts +51 -0
- package/lib/role-control-rpc.js +377 -0
- package/lib/role-control-types.d.ts +92 -0
- package/lib/role-control-types.js +8 -0
- package/lib/role-invocation.d.ts +47 -0
- package/lib/role-invocation.js +135 -0
- package/lib/role-llm-runtime.d.ts +17 -0
- package/lib/role-llm-runtime.js +62 -0
- package/lib/role-llm.d.ts +31 -0
- package/lib/role-llm.js +66 -0
- package/lib/role-policy.d.ts +92 -0
- package/lib/role-policy.js +601 -0
- package/lib/role-providers.d.ts +7 -3
- package/lib/role-providers.js +74 -46
- package/lib/role-routing.d.ts +11 -2
- package/lib/role-routing.js +42 -25
- package/lib/role-runs.d.ts +135 -0
- package/lib/role-runs.js +304 -0
- package/lib/role-subagents.d.ts +63 -4
- package/lib/role-subagents.js +299 -47
- package/lib/roles.d.ts +20 -9
- package/lib/roles.js +87 -216
- package/lib/route-json.d.ts +19 -0
- package/lib/route-json.js +129 -0
- package/lib/routing-policy.d.ts +2 -0
- package/lib/routing-policy.js +12 -2
- package/lib/runtime-integration.d.ts +112 -0
- package/lib/runtime-integration.js +784 -0
- package/lib/runtime-recovery.js +34 -13
- package/lib/session-scope.js +2 -0
- package/lib/settings.d.ts +116 -14
- package/lib/settings.js +455 -149
- package/lib/skills.d.ts +24 -9
- package/lib/skills.js +114 -35
- package/lib/state.d.ts +10 -6
- package/lib/state.js +48 -49
- package/lib/status.d.ts +35 -1
- package/lib/status.js +58 -17
- package/lib/subagent-runtime.d.ts +45 -0
- package/lib/subagent-runtime.js +131 -0
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +112 -45
- package/patches/subagent-runtime.yml +15 -0
- package/prompts/deepseek-flash.md +1 -1
- package/prompts/deepseek-v4-pro.md +2 -2
- package/prompts/deepwork.md +153 -20
- package/prompts/source/agents/clarifier.md +47 -0
- package/prompts/source/agents/orchestrator.md +72 -0
- package/prompts/source/agents/plan-critic.md +29 -0
- package/prompts/source/agents/planner.md +21 -0
- package/prompts/source/agents/reviewer.md +23 -0
- package/prompts/source/catalog.json +548 -0
- package/prompts/source/category/coding.md +46 -0
- package/prompts/source/category/complex.md +29 -0
- package/prompts/source/category/creative.md +40 -0
- package/prompts/source/category/cross-cutting.md +54 -0
- package/prompts/source/category/deep.md +64 -0
- package/prompts/source/category/documenting.md +68 -0
- package/prompts/source/category/frontend.md +38 -0
- package/prompts/source/category/hard-reasoning.md +53 -0
- package/prompts/source/category/normal-task.md +27 -0
- package/prompts/source/category/quick.md +34 -0
- package/prompts/source/category/research.md +58 -0
- package/prompts/source/deepwork/claude-opus-5.md +28 -0
- package/prompts/source/deepwork/codex.md +9 -0
- package/prompts/source/deepwork/default.md +136 -0
- package/prompts/source/deepwork/gemini.md +191 -0
- package/prompts/source/deepwork/glm.md +263 -0
- package/prompts/source/deepwork/gpt.md +49 -0
- package/prompts/source/deepwork/kimi-k27.md +13 -0
- package/prompts/source/deepwork/planner.md +44 -0
- package/prompts/source/deepwork/swe-2.md +13 -0
- package/prompts/source/manifest.json +3233 -0
- package/prompts/source/shared/dsh-host-contract.md +8 -0
- package/prompts/source/shared/locale.md +8 -0
- package/prompts/source/shared/shell-safety.md +7 -0
- package/prompts/source/terminal/builder.md +13 -0
- package/prompts/source/terminal/clarifier.md +41 -0
- package/prompts/source/terminal/code-search.md +39 -0
- package/prompts/source/terminal/coding.md +41 -0
- package/prompts/source/terminal/complex.md +43 -0
- package/prompts/source/terminal/creative.md +41 -0
- package/prompts/source/terminal/cross-cutting.md +43 -0
- package/prompts/source/terminal/deep.md +43 -0
- package/prompts/source/terminal/doc-search.md +39 -0
- package/prompts/source/terminal/documenting.md +41 -0
- package/prompts/source/terminal/frontend.md +41 -0
- package/prompts/source/terminal/hard-reasoning.md +41 -0
- package/prompts/source/terminal/media-reader.md +39 -0
- package/prompts/source/terminal/normal-task.md +41 -0
- package/prompts/source/terminal/oracle-2nd.md +53 -0
- package/prompts/source/terminal/oracle.md +53 -0
- package/prompts/source/terminal/orchestrator.md +26 -0
- package/prompts/source/terminal/plan-critic.md +41 -0
- package/prompts/source/terminal/planner.md +42 -0
- package/prompts/source/terminal/quick.md +39 -0
- package/prompts/source/terminal/research.md +39 -0
- package/prompts/source/terminal/reviewer.md +53 -0
- package/scripts/cold-profile-composition.mjs +329 -0
- package/scripts/cold-profile-sources.mjs +238 -0
- package/scripts/migrate-cold-profile.mjs +315 -0
- package/skills/ast-grep/LICENSE +21 -0
- package/skills/ast-grep/README.md +138 -0
- package/skills/ast-grep/SKILL.md +287 -0
- package/skills/ast-grep/SOURCE +1 -0
- package/skills/ast-grep/install.ps1 +235 -0
- package/skills/ast-grep/install.sh +286 -0
- package/skills/ast-grep/references/cli.md +233 -0
- package/skills/ast-grep/references/install.md +168 -0
- package/skills/ast-grep/references/patterns.md +149 -0
- package/skills/ast-grep/references/pitfalls.md +305 -0
- package/skills/ast-grep/references/recipes.md +404 -0
- package/skills/ast-grep/references/sgconfig.md +250 -0
- package/skills/ast-grep/references/yaml-rules.md +511 -0
- package/skills/ast-grep/scripts/ast_grep_helper.py +760 -0
- package/skills/ast-grep/tests/smoke.ps1 +129 -0
- package/skills/ast-grep/tests/smoke.sh +212 -0
- package/skills/ast-grep/tests/test_resolver.py +154 -0
- package/skills/brainstorming/SKILL.md +123 -9
- package/skills/coding-agent-sessions/LICENSE-UPSTREAM.md +82 -0
- package/skills/coding-agent-sessions/NOTICE.md +24 -0
- package/skills/coding-agent-sessions/SKILL.md +147 -0
- package/skills/coding-agent-sessions/agents/openai.yaml +4 -0
- package/skills/coding-agent-sessions/pyrightconfig.json +5 -0
- package/skills/coding-agent-sessions/references/all-platforms.md +77 -0
- package/skills/coding-agent-sessions/references/claude.md +34 -0
- package/skills/coding-agent-sessions/references/codex.md +32 -0
- package/skills/coding-agent-sessions/references/opencode.md +45 -0
- package/skills/coding-agent-sessions/references/senpi.md +29 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/aside_scanner.py +140 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +104 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
- package/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
- package/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
- package/skills/coding-agent-sessions/scripts/tests/test_agent_sessions.py +322 -0
- package/skills/coding-agent-sessions/scripts/tests/test_aside_scanner.py +131 -0
- package/skills/coding-agent-sessions/scripts/tests/test_cli_contract.py +126 -0
- package/skills/coding-agent-sessions/scripts/tests/test_extended_scanners.py +262 -0
- package/skills/coding-agent-sessions/scripts/tests/test_optional_sqlite_scanners.py +79 -0
- package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -0
- package/skills/debugging/SKILL.md +130 -4
- package/skills/debugging/references/logging.md +2 -0
- package/skills/debugging/references/methodology/00-setup.md +16 -62
- package/skills/debugging/references/methodology/02-investigate.md +11 -5
- package/skills/debugging/references/methodology/03-flaky-triage.md +6 -4
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +6 -16
- package/skills/debugging/references/methodology/05-escalate.md +2 -0
- package/skills/debugging/references/methodology/06-fix.md +8 -6
- package/skills/debugging/references/methodology/08-qa.md +7 -5
- package/skills/debugging/references/methodology/09-cleanup.md +16 -152
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +7 -18
- package/skills/debugging/references/runtimes/bundled-js-binary.md +3 -16
- package/skills/debugging/references/runtimes/go.md +2 -0
- package/skills/debugging/references/runtimes/native-binary.md +11 -54
- package/skills/debugging/references/runtimes/node.md +6 -15
- package/skills/debugging/references/runtimes/python.md +5 -15
- package/skills/debugging/references/runtimes/rust.md +4 -18
- package/skills/debugging/references/scripts/dap.test.mjs +539 -0
- package/skills/debugging/references/scripts/fixture-adapter.mjs +164 -0
- package/skills/debugging/references/tools/dap.md +4 -2
- package/skills/debugging/references/tools/ghidra.md +6 -15
- package/skills/debugging/references/tools/playwright-cli.md +5 -15
- package/skills/debugging/references/tools/pwndbg.md +2 -0
- package/skills/debugging/references/tools/pwntools.md +6 -16
- package/skills/dispatching-parallel-agents/SKILL.md +96 -7
- package/skills/frontend/.frontend-materialized.json +856 -0
- package/skills/frontend/ATTRIBUTION.md +37 -0
- package/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
- package/skills/frontend/LICENSE-taste-skill.txt +21 -0
- package/skills/frontend/LICENSE-ui-ux-pro-max.txt +21 -0
- package/skills/frontend/SKILL.md +145 -0
- package/skills/frontend/references/design/README.md +256 -0
- package/skills/frontend/references/design/_INDEX.md +206 -0
- package/skills/frontend/references/design/airbnb.md +393 -0
- package/skills/frontend/references/design/airtable.md +92 -0
- package/skills/frontend/references/design/apple.md +250 -0
- package/skills/frontend/references/design/aside.md +211 -0
- package/skills/frontend/references/design/binance.md +348 -0
- package/skills/frontend/references/design/bmw.md +183 -0
- package/skills/frontend/references/design/brutalist-skill.md +92 -0
- package/skills/frontend/references/design/bugatti.md +271 -0
- package/skills/frontend/references/design/cal.md +262 -0
- package/skills/frontend/references/design/claude.md +315 -0
- package/skills/frontend/references/design/clay.md +307 -0
- package/skills/frontend/references/design/clickhouse.md +284 -0
- package/skills/frontend/references/design/clone-from-url.md +69 -0
- package/skills/frontend/references/design/cohere.md +269 -0
- package/skills/frontend/references/design/coinbase.md +132 -0
- package/skills/frontend/references/design/composio.md +310 -0
- package/skills/frontend/references/design/cursor.md +312 -0
- package/skills/frontend/references/design/design-system-architecture.md +250 -0
- package/skills/frontend/references/design/elevenlabs.md +268 -0
- package/skills/frontend/references/design/expo.md +284 -0
- package/skills/frontend/references/design/ferrari.md +317 -0
- package/skills/frontend/references/design/figma.md +223 -0
- package/skills/frontend/references/design/framer.md +249 -0
- package/skills/frontend/references/design/gpt-tasteskill.md +74 -0
- package/skills/frontend/references/design/hashicorp.md +281 -0
- package/skills/frontend/references/design/ibm.md +335 -0
- package/skills/frontend/references/design/image-to-code-skill.md +1228 -0
- package/skills/frontend/references/design/imagegen-brandkit.md +798 -0
- package/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
- package/skills/frontend/references/design/imagegen-frontend-web.md +987 -0
- package/skills/frontend/references/design/interaction-skill.md +52 -0
- package/skills/frontend/references/design/intercom.md +149 -0
- package/skills/frontend/references/design/kraken.md +128 -0
- package/skills/frontend/references/design/lamborghini.md +291 -0
- package/skills/frontend/references/design/linear.app.md +370 -0
- package/skills/frontend/references/design/lovable.md +301 -0
- package/skills/frontend/references/design/mastercard.md +368 -0
- package/skills/frontend/references/design/meta.md +369 -0
- package/skills/frontend/references/design/minimalist-skill.md +85 -0
- package/skills/frontend/references/design/minimax.md +260 -0
- package/skills/frontend/references/design/mintlify.md +329 -0
- package/skills/frontend/references/design/miro.md +111 -0
- package/skills/frontend/references/design/mistral.ai.md +264 -0
- package/skills/frontend/references/design/mongodb.md +269 -0
- package/skills/frontend/references/design/nike.md +366 -0
- package/skills/frontend/references/design/notion.md +312 -0
- package/skills/frontend/references/design/nvidia.md +296 -0
- package/skills/frontend/references/design/ollama.md +270 -0
- package/skills/frontend/references/design/opencode.ai.md +284 -0
- package/skills/frontend/references/design/output-skill.md +49 -0
- package/skills/frontend/references/design/pinterest.md +233 -0
- package/skills/frontend/references/design/playstation.md +367 -0
- package/skills/frontend/references/design/posthog.md +259 -0
- package/skills/frontend/references/design/raycast.md +271 -0
- package/skills/frontend/references/design/react-dev-tooling-skill.md +232 -0
- package/skills/frontend/references/design/redesign-skill.md +178 -0
- package/skills/frontend/references/design/renault.md +314 -0
- package/skills/frontend/references/design/replicate.md +264 -0
- package/skills/frontend/references/design/resend.md +306 -0
- package/skills/frontend/references/design/revolut.md +188 -0
- package/skills/frontend/references/design/runwayml.md +247 -0
- package/skills/frontend/references/design/sanity.md +360 -0
- package/skills/frontend/references/design/sentry.md +265 -0
- package/skills/frontend/references/design/shopify.md +353 -0
- package/skills/frontend/references/design/soft-skill.md +98 -0
- package/skills/frontend/references/design/spacex.md +197 -0
- package/skills/frontend/references/design/spotify.md +249 -0
- package/skills/frontend/references/design/starbucks.md +583 -0
- package/skills/frontend/references/design/stitch-design-example.md +121 -0
- package/skills/frontend/references/design/stitch-skill.md +184 -0
- package/skills/frontend/references/design/stripe.md +325 -0
- package/skills/frontend/references/design/supabase.md +258 -0
- package/skills/frontend/references/design/superhuman.md +255 -0
- package/skills/frontend/references/design/taste-skill.md +1206 -0
- package/skills/frontend/references/design/tesla.md +289 -0
- package/skills/frontend/references/design/theverge.md +342 -0
- package/skills/frontend/references/design/together.ai.md +266 -0
- package/skills/frontend/references/design/uber.md +298 -0
- package/skills/frontend/references/design/vercel.md +313 -0
- package/skills/frontend/references/design/vodafone.md +426 -0
- package/skills/frontend/references/design/voltagent.md +326 -0
- package/skills/frontend/references/design/warp.md +256 -0
- package/skills/frontend/references/design/webflow.md +95 -0
- package/skills/frontend/references/design/wired.md +281 -0
- package/skills/frontend/references/design/wise.md +176 -0
- package/skills/frontend/references/design/x.ai.md +260 -0
- package/skills/frontend/references/design/zapier.md +331 -0
- package/skills/frontend/references/perfection/README.md +264 -0
- package/skills/frontend/references/perfection/react-perf-tooling.md +234 -0
- package/skills/frontend/references/ui-ux-db/README.md +659 -0
- package/skills/frontend/references/ui-ux-db/data/app-interface.csv +31 -0
- package/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
- package/skills/frontend/references/ui-ux-db/data/colors.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/google-fonts.csv +1924 -0
- package/skills/frontend/references/ui-ux-db/data/icons.csv +106 -0
- package/skills/frontend/references/ui-ux-db/data/landing.csv +35 -0
- package/skills/frontend/references/ui-ux-db/data/products.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/angular.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/laravel.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/threejs.csv +54 -0
- package/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
- package/skills/frontend/references/ui-ux-db/data/styles.csv +85 -0
- package/skills/frontend/references/ui-ux-db/data/typography.csv +74 -0
- package/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -0
- package/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
- package/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
- package/skills/frontend/references/ui-ux-db/scripts/core.py +262 -0
- package/skills/frontend/references/ui-ux-db/scripts/design_system.py +1148 -0
- package/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
- package/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
- package/skills/git-master/SKILL.md +115 -0
- package/skills/git-master/agents/openai.yaml +13 -0
- package/skills/init-deep/SKILL.md +282 -0
- package/skills/receiving-code-review/SKILL.md +117 -7
- package/skills/remove-ai-slops/SKILL.md +160 -8
- package/skills/requesting-code-review/SKILL.md +98 -3
- package/skills/requesting-code-review/code-reviewer.md +59 -0
- package/skills/subagent-driven-development/SKILL.md +179 -6
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +23 -0
- package/skills/subagent-driven-development/implementer-prompt.md +87 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +37 -0
- package/skills/using-git-worktrees/SKILL.md +144 -0
- package/skills/writing-plans/SKILL.md +126 -7
- package/skills/writing-plans/plan-document-reviewer-prompt.md +47 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#Requires -Version 5.1
|
|
2
|
+
# Smoke test for the ast-grep skill on Windows (PowerShell 5.1+).
|
|
3
|
+
$ErrorActionPreference = 'Stop'
|
|
4
|
+
|
|
5
|
+
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
6
|
+
$SkillDir = Split-Path -Parent $ScriptDir
|
|
7
|
+
$Helper = Join-Path $SkillDir 'scripts/ast_grep_helper.py'
|
|
8
|
+
$Python = if (Get-Command py -ErrorAction SilentlyContinue) {
|
|
9
|
+
'py'
|
|
10
|
+
} elseif (Get-Command pyenv -ErrorAction SilentlyContinue) {
|
|
11
|
+
(& pyenv which python).Trim()
|
|
12
|
+
} else {
|
|
13
|
+
'python'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$Output = Join-Path $env:TEMP ("ast-grep-skill-smoke-" + [guid]::NewGuid().ToString('N').Substring(0,8))
|
|
17
|
+
New-Item -ItemType Directory -Path $Output -Force | Out-Null
|
|
18
|
+
|
|
19
|
+
function Pass([string]$msg) { Write-Host "PASS: $msg" }
|
|
20
|
+
function Fail([string]$msg) { Write-Host "FAIL: $msg" -ForegroundColor Red; Remove-Item -Recurse -Force $Output -ErrorAction SilentlyContinue; exit 1 }
|
|
21
|
+
|
|
22
|
+
function Run([string[]]$ToolArgs) {
|
|
23
|
+
$output = & $Python @($Helper) @ToolArgs 2>&1
|
|
24
|
+
$exitCode = $LASTEXITCODE
|
|
25
|
+
$combined = ($output | ForEach-Object { $_.ToString() }) -join [Environment]::NewLine
|
|
26
|
+
if ($combined.Length -gt 0) { $combined += [Environment]::NewLine }
|
|
27
|
+
return [pscustomobject]@{
|
|
28
|
+
ExitCode = $exitCode
|
|
29
|
+
Stdout = $combined
|
|
30
|
+
Stderr = ''
|
|
31
|
+
Combined = $combined
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
# 1. --version
|
|
37
|
+
$r = Run @('--version')
|
|
38
|
+
if ($r.Combined -notmatch 'ast-grep-helper') { Fail '--version output missing' }
|
|
39
|
+
Pass '--version'
|
|
40
|
+
|
|
41
|
+
# 2. langs (must list >=25)
|
|
42
|
+
$r = Run @('langs')
|
|
43
|
+
$langCount = ($r.Stdout -split "`n" | Where-Object { $_ -match '^ [a-z]' }).Count
|
|
44
|
+
if ($langCount -lt 25) { Fail "langs listed only $langCount (expected >=25)" }
|
|
45
|
+
Pass 'langs lists at least 25 languages'
|
|
46
|
+
|
|
47
|
+
# 3. regex misuse: \w+
|
|
48
|
+
$r = Run @('validate', '\w+', '--lang', 'ts')
|
|
49
|
+
if ($r.ExitCode -ne 2) { Fail "validate '\w+' should exit 2, got $($r.ExitCode)" }
|
|
50
|
+
if ($r.Combined -notmatch 'regex') { Fail "validate '\w+' should mention regex" }
|
|
51
|
+
Pass 'validate detects \w regex misuse'
|
|
52
|
+
|
|
53
|
+
# 4. valid pattern
|
|
54
|
+
$r = Run @('validate', 'console.log($MSG)', '--lang', 'ts')
|
|
55
|
+
if ($r.ExitCode -ne 0) { Fail "validate 'console.log(`$MSG)' should exit 0, got $($r.ExitCode)" }
|
|
56
|
+
Pass 'validate accepts plausible pattern'
|
|
57
|
+
|
|
58
|
+
# 5. Python trailing colon
|
|
59
|
+
$r = Run @('validate', 'def $F($$$):', '--lang', 'py')
|
|
60
|
+
if ($r.ExitCode -ne 2) { Fail "validate 'def `$F(`$`$`$):' should exit 2, got $($r.ExitCode)" }
|
|
61
|
+
if ($r.Combined -notmatch 'colon|trailing') { Fail 'validate should mention trailing colon' }
|
|
62
|
+
Pass 'validate detects Python trailing colon'
|
|
63
|
+
|
|
64
|
+
# 6. Incomplete TS function
|
|
65
|
+
$r = Run @('validate', 'function $N', '--lang', 'ts')
|
|
66
|
+
if ($r.ExitCode -ne 2) { Fail "validate 'function `$N' should exit 2, got $($r.ExitCode)" }
|
|
67
|
+
if ($r.Combined -notmatch 'incomplete|params|body') { Fail 'validate should hint about params/body' }
|
|
68
|
+
Pass 'validate detects incomplete TS function'
|
|
69
|
+
|
|
70
|
+
# 7. Alternation pipe
|
|
71
|
+
$r = Run @('validate', 'foo|bar', '--lang', 'ts')
|
|
72
|
+
if ($r.ExitCode -ne 2) { Fail "validate 'foo|bar' should exit 2, got $($r.ExitCode)" }
|
|
73
|
+
if ($r.Combined -notmatch 'alternation|regex') { Fail 'validate should mention alternation' }
|
|
74
|
+
Pass 'validate detects literal | alternation'
|
|
75
|
+
|
|
76
|
+
# 8. doctor
|
|
77
|
+
$r = Run @('doctor')
|
|
78
|
+
if ($r.Combined -notmatch 'ast-grep-helper') { Fail 'doctor missing helper version line' }
|
|
79
|
+
Pass 'doctor produces output'
|
|
80
|
+
|
|
81
|
+
# 9. search w/o binary
|
|
82
|
+
$r = Run @('--quiet', 'search', 'foo()', 'C:/nonexistent-path-xyzzy', '--lang', 'ts')
|
|
83
|
+
switch ($r.ExitCode) {
|
|
84
|
+
{ $_ -in 0,1,4 } { Pass "search runs (rc=$($r.ExitCode), ast-grep available)" }
|
|
85
|
+
3 {
|
|
86
|
+
if ($r.Combined -notmatch 'install') { Fail 'search rc=3 should print install hint' }
|
|
87
|
+
Pass 'search without binary prints install hint'
|
|
88
|
+
}
|
|
89
|
+
default { Fail "search returned unexpected rc=$($r.ExitCode): $($r.Combined)" }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# 10. install.ps1 syntax (parse-check via PowerShell tokenizer)
|
|
93
|
+
$tokens = $null
|
|
94
|
+
$errors = $null
|
|
95
|
+
[System.Management.Automation.Language.Parser]::ParseFile(
|
|
96
|
+
(Join-Path $SkillDir 'install.ps1'), [ref]$tokens, [ref]$errors) | Out-Null
|
|
97
|
+
if ($errors -and $errors.Count -gt 0) { Fail "install.ps1 has parse errors: $($errors -join '; ')" }
|
|
98
|
+
Pass 'install.ps1 parses cleanly'
|
|
99
|
+
|
|
100
|
+
# 11. SKILL.md frontmatter
|
|
101
|
+
$skill = Get-Content (Join-Path $SkillDir 'SKILL.md') -Raw
|
|
102
|
+
if (-not $skill.StartsWith("---`n") -and -not $skill.StartsWith("---`r`n")) {
|
|
103
|
+
Fail 'SKILL.md must start with YAML frontmatter'
|
|
104
|
+
}
|
|
105
|
+
$endIdx = $skill.IndexOf("`n---`n", 4)
|
|
106
|
+
if ($endIdx -lt 0) { $endIdx = $skill.IndexOf("`r`n---`r`n", 4) }
|
|
107
|
+
if ($endIdx -lt 0) { Fail 'SKILL.md missing closing ---' }
|
|
108
|
+
$fm = $skill.Substring(4, $endIdx - 4)
|
|
109
|
+
if ($fm -notmatch '(?m)^name:\s*ast-grep\s*$') { Fail 'frontmatter missing name: ast-grep' }
|
|
110
|
+
if ($fm -notmatch '(?m)^description:') { Fail 'frontmatter missing description' }
|
|
111
|
+
Pass 'SKILL.md frontmatter shape'
|
|
112
|
+
|
|
113
|
+
# 12. All required reference files exist
|
|
114
|
+
$required = @(
|
|
115
|
+
'references/install.md', 'references/patterns.md', 'references/pitfalls.md',
|
|
116
|
+
'references/recipes.md', 'references/cli.md', 'references/yaml-rules.md',
|
|
117
|
+
'references/sgconfig.md'
|
|
118
|
+
)
|
|
119
|
+
foreach ($f in $required) {
|
|
120
|
+
if (-not (Test-Path (Join-Path $SkillDir $f))) { Fail "missing $f" }
|
|
121
|
+
}
|
|
122
|
+
Pass 'all references present'
|
|
123
|
+
|
|
124
|
+
Write-Host ''
|
|
125
|
+
Write-Host 'all smoke tests passed'
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
Remove-Item -Recurse -Force $Output -ErrorAction SilentlyContinue
|
|
129
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Smoke test for the ast-grep skill on POSIX (macOS / Linux / WSL / Git Bash).
|
|
3
|
+
#
|
|
4
|
+
# Tests:
|
|
5
|
+
# 1. helper --version
|
|
6
|
+
# 2. helper langs (lists 25 languages)
|
|
7
|
+
# 3. helper validate '\w+' --lang ts (must exit 2 with hint)
|
|
8
|
+
# 4. helper validate 'console.log($MSG)' (must exit 0 plausible)
|
|
9
|
+
# 5. helper validate 'def $F($$$):' --lang py (must exit 2 - trailing colon)
|
|
10
|
+
# 6. helper validate 'function $N' --lang ts (must exit 2 - incomplete)
|
|
11
|
+
# 7. helper validate 'foo|bar' --lang ts (must exit 2 - alternation)
|
|
12
|
+
# 8. helper doctor (informational; tolerates no-binary)
|
|
13
|
+
# 9. helper search w/o binary => exit 3 with install hint
|
|
14
|
+
# 10. install.sh --help (parses)
|
|
15
|
+
# 11. SKILL.md frontmatter shape (canonical)
|
|
16
|
+
#
|
|
17
|
+
# Runs against the helper using ONLY stdlib python3 - no ast-grep needed.
|
|
18
|
+
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
|
|
21
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
22
|
+
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
23
|
+
HELPER="python3 $SKILL_DIR/scripts/ast_grep_helper.py"
|
|
24
|
+
|
|
25
|
+
OUTPUT_DIR="$(mktemp -d -t ast-grep-skill-smoke-XXXXXX)"
|
|
26
|
+
trap 'rm -rf "$OUTPUT_DIR"' EXIT
|
|
27
|
+
|
|
28
|
+
fail() { echo "FAIL: $*" >&2; exit 1; }
|
|
29
|
+
pass() { echo "PASS: $*"; }
|
|
30
|
+
|
|
31
|
+
ocmm_runtime_slug() {
|
|
32
|
+
case "$(uname -s)" in
|
|
33
|
+
Darwin) local os_slug="darwin" ;;
|
|
34
|
+
MINGW*|MSYS*|CYGWIN*) local os_slug="win32" ;;
|
|
35
|
+
*) local os_slug="linux" ;;
|
|
36
|
+
esac
|
|
37
|
+
|
|
38
|
+
case "$(uname -m | tr '[:upper:]' '[:lower:]')" in
|
|
39
|
+
arm64|aarch64) local arch_slug="arm64" ;;
|
|
40
|
+
*) local arch_slug="x64" ;;
|
|
41
|
+
esac
|
|
42
|
+
|
|
43
|
+
printf '%s-%s' "$os_slug" "$arch_slug"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
fake_sg() {
|
|
47
|
+
local target="$1"
|
|
48
|
+
mkdir -p "$(dirname "$target")"
|
|
49
|
+
cat > "$target" <<'SH'
|
|
50
|
+
#!/usr/bin/env bash
|
|
51
|
+
if [ "${1:-}" = "--version" ]; then
|
|
52
|
+
printf 'ast-grep 0.45.0 fake\n'
|
|
53
|
+
else
|
|
54
|
+
printf 'fake ast-grep\n'
|
|
55
|
+
fi
|
|
56
|
+
SH
|
|
57
|
+
chmod +x "$target"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# 1. --version
|
|
61
|
+
$HELPER --version | grep -q "ast-grep-helper" || fail "--version output missing"
|
|
62
|
+
pass "--version"
|
|
63
|
+
|
|
64
|
+
# 2. langs (must list 25)
|
|
65
|
+
LANG_LINES=$($HELPER langs | grep -E '^ [a-z]' | wc -l | tr -d ' ')
|
|
66
|
+
[ "$LANG_LINES" -ge 25 ] || fail "langs listed only $LANG_LINES (expected >=25)"
|
|
67
|
+
pass "langs lists at least 25 languages"
|
|
68
|
+
|
|
69
|
+
# 3. regex misuse: \w+
|
|
70
|
+
set +e
|
|
71
|
+
$HELPER validate '\w+' --lang ts > "$OUTPUT_DIR/v1.out" 2>&1
|
|
72
|
+
RC=$?
|
|
73
|
+
set -e
|
|
74
|
+
[ $RC -eq 2 ] || fail "validate '\\w+' should exit 2, got $RC (output: $(cat $OUTPUT_DIR/v1.out))"
|
|
75
|
+
grep -qi 'regex' "$OUTPUT_DIR/v1.out" || fail "validate '\\w+' should mention regex (output: $(cat $OUTPUT_DIR/v1.out))"
|
|
76
|
+
pass "validate detects \\w regex misuse"
|
|
77
|
+
|
|
78
|
+
# 4. valid pattern
|
|
79
|
+
set +e
|
|
80
|
+
$HELPER validate 'console.log($MSG)' --lang ts > "$OUTPUT_DIR/v2.out" 2>&1
|
|
81
|
+
RC=$?
|
|
82
|
+
set -e
|
|
83
|
+
[ $RC -eq 0 ] || fail "validate 'console.log(\$MSG)' should exit 0, got $RC (output: $(cat $OUTPUT_DIR/v2.out))"
|
|
84
|
+
pass "validate accepts plausible pattern"
|
|
85
|
+
|
|
86
|
+
# 5. Python trailing colon
|
|
87
|
+
set +e
|
|
88
|
+
$HELPER validate 'def $F($$$):' --lang py > "$OUTPUT_DIR/v3.out" 2>&1
|
|
89
|
+
RC=$?
|
|
90
|
+
set -e
|
|
91
|
+
[ $RC -eq 2 ] || fail "validate 'def \$F(\$\$\$):' should exit 2, got $RC"
|
|
92
|
+
grep -qi 'colon\|trailing' "$OUTPUT_DIR/v3.out" || fail "validate should mention trailing colon"
|
|
93
|
+
pass "validate detects Python trailing colon"
|
|
94
|
+
|
|
95
|
+
# 6. Incomplete TS function
|
|
96
|
+
set +e
|
|
97
|
+
$HELPER validate 'function $N' --lang ts > "$OUTPUT_DIR/v4.out" 2>&1
|
|
98
|
+
RC=$?
|
|
99
|
+
set -e
|
|
100
|
+
[ $RC -eq 2 ] || fail "validate 'function \$N' should exit 2, got $RC"
|
|
101
|
+
grep -qi 'incomplete\|params\|body' "$OUTPUT_DIR/v4.out" || fail "validate should hint about params/body"
|
|
102
|
+
pass "validate detects incomplete TS function"
|
|
103
|
+
|
|
104
|
+
# 7. Alternation pipe
|
|
105
|
+
set +e
|
|
106
|
+
$HELPER validate 'foo|bar' --lang ts > "$OUTPUT_DIR/v5.out" 2>&1
|
|
107
|
+
RC=$?
|
|
108
|
+
set -e
|
|
109
|
+
[ $RC -eq 2 ] || fail "validate 'foo|bar' should exit 2, got $RC"
|
|
110
|
+
grep -qi 'alternation\|regex' "$OUTPUT_DIR/v5.out" || fail "validate should mention alternation"
|
|
111
|
+
pass "validate detects literal | alternation"
|
|
112
|
+
|
|
113
|
+
# 8. doctor (informational)
|
|
114
|
+
$HELPER doctor > "$OUTPUT_DIR/doc.out" 2>&1 || true
|
|
115
|
+
grep -q "ast-grep-helper" "$OUTPUT_DIR/doc.out" || fail "doctor missing helper version line"
|
|
116
|
+
pass "doctor produces output"
|
|
117
|
+
|
|
118
|
+
# Given OCMM_AST_GREP_SG_PATH points at a fake executable.
|
|
119
|
+
# When doctor resolves ast-grep, then it reports that exact path.
|
|
120
|
+
FAKE_ENV_SG="$OUTPUT_DIR/fake-env/sg"
|
|
121
|
+
fake_sg "$FAKE_ENV_SG"
|
|
122
|
+
OCMM_AST_GREP_SG_PATH="$FAKE_ENV_SG" $HELPER doctor > "$OUTPUT_DIR/ocmm-env.out" 2>&1
|
|
123
|
+
grep -Fq "ast-grep binary: $FAKE_ENV_SG" "$OUTPUT_DIR/ocmm-env.out" || fail "OCMM_AST_GREP_SG_PATH was not preferred: $(cat "$OUTPUT_DIR/ocmm-env.out")"
|
|
124
|
+
pass "OCMM_AST_GREP_SG_PATH resolves first"
|
|
125
|
+
|
|
126
|
+
# Given HOME has an ocmm runtime sg executable.
|
|
127
|
+
# When doctor resolves ast-grep, then it reports the HOME runtime path.
|
|
128
|
+
RUNTIME_HOME="$OUTPUT_DIR/home"
|
|
129
|
+
RUNTIME_SLUG="$(ocmm_runtime_slug)"
|
|
130
|
+
RUNTIME_BIN="sg"
|
|
131
|
+
case "$RUNTIME_SLUG" in
|
|
132
|
+
win32-*) RUNTIME_BIN="sg.exe" ;;
|
|
133
|
+
esac
|
|
134
|
+
FAKE_RUNTIME_SG="$RUNTIME_HOME/.ocmm/runtime/ast-grep/$RUNTIME_SLUG/$RUNTIME_BIN"
|
|
135
|
+
fake_sg "$FAKE_RUNTIME_SG"
|
|
136
|
+
HOME="$RUNTIME_HOME" CODEX_HOME= OCMM_AST_GREP_SG_PATH= $HELPER doctor > "$OUTPUT_DIR/ocmm-runtime.out" 2>&1
|
|
137
|
+
grep -Fq "ast-grep binary: $FAKE_RUNTIME_SG" "$OUTPUT_DIR/ocmm-runtime.out" || fail "ocmm HOME runtime was not resolved: $(cat "$OUTPUT_DIR/ocmm-runtime.out")"
|
|
138
|
+
pass "ocmm HOME runtime resolves before standalone fallback"
|
|
139
|
+
|
|
140
|
+
# 9. search w/o binary => either runs successfully (binary found) OR exits 3 with hint
|
|
141
|
+
# The CI may or may not have ast-grep installed; both are valid.
|
|
142
|
+
set +e
|
|
143
|
+
$HELPER -q search 'foo()' --lang ts /nonexistent-path-xyzzy > "$OUTPUT_DIR/s1.out" 2>&1
|
|
144
|
+
RC=$?
|
|
145
|
+
set -e
|
|
146
|
+
case "$RC" in
|
|
147
|
+
0|1|4)
|
|
148
|
+
# Binary present but no matches OR sg returned non-fatal error - both fine
|
|
149
|
+
pass "search runs (rc=$RC, ast-grep available)"
|
|
150
|
+
;;
|
|
151
|
+
3)
|
|
152
|
+
grep -qi 'install' "$OUTPUT_DIR/s1.out" || fail "search rc=3 should print install hint"
|
|
153
|
+
pass "search without binary prints install hint"
|
|
154
|
+
;;
|
|
155
|
+
*)
|
|
156
|
+
fail "search returned unexpected rc=$RC: $(cat $OUTPUT_DIR/s1.out)"
|
|
157
|
+
;;
|
|
158
|
+
esac
|
|
159
|
+
|
|
160
|
+
# 10. install.sh syntax check + --help
|
|
161
|
+
bash -n "$SKILL_DIR/install.sh" || fail "install.sh has syntax errors"
|
|
162
|
+
$SKILL_DIR/install.sh --help > "$OUTPUT_DIR/inst.out" 2>&1 || true
|
|
163
|
+
grep -qi 'install' "$OUTPUT_DIR/inst.out" || fail "install.sh --help missing keyword 'install'"
|
|
164
|
+
pass "install.sh syntax + --help"
|
|
165
|
+
|
|
166
|
+
# 11. SKILL.md frontmatter
|
|
167
|
+
python3 - <<PY
|
|
168
|
+
import re, sys
|
|
169
|
+
src = open("$SKILL_DIR/SKILL.md").read()
|
|
170
|
+
assert src.startswith("---\n"), "SKILL.md must start with YAML frontmatter"
|
|
171
|
+
end = src.find("\n---\n", 4)
|
|
172
|
+
assert end > 0, "SKILL.md missing closing ---"
|
|
173
|
+
fm = src[4:end]
|
|
174
|
+
assert re.search(r"^name:\s*ast-grep\s*$", fm, re.M), "frontmatter missing name: ast-grep"
|
|
175
|
+
assert re.search(r"^description:", fm, re.M), "frontmatter missing description"
|
|
176
|
+
PY
|
|
177
|
+
pass "SKILL.md frontmatter shape"
|
|
178
|
+
|
|
179
|
+
# 12. All required reference files exist
|
|
180
|
+
for f in references/install.md references/patterns.md references/pitfalls.md \
|
|
181
|
+
references/recipes.md references/cli.md references/yaml-rules.md \
|
|
182
|
+
references/sgconfig.md; do
|
|
183
|
+
test -f "$SKILL_DIR/$f" || fail "missing $f"
|
|
184
|
+
done
|
|
185
|
+
pass "all references present"
|
|
186
|
+
|
|
187
|
+
python3 - "$SKILL_DIR" <<'PY' || fail "Korean characters found in skill content"
|
|
188
|
+
import pathlib, re, sys
|
|
189
|
+
root = pathlib.Path(sys.argv[1])
|
|
190
|
+
hangul = re.compile(r"[\uac00-\ud7a3]")
|
|
191
|
+
targets = [root / "SKILL.md", root / "README.md"]
|
|
192
|
+
for d in ("references", "scripts", "tests", ".github"):
|
|
193
|
+
targets.extend((root / d).rglob("*"))
|
|
194
|
+
targets.extend([root / "install.sh", root / "install.ps1"])
|
|
195
|
+
hits = 0
|
|
196
|
+
for p in targets:
|
|
197
|
+
if not p.is_file():
|
|
198
|
+
continue
|
|
199
|
+
try:
|
|
200
|
+
text = p.read_text(encoding="utf-8")
|
|
201
|
+
except (UnicodeDecodeError, OSError):
|
|
202
|
+
continue
|
|
203
|
+
for n, line in enumerate(text.splitlines(), 1):
|
|
204
|
+
if hangul.search(line):
|
|
205
|
+
print(f"{p}:{n}: {line.rstrip()}")
|
|
206
|
+
hits += 1
|
|
207
|
+
sys.exit(1 if hits else 0)
|
|
208
|
+
PY
|
|
209
|
+
pass "no Korean in skill content"
|
|
210
|
+
|
|
211
|
+
echo ""
|
|
212
|
+
echo "all smoke tests passed"
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"""Regression tests for strict ast-grep binary resolution."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib.util
|
|
6
|
+
import os
|
|
7
|
+
import stat
|
|
8
|
+
import subprocess
|
|
9
|
+
import tempfile
|
|
10
|
+
import unittest
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from unittest.mock import patch
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
SKILL_ROOT = Path(__file__).resolve().parents[1]
|
|
16
|
+
HELPER_PATH = SKILL_ROOT / "scripts" / "ast_grep_helper.py"
|
|
17
|
+
INIT_DEEP_SKILL_PATH = SKILL_ROOT.parent / "init-deep" / "SKILL.md"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def load_helper():
|
|
21
|
+
spec = importlib.util.spec_from_file_location("ast_grep_helper_under_test", HELPER_PATH)
|
|
22
|
+
if spec is None or spec.loader is None:
|
|
23
|
+
raise RuntimeError(f"unable to load helper from {HELPER_PATH}")
|
|
24
|
+
module = importlib.util.module_from_spec(spec)
|
|
25
|
+
spec.loader.exec_module(module)
|
|
26
|
+
return module
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
HELPER = load_helper()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class ProbeAstGrepCandidateTests(unittest.TestCase):
|
|
33
|
+
def make_candidate(self, directory: Path, name: str = "sg") -> Path:
|
|
34
|
+
candidate = directory / name
|
|
35
|
+
candidate.write_text("placeholder", encoding="utf-8")
|
|
36
|
+
candidate.chmod(candidate.stat().st_mode | stat.S_IXUSR)
|
|
37
|
+
return candidate
|
|
38
|
+
|
|
39
|
+
def test_accepts_valid_ast_grep_version_output(self) -> None:
|
|
40
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
41
|
+
candidate = self.make_candidate(Path(temp_dir))
|
|
42
|
+
completed = subprocess.CompletedProcess(
|
|
43
|
+
[str(candidate), "--version"], 0, "ast-grep 0.37.0\n", ""
|
|
44
|
+
)
|
|
45
|
+
with patch.object(HELPER.subprocess, "run", return_value=completed) as run:
|
|
46
|
+
self.assertEqual(HELPER.probe_ast_grep_candidate(candidate), candidate.resolve())
|
|
47
|
+
|
|
48
|
+
run.assert_called_once_with(
|
|
49
|
+
[str(candidate.resolve()), "--version"],
|
|
50
|
+
capture_output=True,
|
|
51
|
+
text=True,
|
|
52
|
+
timeout=5.0,
|
|
53
|
+
check=False,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
def test_rejects_nonzero_version_command(self) -> None:
|
|
57
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
58
|
+
candidate = self.make_candidate(Path(temp_dir))
|
|
59
|
+
completed = subprocess.CompletedProcess(
|
|
60
|
+
[str(candidate), "--version"], 1, "ast-grep 0.37.0\n", "error"
|
|
61
|
+
)
|
|
62
|
+
with patch.object(HELPER.subprocess, "run", return_value=completed):
|
|
63
|
+
self.assertIsNone(HELPER.probe_ast_grep_candidate(candidate))
|
|
64
|
+
|
|
65
|
+
def test_rejects_probe_timeout(self) -> None:
|
|
66
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
67
|
+
candidate = self.make_candidate(Path(temp_dir))
|
|
68
|
+
with patch.object(
|
|
69
|
+
HELPER.subprocess,
|
|
70
|
+
"run",
|
|
71
|
+
side_effect=subprocess.TimeoutExpired([str(candidate), "--version"], 5.0),
|
|
72
|
+
):
|
|
73
|
+
self.assertIsNone(HELPER.probe_ast_grep_candidate(candidate))
|
|
74
|
+
|
|
75
|
+
def test_rejects_unrelated_sg_version_output(self) -> None:
|
|
76
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
77
|
+
candidate = self.make_candidate(Path(temp_dir))
|
|
78
|
+
completed = subprocess.CompletedProcess(
|
|
79
|
+
[str(candidate), "--version"], 0, "setgroups (util-linux) 2.40\n", ""
|
|
80
|
+
)
|
|
81
|
+
with patch.object(HELPER.subprocess, "run", return_value=completed):
|
|
82
|
+
self.assertIsNone(HELPER.probe_ast_grep_candidate(candidate))
|
|
83
|
+
|
|
84
|
+
def test_relative_candidate_uses_path_lookup(self) -> None:
|
|
85
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
86
|
+
candidate = self.make_candidate(Path(temp_dir))
|
|
87
|
+
completed = subprocess.CompletedProcess(
|
|
88
|
+
[str(candidate), "--version"], 0, "", "AST-GREP 0.37.0\n"
|
|
89
|
+
)
|
|
90
|
+
with (
|
|
91
|
+
patch.object(HELPER.shutil, "which", return_value=str(candidate)) as which,
|
|
92
|
+
patch.object(HELPER.subprocess, "run", return_value=completed),
|
|
93
|
+
):
|
|
94
|
+
self.assertEqual(HELPER.probe_ast_grep_candidate("sg"), candidate.resolve())
|
|
95
|
+
|
|
96
|
+
which.assert_called_once_with("sg")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class ResolverFallbackTests(unittest.TestCase):
|
|
100
|
+
def test_invalid_env_candidate_falls_through_runtime_cache_to_path(self) -> None:
|
|
101
|
+
expected = Path("C:/tools/ast-grep.exe")
|
|
102
|
+
with (
|
|
103
|
+
patch.dict(os.environ, {"OCMM_AST_GREP_SG_PATH": "C:/invalid/sg.exe"}),
|
|
104
|
+
patch.object(HELPER, "probe_ast_grep_candidate", return_value=None) as probe,
|
|
105
|
+
patch.object(HELPER, "ocmm_runtime_binary", return_value=None) as runtime,
|
|
106
|
+
patch.object(HELPER, "cached_binary", return_value=None) as cached,
|
|
107
|
+
patch.object(HELPER, "which_binary", return_value=expected) as path,
|
|
108
|
+
patch.object(HELPER, "homebrew_binary") as homebrew,
|
|
109
|
+
):
|
|
110
|
+
self.assertEqual(HELPER.resolve_binary(), expected)
|
|
111
|
+
|
|
112
|
+
probe.assert_called_once_with(Path("C:/invalid/sg.exe"))
|
|
113
|
+
runtime.assert_called_once_with()
|
|
114
|
+
cached.assert_called_once_with()
|
|
115
|
+
path.assert_called_once_with()
|
|
116
|
+
homebrew.assert_not_called()
|
|
117
|
+
|
|
118
|
+
def test_all_resolver_tiers_delegate_to_the_strict_probe(self) -> None:
|
|
119
|
+
source = HELPER_PATH.read_text(encoding="utf-8")
|
|
120
|
+
helper_start = source.index("def _first_valid_candidate(")
|
|
121
|
+
helper_end = source.index("\ndef cached_binary(", helper_start)
|
|
122
|
+
self.assertIn("probe_ast_grep_candidate", source[helper_start:helper_end])
|
|
123
|
+
for function_name in (
|
|
124
|
+
"ocmm_env_binary",
|
|
125
|
+
"ocmm_runtime_binary",
|
|
126
|
+
"cached_binary",
|
|
127
|
+
"which_binary",
|
|
128
|
+
"homebrew_binary",
|
|
129
|
+
):
|
|
130
|
+
start = source.index(f"def {function_name}(")
|
|
131
|
+
next_function = source.find("\ndef ", start + 1)
|
|
132
|
+
body = source[start:next_function if next_function != -1 else None]
|
|
133
|
+
self.assertIn("_first_valid_candidate", body, function_name)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class InitDeepSourceContractTests(unittest.TestCase):
|
|
137
|
+
def test_normal_discovery_uses_lsp_codegraph_rg_not_an_ast_baseline(self) -> None:
|
|
138
|
+
source = INIT_DEEP_SKILL_PATH.read_text(encoding="utf-8")
|
|
139
|
+
|
|
140
|
+
self.assertNotIn("AST-shaped first probe (exactly once)", source)
|
|
141
|
+
self.assertNotIn("ast-grep structural probe: unmeasured", source)
|
|
142
|
+
self.assertIn("Treat `codegraph_*` tools as optional", source)
|
|
143
|
+
self.assertIn("LSP tools and `rg` as the normal fallback evidence path", source)
|
|
144
|
+
self.assertIn("Do not run ast-grep as a baseline substitute", source)
|
|
145
|
+
|
|
146
|
+
def test_ast_grep_escalates_only_for_specific_unanswerable_syntax_questions(self) -> None:
|
|
147
|
+
source = INIT_DEEP_SKILL_PATH.read_text(encoding="utf-8")
|
|
148
|
+
|
|
149
|
+
self.assertIn("specific exact syntax-tree question", source)
|
|
150
|
+
self.assertIn("simpler evidence cannot answer reliably", source)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
if __name__ == "__main__":
|
|
154
|
+
unittest.main()
|
|
@@ -1,15 +1,129 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: brainstorming
|
|
3
|
-
description: Use before creative or materially ambiguous work to clarify outcomes, constraints, risks, and an implementation direction.
|
|
3
|
+
description: "Use before creative or materially ambiguous work to clarify outcomes, constraints, risks, and an appropriate implementation direction."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## DSH resource and authority contract
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This is a full OCMM source adaptation for DSH 0.2.0-rc.2, not an OpenCode or Codex runtime. Source product names in transcript formats, examples, paths and attribution remain descriptive; they are not a host switch.
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
10
|
+
- Load this skill through the native skill tool only when its trigger matches. Resolve every relative reference/script/asset from the directory resourceBase returned with this skill, not from the project cwd or an OCMM checkout. Use available read/glob/grep to inspect resources; use write/edit and the active bash or pwsh only within the actual role and host permissions.
|
|
11
|
+
- External documentation uses actual web_search/web_fetch or an available documentation service. Context7, GitHub MCP, browser, image and LSP tools are optional catalog capabilities, not bundled calls. Use a real available equivalent or report unavailable evidence; never invent an MCP, Task, todo or compression API. Native read uses file_path, not OpenCode filePath; inspect every actual schema before calling it. Use read_image only when exposed and the actual route supports its image result.
|
|
12
|
+
- Source role names are logical assignments: code-search/explore maps to role ID dsmm-code-search, and other canonical roles/categories map to dsmm-<name>. Use this Agent's observed admitted inventory: per-role topology has individual role tools (for example dsmm_plan_critic) plus dsmm_category; parameterized topology has dsmm_role and dsmm_category with their actual role/category enums. Never derive callability from generated files, names or templates. Both layouts preserve target, caller, read-only, inherited tool and depth ceilings; a missing required formal role returns to the stage owner, not a planning bypass.
|
|
13
|
+
- Templates describe assignment content, not callable schemas. Actual delegation takes description/prompt, an exposed level, a deployment-authorized exposed route, and an exposed run_in_background only. Omitted/normal retains the default; low/high/max must be configured at roleRouting.<id>.levels as a complete route or exact supported effort, never synthetic suffix roles or fixed max effort. A complete invocation route needs paired provider/model and cannot silently fall back; effort-only needs exact native preflight. Level/layout never change permissions or verification rigor. Reviewer/Oracle independence requires different observed native routes, not names.
|
|
14
|
+
- One-shot defaults foreground; permitted one-shot background is native-job-owned. A managed admitted continuable configuration defaults background; explicit run_in_background:false creates a non-reusable one-shot. Use only exposed job_output/job_list/job_kill or send_message/interrupt_agent and returned identities. Existing continuable children can receive nearest-step running messages, idle next turns or same-ID cold continuation; receipts mean inbox acceptance, not completion. Exposed native child-to-parent reporting retains exact-sender/adjacency semantics, not new parent-to-child authority. Settled one-shots never revive; reuse never reselects role/level/route or copies a parent's newer policy into the original child capture. Do not send OpenCode task_id/subagent_type/background/resume/retry or guessed control fields.
|
|
15
|
+
- Host observations alone establish lifecycle controls. Managed delivery requires explicit startup composition: disable the stock subagents row, bind the unique PUBLIC DSMM SubagentRuntime subclass and restart; never hot-replace/drain stock or add a shadow runtime. When actually wired and authorized, a user foreground handoff transfers the existing same run to native jobs without a second start; native user queue/steer follows its operator/connection/session/epoch gate. Do not announce unconnected tools/RPCs. Background enablement, capacity, ownership, depth, cancellation and provider support always gate execution. Legacy conservative evidence may permit useful proven capabilities under the same durable child ID; missing evidence denies that capability with a reason, not all legacy children and not an inheritance of current parent policy.
|
|
16
|
+
- When exposed, native todo_write replaces the owning Agent's whole list of content/status items; its schema and allowParallelInProgress policy govern updates. Otherwise use concise session coordination or an authorized plan. ask_user_question is conditional on exposure; otherwise ask in conversation. Native host compaction is not OCMM compress, and no model-facing compression call is assumed. A read-only planner returns complete Markdown; an authorized coordinator persists it, never the planner through shell or a proxy. Role responsibilities, explicit-off common/skill visibility, and the terminal delegation contract override broader examples in a resource.
|
|
17
|
+
- Follow the current user's explicit output-language request, otherwise this Agent's immutable captured DSMM locale when supplied, then applicable host/user language guidance or the current request/context. Supported configured locales are en/zh-Hans/zh-Hant/ja/ko/de/fr/es/pt-BR/ru; omission inherits, not an English default. Preserve code, identifiers, paths, commands, protocol fields and exact quotes, and pass explicit language instructions in child assignments. This resource imports no Root session preference, promises neither internal reasoning language nor UI translation, and never changes host/project locale. A later parent Apply does not rewrite a child's captured locale.
|
|
18
|
+
- Installation, package-manager bootstrap, downloads, authentication/login, credential/profile access, Git writes and destructive actions require explicit authorization for the exact action. Reference commands are not automatic operations. Worktree consent does not authorize dependency installation or later branch deletion. Read before changing an existing file; preserve unrelated user work. Never silently restore/reset a working tree to repair a failed cleanup.
|
|
19
|
+
- Browser/debug QA uses run-owned isolated state, no imported credentials or browser profile, and only already available software unless separately authorized. Keep commands in the active shell dialect. Report unverified surfaces honestly.
|
|
20
|
+
|
|
21
|
+
<!-- Local fork of obra/superpowers/brainstorming v6.3.0.
|
|
22
|
+
Triggered native final-state policy and proportional discovery.
|
|
23
|
+
Authorized work follows applicable planning without redundant design approval.
|
|
24
|
+
Source and maintenance contract: docs/v1-maintenance.md. -->
|
|
25
|
+
|
|
26
|
+
# Brainstorming Outcomes Into Designs
|
|
27
|
+
|
|
28
|
+
Use discovery and design to remove material uncertainty before implementation. The objective is a shared understanding of the goal, constraints, acceptance criteria, interfaces, risks, and ideal end state, not completion of a prescribed ceremony.
|
|
29
|
+
|
|
30
|
+
## Final-State Artifacts and Regression Tests
|
|
31
|
+
|
|
32
|
+
These rules apply when this triggered native skill is loaded. Shared workflow and role policies remain effective without injecting the skill body; packaging is not automatic skill execution or authority.
|
|
33
|
+
|
|
34
|
+
Documents, code and comments, tests, and commit messages express only the concise final requirements, design, and behavior. Update intermediate changes directly to the final text. Don't retain development or decision histories, rejected alternatives, or decision counterexamples. Trace history only through the Git commit tree. The only document exception is a strictly chronological purpose, such as a roadmap or changelog; ordinary maintenance notes aren't history archives.
|
|
35
|
+
|
|
36
|
+
`docs/superpowers/specs/` and `docs/superpowers/plans/` are reserved for final product requirements to be delivered. Each spec or plan describes its final deliverable, not an execution journal. Represent changed requirements with separate plans, not an accumulated change history. Other tasks use conversation-level coordination or a task-owned temporary plan and never write to those directories. Complexity can require planning without making a task a product-spec deliverable.
|
|
37
|
+
|
|
38
|
+
Tests protect valid requirements, functional behavior, and external interfaces against regressions. Don't add string, regex, snapshot, or parsed-content locks for documentation, commit messages, package information, or error/log wording that has no functional or system-boundary significance. Verify executable configuration, protocol fields, and resource delivery through their behavior rather than locking descriptive text. Don't add decision-counterexample tests or tests asserting that a deleted component is absent. When requirements change, update corresponding tests. When a module, helper, tool, or subsystem is removed, delete tests dedicated to it. Negative tests for valid safety, protocol, and input-handling requirements remain appropriate.
|
|
39
|
+
|
|
40
|
+
Don't add tests that freeze incidental files or lockfiles, build-tool details, descriptive package metadata, local OS/shell/path/PATH/CWD settings, dependency/runtime versions, or environment snapshots unrelated to product behavior or an explicit external or necessary delivery contract. A test must expose a concrete failure of a valid requirement, not preserve the current machine or tool setup. Verify configuration and delivery through observable behavior rather than whole-file string/hash equality or parsed incidental state. Necessary integrity, provenance, security, and protocol pins remain valid for their concrete boundary; prompt or document edits alone don't justify new infrastructure/environment tests.
|
|
41
|
+
|
|
42
|
+
Git commits are the compatibility boundary. Uncommitted intermediate implementations may be changed incompatibly to meet final requirements without transition shims or tests preserving intermediate behavior. An existing component with uncommitted edits still has its committed contracts. This rule doesn't authorize changes to public APIs/protocols, security or data guarantees, permissions, or irreversible behavior, and doesn't authorize any Git write.
|
|
43
|
+
|
|
44
|
+
Keep current constraints, authorization boundaries, unresolved risks, and verification evidence visible. State a necessary assumption as a current constraint or verification limit, not a ruling ledger. Agent reports stay in conversation; don't turn coordination, review conclusions, or evidence into workspace files unless explicitly requested as deliverables. Final-state discipline must never hide a real defect, blocker, or unverified requirement.
|
|
45
|
+
|
|
46
|
+
Delegation and delivery need clear goals, useful completion evidence, and material constraints, not exhaustive resource/file inventories, per-item revision/hash/receipt locks, or fixed report fields. Workers may discover relevant files, tests, docs, and other resources within the authorized scope. Communicate scope and ownership boundaries, irreversible-operation limits, and required protocol/integrity identities when they matter; resource discovery never expands permissions. Keep results in conversation and require exact identities only for a concrete safety, integrity, or external protocol requirement.
|
|
47
|
+
|
|
48
|
+
Temporary, debug, disposable, or retired files and directories do not need repeated stability checks, hash comparisons, or correct recorded status at every instant. Keep short-lived state in the agent session and synchronize useful results at delivery or major phase boundaries, not every checklist update. A completed disposable resource checklist can be deleted without first writing completion status; don't introduce repository debug journals or extra ledgers. Deliverables are proven by correct functionality, interfaces, and usability, not string/hash locks on all text files. Use hashes/checksums only for an explicitly necessary integrity, provenance/security, or protocol-identity requirement, preserving required release checks. Cleanup still requires exact task ownership, safe resolved paths, PID plus start identity for process termination, and preservation of user changes; lighter temporary-state handling never weakens authorization, API contracts, or data guarantees.
|
|
49
|
+
|
|
50
|
+
## Coordinated Verification and Evidence Reuse
|
|
51
|
+
|
|
52
|
+
For multi-task or parallel work, workers run lightweight local checks relevant to their substantive changes, not a full suite for each small task. Handoffs state what changed, local evidence/results, and material risks or unverified coverage. The orchestrator coordinates integration and global verification, consolidating necessary heavy checks at task completion or important phase boundaries and minimizing full-suite frequency.
|
|
53
|
+
|
|
54
|
+
Reuse passing evidence when it still covers the current claim and no change materially affects the tested behavior or interface. Unchanged code needs no repeat verification absent a relevant change. During long tasks, dependency/environment changes and unrelated parallel code edits may coexist with valid evidence; they don't automatically invalidate it. Assess concrete relevance: a dependency or environment change that affects tested behavior or interfaces is not unrelated. Rerun only affected or missing checks and state uncovered risks; don't treat failed, stale, or irrelevant evidence as a pass. This reduces duplication, not necessary verification: preserve safety/data/API/permission boundaries, required release checks, repository pre-commit typecheck/test/build gates, and explicit user verification requirements.
|
|
55
|
+
|
|
56
|
+
## Authorization and Intent
|
|
57
|
+
|
|
58
|
+
Start from the user's request and current project evidence:
|
|
59
|
+
|
|
60
|
+
- Identify the requested goal and ideal end state.
|
|
61
|
+
- Preserve stated constraints, permissions, exclusions, and acceptance criteria.
|
|
62
|
+
- Treat a materially clear imperative as authorization to implement that stated scope. Do not require a separate design presentation or reapproval merely because implementation follows discovery.
|
|
63
|
+
- Honor an explicit request for a strict process, design review, approval checkpoint, artifact, or verification step.
|
|
64
|
+
- Ask or obtain specific authorization when a decision changes the requested scope or acceptance, weakens security or data guarantees, changes a public API/protocol, expands permissions, triggers an irreversible/destructive action, or causes an external side effect that requires consent.
|
|
65
|
+
|
|
66
|
+
An instruction to design, investigate, implement, or fix does not authorize unrelated work. Git authorization is operation-specific: implement/fix is not commit; commit is not push, tag, rebase, or release. A clear request for an exact Git operation authorizes that operation without a redundant confirmation, but never expands to another operation, repository, branch, or release action.
|
|
67
|
+
|
|
68
|
+
## Choose Proportional Discovery
|
|
69
|
+
|
|
70
|
+
Choose and revise the path based on actual uncertainty, coordination, and risk. Path labels are planning aids, not gates, and may become lighter or heavier as evidence resolves or reveals complexity.
|
|
71
|
+
|
|
72
|
+
- **Direct/bounded:** The goal, affected flow, constraints, and acceptance are materially clear. Read enough local context to match patterns, state any consequential assumption, and proceed without a separate design approval.
|
|
73
|
+
- **Spike:** Feasibility or missing facts determine the path. Use the cheapest valid investigation and return a recommendation; exploratory code is throwaway unless the user authorizes implementation.
|
|
74
|
+
- **Architectural:** Boundaries, interfaces, dependencies, or consequential trade-offs remain unresolved. Explore enough to make those decisions explicit, then present the useful design or choices before implementation when user input is materially required.
|
|
75
|
+
|
|
76
|
+
Do not default upward merely because work is multi-file, creative, or unfamiliar. Do not default downward when concrete security, data-loss, compatibility, protocol/API, migration, release, or irreversible-operation risks require additional care.
|
|
77
|
+
|
|
78
|
+
These paths size discovery and design; they do not replace workflow planning policy. Complex implementation of product business logic or behavior defaults to `planner` → `plan-critic` → implementation even when requirements are clear and evidence is strong. Planning or criticism for that work may be skipped only for a limited, simple, low-risk, clearly bounded change, or when the user explicitly requests the skip; state the applicable condition in conversation. Non-product routine operations, docs, maintenance, and release preparation use direct execution when resolvable, otherwise a material question or useful `complex`/specialist delegation, not automatic or repeated planner/critic/review cycles. Explicit process requirements and verification for concrete major safety risks remain binding. An explicit skip never permits an unapproved security, data, API/protocol, permission, or irreversible-action decision.
|
|
79
|
+
|
|
80
|
+
## Discovery
|
|
81
|
+
|
|
82
|
+
Inspect only enough project context to resolve material questions:
|
|
83
|
+
|
|
84
|
+
- current behavior and relevant local patterns;
|
|
85
|
+
- affected boundaries, dependencies, and interfaces;
|
|
86
|
+
- constraints and acceptance evidence;
|
|
87
|
+
- plausible failure, rollback, compatibility, security, data, and operational risks;
|
|
88
|
+
- independent work that can form separate waves.
|
|
89
|
+
|
|
90
|
+
Use a clarifier or ask the user only when missing information would change the deliverable, create material rework, or cross an escalation boundary. Ask the smallest useful question in the clearest form; there is no required question count, option count, or multiple-choice format.
|
|
91
|
+
|
|
92
|
+
## Explore Approaches When They Matter
|
|
93
|
+
|
|
94
|
+
Present alternatives only when there is a real decision with meaningful trade-offs. Give as many viable approaches as the decision warrants, including one when the evidence supports a single clear path. Explain the recommendation using project evidence, constraints, reversibility, risk, and cost.
|
|
95
|
+
|
|
96
|
+
Do not manufacture alternatives, architecture, or refactoring to make the process appear thorough. Follow established patterns and apply YAGNI.
|
|
97
|
+
|
|
98
|
+
## Outcome-Oriented Design
|
|
99
|
+
|
|
100
|
+
Scale the design artifact to the work within the product-spec and temporary-plan boundaries above. A useful design makes the following discoverable without requiring fixed sections or order:
|
|
101
|
+
|
|
102
|
+
- goal and ideal end state;
|
|
103
|
+
- scope, exclusions, constraints, permissions, and acceptance criteria;
|
|
104
|
+
- current state and proposed approach;
|
|
105
|
+
- dependencies, interfaces, data/error flow, and ownership boundaries;
|
|
106
|
+
- material risks, rollback or safeguards where relevant;
|
|
107
|
+
- wave goals and useful acceptance evidence.
|
|
108
|
+
|
|
109
|
+
Organize waves by independently meaningful outcomes and dependency order. For each wave, state what becomes true and what evidence would demonstrate it. Do not require a task list, tiny sequential steps, or completion in a fixed order when work can safely proceed directly or in parallel.
|
|
110
|
+
|
|
111
|
+
## Bounded Rulings and Escalation
|
|
112
|
+
|
|
113
|
+
Resolve non-material ambiguity from the approved goal and repository evidence. Choose the smallest safe, reversible option that preserves the user's goal, constraints, permissions, and acceptance criteria.
|
|
114
|
+
|
|
115
|
+
Keep only the resulting current requirements, constraints, unresolved risks, and useful evidence in task coordination and handoffs. Don't write a decision or assumption history.
|
|
116
|
+
|
|
117
|
+
Escalate rather than guess when a choice changes scope or acceptance, weakens security or data guarantees, changes a public API/protocol, expands permissions, creates an irreversible effect, conflicts with a specific user mandate, or has no evidence-based path. Strict process is otherwise justified only by an explicit user request or concrete risk.
|
|
118
|
+
|
|
119
|
+
## Review and Approval
|
|
120
|
+
|
|
121
|
+
Self-review a material design for requirement coverage, internal consistency, interfaces, risks, and acceptance evidence. Fix clear issues directly.
|
|
122
|
+
|
|
123
|
+
Request user review or approval only when their decision is needed, they explicitly requested the checkpoint, or a governing high-risk boundary requires it. Do not require approval section-by-section, repeat review because wording changed, or restart a design loop after a non-substantive edit. If substantive inputs change, revisit only the affected decisions and evidence.
|
|
124
|
+
|
|
125
|
+
A saved spec is not mandatory for a clear bounded change. Create a product spec only for final product requirements to be delivered; other tasks stay in conversation or a task-owned temporary plan. Do not create a separate design/spec commit by default.
|
|
126
|
+
|
|
127
|
+
## Implementation Handoff
|
|
128
|
+
|
|
129
|
+
Once the goal is authorized and material uncertainty is resolved, proceed through the applicable implementation workflow without asking for a second design approval. Hand off the goal, ideal end state, constraints, acceptance criteria, dependencies/interfaces, material risks, and useful evidence. File-backed plans follow the location and final-deliverable rules above; delegated workers remain conditional on execution value.
|