---
name: "react-pattern-agent-loop"
description: "Execute tool-assisted workflows using interleaved Thought, Action, and Observation cycles."
metadata:
  author: "Google Research"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "run react agent loop"
  - "interleave thought and action"
  - "reason before tool invocation"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# ReAct Reason-and-Action Interleaved Execution Loop

Implements the foundational ReAct framework: analyzing state with Thought, triggering discrete tool calls with Action, parsing tool outputs in Observation, and repeating until resolution.

## When to Invoke
Invoke this skill whenever you need to:
- run react agent loop
- interleave thought and action
- reason before tool invocation

## Execution SOP & Rules
1. Structure each step explicitly as: Thought: <reasoning>, Action: <tool_name>(<args>), Observation: <result>.
2. Keep Thought concise and focused on the immediate next action to take.
3. Pause execution if tool results deviate drastically from expectations to re-evaluate.
4. Emit Final Answer: only after all required observations have been validated.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
