Imported from bigsexyaloe/agent_infra (
AGENTS.md). Install upstream withnpx skills add bigsexyaloe/agent_infra. Copyright stays with the author.
AGENTS.md — Agent Infrastructure Rules
This file is automatically read by Qwen Code at session start.
It defines global rules that apply to ALL agents in this project.
Context: Fintech compliance environment — 152-ФЗ, ФСТЭК, ISO 27001.
Pipeline Overview
This project uses a two-level mandatory pipeline for all feature development.
Pipeline level (secure or complex) is determined by the Manager in Phase 0, not by the requester.
Phase 0 — Pre-Pipeline (interactive, user-facing)
Feature Request → [MANAGER] — clarify → determine complexity → write spec → spec_ready
/pipeline cannot start until Manager sets Status: spec_ready.
No user input is accepted once /pipeline starts.
Secure Pipeline (default for all fintech features)
spec_ready → [PROGRAMMER] → [REVIEWER] → [SECURITY] → [TESTER] → Done ✅
Complex Pipeline (new subsystems, architectural changes, breaking API)
spec_ready → [ARCHITECT] → [PROGRAMMER] → [REVIEWER] → [SECURITY] → [TESTER] → Done ✅
Return Loops
[REVIEWER] ──REQUEST_CHANGES──▶ .qwen/tasks/returned/<ID>-review.md
[SECURITY] ──FAIL──────────────▶ .qwen/tasks/returned/<ID>-security.md
[TESTER] ──FAIL──────────────▶ .qwen/tasks/returned/<ID>-bug.md
└── all return via: /return programmer <TASK-ID>
Agent Roster
| Agent | File | Role | When |
|---|---|---|---|
manager |
.qwen/agents/manager.md |
Phase 0: clarification, complexity decision, spec | Every task — before pipeline |
architect |
.qwen/agents/architect.md |
Architecture Decision Record | complex pipeline only |
programmer |
.qwen/agents/programmer.md |
Feature implementation + unit tests | Every pipeline, after spec/ADR or on return |
reviewer |
.qwen/agents/reviewer.md |
Code quality gate (SOLID, tests, design) | Every pipeline |
security |
.qwen/agents/security.md |
Security audit (OWASP + compliance standards) | Every pipeline |
tester |
.qwen/agents/tester.md |
QA acceptance gate | Every pipeline — only after reviewer + security pass |
Commands
| Command | Usage | Effect |
|---|---|---|
/run manager <ID> |
Phase 0 — before pipeline | Manager clarifies, determines complexity, writes spec |
/run architect <ID> |
After spec (complex only) |
Architect writes ADR |
/run programmer <ID> |
After spec/ADR or on any return | Programmer implements |
/run reviewer <ID> |
After implementation | Code review — APPROVE or REQUEST_CHANGES |
/run security <ID> |
After review passes | Security audit — PASS or FAIL |
/run tester <ID> |
After reviewer + security pass | QA — accepts or returns with bugs |
/return programmer <ID> |
After any FAIL/RETURN | Routes bug/review/security report to programmer |
/pipeline <ID> |
After Status: spec_ready |
Auto-run entire pipeline without user input |
/status |
Any time | Dashboard of all task states |
/status <ID> |
Any time | Detailed trace for one task |
Task File Locations
| Stage | Location | Pattern |
|---|---|---|
| Feature request | .qwen/tasks/active/ |
FEAT-XXX.md |
| Manager spec | .qwen/tasks/active/ |
FEAT-XXX-spec.md |
| Architect ADR | .qwen/tasks/active/ |
FEAT-XXX-arch.md |
| Programmer impl | .qwen/tasks/active/ |
FEAT-XXX-impl.md |
| Code review (pass) | .qwen/tasks/active/ |
FEAT-XXX-review.md |
| Security audit (pass) | .qwen/tasks/active/ |
FEAT-XXX-security.md |
| Review return | .qwen/tasks/returned/ |
FEAT-XXX-review.md |
| Security return | .qwen/tasks/returned/ |
FEAT-XXX-security.md |
| QA bug report | .qwen/tasks/returned/ |
FEAT-XXX-bug.md |
| Accepted result | .qwen/tasks/done/ |
FEAT-XXX-result.md + all files |
Task Status Lifecycle
new
│
▼
clarifying ◀──── (Manager asks questions, user responds)
│
▼
spec_ready ────────────────────────────── /pipeline starts here
│
├─▶ arch_conflict ◀── [ARCHITECT: spec contradicts architecture]
│ │
│ └──▶ spec_ready ◀── [MANAGER: spec revised]
│
▼ (complex only)
arch_ready
│
▼
in_development ◀──────────────────────────────────────────────────────┐
│ │
├─▶ spec_question ◀── [PROGRAMMER: spec technically impossible] │
│ │ │
│ └──▶ spec_ready / arch_ready ◀── [MANAGER: question answered]│
│ │
▼ │
code_review ◀──── review_returned ◀── [REVIEWER: REQUEST_CHANGES] │
│ │
▼ │
review_passed │
│ │
▼ │
security_audit ◀── security_failed ◀── [SECURITY: FAIL] │
│ │
▼ │
security_cleared │
│ │
▼ │
in_review ◀──── qa_returned ◀──── [TESTER: FAIL] ─────────────────────┘
│
▼
done ✅
Pipeline Selection
Complexity is set by Manager in Phase 0 — never by the requester.
| Level | When | Stages |
|---|---|---|
secure |
Default for all fintech features — auth, PII, payments, any data path | programmer → reviewer → security → tester |
complex |
New subsystem, breaking API change, new data model, cross-cutting concern | architect → programmer → reviewer → security → tester |
There is no simple or standard pipeline in this environment.
Every feature goes through security audit and code review — no exceptions.
Compliance Standards
Standards are loaded from .qwen/standards/security/ and .qwen/standards/architecture/.
| Standard | File | Default |
|---|---|---|
| 152-ФЗ (Personal Data) | standards/security/152-fz.md |
Always active |
| ISO 27001 | standards/security/iso-27001.md |
Always active |
| ФСТЭК | standards/security/fstec.md |
Activated by Manager when КИИ is affected |
| PCI-DSS v4 | standards/security/pci-dss-v4.md |
Activated by Manager when card data is involved |
| GDPR | standards/security/gdpr.md |
Activated by Manager when EU resident data is involved |
Manager activates standards in the task's Meta table. Security agent reads them in Step 0.
Artifact Gates (technical enforcement)
Every pipeline agent hard-checks its required artifacts by reading .qwen/pipeline.json before doing any work.
If a required file is missing or the task status is wrong — the agent stops and prints an error. It does not proceed.
This is not policy — it is a hard block enforced by each agent's Artifact Gate section.
Global Rules (all agents must follow)
- Always read
.qwen/pipeline.json— it is the source of truth for artifact requirements. - Always run your Artifact Gate first — no exceptions.
- Always use the provided templates — no ad-hoc formats.
- Always print the handoff message at the end of your work.
- Never skip your checklist — quality gates are mandatory.
- Never implement outside the spec — out-of-scope work is rejected.
- Respect role boundaries — testers don't fix code; managers don't write code; architects don't implement.
- Task IDs are immutable — do not rename or change the TASK-ID once assigned.
- Reviewer and Security are HARD GATES — tester cannot run until both report passing verdicts. No exceptions.
- Security findings are non-negotiable — CRITICAL and HIGH always block. MEDIUM is tracked. No severity may be downgraded.
- Manager Phase 0 is interactive — once
/pipelinestarts, no user interaction is expected or accepted.
Return Limits (escalation thresholds)
| Stage | Max Returns | On Exceeded |
|---|---|---|
| Reviewer | 2 | Escalate to manager — spec or design may be fundamentally flawed |
| Security | 2 | Escalate — programmer may need security training or pair review |
| Tester | 3 | Escalate — review spec clarity |
| Total | 6 | Stop pipeline, mandatory manager review |
LLM Configuration
Models are configured in .qwen/settings.json.
Per-role model overrides are in the agentConfig section.
Use /model inside a session to switch models on the fly.
Naming Conventions
- Task IDs:
FEAT-001,FEAT-002, … (increment, never reuse) - Bug IDs within a report:
BUG-001,BUG-002, … - Review findings:
RV-001,RV-002, … - Security findings:
SEC-001,SEC-002, … - Acceptance criteria:
AC-01,AC-02, … - Return iterations: increment
Return #in each impl/bug/review/security report
Common Commands (project)
# Install Qwen Code
npm install -g @qwen-code/qwen-code@latest
# Configure LLM
# Edit .qwen/settings.json — add your API key and set model
# Start a session
qwen
# Create a new feature task
cp .qwen/templates/feature-request.md .qwen/tasks/active/FEAT-001.md
# Fill in: title, description, problem, rough acceptance criteria
# Do NOT set Complexity or Standards — Manager sets these in Phase 0
# Phase 0: clarify and spec (interactive)
/run manager FEAT-001
# Run the pipeline (no user input from here)
/pipeline FEAT-001
# Check status
/status
/status FEAT-001