Skip to content

StringKe/std-ai

Repository files navigation

std-agent

One source of truth, eleven AI CLI tools.

Go License CI

English | 简体中文 | 繁體中文 | 日本語


stdagent is a lightweight, pure Go CLI that keeps a single .stdai/ directory as the source of truth for your project's AI configuration, then fans it out to 11 AI CLI tools with their native file formats, frontmatter dialects, and quirks handled for you.

Stop maintaining CLAUDE.md, AGENTS.md, GEMINI.md, .cursor/rules/, .windsurf/rules/, .clinerules/, .github/copilot-instructions.md, ... by hand. Edit once, sync everywhere.

Why std-agent?

  • Single source — write rules / skills / commands / references once in YAML frontmatter + Markdown.
  • Eleven targets — Claude Code, Codex, Cursor, GitHub Copilot, Windsurf, Gemini CLI, Aider, Cline, OpenCode, Continue.dev, Antigravity.
  • Zero lock-in — the writer only touches a tiny whitelist of paths; backups before every sync; clean reverses everything.
  • Drift detectionstatus shows files modified outside stdagent; fix reapplies the source.
  • MCP — single .stdai/standards/mcp.json fans out to .mcp.json / .cursor/mcp.json / .vscode/mcp.json
  • Monorepo aware — config lookup walks up from cwd; works from any subdirectory.
  • Self-upgradingstdagent upgrade pulls signed releases from GitHub with sha256 verification and atomic replace.

Supported tools

Tier 1 (9)

Target Primary outputs
Claude Code (Anthropic) CLAUDE.md + .claude/{rules,skills,commands}/ + .mcp.json
Codex (OpenAI) AGENTS.md + .agents/skills/ + .codex/rules/ (byte-budget spillover)
Cursor .cursor/{rules/*.mdc,skills,commands}/ + .cursor/mcp.json
GitHub Copilot .github/{copilot-instructions,instructions,prompts,agents}/ + .vscode/mcp.json
Windsurf (Codeium) .windsurf/{rules,skills,workflows}/
Gemini CLI (Google) GEMINI.md + .gemini/commands/*.toml
Aider reuses AGENTS.md (noop)
Cline .clinerules/ + .clinerules/workflows/
OpenCode .opencode/{agents,commands}/

Tier 2 (2)

Target Primary outputs
Continue.dev .continue/{rules,prompts}/
Antigravity (Google) .agents/{rules,workflows}/

Each integration is documented under docs/targets/.

Quick start

# Install (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/StringKe/std-ai/main/install.sh | sh

# Install (Windows PowerShell)
irm https://raw.githubusercontent.com/StringKe/std-ai/main/install.ps1 | iex

# Initialize in your project
cd your-project
stdagent init

# Edit .stdai/standards/rules/example.md, then sync to all enabled targets
stdagent sync

# Inspect / fix drift
stdagent status
stdagent fix

Commands

Command Purpose
stdagent init Scaffold .stdai/ + config.toml + .stdaiignore + sample standards
stdagent pull Update git-backed sources cached in .stdai/cache/
stdagent sync Core: pull → parse → convert → fan out
stdagent fix Re-sync to repair drift (alias of sync)
stdagent status Per-target drift + last sync time
stdagent clean Remove generated files (preserves .stdai/)
stdagent budget LLM context budget check (chars + token estimate)
stdagent intro Print a migration prompt for an LLM to convert your existing config
stdagent upgrade Self-upgrade from GitHub Releases (sha256 + atomic replace)
stdagent version Build info

Every command supports --help. Full reference: docs/commands.md.

Source format

A complete schema lives in docs/spec.md Part 1. The minimal shape:

---
type: rules                       # rules | skills | commands | references
name: coding-style
description: General coding style
priority: high                    # high | normal | low
targets: [claude-code, codex]     # opt-in (or use exclude_targets to opt-out)
applyTo: ["**/*.go"]
alwaysApply: false
---

# Coding Style

Always use meaningful variable names...

MCP servers (.stdai/standards/mcp.json):

{
  "version": "1.0",
  "servers": {
    "github": { "type": "stdio", "command": "gh", "args": ["api"] },
    "linear": { "type": "http", "url": "https://mcp.linear.app/sse" }
  }
}

Configuration

.stdai/config.toml:

version = "1.0"
inject = true            # inject "Generated by stdagent" footer in outputs
inject_whatis = true     # add a one-line origin note inside skills
auto_pull = true         # pull git sources on every sync
backup = true
backup_keep = 5

[targets]
claude-code  = { enabled = true,  convert = true }
codex        = { enabled = true,  convert = true }
cursor       = { enabled = false, convert = true }
copilot      = { enabled = false, convert = true }
windsurf     = { enabled = false, convert = true }
gemini       = { enabled = false, convert = true }
aider        = { enabled = false, convert = true }
cline        = { enabled = false, convert = true }
opencode     = { enabled = false, convert = true }
continue-dev = { enabled = false, convert = true }
antigravity  = { enabled = false, convert = true }

[sources.default]
url     = "https://github.com/your-org/ai-standards.git"
branch  = "main"
enabled = true
paths   = ["standards/"]

Full reference: docs/config-spec.md.

Project layout

your-project/
├── .stdai/                    Internal management area (single source of truth)
│   ├── config.toml            One config file
│   ├── standards/             Authoring root
│   │   ├── rules/
│   │   ├── skills/
│   │   ├── commands/
│   │   ├── references/
│   │   └── mcp.json           MCP servers (optional)
│   ├── cache/                 Git source cache
│   ├── backups/               Auto-snapshot before each sync
│   └── state.json             Runtime state
├── .stdaiignore               gitignore-style globs to exclude source files
├── CLAUDE.md                  Fan-out: Claude Code
├── AGENTS.md                  Fan-out: Codex / Cursor fallback / Copilot agent / OpenCode / Antigravity
├── GEMINI.md                  Fan-out: Gemini CLI
├── .mcp.json                  MCP for Claude
└── .claude/ .codex/ .cursor/ .github/ .windsurf/ .gemini/ .clinerules/ .opencode/ .continue/ .agents/

Details: docs/file-structure.md.

Monorepo support

When --config is omitted, stdagent walks up from cwd to find the nearest .stdai/config.toml. Run it from any subdirectory and it will locate the monorepo root automatically.

Development

# Toolchain (mise + go + golangci-lint + gofumpt + git-cliff)
mise install

# Common tasks
mise run fmt        # gofumpt + goimports
mise run lint       # golangci-lint
mise run test       # go test -race -cover
mise run check      # fmt + lint + test in one go
mise run build      # produces bin/stdagent
mise run run        # go run ./cmd/stdagent

Documentation

License

MIT — see LICENSE.

About

Synchronize AI CLI configuration (rules / skills / commands / references / MCP) across 11 tools — Claude Code, Codex, Cursor, Copilot, Windsurf, Gemini CLI, Aider, Cline, OpenCode, Continue.dev, Antigravity

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors