# Skill + MCP + Agent Automation Architecture

This repository now has a lightweight automation layer around the existing pytest + Playwright + Allure suite.

## Layers

| Layer | Path | Purpose |
| --- | --- | --- |
| Skill | `.codex/skills/saas-e2e-automation/` | Gives Codex repository-specific E2E workflow knowledge. |
| MCP | `scripts/mcp_saas_e2e.py` and `.codex/mcp/saas-e2e.json` | Exposes test planning, account inspection, bug lookup, report summary, and pytest runs as tools. |
| Agent entry | `scripts/agent_e2e.py` | Human-friendly CLI for the same core operations when MCP is not attached. |
| Core library | `scripts/e2e_automation_core.py` | Shared implementation used by both MCP and CLI. |
| Agent profile | `.codex/agents/e2e-runner.md` | Operating loop for future test-running/debugging agents. |

## Daily Commands

```powershell
.\.venv\Scripts\python.exe .\scripts\agent_e2e.py plan standalone
.\.venv\Scripts\python.exe .\scripts\agent_e2e.py accounts
.\.venv\Scripts\python.exe .\scripts\agent_e2e.py run main
.\.venv\Scripts\python.exe .\scripts\agent_e2e.py summary
.\.venv\Scripts\python.exe .\scripts\agent_e2e.py bugs
```

## MCP Tools

The `saas-e2e` MCP server supports:

- `list_tests`
- `inspect_accounts`
- `latest_bugs`
- `allure_summary`
- `build_plan`
- `run_pytest`

Point a Codex/MCP client at `.codex/mcp/saas-e2e.json`, or copy that server entry into the client-level MCP config.
