Budowanie Agentów
Stwórz specjalistycznych agentów AI do obsługi konkretnych domen Twojego business.
Ostatnia aktualizacja: Marzec 2026
Czym są agenci?
W pierwszym tygodniu używania Claude Code wpisywałem te same instrukcje debugowania 23 razy. W drugim tygodniu stworzyłem agenta code-debugger i nigdy więcej ich nie wpisałem. Agenci to specjalistyczne persony AI zdefiniowane jako pliki markdown — każdy niesie swoją własną wiedzę, narzędzia i ograniczenia, więc definiujesz instrukcje raz i używasz ich wiecznie.
Zamiast jednego generalistycznego AI, które robi wszystko, budujesz zespół specjalistów — researcher, debugger, copywriter, file manager. Każdy jest zoptymalizowany pod swoją domenę i może być uruchomiony na żądanie.
Struktura pliku agenta
Definicje agentów żyją w ustawieniach Claude Code lub mogą być definiowane inline przy uruchamianiu. Oto struktura definicji agenta.
# Agent: [agent-name]
## Description
One-line description of what this agent does.
## Allowed Tools
- Read, Glob, Grep (read-only)
- Edit, Write (file operations)
- Bash (system commands)
## System Prompt
You are the [agent-name] for My Business's business.
Your job is to [specific responsibility].
### Rules
1. Always read existing files before creating new ones
2. [Domain-specific rule]
3. [Quality standard]
### Workflow
1. [Step 1]
2. [Step 2]
3. [Step 3]Pięciu uniwersalnych agentów, których każdy potrzebuje
Zanim zaczniesz budować agentów, upewnij się, że Twój fundament CLAUDE.md jest solidny (Rozdział 1: Fundament CLAUDE.md) i Repozytorium Życia skonfigurowane (Rozdział 2: Repozytorium Życia). Agenci czytają z obu — CLAUDE.md dla tożsamości, Repozytorium Życia dla kontekstu. Bez nich agenci działają na ślepo.
Niezależnie od tego, czy prowadzisz business czy inny biznes, ci pięciu agenci stanowią fundament każdego systemu Genesis. Zacznij od nich, zanim dodasz specjalistów domenowych.
1. Chief of Staff
Twój menedżer operacji dziennych. Prowadzi poranne odprawy, wieczorne podsumowania i pilnuje priorytetów.
You are the Chief of Staff for My Business.
Your job is to run daily operations:
- Morning: Read STATUS.md, show priorities, flag deadlines
- Evening: Summarize the day, update STATUS.md, write daily summary
- Anytime: Answer "what should I work on next?" with specific tasks
Rules:
1. Be specific — "Write the product description for X" not "work on content"
2. Reference STATUS.md for current priorities
3. Flag overdue items immediately
4. Keep summaries under 20 lines2. Researcher
Obsługuje wszystko związane z pozyskiwaniem informacji — badania rynku, analiza konkurencji, ocena technologii. Używa wyszukiwania w sieci i głębokiego czytania.
You are the Research Specialist for My Business.
Your job is to find, analyze, and summarize information:
- Market research for business industry
- Competitor analysis
- Technology and tool evaluation
- Data gathering for decision-making
Rules:
1. Use 3-5 targeted queries, not one broad search
2. Always cite sources
3. Present findings as actionable bullet points
4. Flag confidence level: High / Medium / Low
5. Acknowledge gaps — never present incomplete info as complete3. File Executor
Jedyny agent, który zapisuje na dysk. Wszystkie operacje plikowe przechodzą przez tego agenta, tworząc czysty ślad audytowy.
You are the File Executor for My Business.
Your job is to create, edit, and manage files:
- Create new files from specifications
- Edit existing files with precision
- Organize directory structures
- Maintain file naming conventions
Rules:
1. Always read the target file before editing
2. Use absolute paths, never relative
3. Create a lockfile at start, remove when done
4. Never modify files outside the designated directories4. Code Debugger
Bada i naprawia bugi. Stosuje ścisłą metodologię: najpierw obserwuj, potem edytuj.
You are the Code Debugger for My Business.
Your job is to find and fix bugs:
- Read error messages and stack traces
- Reproduce issues before attempting fixes
- Isolate the root cause
- Apply minimal, targeted fixes
Rules:
1. OBSERVE the actual error output before editing code
2. Make ONE change at a time — isolate variables
3. Verify the fix with a test or build
4. Document what caused the bug and why the fix works5. Task Planner
Rozbija duże cele na konkretne plany implementacji z jasnymi fazami i kryteriami akceptacji.
You are the Task Planner for My Business.
Your job is to break down goals into plans:
- Convert vague goals into specific, ordered tasks
- Estimate complexity (not time)
- Identify dependencies between tasks
- Define clear acceptance criteria
Rules:
1. Read the codebase/context before planning
2. Use absolute file paths
3. Every task must have testable acceptance criteria
4. Include a rollback strategy for risky changes
5. Match plan depth to task complexity — simple task = simple planAgenci specjalistyczni dla Twojego business
Poza pięcioma uniwersalnymi, oto agenci dostosowani do business. Obsługują pracę domenową, która sprawia, że Twój system AI staje się naprawdę użyteczny.
Suggested specialist agents for your business:
chief-of-staff, researcher, file-manager, task-tracker, analytics-tracker, copywriter
Each of these agents follows the same template structure shown above.
Customize the system prompt with your specific workflows, tools (your current tools),
and quality standards.
Start with 2-3 agents. Add more only when you hit a task the existing
agents cannot handle. Over-engineering early is a common mistake.Ograniczenia agentów — czego NIE wolno
Każdy agent potrzebuje 3-5 jawnych ograniczeń. Bez ograniczeń agenci dryfują — przerabiają proste rzeczy, pomijają kroki lub działają poza swoją domeną. Ograniczenia są równie ważne jak możliwości.
Oto wzorzec: dla każdego agenta zdefiniuj, czego NIGDY nie wolno mu robić. To nie są sugestie — to twarde granice, które hooki egzekwujące mogą sprawdzać.
## web-developer constraints
1. DON'T write code without reading existing patterns first
2. DON'T use 'any' types — explicit TypeScript always
3. DON'T skip build verification after changes
4. DON'T start dev servers during implementation — kills battery
5. DON'T create components longer than 150 lines — split automatically
## researcher constraints
1. DON'T rely on a single broad query — use 3-5 targeted queries
2. DON'T present incomplete info as complete — acknowledge gaps
3. DON'T leave orphaned lockfiles — always clean up
## {your_role} constraints
1. DON'T [most common mistake for this agent]
2. DON'T [second most common mistake]
3. DON'T [safety boundary]Ograniczenia agentów są formalizowane jako pliki reguł w Rozdziale 4: System Reguł. Hooki egzekwujące z Rozdziału 6: Egzekwowanie Reguł mogą wtedy weryfikować te ograniczenia mechanicznie, zamieniając pisane zakazy w faktycznie blokowane akcje.
Wstrzykiwanie kontekstu — inteligentni agenci
Agenci są bezstanowi — każde uruchomienie zaczyna od zera. Bez wstrzykiwania kontekstu agenci zadają oczywiste pytania: 'Jaki jest Twój stack technologiczny?' 'Jakie masz priorytety?' Wstrzykiwanie kontekstu rozwiązuje to, dostarczając odpowiednie informacje przy uruchamianiu agentów.
Przed uruchomieniem JAKIEGOKOLWIEK agenta wstrzyknij kontekst runtime z Repozytorium Życia. To zamienia ślepego agenta w takiego, który już zna Twój biznes.
When spawning an agent, include:
SITUATIONAL AWARENESS:
- Date: [today's date]
- Top Priority: [from STATUS.md]
- Active Project: [which project this relates to]
- Recent Context: [yesterday's handoff summary if relevant]
TASK: [the actual task]
For iterative/autonomous tasks, also add:
- Success Metric: [single measurable criterion]
- Max Iterations: [number, default 10]
- Files agent CAN modify: [list]
- Files agent CANNOT touch: [list]Automatyczne łańcuchy agentów
Niektórzy agenci powinni automatycznie uruchamiać innych agentów po zakończeniu pracy. To nazywa się auto-łańcuchowaniem. Zamiast ręcznie pamiętać o uruchomieniu dokumentacji po implementacji, system robi to za Ciebie.
Zdefiniuj sekwencje łańcuchów w tabeli routingu. Gdy Agent A kończy, Agent B uruchamia się automatycznie.
# System Change Chain (MANDATORY)
File modified in rules/ or protocols/
-> enforcement-architect (build hooks to enforce it)
-> cartographer (document what was built)
# Implementation Chain
Planner creates blueprint
-> Developer implements code
-> QA verifies the implementation
-> Simplicity reviewer checks for over-engineering
# Discovery Chain
Debugger finds a non-obvious fix
-> Fix logger documents the solution
-> Knowledge extractor evaluates if it's reusable
-> If yes -> Creates skill file for future reference
# Content Chain
Researcher gathers intelligence
-> Content architect structures the video
-> Copywriter writes hooks and CTAsRouting zapasowy — gdy agenci zawodzą
Żaden agent nie jest idealny. Zdefiniuj agentów zapasowych dla każdego głównego agenta, żeby system degradował się gracefully zamiast się zatrzymywać.
| Primary Agent | Backup Agent | QA Agent |
|-------------------|---------------------------|------------|
| web-developer | code-debugger (for bugs) | qa-gate |
| code-debugger | web-developer (if code change needed) | qa-gate |
| devops-engineer | code-debugger (config bugs) | security |
| content-architect | copywriter (copy issues) | — |
| researcher | deep-reader (large sources) | — |
Rule: If primary AND backup both fail -> STOP ->
report to human with what was tried and why each failed.