espalier-init
Analyze any existing codebase, discover its patterns and best practices, and generate an Espalier structure (rules, skills, wiki, pipeline) so AI coders produce code matching that project's language and conventions. Greenfield repos take the two-pass Decide-Then-Bind path (/espalier-map charts the conventions, init binds them); boilerplate repos run init normally, then map the product. Wires into Claude Code, Codex, and/or GitHub Copilot (.claude/, .agents/skills/ + .codex/, .github/).
Junhanliu-dev · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add Junhanliu-dev/espalier-engineering --skill espalier-init技能说明
name: espalier-init description: Analyze any existing codebase, discover its patterns and best practices, and generate an Espalier structure (rules, skills, wiki, pipeline) so AI coders produce code matching that project's language and conventions. Greenfield repos take the two-pass Decide-Then-Bind path (/espalier-map charts the conventions, init binds them); boilerplate repos run init normally, then map the product. Wires into Claude Code, Codex, and/or GitHub Copilot (.claude/, .agents/skills/ + .codex/, .github/).
Espalier Init
Discover the actual patterns, conventions, and architecture of an existing codebase, then generate a structured constraint system that ensures AI agents produce code matching those standards.
When to Use
- "Set up Espalier for this project"
- "Create Espalier structure for my codebase"
- "Make AI code production-ready for this repo"
- "Build agent constraints for this project"
- "/espalier-init"
Philosophy
When an agent makes an error, engineer its elimination — not with prompt tweaks, but with files, rules, automated checks, and system structure.
Core insight: The problem isn't model intelligence. It's that models don't know the unwritten rules — patterns every experienced developer on the team knows but nobody documented.
This skill discovers those rules from the code itself, then encodes them as machine-enforceable constraints. Like an espalier trains a fruit tree to grow along a wall, this skill trains your AI coder to grow along the patterns already in your codebase.
File Layout of This Skill
espalier-init/
├── SKILL.md # this file — overview + phase index
├── templates/ # markdown templates emitted into target project
│ ├── rules/ # → espalier/rules/ in target
│ ├── skills/ # → espalier/skills/<name>/SKILL.md
│ ├── agents/ # → espalier/agents/ in target
│ ├── agent.md # → espalier/agent.md (orchestrator)
│ └── pipeline.md # → espalier/pipeline.md
├── hook-templates/ # shell scripts emitted into espalier/hooks/
└── references/ # deep-dive content read on demand
├── discovery-checklist.md # Phase 1 detail
├── wiring.md # Phase 10 detail
├── validation.md # Phase 11 detail
└── wiki-templates.md # Phase 6 wiki stubs
Rule: Every phase below tells you which template/reference to read. Open them with the Read tool when the phase fires — do NOT invent template content from memory.
Output Structure in Target Project (after full setup)
project-root/
├── .claude/ # [claude platform]
│ ├── rules/ # symlinks to espalier/rules/*.md
│ ├── skills/ # symlinks to espalier/skills/*
│ ├── agents/ # symlinks to espalier/agents/*.md
│ └── settings.json # hooks for quality gates
├── .agents/ # [codex platform]
│ └── skills/ # symlinks to espalier/skills/* (Codex repo-skill discovery)
├── .codex/ # [codex platform]
│ ├── config.toml # PreToolUse/PostToolUse hook block (marker-guarded)
│ └── agents/ # harness-{coder,reviewer,security}.toml sub-agents
├── .github/ # [copilot platform]
│ ├── skills/ # symlinks to espalier/skills/* (Copilot Agent Skills — VS Code/CLI/cloud agent)
│ ├── agents/ # harness-*.agent.md custom agents (@harness-coder …)
│ ├── hooks/espalier-gates.json # preToolUse/postToolUse gates via copilot-hook-adapter.sh
│ └── copilot-instructions.md # Espalier section + platform mapping (bootstrap-appended)
├── AGENTS.md # [codex] Espalier section + platform mapping (bootstrap-appended)
├── CLAUDE.md # [claude] references espalier/agent.md
├── espalier/
│ ├── agent.md # orchestrator definition
│ ├── rules/ # engineering-structure, coding-standards, development-process, security-standards, production-standards
│ ├── skills/ # folder name MUST equal SKILL.md `name:` frontmatter
│ │ ├── espalier-coding/
│ │ │ ├── SKILL.md
│ │ │ └── specs/{layer}.md
│ │ ├── espalier-review/SKILL.md
│ │ ├── espalier-security/SKILL.md # trust-boundary audit checklist (harness-security)
│ │ ├── espalier-testing/SKILL.md
│ │ ├── espalier-requirements/SKILL.md
│ │ ├── espalier-grill/SKILL.md # Stage 1 interrogation (invoked by espalier + espalier-fix)
│ │ ├── espalier/SKILL.md # main pipeline orchestrator (slash: /espalier)
│ │ ├── espalier-fix/SKILL.md # bug-fix lane, 7 stages (0–7, no Stage 2); slash: /espalier-fix
│ │ ├── espalier-prune/SKILL.md # stale-artifact refresh (slash: /espalier-prune)
│ │ ├── espalier-doctor/SKILL.md # periodic drift scan (slash: /espalier-doctor)
│ │ ├── espalier-ask/SKILL.md # read-only Q&A lane (slash: /espalier-ask)
│ │ ├── espalier-audit/SKILL.md # repo-wide security audit (slash: /espalier-audit)
│ │ ├── espalier-map/SKILL.md # multi-session planning lane (slash: /espalier-map)
│ │ ├── espalier-maprun/SKILL.md # map batch executor (slash: /espalier-maprun)
│ │ └── espalier-simplify/SKILL.md # simplification survey lane (slash: /espalier-simplify)
│ ├── agents/ # harness-coder.md, harness-reviewer.md, harness-security.md (agent names kept for stability)
│ ├── wiki/ # architecture, data-models, critical-paths, external-services
│ ├── hooks/ # check-layer-boundaries.sh, pre-push-gate.sh, map-guard.sh, esp
阅读完整来源 ↗