agentleFS
HerbHallHerbHall/samverk/AGENTS.md

samverk

AGENTS.md1 starsChanged 9 months agoMITArchived repositoryView on GitHub

Async background development engine -- keeps your project building while you live your life. Multi-forge development workflow manager that manages Git repositories across GitHub, Gitea, and other forges.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

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

10 rules. About 2 are common, 5 are distinctive, and 3 are very specific to this project.

  • ≈2

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    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:

    Create a feature branch for every change (feature/issue-NNN-description)

    line 82
  2. Very specific:

    Use conventional commits: feat:, fix:, refactor:, docs:, test:, chore:

    line 83
  3. Distinctive:

    Run build, test, and lint before opening a PR

    line 84
  4. Distinctive:

    Write table-driven tests with descriptive names

    line 85
  5. Distinctive:

    Commit directly to main -- always use feature branches

    line 100
  6. Very specific:

    Use --no-verify or --force flags

    line 102
  7. Common:

    Commit secrets, credentials, or API keys

    line 103
  8. Distinctive:

    Add TODO comments without a linked issue number

    line 104
  9. Common:

    Safety: Never force-push main. Never skip hooks.

    line 113
  10. Distinctive:

    Honesty: Never mark work as complete when it is not.

    line 114

≈ “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
<!-- Scope: AGENTS.md guides the Copilot coding agent and Copilot Chat. For code completion and code review patterns, see .github/copilot-instructions.md and .github/instructions/*.instructions.md For Claude Code, see CLAUDE.md -->

Samverk

Async background development engine -- keeps your project building while you live your life. Multi-forge development workflow manager that manages Git repositories across GitHub, Gitea, and other forges.

Tech Stack

  • Language: Go 1.25 -- single binary with Cobra subcommands (samverk serve, samverk dispatch, samverk config)
  • AI Providers: Anthropic Claude API (primary), OpenAI/GPT-4, Gemini, Ollama (local containers)
  • Web Dashboard: React 19 + TypeScript + Vite, embedded in Go binary via embed.FS
  • Frontend: shadcn/ui, Tailwind CSS, TanStack Query, Zustand, Recharts
  • State: Git issues (tasks) + SQLite (sessions, cost, audit) + YAML (config)
  • Git Forge: GitHub (primary), Gitea (self-hosted), abstracted behind IssueTracker interface
  • SDKs: Gitea SDK, GitHub Go SDK, MCP Go SDK
  • Testing: Go stdlib + table-driven tests, Vitest + Testing Library (frontend)
  • Build: Make + GoReleaser
  • CI/CD: GitHub Actions
  • Linting: golangci-lint v2 (Go), ESLint + TypeScript (frontend), markdownlint (docs)

Build and Test Commands

# Build (compiles frontend first, then Go binary)
make build          # or: go build ./...

# Test
make test           # or: go test ./...

# Lint
make lint           # or: golangci-lint run ./...

# Markdown lint
make lint-md

# Full verification (run before any PR)
make ci             # or: go build ./... && go test ./... && golangci-lint run ./...

# Frontend only
make web            # Build frontend to internal/server/static/
make dev-web        # Run Vite dev server

Project Structure

samverk/
├── cmd/samverk/              # Single binary entrypoint (Cobra subcommands)
├── internal/
│   ├── server/               # HTTP server (MCP + API + embedded SPA)
│   ├── api/                  # REST API handlers for dashboard
│   ├── mcp/                  # MCP protocol handler (Streamable HTTP)
│   ├── dispatcher/           # Issue watcher, task router, dependency DAG
│   ├── digest/               # Check-in digest builder and formatting
│   ├── forge/                # IssueTracker interface + GitHub/Gitea implementations
│   ├── agent/                # Agent runtime, container management
│   ├── provider/             # AI provider clients (Claude, OpenAI, Ollama)
│   ├── autonomy/             # Trust tier evaluation engine
│   ├── profile/              # User profile management
│   ├── cost/                 # Token tracking, budget, attribution
│   ├── store/                # SQLite persistence layer
│   └── version/              # Build version injection (ldflags)
├── pkg/models/               # Shared types (Issue, Agent, Action, etc.)
├── web/                      # React SPA dashboard (Vite + TypeScript + pnpm)
├── docs/                     # Design docs and ADRs
├── deploy/                   # Deployment configurations
├── scripts/                  # Build and utility scripts
├── bin/                      # Compiled binaries (gitignored)
├── .github/workflows/        # CI/CD pipelines
└── Makefile                  # Build and development tasks

Workflow Rules

Always Do

  • Create a feature branch for every change (feature/issue-NNN-description)
  • Use conventional commits: feat:, fix:, refactor:, docs:, test:, chore:
  • Run build, test, and lint before opening a PR
  • Write table-driven tests with descriptive names
  • Wrap errors with context: fmt.Errorf("operation: %w", err)
  • Fix every error you find, regardless of who introduced it

Ask First

  • Adding new dependencies (check if stdlib covers the need)
  • Architectural changes (new packages, major interface changes)
  • Database schema migrations
  • Changes to CI/CD workflows
  • Removing or renaming public APIs
  • Changes to the forge abstraction layer (IssueTracker interface)

Never Do

  • Commit directly to main -- always use feature branches
  • Skip tests or lint checks -- even for "small changes"
  • Use --no-verify or --force flags
  • Commit secrets, credentials, or API keys
  • Add TODO comments without a linked issue number
  • Mark work as complete when build, test, or lint failures remain

Core Principles

These are unconditional -- no optimization or time pressure overrides them:

  1. Quality: Once found, always fix, never leave. There is no "pre-existing" error.
  2. Verification: Build, test, and lint must pass before any commit.
  3. Safety: Never force-push main. Never skip hooks. Never commit secrets.
  4. Honesty: Never mark work as complete when it is not.

Error Handling

// Wrap errors with context -- every return site should add meaning
if err != nil {
    return fmt.Errorf("load config: %w", err)
}

// Use sentinel errors for caller-distinguishable conditions
var ErrNotFound = errors.New("not found")
if errors.Is(err, ErrNotFound) { ... }

Testing Conventions

// Table-driven tests with descriptive names
func TestFunctionName(t *testing.T) {
    tests := []struct {
        name    string
        input   string
        want    string
        wantErr bool
    }{
        {
            name:  "valid input returns expected output",
            input: "example",
            want:  "result",
        },
        {
            name:    "empty input returns error",
            input:   "",
            wantErr: true,
        },
    }

    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            got, err := FunctionName(tt.input)
            if (err != nil) != tt.wantErr {
                t.Errorf("FunctionName() error = %v, wantErr %v", err, tt.wantErr)
            }
            if got != tt.want {
                t.Errorf("FunctionName() = %v, want %v", got, tt.want)
            }
        })
    }
}

Commit Format

feat: add user authentication endpoint

Implements JWT-based login and token refresh. Tokens expire after 1h.

Closes #42
Co-Authored-By: GitHub Copilot <copilot@github.com>

Types: feat (new feature), fix (bug fix), refactor (no behavior change), docs (documentation only), test (tests only), chore (build/tooling).

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.