建立 Watchman 规划基线,并接入 Marionettist Cursor 工作流。

公司规范只约束代码内容,门禁仍按插件执行;MCP token 不入库。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
unknownandCursor committed 2026-11-17 10:11:27 +08:00
commit 8b2a809f06
73 files changed
+8661

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
---
name: marionettist-bugfix
description: Start Marionettist workflow for a bug fix
---
I want to fix a bug. Follow the current repository bugfix Marionettist workflow.
Observed behavior:
$1
Expected behavior:
$2
Reproduction steps:
$3
Evidence:
$4
Affected scope:
$5
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- First decide whether `workflow-inspector` or `module-inspector` is needed.
- Create a dated task directory for non-trivial work and point `.task/active.json` to it.
- When intaking non-trivial work, surface Marionettist gate policy choices `strict`, `balanced`, and `autonomous`, including config `gatePolicy.defaultMode` when available, the recommended policy, and any allowed task-local selection.
- If task-local override is allowed, capture `gatePolicy.selected` distinctly from the default and recommendation instead of silently defaulting.
- Use `marionettist-indexer` for repository, docs, rules, knowledge, boundary, or call-path exploration when evidence is incomplete.
- Use `marionettist-planner` only when the bugfix needs an implementation slice, validation strategy, or context-pack planning.
- Do not use `requirement-freezer` by default.
- Only use `requirement-freezer` when expected behavior or business rules are unclear.
- Create `.task/<task-id>/context-pack.md` before coding, where `<task-id>` is selected by `.task/active.json`.
- Do not code directly.
- After the user confirms analysis is complete, orchestrate the approved slice through `marionettist-coder` and `marionettist-reviewer`.
+20
View File
@@ -0,0 +1,20 @@
---
name: marionettist-config
description: Start Marionettist or project configuration work through the builder-first flow
---
I want help with Marionettist or project workflow configuration:
<user-request>
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- Treat this as the normal-user configuration wrapper.
- Prefer configuration-oriented routing for Marionettist-managed setup, workflow, agent, rule, tasking, or Cursor-related config work unless another workflow is clearly a better fit.
- When the request describes Tier-policy changes in natural language, draft candidate `.marionettist/tier-policy.yml` content, show a diff before any write, and require explicit confirmation before persistence.
- For Tier-policy authoring, use the existing builder/config workflow rather than inventing a new command unless a future approved design adds one.
- Explain the selected workflow in one concise sentence, including any required gate before acting or delegating.
- Keep the request project-neutral.
- Do not skip analysis, critic, review, validation, or human-confirmation gates.
- For non-trivial task intake, surface Marionettist gate policy choices `strict`, `balanced`, and `autonomous`, including config `defaultMode` when available and the recommended policy for the task.
- If task-local override is allowed, capture the selected task policy explicitly instead of silently defaulting.
+33
View File
@@ -0,0 +1,33 @@
---
name: marionettist-context
description: Generate or update the current task context pack
---
Use `context-pack-builder`.
Use `marionettist-planner` first if the current slice, validation commands, or stop conditions are not clear enough.
Requirement source:
$1
Implementation source:
$2
Current slice:
$3
Output:
`.task/<task-id>/context-pack.md`, where `<task-id>` is read from `.task/active.json`.
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- Keep the context pack compact.
- Include only what is needed for the current coding slice.
- Include visible gate policy state when available: config `defaultMode`, recommended policy, selected policy, effective policy, and `finalApprovalRequired`.
- If task-local override is allowed and `selected` is still missing at a decision point, surface the available choices `strict`, `balanced`, and `autonomous` instead of silently defaulting when the task still needs an explicit selection.
- State allowed modification scope.
- State forbidden modification scope.
- State validation commands.
- State stop conditions.
- Do not code.
- If `.task/active.json` is missing, do not guess a task path; ask the user to start or select a task first.
- If legacy `.task/context-pack.md` exists, use it only as migration fallback and recommend moving context into the active task directory.
+55
View File
@@ -0,0 +1,55 @@
---
name: marionettist-continue
description: Continue the active Marionettist task by reading task state and respecting gates
---
Read `.task/active.json` first, then `.task/<task-id>/state.json`. Here `<task-id>` is selected by `.task/active.json`.
When available, also read `marionettist.config.yaml` to determine the local `gatePolicy.defaultMode`. Treat gate policy as Marionettist workflow behavior, not as host tool-permission settings or other tool-permission settings.
When `marionettist.config.yaml` exists, also read `marionettist.language` early and use it for Marionettist user-facing communication only. Support `en` and `zh-CN`; fall back to `en` when the value is absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language. Preserve identifiers, file paths, YAML keys, command names, and quoted user text.
Do not blindly write code. Respect the current phase, all gates, `criticPassed`, and `allowedToCode`.
Treat work as critic-gated when it is Tier L, or when the requirement, implementation plan, state, or context pack marks it as high-risk, boundary-sensitive, or workflow-sensitive.
Use this effective gate policy order for continuation decisions:
- `gatePolicy.selected` from task state when present
- otherwise `gatePolicy.defaultMode` from `marionettist.config.yaml` when present
- otherwise current safe Marionettist behavior
- `recommended` values remain advisory only
When reporting or deciding continuation, show the visible gate-policy state when available: config default, recommended policy, selected policy, effective policy, whether task-local override is allowed, and `finalApprovalRequired`.
If `gatePolicy.selected` is missing at a decision point and task-local override is allowed, do not silently coerce to `defaultMode` when an explicit task choice should still be surfaced; present `strict`, `balanced`, and `autonomous`, explain the default and recommendation, and ask the user to choose before continuing when appropriate.
Policy semantics for continuation:
- `strict`: stop at each required Marionettist gate.
- `balanced`: preserve analysis and final approval gates; allow continuation into the next already-approved `gateClass: simple` slice/group or low/moderate-risk `gateClass: standard` slice/group with `risk_score <= 3` when no critic gate, explicit stop condition, or missing approval evidence blocks it.
- `autonomous`: preserve analysis and final approval gates; allow continuation only into the next already-approved `gateClass: simple` or `gateClass: standard` slice or approved parallel group with `risk_score <= 3`, and only when no mandatory stop applies.
Supplemental `risk_score` is stricter metadata. Use it together with `gateClass` and `gateReasons` when deciding whether to continue, pause, or escalate. It may only preserve or strengthen required pauses and routing; it must never weaken `gateClass`, critic requirements, explicit gates, final approval, or other mandatory stops.
Continuation rules:
- If there is no active task, prompt the user to create one with `/marionettist` or a focused entrypoint such as `/marionettist-dev`, `/marionettist-incident`, `/marionettist-docs`, or `/marionettist-config`.
- If `requirementFrozen` is false and the task needs frozen requirements, route to `requirement-freezer`.
- If `implementationPlan` is missing or plan approval is required, route to `implementation-slicer` or `marionettist-planner`.
- If `contextPackReady` is false, route to `context-pack-builder` and write `.task/<task-id>/context-pack.md`.
- If the task is critic-gated and `criticPassed` is false, route to `marionettist-critic` in `plan-review` mode before any coding handoff.
- A critic `PASS` does not authorize coding by itself. If `allowedToCode` is false, explain the blocked gate and ask the user for confirmation before coding.
- If `allowedToCode` is true, pass only the current approved slice or group to `marionettist-coder`.
- If coding is complete but review has not passed, route to `marionettist-reviewer` for the current slice or group.
- Use the reviewer’s bounded high-risk two-stage mode when the task or current slice/group is Tier L, high-risk, boundary-sensitive, workflow-sensitive, or critic-required.
- Otherwise use the reviewer’s standard bounded diff-review mode by default.
- If coding, review, and required validation are complete for critic-gated work, route to `marionettist-critic` in `pre-done` mode before declaring the approved work done. Provide reviewer verdict, validation evidence, changed-file inventory, and state/gate summary; do not ask the critic to redo code review.
- If review passed but validation has not passed, route to `marionettist-validator`.
- If the current slice or group is done and the next step is another already-approved slice or group, use the effective gate policy plus that next item's `gateClass`, `risk_score`, and `gateReasons` to decide whether to pause or continue.
- In `balanced` mode, continue only for `gateClass: simple` or low/moderate-risk `gateClass: standard` slices or groups with `risk_score <= 3`, and only when no critic-required, explicit gate, or other stop condition applies.
- In `autonomous` mode, continue only for already-approved next `simple` or `standard` slices or approved parallel groups with `risk_score <= 3`, and only when no mandatory stop applies.
- In `autonomous` mode, stop for `risk_score >= 4`, `boundary-sensitive`, `high-risk`, critic-required work, explicit gates or stop conditions, protected-area or dangerous-command decisions, analysis-to-coding, and final approval.
- When pausing or escalating because of risk, explain the controlling `gateClass` and include the relevant `risk_score` and `gateReasons` in the gate explanation.
- Keep final approval required by default.
Do not use the critic gate to bypass coding, review, validation, or human-confirmation gates.
Before any important phase transition, tell the user what will happen next and request confirmation.
+18
View File
@@ -0,0 +1,18 @@
---
name: marionettist-dev
description: Start focused development work through the builder-first Marionettist flow
---
I want help with development or implementation work:
<user-request>
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- Treat this as the normal-user development wrapper.
- Prefer the development workflow unless the request clearly fits another workflow better.
- Explain the selected workflow in one concise sentence, including any required gate before acting or delegating.
- Keep the request broad enough to cover feature, build, or implementation work without forcing a low-level command choice.
- Do not skip analysis, critic, review, validation, or human-confirmation gates.
- For non-trivial task intake, surface gate policy choices `strict`, `balanced`, and `autonomous`, including config `defaultMode` when available and the recommended policy for the task.
- If task-local override is allowed, capture the selected task policy explicitly instead of silently defaulting.
+22
View File
@@ -0,0 +1,22 @@
---
name: marionettist-docs
description: Start focused docs or rules work through the builder-first Marionettist flow
---
I want help with docs, rules, or project knowledge work.
Target area:
$1
Task:
$2
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- Treat this as the normal-user docs wrapper.
- Prefer docs-oriented routing unless another workflow is clearly a better fit.
- Explain the selected workflow in one concise sentence, including any required gate before acting or delegating.
- Docs should explain responsibilities, design, workflows, boundaries, and extension points.
- Rules should express behavioral constraints and may include metadata such as `type`, `confidence`, and `source`; do not treat `observed` or `target` rules as hard constraints by default.
- Do not duplicate content between docs and rules.
- If docs or rules are added, moved, renamed, or deleted, update `docs/project/knowledge-map.md` as well.
+21
View File
@@ -0,0 +1,21 @@
---
name: marionettist-feature
description: Start Marionettist workflow for a feature request
---
I want to develop a new requirement:
<user-request>
Follow the current repository Marionettist workflow.
When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
Run `task-intake` first.
Create a dated task directory for non-trivial work and point `.task/active.json` to it.
When intaking non-trivial work, surface Marionettist gate policy choices `strict`, `balanced`, and `autonomous`, including config `gatePolicy.defaultMode` when available, the recommended policy, and any allowed task-local selection.
If task-local override is allowed, capture `gatePolicy.selected` distinctly from the default and recommendation instead of silently defaulting.
Use `marionettist-indexer` for repository, module, docs, rules, or workflow exploration when scope is unclear.
Use `marionettist-planner` when implementation slicing, validation strategy, or context-pack planning is needed.
If needed, create the requirement document and implementation plan later.
Do not code directly.
Do not skip analysis gates.
After the user confirms analysis is complete, orchestrate the approved slice through `marionettist-coder` and `marionettist-reviewer`.
+58
View File
@@ -0,0 +1,58 @@
---
name: marionettist-incident
description: Start focused incident investigation through the builder-first Marionettist flow
---
Use this command for incident or urgent investigation when the user has symptoms, reports, logs, screenshots, videos, error stacks, communication packets, config, environment details, reproduction notes, or partial analysis.
Incident details:
<user-request>
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- Treat this as the normal-user incident wrapper and prefer an incident-first evidence workflow unless another workflow is clearly a better fit.
- Read `.task/active.json` first. If an active task exists, then read `.task/<task-id>/state.json`. Here `<task-id>` is selected by `.task/active.json`.
- Explain the selected workflow in one concise sentence, including any required gate before acting or delegating.
- Create or update `.task/<task-id>/incident.md` as an analysis artifact only.
- Do not treat this command as authorization to code, bugfix, refactor, or change production files.
- Do not skip evidence organization and jump to code changes.
- Keep facts, hypotheses, candidate repair actions, and missing evidence in separate sections.
- Require reproduction evidence or an explicit unavailable/manual/environmental `NOT_RUN` reason before recommending implementation by default.
Incident-first rules:
- If no active task exists, create a dated task directory for the investigation and point `.task/active.json` to it.
- Do not assume local reproduction is available.
- Do not assume site, production, browser, device, packet-capture, or environment access.
- Do not automatically capture terminal logs or any other evidence.
- Use `marionettist-indexer` only for read-only repository, docs, rules, ownership, boundary, or suspected-file exploration when that helps organize the incident.
- Treat broad repairs without direct evidence, reproduction, or documented validation constraints as a stop condition unless the user explicitly approves the risk.
Collect and organize only user-provided or explicitly supplied evidence:
- symptoms, impact, and severity clues
- logs
- screenshots or video references
- error stacks or traces
- communication packets, requests, responses, and headers
- relevant config, flags, and feature toggles
- environment, version, deployment, runtime, and device details
- reproduction steps or operator steps
- initial analysis already performed
- suspected modules, files, services, or ownership hints
- explicit unknowns, missing evidence, and blocked observations
Write `.task/<task-id>/incident.md` with at least:
- incident summary
- evidence inventory
- timeline or event sequence if known
- reproduction or operation notes
- initial hypotheses
- confirmed facts separated from assumptions and unknowns
- hypothesis support classification: `confirmed`, `likely`, `possible`, `unknown`, `weakly-supported`, `unsupported`, or `contradicted`
- candidate repair actions with the evidence each action depends on
- before-fix validation and after-fix validation, or `NOT_RUN` reasons when validation is unavailable, manual, or environmental
- needed on-site or user confirmations for each non-confirmed hypothesis
- missing evidence
- forbidden assumptions and non-goals
- recommended next analysis step
Before any next-phase recommendation, explicitly remind the user that incident analysis is not coding authorization.
+18
View File
@@ -0,0 +1,18 @@
---
name: marionettist-refactor
description: Start Marionettist workflow for a refactor task
---
I want to perform a refactor task:
<user-request>
Follow the current repository Marionettist workflow.
When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
Analyze boundaries and workflow impact first.
When intaking non-trivial work, surface Marionettist gate policy choices `strict`, `balanced`, and `autonomous`, including config `gatePolicy.defaultMode` when available, the recommended policy, and any allowed task-local selection.
If task-local override is allowed, capture `gatePolicy.selected` distinctly from the default and recommendation instead of silently defaulting.
Use `marionettist-indexer` for ownership, docs, rules, and call-path exploration.
Use `marionettist-planner` to create small implementation slices and validation strategy after scope is clear.
Do not code directly.
After the user confirms analysis is complete, orchestrate the approved slice through `marionettist-coder` and `marionettist-reviewer`.
+32
View File
@@ -0,0 +1,32 @@
---
name: marionettist-status
description: Show current Marionettist task state without modifying files
---
Read `.task/active.json` first, then read `.task/<task-id>/state.json` if an active task exists. Here `<task-id>` is selected by `.task/active.json`.
When available, also read `marionettist.config.yaml` so gate policy can be reported with its config `defaultMode`. Treat Marionettist gate policy separately from Cursor permission settings.
When `marionettist.config.yaml` exists, also read `marionettist.language` early and use it for Marionettist user-facing communication only. Support `en` and `zh-CN`; fall back to `en` when the value is absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language. Preserve identifiers, file paths, YAML keys, command names, and quoted user text.
Output only the current task status. Do not modify files and do not code.
If no active task exists, tell the user to start with one of:
- `/marionettist`
- `/marionettist-dev`
- `/marionettist-incident`
- `/marionettist-docs`
Report:
- Task
- Type
- Phase
- Allowed To Code
- Current Slice
- Last Gate
- Next Command
- Gate policy: config default, recommended, selected, effective, whether override appears allowed, and `finalApprovalRequired`
- Required files and whether each exists
- Warnings
Do not guess missing state. If state is incomplete, name the missing field and suggest the smallest repair.
+21
View File
@@ -0,0 +1,21 @@
---
name: marionettist
description: Start from the unified builder-first Marionettist entrypoint
---
Use this as the default Marionettist command.
User request:
<user-request>
Requirements:
- When `marionettist.config.yaml` exists, read `marionettist.language` early and use it for Marionettist user-facing communication only; support `en` and `zh-CN`, fall back to `en` when absent or unknown unless a higher-priority local safety instruction for that Marionettist interaction explicitly requires another language, and preserve identifiers, file paths, YAML keys, command names, and quoted user text.
- Treat this as a builder-first natural-language entrypoint.
- First classify the intent and choose the smallest matching Marionettist workflow.
- Explain the selected workflow in one concise sentence, including any required gate before acting or delegating.
- Ask only minimal clarifying questions when ambiguity blocks safe progress.
- Keep the command project-neutral and preserve normal Marionettist gates.
- When starting or intaking non-trivial work, surface Marionettist gate policy choices separately from host tool permissions: report config `gatePolicy.defaultMode` when available, the recommended policy for the task, and the available choices `strict`, `balanced`, and `autonomous`.
- If task-local gate-policy override is allowed, capture the user's selected policy for the task instead of silently defaulting; record recommended versus selected distinctly.
Supported intent examples include development, bugfix, incident, docs, config, review, validation, status, continuation, and context-pack requests.