Agent OS Documentation

repository·main·Indexed 26 days ago

https://github.com/buildermethods/agent-os

A system for managing and deploying coding standards to ensure AI agents build in alignment with project-specific patterns and conventions. Agent OS provides tools to discover, index, and inject standards into AI context windows, and includes workflows for product planning via `plan-product` and technical specification shaping via `shape-spec`. It is designed to work with AI tools such as Claude Code, Cursor, and Antigravity across any language or framework.

Tokens
3.2K
Snippets
3
Records
17
Agent score
90%

What's inside Agent OS

  1. Overview of Agent OS capabilities

    main

    Agent OS is a lightweight system designed to help developers shape better specifications and keep AI agents aligned with existing codebase patterns. It is designed to work alongside AI tools like Claude Code, Cursor, and Antigravity, supporting any language or framework.

    Core capabilities include:

    • Discover Standards: Extract patterns and conventions from your codebase into documented standards.
    • Deploy Standards: Intelligently inject relevant standards based on the current build context.
    • Shape Spec: Create high-quality plans to improve build outcomes.
    • Index Standards: Organize and make standards discoverable.
  2. Plan Product via interactive conversation

    main

    Use the plan-product process to establish foundational product documentation through an interactive conversation. This process creates three key files in the agent-os/product/ directory: mission.md, roadmap.md, and tech-stack.md.

    Workflow Overview

    1. Check for existing docs: The system checks agent-os/product/ for existing files. You can choose to start fresh, update specific files, or cancel.
    2. Define Product Mission: You will be asked about the problem being solved, target users, and the unique solution.
    3. Outline Roadmap: You will define MVP (must-have) features and post-launch features.
    4. Establish Tech Stack: The system checks for a global standard at agent-os/standards/global/tech-stack.md. You can adopt the standard or specify a custom stack (Frontend, Backend, Database, and Other).
    5. File Generation: The system generates the markdown files based on your inputs.

    Integration Note

    The /shape-spec command reads these files when planning features, so keeping them populated provides essential context for future agent tasks.

  3. Understand the /inject-standards injection scenarios

    main

    The way standards are injected depends on the detected context scenario. The agent determines the scenario by analyzing your conversation or plan mode.

    1. Conversation Scenario

    Used for regular chat, implementing code, or answering questions. The agent reads the full content of the standards directly into the chat.

    2. Creating a Skill Scenario

    Used when building a .claude/skills/ file. The agent will ask if you want to include standards via:

    • References: Adding @ file paths (e.g., @agent-os/standards/api/response-format.md) to keep the skill lightweight.
    • Copy content: Pasting the full text of the standards into the skill for a self-contained file.

    3. Shaping/Planning Scenario

    Used when in plan mode or building a spec (e.g., after running /shape-spec). Like the Skill scenario, you can choose between:

    • References: Adding @ file paths to the plan.
    • Copy content: Pasting the full text of the standards into the plan.
  4. Maintain the standards index file (index.yml)

    main

    The standards index (agent-os/standards/index.yml) is used by the /inject-standards command to quickly match relevant standards to tasks without reading every file. The index maps standards to brief, one-sentence descriptions.

    When to run the indexing process:

    • After manually creating or deleting standards files.
    • If /inject-standards suggestions appear out of sync.
    • To clean up an outdated or messy index.

    Note: The /discover-standards command runs this indexing process automatically as its final step, so manual execution is often unnecessary after discovery.

  5. Run the Shape Spec command

    main

    The shape-spec command is used to gather context and structure planning for significant work.

    CRITICAL REQUIREMENT: This command must be run while the agent is in plan mode. If you attempt to run it outside of plan mode, the process will stop with the following error:

    Shape-spec must be run in plan mode. Please enter plan mode first, then run /shape-spec again.

  6. Understand the Shape Spec process

    main

    The shape-spec process follows a structured sequence to ensure implementation is well-informed:

    1. Clarify Scope: Define exactly what is being built.
    2. Gather Visuals: Collect mockups, wireframes, or screenshots.
    3. Identify References: Locate similar code in the existing codebase to study patterns.
    4. Check Product Context: Align the work with files in agent-os/product/ (e.g., mission.md, roadmap.md).
    5. Surface Standards: Identify relevant patterns from agent-os/standards/index.yml (e.g., api/response-format).
    6. Generate Spec Folder: Create a timestamped directory.
    7. Structure the Plan: Organize tasks, ensuring Task 1 is always saving the spec documentation.
    8. Complete & Execute: Finalize implementation tasks and await approval.
  7. Discover Standards command overview

    main
    The discover-standards command extracts tribal knowledge from your codebase and converts it into concise, documented standards. This process helps ensure that both human developers and AI agents follow consistent patterns. The command follows a structured workflow: determining a focus area, analyzing patterns, interviewing the user to understand the 'why' behind patterns, drafting the standard, creating the file, and updating the central index.
  8. Writing concise standards for AI context

    main

    Because standards are intended to be injected into AI context windows, they must be optimized for token efficiency and scannability. Follow these rules:

    • Lead with the rule: State what to do first, explain why second.
    • Use code examples: Show the pattern rather than just describing it.
    • Skip the obvious: Do not document what the code already makes clear.
    • One standard per concept: Avoid combining unrelated patterns.
    • Bullet points over paragraphs: Prioritize scannability over prose.

    Example of a good standard:

    # Error Responses
    
    Use error codes: `AUTH_001`, `DB_001`, `VAL_001`
    
    ```json
    { "success": false, "error": { "code": "AUTH_001", "message": "..." } }
    • Always include both code and message
    • Log full error server-side, return safe message to client
  9. Troubleshoot /inject-standards errors

    main

    If you encounter issues with the /inject-standards command, check the following:

    • No standards index found: If you see No standards index found. Run /discover-standards first to create standards, or /index-standards if you have standards files without an index., you need to generate or rebuild your standards index.
    • Standard not found: If you provide an incorrect path in Explicit Mode, the agent will report Standard not found: [path] and list available options in that directory to help you correct the path.
    • Incorrect suggestions: If the Auto-Suggest mode provides irrelevant standards, run /index-standards to rebuild the index and ensure descriptions are accurate.
  10. Product documentation file formats

    main

    The plan-product process generates the following files in agent-os/product/:

    mission.md

    Contains the core product vision:

    • ## Problem: The core problem or pain point addressed.
    • ## Target Users: The intended audience.
    • ## Solution: The key differentiator or unique approach.

    roadmap.md

    Contains the development timeline:

    • ## Phase 1: MVP: Must-have features for launch.
    • ## Phase 2: Post-Launch: Planned future features.

    tech-stack.md

    Contains the technical architecture:

    • ## Frontend: Frontend technologies.
    • ## Backend: Backend technologies.
    • ## Database: Database choice.
    • ## Other: Hosting, APIs, and other tools.