UNPKG

@every-env/cli

Version:

Multi-agent orchestrator for AI-powered development workflows

429 lines (314 loc) β€’ 11.6 kB
# 🌱 every Tools for AI-powered development that get smarter with every use. Make each unit of engineering work easier than the last. ## Philosophy: Compounding Engineering **Compounding engineering: Each unit of engineering work should make subsequent units of work easierβ€”not harder.** Every-Env embodies this principle through a simple, repeatable process that ensures your development workflow continuously improves. Every-env is how we build software at Every. ### The Compounding Engineering Process ```mermaid graph LR A[Plan<br/>Plan it out<br/>in detail] --> B[Delegate<br/>Do the work] B --> C[Assess<br/>Make sure<br/>it works] C --> D[Codify<br/>Record<br/>learnings] D --> A style A fill:#f9f,stroke:#333,stroke-width:2px style B fill:#bbf,stroke:#333,stroke-width:2px style C fill:#bfb,stroke:#333,stroke-width:2px style D fill:#ffb,stroke:#333,stroke-width:2px ``` ### The Four Steps 1. **Plan** β†’ Plan out a feature or bug fix in detail - Break down complex tasks into clear steps - Think through edge cases and dependencies - Create a roadmap that AI and humans can follow 2. **Delegate** β†’ Do the work - Execute the plan with AI assistance - Leverage automation for repetitive tasks - Focus human effort on high-value decisions 3. **Assess** β†’ Make sure it works as expected - Test thoroughly against requirements - Verify edge cases are handled - Ensure code quality standards are met 4. **Codify** β†’ Record learnings for next time - Capture what worked and what didn't - Update project knowledge (CLAUDE.md) - Ensure mistakes never happen twice ### Why This Works - **Knowledge compounds**: Every completed task adds to your project's collective intelligence - **Mistakes become strengths**: Issues encountered today become safeguards tomorrow - **Automation grows naturally**: Repeated patterns automatically become reusable workflows - **Teams scale efficiently**: New team members inherit all accumulated knowledge ### Use Your Own Tools Every-Env is opinionated about the process (Plan β†’ Delegate β†’ Assess β†’ Codify) but works with whatever tools you already use: - **AI Tools**: Claude, GPT, Copilot, or any command-line AI - **Project Management**: GitHub Issues, Linear, Jira, or markdown files - **Documentation**: Store it wherever - repo, Notion, Confluence - **Development**: Any IDE, terminal, or environment you prefer The four-step process works regardless of your toolchain. Every-Env provides the structure; you bring the tools. ## Prerequisites - Claude Code: `npm install -g @anthropic-ai/claude-code` - Verify with: `claude --version` ## Installation ```bash # Global (recommended) npm install -g @every-env/cli # Project-specific npm install --save-dev @every-env/cli ``` ## CLI Commands ```bash # Core initialization every init # Initialize every in your project # The Four Steps of Compounding Engineering every plan <task|patterns...> # Step 1: PLAN - Create detailed implementation plans every work [target] # Step 2: DELEGATE - Execute with AI assistance on a target every review [target] # Step 3: ASSESS - Verify work meets requirements every codify [target] # Step 4: CODIFY - Record learnings permanently # Supporting commands every research <task> # Research implementations across GitHub repos every copy-commands # Copy Claude Code workflow templates to your project every request-review [target] --from <@u> # Get team feedback during assessment every revise [target] [feedback] # Iterate on plans based on feedback # Documentation workflow every docs update # Update documentation every docs run <pattern> # Run specific documentation patterns every docs list # List available patterns every docs status # Check documentation status ``` ### Global Options - `-c, --config <path>` - Config file (default: `.docs-config.json`) - `--dry-run` - Preview without executing - `-v, --verbose` - Verbose output - `--debug` - Debug output - `-a, --agent-cli <name>` - Override agent: `claude`, `copy-clipboard`, `amp`, `codex`, or custom - `--copy-clipboard` - Shorthand for `--agent-cli copy-clipboard` ### Targets - Plan path: `plans/2025-07-24-auth-plan.md` - Plan id/slug: from `.every-env/state.json` - GitHub issue/PR: `--github <number>` - Latest plan: omit target ### Agent Examples ```bash every plan "add user authentication" # Default (Claude) every plan "add user authentication" --copy-clipboard every work plans/auth.md --agent-cli codex ``` ## The `init` Command Initialize every in your project: ```bash every init # Interactive setup every init --yes # Non-interactive defaults every init --default-agent amp # Set default agent every init --project-type node # Override detected type ``` **Creates:** - `.every-env/config.json` - Runtime configuration - Detects project type automatically - Interactive prompts for agent selection ## Documentation Commands ```bash every docs update # Update all documentation every docs update --pattern api # Update specific pattern every docs run api-docs # Run single pattern every docs list # List available patterns every docs status # Check generation status ``` ## Planning Commands ### `every plan [patterns...]` Generate AI-powered implementation plans: ```bash every plan --list # List patterns every plan implementation-plan # Single plan every plan implementation-plan work-breakdown technical-design ``` **Built-in patterns:** - `implementation-plan` - Full implementation plan with phases - `work-breakdown` - Task decomposition with estimates - `technical-design` - Architecture and specifications **Options:** - `-o, --output <path>` - Output directory (default: "plans") - `--timeline` - Include timeline (default: true) - `--resources` - Include estimates (default: true) ### `every review [target]` Review plans and PRs: ```bash every review # Latest PR (from current repo) every review plans/auth.md # Review a specific local document every review 1234 # Review GitHub PR number 1234 every review https://github.com/org/repo/pull/456 # Review by PR URL ``` ### `every research <task>` Analyze GitHub repos for implementation patterns: ```bash every research "modal in react" every research "auth flow" --depth deep every research "webpack optimization" --output ./research ``` **Options:** - `--depth` - `quick`, `standard`, or `deep` - `-o, --output` - Output directory (default: `research/`) **Output:** Timestamped markdown reports with best practices, code examples, and recommendations. ### `every request-review` & `every revise` ```bash # Request review every request-review plans/auth.md --from @teammate every request-review --github 444 --from @alice,@bob # Revise based on feedback every revise # Use embedded comments every revise plans/auth.md "make it simpler" every revise --github 444 # From PR comments ``` ### `every work [target]` Start development with AI assistance: ```bash every work # Latest plan every work plans/auth.md # Specific plan every work --github 1234 # From GitHub issue every work plans/auth.md --context docs/API.md ``` Launches AI with plan context and project information. ### `every codify [target]` Capture learnings and update project knowledge: ```bash every codify # From recent work every codify plans/auth.md # Specific plan every codify --insight "always validate client-side" ``` Updates CLAUDE.md and creates migration records in `.every-env/migrations/`. ### `every copy-commands` ```bash every copy-commands # Copy Claude workflow templates ``` ## Workflow State Management Tracks workflow in `.every-env/state.json`: - Active plans and their status - Review requests - Codification history - Smart defaults for commands ## Configuration JSON-based configuration in `.docs-config.json`: ```json { "defaultCommand": "claude", "parallelism": { "maxAgents": 5 }, "patterns": [ { "name": "api", "match": { "files": ["app/controllers/**/*.rb"], "exclude": ["**/*_test.rb"] }, "agents": [ { "id": "api-docs", "promptFile": "prompts/api.md", "output": "docs/api.md" } ] } ] } ``` ### AllowedTools Configuration Essential tools are **automatically included**: - File operations: `Read`, `Write`, `Edit`, `MultiEdit` - Search: `Glob`, `Grep`, `LS` Add extra tools as needed: ```json { "defaultAllowedTools": ["WebSearch", "Bash(git log:*)", "Bash(npm list:*)"] } ``` ### Pattern Matching ```json { "patterns": [ { "name": "dependencies", "match": { "files": ["package.json"], "content": { "regex": "\"([^\"]+)\": \"[^\"]+\"", "captureGroup": 1 } }, "agents": [ { "outputPattern": "docs/deps/{name}.md", "forEach": "match" } ] } ] } ``` ### Variables **Built-in:** `projectName`, `timestamp`, `date`, `gitBranch`, `gitCommit`, `output`, `name`, `index`, `total` **Custom:** ```json { "variables": { "company": "Acme Corp", "framework": "Rails" } } ``` Use in prompts: `{{ company }} - {{ framework }}` ## Examples ### Complete Workflow ```bash # Step 1: PLAN every plan "add user authentication" # Step 2: DELEGATE every work # Step 3: ASSESS every review every request-review --from @teammate # Step 4: CODIFY every codify ``` ### Quick Start ```bash # Rails every init --template rails every docs update every plan "add admin dashboard" # Node.js every init --template node every docs run dependencies every plan "add rate limiting" ``` ## Features - πŸš€ **Fast** - Parallel AI agents - 🎯 **Smart** - Precise file targeting - πŸ”§ **Flexible** - Any AI tool - πŸ“ **Dynamic** - Adaptive templates - πŸ”„ **Efficient** - Incremental updates - 🧠 **Learning** - Gets smarter over time ## Environment Variables - `EVERY_ENV_STATE_DIR` - State directory - `EVERY_ENV_CONFIG` - Config file path ## Development ```bash # Setup git clone https://github.com/every-env/every-env.git npm install # Development npm run dev # Watch mode npm test # Run tests npm run build # Build # Local testing node dist/cli.js [command] # Or npm link every [command] ``` ## Ideas & TODOs (from dogfooding) - [ ] Auto gen plan name, not with a passed variable in the plan step? ### Workflow Improvements - [ ] **Better plan exploration**: Need a simpler way to explore a plan and understand which parts of the codebase it's touching. Moreover, needs to help me understand the codebase. - [ ] **Fix plan output messaging**: The plan command creates local markdown files but incorrectly tells users it "created a GitHub issue" - the command output needs to match what it actually does (creates local .md files) - [ ] **Auto-open plans**: The plan command should automatically open the created markdown file in the user's preferred editor by default ## Contributing Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details. ## License MIT Β© Every Env