Document-driven development workflow for AI-assisted coding.
Works with Cursor and Claude Code. Zero runtime. Pure workflow.
π¨π³ δΈζζζ‘£ Β· π Documentation Β· π Changelog Β· π€ Contributing
LayerFlow is a document-driven development workflow for AI-assisted coding. It works with both Cursor (as Agent Skills) and Claude Code (as slash commands). No CLI to install. No runtime to manage. No config files to maintain.
Seven skills form a complete pipeline β from project initialization to code review β with every decision recorded in a shared memory_bank/ that AI agents read before acting.
/layerflow-init β /layerflow-plan β /layerflow-analyze β /layerflow-impl β /layerflow-review
β |
/layerflow-spec feedback loop
/layerflow-arch
One sentence: LayerFlow teaches your AI agent how to think about your project β not just how to write code.
| Problem | Without LayerFlow | With LayerFlow |
|---|---|---|
| Context loss | AI forgets decisions across sessions | memory_bank/index.md carries confirmed decisions forward |
| Inconsistent output | Each prompt yields different quality | Structured skills enforce consistent workflow stages |
| Missing architecture | Code first, regret later | Optional spec and arch phases before any code |
| No traceability | "Why did we build it this way?" | Every decision has a trail: spec β task β implementation |
| Review overhead | Manual review with no context | Multi-role AI review with full project context |
| Project scale mismatch | Same process for 100-line scripts and 10K-line apps | Two paths: skip phases for small projects, use all for complex ones |
# Clone and install to your project
git clone https://github.com/layerflow-dev/layerflow.git
cd layerflow
./install.sh /path/to/your/project
# Or one-liner
curl -sL https://raw.githubusercontent.com/layerflow-dev/layerflow/main/install.sh | bash -s /path/to/your/projectThe installer auto-detects your platform. You can also force a specific one:
./install.sh /path/to/project --cursor # Cursor only
./install.sh /path/to/project --claude # Claude Code only
./install.sh /path/to/project --both # Both platforms| Platform | What Gets Installed | Where |
|---|---|---|
| Cursor | Agent Skills + Rules | .cursor/skills/ + .cursor/rules/ |
| Claude Code | Slash Commands | .claude/commands/ |
Works the same in both Cursor and Claude Code:
# 1. Open your project in Cursor or Claude Code
# 2. Initialize LayerFlow
/layerflow-init
# 3. Plan your tasks
/layerflow-plan
# 4. Analyze a specific task
/layerflow-analyze FEAT-user-login
# 5. Implement it
/layerflow-impl FEAT-user-login
# 6. Review the code
/layerflow-reviewThat's it. Every step builds on the documents from the previous one.
graph TD
Init["ποΈ /layerflow-init<br/>Project Setup"] --> Spec
Spec["π /layerflow-spec<br/>Requirements"] --> Arch
Arch["ποΈ /layerflow-arch<br/>Architecture"] --> Plan
Plan["πΊοΈ /layerflow-plan<br/>Task Planning"] --> Analyze
Analyze["π /layerflow-analyze<br/>Task Analysis"] --> Impl
Impl["β‘ /layerflow-impl<br/>Implementation"] --> Review
Review["π /layerflow-review<br/>Code Review"]
Impl -->|"missing context"| Analyze
Analyze -->|"needs replanning"| Plan
Plan -->|"scope changed"| Spec
Analyze -->|"create dep task"| Analyze
Review -->|"issues found"| Analyze
Review -->|"fix confirmed"| Impl
style Init fill:#4CAF50,stroke:#333,color:#fff
style Spec stroke-dasharray: 5 5
style Arch stroke-dasharray: 5 5
style Plan fill:#2196F3,stroke:#333,color:#fff
style Analyze fill:#FF9800,stroke:#333,color:#fff
style Impl fill:#9C27B0,stroke:#333,color:#fff
style Review fill:#F44336,stroke:#333,color:#fff
Dashed = optional. For small projects, jump straight from
initβplan. Usespecandarchwhen projects grow complex.
| Skill | Command | What It Does |
|---|---|---|
| Init | /layerflow-init |
Scaffolds memory_bank/, AGENTS.md, and project docs. Asks about your project type, tech stack, and task categories. |
| Spec | /layerflow-spec |
Decomposes PRD/requirements into structured specs/*.md and acceptance.md. Optional for small projects. |
| Arch | /layerflow-arch |
Designs architecture.md, interfaces.md, and glossary.md from your specs. Optional for small projects. |
| Plan | /layerflow-plan |
Batch-creates task files in tasks/*.md with dependency DAG, priorities, and a roadmap.md. |
| Analyze | /layerflow-analyze TASK |
Deep-dives into a single task β explores code, discusses approach, supplements the plan. No code written. |
| Impl | /layerflow-impl TASK |
Readiness check β risk assessment β write code β verify β update task status. |
| Review | /layerflow-review |
Multi-role code review (security, performance, maintainability) with findings written back to task docs. |
For personal projects, prototypes, or anything with clear requirements:
/layerflow-init β Set up project docs
/layerflow-plan β Plan tasks directly
/layerflow-analyze β Discuss approach for each task
/layerflow-impl β Implement
/layerflow-review β Review before merge
For team projects, ambiguous requirements, or systems that need architectural planning:
/layerflow-init β Set up project docs
/layerflow-spec β Decompose requirements from PRD
/layerflow-arch β Design system architecture
/layerflow-plan β Derive tasks from specs + architecture
/layerflow-analyze β Deep-dive into each task
/layerflow-impl β Implement with risk assessment
/layerflow-review β Multi-role review
Every LayerFlow project maintains a memory_bank/ directory β the single source of truth that AI agents read before acting.
memory_bank/
βββ index.md # Unified entry point + confirmed decisions
βββ requirements.md # Structured requirements
βββ architecture.md # System design
βββ glossary.md # Domain terminology
βββ roadmap.md # Task overview with priorities
βββ interfaces.md # API contracts (if applicable)
βββ acceptance.md # Acceptance criteria checklist
βββ specs/ # Detailed specifications
β βββ 01_user-auth.md
β βββ 02_data-models.md
βββ tasks/ # Individual task plans
βββ FEAT-user-login.md
βββ API-payment-webhook.md
βββ UI-dashboard.md
Decisions don't get lost between sessions. Here's how they flow:
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β memory_bank/index.md β
β Confirmed Decisions Section β
β β
β Each skill APPENDS confirmed conclusions β
β Downstream skills READ to skip answered Qs β
ββββββββββ¬βββββββββββββββββββββββββ¬βββββββββββββββββ
β β
ββββββΌβββββ ββββββββΌβββββββ
β spec β β arch β
β appends β β appends β
ββββββ¬βββββ ββββββββ¬βββββββ
β β
ββββββββββββ¬ββββββββββββββ
βββββββΌββββββ
β plan β
β reads β
βββββββ¬ββββββ
β
βββββββΌβββββββ
β analyze β
βreads+writesβ
βββββββ¬βββββββ
β
βββββββΌββββββ
β impl β
β reads β
βββββββ¬ββββββ
β
βββββββΌβββββββ
β review β
βwrites back β
ββββββββββββββ
Every skill that asks clarifying questions offers two depth levels:
| Level | Questions | Best For |
|---|---|---|
| Quick | 5β15 | Small projects, clear requirements, time-constrained |
| Detailed | 15β30+ | Complex projects, ambiguous requirements, critical systems |
layerflow-common/audit-checklist.md defines post-write verification items. Each skill references common items and appends its own, ensuring consistent quality across the entire workflow.
| Feature | LayerFlow | GSD | Aider | Raw Prompting |
|---|---|---|---|---|
| Runtime | None (Skills / Commands) | CLI + Pi SDK | CLI + Git | None |
| Setup | Copy files, done | npm install -g |
pip install |
N/A |
| Context persistence | memory_bank/ docs |
.gsd/ state files |
Git history | Manual copy-paste |
| Workflow structure | 7 composable skills | State machine + auto mode | Edit/commit loop | Ad-hoc |
| Architecture phase | Built-in (optional) | Research + planning | None | None |
| Decision tracking | Confirmed decisions in index.md |
DECISIONS.md |
None | None |
| Multi-role review | Built-in | None | None | None |
| Project scale | Adapts (skip phases) | Fixed pipeline | Single file focus | Per-prompt |
| Language support | Any (incl. Chinese filenames) | English-centric | Any | Any |
| Cost | Free (uses your Cursor sub) | API costs per token | API costs per token | API costs per prompt |
layerflow/
βββ README.md # This file
βββ README.zh-CN.md # Chinese documentation
βββ LICENSE # MIT License
βββ CONTRIBUTING.md # Contribution guidelines
βββ CHANGELOG.md # Version history
βββ install.sh # Smart installer (auto-detects platform)
β
βββ skills/ # ββ Cursor Agent Skills ββ
β βββ layerflow-common/
β β βββ audit-checklist.md # Shared audit items + skill navigation
β βββ layerflow-init/
β β βββ SKILL.md # Project initialization skill
β β βββ resources/ # Root-level file templates
β β βββ templates/ # memory_bank templates
β βββ layerflow-spec/ # Requirements decomposition
β βββ layerflow-arch/ # Architecture design
β βββ layerflow-plan/ # Batch task planning + templates
β βββ layerflow-analyze/ # Single task deep-dive
β βββ layerflow-impl/ # Implementation with verification
β βββ layerflow-review/ # Multi-role code review
β
βββ commands/ # ββ Claude Code Slash Commands ββ
β βββ layerflow-init.md # /layerflow-init
β βββ layerflow-spec.md # /layerflow-spec
β βββ layerflow-arch.md # /layerflow-arch
β βββ layerflow-plan.md # /layerflow-plan
β βββ layerflow-analyze.md # /layerflow-analyze TASK
β βββ layerflow-impl.md # /layerflow-impl TASK
β βββ layerflow-review.md # /layerflow-review
β
βββ rules/ # ββ Shared Rules ββ
β βββ code-conventions.mdc # Universal code style rules
β βββ commit-conventions.mdc # Git commit message conventions
β
βββ docs/ # Extended documentation
βββ .github/ # Issue/PR templates
| Document | Description |
|---|---|
| Getting Started | Install, first run, basic usage |
| Workflow Guide | Step-by-step walkthrough of the full pipeline |
| Skills Reference | Detailed API for each skill |
| Memory Bank | How the document architecture works |
| Customization | Adapting task types, naming, and workflow |
| FAQ | Common questions and troubleshooting |
One of the following:
- Cursor IDE (any version with Agent Skills support), or
- Claude Code CLI
That's it. No Node.js, no Python, no extra API keys.
We welcome contributions! See CONTRIBUTING.md for guidelines.
- π Report a bug
- π‘ Request a feature
- π Improve documentation
MIT β use it however you want.
Stop prompting. Start flowing.
./install.sh and type /layerflow-init in Cursor or Claude Code.