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.
From zenflownpx claudepluginhub brewpirate/zen-flow --plugin zenflowThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Scan the codebase and available agents to generate a zen.local.md config tailored to this project. Auto-triggered when zenflow:audit or 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:auditto audit the codebase or/zenflow:bug-fixto diagnose a bug — both will now use this config."
When re-run on a project that already has config:
agents from config for section-to-agent mappingagents from config for specialist selectiondocs from config for documentation paths