Skip to content

layerflow-dev/layerflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LayerFlow

LayerFlow

Document-driven development workflow for AI-assisted coding.
Works with Cursor and Claude Code. Zero runtime. Pure workflow.

Version License Stars Cursor Claude Code Language

πŸ‡¨πŸ‡³ δΈ­ζ–‡ζ–‡ζ‘£ Β· πŸ“– Documentation Β· πŸ“‹ Changelog Β· 🀝 Contributing


What is LayerFlow?

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.


Why LayerFlow?

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

Quick Start

Installation

# 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/project

The 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/

Your First Workflow

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-review

That's it. Every step builds on the documents from the previous one.


The Seven Skills

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
Loading

Dashed = optional. For small projects, jump straight from init β†’ plan. Use spec and arch when 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.

Two Paths, One Framework

πŸš€ Small Projects

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

πŸ—οΈ Complex Projects

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

How It Works

The Memory Bank

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

Decision Propagation

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 β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Interaction Depth

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

Shared Audit Checklist

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.


LayerFlow vs Others

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

Project Structure

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

Documentation

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

Requirements

One of the following:

That's it. No Node.js, no Python, no extra API keys.


Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.


Star History

Star History Chart

License

MIT β€” use it however you want.


Stop prompting. Start flowing.
./install.sh and type /layerflow-init in Cursor or Claude Code.

About

Document-driven development workflow for AI-assisted coding.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages