agentleFS
xsovad06xsovad06/sova/AGENTS.md

sova

AGENTS.md2 starsChanged 3 months agoApache-2.0View on GitHub

This file provides cross-cutting guidance for any AI agent (Claude Code, Cursor, CodeRabbit, etc.) working in this repository. SOVA (Software Orchestration Via Agents) is a standalone application that any software project can install to gain autonomous AI-assisted development capabilities. It takes issues from your tracker, develops solutions using TDD, self-reviews, creates PRs, monitors CI, addresses review feedback, and learns from mistakes. The system is written in Python (CLI, roles, scheduler, dashboard).

  • Reads credentials

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

33 rules. About 0 are common, 15 are distinctive, and 18 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 18

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    GitHub account: use the github_user configured in sova.toml (verify with gh auth status)

    line 97
  2. Very specific:

    Create feature branch: feat/<name>, fix/<name>, or refactor/<name>

    line 103
  3. Very specific:

    After merge: run /after-merge

    line 106
  4. Very specific:

    Quoting: always double-quote variables ("$var", "${arr[@]}")

    line 112
  5. Very specific:

    Functions: use snake_case, declare local variables

    line 113
  6. Very specific:

    ShellCheck: all bash scripts must pass shellcheck with no warnings

    line 115
  7. Very specific:

    No bashisms in shebangs: use #!/usr/bin/env bash

    line 116
  8. Distinctive:

    No emojis: not in code or documentation

    line 121
  9. Very specific:

    Falsy-default trap: never use x or default when x can be a legitimate falsy non-None value (0, "", [], False).

    line 125
  10. Very specific:

    Headings: use ATX style (#, ##, ###)

    line 130
  11. Distinctive:

    No emojis: not in documentation

    line 131
  12. Very specific:

    Code blocks: always specify language (`bash, `python, etc.)

    line 132
  13. Very specific:

    Bash script contract: every script under invariants/ and .github/scripts/ must handle --help gracefully and stay executable (CI enforces …

    line 138
  14. Distinctive:

    Keep docs concise: document what exists, not plans

    line 148
  15. Very specific:

    Always assign PRs to the user configured as github_user in sova.toml

    line 165
  16. Distinctive:

    Never include "Generated with Claude Code" or similar AI branding in PR descriptions

    line 167
  17. Very specific:

    Run shellcheck on changed bash scripts before committing

    line 173
  18. Distinctive:

    Run tests and linters before creating PRs

    line 174
  19. Distinctive:

    Read any file in the repo to understand context

    line 176
  20. Distinctive:

    Create feature branches from main

    line 177
  21. Distinctive:

    Add, remove, or upgrade dependencies

    line 182
  22. Distinctive:

    Delete files or branches

    line 183
  23. Distinctive:

    Run commands that affect external services (GitHub API writes, notifications)

    line 186
  24. Distinctive:

    Add AI co-author lines or AI branding in commits/PRs

    line 189
  25. Very specific:

    Commit secrets (.env, credentials, API keys)

    line 191
  26. Very specific:

    Commit generated files (.DS_Store, __pycache__/, *.pyc, dashboard/.venv/)

    line 192
  27. Distinctive:

    Use fix-on-fix commits -- squash fixes into the commit they fix

    line 193
  28. Distinctive:

    Create separate doc commits for changes in the same PR

    line 194
  29. Distinctive:

    Use emojis in code, documentation, or commit messages

    line 195
  30. Distinctive:

    Before any push: ask the user for explicit approval

    line 204
  31. Very specific:

    After any merge: run /after-merge (pull main, delete branches, update memory)

    line 205
  32. Very specific:

    Before creating PR: run /review (lint, test, review changes)

    line 206
  33. Very specific:

    Commit policy: no fix-on-fix, no separate doc commits for changes in the same PR.

    line 207

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AI Agent Guidance for SOVA

This file provides cross-cutting guidance for any AI agent (Claude Code, Cursor, CodeRabbit, etc.) working in this repository.

SOVA (Software Orchestration Via Agents) is a standalone application that any software project can install to gain autonomous AI-assisted development capabilities. It takes issues from your tracker, develops solutions using TDD, self-reviews, creates PRs, monitors CI, addresses review feedback, and learns from mistakes. The system is written in Python (CLI, roles, scheduler, dashboard).

Context Index

FilePurpose
CLAUDE.mdClaude Code-specific commands, run instructions, knowledge system
AGENTS.mdCross-cutting conventions for all AI tools (this file)
README.mdProject overview, installation, usage
docs/VISION.mdProduct vision and roadmap
.claude/rules/architecture.mdProject structure, key paths, design decisions
docs/architecture-deep-dive.mdOn-demand: full narrative entries indexed (not duplicated) in architecture.md's "Supporting Modules" and "Key Design Decisions" sections
.claude/rules/bash-patterns.mdShell scripting conventions and gotchas
.claude/rules/workflow.mdDevelopment workflow and task finding
docs/model-selection-architecture.mdLLM model routing, provider abstraction, design details
docs/model-selection-risk-assessment.mdModel selection risks, migration path, rollback strategy
docs/model-selection-migration-guide.mdConfig shape for openai/ollama/vertex provider types
docs/security-guidelines.mdCredential handling, input sanitization, subprocess safety
docs/performance-guidelines.mdTimeouts, caching, concurrency, async patterns
docs/error-handling-guidelines.mdExceptions, logging, retries, fallbacks, circuit breakers
docs/api-contracts-guidelines.mdDashboard API, adapter ABC, LLM output formats
docs/database-guidelines.mdORM models, session management, migrations
docs/testing-guidelines.mdpytest patterns, fixtures, mocking, test isolation
docs/integration-guidelines.mdGitHub/Jira/SonarCloud integration, handoff protocol
docs/jira-configuration-guide.mdJira Cloud setup, JQL filters, status mapping, troubleshooting

Project Structure

sova/
  sova/                            # Python package (SOVA)
    cli/                           # Typer CLI (sova run, sova triage, etc.)
      app.py                       # Main app, subcommand registration
      commands/                    # Command modules (run, triage, harden, project, pr, admin, briefing, memory, migrate, commands, server, mcp, supervisor)
    core/                          # Workflow engine, steps, state machine, context, output writer, DAG executor
    roles/                         # Agent roles (triage, researcher, developer, reviewer, custom, planner, dispatcher)
    adapters/                      # Task source plugins (github; jira, linear, manual planned)
    llm/                           # Claude CLI wrapper, cost tracking
    git/                           # Git operations (branch, pr, rebase), worktree management
    ipc/                           # Inter-process: handoff protocol, process control, notifications
    agents/                        # RuntimeAdapter ABC: where each coding-agent runtime (claude-code, codex) reads its commands/skills from on disk
    knowledge/                     # Memory CRUD, tier loading, personas, review patterns
    scheduler/                     # Watch loop, parallel executor, server daemon
    dashboard/                     # FastAPI web UI
      app.py                       # App factory
      routers/                     # 33 API routers (auth, overview, runs, costs, briefing, control, feed, handoff, lifecycle, memory, models, logs, tasks, queue, quota, reliability, settings, setup, agents, work, roles, spec, prs, dependencies, dependency_health, resources, supervisor, oversight, fleet_manager, fleet_insights, telemetry, a2a, mcp)
      services/                    # 49 services (run, cost, memory, models, control, feed, handoff, lifecycle, queue, batch, reliability, work, work_item, work_state, work_verdict, task, log, settings, setup, agent_lifecycle, agent_output, agent_recovery, agent_handoff, agent_pool, agent_db, agent_status, agent_context, agent_progress, agent_validation, agent_approval, agent_finalize, agent_resource, output, role, spec, pr, pr_metrics, resource, llm_suggestion, output_stream, fleet, fleet_manager, supervisor, oversight, telemetry_push, merge_queue_monitor, mcp_service, awareness, dependency_health)
      templates/                   # Jinja2 HTML (Catppuccin dark + Tailwind)
      static/                      # JS + CSS + favicon + logo
    a2a/                           # A2A (Agent-to-Agent) protocol: agent card generation, task state mapping
    mcp/                           # MCP stdio server (provider-agnostic agent tools via Model Context Protocol)
    dashboard/routers/mcp.py       # MCP HTTP endpoint for agent self-inspection (read-only runtime queries)
    dashboard/services/mcp_service.py  # MCP token generation/validation and tool handlers
    awareness/                     # Awareness subsystem (AwarenessProvider ABC, AwarenessItem, ItemCategory, provider registry, BriefingService aggregation engine, rendering models, rendering/cli_renderer.py Rich terminal output)
    oversight/                     # Oversight agent: background daemon, operations persona (user-maintained LLM guidance)
    supervisor/                    # Supervisor-level services (TaskProgressionEngine, CodeRabbit quota, task dependency graph)
      gates/                       # Gate check functions (one per module): rate_limit, connectivity, memory_pressure, dependency, human_involvement, quota, ci_budget, slots, budget, already_running, repeated_failure, ownership, merge_conflict, file_conflict, circuit_breaker, review_completed
    commands/                      # Command + guideline distribution (catalog, templates, manifest, distribution)
    config/                        # Pydantic Settings + TOML config + project registry + request context
    monitoring/                     # Resource monitoring (psutil-based CPU, memory, I/O tracking)
    db/                            # SQLAlchemy ORM models + async session
    utils/                         # Logging, shell, formatting
  commands/                        # 28 standardized commands (markdown with category frontmatter)
  .claude/commands/                # Rendered copy Claude Code loads (generated by `make commands-render`)
  .claude-plugin/marketplace.json  # Claude Code plugin marketplace manifest (direct-install source, points at plugins/sova)
  plugins/sova/                    # Standalone Claude Code plugin: subset of commands (develop, spec, review, pr, debug, test) adapted for any project without installing SOVA
  .githooks/                       # Git hooks (tracked, mirroring CI checks)
  .github/scripts/                 # CI gate scripts (bash, unit-tested from tests/)
  invariants/                      # Pre-push constraint check scripts (bash)
  guidelines/                      # Distributable guideline templates (installed to .claude/rules/)
  skills/                          # Distributable skill templates (installed to .claude/skills/)
  personas/                        # Tech-stack-specific guidance (markdown)
  knowledge/
    KNOWLEDGE.md                   # 4-tier knowledge management system
  templates/                       # Project scaffolding templates
  deploy/                          # systemd + launchd service files
  tests/                           # pytest suite (10400+ tests)
  docs/
    VISION.md                      # Product vision and roadmap
    ARCHITECTURE.md                # Architecture overview (points to .claude/rules/)
    *-guidelines.md                # Domain-specific guidelines (7 files)
    design-system.md               # Dashboard design system reference
    handoff-protocol.md            # Agent handoff protocol
    naming-journey.md              # How SOVA got its name
  assets/
    agent-icon.png                 # Notification icon

Project Tracker

This project uses GitHub Issues with a project board.

  • GitHub account: use the github_user configured in sova.toml (verify with gh auth status)
  • Issue templates: .github/ISSUE_TEMPLATE/ (bug.md, feature.md, task.md)
  • Labels: type: (feature/task/infra/bug/epic), priority: (critical/high/medium/low), area: (agent/dashboard/commands/personas/invariants/knowledge/docs), agent: (triaged/researched/ready/in-progress/in-review/needs-spec/needs-research/human-only)

Ticket workflow

  1. Pick an open issue
  2. Create feature branch: feat/<name>, fix/<name>, or refactor/<name>
  3. Develop using TDD approach (/develop, /test)
  4. PR links to issue via Closes #<number>
  5. After merge: run /after-merge

Key Conventions

Code Patterns: Bash (invariants)

  • set -euo pipefail at the top of every script
  • Quoting: always double-quote variables ("$var", "${arr[@]}")
  • Functions: use snake_case, declare local variables
  • Exit codes: 0 = success, 1 = error, 2 = usage error
  • ShellCheck: all bash scripts must pass shellcheck with no warnings
  • No bashisms in shebangs: use #!/usr/bin/env bash

Code Patterns: Python (CLI, agent, dashboard)

  • Type hints: required on all function signatures
  • f-strings: preferred for string formatting
  • No emojis: not in code or documentation
  • No double dashes: never use -- as a separator in prose, comments, descriptions, PR bodies, review comments, or any text output. Use a colon, period, comma, or parentheses instead. Example: Fixed: updated type hint not Fixed -- updated type hint. This applies everywhere: code comments, commit messages, PR descriptions, review findings, issue bodies, command descriptions, and documentation.
  • Line length: 120 max
  • Formatter: Ruff (lint + format) when available
  • Falsy-default trap: never use x or default when x can be a legitimate falsy non-None value (0, "", [], False). It silently discards the real value. Use x if x is not None else default or an explicit membership/identity check instead.
  • Reading text files: always specify encoding="utf-8" and catch (OSError, UnicodeDecodeError): bare path.read_text() uses the platform default encoding, and UnicodeDecodeError is not a subclass of OSError, so an except OSError guard alone still crashes on a non-UTF-8 file. This applies to any "read a file, return None on failure" helper, and equally to any read inside a loop over many files where one bad file must not abort the whole batch. Confirmed three times: sova/core/steps/spec.py (PR #680), sova/dashboard/services/settings_service.py (PR #1070), and sova/commands/distribution.py:_reverse_diff_files() (issue #695, a per-file loop where the guard continues past the unreadable file instead of returning None). By the third confirmation the pattern was extracted into a single shared helper, read_text_or_none() in sova/utils/files.py, used by sova/commands/distribution.py (_diff_files, _reverse_diff_files, _update_files) and sova/dashboard/services/settings_service.py, rather than adding a fourth and fifth hand-rolled copy in the same PR that documented the convention (issue #695 review).

Code Patterns: Markdown (commands, personas, knowledge)

  • Frontmatter: commands use YAML frontmatter (name, description, user-invocable)
  • Headings: use ATX style (#, ##, ###)
  • No emojis: not in documentation
  • Code blocks: always specify language (bash, python, etc.)

Testing

  • All checks: make check (lint + test, CI-equivalent)
  • Bash scripts: make lint-bash (shellcheck on invariants/ + .github/scripts/) + make test-bash (--help smoke test on both)
  • Python: make test-py (pytest suite in tests/ covering all sova/ modules)
  • Bash script contract: every script under invariants/ and .github/scripts/ must handle --help gracefully and stay executable (CI enforces both)
  • Commands: validate markdown structure (frontmatter, sections)

Documentation

  • Every code change must leave docs accurate -- verify before committing
  • README.md -- update when project structure, features, usage, or commands change
  • CLAUDE.md -- update when run commands, knowledge tiers, or workflow change
  • AGENTS.md -- update when conventions, testing, or tooling change
  • .claude/rules/architecture.md -- update when components, config, or design decisions change
  • docs/VISION.md -- update when roadmap phases change
  • Keep docs concise: document what exists, not plans
  • The /review command checks doc freshness automatically -- stale docs score 4/10+

Commit Messages

Conventional commits format: type(scope): short description. Types: feat, fix, refactor, test, docs, chore, ci. Scopes: dashboard, commands, personas, invariants, knowledge, cli, docs, scheduler, ipc, adapters, roles, core, config, supervisor, mcp, monitoring, db, awareness, oversight. The ci type is scopeless (repo-wide infrastructure); all other types require a scope.

Examples:

  • feat(adapters): add Linear task source adapter
  • fix(dashboard): correct cost tracking calculation
  • refactor(cli): simplify argument parsing
  • ci: add invariants job to CI pipeline
  • docs(readme): update installation instructions

Pull Requests

  • Always assign PRs to the user configured as github_user in sova.toml
  • Link to issue via Closes #<number> in PR body
  • Never include "Generated with Claude Code" or similar AI branding in PR descriptions
  • Include a Test Plan section

Agent Autonomy Boundaries

Always do (no approval needed):

  • Run shellcheck on changed bash scripts before committing
  • Run tests and linters before creating PRs
  • Fix lint/shellcheck warnings in code you wrote
  • Read any file in the repo to understand context
  • Create feature branches from main

Ask first (requires explicit user approval):

  • Push to remote / create PRs
  • Modify database schemas or migration files
  • Add, remove, or upgrade dependencies
  • Delete files or branches
  • Modify CI/CD pipeline configuration
  • Change project configuration files (sova.toml, .claude/settings.json)
  • Run commands that affect external services (GitHub API writes, notifications)

Never do:

  • Add AI co-author lines or AI branding in commits/PRs
  • Force-push to main/master
  • Commit secrets (.env, credentials, API keys)
  • Commit generated files (.DS_Store, __pycache__/, *.pyc, dashboard/.venv/)
  • Use fix-on-fix commits -- squash fixes into the commit they fix
  • Create separate doc commits for changes in the same PR
  • Use emojis in code, documentation, or commit messages
  • Skip pre-commit hooks (--no-verify)

Role Chaining and Circuit Breaker

Agents chain autonomously: Developer -> Reviewer -> Developer (address review) -> Reviewer (re-review). The address-review circuit breaker prevents infinite bot re-review loops (e.g., CodeRabbit repeatedly requesting changes). It counts completed address cycles for a PR: a developer run with an address_review StepExecution, or a command:address-pr run, so both the autonomous pipeline and the /address-pr command consume the same budget. When the count reaches pipeline.max_address_review_cycles (default 2, 0=unlimited), auto-execution is blocked and a manual-only handoff is written so the dashboard shows "Address Review (manual)" and "Integrate PR" buttons; the supervisor's own SPAWN_ADDRESS_PR/SPAWN_ADDRESS_REVIEW actions are blocked by the same gate. See .claude/rules/architecture.md for full details.

Development Workflow

  • SSH: repo-level core.sshCommand is configured for the personal key
  • Before any push: ask the user for explicit approval
  • After any merge: run /after-merge (pull main, delete branches, update memory)
  • Before creating PR: run /review (lint, test, review changes)
  • Commit policy: no fix-on-fix, no separate doc commits for changes in the same PR. Use /rearrange-commits before pushing.

Agentic Workflow Commands

This repo has Claude Code commands in .claude/commands/:

Planning

  • /spec -- produce a structured spec document for an issue; approving it guides /develop

Core Development

  • /develop -- implement a feature or fix (TDD approach)
  • /develop-full -- full workflow: TDD, lint, test, self-review, commit organization
  • /test -- run linter and tests iteratively
  • /review -- pre-push code review with scoring and auto-fix (>=3/10)
  • /review-full -- full pre-push pipeline: simplify -> review -> rearrange-commits
  • /debug -- systematic debugging workflow

Pull Requests

  • /pr -- create PR with standard template (supports AI feedback + incremental workflows)
  • /rearrange-commits -- reorganize branch commits into clean steps

Shipping Pipeline

  • /integrate-pr -- full pipeline: rebase, CI, merge, cleanup, learn (one click)
  • /approve-merge -- merge PR (squash), delete branch, post-merge cleanup
  • /agent-resume -- smart router: assess PR state and decide next action

Post-Work

  • /after-merge -- post-merge cleanup
  • /ingest-review -- extract review feedback into agent memory
  • /extract-knowledge -- promote learnings across knowledge tiers

Project Management

  • /new-feature -- set up a new feature branch
  • /standup -- daily context summary
  • /find-task -- browse GitHub Issues backlog

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.