| name | agent-first-bootstrap |
| description | Initialize projects with Agent-First methodology. Supports Codex, Claude Code, Qwen Code, GitHub Copilot, Gemini CLI. Generates AGENTS.md, tool-specific configs, and documentation structure. |
Agent-First Project Bootstrap
Description
A comprehensive toolkit for initializing projects with Agent-First methodology. Enables seamless integration with multiple AI coding tools (Codex, Claude Code, Qwen Code, GitHub Copilot, Gemini CLI) by generating structured documentation, architecture guides, and tool-specific configuration files.
Key Features:
- Interactive project interview protocol
- Automatic generation of AGENTS.md and tool-specific configs
- Validation checklist for Agent-First readiness
- Support for 5 AI coding tools
Overview
Source: OpenAI "Harness Engineering" + Best Practices
Purpose: Initialize projects with Agent-First methodology
Supports: Codex, Claude Code, Qwen Code, GitHub Copilot, Gemini CLI
Activation Keywords
- agent-first bootstrap
- harness engineering init
- project bootstrap
- agent kickoff
Core Principle
"Humans steer. Agents execute."
Before any code is written, establish:
- Environment - Repository structure, tools, constraints
- Intent - Goals, requirements, success criteria
- Feedback Loops - Tests, reviews, observability
Quick Start
Interactive Bootstrap
agent-bootstrap init
agent-bootstrap init --tool codex
agent-bootstrap init --tool claude
agent-bootstrap init --tool qwen
agent-bootstrap init --tool copilot
agent-bootstrap init --tool gemini
Project Interview Protocol
Phase 1: Vision & Goals
## Project Vision Interview
1. **What are we building?**
- [ ] One-line description
- [ ] Target users
- [ ] Core value proposition
2. **What does success look like?**
- [ ] Key metrics
- [ ] User outcomes
- [ ] Business goals
3. **What are the constraints?**
- [ ] Time constraints
- [ ] Resource constraints
- [ ] Technical constraints
- [ ] Must-have vs nice-to-have
4. **What is out of scope?**
- [ ] Explicit non-goals
- [ ] Future phases
Phase 2: Architecture & Domain
## Architecture Interview
1. **What are the core domains?**
Example: User Management, Payments, Notifications
2. **What are the layers per domain?**
Recommended: Types โ Config โ Repo โ Service โ Runtime โ UI
3. **What are the cross-cutting concerns?**
- Authentication
- Logging/Observability
- Feature Flags
- Error Handling
4. **What external dependencies exist?**
- Databases
- APIs
- Services
Phase 3: Agent Configuration
## Agent Configuration Interview
1. **What coding conventions?**
- Naming patterns
- File organization
- Logging format
2. **What constraints to enforce?**
- Layer boundaries
- Dependency rules
- Test requirements
3. **What agent capabilities needed?**
- UI testing (Chrome DevTools)
- API testing
- Database migrations
4. **What feedback loops?**
- Agent-to-agent review
- Automated tests
- Performance gates
Phase 4: Documentation Structure
## Documentation Interview
1. **Design docs location?**
- docs/design/
2. **Architecture docs?**
- docs/architecture/
3. **Quality tracking?**
- docs/quality/
4. **Plans location?**
- docs/plans/
Generated Artifacts
1. AGENTS.md (~100 lines)
# Agent Guide: [Project Name]
## Quick Start
- Run tests: `npm test` / `cargo test` / `pytest`
- Open PR: [instructions]
- Get help: [link to docs]
## Architecture
- See: docs/architecture/README.md
- Layers: Types โ Config โ Repo โ Service โ Runtime โ UI
- Cross-cutting: Providers (auth, telemetry, flags)
## Key Domains
| Domain | Docs | Owner |
|--------|------|-------|
| [Domain1] | docs/design/domain1.md | @agent |
| [Domain2] | docs/design/domain2.md | @agent |
## Conventions
- Naming: [patterns]
- Logging: structured JSON via logger
- Tests: required for all new code
## Constraints (Enforced)
- Layer dependencies: forward only
- Max file size: 300 lines
- Test coverage: >80%
## Where to Learn More
- Design: docs/design/
- Quality: docs/quality/
- Plans: docs/plans/
- Debt: docs/debt.md
## Agent Workflow
1. Read this file first
2. Check docs/design/ for context
3. Write code following conventions
4. Run tests locally
5. Open PR for agent review
6. Iterate until all reviewers pass
2. Directory Structure
project/
โโโ AGENTS.md # ~100 lines, table of contents
โโโ CLAUDE.md # Claude Code specific (optional)
โโโ COPILOT.md # GitHub Copilot specific (optional)
โโโ GEMINI.md # Gemini CLI specific (optional)
โโโ docs/
โ โโโ design/ # Design documents
โ โ โโโ README.md # Index of all designs
โ โ โโโ [domain].md # Per-domain designs
โ โโโ architecture/ # Architecture docs
โ โ โโโ README.md # Layer map
โ โ โโโ domains.md # Domain breakdown
โ โโโ quality/ # Quality tracking
โ โ โโโ domains.md # Per-domain quality grades
โ โโโ plans/ # Execution plans
โ โ โโโ active/ # Current work
โ โ โโโ completed/ # Done work
โ โโโ debt.md # Known technical debt
โโโ .github/
โ โโโ workflows/ # CI/CD (agent-generated)
โโโ src/
โ โโโ [domains]/ # Domain-organized code
โโโ tests/ # Test suite
3. Tool-Specific Configs
Claude Code (CLAUDE.md)
# Claude Code Instructions
## Project Context
This project follows Agent-First methodology.
Read AGENTS.md first, then docs/architecture/README.md.
## Workflow
1. Understand goal from user
2. Check docs/design/ for relevant context
3. Follow layer constraints strictly
4. Write tests before implementation
5. Self-review changes
6. Open PR for review
## Constraints
- Max file size: 300 lines
- Test coverage: >80%
- Use structured logging
- Follow naming conventions in AGENTS.md
GitHub Copilot (COPILOT.md)
# GitHub Copilot Instructions
## Project Context
Agent-First project. See AGENTS.md for conventions.
## Coding Standards
- Follow layer architecture
- Use structured logging
- Write tests for new code
- Keep files under 300 lines
## Architecture
See docs/architecture/README.md
Gemini CLI (GEMINI.md)
# Gemini CLI Instructions
## Project Context
This project follows Agent-First methodology.
Read AGENTS.md first, then docs/architecture/README.md.
## ReAct Workflow
Gemini CLI uses Reason-and-Act loop:
1. **Reason**: Understand the task and plan approach
2. **Act**: Execute file operations, shell commands, web fetch
3. **Iterate**: Refine based on results
## Available Tools
- `read_file` / `write_file` - File operations
- `run_shell_command` - Execute shell commands
- `web_fetch` - Fetch web content
- `google_web_search` - Search the web
- `save_memory` - Persist context across sessions
## MCP Server Integration
Gemini CLI supports MCP servers for extended capabilities.
Configure in `~/.gemini-cli/config.json`:
```json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
}
}
}
Workflow
- Read AGENTS.md for project context
- Check docs/design/ for domain details
- Use
read_file to understand existing code
- Plan changes following layer architecture
- Use
write_file to implement
- Run tests via
run_shell_command
- Iterate until tests pass
Constraints
- Max file size: 300 lines
- Test coverage: >80%
- Use structured logging
- Follow naming conventions in AGENTS.md
Extensions
Install useful extensions:
gemini-cli extension install @google/gemini-cli-extension-filesystem
gemini-cli extension install @google/gemini-cli-extension-web
Architecture
See docs/architecture/README.md
---
## Bootstrap CLI Tool
### Installation
```bash
# Install globally
npm install -g agent-bootstrap
# Or use directly
npx agent-bootstrap init
Commands
agent-bootstrap init
agent-bootstrap interview
agent-bootstrap generate agents
agent-bootstrap generate docs
agent-bootstrap add-domain <name>
agent-bootstrap validate
agent-bootstrap readiness
Interactive Mode
$ agent-bootstrap init
๐ Agent-First Project Bootstrap
Phase 1: Vision & Goals
โโโโโโโโโโโโโโโโโโโโโโโ
? What are we building? (one-line description)
> A task management API with real-time collaboration
? Who are the target users?
> Small teams, remote workers
? What does success look like?
> 1. < 200ms API response time
> 2. Real-time sync < 1s latency
> 3. 99.9% uptime
? Time constraints?
> MVP in 2 weeks
Phase 2: Architecture & Domains
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
? Core domains (comma-separated)
> Users, Tasks, Collaboration, Notifications
? Layers per domain
> Types, Config, Repo, Service, Runtime, UI
? Cross-cutting concerns
> Auth, Logging, Feature Flags
Phase 3: Agent Configuration
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
? Coding conventions file?
> Use defaults
? Enable agent-to-agent review?
> Yes
? Test coverage threshold?
> 80%
Phase 4: Documentation
โโโโโโโโโโโโโโโโโโโโโ
? Docs location?
> docs/
? Generate all docs?
> Yes
โจ Generating project structure...
Created:
โ AGENTS.md
โ CLAUDE.md
โ COPILOT.md
โ GEMINI.md
โ docs/design/README.md
โ docs/architecture/README.md
โ docs/quality/domains.md
โ docs/plans/active/
โ docs/debt.md
โ .github/workflows/ci.yml
โ tests/
๐ฏ Next steps:
1. Review AGENTS.md
2. Fill in docs/design/ for each domain
3. Run: agent-bootstrap validate
4. Start coding with your AI tool!
Validation Checklist
$ agent-bootstrap validate
Checking Agent-First readiness...
โ AGENTS.md exists (< 200 lines)
โ AGENTS.md has architecture section
โ AGENTS.md points to docs/
โ docs/design/ exists
โ docs/architecture/ exists
โ docs/quality/ exists
โ docs/plans/ exists
โ CLAUDE.md, COPILOT.md, or GEMINI.md exists
โ .github/workflows/ exists
โ Test framework configured
Score: 10/10 - Ready for Agent-First development!
Integration with AI Tools
Codex CLI
codex --agents-md AGENTS.md "Build the Users domain"
Claude Code
claude --model sonnet "Build the Users domain following AGENTS.md"
GitHub Copilot
# In VS Code with Copilot Chat:
@workspace Build the Users domain following AGENTS.md architecture.
Ensure:
- Layer constraints (Types โ Service โ UI)
- Test coverage >80%
- Structured logging
Qwen Code
qwen-code "Build Users domain" --agents-md AGENTS.md
Gemini CLI
gemini-cli "Build the Users domain based on docs/design/users.md"
gemini-cli --mcp-config ~/.gemini-cli/mcp-config.json "Build Users domain"
$ gemini-cli
> Build the Users domain following AGENTS.md
[Reason]: I need to read AGENTS.md first, then docs/design/users.md,
understand the layer architecture, and plan implementation.
[Act]: read_file AGENTS.md
read_file docs/design/users.md
read_file src/users/types.ts
[Reason]: I see the Users domain needs Types, Repo, and Service layers.
Let me start with Types layer following existing patterns.
[Act]: write_file src/users/types/User.ts
write_file src/users/types/UserRepository.ts
[Reason]: Now I need to implement the Repo layer with database operations.
[Act]: write_file src/users/repo/UserRepo.ts
[Reason]: Let me run tests to verify my implementation.
[Act]: run_shell_command npm test -- --grep "Users"
[Result]: Tests passed! Coverage: 85%
[Reason]: All tests pass with >80% coverage. Let me add more tests
for edge cases.
[Act]: write_file tests/users/UserRepo.test.ts
[Reason]: Final verification.
[Act]: run_shell_command npm test
[Result]: All tests pass! Users domain complete.
> Done! Users domain implemented following AGENTS.md architecture.
Best Practices
1. Keep AGENTS.md Short
| โ
Good | โ Bad |
|---|
| ~100 lines | 500+ lines |
| Links to docs | All rules inline |
| Table of contents | Encyclopedia |
2. Progressive Disclosure
AGENTS.md (entry point)
โ
docs/architecture/ (layer map)
โ
docs/design/[domain].md (detailed design)
3. Enforce Mechanically
name: Agent Constraints
on: [pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check file sizes
run: find src -name "*.ts" -exec wc -l {} \; | awk '$1 > 300 {exit 1}'
- name: Check layer boundaries
run: node scripts/check-layers.js
- name: Check test coverage
run: npm run coverage -- --min=80
4. Doc-Gardening Agent
agent-bootstrap garden
Example: Full Bootstrap
mkdir my-project && cd my-project
git init
npx agent-bootstrap init
agent-bootstrap validate
codex "Implement the Users domain based on docs/design/users.md"
Templates
docs/design/[domain].md
# [Domain] Design
## Overview
[What this domain does]
## User Stories
1. As a [user], I want to [action]
2. ...
## API Contracts
[Endpoints/Interfaces]
## Data Models
[Schemas/Types]
## Implementation Notes
[Agent-relevant context]
## Quality Gates
- [ ] Unit tests >80%
- [ ] Integration tests pass
- [ ] Performance <200ms
docs/architecture/README.md
# Architecture Overview
## Domains
| Domain | Description | Layers |
|--------|-------------|--------|
| Users | User management | All 6 |
| Tasks | Task CRUD | All 6 |
| ... | ... | ... |
## Layer Rules
Types โ Config โ Repo โ Service โ Runtime โ UI
โ
Providers (auth, telemetry)
## Dependency Rules
- Forward only within domain
- Cross-domain via Service layer only
- Providers inject at Config layer
References
Tools Used
exec - Run agent-bootstrap CLI commands
write - Create AGENTS.md, GEMINI.md, docs structure
read - Read existing project files for context
edit - Modify generated configs
web_fetch - Fetch Gemini CLI documentation
web_search - Search for AI tool best practices
Instructions for Agents
When User Requests Bootstrap
-
Ask clarifying questions (if not provided):
- What AI tool will be used? (codex, claude, copilot, gemini, qwen)
- What is the project domain?
- What are the core features?
-
Generate project structure:
- Create AGENTS.md with architecture overview
- Create tool-specific config (CLAUDE.md, GEMINI.md, etc.)
- Create docs/design/, docs/architecture/, docs/quality/
- Create .github/workflows/ci.yml
-
Validate structure:
- Run agent-bootstrap validate (if available)
- Check all required files exist
-
Report to user:
- List created files
- Provide next steps
For Gemini CLI Specific
- Include GEMINI.md with ReAct workflow instructions
- Document MCP server integration options
- List available tools (read_file, write_file, run_shell_command)
- Provide extension installation examples
For Other Tools
- Claude Code: CLAUDE.md with self-review workflow
- GitHub Copilot: COPILOT.md with @workspace instructions
- Codex: Direct AGENTS.md integration
- Qwen Code: Similar to Codex approach
Created: 2026-03-28
Updated: 2026-03-29 (Added Gemini CLI support)
Purpose: Universal Agent-First project bootstrap tool