一键导入
init
Study the codebase and available agents to generate a zen.local.md config. Run once to onboard a new project, or re-run to update config after adding agents.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Study the codebase and available agents to generate a zen.local.md config. Run once to onboard a new project, or re-run to update config after adding agents.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Discover files with trigger_phrase and/or refresh frontmatter, let the user choose which to schedule for periodic re-injection via CronCreate. Prevents behavioral drift by keeping core rules and goals fresh in context.
Write trigger phrases from .claude/triggers.json into file frontmatter as model-scoped trigger_phrase fields. Bridges trigger generation (scan) with scheduled injection (zenflow:schedule).
Build a GitHub issue into a PR. User-launched with an issue number — reads the issue, confirms with user, creates branch, implements against acceptance criteria, runs verification, and opens a PR. Every decision surfaces via AskUserQuestion.
Collaborative working session — you and the user are a team exploring, researching, and planning together. When implementation work is needed, create well-structured GitHub issues. The user launches Builder agents to implement and Reviewer agents to verify.
Shed accumulated context mid-session. Writes a knowledge handoff document capturing session state, decisions, observations, and behavioral calibration, then guides the user through /clear and resumption.
Runtime verification using Playwright MCP + proof artifacts. Use when acceptance criteria mention UI behavior, when claiming runtime verification, or when independently verifying a PR's claims. Produces artifact-backed proof — screenshots, DOM snapshots — not prose claims.
| name | init |
| description | Study the codebase and available agents to generate a zen.local.md config. Run once to onboard a new project, or re-run to update config after adding agents. |
Scan the codebase and available agents to generate a zen.local.md config tailored to this project. Auto-triggered when zenflow:bug-fix finds no config; also invocable directly via /zenflow:init.
Announce at start: "I'm using the zenflow:init skill to configure zen for this project."
zenflow:init generates .claude/zen.local.md with this structure:
---
project:
language: typescript # primary language detected
framework: nextjs # framework detected (if any)
docs:
readme: README.md
architecture: docs/ARCHITECTURE.md
claude: CLAUDE.md
changelog: CHANGELOG.md
paths:
- name: Guides
dir: docs/guides/
glob: "*.md"
- name: API Reference
path: docs/api-reference.md
plans:
dir: resources/plans # where plan files are stored (relative to project root)
agents:
- domain: api-routes
dir: packages/server/src/routes/
glob: "*.ts"
agent: Backend Architect
rules:
- error-handling
- async-patterns
- domain: frontend
dir: packages/frontend/src/components/
glob: "**/*.tsx"
agent: Frontend Developer
rules:
- react-patterns
---
Fields:
| Field | Required | Description |
|---|---|---|
domain | yes | Logical name for this codebase section |
dir | yes | Directory path relative to project root |
glob | no | File pattern (default: **/*) |
agent | no | Agent name from discovered agents |
rules | no | Rule names mapping to .claude/rules/{name}.md |
Spawn an Explore subagent to perform a deep codebase scan:
Agent tool:
subagent_type: Explore
prompt: |
Perform a deep scan of this codebase and report back:
1. **Project metadata** — detect primary language and framework from:
- package.json (dependencies, scripts)
- pyproject.toml / setup.py
- Cargo.toml
- go.mod
- Any other manifest files at the root
2. **Directory structure** — walk the full tree (not just top-level), identify logical sections:
- Group by responsibility (routes, components, services, schemas, tests, config, etc.)
- Note dir paths and primary file extensions per section
- Sample 2-3 key files per section to understand patterns
3. **Existing rules** — glob `.claude/rules/*.md`, list available rule names
4. **Existing config** — read `.claude/zen.local.md` if it exists, report current structure
5. **Documentation** — detect common doc files and directories:
- README.md at project root
- docs/ directory — list subdirs and glob patterns present
- ARCHITECTURE.md, CHANGELOG.md, CLAUDE.md
- Any other top-level .md files likely to be docs
Report: language, framework, list of sections (name + dir + glob + suggested rules), existing rules available, existing config (if any), detected doc files/dirs.
After the Explore subagent returns:
.claude/agents/*.md and ~/.claude/agents/*.mdname and description from each file's frontmatterCoverage check: If more than half the sections have no good agent match, or no agents were found at all:
"⚠️ Agent coverage is weak — [N] of [M] sections have no good match. Browse awesome-claude-code-subagents to find specialist agents, install them to
.claude/agents/, then re-run/zenflow:init."
Continue regardless — the user can add agents and re-run.
Construct the recommended config from Phase 1 + Phase 2 results:
project:
language: <detected>
framework: <detected or omit if none>
docs:
readme: <path if detected>
architecture: <path if detected>
claude: <path if detected>
changelog: <path if detected>
paths: # only if additional doc dirs were found
- name: <name>
dir: <dir> # for directories
glob: "*.md"
- name: <name>
path: <path> # for single files
agents:
- domain: <section name>
dir: <dir>
glob: <glob>
agent: <matched agent name or omit if no match>
rules:
- <rule name> # only rules that exist in .claude/rules/
Only include docs fields that were actually detected. Omit paths if no additional doc directories were found.
Present the recommendation to the user:
## Recommended zen.local.md config
**Project:** TypeScript / Next.js
**Docs detected:**
| Key | Path |
|-----|------|
| readme | README.md |
| architecture | docs/ARCHITECTURE.md |
| changelog | CHANGELOG.md |
**Additional paths:** 2 detected (Guides, API Reference)
**Agent domains:** 4 sections found
| Domain | Dir | Agent | Rules |
|--------|-----|-------|-------|
| api-routes | packages/server/src/routes/ | Backend Architect | error-handling, async-patterns |
| frontend | packages/frontend/src/components/ | Frontend Developer | react-patterns |
| schemas | packages/core/src/types/ | (no match) | typescript-patterns |
| tests | tests/ | (no match) | — |
⚠️ 2 sections have no agent match. Consider adding specialists from awesome-claude-code-subagents.
**Accept this config?** (yes / edit / skip sections)
Wait for user response before proceeding. If the user wants to edit, accept their changes conversationally before writing.
After approval:
.claude/zen.local.md already existszenflow:init, update project, docs, and agents sectionsWrite the approved YAML as frontmatter in .claude/zen.local.md. Preserve any existing markdown body below the frontmatter.
Confirm:
"Config written to
.claude/zen.local.md. Run/zenflow:bug-fixto diagnose a bug — it will now use this config."
When re-run on a project that already has config:
agents from config for specialist selectiondocs from config for documentation paths