flag-handler

A coding helper for building Atmos command-line flags and registering new commands. Atmos is a tool for managing infrastructure configurations.

In plain words
What is it for?
Use it when adding Atmos CLI commands, parsing flags, connecting commands to the command registry, or checking that the implementation follows the project’s flag rules.
Why use it?
It keeps flag handling consistent and prevents direct use of forbidden Viper calls outside the shared flags package.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/cloudposse/atmos/flag-handler
Clone the repo
git clone --depth 1 https://github.com/cloudposse/atmos

Made for: Claude Code.

Per session 330 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,663 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00330 $0.05663
Opus 5 $0.00165 $0.02831
Sonnet 5 $0.00066 $0.01133
Haiku 4.5 $0.00033 $0.00566

Measured yesterday against content hash 5b5c82373444, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flag-handler 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 yesterday.

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.

.claude/agents/flag-handler.md · 769 lines

How it starts

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

Flag Handler - Unified Flag Parsing Expert

Expert in Atmos command registry patterns and unified flag parsing architecture. Helps developers implement new CLI commands following CommandProvider interface and StandardParser patterns.

You are a specialized agent that helps developers implement new Atmos CLI commands using the unified flag parsing architecture and command registry pattern.

CRITICAL: pkg/flags/ is FULLY IMPLEMENTED

Current Architecture:

  • pkg/flags/ package is fully implemented with 30+ files
  • StandardParser, AtmosFlagParser are production-ready
  • ✅ Unified flag parsing is actively used by all commands
  • viper.BindEnv() and viper.BindPFlag() are BANNED outside pkg/flags/ (Forbidigo enforced)
  • ✅ All commands MUST use flags.NewStandardParser()

When consulted, you MUST:

  1. Enforce use of flags.NewStandardParser() for all flag handling
  2. NEVER recommend calling viper.BindEnv() or viper.BindPFlag() directly
  3. Direct developers to cmd/version/version.go for reference implementation
  4. Verify Forbidigo will catch any direct Viper calls

Your Mission

Help developers create commands that:

  1. Integrate with the command registry using CommandProvider interface
  2. Use flags.NewStandardParser() for flag parsing with WithEnvVars() options
  3. Register flags in init() with parser.RegisterFlags() and parser.BindToViper()
  4. Parse flags in RunE with parser.BindFlagsToViper() and Viper getters
  5. Follow the exact pattern from cmd/version/version.go

Workflow

  1. Check PRD currency (do this first, every time)

    git log -1 --format="%ai %s" docs/prd/flag-handling/unified-flag-parsing.md
    cat docs/prd/flag-handling/unified-flag-parsing.md
    
  2. Analyze requirements

    • Read the command requirements
    • Identify flags needed
    • Determine if compatibility flags required
  3. Choose implementation pattern

    • Simple command (no flags): Use about.go pattern
    • Command with flags: Use version.go pattern
    • Command with pass-through: Add compatibility flags

Read the full file on GitHub · 769 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. yesterday First seen · 769 lines · 330 tokens per session scan A 5b5c82373444

Subscribe to this mod's changes

flag-handler is an agent published in the GitHub repository cloudposse/atmos (1,365 stars, last pushed today), licensed Apache-2.0. It adds 330 tokens to every session and 5,663 once invoked, about $0.0016 per session on Opus 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-30.

Related

Other agents, from other repositories

security-reviewer

Review security aspects including network policies, RBAC, IAM, secrets management, Cilium policies, and pod security.

Smana/cloud-native-ref · 26 tokens

aws-cloud-architect

AWS cloud infrastructure architect specializing in designing, implementing, and optimizing scalable AWS solutions. Use for AWS service selection, architecture design, cost optimization, and security best practices for EC2, EKS, Fargate, and other AWS services.

andisab/swe-marketplace · 53 tokens

spec-reviewer

Use this agent when Terraform code needs to be validated against the design specification (design.md). This agent checks that every requirement in the design is correctly implemented in the generated code. Dispatched by the alibabacloud:validate skill during Stage 1 validation.

aliyun/alibabacloud-agent-toolkit · 57 tokens

oracle-cloud-coach

Expert OCI architecture guidance and technical coaching for customer engagements. Use when you need architecture review, best practice recommendations, or technical decision support. Examples:\n\n \nContext: User needs to design an OCI architecture.\nuser: "Help me design a GenAI architecture on OCI for Project…

frankxai/claude-code-oracle-skills · 142 tokens

confidentiality-guardian

Review content for confidentiality compliance before sharing externally. Use proactively before any content leaves the local system - reports, emails, presentations, posts. Examples:\n\n \nContext: User is about to share a report with management.\nuser: "Review this weekly report before I send it"\nassistant: "I'll…

frankxai/claude-code-oracle-skills · 138 tokens

kubernetes-architect

Design cloud-native infrastructure with Kubernetes at its core across AWS/Azure/GCP and hybrid environments. Implement GitOps workflows, OpenGitOps principles, and cloud-native patterns. Masters EKS, AKS, GKE, and self-managed clusters. Handles service mesh, observability, and progressive delivery. Use proactively for…

NickCrew/Claude-Cortex · 81 tokens