# agentic - Agent Ruleset

> **Skills**: on-demand rulesets live in [`../skills/`](../skills/); the full
> list is the SKILLS CATALOGUE in the [root AGENTS.md](../AGENTS.md). The table
> below is generated by `sync.sh` - never hand-edit it.

### Auto-invoke Skills

When performing these actions, ALWAYS invoke the corresponding skill FIRST:

| Action | Skill |
| ------ | ----- |
| Adding a Community Agent Skill (importable .md attack workflow) | `add-community-skill` |
| Adding a built-in attack skill to the agent | `builtin-agent-skill` |
| Adding a tool the agent can call | `agentic-tool-integration` |
| Adding or editing an MCP server the agent uses | `agentic-tool-integration` |
| Adding or integrating an LLM provider | `llm-provider-integration` |
| Changing or adding a project setting or default value | `project-settings-cascade` |
| Editing a Prisma @default, a Python settings default, or the /defaults endpoint | `project-settings-cascade` |
| Editing agent skill classification, phase injection, or the attack-skill UI | `builtin-agent-skill` |
| Editing model-id routing or provider credential handling | `llm-provider-integration` |
| Editing the agent tool registry, phase map, or PhaseAwareToolExecutor dispatch | `agentic-tool-integration` |

---

## CRITICAL RULES - NON-NEGOTIABLE

<!-- Add a rule only if an agent breaks it while working elsewhere AND cannot
     discover it from the file being edited. Component patterns belong in a
     scoped skill. See the root AGENTS.md for repo-wide rules. -->

- **NEVER** give the agent white-box knowledge of a target. RedAmon agents
  operate black-box (no source access to the systems they test); prompts,
  skills, and tools must not assume target internals.

---

## TECH STACK

Python 3.11 · LangGraph / LangChain agent · pydantic. Source is **baked into the
`redamon-agent` image** (NOT volume-mounted): a `.py` change needs
`docker compose build agent && docker compose up -d agent`. Exceptions that
hot-reload (read-only mounts): `agentic/logs`, `agentic/skills` (Chat Skills),
`agentic/community-skills` (Community Agent Skills).

## PROJECT STRUCTURE

```
api.py  orchestrator.py  job_runner.py   FastAPI surface + agent loop entrypoints
orchestrator_helpers/                    agent orchestration helpers
prompts/                                 system + tool prompts
skills/               Chat Skills (volume-mounted, no rebuild)
community-skills/     Community Agent Skills (volume-mounted, no rebuild)
cypherfix_triage/  cypherfix_codefix/    CypherFix triage + codefix agents
graph_db/  knowledge_base/               COPY-baked copies of the repo-root layers
mcp_registry.py  project_settings.py     tool registry + per-project settings
tests/                                   pytest (run via ../agentic/run_tests.sh)
```

## COMMANDS

```bash
# Rebuild after any agentic/*.py change, then run the gate
docker compose build agent && docker compose up -d agent
./agentic/run_tests.sh          # unit gate, per-file isolated in redamon-agent; must be 100% green
./agentic/run_tests.sh integration    # heavier tier
```

## QA CHECKLIST

- [ ] `./agentic/run_tests.sh` green (per-file isolation gate).
- [ ] New or changed behaviour is covered by a test (see the `redamon-testing` skill for where + how).
- [ ] Rebuilt the `agent` image if you changed a baked `.py` (skills/ & community-skills/ are exempt).
- [ ] No white-box target assumptions introduced (black-box only).
- [ ] New agent tool / skill wired through every layer it requires.
