建立 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

+127
View File
@@ -0,0 +1,127 @@
---
name: boundary-reviewer
description: Review code changes for boundary violations, rule conflicts, unintended scope expansion, missing validation, and documentation sync requirements. Use after implementation and before commit.
phase: review
model_requirement: reflective
can_edit: false
risk_level: medium
---
# Boundary Reviewer
Use this skill after code changes and before commit or handoff.
This skill is primarily a boundary, scope, rules, and validation reviewer. For higher-risk work, it may also include a distinct second review dimension for implementation quality, but it should not turn every review into a full heavyweight code review by default.
## Workflow
1. Inspect the current diff.
2. Read `AGENTS.md`.
3. Read `.task/active.json`, `.task/<task-id>/state.json`, and `.task/<task-id>/context-pack.md` if present. Here `<task-id>` is selected by `.task/active.json`.
4. Read `docs/project/knowledge-map.md`.
5. Read relevant rules and docs for changed areas.
6. Determine review depth from the active task context:
- Use the standard boundary-focused review by default.
- Use two review dimensions only when the task context, rules, or reviewer instructions explicitly mark the work as high-risk, Tier L, architecture-sensitive, or otherwise requiring stricter review.
- Keep any second review dimension distinct from pre-done critic evidence audit work; do not treat critic findings as a substitute for this review, and do not repeat the critic's role as a pre-done gate evidence checker.
7. Check boundary/spec/scope/rule/validation compliance:
- allowed scope vs actual changed files
- forbidden scope violations
- protected area modifications
- spec or requirement drift relative to the approved slice, group, or task context
- dependency direction
- architecture-sensitive changes
- SQL or data migration risks
- parallel group shared files, merge owner, fallback order, and group validation when applicable
- Marionettist gate compliance for analysis, coding slice/group, and review transitions
- rule conflicts
- missing validation
- docs, rules, or knowledge-map sync needs
8. When the task explicitly requires higher-risk or Tier L review, also check implementation quality in a separate dimension:
- code quality and maintainability concerns that materially affect the approved slice
- implementation clarity and fitness for the stated requirement
- test quality and whether tests or checks meaningfully cover the changed behavior
- avoid duplicating a full general-purpose review when the task does not require it
9. Output review findings only.
10. Do not modify code unless explicitly asked.
## Diff Sources
Prefer these git sources when reviewing changes:
- `git status --short`
- `git diff --stat`
- `git diff`
- `git diff --staged` when staged changes are present
If git is unavailable, state the limitation explicitly in the review output.
## Blocking Criteria
Return `BLOCKED` when:
- a forbidden file or area was modified
- a protected area was modified without explicit user approval
- actual changes exceed `.task/<task-id>/context-pack.md` allowed scope
- a rule in `AGENTS.md` or `.aiassistant/rules` is violated
- destructive SQL or migration risk is detected without explicit approval
- required validation is missing for architecture-sensitive changes
- parallel group work touched shared files without a declared merge owner or conflict resolution rule
- current changes show the task crossed a required Marionettist gate without explicit user confirmation
Do not block solely for code-quality or maintainability observations unless the task explicitly requires the higher-risk second review dimension and the issue creates material release, correctness, safety, or supportability risk.
## Output Format
```md
# Boundary Review Result
## Summary
## Changed Scope
## Violations
### Violation 1
- File:
- Rule:
- Risk:
- Required Fix:
## Warnings
## Missing Validation
## Review Dimensions
- Boundary / Spec / Scope / Rules / Validation:
- Code Quality / Maintainability / Implementation / Test Quality:
## Parallel Group Check
- Applicable:
- Shared Files:
- Merge Owner:
- Fallback Order:
- Group Validation:
- Issues:
## Marionettist Gate Check
## Documentation Sync Needed
## Final Recommendation
Final recommendation must be one of:
- PASS
- PASS_WITH_WARNINGS
- BLOCKED
```
## Guardrails
- Do not modify code during review.
- Treat rules as constraints and docs as knowledge.
- Do not expand the task scope.
- Keep the boundary-reviewer and critic roles distinct. The critic is not a duplicate code reviewer, and this skill is not a pre-done evidence-audit substitute.
- For non-high-risk work, keep the review lightweight and boundary-focused unless stronger instructions require more.
- If a violation is uncertain, report a warning instead of inventing a violation.
@@ -0,0 +1,204 @@
---
name: context-pack-builder
description: Build a minimal task context pack before coding. Use after a requirement document or implementation plan exists, or when a coding task spans modules and needs compact context for AI agent execution.
phase: analysis
model_requirement: reasoning
can_edit: true
risk_level: medium
---
# Context Pack Builder
Use this skill to build `.task/<task-id>/context-pack.md` before implementation. Read `<task-id>` from `.task/active.json`.
## When To Use
- Use after a requirement document or implementation plan exists.
- Use before coding when a task needs compact, bounded execution context.
## Inputs Required
- `.task/active.json` and `.task/<task-id>/state.json`
- Requirement, implementation, and incident artifacts when applicable
- Relevant rules and docs routed through the knowledge map or nearby rule files
## Steps
1. Read `.task/active.json` and `.task/<task-id>/state.json`.
2. Read `marionettist.config.yaml` when it exists and note `knowledge.mode` and `knowledge.maturity`.
3. Read the requirement document if available, preferring `.task/<task-id>/requirement.md`.
4. Read the implementation plan if available, preferring `.task/<task-id>/implementation-plan.md`.
5. For bugfix or incident-style work, read `.task/<task-id>/incident.md` when it exists.
6. Read `docs/project/knowledge-map.md` to route only the most relevant docs and rules.
7. Match involved areas using knowledge-map fields such as `Areas`, `Tags`, `Docs`, `Rules`, `Read When`, `Boundaries`, and `Validation`.
8. If target files or directories are known, walk upward from those paths and load only nearby `MODULE_RULES.md`, `AGENTS.md`, or `HARNESS_RULES.md` files that actually constrain the work.
9. Treat global safety and boundary rules as higher priority than local path-proximity rules when they conflict.
10. Use module-inspector or workflow-inspector only when scope is still unclear after targeted routing.
11. Extract only the minimum context needed for coding.
12. Create or update `.task/<task-id>/context-pack.md`.
13. Do not implement code.
14. If legacy `.task/context-pack.md` exists, read it only as a migration fallback and recommend moving context into the active task directory.
15. Record the task's recommended and selected gate policy when available from task artifacts and, when present, `marionettist.config.yaml`, along with the stop conditions that still require a pause.
## Output Artifact
- A compact `.task/<task-id>/context-pack.md` with the current slice or group, loaded context, allowed scope, validation commands, and stop conditions
## Knowledge Mode And Maturity
Use config values as routing defaults:
- `knowledge.mode: standard` -> balance current-state and future-intent context as needed
- `knowledge.mode: mudball` -> load current-state evidence first and prefer present-day behavior, risk, unknowns, and safe-change guidance
Scale context depth by `knowledge.maturity`:
- **L0**: minimum viable context; keep scope tight and unknowns explicit
- **L1**: include current-state entrypoints, major flows, risk zones, and safe-change notes
- **L2**: include reusable area docs and rule metadata when they materially affect the task
- **L3**: include stronger ownership, boundary, and docs/rules sync context when relevant
- **L4**: include curated high-trust constraints and stronger validation expectations for architecture-sensitive work
Do not push mudball projects toward L3/L4 by default. L0-L1 are acceptable steady states when knowledge is still emerging.
## Output File Template
```md
# Task Context Pack
## Task Goal
## Knowledge Posture
- Mode:
- Maturity:
## Current Slice Or Group
## Gate Policy
- Recommended:
- Selected:
- finalApprovalRequired: true | false
- Policy Notes:
## Bugfix Context
### Observed Behavior
### Expected Behavior
### Reproduction Steps
### Evidence
- Logs:
- Stack Trace:
- Screenshots:
- Related Files:
### Suspected Scope
### Regression Risk
## Requirement Source
## Implementation Source
## Involved Modules Or Areas
## Loaded Context
### Global Rules
### Knowledge Map Matches
### Path-Proximity Rules
### Excluded Context
Use `Loaded Context` to explain routing decisions and why each source was included or excluded. Use the following `Loaded Rules` and `Loaded Docs` sections as concise reference lists, not as places to duplicate full content.
## Loaded Rules
## Loaded Docs
## Execution Mode
- Mode: sequential | parallel-group
- Current Slice Or Group:
- Parallel Members:
- Fallback Order:
- Shared Files:
- Merge Owner:
- Conflict Resolution Rule:
- Validation Level: slice | group | final
## Execution Chain
## Allowed Modification Scope
## Forbidden Modification Scope
## Key Existing Classes Or Entrypoints
## Required Behavior
## Non-goals
## Implementation Steps
## Validation Commands
## Assumptions
## Risks
## Stop Conditions
```
## Guardrails
- Keep the context pack compact.
- Read mode/maturity from `marionettist.config.yaml` when available and reflect them in the context pack.
- Do not copy full docs or source files.
- Include forbidden scope explicitly.
- Include validation commands explicitly.
- When the current approved work is `parallel-capable`, include both the parallel mode and the sequential fallback order.
- When the current approved work is a parallel group, include members, shared files, merge owner, conflict rule, and group validation.
- Include stop conditions explicitly.
- Record recommended and selected gate policy from task artifacts when available, and also note relevant `marionettist.config.yaml` gate policy defaults or overrides when present.
- In markdown, prefer the canonical field name `finalApprovalRequired` or explicitly note that it maps to the JSON key of the same name so agents do not copy a humanized label into `state.json`.
- If a task-local policy override is selected, note that it changes the task posture but does not bypass required analysis gates, required final approval by default, or any other explicit stop condition.
- For bugfix tasks, include observed behavior, expected behavior, reproduction steps, evidence, suspected scope, and regression risk when available.
- Read `incident.md` only when the task type and available evidence justify it.
- Do not load the whole `docs` directory by default.
- Do not turn `knowledge-map.md` into a code index.
- Record which context was loaded, why it matched, and what was intentionally excluded.
- Prefer references to the exact docs and rules that matter instead of copying them.
- If local path rules conflict with repository-global safety or boundary rules, follow the global rules and note the conflict.
- For `knowledge.mode: mudball`, prefer current-state docs over target-state docs unless future design is directly relevant.
- Do not require broad documentation context for L0-L1 tasks when a smaller safe context is sufficient.
- Do not implement code.
## Gate / Stop Condition
- Stop when the approved slice or current task posture cannot be identified.
- Stop when required rules, boundaries, or validation expectations remain too unclear for safe coding handoff.
## Red Flags
- Context packs that duplicate large docs instead of routing to them
- Missing forbidden scope or stop conditions
- Unclear slice versus parallel-group execution posture
- Loaded local rules that conflict with stronger global safety boundaries
## Exit Criteria
- The current slice or group is explicit
- Only the minimum relevant docs and rules are included
- Allowed and forbidden scope are clear
- Validation commands, assumptions, risks, and stop conditions are documented
## Handoff
- Hand the context pack to the coding workflow together with the approved slice or group and any unresolved stop conditions that still require a pause
+146
View File
@@ -0,0 +1,146 @@
---
name: hypothesis-critic
description: Challenge incident or bugfix hypotheses against available evidence before implementation. Use after incident intake or whenever a suspected root cause needs support checks, disconfirming evidence review, and a safest-next-step recommendation.
phase: analysis
model_requirement: reasoning
can_edit: false
reads:
- .task/active.json
- .task/<task-id>/incident.md
- user-supplied evidence
- relevant logs, code snippets, screenshots, configs, and reports
writes: []
outputs:
- hypothesis assessment with support labels
- evidence gaps and disconfirming checks
- safest next step for planner or context-pack-builder handoff
risk_level: medium
---
# Hypothesis Critic
Use this skill to challenge bugfix or incident hypotheses before implementation.
Read `<task-id>` from `.task/active.json`. Prefer `.task/<task-id>/incident.md` when it exists. If no incident file exists, use only the evidence the user supplied and state the limitation clearly.
## Purpose
- Test whether each hypothesis is supported by observed phenomena, logs, code, runtime behavior, configuration, and other concrete evidence.
- Separate evidence from interpretation.
- Catch weak causal claims before a planner or coding agent acts on them.
- Prepare a clean handoff for a planner, context-pack-builder, or reviewer.
## Workflow
1. Read `.task/active.json` when a task directory is in use.
2. Read `.task/<task-id>/incident.md` if available.
3. Collect the smallest relevant evidence set:
- user symptom report
- logs or stack traces
- screenshots or external reports
- relevant code snippets or config fragments
- known environment or version notes
4. List the explicit hypotheses already proposed by the user, incident pack, or prior analysis.
5. If no explicit hypotheses exist, derive a small set of candidate hypotheses and label them as tentative.
6. For each hypothesis, evaluate:
- what evidence supports it
- what evidence only weakly suggests it
- what evidence could disconfirm it
- whether the claimed cause actually explains the observed effect
- whether the hypothesis is broader than the current incident scope
7. Assign exactly one support label to each hypothesis:
- `confirmed`
- `likely`
- `possible`
- `unknown`
- `weakly-supported`
- `unsupported`
- `contradicted`
8. Identify whether the current evidence is sufficient to justify implementation, or whether the safest next step is reproduction, disconfirming checks, or more evidence.
9. Recommend the smallest safe next step needed to reduce uncertainty.
10. Output the assessment only.
11. Do not implement fixes.
## Required Checks
For every hypothesis, explicitly check for:
- over-interpretation from partial evidence
- weak causal links between symptom and suspected cause
- missing disconfirming evidence
- missing reproduction evidence or documented `NOT_RUN` reason
- repair actions that depend on unsupported assumptions
- scope creep beyond the reported incident
- reliance on a single log fragment as if it were conclusive
## Support Label Rules
- `confirmed`: directly supported by multiple consistent evidence points, with no meaningful conflicting evidence currently visible.
- `likely`: supported by meaningful evidence, but at least one uncertainty or missing disconfirmation step remains.
- `possible`: plausible, but support is limited, indirect, or mostly inferential.
- `unknown`: not adequately supported by current evidence, or the evidence is too incomplete or conflicting to judge.
- `weakly-supported`: some evidence points in this direction, but the causal link is too thin for implementation without a narrower check.
- `unsupported`: asserted without concrete evidence in the current packet.
- `contradicted`: conflicts with observed evidence or a stronger confirmed fact.
Do not use any label other than `confirmed`, `likely`, `possible`, `unknown`, `weakly-supported`, `unsupported`, or `contradicted`.
## Output Format
```md
# Hypothesis Critic Assessment
## Evidence Basis
- Incident source:
- Evidence reviewed:
- Missing evidence:
- Limitations:
## Hypothesis Review
### Hypothesis 1
- Statement:
- Support label: confirmed | likely | possible | unknown | weakly-supported | unsupported | contradicted
- Implementation readiness: ready | needs narrower check | needs more evidence | blocked
- Supporting evidence:
- Weak or indirect evidence:
- Disconfirming evidence checked:
- Gaps or contradictions:
- Over-interpretation or scope-creep risk:
- Verdict:
- Required evidence or safest next step:
### Hypothesis 2
- Statement:
- Support label: confirmed | likely | possible | unknown | weakly-supported | unsupported | contradicted
- Implementation readiness: ready | needs narrower check | needs more evidence | blocked
- Supporting evidence:
- Weak or indirect evidence:
- Disconfirming evidence checked:
- Gaps or contradictions:
- Over-interpretation or scope-creep risk:
- Verdict:
- Required evidence or safest next step:
## Recommended Handoff
- Best current working hypothesis:
- Hypotheses that should not drive implementation yet:
- Unsupported, weakly-supported, or contradicted assumptions:
- Before-fix validation needed:
- After-fix validation expectation:
- Next recipient: planner | context-pack-builder | user for more evidence
- Notes for handoff:
```
## Guardrails
- Do not edit code.
- Do not implement or suggest a broad fix plan beyond the safest next step.
- Do not assume local reproduction exists or is required.
- Do not auto-capture logs or generate synthetic evidence.
- Do not treat a single stack trace line or log fragment as conclusive on its own.
- State uncertainty explicitly.
- Treat large code changes based on `possible`, `unknown`, `weakly-supported`, `unsupported`, or `contradicted` hypotheses as blocked unless the user explicitly accepts the risk and the task records the rationale.
- Prefer before-fix and after-fix validation evidence; when validation cannot be run, require a documented `NOT_RUN` reason and follow-up.
- Prefer disconfirming checks over confident speculation.
- Keep the output tied to the reported incident scope.
@@ -0,0 +1,193 @@
---
name: implementation-slicer
description: Convert a frozen requirement document or approved refactor scope into small implementation slices with file scope, modification order, validation commands, rollback notes, and done criteria. Use before coding non-trivial features or refactors.
phase: analysis
model_requirement: reasoning
can_edit: true
risk_level: medium
---
# Implementation Slicer
Use this skill to convert a requirement document into executable implementation slices.
## When To Use
- Use after requirements are frozen or refactor scope is approved.
- Use before coding non-trivial features or refactors that need bounded slices.
## Inputs Required
- Frozen requirement document or approved refactor scope
- Relevant boundary or workflow analysis when available
- Active task selection from `.task/active.json` when writing artifacts
## Steps
1. Read the requirement document or approved refactor scope.
2. Use module-inspector or workflow-inspector when module or workflow scope is unclear.
3. Identify the smallest safe implementation slices.
4. For each slice, define:
- goal
- allowed files, packages, or directories
- forbidden files, packages, or directories
- execution mode
- gate class
- risk score
- gate reasons
- dependencies and parallel eligibility when the task is complex
- validation level
- merge owner and conflict rule when shared files are involved
- steps
- validation command
- done criteria
- rollback notes
5. Create or update `.task/<task-id>/implementation-plan.md`, where `<task-id>` is read from `.task/active.json`.
6. Update `.task/<task-id>/state.json` if the caller asks you to record slices or gates.
7. Use the active task directory selected by `.task/active.json`.
8. Do not implement code.
## Output Artifact
- An implementation plan with bounded slices, validation guidance, and rollback notes in `.task/<task-id>/implementation-plan.md`
- Optional task state update only when the caller asks to record slices or gates
## Gate Class Rules
- Use only this frozen `gateClass` vocabulary: `simple`, `standard`, `boundary-sensitive`, `high-risk`.
- Emit `risk_score` as an integer from `1` to `5` for every slice or approved parallel group.
- Emit `gateReasons` as short reason labels that explain why the slice should pause or may continue under the selected policy.
- `risk_score` is stricter supplemental metadata, not a replacement for `gateClass`, required human gates, explicit stop conditions, or critic-required pauses.
- When `risk_score` indicates higher risk than `gateClass` alone, preserve or strengthen the stop posture rather than weakening it.
- Calibrate ordinary bounded `standard` slices toward `risk_score` 2-3 unless there is concrete elevated impact, reversibility concern, or validation uncertainty.
- Use `risk_score` 4-5 only when the slice itself carries elevated safety, compatibility, production, data, security, cross-boundary, or validation risk.
- Treat these as common higher-risk inputs when assigning or explaining `risk_score`: database schema updates, permissions or security logic, device communication, scheduling, externally committed public API compatibility, build or release scripts, code deletion, dependency upgrades, and production configuration.
## Output Document Template
```md
# <Task Name> Implementation Plan
## Requirement Source
## Scope Summary
## Involved Modules Or Areas
## Loaded Rules
## Loaded Docs
## Global Forbidden Scope
## Execution Strategy
- Complexity: simple | complex
- Default Execution: sequential
- Parallel Execution: optional | not-needed
- Fallback Execution: sequential
- Merge Owner:
- Conflict Resolution Rule:
## Slice Dependency Graph
| Slice | Depends On | Can Run In Parallel With | Fallback Order | Shared Files | Merge Owner | Conflict Risk |
| --- | --- | --- | --- | --- | --- | --- |
## Implementation Slices
### Slice 1: <Name>
#### Goal
#### Allowed Modification Scope
#### Forbidden Scope
#### Execution
- Mode: sequential | parallel-capable
- Depends On:
- Can Run With:
- Must Not Run With:
- Fallback Order:
- Shared Files:
- Merge Owner:
- Conflict Risk: low | medium | high
- Gate Class: simple | standard | boundary-sensitive | high-risk
- Risk Score: 1 | 2 | 3 | 4 | 5
- Gate Reasons:
- Validation Level: slice | group | final
- Recommended Agent Strategy:
#### Steps
#### Validation
#### Done Criteria
#### Rollback Notes
## Parallel Slice Groups
Use this section only for complex tasks that have independent work worth parallel planning.
### Group A: <Name>
#### Members
#### Parallel Eligibility
#### Sequential Fallback Order
#### Merge Rule
#### Conflict Resolution Rule
#### Group Validation
#### Group Done Criteria
## Final Validation
## Documentation Update Requirement
## Risks
```
## Guardrails
- Prefer small slices.
- Do not merge unrelated work into one slice.
- Do not implement code.
- Use `parallel-capable` planning only for complex tasks with independent scope and a clear sequential fallback.
- Do not mark shared-file work as `parallel-capable` unless the plan names a merge owner and conflict resolution rule.
- Do not expand the requirement scope.
- Include validation commands whenever possible.
- When recording slices in task state or plan artifacts, emit `gateClass`, `risk_score`, and `gateReasons` together.
- Do not use `risk_score` to replace `gateClass`, invent new gate classes, or relax structured artifact shape.
## Gate / Stop Condition
- Stop when requirement scope is still unstable or slice boundaries cannot be defined safely.
- Stop before coding or when planning would require expanding scope, changing the frozen `gateClass` vocabulary, or turning `risk_score` into a replacement for required gates.
## Red Flags
- Large or mixed-purpose slices
- Shared-file parallel work without a merge owner or conflict rule
- Missing validation guidance for risky changes
- Slice definitions that blur allowed versus forbidden scope
- Slice metadata that omits one of `gateClass`, `risk_score`, or `gateReasons`
- Numeric scoring framed as a substitute for human review or gate stops
## Exit Criteria
- Each slice has a clear goal and bounded modification scope
- Execution order, dependencies, and validation level are explicit
- Gate metadata uses existing `gateClass` vocabulary and includes supplemental `risk_score` plus `gateReasons`
- The plan is ready for context packing and coding handoff
## Handoff
- Hand the approved slice or parallel group, including `gateClass`, `risk_score`, `gateReasons`, validation guidance, and forbidden scope, to context-pack-builder or the coding workflow
@@ -0,0 +1,177 @@
---
name: incident-pack-builder
description: Organize user-provided incident evidence into `.task/<task-id>/incident.md` before code changes. Use for evidence-first bug investigations when symptoms, logs, screenshots, reports, configs, or field observations exist but the root cause is not yet confirmed.
phase: analysis
model_requirement: reasoning
can_edit: true
reads:
- AGENTS.md
- .task/active.json
- .task/<task-id>/state.json
- .task/<task-id>/context-pack.md
- user-provided evidence files and notes
writes:
- .task/<task-id>/incident.md
outputs:
- structured incident pack for hypothesis review and follow-up context building
risk_level: medium
---
# Incident Pack Builder
Use this skill to build `.task/<task-id>/incident.md` from user-provided evidence only. Read `<task-id>` from `.task/active.json`.
This skill prepares a clean incident handoff for later analysis, including `hypothesis-critic` and context-pack-building work. It does not implement fixes.
## Workflow
1. Read `AGENTS.md`.
2. Read `.task/active.json` and `.task/<task-id>/state.json`.
3. Read `.task/<task-id>/context-pack.md` if it exists.
4. Collect only the evidence the user or repository already provides, such as:
- symptoms and observed behavior
- environment, version, branch, deployment, or device context
- operation steps or reproduction notes
- logs, stack traces, crash reports, screenshots, or videos
- communication packets, payload samples, requests, or responses
- relevant config, flags, inputs, or data conditions
- initial analysis notes
- suspected modules, files, systems, or ownership hints
- explicit unknowns and contradictions
5. Normalize the evidence into a structured incident pack.
6. Separate confirmed facts from assumptions, hypotheses, proposed repair actions, and missing information.
7. Record reproduction status and evidence quality before recommending any code change.
8. Record missing evidence and on-site or user confirmations still needed.
9. Define the initial analysis scope and forbidden assumptions.
10. Recommend the smallest next analysis step, including before-fix validation when feasible.
11. Write `.task/<task-id>/incident.md`.
12. Do not edit code, configs, tests, or runtime scripts.
## Required Output Structure
Write the incident pack in this shape:
```md
# Incident Pack
## Incident Summary
## Current Status
- Evidence quality:
- Reproduction status: not attempted | user-reported only | partially observed | locally confirmed
- Scope confidence:
## Evidence Inventory
| Evidence | Source | What it supports | Confidence | Notes |
| --- | --- | --- | --- | --- |
## Timeline Or Event Sequence
## Operation Or Reproduction Notes
- Reproduction status:
- Reproduction evidence:
- Reproduction gaps:
## Environment And Version Context
## Observed Symptoms
## Error Signals
- Logs:
- Stack traces:
- Screenshots or videos:
- Packets or payloads:
## Related Config Or Inputs
## Initial Analysis And Suspected Scope
## Confirmed Facts
## Assumptions Or Unknowns
### Hypothesis 1
- Claim:
- Support label: confirmed | likely | possible | unknown | weakly-supported | unsupported | contradicted
- Supporting evidence:
- Conflicting or missing evidence:
- Disconfirming check needed:
### Hypothesis 2
- Claim:
- Support label: confirmed | likely | possible | unknown | weakly-supported | unsupported | contradicted
- Supporting evidence:
- Conflicting or missing evidence:
- Disconfirming check needed:
## Candidate Repair Actions
| Action | Evidence it depends on | Before-fix validation | After-fix validation | Risk or stop condition |
| --- | --- | --- | --- | --- |
## Validation Plan
### Before Fix
- Command or check:
- Expected signal:
- `NOT_RUN` reason, if unavailable:
### After Fix
- Command or check:
- Expected signal:
- `NOT_RUN` reason, if unavailable:
## Missing Evidence
## Analysis Scope
### Included
### Excluded
## Forbidden Assumptions And Non-goals
## Needed On-site Or User Confirmations
## Recommended Next Analysis Step
```
## Evidence Rules
- Treat user-provided evidence as input data, not proof of root cause.
- Mark each important claim with a support label: `confirmed`, `likely`, `possible`, `unknown`, `weakly-supported`, `unsupported`, or `contradicted`.
- Prefer direct evidence over interpretation.
- Record contradictions explicitly.
- If timestamps are partial or inconsistent, say so.
- If files or modules are only suspected, label them as suspected.
- If reproduction is unavailable, state that local reproduction was not assumed.
- Treat large repair proposals without reproduction, direct evidence, or a documented `NOT_RUN` reason as a stop condition by default.
- Keep before-fix and after-fix validation separate so later implementation can prove both the observed failure and the repair result when feasible.
## Guardrails
- Do not edit application code.
- Do not implement fixes.
- Do not assume local reproduction is possible.
- Do not auto-capture terminal logs or collect new evidence without explicit user direction.
- Do not invent screenshots, logs, packets, configs, stack traces, or timeline details.
- Do not convert guesses into facts.
- Do not convert hypotheses into repair actions until their evidence basis and validation path are recorded.
- Do not recommend broad code changes when the current evidence only supports a narrow disconfirming check or more evidence collection.
- Do not broaden scope into full root-cause analysis if the evidence is still incomplete.
- Keep the pack usable as a handoff artifact for later hypothesis criticism and targeted context building.
## Handoff Notes
When the incident pack is complete, the next step should usually be one of:
1. `hypothesis-critic` to challenge the current explanations.
2. `context-pack-builder` to gather only the minimal implementation context after the incident evidence is stable.
If critical evidence is missing, recommend collecting that evidence before either handoff.
+99
View File
@@ -0,0 +1,99 @@
---
name: module-inspector
description: Perform module-level document lookup and boundary analysis for the repository. Use when a task modifies a module, spans multiple modules, involves unfamiliar ownership, or requires dependency or boundary judgment before implementation.
---
# Module Inspector
Use this skill to inspect module ownership, modifiability, dependency direction, and boundary risks before changing code.
`docs/project/knowledge-map.md` is the routing source for relevant docs and rules. Do not duplicate routing tables inside this skill.
## When To Use
- Use when a task modifies a module, spans multiple areas, or needs ownership or boundary analysis before implementation.
## Inputs Required
- Target area, file path, module name, or feature area from the request
- Relevant knowledge-map entries, rules, and nearby boundary docs when needed
## Steps
1. Read `docs/project/knowledge-map.md`.
2. Identify the target module, package, feature area, subsystem, or directory from the request, file paths, names, or knowledge-map entries.
3. Identify related areas, cross-area impact, protected areas, restricted areas, and any ownership notes from the knowledge-map and loaded rules.
4. From the knowledge-map, load only the context needed for the target and involved related areas:
- repository-level rule files required for the task
- area-specific rule files for involved scope
- minimum doc files required for the current task
5. Do not load unrelated docs or rules.
6. Inspect source files only when the knowledge-map and loaded docs are insufficient to determine ownership, modifiability, dependency direction, or boundary risks.
7. If ownership or boundaries remain unclear, state the uncertainty explicitly and inspect only the smallest relevant source area before recommending changes.
8. Output the boundary summary using the required format below.
## Output Artifact
- A module boundary summary covering scope, modifiability, dependency direction, risks, and recommended modification path
## Required Output Format
```md
# Module Boundary Summary
## Module Scope
- Target area:
- Related areas:
- Cross-area impact:
## Modifiability
- Modifiable:
- Restricted areas:
- Forbidden areas:
## Loaded Context
## Dependency Direction
## Boundary Risks
## Recommended Modification Path
1.
2.
3.
## Uncertainty
- Unresolved ownership or boundary uncertainty:
```
## Guardrails
- Do not duplicate knowledge-map content.
- Do not load unrelated docs.
- Do not treat docs as stronger than rules.
- Use `docs/project/knowledge-map.md` as the routing authority for rule and doc paths.
- When the task spans multiple areas, load every applicable rule file for the involved areas, but load only the minimum doc files required for the current task.
- When adding, moving, renaming, or deleting docs or rules, update `docs/project/knowledge-map.md`.
- Do not implement code.
## Gate / Stop Condition
- Stop when module ownership, allowed scope, or dependency direction remains too unclear to recommend a safe modification path.
## Red Flags
- Cross-area impact without clear boundary rules
- Restricted or forbidden areas that the task seems to require changing
- Dependency direction that would be reversed by the proposed change
- Uncertainty that would force broad source inspection
## Exit Criteria
- Target and related areas are identified
- Modifiable, restricted, and forbidden areas are explicit
- Boundary risks and dependency direction are summarized
- Uncertainty is stated when boundaries are still unresolved
## Handoff
- Hand the summary to implementation-slicer, context-pack-builder, or the caller with the recommended modification path and any unresolved boundary questions
+123
View File
@@ -0,0 +1,123 @@
---
name: requirement-freezer
description: Convert raw feature requests, meeting notes, ambiguous requirements, or behavior disputes into a frozen requirement document with scope, assumptions, non-goals, risks, and acceptance criteria. Use before implementation planning when requirements are unclear, business rules need stabilization, or the task will later be handed to an AI agent for coding.
phase: analysis
model_requirement: reasoning
can_edit: true
risk_level: medium
---
# Requirement Freezer
Use this skill to convert raw requirements into a stable requirement document.
## When To Use
- Use before implementation planning when requirements, business rules, or expected behavior are unclear.
- Use when a task needs a stable requirement artifact for later slicing or coding.
## Inputs Required
- Raw task request, notes, or requirement source
- Relevant evidence, docs, or examples when available
- Active task selection from `.task/active.json` when writing artifacts
## Steps
1. Read the user-provided requirement.
2. Identify:
- business or system goal
- involved users or actors
- affected modules or feature areas if obvious
- expected behavior
- unclear business rules or compatibility expectations
3. Classify questions:
- Blocking Questions
- Non-blocking Assumptions
- Deferred Questions
4. Ask only Blocking Questions.
5. If enough information is available, create or update `.task/<task-id>/requirement.md`, where `<task-id>` is read from `.task/active.json`.
6. Update `.task/<task-id>/state.json` if the caller asks you to record the requirement gate.
7. Use the active task directory selected by `.task/active.json`.
8. Do not implement code.
9. Do not write an implementation plan.
## Output Artifact
- A frozen requirement document in `.task/<task-id>/requirement.md`
- Optional task state update only when the caller asks to record the gate
## Output Document Template
```md
# <Task Name> Requirement
## Goal
## Background
## In Scope
## Out Of Scope
## Current Behavior
## Required Behavior
## User Flow
## Business Rules
## Data Rules
## API Contract
## UI Requirements
## Compatibility Requirements
## Error Handling
## Permissions And Security
## Assumptions
## Risks
## Acceptance Criteria
## Deferred Questions
## Source Notes
```
## Guardrails
- Do not implement code.
- Do not invent business rules.
- Record assumptions explicitly.
- Keep requirements separate from implementation details.
- Ask only blocking questions.
## Gate / Stop Condition
- Stop and ask blocking questions when required behavior, scope, or acceptance criteria cannot be stabilized from available evidence.
- Stop before planning or coding.
## Red Flags
- Conflicting sources for expected behavior
- Unclear in-scope versus out-of-scope boundaries
- Missing acceptance criteria for a non-trivial change
- Hidden implementation decisions presented as requirements
## Exit Criteria
- Scope and non-goals are explicit
- Assumptions and deferred questions are recorded
- Acceptance criteria are stable enough for implementation slicing
- No code or implementation plan was produced
## Handoff
- Hand the frozen requirement to implementation-slicer or context-pack-builder together with any remaining deferred questions and relevant source notes
+224
View File
@@ -0,0 +1,224 @@
---
name: task-intake
description: Default lightweight entrypoint for non-trivial repository tasks, including feature development, bug fixing, refactoring, documentation updates, investigations, reviews, and workflow-sensitive work. Use when a new task starts and the Marionettist flow has not started yet; use fast path when structured task artifacts or a clearly scoped ongoing slice are already provided.
phase: analysis
model_requirement: reasoning
can_edit: true
risk_level: low
---
# Task Intake
Use this skill to collect task information and route the task into the lightweight file-based Marionettist workflow.
## When To Use
- Use when a new non-trivial repository task starts and the Marionettist flow has not started yet.
- Use the fast path when structured task artifacts or a clearly scoped ongoing slice already exist.
## Inputs Required
- User task goal and requested outcome
- Relevant repository constraints, paths, or evidence when available
- Existing task artifacts if the task is already in progress
## Fast Path
If the user already provides structured task artifacts or a clearly scoped ongoing slice, do not ask the full intake questions.
Structured task artifacts include:
- `.task/active.json`
- `.task/<task-id>/state.json`
- `.task/<task-id>/requirement.md`
- `.task/<task-id>/implementation-plan.md`
- `.task/<task-id>/context-pack.md`
Use the local task date for `<yyyy-MM-dd>`, for example `.task/2026-04-28/`.
For fast-path tasks:
1. Summarize the current task state.
2. Identify the next required Marionettist step.
3. Check and report existing gate policy state, including any visible `gatePolicy.selected`, config default, or effective task policy, instead of skipping policy state entirely.
4. If the task is resuming non-trivial work and policy selection is missing or ambiguous, ask only the blocking question needed to confirm the effective task policy when override is allowed.
5. Route directly to that step.
6. Ask only blocking questions needed for routing.
## Steps
1. Read `AGENTS.md`.
2. Read `marionettist.config.yaml` if present.
3. Classify the task type:
- feature
- bugfix
- refactor
- documentation
- review
- investigation
- build/deployment
4. Read `marionettist.config.yaml` gate policy defaults when present, especially `gatePolicy.defaultMode` and whether task-local override is allowed.
5. Explain the available gate policy choices for the task:
- `strict` for the most pause-heavy posture, especially for explicitly high-risk, boundary-sensitive, or critic-required work
- `balanced` for the normal middle posture for many non-trivial tasks with clear approved slices, including low/moderate-risk `standard` slices that should not pause after every slice
- `autonomous` only when the task is already well-bounded, validation is clear, and fewer mid-task pauses are acceptable
6. Recommend an initial gate policy for the task based on risk and workflow sensitivity, but make clear the recommendation is advisory rather than controlling.
7. Explain that a task-local gate policy selection changes only the task's gate posture. It does not bypass required analysis gates, critic-required routing, final approval by default, explicit stops, protected or dangerous command stops, or concrete elevated-risk `risk_score >= 4` stops. A `strict` recommendation is advisory and must not overwrite an explicit selected policy.
8. For non-trivial new tasks, ask for and capture the selected task gate policy when task-local override is allowed. If no explicit selection is provided, record the default or effective task policy instead of leaving policy state implicit.
9. Ask only the minimum blocking questions required to choose the next workflow.
10. Do not implement code.
11. Do not create large documents unless the task requires them.
12. For non-trivial new tasks, create a dated task directory and point `.task/active.json` to it.
13. Route to the correct next skill or workflow.
## Questions To Ask
### Common Questions
- What is the task goal?
- Which module, package, feature area, API, page, or workflow is involved?
- Is this a new feature, bug fix, refactor, investigation, documentation task, or review?
- Is the expected behavior already known?
- Are there files, logs, screenshots, APIs, or docs that must be used?
- Is any area forbidden to modify?
- What validation command or manual verification is expected?
### Feature Task Questions
- What user or system scenario should be supported?
- What is in scope?
- What is explicitly out of scope?
- Are UI, API, database, workflow, or infrastructure changes required?
- Are compatibility requirements involved?
### Bugfix Task Questions
- What is the observed behavior?
- What is the expected behavior?
- How can the issue be reproduced?
- Is there an error log or stack trace?
- Is the bug stable or intermittent?
- Which version, branch, environment, customer, or deployment context is affected?
- Is this a regression?
### Refactor Task Questions
- What problem should the refactor solve?
- What behavior must remain unchanged?
- What areas are allowed to change?
- What areas are forbidden to change?
## Routing Rules
### Feature
Use:
1. requirement-freezer when scope, business rules, or expected behavior are unclear
2. module-inspector or workflow-inspector when boundaries or flows need analysis
3. implementation-slicer
4. context-pack-builder
5. coding
6. boundary-reviewer
### Bugfix
Use:
1. bug intake section in this skill
2. workflow-inspector if call chain or runtime flow is unclear
3. module-inspector if module boundary is unclear
4. requirement-freezer only when expected behavior or business rule is unclear
5. context-pack-builder
6. coding
7. boundary-reviewer
### Refactor
Use:
1. module-inspector
2. workflow-inspector if behavior flow may be affected
3. implementation-slicer
4. context-pack-builder
5. coding
6. boundary-reviewer
### Documentation
Use:
1. workspace-knowledge-manager
2. update `docs/project/knowledge-map.md` when docs or rules are added, moved, renamed, or deleted
## Output Artifact
- A compact intake result that captures task type, current understanding, gate policy recommendation, gate policy selection or effective default, blocking questions, assumptions, and the recommended next step
- Task artifacts only when the task requires initialization or the caller asks for them
## Output Format
```md
# Task Intake Result
## Task Type
## Current Understanding
## Gate Policy
- config/default:
- allowTaskOverride:
- recommended:
- selected:
- reason or override reason:
- effective:
- finalApprovalRequired:
## Blocking Questions
## Non-blocking Assumptions
## Recommended Next Step
## Suggested Prompt For Next Step
```
## Guardrails
- Ask only blocking questions.
- Do not implement code.
- Do not generate full implementation plans directly.
- Keep the intake lightweight.
- Prefer repository evidence over asking the user when possible.
- Recommend a gate policy at task start for non-trivial work, but keep the recommendation advisory.
- Do not classify work as Tier L merely because it is non-trivial. Prefer Tier M for clear, bounded bugfixes, features, refactors, docs, or config work without cross-boundary ambiguity or sensitive production/security/compatibility impact.
- Treat Tier S as available for clearly scoped localized low-risk work such as typo/comment fixes, docs-only corrections, small tests/examples, harmless config text changes, or localized one-file fixes with no boundary ambiguity.
- Record gate policy state for non-trivial work even on fast path; do not leave selected/default/effective policy implicit when the evidence is available.
- Treat Tier L / Tier M references here as existing Marionettist task classification guidance only, not as a configurable tier-policy mapping.
- Preserve final approval by default unless higher-priority instructions explicitly change it.
- Treat task override as policy selection, not as permission to bypass required gates.
- Keep Marionettist gate policy separate from OpenCode permission settings.
- Do not imply that balanced or autonomous bypasses analysis, critic-required review, final approval, explicit stops, protected or dangerous command handling, or concrete elevated-risk `risk_score >= 4` pauses.
## Gate / Stop Condition
- Stop and ask blocking questions when the goal, task type, or safe next workflow cannot be determined from available evidence.
- Stop before coding, implementation planning, or broad document creation.
## Red Flags
- Missing task goal, scope, or validation expectation
- Conflicting instructions about allowed or forbidden areas
- Fast-path artifacts that disagree about current slice or gate status
- Requests that implicitly skip required Marionettist steps
## Exit Criteria
- The next Marionettist step is identified
- Blocking questions are minimized and explicit
- Recommended gate policy is stated for non-trivial work
- Selected/default/effective gate policy state is captured for non-trivial work
- The task is routed without implementing code
## Handoff
- Send the task to the next skill with the intake result, task type, known scope, open blocking questions, and the recorded gate policy state, including recommended, selected, reason or override reason, and effective policy when available
+133
View File
@@ -0,0 +1,133 @@
---
name: test-strategy
description: Select a task-appropriate validation strategy before coding or validation handoff. Use to recommend evidence, automated tests, manual checks, or NOT_RUN conditions based on task type, change risk, and environment limits without mandating global TDD.
phase: analysis
model_requirement: reasoning
can_edit: false
reads:
- task goal, task type, scope, and allowed slice
- requirement, implementation, context-pack, or incident artifacts when available
- relevant risk notes, reproduction steps, and validation constraints
writes: []
outputs:
- selected validation strategy by task type and risk
- required evidence and validation approach for planner, context-pack, coder, or validator handoff
- commands, manual checks, or NOT_RUN conditions with reasons
risk_level: medium
---
# Test Strategy
Use this skill to choose a proportionate validation strategy for the current task or slice.
## When To Use
- Use before coding when validation expectations are unclear or disputed.
- Use during planning or context building to define the expected evidence for implementation and validation handoff.
- Use when the task needs nuanced guidance instead of a blanket failing-test-first rule.
## Inputs Required
- Task type, goal, and approved slice or scope
- Expected behavior, reproduction steps, or incident evidence when available
- Change risk, affected areas, and environmental constraints
- Known validation options such as automated checks, smoke checks, manual checks, mocks, simulators, or protocol-level verification
## Steps
1. Identify the task type and the kind of behavior being changed.
2. Identify the main risks: regression, hidden state, permission boundaries, event ordering, hardware or environment dependence, or purely presentational change.
3. Choose the lightest strategy that still produces credible evidence.
4. Apply task-type guidance:
- **bugfix**: prefer clear reproduction and ideally a failing test first when practical.
- **algorithms, state machines, permissions, event bus behavior**: strongly prefer automated tests.
- **UI styling or configuration-only changes**: smoke checks or documented manual verification can be acceptable when behavior risk is low.
- **hardware communication**: prefer mocks, simulators, or protocol-level testing over fragile live-device dependence when possible.
- **incidents**: require evidence-first analysis before code changes.
5. Decide what evidence is required before implementation can be considered safe enough to proceed.
6. Define the validation approach for the current slice:
- automated tests
- smoke checks
- manual verification
- environment-constrained `NOT_RUN` with reason
- stop and ask for more evidence
7. Record commands or manual checks only when they are actually known.
8. List risks, limits, and stop conditions that should block weak validation.
## Output Artifact
- A compact test-strategy recommendation usable by planner, context-pack-builder, coder, or validator handoff
## Output Format
```md
# Test Strategy
## Selected Strategy
- Task type:
- Change type:
- Strategy summary:
## Required Evidence
- Reproduction or baseline evidence:
- Behavior that must be protected:
- Risk-sensitive areas:
## Validation Approach
- Automated tests:
- Smoke checks:
- Manual checks:
- Environment dependencies:
## Commands Or Checks
- Command 1:
- Manual check 1:
## NOT_RUN Conditions
- Check:
- Reason:
- Required follow-up:
## Risks / Stop Conditions
-
## Handoff Notes
- For planner/context-pack:
- For coder:
- For validator:
```
## Gate / Stop Condition
- Stop when no credible validation path can be defined from the current evidence and constraints.
- Stop when the task appears to need incident evidence, reproduction detail, or boundary clarification before test strategy can be chosen safely.
- Stop when the only available validation would create false confidence for a high-risk behavior change.
## Red Flags
- Treating all tasks as if they require the same testing pattern
- Using manual checks alone for logic with hidden state, ordering, permissions, or non-trivial regressions
- Skipping reproduction or evidence collection for a bugfix or incident without a clear reason
- Accepting a weak smoke check for behavior that needs deterministic automated coverage
- Claiming validation is complete without documenting environment limits or NOT_RUN reasons
## Exit Criteria
- The selected strategy matches task type and risk
- Required evidence is explicit
- Validation expectations are concrete enough for handoff
- Any NOT_RUN condition is justified with a reason and follow-up expectation
- No global TDD mandate is introduced
## Handoff
- Hand the strategy to planner, context-pack-builder, coder, or validator with the selected approach, required evidence, known commands or manual checks, NOT_RUN conditions, and risks or stop conditions
## Guardrails
- Keep the guidance stack-agnostic and project-neutral.
- Prefer proportionate evidence over rigid process mandates.
- Do not require failing tests first when the environment or task shape makes that impractical, but say so explicitly.
- Do not weaken validation for high-risk logic, permission, state, or event-ordering work.
- Do not name specific test frameworks unless a caller explicitly asks for stack-specific guidance.
- Do not implement code or invent commands that are not grounded in the task context.
+100
View File
@@ -0,0 +1,100 @@
---
name: workflow-inspector
description: Analyze repository flows, execution chains, orchestration paths, event-driven behavior, and frontend-backend integration paths. Use when a task involves process design, workflow-sensitive behavior, call-chain analysis, or cross-boundary flow impact.
---
# Workflow Inspector
Use this skill to inspect execution chains and workflow impact. It should output workflow context, not a full implementation plan.
## When To Use
- Use when the task is mainly about execution flow, call chain, orchestration, event-driven behavior, or cross-boundary workflow impact.
## Inputs Required
- Known entrypoint clues such as routes, jobs, actions, listeners, or integration boundaries
- Relevant docs, rules, filenames, or task evidence when available
## Steps
1. Identify the likely functional entrypoint:
- controller, route, or API endpoint
- service or use case entrypoint
- stage, job, worker, or task runner
- event publisher or event listener
- frontend action or state transition
- integration or message boundary
2. Read `docs/project/knowledge-map.md` when ownership, cross-area scope, or relevant docs/rules routing is unclear.
3. Load only docs and rules relevant to the identified flow and involved areas.
4. Do not duplicate knowledge-map indexes inside this skill.
5. Inspect source files only after identifying the likely area and flow boundary.
6. Output workflow context only.
7. If the entrypoint or flow cannot be determined from docs and filenames, state the uncertainty explicitly and inspect the smallest relevant source area.
## Output Artifact
- A workflow inspection result covering the entrypoint, execution chain, involved areas, impact range, risks, and uncertainty
## Required Output Format
```md
# Workflow Inspection Result
## Entrypoint
## Execution Chain
## Involved Areas
## Key Nodes
## Impact Range
## Recommended Modification Order
## Risks And Boundary Constraints
## Uncertainty
```
## Boundary With Other Skills
- Use module-inspector when the task is mainly about area ownership or modifiability.
- Use workflow-inspector when the task is mainly about execution flow, call chain, orchestration, event-driven behavior, or frontend-backend integration.
- If both apply:
1. Use workflow-inspector to identify the execution chain.
2. Use module-inspector only for areas that need modification.
- This skill should output workflow context, not a full implementation plan.
- Use implementation-slicer after this skill if coding is required.
## Guardrails
- Do not create code indexes.
- Do not inspect unrelated flows.
- Do not produce a full implementation plan.
- Use implementation-slicer after this skill if coding is required.
- Do not implement code.
## Gate / Stop Condition
- Stop when the likely entrypoint or execution chain cannot be identified safely from available evidence.
- Stop before turning workflow analysis into a plan or code change.
## Red Flags
- Multiple plausible entrypoints with no strong evidence
- Workflow changes that cross protected or unfamiliar boundaries
- Analysis drifting into broad code indexing or implementation planning
- Missing rules for integration or orchestration boundaries
## Exit Criteria
- The likely entrypoint and execution chain are summarized
- Involved areas and impact range are bounded
- Risks and boundary constraints are explicit
- Uncertainty is recorded where the flow is still unresolved
## Handoff
- Hand the workflow summary to module-inspector, implementation-slicer, context-pack-builder, or the caller depending on the next approved step
@@ -0,0 +1,299 @@
---
name: workspace-knowledge-manager
description: Build and maintain project design knowledge docs, architecture docs, boundary rules, and knowledge-map routing for frontend, backend, fullstack, monorepo, multi-module, and single-module projects. Use for initializing project docs, refreshing architecture knowledge, or reviewing whether code changes require docs/rules updates.
---
# Workspace Knowledge Manager
Use this skill to create and maintain design-oriented project knowledge.
This skill must not create code index directories or exhaustive source inventories. Code lookup belongs to IDE tools, MCP tools, local search, and direct source inspection.
## Question Classification
Classify uncertainty before writing docs or rules.
### Blocking Questions
Use for unknowns that affect correctness, ownership, scope, terminology, or rule enforceability.
- These questions must stop the workflow.
- Wait for user clarification before writing docs or rules.
### Non-blocking Assumptions
Use when the likely answer can be inferred from code, docs, rules, naming, or existing patterns without creating correctness risk.
- Record these assumptions explicitly in the output.
- Continue after recording them.
### Deferred Questions
Use for helpful follow-up questions that do not affect the current docs or rules correctness.
- These questions must not stop the workflow.
- List them as follow-up items in the output.
## Modes
Before choosing document depth, read `marionettist.config.yaml` when it exists and capture:
- `knowledge.mode`: `standard` or `mudball`
- `knowledge.maturity`: `L0` through `L4`
Use those values as posture defaults, not as hard blockers.
### Knowledge Mode And Maturity
`knowledge.mode` sets the documentation starting point:
- `standard`: balance current-state explanation with design intent
- `mudball`: document present-day behavior first, especially entrypoints, call paths, implicit rules, risk zones, unknowns, and safe-change advice
`knowledge.maturity` scales documentation depth and governance:
- **L0**: minimal capture; create only task-relevant or high-risk docs
- **L1**: current-state map; prioritize present-day behavior and practical safe-change guidance
- **L2**: reusable area knowledge; maintain stable routing and important current/target docs
- **L3**: governed knowledge; stronger docs/rules sync and clearer ownership notes
- **L4**: strict governance; curated high-trust docs and stronger expectations for validation-linked updates
Mudball projects should not be pushed toward L3/L4 by default. L0-L1 are valid adoption levels, and L2 is a reasonable gradual-improvement target.
### init
Use when a project is first connected to Marionettist.
1. Inspect project configuration and high-level structure.
2. Read `marionettist.config.yaml` if present and note `knowledge.mode` and `knowledge.maturity`.
3. Identify architecture shape:
- frontend
- backend
- fullstack
- library
- monorepo
- multi-module
- single-module
- unknown
4. Identify major design areas, functional domains, workflows, and high-risk boundaries.
5. Create or update `docs/project/knowledge-map.md`.
6. For `knowledge.mode: mudball`, prefer `docs/current/` and present-day evidence before any target-state documentation.
7. Scale output by maturity:
- `L0-L1`: start small; avoid broad documentation mandates
- `L2`: create reusable area docs only for meaningful boundaries
- `L3-L4`: include stronger ownership, drift, and sync guidance where appropriate
8. Create only high-value design docs and rule files.
9. Do not create one doc per directory unless each directory represents a real design boundary.
10. Keep docs and rules non-overlapping.
### refresh
Use for periodic maintenance.
1. Compare current project behavior, structure, and docs.
2. Update docs only when design meaning changed.
3. Update rules only when enforceable constraints changed.
4. Update knowledge-map routing when docs or rules were added, moved, renamed, or deleted.
5. Keep terminology consistent across docs, rules, and knowledge-map entries.
6. Scale the refresh depth to `knowledge.maturity`; low-maturity projects can keep lighter docs if unknowns remain explicit.
### review
Use after code changes or before review.
1. Inspect the diff.
2. Decide whether changes affect:
- architecture
- public behavior
- feature design
- workflow
- domain concepts
- module or directory boundaries
- extension points
- operational or compatibility constraints
3. Output one of:
- `Docs Update Required`
- `Rules Update Required`
- `No Knowledge Update Needed`
4. Do not update docs automatically unless the user asks for updates.
5. Consider `knowledge.mode` and `knowledge.maturity` before recommending missing documentation; do not impose L3/L4 standards on L0-L1 or mudball projects by default.
### topic
Use when the user asks for documentation of a specific feature, workflow, subsystem, or architecture concern.
The target does not need to be a module.
## Docs vs Rules Separation Policy
### Core Principle
- Docs = explain
- Rules = enforce
### Docs Scope
Docs should explain:
- responsibilities and design intent
- architecture and dependency direction
- domain concepts and terminology
- workflows and state transitions
- extension points
- boundary context and risk areas
- compatibility or migration meaning at a high level
Docs must not include:
- rule-style MUST or MUST NOT directives unless needed as brief high-level context
- line-by-line implementation explanation
- source-code indexes, inventories, or generated navigation tables
- content already fully covered by rules
### Rules Scope
Rules should define enforceable constraints:
- MUST and MUST NOT behavior
- boundary constraints
- dependency direction
- forbidden coupling
- required validation
- compatibility guarantees
- documentation sync triggers
Rules must not include:
- narrative background
- broad architecture explanation
- duplicated explanatory content already present in docs
### Strict Requirements
1. No duplication:
- the same content must not appear in both docs and rules
2. Conflict resolution:
- rules take priority
- docs may keep only high-level explanation
3. Routing consistency:
- when docs or rules are created, moved, renamed, or deleted, update `docs/project/knowledge-map.md`
## Document Scope
Docs should explain:
- product or system capability
- design intent
- architecture and dependency direction
- domain concepts and terminology
- request, event, or task workflows
- state transitions and lifecycle
- extension patterns
- integration boundaries
- compatibility and migration concerns
- high-risk areas and why they are risky
Docs must not include:
- file trees
- class inventories
- function lists
- controller/service/repository mechanical lists
- line-by-line implementation explanation
- information easily recoverable through IDE search
- generated indexes of source locations
- maturity-driven busywork that exceeds the project's configured posture
## Rules Scope
Rules should define enforceable constraints:
- MUST and MUST NOT behavior
- boundary constraints
- dependency direction
- forbidden coupling
- required validation
- compatibility guarantees
- documentation sync triggers
Rules must not include narrative background or broad architecture explanation.
## Knowledge Map Scope
`docs/project/knowledge-map.md` routes design knowledge.
Each entry should include:
- knowledge docs
- rule files
- scope
- when to read
- boundary notes
Do not include every file, class, function, or symbol.
Keep routing proportional to maturity:
- `L0-L1`: enough routing to reach the right current-state docs and rules
- `L2`: stable routing for important areas
- `L3-L4`: clearer ownership, boundary, and validation routing where the project depends on that discipline
## Output Format
When creating or updating docs:
```md
# Workspace Knowledge Result
## Mode
## Knowledge Mode
## Knowledge Maturity
## Project Shape
## Created Or Updated Docs
## Created Or Updated Rules
## Knowledge Map Changes
## Blocking Questions
## Assumptions
## Deferred Questions
## Validation Notes
```
When reviewing docs impact:
```md
# Knowledge Review Result
## Recommendation
## Design Impact
## Rules Impact
## Knowledge Map Impact
## Required Updates
## No-Update Rationale
```
## Guardrails
- Base docs on actual behavior and source evidence.
- In mudball mode, prefer current-state evidence over idealized design.
- Prefer fewer, higher-value documents over many shallow documents.
- Ask blocking questions only when design meaning or boundary ownership cannot be inferred.
- Keep docs useful for human and agent understanding.
- Keep code navigation out of docs.
- Keep docs and rules non-overlapping.
- Update `docs/project/knowledge-map.md` whenever routing changes.
- Do not use maturity to force unnecessary docs volume or L3/L4 governance on low-maturity projects.