complexity-detection
Classify a task or feature as quick, standard, or thorough so the rest of the pipeline (budget sizing, model routing, review depth) can right-size itself. Used by /ck:sketch to default the kit's complexity, by /ck:map to assign task depth, and by /ck:make for per-task budgets. Also invoked by the ck:complexity agent with the haiku model. Trigger phrases: "how complex", "what depth", "pick a depth", "classify this task".
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- complexity-detection
- description
- Classify a task or feature as quick, standard, or thorough so the rest of the pipeline (budget sizing, model routing, review depth) can right-size itself. Used by /ck:sketch to default the kit's complexity, by /ck:map to assign task depth, and by /ck:make for per-task budgets. Also invoked by the ck:complexity agent with the haiku model. Trigger phrases: "how complex", "what depth", "pick a depth", "classify this task".
03 SKILL.md 正文
Complexity Detection
A deterministic scoring rubric. Five axes, 0–4 each, summed to 0–20.
Axes
| Axis | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| Files touched | 0–2 | 3–5 | 6–10 | 11–20 | 20+ |
| Type | chore / format | refactor | feature | cross-cutting | architectural |
| Judgment required | mechanical | low-ambiguity | medium | high | critical (sec/prod) |
| Cross-component | single module | two modules | three modules | many within one repo | multi-repo |
| Novelty | known pattern | rare pattern | novel | research needed | unknown unknowns |
Total score maps to:
| Score | Depth |
|---|---|
| 0 – 6 | quick |
| 7 – 13 | standard |
| 14+ | thorough |
Override signals
Upgrade one step regardless of score when any of these are true:
- Security-sensitive: authentication, authorization, crypto, secrets, PII.
- Data migration that is not reversible.
- Public API shape change (breaking).
- Performance-critical hot path with an existing SLA.
Downgrade one step only when all of these are true:
- Zero new dependencies.
- Existing tests cover the change.
- No user-visible behaviour change.
- Single file, single function.
Per-depth defaults
| Depth | Token budget | Model tier | Review | Tests |
|---|---|---|---|---|
| quick | 8 000 | haiku | optional | smoke |
| standard | 20 000 | sonnet | required | unit + integration |
| thorough | 45 000 | sonnet/opus | mandatory | unit + integration + E2E |
These defaults are recorded in .cavekit/config.json under task_budgets
and consumed by the cavekit-router.cjs model router.
How agents score
The ck:complexity subagent (haiku) receives a task description and returns
a JSON blob:
{
"score": 11,
"depth": "standard",
"axes": {
"files": 2, "type": 2, "judgment": 2, "cross_component": 2, "novelty": 3
},
"overrides_applied": []
}
/ck:map calls this agent per task to set depth in the task registry. If
the agent produces a score in the "thorough" band with a novelty of 4 and a
security override, it may return needs_research: true, which /ck:map must
translate into an upstream ck:researcher task dependency before the work
itself.
Integration points
/ck:sketch— runs complexity scoring on the whole domain to set the kit'scomplexity:frontmatter./ck:map— runs it per task to assigndepth./ck:make— readsdepthto size the task budget and pick the review intensity.ck:complexityagent — pure-haiku worker; does nothing else.
Anti-patterns
- Using one depth for every task in a kit "for consistency." Cost up, signal down.
- Padding depth to "be safe" — if the budget is oversized, the model wastes tokens exploring. Right-size, then raise only when verification fails.
- Ignoring overrides — scoring a login flow as "quick" because it touches one file. Security overrides exist for exactly this reason.
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.