safe-agentic-workflow

by bybren-llcVerified

SAW — SAFe Agentic Workflow AI Agent Harness for Multi-Agent Team Workflows Built on SAFe methodology (Scaled Agile Framework), adapted for AI agent teams (Now With AI-DLC!) Works for any team with repeatable processes: Software, Marketing, Research, Legal, Operations.

402
Stars
87
Forks
Shell
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/bybren-llc/safe-agentic-workflow

Getting Started

Guides for using skills like safe-agentic-workflow.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

SAW — SAFe Agentic Workflow

AI Agent Harness for Multi-Agent Team Workflows

A Production-Tested Three-Layer Architecture for Coordinated AI Teams

Version License Template Ready Tests DeepWiki

Agents Skills Commands Cursor Rules

Supported AI Providers
Claude Code Gemini CLI Codex CLI Cursor IDE

Template Repository - Click "Use this template" above to create your own AI agent harness. After cloning, run bash scripts/setup-template.sh to customize for your project. See TEMPLATE_SETUP.md for details.


What This Is

A production-tested AI agent harness for teams that want structured AI workflows.

Multi-provider support: Works with Claude Code (Anthropic), Gemini CLI (Google), Codex CLI (OpenAI), and Cursor IDE (Anysphere).

Built on SAFe methodology (Scaled Agile Framework), adapted for AI agent teams. Works for any team with repeatable processes: Software, Marketing, Research, Legal, Operations.

Includes:

  • 20 Model-Invoked Skills - Domain expertise that loads automatically (Skills 2.0 frontmatter)
  • 24 Slash Commands - Workflow automation for common tasks
  • 11 SAFe Agent Profiles - Specialized roles with clear boundaries
  • Three-Layer Architecture - Hooks → Commands → Skills
  • Agent Teams - Multi-agent orchestration with SAFe quality gates (experimental)
  • Dark Factory - Persistent autonomous agent teams via tmux on remote servers (guide)
  • Knowledge Vault - Evidence-verified knowledge base with a drift-detecting validator (guide)

Origin: 5 months production use, 169 issues, 2,193 commits. Implements patterns from 6 Anthropic engineering papers and SAFe methodology.


Quick Start (30 seconds)

Claude Code (Anthropic)

# Copy harness to your project
cp -r .claude/ /your-project/.claude/

# Customize placeholders across all provider files ({{TICKET_PREFIX}}, {{PROJECT_NAME}},
# and the rest) in one pass:
bash scripts/setup-template.sh

# Start working
/start-work TICKET-123

Gemini CLI (Google)

# Copy harness to your project
cp -r .gemini/ /your-project/.gemini/

# Install Gemini CLI (if needed)
npm install -g @google/gemini-cli

# Authenticate
export GEMINI_API_KEY="your-api-key"

# Start working
/workflow:start-work TICKET-123

Codex CLI (OpenAI)

# Copy harness to your project
cp -r .codex/ /your-project/.codex/
cp -r .agents/ /your-project/.agents/

# Install Codex CLI (if needed)
npm install -g @openai/codex

# Authenticate
export OPENAI_API_KEY="your-api-key"

# Start working (natural language, no slash commands)
codex

Cursor IDE (Anysphere)

# Copy rules to your project
cp -r .cursor/ /your-project/.cursor/

# Open in Cursor
cursor /your-project

# Rules activate automatically based on file context
# Use @rule-name to invoke agent roles manually

That's it. Your AI assistant now has your team's workflow patterns built in.


Keeping Your Harness Updated

Already using the harness and a new version is out? You have two paths:

Automated (multi-domain, manifest-based):

# Initialize sync metadata (first time only)
./scripts/sync-claude-harness.sh init
./scripts/sync-claude-harness.sh manifest init --yes

# Preview and apply (syncs all domains in your manifest's sync_scope)
./scripts/sync-claude-harness.sh sync --version v2.11.1 --dry-run
./scripts/sync-claude-harness.sh sync --version v2.11.1

# Sync specific domains only
./scripts/sync-claude-harness.sh sync --version v2.11.1 --scope .claude,.gemini

Manual (full release, all providers):

git remote add harness https://github.com/bybren-llc/safe-agentic-workflow.git
git fetch harness main --tags
git diff v2.10.0..v2.11.1 --stat             # See what changed
git checkout harness/main -- .codex/agents/   # Cherry-pick what you need
bash scripts/sync-claude-harness.sh --dry-run # Preview, then drop --dry-run to apply

The sync script protects your customizations via a manifest (required since v2.10.0). It won't overwrite files you've marked as protected. See the Harness Sync Guide for the full reference and Upgrade Guide for rollback options.


The Three-Layer Architecture

┌──────────────────────────────────────────────────────────────────────┐
│                      Claude Code Harness                              │
├──────────────────────────────────────────────────────────────────────┤
│  LAYER 1: HOOKS     │ Automatic guardrails (format checks, blockers) │
│  LAYER 2: COMMANDS  │ User-invoked workflows (/start-work, /pre-pr)  │
│  LAYER 3: SKILLS    │ Model-invoked expertise (pattern discovery)    │
└──────────────────────────────────────────────────────────────────────┘

Philosophy: Process as service, not control. Everything exists to reduce cognitive load on already-solved problems.


Choose Your Path

For Practitioners - I want to use this today

Getting Started

  1. Run bash scripts/setup-template.sh to customize placeholders
  2. Read the Getting Started Guide for the full walkthrough
  3. Run /start-work on your first ticket

Adopting into an existing repo? See the Workspace Adoption Guide. Upgrading from a previous version? See Keeping the Harness Updated. Syncing your fork with upstream? See the Harness Sync Guide. Planning a multi-issue program? See the SAFe x AI-DLC Methodology. Building a knowledge base? See the Knowledge Vault.

Key Commands

CommandPurpose
/start-workBegin ticket with proper workflow
/pre-prValidate before pull request
/end-workComplete session cleanly
/check-workflowQuick status check

Full Command Reference

Workflow (8): /start-work, /pre-pr, /release, /end-work, /check-workflow, /update-docs, /retro, /sync-linear

Local Operations (3): /local-sync, /local-deploy, /quick-fix

Remote Operations (5): /remote-status, /remote-deploy, /remote-health, /remote-logs, /remote-rollback

Complete Setup Guide

For Researchers - I want to understand the methodology

Research Foundation

This harness implements patterns from 6 Anthropic engineering papers (see below).

See docs/whitepapers/ for methodology deep-dives and comparative analysis.

For Leaders - I want to understand adoption

Adoption Requirements

  • At least one supported AI tool: Claude Code, Gemini CLI, Codex CLI, or Cursor IDE
  • Git repository
  • Team buy-in for structured workflows

Why Teams Choose SAW

  • Structured autonomy: AI agents work within clear boundaries and quality gates
  • Evidence-based delivery: Every deliverable requires verifiable evidence, not "trust me"
  • Stop-the-line authority: Any agent can halt work for quality or security concerns
  • Multi-provider flexibility: Same workflow across Claude Code, Gemini CLI, Codex CLI, and Cursor IDE

Known Limitations

  • Claude Code has the deepest integration; Gemini CLI, Codex CLI, and Cursor IDE support is newer
  • Non-SWE domain adaptations (marketing, research) are documented but not yet validated in production

Gemini CLI Integration

Why Gemini CLI? - Unique capabilities and when to use it

Gemini CLI Unique Features

Gemini CLI offers capabilities that complement Claude Code:

FeatureGemini CLIClaude Code
Shell Injection!{command} - Execute shell, inject output into promptVia Bash tool only
File Injection@{file} - Inject file contents into promptsVia Read tool only
Built-in SandboxGoogle Cloud sandboxingMCP sandboxing
Model OptionsGemini 3 Flash, Gemini 3.1 Pro PreviewClaude Opus, Sonnet, Haiku
Command FormatTOMLYAML + Markdown
Namespaced Commands/workflow:start-work/start-work
Hookssettings.json hooks sectionhooks-config.json
MCP Serverssettings.json mcpServerssettings.local.json
Hook Migrationgemini hooks migrate --from-claudeN/A
Plan Mode/plan command, plan-then-executeN/A
Policy EngineYAML policies, seatbelt profilesN/A
Browser AgentBuilt-in experimental agentMCP (claude-in-chrome)
ExtensionsBundled skill/MCP/command packagesN/A
Checkpointing/restore session recoveryN/A
Audio/VideoNative multimodal (Gemini 3+)N/A

When to Use Gemini CLI

Choose Gemini CLI when you need:

  • Shell command output directly in prompts (!{git log --oneline -5})
  • File contents injected into context (@{package.json})
  • Plan mode for complex multi-step tasks (/plan)
  • Audio/video transcription and analysis (Gemini 3+ multimodal)
  • Policy engine for fine-grained tool control
  • Google Cloud integration and Gemini model family access

Choose Claude Code when you need:

  • Agent subprocesses with tool restrictions
  • Claude model family access
  • Production-tested workflow (5+ months validated)

Gemini CLI Quick Reference

# Installation
npm install -g @google/gemini-cli

# Authentication (choose one)
export GEMINI_API_KEY="your-api-key"
# or
gcloud auth application-default login

# Start Gemini CLI
gemini

# List available commands
/help

# List available skills
/skills

Command Syntax Differences

ActionClaude CodeGemini CLI
Start work/start-work {{TICKET_PREFIX}}-123/workflow:start-work {{TICKET_PREFIX}}-123
Pre-PR check/pre-pr/workflow:pre-pr
Local sync/local-sync/local:sync
Remote deploy/remote-deploy/remote:deploy
Search patterns/search-pattern "pattern"/search-pattern "pattern"

Gemini CLI Documentation


Implementing Anthropic's Research

This harness directly implements patterns from Anthropic's engineering papers:

PaperWhat We Implement
Building Effective Agents11-agent team structure
Effective HarnessesThree-layer architecture
Agent Skills20 model-invoked skills
Skills AnnouncementSkills 2.0 frontmatter, trigger patterns
Code Execution with MCPTool restrictions per role

"The best harness is one you forget exists." — Agent Perspective


SAFe Foundation

For Agile Practitioners - Deep dive into SAFe integration

This harness maps SAFe roles to AI agents:

SAFe RoleAgentResponsibility
Business Systems AnalystBSARequirements, acceptance criteria
System ArchitectSystem ArchitectArchitecture decisions, ADRs
Product OwnerPOPM (human)Final approval on deliverables
Scrum MasterTDMCoordination, blocker escalation
Release Train EngineerRTECI/CD, release coordination

SAFe Concepts Implemented

  • Epic → Feature → Story → Enabler hierarchy in specs
  • Sprint cycles with velocity tracking (or Bolts — see below)
  • Evidence-based delivery with Linear integration
  • Specs-driven workflow - BSA plans, developers execute

Program Cadence: SAFe x AI-DLC

SAFe gives this harness its structure. But SAFe's cadence assumes human squads on week-long sprints, and agent teams do not move at that speed — a team of specialized agents can elaborate, build, and verify a unit of work in hours.

So the harness also ships the SAFe x AI-DLC fusion: SAFe keeps the hierarchy, WSJF, role boundaries, and Definition of Done; AWS's AI-Driven Development Life Cycle supplies the cadence and the human checkpoint. In a program that adopts the fusion, the Bolt takes the sprint's place. Adoption is per-program; the standard sprint path stays valid.

Inside such a program, each concept below stands in for its SAFe counterpart:

ConceptStands in forDefinition
BoltThe sprintAn hours-to-days swarm with an entry gate and a hard exit. Exits on evidence, not a date.
Unit of WorkThe FeatureOne coherent outcome. A project in the tracker.
Mob ElaborationSprint planningDecompose, list unknowns, ask questions — before writing any code.
The loopThe stand-upAI plans → AI asks → human validates business context → AI executes.

The human validation step is not optional. Agents own the build; humans own the judgment — secrets, security policy, branch protection, risk thresholds, and signing the Definition of Done always route to a human with options and a recommendation.

Using It

ResourcePurpose
Methodology guideRead this first — vocabulary, worked example, when not to use a Bolt
safe-ai-dlc skillThe method encoded for agents (Claude, Gemini, portable; Cursor as a rule)
Program templateScaffolding for a new program document
linear-sop skillProgram structure: initiative → project → milestone → issue

Use it when work spans many issues and needs cadence — turning an audit, epic, or initiative into an executable program. For a single ticket, the standard safe-workflow path is correct. And if the problem space is still unclear, run a spike instead: forcing an ambiguous epic into one Bolt just relocates the ambiguity into the code.


Knowledge Vault

Agent teams need a shared map of the system, and a map nobody can prove is current will quietly become wrong. The knowledge-vault/ subsystem is an evidence-verified knowledge base: every concept records the commit its claims were checked against, so staleness is something you compute, not something you feel.

Built on Open Knowledge Format v0.1 (Google, Apache-2.0), which gives portability. This harness adds the rigor layer that gives trust: a strict frontmatter contract, a zero-dependency validator, an anti-hallucination link rule, and a drift mechanism.

In the project this method came from, an independent architecture audit called the vault "the single strongest KT asset in the repo" and told new developers to trust it over the project's own canonical context file — because the vault's claims were verified against a SHA and the canonical file's had silently drifted.

Run It

PromptWho it is for
BUILD-PROMPT.mdEvery adopter — the generic multi-agent build prompt. Fill in your project, taxonomy, and watch-list, then run it.
SAW-VAULT-BUILD.mdThis repo's maintainers — pre-scoped to {{PROJECT_SHORT}} and runnable as-is, with a ready-to-file ticket breakdown.
# Prove the tooling works before you trust it
node knowledge-vault/scripts/validate-vault.mjs --vault knowledge-vault/templates/starter-bundle
ResourcePurpose
Knowledge Vault READMEStart here — 30-second quickstart
GuideThe method, and why each rule exists
Adoption PlaybookSteps, taxonomy choice, CI gating, ticket breakdown
Obsidian GuideGraph, canvases, Bases, and the config treaty
vault-sync skillDrift detection and repair (Claude, Gemini, portable; Cursor as a rule)

The reading layer

Because an OKF bundle is a directory of plain markdown, Obsidian opens it with no conversion step, and that is where the vault stops feeling like a docs folder: a graph view of the concept graph (colour-grouped by directory, with orphans deliberately visible because an orphan is a defect), canvases for relationships a linear document cannot show, and Bases saved queries including a drift dashboard listing every concept whose verified_against has fallen behind. knowledge-vault/templates/obsidian/ ships the app, graph and core-plugin config; the canvases and Bases views ship inside the vault itself. Bases needs Obsidian 1.9+.

Obsidian is not required: no community plugins are needed, and the vault degrades to plain markdown in any editor. But the graph, canvases and dashboard are a large part of what you get.


The 11-Agent Team

AgentRoleWhen to Use
BSARequirements & specsStarting any feature
System ArchitectArchitecture reviewSignificant changes
FE DeveloperFrontend implementationUI components
BE DeveloperBackend implementationAPI routes, server logic
Data EngineerDatabase & migrationsSchema changes
QASQuality assuranceTest validation
Security EngineerSecurity validationRLS, vulnerability checks
Tech WriterDocumentationGuides, technical content
DPEData provisioningTest data, seeds
RTERelease coordinationCI/CD, deployments
TDMCoordinationBlockers, escalation

See AGENTS.md for complete reference with invocation examples.


Domain Adaptation Guide

The harness patterns work beyond software engineering:

Marketing Team Example

SWE ConceptMarketing Adaptation
BSA (specs)Campaign Brief Writer
Code ReviewAsset Review
/pre-pr/pre-launch
Pattern LibraryBrand Guidelines

Research Team Example

SWE ConceptResearch Adaptation
User StoriesResearch Questions
Test CasesValidation Criteria
CI/CDPeer Review Pipeline
DocumentationLiterature Notes

What Makes This Different

Round Table Philosophy

Human and AI input have equal weight. No hierarchy, just expertise.

Stop-the-Line Authority

Any agent can halt work for architectural or security concerns.

Pattern Discovery Protocol

"Search First, Reuse Always, Create Only When Necessary"

Evidence-Based Delivery

All work requires verifiable evidence. No "trust me, it works."


vNext Workflow Contract (v1.4)

Note from the Author: It became apparent early on that some of the autonomy and alignment we'd lost in our original harness was not going to work. This re-introduces strong solo and larger orchestration hats with selection criteria. Gates for QAS cover all scenarios.

Complete Agent Flow

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                        SAFe AGENTIC WORKFLOW - vNext                                     │
└─────────────────────────────────────────────────────────────────────────────────────────┘

                                    ┌──────────────┐
                                    │  USER/POPM   │
                                    │  Creates     │
                                    │  Linear      │
                                    │  Ticket      │
                                    └──────┬───────┘
                                           │
                                           ▼
                              ┌────────────────────────┐
                              │         BSA            │
                              │  • Defines AC/DoD      │
                              │  • Pattern discovery   │
                              │  • Creates spec        │
                              └────────────┬───────────┘
                                           │
                        ┌──────────────────┴──────────────────┐
                        │       STOP-THE-LINE GATE            │
                        │  AC/DoD exists? YES → Proceed       │
                        │                 NO  → STOP          │
                        └──────────────────┬──────────────────┘
                                           │
                    ┌──────────────────────┼──────────────────────┐
                    ▼                      ▼                      ▼
          ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
          │  BE-DEVELOPER   │    │  FE-DEVELOPER   │    │  DATA-ENGINEER  │
          │  Exit: "Ready   │    │  Exit: "Ready   │    │  Exit: "Ready   │
          │   for QAS"      │    │   for QAS"      │    │   for QAS"      │
          └────────┬────────┘    └────────┬────────┘    └────────┬────────┘
                   └──────────────────────┼──────────────────────┘
                                          ▼
                        ┌─────────────────────────────────┐
                        │        QAS (GATE OWNER)         │
                        │  • Iteration authority          │
                        │  • Bounce back repeatedly       │
                        │  • Final evidence to Linear     │
                        │  Exit: "Approved for RTE"       │
                        └────────────┬────────────────────┘
                                     ▼
                        ┌─────────────────────────────────┐
                        │        RTE (PR SHEPHERD)        │
                        │  • PR creation (from spec)      │
                        │  • CI/CD monitoring             │
                        │  • NO code, NO merge            │
                        │  Exit: "Ready for HITL Review"  │
                        └────────────┬────────────────────┘
                                     ▼
                    ┌─────────────────────────────────────────────┐
                    │           3-STAGE PR REVIEW                 │
                    │  Stage 1: System Architect (pattern)        │
                    │  Stage 2: ARCHitect-in-CLI (architecture)   │
                    │  Stage 3: HITL ({{AUTHOR_NAME}}) → MERGE              │
                    └─────────────────────────────────────────────┘

Exit States

┌─────────────────┬───────────────────────────────────────────┐
│ Role            │ Exit State                                │
├─────────────────┼───────────────────────────────────────────┤
│ BE-Developer    │ "Ready for QAS"                           │
│ FE-Developer    │ "Ready for QAS"                           │
│ Data-Engineer   │ "Ready for QAS"                           │
│ QAS             │ "Approved for RTE"                        │
│ RTE             │ "Ready for HITL Review"                   │
│ System Architect│ "Stage 1 Approved - Ready for ARCHitect"  │
│ HITL            │ MERGED                                    │
└─────────────────┴───────────────────────────────────────────┘

Gate Quick Reference

┌─────────────────┬─────────────────┬─────────────────────────┐
│ Gate            │ Owner           │ Blocking?               │
├─────────────────┼─────────────────┼─────────────────────────┤
│ Stop-the-Line   │ Implementer     │ YES - no AC = no work   │
│ QAS Gate        │ QAS             │ YES - no approval = stop│
│ Stage 1 Review  │ System Architect│ YES - pattern check     │
│ Stage 2 Review  │ ARCHitect-CLI   │ YES - architecture check│
│ HITL Merge      │ {{AUTHOR_NAME}}            │ YES - final authority   │
└─────────────────┴─────────────────┴─────────────────────────┘

Role Collapsing ({{TICKET_PREFIX}}-499)

┌─────────────────────────────────────────────────────────────┐
│                  ROLE COLLAPSING AUTHORITY                  │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  COLLAPSIBLE:                                               │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ RTE (Release Train Engineer)                         │   │
│  │ • PR creation can be done by implementer             │   │
│  │ • Use when: Simple PRs, single-agent work            │   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
│  NOT COLLAPSIBLE (Independence Gates):                      │
│  ┌─────────────────────────────────────────────────────┐   │
│  │ QAS (Quality Assurance Specialist)                   │   │
│  │ • ALWAYS spawn subagent - never self-review          │   │
│  │ • Rationale: Self-review bias, quality enforcement   │   │
│  ├─────────────────────────────────────────────────────┤   │
│  │ Security Engineer                                    │   │
│  │ • ALWAYS spawn subagent - never self-audit           │   │
│  │ • Rationale: Security blindness, conflict of interest│   │
│  └─────────────────────────────────────────────────────┘   │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Collapsed Workflow Example

Standard Workflow:
Implementer → QAS → RTE → HITL
                     │
                     └─ RTE handles PR creation

Collapsed Workflow (RTE collapsed):
Implementer → QAS → [Implementer handles PR] → HITL
               │
               └─ QAS gate ALWAYS present, never collapsed

Note: Quality gates are immutable. QAS and SecEng cannot be collapsed.
Part 1: Core Workflow Architecture - Complete flow diagrams

1.1 Complete Agent Flow (Detailed)

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                        SAFe AGENTIC WORKFLOW - vNext                                    │
└─────────────────────────────────────────────────────────────────────────────────────────┘

                                    ┌──────────────┐
                                    │  USER/POPM   │
                                    │  Creates     │
                                    │  Linear      │
                                    │  Ticket      │
                                    └──────┬───────┘
                                           │
                                           ▼
                              ┌────────────────────────┐
                              │         BSA            │
                              │  • Defines AC/DoD      │
                              │  • Pattern discovery   │
                              │  • Creates spec        │
                              └────────────┬───────────┘
                                           │
                        ┌──────────────────┴──────────────────┐
                        │       STOP-THE-LINE GATE            │
                        │  ┌────────────────────────────────┐ │
                        │  │ AC/DoD exists?                 │ │
                        │  │  • YES → Proceed               │ │
                        │  │  • NO  → STOP, route to BSA    │ │
                        │  └────────────────────────────────┘ │
                        └──────────────────┬──────────────────┘
                                           │
                    ┌──────────────────────┼──────────────────────┐
                    │                      │                      │
                    ▼                      ▼                      ▼
          ┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
          │  BE-DEVELOPER   │    │  FE-DEVELOPER   │    │  DATA-ENGINEER  │
          │                 │    │                 │    │                 │
          │  Owns:          │    │  Owns:          │    │  Owns:          │
          │  • API routes   │    │  • UI components│    │  • Schema/DB    │
          │  • Server logic │    │  • Client logic │    │  • Migrations   │
          │  • SAFe commits │    │  • SAFe commits │    │  • SAFe commits │
          │                 │    │                 │    │                 │
          │  Must NOT:      │    │  Must NOT:      │    │  Must NOT:      │
          │  • Create PRs   │    │  • Create PRs   │    │  • Create PRs   │
          │  • Merge        │    │  • Merge        │    │  • Merge        │
          │                 │    │                 │    │  • Skip ARCHitect│
          └────────┬────────┘    └────────┬────────┘    └────────┬────────┘
                   │                      │                      │
                   │    Exit: "Ready for QAS"                    │
                   └──────────────────────┼──────────────────────┘
                                          │
                                          ▼
                        ┌─────────────────────────────────┐
                        │              QAS                │
                        │         (GATE OWNER)            │
                        │                                 │
                        │  Powers:                        │
                        │  • Iteration authority          │
                        │  • Bounce back repeatedly       │
                        │  • Route to specialists         │
                        │  • Final evidence to Linear     │
                        │                                 │
                        │  Tools (Linear MCP):            │
                        │  • mcp__{{MCP_LINEAR_SERVER}}__            │
                        │      create_comment             │
                        │  • mcp__{{MCP_LINEAR_SERVER}}__            │
                        │      update_issue               │
                        │  • mcp__{{MCP_LINEAR_SERVER}}__            │
                        │      list_comments              │
                        └────────────┬────────────────────┘
                                     │
                    ┌────────────────┴────────────────┐
                    │                                 │
                    ▼                                 ▼
          ┌─────────────────┐               ┌─────────────────┐
          │    BLOCKED      │               │    APPROVED     │
          │                 │               │                 │
          │  Routes to:     │               │  Exit State:    │
          │  • Implementer  │               │  "Approved      │
          │  • Tech Writer  │               │   for RTE"      │
          │  • Sys Architect│               │                 │
          └────────┬────────┘               └────────┬────────┘
                   │                                  │
                   │ (Loop until fixed)               │
                   └──────────────────────────────────┤
                                                      │
                                                      ▼
                              ┌─────────────────────────────────┐
                              │              RTE                │
                              │        (PR SHEPHERD)            │
                              │                                 │
                              │  Owns:                          │
                              │  • PR creation (from spec)      │
                              │  • CI/CD monitoring             │
                              │  • Evidence assembly            │
                              │  • PR metadata edits            │
                              │                                 │
                              │  Must NOT:                      │
                              │  • Write product code           │
                              │  • Merge PRs                    │
                              │  • Approve own work             │
                              └────────────┬────────────────────┘
                                           │
                                           ▼
                    ┌─────────────────────────────────────────────┐
                    │           3-STAGE PR REVIEW                 │
                    │                                             │
                    │  ┌─────────────────────────────────────┐    │
                    │  │ STAGE 1: System Architect           │    │
                    │  │  • Pattern compliance               │    │
                    │  │  • RLS enforcement                  │    │
                    │  │  • Technical validation             │    │
                    │  │  → Exit: "Stage 1 Approved"         │    │
                    │  └─────────────────┬───────────────────┘    │
                    │                    ▼                        │
                    │  ┌─────────────────────────────────────┐    │
                    │  │ STAGE 2: ARCHitect-in-CLI           │    │
                    │  │  • Comprehensive review             │    │
                    │  │  • Architecture validation          │    │
                    │  │  • Security verification            │    │
                    │  │  → Exit: "Stage 2 Approved"         │    │
                    │  └─────────────────┬───────────────────┘    │
                    │                    ▼                        │
                    │  ┌─────────────────────────────────────┐    │
                    │  │ STAGE 3: HITL ({{AUTHOR_NAME}})               │    │
                    │  │  • Final human review               │    │
                    │  │  • Merge authority                  │    │
                    │  │  → Action: MERGE                    │    │
                    │  └─────────────────────────────────────┘    │
                    └─────────────────────────────────────────────┘

1.2 Exit States Flow (with Handoff Statements)

┌─────────────────────────────────────────────────────────────────────────────┐
│                         EXIT STATE PROGRESSION                              │
└─────────────────────────────────────────────────────────────────────────────┘

  IMPLEMENTATION                QAS                   RTE                 HITL
  ─────────────                ─────                 ─────               ──────

  ┌─────────────┐         ┌─────────────┐       ┌─────────────┐     ┌─────────────┐
  │   Coding    │         │  Validating │       │  Shepherding│     │  Reviewing  │
  │   Testing   │         │  Iterating  │       │  CI/CD      │     │  Merging    │
  │   Commits   │         │  Evidence   │       │  Assembling │     │             │
  └──────┬──────┘         └──────┬──────┘       └──────┬──────┘     └──────┬──────┘
         │                       │                     │                   │
         ▼                       ▼                     ▼                   ▼
  ╔═════════════╗         ╔═════════════╗       ╔═════════════╗     ╔═════════════╗
  ║  "Ready     ║  ────▶  ║ "Approved   ║ ────▶ ║ "Ready for  ║ ──▶ ║   MERGED    ║
  ║  for QAS"   ║         ║  for RTE"   ║       ║ HITL Review"║     ║             ║
  ╚═════════════╝         ╚═════════════╝       ╚═════════════╝     ╚═════════════╝
         │                       │                     │
         │                       │                     │
         ▼                       ▼                     ▼
  ┌─────────────┐         ┌─────────────┐       ┌─────────────┐
  │ Handoff     │         │ Handoff     │       │ Handoff     │
  │ Statement:  │         │ Statement:  │       │ Statement:  │
  │             │         │             │       │             │
  │ "BE/FE/DE   │         │ "QAS valid- │       │ "PR #XXX    │
  │ impl done   │         │ ation done  │       │ ready for   │
  │ for {{TICKET_PREFIX}}-X.  │         │ for {{TICKET_PREFIX}}-X.  │       │ HITL review.│
  │ All valid-  │         │ All PASSED. │       │ CI green,   │
  │ ation pass. │         │ Approved    │       │ reviews     │
  │ AC/DoD      │         │ for RTE."   │       │ complete."  │
  │ confirmed.  │         │             │       │             │
  │ Ready for   │         │             │       │             │
  │ QAS."       │         │             │       │             │
  └─────────────┘         └─────────────┘       └─────────────┘

1.3 Stop-the-Line Gate (Mandatory)

┌─────────────────────────────────────────────────────────────────────────────┐
│                      STOP-THE-LINE GATE (MANDATORY)                         │
└─────────────────────────────────────────────────────────────────────────────┘

                              ┌─────────────────┐
                              │  TICKET ARRIVES │
                              │  (Linear {{TICKET_PREFIX}}-X) │
                              └────────┬────────┘
                                       │
                                       ▼
                         ┌─────────────────────────┐
                         │   CHECK: AC/DoD EXISTS? │
                         └────────────┬────────────┘
                                      │
                    ┌─────────────────┴─────────────────┐
                    │                                   │
                    ▼                                   ▼
          ┌─────────────────┐                 ┌─────────────────┐
          │       YES       │                 │        NO       │
          │                 │                 │                 │
          │  AC/DoD is      │                 │  AC/DoD missing │
          │  defined and    │                 │  or unclear     │
          │  clear          │                 │                 │
          └────────┬────────┘                 └────────┬────────┘
                   │                                   │
                   ▼                                   ▼
          ┌─────────────────┐                 ╔═════════════════╗
          │    PROCEED      │                 ║   FULL STOP     ║
          │                 │                 ║                 ║
          │  Begin          │                 ║  • Do NOT       ║
          │  implementation │                 ║    proceed      ║
          │                 │                 ║                 ║
          │                 │                 ║  • Route back   ║
          │                 │                 ║    to BSA/POPM  ║
          │                 │                 ║                 ║
          │                 │                 ║  • You are NOT  ║
          │                 │                 ║    responsible  ║
          │                 │                 ║    for inventing║
          │                 │                 ║    AC/DoD       ║
          └─────────────────┘                 ╚═════════════════╝


  ┌───────────────────────────────────────────────────────────────────────────┐
  │  POLICY: Implementation agents (BE/FE/DE) must verify AC/DoD exists      │
  │          before starting ANY work. This is a hard gate, not optional.    │
  └───────────────────────────────────────────────────────────────────────────┘

1.4 QAS Iteration Loop

┌─────────────────────────────────────────────────────────────────────────────┐
│                         QAS ITERATION AUTHORITY                             │
└─────────────────────────────────────────────────────────────────────────────┘

                              ┌─────────────────┐
                              │  WORK ARRIVES   │
                              │  "Ready for QAS"│
                              └────────┬────────┘
                                       │
                                       ▼
                         ┌─────────────────────────┐
                         │   QAS VALIDATES WORK    │
                         │                         │
                         │  • Run test suites      │
                         │  • Check AC/DoD         │
                         │  • Verify evidence      │
                         │  • Review documentation │
                         └────────────┬────────────┘
                                      │
                    ┌─────────────────┴─────────────────┐
                    │                                   │
                    ▼                                   ▼
          ┌─────────────────┐                 ┌─────────────────┐
          │   ALL PASS ✓    │                 │   ISSUES FOUND  │
          │                 │                 │                 │
          │  • Tests pass   │                 │  • Tests fail   │
          │  • AC/DoD met   │                 │  • AC incomplete│
          │  • Evidence OK  │                 │  • Docs missing │
          │  • Docs match   │                 │  • Pattern issue│
          └────────┬────────┘                 └────────┬────────┘
                   │                                   │
                   ▼                                   ▼
          ╔═════════════════╗                 ┌─────────────────┐
          ║    APPROVED     ║                 │     BLOCKED     │
          ║                 ║                 │                 │
          ║  Post evidence  ║                 │  Route to:      │
          ║  to Linear      ║                 │                 │
          ║                 ║                 │  ┌───────────┐  │
          ║  Exit: "Approved║                 │  │Code bugs  │──┼──▶ @be-developer
          ║  for RTE"       ║                 │  └───────────┘  │     @fe-developer
          ╚═════════════════╝                 │  ┌───────────┐  │
                                              │  │Validation │──┼──▶ Implementer
                                              │  │fails      │  │
                                              │  └───────────┘  │
                                              │  ┌───────────┐  │
                                              │  │Doc gaps   │──┼──▶ @tech-writer
                                              │  └───────────┘  │
                                              │  ┌───────────┐  │
                                              │  │Pattern    │──┼──▶ @system-architect
                                              │  │violation  │  │
                                              │  └───────────┘  │
                                              │  ┌───────────┐  │
                                              │  │AC/DoD     │──┼──▶ @bsa
                                              │  │missing    │  │
                                              │  └───────────┘  │
                                              └────────┬────────┘
                                                       │
                                                       │ (Fix and return)
                                                       │
                                                       ▼
                                              ┌─────────────────┐
                                              │  REPEAT UNTIL   │
                                              │  ALL PASS       │
                                              │                 │
                                              │  QAS has full   │
                                              │  iteration      │
                                              │  authority      │
                                              └─────────────────┘
Part 2: Role Definitions - Contract specifications for each role

2.1 Role Ownership Matrix

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                              ROLE OWNERSHIP MATRIX                                      │
├─────────────────┬───────────────────────────────────────────────────────────────────────┤
│                 │                           RESPONSIBILITIES                            │
│      ROLE       ├───────────┬───────────┬───────────┬───────────┬───────────┬──────────┤
│                 │   CODE    │  COMMITS  │    PR     │   MERGE   │  EVIDENCE │   GATE   │
├─────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼──────────┤
│ BE-Developer    │    ✓      │    ✓      │    ✗      │    ✗      │  Partial  │    ✗     │
│ FE-Developer    │    ✓      │    ✓      │    ✗      │    ✗      │  Partial  │    ✗     │
│ Data-Engineer   │    ✓      │    ✓      │    ✗      │    ✗      │  Partial  │    ✗     │
├─────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼──────────┤
│ QAS             │    ✗      │    ✗      │    ✗      │    ✗      │    ✓      │    ✓     │
├─────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼──────────┤
│ RTE             │    ✗      │  Metadata │    ✓      │    ✗      │  Assembly │    ✗     │
├─────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼──────────┤
│ System Architect│  Review   │    ✗      │  Stage 1  │    ✗      │  Review   │  Stage 1 │
│ ARCHitect-CLI   │  Review   │    ✗      │  Stage 2  │    ✗      │  Review   │  Stage 2 │
├─────────────────┼───────────┼───────────┼───────────┼───────────┼───────────┼──────────┤
│ HITL ({{AUTHOR_NAME}})    │  Review   │    ✗      │  Stage 3  │    ✓      │  Final    │  Stage 3 │
└─────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┴──────────┘

Legend:
  ✓ = Owns/Authorized
  ✗ = Not Authorized
  Partial = Captures during work, QAS collects
  Review = Read-only review authority
  Metadata = PR title, labels, body only (not code)
  Assembly = Collects from all agents

2.2 Implementation Agents Contract (BE/FE/DE)

┌─────────────────────────────────────────────────────────────────────────────┐
│                    IMPLEMENTATION AGENT CONTRACT                            │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  PRECONDITION (Mandatory Gate):                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  Verify AC/DoD exists → If missing, STOP and route to BSA/POPM      │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  OWNS:                                     MUST NOT:                        │
│  ├─ Code changes                           ├─ Create PRs                    │
│  ├─ Atomic SAFe commits                    ├─ Merge to dev/master           │
│  └─ Local validation                       └─ Invent AC/DoD                 │
│                                                                             │
│  MUST DO:                                                                   │
│  ├─ Run validation loop until ALL pass                                      │
│  ├─ Confirm ALL AC/DoD satisfied                                            │
│  ├─ Commit own work (SAFe format)                                           │
│  └─ Provide handoff statement                                               │
│                                                                             │
│  EXIT STATE: "Ready for QAS"                                                │
│                                                                             │
│  HANDOFF TEMPLATE:                                                          │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  "[BE/FE/DE] implementation complete for {{TICKET_PREFIX}}-XXX.                   │   │
│  │   All validation passing. AC/DoD confirmed.                         │   │
│  │   Ready for QAS review."                                            │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

2.3 QAS Gate Owner Contract

┌─────────────────────────────────────────────────────────────────────────────┐
│                         QAS GATE OWNER CONTRACT                             │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ROLE: GATE (not just validator)                                            │
│  ───────────────────────────────                                            │
│  Work does NOT proceed without QAS approval.                                │
│                                                                             │
│  OWNS:                                     MUST NOT:                        │
│  ├─ Independent verification               ├─ Modify product code           │
│  ├─ Iteration authority                    ├─ Skip AC/DoD verification      │
│  ├─ QA artifacts                           └─ Approve incomplete work       │
│  └─ Final evidence to Linear                                                │
│                                                                             │
│  LINEAR MCP TOOLS:                                                          │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  • mcp__{{MCP_LINEAR_SERVER}}__create_comment  (post evidence)                 │   │
│  │  • mcp__{{MCP_LINEAR_SERVER}}__update_issue    (update status)                 │   │
│  │  • mcp__{{MCP_LINEAR_SERVER}}__list_comments   (read context)                  │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  ROUTING AUTHORITY:                                                         │
│  ┌────────────────┬──────────────────┬───────────────────────────────┐     │
│  │ Issue Type     │ Route To         │ Action                        │     │
│  ├────────────────┼──────────────────┼───────────────────────────────┤     │
│  │ Code bugs      │ @be/fe-developer │ Return with specific issues   │     │
│  │ Validation fail│ Implementer      │ Return with failure output    │     │
│  │ Doc mismatch   │ @tech-writer     │ Route for documentation fix   │     │
│  │ Pattern issue  │ @system-architect│ Escalate for pattern review   │     │
│  │ AC/DoD missing │ @bsa             │ Cannot approve without AC     │     │
│  └────────────────┴──────────────────┴───────────────────────────────┘     │
│                                                                             │
│  EXIT STATE: "Approved for RTE"                                             │
│                                                                             │
│  HANDOFF TEMPLATE:                                                          │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  "QAS validation complete for {{TICKET_PREFIX}}-XXX.                              │   │
│  │   All criteria PASSED. Evidence posted to Linear.                   │   │
│  │   Approved for RTE."                                                │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

2.4 RTE PR Shepherd Contract

┌─────────────────────────────────────────────────────────────────────────────┐
│                         RTE PR SHEPHERD CONTRACT                            │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  PREREQUISITE (QAS Gate):                                                   │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  Work MUST have QAS approval ("Approved for RTE" status)            │   │
│  │  Evidence MUST be posted to Linear                                  │   │
│  │  If QAS not approved → STOP and wait                                │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  OWNS:                                     MUST NOT (NEVER):                │
│  ├─ PR creation (from spec)                ├─ Merge PRs (HITL only)         │
│  ├─ CI/CD monitoring                       ├─ Write product code            │
│  ├─ Evidence assembly                      ├─ Approve own work              │
│  ├─ PR metadata (title, labels, body)      └─ Have merge cmd examples       │
│  └─ Coordination between agents                                             │
│                                                                             │
│  IF CI FAILS:                                                               │
│  ┌────────────────────────────┬─────────────────────────────────────┐      │
│  │ Failure Type               │ Route To                            │      │
│  ├────────────────────────────┼─────────────────────────────────────┤      │
│  │ Structural/pattern issues  │ System Architect                    │      │
│  │ Implementation bugs        │ Original implementer (BE/FE/DE)     │      │
│  │ NEVER fix code yourself    │ ---                                 │      │
│  └────────────────────────────┴─────────────────────────────────────┘      │
│                                                                             │
│  EXIT STATE: "Ready for HITL Review"                                        │
│                                                                             │
│  HANDOFF TEMPLATE:                                                          │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  "PR #XXX for {{TICKET_PREFIX}}-YYY is Ready for HITL Review.                     │   │
│  │   All CI green, reviews complete, evidence attached.                │   │
│  │   Awaiting final merge approval from {{AUTHOR_NAME}}."                        │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

2.5 System Architect Stage 1 Contract

┌─────────────────────────────────────────────────────────────────────────────┐
│                    SYSTEM ARCHITECT STAGE 1 CONTRACT                        │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ROLE: Stage 1 of 3-Stage PR Review Process                                 │
│  ───────────────────────────────────────────                                │
│                                                                             │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  Stage 1: System Architect (you) - Technical/pattern validation     │   │
│  │  Stage 2: ARCHitect-in-CLI - Comprehensive review                   │   │
│  │  Stage 3: HITL ({{AUTHOR_NAME}}) - Final merge authority                      │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  OWNS:                                     MUST NOT:                        │
│  ├─ Pattern compliance review              ├─ Merge PRs                     │
│  ├─ RLS enforcement verification           ├─ Skip to Stage 3               │
│  ├─ Architecture validation                └─ Approve security bypasses     │
│  └─ Stage 1 gate authority                                                  │
│                                                                             │
│  VALIDATION CHECKLIST:                                                      │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  [ ] RLS context enforced (no direct Prisma calls)                  │   │
│  │  [ ] withUserContext/withAdminContext/withSystemContext used        │   │
│  │  [ ] Authentication checks present                                  │   │
│  │  [ ] Pattern library followed                                       │   │
│  │  [ ] TypeScript types valid                                         │   │
│  │  [ ] Error handling comprehensive                                   │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  EXIT STATE: "Stage 1 Approved - Ready for ARCHitect"                       │
│                                                                             │
│  HANDOFF TEMPLATE:                                                          │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │  "Stage 1 review complete for PR #XXX ({{TICKET_PREFIX}}-YYY).                    │   │
│  │   Pattern compliance verified, RLS enforced.                        │   │
│  │   Approved for ARCHitect-in-CLI review (Stage 2)."                  │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

Routing Quick Reference

┌─────────────────────────────────────────────────────────────────────────────┐
│                          ROUTING CHEAT SHEET                                │
├─────────────────┬───────────────────────────────────────────────────────────┤
│ Issue           │ Route To                                                  │
├─────────────────┼───────────────────────────────────────────────────────────┤
│ Code bugs       │ @be-developer / @fe-developer                             │
│ Validation fail │ Original implementer                                      │
│ Doc mismatch    │ @tech-writer                                              │
│ Pattern issue   │ @system-architect                                         │
│ AC/DoD missing  │ @bsa                                                      │
│ CI failure      │ Implementer (code) or Architect (infra)                   │
│ Blocked > 4hrs  │ @tdm                                                      │
└─────────────────┴───────────────────────────────────────────────────────────┘
What Changed and Why - vNext Contract Changelog

Why This Upgrade Matters

This contract establishes proper SAFe governance for an AI agent team - treating agents as accountable team members with clear boundaries, not autonomous actors.

Key Changes Summary

CategoryBeforeAfterWhy
AC/DoD CheckOptional/informalStop-the-Line Gate (mandatory)Agents shouldn't invent requirements
QAS RoleReport producerGate Owner with iteration authorityQuality is enforced, not just documented
RTE RoleCould touch code/mergePR shepherd only (no code, no merge)Clear separation of concerns
Exit StatesInformal "done"Explicit states per roleClear chain of custody
EvidenceScatteredLinear as system of recordAuditable, traceable delivery
PR ReviewUndefined stages3-stage processLayered review with clear ownership
Role CollapsingNot defined{{TICKET_PREFIX}}-499: RTE collapsible, QAS/SecEng notFlexibility with safety

Detailed File Changes

Harness Files Updated (10):

FileChangeRationale
.claude/README.mdAdded Role Execution ModesClarify solo vs multi-agent operation
.claude/commands/start-work.mdAdded Stop-the-Line gateAgents must verify AC/DoD exists
.claude/agents/be-developer.mdAdded Precondition, Ownership, ExitClear boundaries for implementers
.claude/agents/fe-developer.mdAdded Precondition, Ownership, ExitClear boundaries for implementers
.claude/agents/data-engineer.mdAdded Precondition, Ownership, ExitClear boundaries for implementers
.claude/agents/qas.mdUpgraded to Gate Owner + Linear MCPQAS is a gate, not just validator
.claude/agents/rte.mdAdded QAS prerequisite, removed mergeRTE shepherds, doesn't merge
.claude/agents/system-architect.mdAdded Stage 1 review roleFirst stage of 3-stage review
.claude/commands/search-pattern.mdAdded Grep tool parametersBetter pattern search UX
.claude/skills/orchestration-patterns/SKILL.mdFixed command referencesDocumentation accuracy

New Documentation Added (4):

FilePurpose
docs/sop/AGENT_CONFIGURATION_SOP.mdTool restrictions, model selection per role
docs/guides/AGENT_TEAM_GUIDE.mdComprehensive agent team reference
docs/workflow/WORKFLOW_COMPARISON.mdTDM role clarification (coordinator, not orchestrator)
docs/workflow/WORKFLOW_MIGRATION_GUIDE.mdGuide for transitioning to vNext

Project Docs Updated (6):

FileChange
AGENTS.mdExit States table, role updates
README.mdvNext workflow diagrams, Author's Note
CONTRIBUTING.mdExit States, Gate Reference, Role Collapsing
docs/sop/AGENT_WORKFLOW_SOP.mdv1.4 with vNext sections
docs/workflow/TDM_AGENT_ASSIGNMENT_MATRIX.mdv1.4 updates
docs/workflow/ARCHITECT_IN_CLI_ROLE.mdRole Collapsing Authority

Version History

VersionDateAuthorChanges
1.02025-12-23Claude Code (Opus 4.5)Initial vNext contract (Phases 1-2)
1.12025-12-23Claude Code (Opus 4.5)Phase 3 docs + errata
1.22025-12-23Claude Code (Opus 4.5)Alignment fixes (TDM role, QAS write policy)
1.32025-12-23Claude Code (Opus 4.5){{TICKET_PREFIX}}-499: Role collapsing policy

Source Document

Full knowledge transfer document: {{TICKET_PREFIX}}-497-vnext-workflow-contract-kt.md

Appendix A: Quick Reference Cards - Printable cheat sheets

A.1 Exit State Quick Reference

┌─────────────────────────────────────────────────────────────┐
│                    EXIT STATE CHEAT SHEET                   │
├─────────────────┬───────────────────────────────────────────┤
│ Role            │ Exit State                                │
├─────────────────┼───────────────────────────────────────────┤
│ BE-Developer    │ "Ready for QAS"                           │
│ FE-Developer    │ "Ready for QAS"                           │
│ Data-Engineer   │ "Ready for QAS"                           │
│ QAS             │ "Approved for RTE"                        │
│ RTE             │ "Ready for HITL Review"                   │
│ System Architect│ "Stage 1 Approved - Ready for ARCHitect"  │
│ ARCHitect-CLI   │ "Stage 2 Approved - Ready for HITL"       │
│ HITL            │ MERGED                                    │
└─────────────────┴───────────────────────────────────────────┘

A.2 Gate Quick Reference

┌─────────────────────────────────────────────────────────────┐
│                      GATE CHEAT SHEET                       │
├─────────────────┬─────────────────┬─────────────────────────┤
│ Gate            │ Owner           │ Blocking?               │
├─────────────────┼─────────────────┼─────────────────────────┤
│ Stop-the-Line   │ Implementer     │ YES - no AC = no work   │
│ QAS Gate        │ QAS             │ YES - no approval = stop│
│ Stage 1 Review  │ System Architect│ YES - pattern check     │
│ Stage 2 Review  │ ARCHitect-CLI   │ YES - architecture check│
│ HITL Merge      │ {{AUTHOR_NAME}}            │ YES - final authority   │
└─────────────────┴─────────────────┴─────────────────────────┘

A.3 Routing Quick Reference

┌─────────────────────────────────────────────────────────────┐
│                    ROUTING CHEAT SHEET                      │
├─────────────────┬───────────────────────────────────────────┤
│ Issue           │ Route To                                  │
├─────────────────┼───────────────────────────────────────────┤
│ Code bugs       │ @be-developer / @fe-developer             │
│ Validation fail │ Original implementer                      │
│ Doc mismatch    │ @tech-writer                              │
│ Pattern issue   │ @system-architect                         │
│ AC/DoD missing  │ @bsa                                      │
│ CI failure      │ Implementer (code) or Architect (infra)   │
│ Blocked > 4hrs  │ @tdm                                      │
└─────────────────┴───────────────────────────────────────────┘

See Agent Workflow SOP v1.4 for complete details.


Important Caveats

  • Multi-provider: Supports Claude Code, Gemini CLI, Codex CLI, and Cursor IDE
  • Template-ready: All project-specific values use {{PLACEHOLDER}} tokens
  • Provider maturity varies: Claude Code has the deepest integration; other providers are newer
  • Domain examples: Non-SWE adaptations (marketing, research) are documented but not yet validated

Repository Structure

.claude/                 # Claude Code harness (primary provider)
├── commands/            # 24 slash commands for workflow automation
├── skills/              # 20 model-invoked skills for domain expertise
├── agents/              # 11 SAFe agent profiles
├── team-config.json     # Agent Teams settings (optional, experimental)
└── SETUP.md             # Installation and customization guide

.gemini/                 # Gemini CLI harness (secondary provider)
├── commands/            # 30 TOML commands (namespaced: /workflow:*, /local:*, /remote:*, /media:*)
├── skills/              # 19 model-invoked skills (team-coordination is Claude-only)
├── settings.json        # Configuration (model, hooks, policy, security)
├── GEMINI.md            # System instructions
└── README.md            # Gemini-specific setup guide

.codex/                  # Codex CLI harness (reads AGENTS.md, TOML config, MCP native)
├── config.toml          # Codex CLI configuration (model, approval policy, sandbox)
└── README.md            # Codex-specific setup guide

.cursor/                 # Cursor IDE harness (glob-based .mdc rules, background agents)
└── rules/               # .mdc rule files with YAML frontmatter activation
    ├── 00-02            # Always-apply core rules (SAFe, git, patterns)
    ├── 03               # SAFe x AI-DLC program cadence (manual activation)
    ├── 04               # Knowledge-vault conventions (manual activation)
    ├── 10-13            # Auto-attached tech rules (Python, React, SQL, tests)
    ├── 20-23            # Agent-role rules (Architect, Backend, QAS, Security)
    └── 30-31            # Background agents and MCP integration

.agents/                 # Shared agent skills (discovered by Codex and other agents)
└── skills/              # 20 cross-provider skills (api-patterns, safe-workflow, etc.)

knowledge-vault/         # OKF knowledge-base subsystem (optional)
├── docs/                # Method, playbook, build prompts, Obsidian guide
├── templates/           # Starter bundle, Obsidian config, CI workflow
├── scripts/             # validate-vault.mjs (zero dependencies)
└── tests/               # Proof that each validator gate fails when broken

dark-factory/            # tmux Agent Teams infrastructure (optional)
├── scripts/             # factory-setup, start, stop, status, attach
├── templates/           # tmux.conf, team layouts, merge queue ruleset
└── docs/                # Dark Factory guide, Cursor SSH, merge queue policy

docs/                    # Additional documentation
├── guides/              # Methodology and adoption guides (incl. SAFe x AI-DLC)
├── whitepapers/         # Harness architecture and philosophy
└── onboarding/          # Getting started guides

specs_templates/         # Spec, planning, PI planning, and program templates


Citation

Download: CITATION.bib | CITATION.cff

APA 7th Edition

{{AUTHOR_LAST_NAME}}, {{AUTHOR_INITIALS}}, & {{PROJECT_SHORT}} Development Team. (2025). Evidence-based multi-agent
development: A SAFe framework implementation with Claude Code [White paper].
https://github.com/{{GITHUB_ORG}}/{{PROJECT_REPO}}

Contributing

We welcome contributions:

  • Patterns: Share production-tested patterns
  • Case Studies: Document your implementation experience
  • Research: Explore open questions from Section 10
  • Improvements: Suggest methodology enhancements

See CONTRIBUTING.md for guidelines.


License

MIT License - See LICENSE for details.


Attribution

This project is the Words To Film By™ multi-agent harness, adapted for SAFe development workflows.

Creator: J. Scott Graham (@cheddarfox) - jscottgraham.us Organization: ByBren, LLC Enterprise: Words To Film By™

If you use this harness in your own projects, you must include attribution. See NOTICE for details.

Historical Context: Evolved from Auggie's Architect Handbook


Words To Film By™
WebsiteContactSponsor

"Your AI team, ready to work."

Version: v2.11.1
Status: Production-validated, multi-provider (Claude Code + Gemini CLI + Codex CLI + Cursor IDE)

Frequently Asked Questions

What is safe-agentic-workflow?

safe-agentic-workflow is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by bybren-llc. SAW — SAFe Agentic Workflow AI Agent Harness for Multi-Agent Team Workflows Built on SAFe methodology (Scaled Agile Framework), adapted for AI agent teams (Now With AI-DLC!) Works for any team with repeatable processes: Software, Marketing, Research, Legal, Operations. It has 402 GitHub stars.

Is safe-agentic-workflow safe to use?

Yes. safe-agentic-workflow passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install safe-agentic-workflow?

Clone the repository with "git clone https://github.com/bybren-llc/safe-agentic-workflow" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is safe-agentic-workflow written in?

safe-agentic-workflow is primarily written in Shell. It is open-source under bybren-llc on GitHub, so you can review or fork the full source.

Are there alternatives to safe-agentic-workflow?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh safe-agentic-workflow against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details