bastion: Agent for Claude Code

.claude/agents/_bastion-conventions.md

_bastion-conventions is an agent for Claude Code from JoakimCarlsson/bastion. It costs 0 tokens per session (746 once invoked), scanned A, original, MIT.

A set of project instructions for coding agents working in a Go codebase. It tells them what files to read, how the code should be organised, and how to verify changes.

In plain words
What is it for?
Guiding planning, implementation, API testing, handoffs, and package structure in this project.
Why use it?
It gives agents the repository’s rules and prevents incomplete checks, such as testing an HTTP route without calling the running service.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

This is JoakimCarlsson/bastion's own configuration. It tells Claude Code how to work on bastion itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything bastion configures →

Reuse

Borrowing it

Nothing to install: this file belongs to JoakimCarlsson/bastion. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/JoakimCarlsson/bastion/main/.claude/agents/_bastion-conventions.md
Clone the repo
git clone --depth 1 https://github.com/JoakimCarlsson/bastion

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for _bastion-conventions

README.md
[![agentmods](https://agentmods.dev/badge/agents/joakimcarlsson/bastion/_bastion-conventions/github.svg)](https://agentmods.dev/agents/joakimcarlsson/bastion/_bastion-conventions)
Your own site
<a href="https://agentmods.dev/agents/joakimcarlsson/bastion/_bastion-conventions"><img src="https://agentmods.dev/badge/agents/joakimcarlsson/bastion/_bastion-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for _bastion-conventions

Your own site · 80×15
<a href="https://agentmods.dev/agents/joakimcarlsson/bastion/_bastion-conventions"><img src="https://agentmods.dev/badge/agents/joakimcarlsson/bastion/_bastion-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 746 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00746
Opus 5 $0.00000 $0.00373
Sonnet 5 $0.00000 $0.00149
Haiku 4.5 $0.00000 $0.00075

Measured 9d ago against content hash cefa34c260c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

_bastion-conventions scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

2. **New or changed API routes:** start the API (`go run ./cmd/api`, `docker compose up`, or `commands_to_verify.serve`), then **`curl` every new/changed endpoint** — record status and body; compare to acceptance criteri
.claude/agents/_bastion-conventions.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bastion conventions (all delivery agents)

Read repo-root AGENTS.md first, then docs/backend-architecture.md, then LEARNINGS.md, before planning or implementing.

Verification — mandatory E2E

  1. Everything observable must be verified end-to-end. Unit tests alone are not enough for HTTP APIs or running services.
  2. New or changed API routes: start the API (go run ./cmd/api, docker compose up, or commands_to_verify.serve), then curl every new/changed endpoint — record status and body; compare to acceptance criteria.
  3. smoke-tester must not mark pass without live endpoint evidence when the issue touches HTTP.
  4. coder must list every new/changed route in its handoff with concrete expect values.

Architecture (Go)

Package by subsystem (bounded context), not by layer. Top-level dirs under internal/ are domain slices. Flat packages with many .go files; sub-folders only when a sub-feature has its own vocabulary and ~10+ files.

Forbidden:

internal/
  controllers/
  services/
  repositories/
  models/

Layout:

bastion/
  cmd/api/main.go
  deps/minmux/              # git submodule
  migrations/
  docs/backend-architecture.md
  internal/
    health/                 # pure domain
    http/                   # minmux routes, static SPA
    store/                  # DB pool + migrate
  web/                      # Bun + React SPA — all frontend here
Rule Detail
Domain purity internal/<subsystem>/ — no net/http, no HTTP request DTOs
HTTP internal/http/*_endpoint.go per subsystem; minmux routes
SQL internal/<subsystem>/store.go — not internal/repositories/
Shared DB internal/store/ — pool + migrate only
main.go Wiring only — env, pool, http.NewHandler, listen

When adding a subsystem: domain package → optional store.gohttp/<name>_endpoint.go → wire in NewHandler. Mirror internal/health + health_endpoint.go.

Pipeline note

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 56 lines · 0 tokens per session scan A cefa34c260c5

Subscribe to this mod's changes

_bastion-conventions is an agent published in the GitHub repository JoakimCarlsson/bastion (2 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 746 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.