一键导入
kookr-playbooks
How to create, structure, and launch Kookr playbook tasks — reusable agent task templates with dynamic sources and project identity
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How to create, structure, and launch Kookr playbook tasks — reusable agent task templates with dynamic sources and project identity
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Make Codex CLI behave more like Claude Code for Kookr by preserving the known fork, branch, build, deploy, daily upstream sync, and live-verification workflow for Claude-compatible skills, agents, settings, hooks, and related UX.
Kookr-internal extension to rfc-iterative-review that captures append-only critic traces for later meta-analysis of RFC reviewer subagents.
Analyze an open question by casting 3-5 deliberately conflicting expert roles, running them in parallel and blind to each other, sharpening them in a debate round, attacking their consensus with a devil's advocate, then synthesizing a verdict that preserves disagreement instead of averaging it. Use for decisions, strategy, idea generation, hypothesis triage, experiment post-mortems, or any question where a single lens would return "it depends".
Iterative RFC drafting workflow — draft in worktree, run parallel critic subagents, incorporate feedback over N rounds, present to user before any action
Build a Ralph-like sequential Kookr task chain where each task completes one independent unit, records durable state, and spawns the next task with the same continuation contract. Use for issue batches, queue drains, staged migrations, or other long runs that should proceed one task at a time without relying on conversation memory.
Reflect on a mistake or unnecessary user correction — root-cause why it happened, then propose and implement structural fixes (skills, hooks, CLAUDE.md, memory, scripts). Use after the user corrects behavior, repeats guidance, or points out an avoidable error.
| name | kookr-playbooks |
| description | How to create, structure, and launch Kookr playbook tasks — reusable agent task templates with dynamic sources and project identity |
| keywords | playbook, playbooks, task, template, kookr, launch, repeatable, tracked-projects, project, source |
A playbook is a reusable task template stored as a Markdown file in .kookr/playbooks/. It defines a repeatable agent task that users can launch from the Kookr dashboard UI with one click (optionally filling in parameters).
.kookr/playbooks/*.mdcurl POST /api/tasks for that.kookr/playbooks/
├── my-playbook.md
├── another-playbook.md
└── ...
The directory is scanned by src/core/playbook-discovery.ts which reads .kookr/playbooks/*.md from the project CWD.
---
name: Human-Readable Playbook Name # REQUIRED — displayed in UI
description: One-line description # Optional — shown on playbook card
cwd: /absolute/path/to/working/directory # Optional — overrides dialog CWD
parameters: # Optional — user fills these in before launch
- name: repoFullName
description: "Target repository (owner/repo)"
required: false
defaultFrom: git-remote # Optional — server resolves blank value from launch CWD remote
type: select # Optional — 'text' (default) or 'select'
source: tracked-projects # Optional — dynamic data source
options: # Optional — static fallback options (merged with source)
- label: "grafana/grafana"
value: "grafana/grafana"
checklist: # Optional — becomes task completion criteria
- First thing to verify
- Second thing to verify
---
| Field | Required | Type | Purpose |
|---|---|---|---|
name | Yes | string | Display name in UI |
description | No | string | Subtitle on playbook card |
cwd | No | string | Target working directory (absolute path). If omitted, uses the CWD from the launch dialog. Use this when the playbook targets a specific repo. |
parameters | No | array | Parameters with name, description, required, default, defaultFrom, type, source, options. |
checklist | No | array of strings | Completion criteria shown in UI and tracked by the supervisor. |
| Field | Required | Type | Purpose |
|---|---|---|---|
name | Yes | string | Parameter name, used in {{name}} interpolation |
description | No | string | Placeholder hint shown in the form |
required | No | boolean | If true, the Launch button is disabled until filled |
default | No | string | Pre-filled value when no history exists |
defaultFrom | No | 'git-remote' | Server fills a blank launch value from the launch CWD's origin remote. Use for repo params that should follow the current project instead of reusing stale history. |
type | No | 'text' or 'select' | select renders a dropdown. Default: text |
source | No | string | Dynamic data source ID (see below). Merged with static options. |
options | No | array of {label, value} | Static dropdown options for type: select |
source field)When a parameter has a source, the UI resolves it at render time to populate the dropdown dynamically.
| Source ID | Resolves to | Value format |
|---|---|---|
tracked-projects | All hosted ProjectSummary entries from the sidebar (local projects excluded) | owner/repo (e.g., grafana/grafana) |
Key behaviors:
options (deduped by value, static labels win)source: tracked-projects is present, the selected value is automatically converted to a project ID (github.com/owner/repo) and assigned to the task. This makes the task appear under the correct project in the sidebar — not under the Kookr project.source: tracked-projects are auto-filled with that project's displayName.defaultFrom: git-remote, leave it optional in the form. Kookr resolves blank values from the launch CWD's git remote on the server and does not reuse the last manually entered value on future launches.source: tracked-projects matters for OSS playbooksWithout it, all playbook tasks run in the Kookr repo's CWD, so they get assigned to kookr-ai/kookr in the sidebar. With source: tracked-projects:
projectId (e.g., github.com/grafana/grafana)Every OSS playbook that takes a repo parameter should use source: tracked-projects.
For parameters that are mechanically derivable from repoFullName (like repoSlug, forkName, defaultBranch), do NOT add them as user-facing parameters. Instead, add a "Derived values" section at the top of the prompt body:
## Derived values
Compute these from `{{repoFullName}}`:
- **repoSlug**: replace `/` with `-` (e.g., `microsoft/vscode` → `microsoft-vscode`)
- **forkName**: `jeanibarz/<repo>` where `<repo>` is the part after `/`
- **defaultBranch**: look up from recon report at `~/.claude/<repoSlug>-recon/recon-report.md`, or default to `main`
Use these derived values wherever they appear below.
Use <angleBrackets> for derived values in the body (not {{mustache}}) to distinguish them from engine-interpolated parameters.
Everything after the frontmatter closing --- is the agent prompt body. At launch Kookr prepends a one-line context header naming the playbook, its scope, and its definition path — so don't open the body with your own "you are running X" preamble; it is redundant and competes with the header's framing. Structure the body as a comprehensive brief for a fresh agent that has no prior context:
Use {{paramName}} in the body. When the user launches the playbook, values are substituted before the prompt is sent to the agent.
Deploy version {{version}} to {{environment}}.
tracked-projects fields)repoFullName is auto-filled with the project's nameBoth paths produce identical tasks (same CWD, same prompt, same projectId).
POST /api/tasks takes a raw prompt — it does not go through playbook launch
preparation, so no playbook context header is prepended and playbookId is not
recorded. The resulting task is not identical to a UI-launched one: the agent
won't know it is running a playbook or where the definition lives. Prefer the UI
or the launchPlaybook WS message when you want real playbook semantics.
curl -s -X POST http://localhost:4800/api/tasks \
-H 'Content-Type: application/json' \
-d '{
"prompt": "<paste the playbook body with params filled in>",
"cwd": "/path/to/working/dir",
"criteria": "checklist item 1. checklist item 2."
}'
| Scenario | Use |
|---|---|
| Repeatable process (triage, audit, analysis) | Playbook |
| One-time investigation or fix | Manual launch or curl POST /api/tasks |
| Process that will run on a schedule | Playbook (idempotency rules required) |
| Quick delegation from within an agent session | spawn-child-task skill |
gh, curl, git commands, not vague instructionsdefaultFrom: git-remote for repo fields that should follow the launch project, source: tracked-projects when project-drawer launch should pre-fill the selected project, and derive slug/fork/branch in the prompt body.cwd: $HOME/git/codex for Codex-specific playbooks)---
name: OSS <Task Name>
description: <One-line description>
parameters:
- name: repoFullName
description: "Target repository (owner/repo)"
required: true
type: select
source: tracked-projects
checklist:
- <First verifiable outcome>
- <Second verifiable outcome>
---
## Derived values
Compute these from `{{repoFullName}}`:
- **repoSlug**: replace `/` with `-`
- **forkName**: `jeanibarz/<repo>` where `<repo>` is the part after `/`
## Objective
<What this task achieves for {{repoFullName}}>
## Context
- **Upstream**: `{{repoFullName}}`
- **Fork**: `<forkName>`
- **State**: `~/.claude/<repoSlug>-<task-slug>/`
## Phases
### Phase 1: ...
## Idempotency Rules
1. ...
## Anti-Patterns
- ...
oss-pr-lessons.md — Analyzes closed PRs to learn contribution patterns (1 param: repoFullName)oss-bug-triage.md — Scores upstream bugs, maintains ranked triage issues (1 param: repoFullName)oss-contribution-pipeline.md — End-to-end contribution workflow (2 params: repoFullName, phase)codex-bug-triage.md — Codex-specific triage (hardcoded cwd, no tracked-projects source)src/core/playbook.ts — Type definitions (Playbook, PlaybookParameter, source field)src/core/playbook-parser.ts — Parses frontmatter + body, interpolates {{params}}src/core/playbook-discovery.ts — Scans .kookr/playbooks/*.mdsrc/server/use-cases/playbook-launch.ts — Prepares launch options, derives projectId from tracked-projects paramsrc/server/launch-service.ts — Creates task, sets projectId if providedsrc/server/schedule-validator.ts — Same projectId derivation for scheduled launchessrc/frontend/store/playbook-source-resolver.ts — Resolves tracked-projects source to dropdown optionssrc/frontend/components/FilterableSelect.tsx — Searchable dropdown for large option listssrc/frontend/components/PlaybookBrowser.tsx — UI for browsing, project-context pre-fillsrc/frontend/components/LaunchTaskDialog.tsx — Tabbed dialog (Manual | Playbooks)