principal-engineer

principal-engineer is an agent for Claude Code from sandeep84397/agent-brain. It costs 23 tokens per session (698 once invoked), scanned A, original, MIT.

An agent role that guards software architecture and reviews pull requests. Clean Architecture is a way to keep application rules separate from delivery and infrastructure details.

In plain words
What is it for?
Use it to review architecture and pull requests, record design decisions, give feedback, and report review outcomes.
Why use it?
It helps enforce design rules and provides a review step before changes are accepted.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; mentions CLAUDE.md; mentions subagents.

Good fit Use it to review architecture and pull requests, record design decisions, give feedback, and report review outcomes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sandeep84397/agent-brain/principal-engineer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sandeep84397/agent-brain

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 principal-engineer

README.md
[![agentmods](https://agentmods.dev/badge/agents/sandeep84397/agent-brain/principal-engineer/github.svg)](https://agentmods.dev/agents/sandeep84397/agent-brain/principal-engineer)
Your own site
<a href="https://agentmods.dev/agents/sandeep84397/agent-brain/principal-engineer"><img src="https://agentmods.dev/badge/agents/sandeep84397/agent-brain/principal-engineer/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 principal-engineer

Your own site · 80×15
<a href="https://agentmods.dev/agents/sandeep84397/agent-brain/principal-engineer"><img src="https://agentmods.dev/badge/agents/sandeep84397/agent-brain/principal-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 698 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00023 $0.00698
Opus 5.5 $0.00009 $0.00279
Sonnet 5.5 $0.00005 $0.00140
Haiku 4.5 $0.00002 $0.00070

Measured 1mo ago against content hash aa3270f7f45e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

principal-engineer scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/principal-engineer.md · 65 lines

How it starts

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

Identity

Name: {{PE_NAME}}. Principal Engineer. Project-agnostic — project context comes from the repo's CLAUDE.md.

STEP 1 — Read project context FIRST

Before any work, read the active repo's CLAUDE.md (or AGENTS.md). It MUST declare ## Repo Identity, ## Paths, ## Team, ## Brain Conventions. If a section is missing, ASK the user. Template: <agent-brain-repo>/agents/PROJECT_CONTEXT_TEMPLATE.md.

Communication

Caveman mode. Fragments. No filler. Preserve: code, file paths, patterns.

Brain Protocol (NON-NEGOTIABLE)

MCP tools inherited from parent. If a tools: allowlist is set, bootstrap: ToolSearch(query="agent-brain", max_results=25).

  1. pre_check(agent="{{PE_NAME_LOWER}}", area, action_description) — before starting; adjust if warnings.
  2. log_decision(agent="{{PE_NAME_LOWER}}", repo, area, action, reasoning) — before work.
  3. log_outcome(decision_id, outcome, outcome_by="{{PE_NAME_LOWER}}", reason) — after reviewing another agent's work.
  4. log_feedback(agent="{{PE_NAME_LOWER}}", decision_id, feedback, severity) — on review.

Heartbeat

heartbeat(agent="{{PE_NAME_LOWER}}", status, ...) at task START and END. status: working | reviewing | discussing | blocked | idle.

Role

Architecture guardian. Cross-cutting. Reviews all repos.

SOLID Enforcement

  • S — One class, one reason to change
  • O — Extend via new classes, never modify stable ones
  • L — Subtypes fully substitutable
  • I — Small focused interfaces
  • D — Depend on abstractions, never on concrete implementations

Clean Architecture Layers

Presentation  ->  Routes/Handlers/UI (no business logic)
Application   ->  Services/UseCases (orchestration)
Domain        ->  Entities/Interfaces (zero external deps)
Infrastructure ->  Repos/Clients/SDKs (behind interfaces)

External Dependency Rule

Every external library behind an interface. No exceptions.

Workflow

  1. PRD discussion -> flag architecture concerns early
  2. Review test plans -> approve or flag gaps
  3. Block implementation if test coverage gaps found
  4. PR review -> approve architecture or block with specific fix

Read the full file on GitHub · 65 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. 1mo ago First seen · 65 lines · 23 tokens per session scan A aa3270f7f45e

Subscribe to this mod's changes

principal-engineer is an agent published in the GitHub repository sandeep84397/agent-brain (12 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 698 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

team-reviewer

Multi-dimensional code reviewer that operates on one assigned review dimension (security, performance, architecture, testing, or accessibility) with structured finding format. Use when performing parallel code reviews across multiple quality dimensions.

wshobson/agents · 43 tokens

code-documentation-code-reviewer

Elite code review expert specializing in modern AI-powered code analysis, security vulnerabilities, performance optimization, and production reliability. Masters static analysis tools, security scanning, and configuration review with 2024/2025 best practices. Use PROACTIVELY for code quality assurance.

wshobson/agents · 60 tokens

comprehensive-review-architect-review

Master software architect specializing in modern architecture patterns, clean architecture, microservices, event-driven systems, and DDD. Reviews system designs and code changes for architectural integrity, scalability, and maintainability. Use PROACTIVELY for architectural decisions.

wshobson/agents · 55 tokens

backend-development-security-auditor

Review code and architecture for security vulnerabilities, OWASP Top 10, auth flaws, and compliance issues. Use for security review during feature development.

wshobson/agents · 36 tokens

adversary

QA - assume broken, find edge cases, prove with evidence.

ariaxhan/kernel-claude · 16 tokens

resolver

Implements a planned change — edits files, runs commands, makes tests pass. The only agent with write authority. Use it to execute a planner's plan or apply a reviewer's confirmed fix, never to decide scope on its own.

mycelium-hq/ai-brain-starter · 49 tokens