AGENT SKILL

operational-constraints

Activate comprehensive operational constraints for disciplined execution. Use at session start, before complex tasks, during planning phases, or when encountering friction. Enforces token efficiency, tool protocols, parallel execution, TDD, and system mapping.

License 许可
Apache-2.0
最近更新
2026-11-12
Stars
★ 6
Forks
1

01 前言 Front Matter

name
operational-constraints
description
Activate comprehensive operational constraints for disciplined execution. Use at session start, before complex tasks, during planning phases, or when encountering friction. Enforces token efficiency, tool protocols, parallel execution, TDD, and system mapping.
when_to_use
Use for ops-mode, ultrathink, operational mode, disciplined execution, a complex task, or a request to enable constraints.

03 SKILL.md 正文

Operational Constraints Skill

Comprehensive operational rules for disciplined Claude Code execution. This skill captures battle-tested constraints that prevent common pitfalls and ensure consistent, high-quality outputs.

When to Use

ALWAYS invoke this skill when:

  • Starting a session that will involve complex multi-step work
  • Before /aa-ma-plan or any significant planning
  • After encountering friction or repeated issues
  • When you notice yourself making avoidable mistakes
  • Any session requiring disciplined, methodical execution

Quick activation: /ops-mode command loads this automatically.


Core Constraints

1. Token & Context Efficiency

Output compression: Use Skill(token-compression) for response token reduction. Default level: full. During AA-MA execution, level is set automatically by task Mode (HITL→lite, AFK→ultra). See skill for intensity details and auto-clarity exceptions.

Context loading:

  • When approaching 70% context usage, consider context compaction
  • Prefer loading REFERENCE and TASKS files over full history
  • Suppress verbose logs unless actively debugging
  • Use structured summaries over lengthy explanations
  • No redundant confirmation messages

Anti-patterns to avoid:

  • Loading entire files when only specific sections needed
  • Repeating information already established in context
  • Verbose "thinking out loud" when concise reasoning suffices

2. Research & Tools Protocol

Principles:

  • Use the right tool for the job
  • Leverage external knowledge sources for current information
  • Prefer specialized tools over bash commands

Tool Selection Matrix:

Need Primary Tool Alternative
Library/API docs Context7 MCP WebSearch
Current information WebSearch WebFetch
Text pattern search GrepTool -
Structural code search Skill(ast-grep) GrepTool
Complex file analysis Python script -
File pattern matching Glob -
Codebase exploration Task(Explore) GrepTool + Glob

Context7 MCP Protocol:

  1. ALWAYS use Context7 for library/API documentation when available
  2. If Context7 fails, retry once
  3. If retry fails, fallback to:
    • Native Claude Code documentation tools
    • Community-vetted code snippets
    • Official documentation via WebFetch
  4. Record and surface fallback status

Search Tools:

# Pattern-based content search
GrepTool: pattern="function_name", path="src/"

# Structural code search (AST-based)
Skill(ast-grep) for:
- Finding all function definitions matching pattern
- Refactoring code structures
- Complex code transformations

# Large file analysis
Python script when:
- Multiple processing steps required
- Complex logic needed
- Results need aggregation

3. Parallel Execution Mandate

Principle: MUST evaluate if parallel subagents can handle independent subtasks.

Decision Tree:

Are there multiple distinct subtasks?
├── NO → Execute sequentially
└── YES → Do they have dependencies between them?
    ├── YES → Identify dependency chain, parallelize independent portions
    └── NO → PARALLELIZE IMMEDIATELY

When to use parallel agents:

  • 3+ independent research questions
  • Multiple files need analysis without interdependencies
  • Different aspects of a problem can be explored simultaneously
  • Investigation tasks that don't share state

How to parallelize:

Use Task tool with multiple invocations in SINGLE message:
- Task 1: Explore agent for area A
- Task 2: Explore agent for area B
- Task 3: Plan agent for design

OR use Skill(dispatching-parallel-agents) for structured dispatch.

Anti-patterns:

  • Sequential execution of clearly independent tasks
  • Waiting for one exploration to complete before starting another
  • Not considering parallelization at all

4. Development Discipline

Full doctrine (auto-loaded, stated once): the principles (KISS, DRY, YAGNI, SoC, SOLID), the testing floor, comments and suppressions are in claude-code/rules/coding-standards.md; the AA-MA process doctrine is in claude-code/rules/engineering-standards.md. This section names them without restating them. Also: 12-Factor for services; TDD via Skill(test-driven-development).

Impact Analysis:

  • Use Skill(impact-analysis) for ALL code changes
  • Required at milestone boundaries during AA-MA execution
  • HIGH risk impacts must be resolved before proceeding

Code Quality:

  • Functional working code over perfection
  • Follow existing codebase patterns

5. System Mapping (Pre-Flight)

Principle: Before modifying code, understand the system context.

5-Point Protocol:

Point Question Tools
1. Architecture What files/modules are involved? Glob, LS
2. Execution Flows How does data/control flow? Grep, ast-grep
3. Logging What observability exists? Grep "logger|logging"
4. Dependencies What does this code depend on? Grep "import|from"
5. Environment What config/env vars matter? Grep "environ|getenv"

When to perform:

  • Changes touch 3+ files
  • Unfamiliar code area
  • Integrating with external services
  • Modifying data pipelines

Detailed protocol: See Skill(system-mapping)


6. Planning Output Protocol

At the end of any planning phase, MUST:

  1. Explicitly ask for approval before proceeding
  2. Offer clear options:
    • Proceed with implementation
    • Create AA-MA artifacts first
    • Adjust/refine the plan
  3. Create AA-MA artifacts when approved for complex tasks
  4. Identify the single next action to take
  5. Emit element #12 (Engineering Standards Declaration) as part of the plan output — declare which themes from engineering-standards.md materially apply and how. See Skill(plan-verification) Angle 6 for the verification path.

Template:

## Plan Summary
[Concise overview]

## Proposed Approach
[Key decisions]

## Ready to proceed?
- [ ] Approve and proceed
- [ ] Create AA-MA artifacts first
- [ ] Need adjustments: [specify]

Checklists

Session Start Checklist

  • [ ] Is this a complex multi-step task? If yes, invoke this skill
  • [ ] Any active AA-MA plans? Check .claude/dev/active/
  • [ ] What skills might apply? Review available skills

Pre-Task Checklist

  • [ ] Can this be parallelized? Evaluate subagent opportunities
  • [ ] Is system-mapping needed? Check 5-point protocol triggers
  • [ ] TDD applicable? Plan tests first if coding
  • [ ] Impact analysis required? For code changes, always

Pre-Commit Checklist

  • [ ] All tests passing?
  • [ ] Impact analysis completed for changes?
  • [ ] AA-MA docs updated if active plan?
  • [ ] Conventional commit message?

Cross-References

Skill/Command Purpose When to Use
Skill(system-mapping) Detailed 5-point pre-flight Before code modifications
Skill(test-driven-development) TDD enforcement All coding tasks
Skill(impact-analysis) Change risk assessment Before and after code changes
Skill(dispatching-parallel-agents) Parallel execution patterns Independent subtasks
Skill(ast-grep) Structural code search Complex code analysis
/ops-mode Quick constraint activation Session start
/aa-ma-plan Comprehensive planning Major features
claude-code/rules/engineering-standards.md 6-theme doctrine (auto-loaded) Always

Quick Reference Card

TOKEN EFFICIENCY
├── Skill(token-compression) for output reduction
├── Load only essential context
└── No redundant confirmations

TOOLS
├── Context7 → Library docs
├── GrepTool → Pattern search
├── ast-grep → Structural search
└── Python → Complex analysis

PARALLEL
├── 3+ independent tasks → PARALLELIZE
├── No dependencies → PARALLELIZE
└── Use Task tool with multiple calls

DISCIPLINE
├── coding-standards.md (principles, TDD floor)
├── Impact analysis for all changes
└── System mapping for unfamiliar code

PLANNING
├── Ask approval before proceeding
├── Offer: proceed / AA-MA / adjust
└── Identify single next action

Activation Confirmation

When this skill is loaded, acknowledge with:

OPERATIONAL CONSTRAINTS: ACTIVE

Enforcing:
- Token compression (Skill: token-compression)
- Tool protocols (Context7, GrepTool, ast-grep)
- Parallel execution evaluation
- TDD discipline
- System mapping pre-flight
- Planning approval protocol

Ready for disciplined execution.

04 同仓库更多 Skills

snewhouse
snewhouse/aa-ma-forge

deploy-helper

You can use this to help with deploy stuff, deploying, deployments, releases, shipping, pushing to prod, going live, rollouts.

运维与部署
★ 6
snewhouse
snewhouse/aa-ma-forge

writing-for-agents

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

内容创作者写作与文案Skill与智能体开发
★ 6
snewhouse
snewhouse/aa-ma-forge

verify-plan

Slash entry for plan verification: runs plan-verification on an existing AA-MA plan, writes [task]-verification.md, and with --iterate loops until the plan converges. Use when the user types /verify-plan or wants the verification report saved.

★ 6
snewhouse
snewhouse/aa-ma-forge

verify-impl

Post-impl adversarial review symmetric to /verify-plan. Dispatches up to 5 parallel audit agents (code-reviewer, security-auditor, tdd-sequence-auditor, context7-evidence-auditor, future-proofing-auditor) based on the milestone's plan-declared Audit-Profile. CRITICAL findings surface via AskUserQuestion accept/dispute/defer panel before §7.3 user authorization. Introduced in v0.8.0 per ADR-0005. Invoked by Phase 6.8 of /execute-aa-ma-milestone.

★ 6
snewhouse
snewhouse/aa-ma-forge

understand-codebase

Onboard to a new, inherited, or shared codebase. Read it, understand it, map it, and learn its conventions, versioning, tests, tech stack, rules (AGENTS.md / CLAUDE.md / .cursorrules / etc.), build/run/CI, integrations, security posture, and repo health — then produce an honest pros/cons verdict, a "contribute safely" playbook, and an "add a feature" playbook, written to ONBOARDING.md at the repo root plus a .claude/onboarding/ set of deep-dives — and optionally author an AGENTS.md if one is missing, or review and propose improvements to an existing one. Tiered (Quick / Standard / Deep). Reuses codemem (index + diagrams), gsd-map-codebase, system-mapping, code-intelligence, impact-analysis rather than re-implementing them; Deep tier runs a TeamCreate agent-team. Keywords: new codebase, shared codebase, inherited code, onboard, understand this repo, how do I contribute, how do I add a feature, ramp up, get oriented, ONBOARDING.md, AGENTS.md, codebase walkthrough, joining a project.

人力资源Skill与智能体开发
★ 6
snewhouse
snewhouse/aa-ma-forge

token-compression

Output token compression for AA-MA workflows. Reduces response tokens by 40-75% while preserving full technical accuracy. Three intensity levels mapped to execution modes: lite (HITL), full (general), ultra (AFK). Auto-activates during AA-MA execution based on task Mode field. Manual activation via /compress lite|full|ultra.

★ 6