بنقرة واحدة
mu-scope
Use before mu-arch to scope work — enumerate use cases, detect conflicts, assess impact on existing code.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use before mu-arch to scope work — enumerate use cases, detect conflicts, assess impact on existing code.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Use when code changes need review, verification, and integration - covers review dispatch, feedback handling, verification gates, and merge/PR workflow
Use before any creative engineering work to design technical architecture — components, interfaces, data flow, error handling. For product/UX requirements (user flows, feature specs), use mu-prd first.
Use when user wants to generate or maintain project-level architecture documentation. Two modes: generate (full wiki creation from codebase analysis) and update (incremental maintenance via git diff). On-demand only — never auto-routed by mu-route.
Use at the start of any unprefixed user message within DevMuse's domain (dev or product work) to route to the right skill. Confidence-based: high confidence invokes silently, medium gives a one-line proposal, low gives full proposal with override options. Bypassed by direct slash invocations (`/mu-<skill>`).
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Use when validating a business premise or defining product strategy (market, BMC, VPC, personas, MVP scope). Two modes: quick (4 forcing questions) or full (comprehensive analysis).
| name | mu-scope |
| description | Use before mu-arch to scope work — enumerate use cases, detect conflicts, assess impact on existing code. |
Scope work by enumerating use cases, detecting conflicts, and assessing impact on existing code. Produces a Use Case Set that feeds into mu-arch.
Start by probing the codebase for impact, then work with the user to exhaust scenarios and resolve conflicts.
Do NOT invoke mu-arch or any implementation skill until you have a complete Use Case Set approved by the user. This applies to EVERY task regardless of perceived simplicity.Every task goes through scoping. A bug fix, a config change, a one-liner — all of them. "Simple" tasks are where omissions cause the most wasted work. The scope can be a single use case (30 seconds), but you MUST produce it and get approval.
You MUST create a task for each of these items and complete them in order:
docs/scope/YYYY-MM-DD-<name>.md, user confirmsdigraph mu_scope {
"Quick Probe\n(inline, automatic)" [shape=box];
"New/empty project?" [shape=diamond];
"Skip probe" [shape=box];
"Present probe results\n+ depth recommendation" [shape=box];
"User confirms depth" [shape=box];
"Enumerate happy paths" [shape=box];
"User confirms/supplements" [shape=diamond];
"Enumerate edge cases" [shape=box];
"Enumerate error cases" [shape=box];
"Cross-check all use cases\nfor conflicts" [shape=box];
"Conflicts found?" [shape=diamond];
"User resolves conflicts" [shape=box];
"Write scope artifact" [shape=box];
"User approves scope?" [shape=diamond];
"Invoke mu-arch" [shape=doublecircle];
"Quick Probe\n(inline, automatic)" -> "New/empty project?";
"New/empty project?" -> "Skip probe" [label="yes"];
"New/empty project?" -> "Present probe results\n+ depth recommendation" [label="no"];
"Skip probe" -> "Enumerate happy paths";
"Present probe results\n+ depth recommendation" -> "User confirms depth";
"User confirms depth" -> "Enumerate happy paths";
"Enumerate happy paths" -> "User confirms/supplements";
"User confirms/supplements" -> "Enumerate edge cases" [label="ok"];
"User confirms/supplements" -> "Enumerate happy paths" [label="revise"];
"Enumerate edge cases" -> "Enumerate error cases";
"Enumerate error cases" -> "Cross-check all use cases\nfor conflicts";
"Cross-check all use cases\nfor conflicts" -> "Conflicts found?";
"Conflicts found?" -> "User resolves conflicts" [label="yes"];
"Conflicts found?" -> "Write scope artifact" [label="no"];
"User resolves conflicts" -> "Write scope artifact";
"Write scope artifact" -> "User approves scope?";
"User approves scope?" -> "Write scope artifact" [label="changes requested"];
"User approves scope?" -> "Invoke mu-arch" [label="approved"];
}
The terminal state is invoking mu-arch. Do NOT invoke any other skill. The ONLY skill you invoke after mu-scope is mu-arch.
Before asking the user anything, scan the codebase to understand what this change touches.
Premise check: Before scanning the codebase, check if any of these artifacts exist (any one satisfies the gate):
docs/premise/*.md (legacy premise artifact)docs/biz/*.md (biz artifact from mu-biz quick or full mode)docs/prd/*.md (PRD artifact from mu-prd)If any found, skip the premise check. If none found, run a lightweight premise check (3 questions from @../../knowledge/principles/premise-check.md — skip Q4). If the user provides strong evidence immediately, pass quickly. If the user says "just do it" after 3 rounds without substantive answers, flag "Premise not validated — proceeding at user's request" and continue.
Skip if: The project is new (empty codebase) or user explicitly says "new project."
Checks:
| Check | Method | What it reveals |
|---|---|---|
| Locate code | grep/glob for keywords from user's description | What files are involved |
| Fan-out | Count callers of affected functions/modules | Blast radius |
| Test coverage | Find existing tests for affected code | Safety net status |
| Historical signals | git log for recent changes and bug fixes | Stability of affected area |
| Interface risk | Check if change affects public API/contracts | Breaking change potential |
| Guard semantics | If modifying a condition/filter/guard, enumerate ALL scenarios it currently blocks | Regression gap from condition replacement |
| Architecture context | Read architecture doc (README, ARCHITECTURE.md, docs/); map change onto components | Which layers/boundaries are affected |
Architecture context (see @../../knowledge/principles/architecture-assessment.md Phase 1): Read the project's architecture doc if one exists. Identify which components/layers the proposed work touches, whether it crosses architectural boundaries, and whether new components are needed. This is a coarse 2-minute assessment, not a detailed diagram — that comes in mu-arch.
Guard Semantic Analysis (when the change modifies/replaces an existing condition, filter, or guard):
A single condition often carries multiple implicit responsibilities. Replacing it to fix one scenario can silently drop protection for others. Before proposing a replacement:
Guard Analysis: <condition being replaced>
Old condition blocks: [scenario A, scenario B, scenario C]
New condition blocks: [scenario A]
Regression gap: [scenario B, scenario C]
→ scenario B: [intentionally allowed / must still block]
→ scenario C: [intentionally allowed / must still block]
Output to user:
Quick Probe Results:
- Files: [list]
- Fan-out: [N callers / M dependents]
- Test coverage: [summary]
- Guard analysis: [if applicable — gap items requiring disposition]
- Architecture impact: [components affected, boundaries crossed, new components needed]
- Risk: [low/medium/high]
Recommendation: [quick scope (2-3 use cases) / full enumeration]
- Wiki: [if risk >= medium AND docs/wiki/_index.md does not exist] "项目暂无架构 wiki,建议 `/mu-wiki generate`"
Present the probe results and recommend a depth level. The user confirms or overrides.
Work through scenarios with the user, one category at a time.
Methodology (migrated from mu-arch):
Order: Happy paths first (establish the core), then edge cases (expand boundaries), then error cases (handle failures), then reverse cases (what must NOT happen).
Reverse use cases: For every new behavior introduced, ask: "What existing behavior must remain unchanged?" Frame these as negative assertions:
- UC-R1: When <scenario that worked before>, Then <must still behave the same way>
This catches regressions that positive use cases miss — especially when replacing conditions/guards.
Present each category, get user confirmation before moving to the next.
Use case format:
- UC-<N>: [Given <precondition>] When <action> Then <expected result>
Simple cases can omit Given:
- UC-1: When user logs in with valid credentials, Then return JWT and redirect to dashboard
Complex cases include Given:
- UC-3: Given password expired, When user logs in, Then force password reset flow
After all use cases are enumerated, cross-check every pair for contradictions.
What to look for:
Format:
- ⚠️ CONFLICT: UC-X vs UC-Y — <description of contradiction>
- Resolution: <user decision> | PENDING
All conflicts must be resolved before proceeding. Present each conflict, let the user decide. No PENDING items in the final artifact.
Write the Use Case Set to docs/scope/YYYY-MM-DD-<name>.md using the template at @../../knowledge/templates/scope.md.
Commit the file, then ask the user to review:
"Scope written and committed to
<path>. Please review and let me know if you want changes before we proceed to design."
Wait for confirmation.
docs/scope/YYYY-MM-DD-<name>.md