一键导入
kn-plan
Use when creating an implementation plan for a task
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating an implementation plan for a task
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when orchestrating a full Knowns spec or task wave through planning, implementation, review, integration, and verification, optionally using sub-agents when scopes are parallel-safe.
Use when you need to understand existing code, find patterns, search project knowledge, use web research for external/current facts, or explore a large codebase before implementation
Use when committing code changes with proper conventional commit format and verification
Use when working with Knowns documentation - viewing, searching, creating, or updating docs
Use when extracting reusable patterns, decisions, failures, or knowledge into documentation
Use only when the user explicitly wants the legacy no-review-gates pipeline for an approved spec; prefer kn-flow for normal spec orchestration
| name | kn-plan |
| description | Use when creating an implementation plan for a task |
Announce: "Using kn-plan for task [ID]."
Core principle: GATHER CONTEXT → PLAN → VALIDATE → WAIT FOR APPROVAL.
--new "<work summary>" for direct task creation, or --from @doc/<spec-path> for SDD task generation@task-, @doc/, and @template/ ref before finalizing the plan/kn-flow @doc/<spec-path> instead of planning one task at a timeCheck if $ARGUMENTS contains --from:
/kn-flow @doc/<spec-path> after approval when the goal is execution.$ARGUMENTS contains --new
Use this mode when the work is too small for a spec or the user has a work summary but no task ID yet.
When $ARGUMENTS contains --new "<work summary>":
Announce: "Using kn-plan to create and plan a new task."
Extract the work summary and classify the lane:
tiny for narrow docs/copy/config/low-risk bug fixesnormal for story-sized work with bounded impacthigh-risk only when the summary touches auth, authorization, data migration/loss, external providers, public contracts, security/audit, or broad cross-module behaviorIf the work is high-risk, stop and recommend /kn-spec unless the user explicitly asked to bypass spec creation.
For tiny/normal work, create the task first:
mcp_knowns_tasks({ "action": "create", "title": "<short task title>",
"description": "<work summary>",
"priority": "medium",
"labels": ["<lane>"]
})
If the work needs a short reusable note or convention, create/update the supporting doc or memory before planning and reference it in the task description or plan.
Use the returned taskId as $ARGUMENTS and continue with Normal Planning Flow.
In the final response, include both:
mcp_knowns_tasks({ "action": "get", "taskId": "$ARGUMENTS" })
mcp_knowns_tasks({ "action": "update", "taskId": "$ARGUMENTS",
"status": "in-progress",
"assignee": "@me"
})
mcp_knowns_time({ "action": "start", "taskId": "$ARGUMENTS" })
Follow refs in task:
mcp_knowns_docs({ "action": "get", "path": "<path>", "smart": true })
mcp_knowns_tasks({ "action": "get", "taskId": "<id>" })
If the task links to a spec, use structural resolve to find related tasks and dependencies:
mcp_knowns_search({ "action": "resolve", "ref": "@doc/<spec-path>{implements}", "direction": "inbound", "entityTypes": "task" })
Search related (unified search includes docs and memories):
mcp_knowns_search({ "action": "search", "query": "<keywords>", "type": "doc" })
mcp_knowns_search({ "action": "search", "query": "<keywords>", "type": "memory" })
mcp_knowns_templates({ "action": "list" })
If relevant memories appear, factor them into the plan (past patterns, decisions, conventions).
If the plan needs assembled execution context rather than raw search hits, use retrieval after discovery:
mcp_knowns_search({ "action": "retrieve", "query": "<keywords>" })
If MCP is unavailable, fall back to CLI: knowns retrieve "<keywords>" --json
Use search for discovery. Use retrieve when you need ranked candidates plus a context pack with citations.
## Implementation Plan
1. [Step] (see @doc/relevant-doc)
2. [Step] (use @template/xxx)
3. Add tests
4. Update docs
Tip: Use mermaid for complex flows:
```mermaid
graph LR
A[Input] --> B[Process] --> C[Output]
```
Plan quality rules:
mcp_knowns_tasks({ "action": "update", "taskId": "$ARGUMENTS",
"plan": "1. Step one\n2. Step two\n3. Tests"
})
CRITICAL: After saving plan with refs, validate to catch broken refs:
mcp_knowns_validate({ "entity": "$ARGUMENTS" })
If errors found (broken @doc/... or @task-...), fix before asking approval.
Before presenting the plan for approval, verify plan quality:
Report any issues found inline with the plan:
Plan for task-<id>:
1. Step one
2. Step two
⚠️ Plan check: AC-3 not covered by any step
⚠️ Plan check: Step 4 touches 7 files — consider splitting
Fix issues before presenting for approval. If unfixable, surface them explicitly so the user can decide.
Present plan and WAIT for explicit approval.
All built-in skills in scope must end with the same user-facing information order: kn-init, kn-spec, kn-flow, kn-plan, kn-research, kn-implement, kn-verify, kn-doc, kn-template, kn-extract, and kn-commit.
Required order for the final user-facing response:
Keep this concise for CLI use. Skill-specific content may extend the key-details section, but must not replace or reorder the shared structure.
Out of scope: explaining, syncing, or generating .claude/skills/*. Runtime auto-sync already handles platform copies, so this skill source only defines the built-in output contract.
For kn-plan, the key details should cover:
You MUST suggest the next action when a natural follow-up exists. User won't know what to do next.
After user approves the plan:
Plan approved! Ready to implement.
Run: /kn-implement $ARGUMENTS
If the plan is part of an active /kn-flow, return control to that flow so the task can be implemented, reviewed, and verified in schedule order.
If user wants to review first:
Take your time to review. When ready:
Run: /kn-implement $ARGUMENTS
/kn-flow @doc/<spec-path> - Orchestrate an approved spec or task wave after tasks exist/kn-research - Research before planning/kn-implement <id> - Implement after plan approved/kn-spec - Create spec for complex features/kn-plan --new "<work summary>" - Create a direct task before planning--new/kn-flow when appropriate--new request is high-risk -> recommend /kn-spec instead of creating a vague task/kn-flow @doc/<spec-path> instead of serial manual planningWhen $ARGUMENTS contains --from @doc/<spec-path>:
Announce: "Using kn-plan to generate tasks from spec [name]."
Extract the exact spec path from arguments:
--from @doc/specs/2026-06-17/user-auth → specs/2026-06-17/user-auth--from @doc/specs/user-auth are still valid if that spec already exists.mcp_knowns_docs({ "action": "get", "path": "<spec-path>", "smart": true })
Derive a task prefix from the spec path:
specs/2026-06-17/user-auth, use [user-auth-NN].specs/user-auth, also use [user-auth-NN].NN zero-padded (01, 02, 03) so task titles sort correctly.Scan spec for:
Group related items into logical tasks.
Token control rules:
Task Links section after task creation.For each requirement/group, create task structure:
## Generated Tasks from <spec-path>
### [user-auth-01] [Requirement Title]
- **Description:** [From spec]
- **ACs:**
- [ ] AC from spec
- [ ] AC from spec
- **Spec:** <spec-path>
- **Fulfills:** AC-1, AC-2 (maps to Spec ACs this task completes)
- **Priority:** medium
- **Order:** 10
### [user-auth-02] [Requirement Title]
- **Description:** [From spec]
- **ACs:**
- [ ] AC from spec
- **Spec:** <spec-path>
- **Fulfills:** AC-3
- **Priority:** medium
- **Order:** 20
---
Total: X tasks to create
CRITICAL: The
fulfillsfield maps Task → Spec ACs. When the task is marked done, the matching Spec ACs will be auto-checked in the spec document.
I've generated X tasks from the spec. Please review:
- Approve to create all tasks
- Edit to modify before creating
- Cancel to abort
WAIT for explicit approval.
When approved, create tasks with fulfills to link Task → Spec ACs:
mcp_knowns_tasks({ "action": "create", "title": "[<slug>-NN] <requirement title>",
"description": "<from spec>",
"spec": "<spec-path>",
"fulfills": ["AC-1", "AC-2"],
"priority": "medium",
"labels": ["from-spec", "spec:<slug>", "spec-date:<yyyy-mm-dd>"],
"order": 10
})
Then add implementation ACs (task-level criteria, different from spec ACs):
mcp_knowns_tasks({ "action": "update", "taskId": "<new-id>",
"addAc": ["Implementation step 1", "Implementation step 2", "Tests added"]
})
Key Concept:
fulfills: Which Spec ACs (AC-1, AC-2, etc.) this task satisfiesaddAc: Implementation ACs - specific steps to complete the taskWhen task status → "done", the
fulfillsACs are auto-checked in the spec document.
Repeat for each task.
Creation rules:
[<slug>-NN].order as NN * 10 so the board can sort tasks in spec order.from-spec, spec:<slug>, and spec-date:<yyyy-mm-dd> for filtering.fulfills stays mapped to spec AC IDsTask Links section with only short links, e.g. - @task-abc123 [user-auth-01] Add login validation.Goal/result: created X tasks linked to `<spec-path>`.
Key details:
- task-xxx: [user-auth-01] Requirement 1 (3 ACs)
- task-yyy: [user-auth-02] Requirement 2 (2 ACs)
- validation/approval status, if relevant
Next action:
- `/kn-flow @doc/<spec-path>` to execute the task set, or `/kn-plan <first-task-id>` for manual task-by-task planning
fulfills mapping to Spec ACsTask Links section updated concisely/kn-flow for spec-wide execution