PTENES
TRACK 4

🚀 Advanced & cross-environment

Beyond Claude Code. Architecture at scale, Codex and other runtimes, security, community libraries, and assembling your system of specialists.

Orchestrator agent fleet security-auditor read-only · isolated test-runner checks output doc-writer generates documentation db-expert queries + migrations Claude Code native runtime Codex CLI cross-runtime Custom harness portable skill System in production cross-runtime
6 modules · ~3h 20min · Advanced level

Learning path map

Detailed content

4.1 ~35 min

🏗️ Multiagent architecture at scale

Fleet, loop-until-dry, adversarial verification, completeness critic — with no silent cap on system depth.

What it is:

A fleet is a named set of subagents with distinct roles that the orchestrator can scale horizontally: one agent per task, N tasks in parallel.

Why learn:

Without the concept of a fleet, you’re limited to linear pipelines. With it, the workload grows without increasing the complexity of the main prompt.

Key concepts:

Fleet = group + role + parallelism; the orchestrator manages, not executes; each member reports to the hub.

What it is:

The orchestrator relaunches subagents until there are no more items to process. The loop ends when the queue is empty, not after a fixed number of attempts.

Why learn:

Research, code audit, and log analysis tasks never have a predictable size. The loop-until-dry ensures completeness without an arbitrary hard cap.

Key concepts:

Stop condition = empty queue; safety guard = iteration limit; progress report between rounds.

What it is:

A separate subagent receives the main agent’s result and actively tries to refute it — looking for errors, gaps, and contradictions — without access to the original reasoning.

Why learn:

LLMs tend to confirm what they generated. The adversarial verifier breaks this confirmation bias without requiring human review on every iteration.

Key concepts:

Context isolation; explicit role of "devil's advocate"; binary output: approved / list of failures.

What it is:

A critical agent compares the initial scope with the final deliverable and lists what was left incomplete or not addressed. It differs from the adversarial verifier: the focus here is coverage, not correctness.

Why learn:

Large projects silently lose entire sections of scope. The completeness critic acts as an automated checklist and closes the loop.

Key concepts:

Scope as a contract; coverage × correctness distinction; output: a list of gaps to relaunch or report.

What it is:

The three-stage pattern for large-scale research: a finder gathers evidence, a verifier checks each piece, and a synthesizer produces the final report with sources tracked.

Why learn:

Separates concerns—search, verification, and synthesis into dedicated agents—making each stage replaceable and the result auditable.

Key concepts:

Decoupled stages; handoff via artifact (file or JSON); source traceability.

What it is:

A minimal orchestrator template that delegates to N subagents, collects results, and decides whether to relaunch or stop — the skeleton you copy and adapt.

Why learn:

Building a harness from scratch every time is repetitive work. The skeleton exposes extension points without tying down the domain logic.

Key concepts:

Entry point; agent list; collection loop; stopping condition; structured output.

View Full
4.2 ~30 min

🌐 Subagents in Codex and other environments

How the subagent concept maps beyond Claude Code — cross-runtime with polyskill, tool equivalents, portable skill.

What it is:

A subagent is a pattern — isolated context, a defined role, and a report back — that exists in any runtime that supports agent calls, not just Claude Code.

Why learn:

Frees you from depending on a single vendor. The ability to design multiagent systems is valuable in any tool you use.

Key concepts:

Standard vs. implementation; concept portability; mapping primitives across runtimes.

What it is:

OpenAI’s Codex CLI uses `.md` files in `.codex/agents/` with the same philosophy: persona + tools + disallowed-tools. The structure is analogous to `.claude/agents/`.

Why learn:

Teams use multiple tools. Knowing how to map your Claude agent to Codex lets you reuse the logic without rewriting it from scratch.

Key concepts:

`.codex/agents/` ↔ `.claude/agents/`; equivalent fields; syntax differences and limitations.

What it is:

Polyskill is the standard for writing a single skill source that adapts to the detected runtime — Claude Code, Codex, or another — without forking the file.

Why learn:

Keeping two parallel files inevitably leads to drift. polyskill keeps a single source of truth and handles the differences in the adaptation layer.

Key concepts:

One source, N outputs; conditional sections; adaptation layer vs. domain logic.

What it is:

Side-by-side mapping of the main tools across runtimes: Claude Code’s Bash/Read/Write/Edit and their equivalents in Codex and other environments.

Why learn:

Explicit translation avoids surprises. Knowing that “Bash” becomes “shell” and “Edit” becomes “patch” speeds up portability and reduces adaptation bugs.

Key concepts:

Common primitives (read, write, execute); tools without a direct equivalent; strategy for gaps.

What it is:

A portable skill uses domain language in its body—never specific tool names—and delegates the “which tool to use” decision to the adaptation section.

Why learn:

Skills with hardcoded `Bash:` fail silently in runtimes that don't have Bash. Portability starts with the choice of words.

Key concepts:

Tool abstraction; “Tool mapping” section; portability tests across runtimes.

What it is:

Walkthrough of a `code-reviewer` agent that runs in Claude Code and Codex CLI without modification, showing where adaptation happens and what stays identical.

Why learn:

Seeing the concrete example reinforces the pattern. It's the difference between understanding the concept and knowing where to make changes when something breaks in portability.

Key concepts:

Invariant sections vs. adaptation sections; annotated diff; cross-runtime test checklist.

View Full
4.3 ~35 min

🎯 Comparing models by role

Opus, Sonnet, Haiku × GPT × others; deep reasoning × cheap/fast; when to switch models based on the agent's role. Heterogeneous fleet.

What it is:

Each agent role (reasoning, execution, verification, summarization) has different requirements for cost, speed, and depth. Using the same model for everything is wasteful or risky.

Why learn:

The cost difference between Opus and Haiku can be 50×. With a fleet of 20 agents, choosing the wrong model is expensive and slow for no reason.

Key concepts:

Role = requirements; model = resource; optimize by role, not by project.

What it is:

Opus = complex reasoning, planning, high-risk decisions. Sonnet = balanced execution, code, analysis. Haiku = triage, summarization, high-volume repetitive tasks.

Why learn:

The Model × Role table is the backbone of any well-sized fleet. Without it, you test in the dark and either pay too much or get lower-than-expected quality.

Key concepts:

Deep reasoning × throughput; cost per token; response latency; context limits per model.

What it is:

GPT-4 can fill execution roles where the team already has credits or existing integrations. Codex (GPT-4-turbo fine-tuned for code) has an advantage in code generation in specific contexts.

Why learn:

Heterogeneous fleets are the reality in companies. Knowing where each model has a comparative advantage avoids team conflicts and optimizes the vendor portfolio.

Key concepts:

Comparative advantage; lock-in vs. flexibility; API abstraction layer to switch models without rewriting agents.

What it is:

Orchestrator = Opus (plans). Execution workers = Sonnet (code, analysis). Triage and summarization = Haiku. Final verification = Opus or Sonnet, depending on risk.

Why learn:

The concrete example turns the principle into a decision. You leave with a model allocation template that you can adapt for any project.

Key concepts:

Allocation template; upgrade criteria (when to use a more expensive model); downgrade criteria (when it's safe to use a cheaper one).

What it is:

Signals that indicate switching providers by role: recurring unavailability, cost above the benchmark, tool limitations, unmet latency requirements.

Why learn:

The decision to switch is often emotional or political. Having objective criteria for each role makes the decision technical and defensible.

Key concepts:

SLO by role; migration cost; abstraction layer; model A/B test.

What it is:

Exercise: map the roles in your current—or planned—system and choose the most suitable model for each, with cost and risk justification.

Why learn:

The matrix is the fleet’s design document. It communicates intent, makes onboarding easier, and serves as a reference when optimizing.

Key concepts:

Role, selected model, rationale, estimated cost, alternative fallback model.

View Full
4.4 ~30 min

🔒 Security

Download third-party `.md` files, prompt injection, a read-only verifier subagent that never sends data, permission hygiene, and MCP.

What it is:

An agent `.md` file from an unknown source may contain malicious instructions embedded in the text that the LLM executes as commands while processing the context.

Why learn:

The attack surface grew with public catalogs. The risk is real: an imported agent could exfiltrate data, modify files, or create backdoors.

Key concepts:

Zero trust in external sources; audit before running; `.md` review checklist.

What it is:

Prompt injection is the insertion of instructions for the LLM into data the agent will read—code comments, file contents, API results—causing it to deviate from its expected behavior.

Why learn:

An agent that reads code from a repository or a response from an API could potentially be instructed by that content. Ignoring this is the biggest vulnerability in multi-agent systems.

Key concepts:

Data vs. instructions; context contamination; suspicious pattern detection; input sandboxing.

What it is:

An agent with `disallowed-tools: [Bash, Edit, Write]` that can only read — never execute, never modify, never send data outside. The isolation is declared in the `.md` file itself.

Why learn:

Suspicious content (a third-party `.md` file, a configuration file) must be checked by an agent that cannot cause harm even if compromised.

Key concepts:

`disallowed-tools`; principle of least privilege; separation between reading and acting; structured report with no side effects.

What it is:

Explicitly define which tools each agent can use, periodically reviewing whether permissions still match its current role—and removing anything no longer needed.

Why learn:

Permissions accumulate silently. A documentation agent that gained Bash access "for convenience" is a risk that won’t show up in the logs until it’s too late.

Key concepts:

Least privilege; periodic audits; explicit vs. default permissions; scope creep risk.

What it is:

MCPs expose external tools to the agent. A compromised or malicious MCP can exfiltrate data, run remote commands, or escalate privileges without the agent noticing.

Why learn:

MCP is the most powerful integration point — and the most dangerous. The attack surface grows with every MCP added without a security review.

Key concepts:

Zero trust in external MCPs; review MCP server code; minimize the scope of exposed tools; log calls.

What it is:

An 8-point checklist for reviewing any `.md` before putting it into production: source, declared permissions, hidden instructions, network access, tool scope, exfiltration, bypass backdoors, and review by a second pair of eyes.

Why learn:

A repeatable process is the only way to audit consistently. The checklist becomes the approval gate before any external `.md` file enters the repo.

Key concepts:

Approval gate; mandatory manual review; quarantine before production; minimum viable security process.

View Full
4.5 ~25 min

📚 Libraries and reuse

awesome-claude-code-subagents and similar; copy > create; download .md, put it in .claude/agents/, adapt; security considerations when importing.

What it is:

Public repositories like `awesome-claude-code-subagents` bring together hundreds of ready-to-use agents — security-auditor, test-runner, doc-writer, db-expert — maintained by the community.

Why learn:

Creating from scratch takes time and introduces errors that others have already solved. Learning the ecosystem is the first step toward speeding up your library.

Key concepts:

Curated vs. uncurated catalogs; quality criteria; maintainer reputation; license.

What it is:

Starting with a community-tested agent and adapting it is systematically faster and more reliable than creating one from scratch, even if the final result is almost identical.

Why learn:

NIH (not invented here) is costly in time and quality. The reuse principle shifts the starting point from “create” to “find + adapt.”

Key concepts:

Smart starting point; adaptation vs. rewrite; comparative maintenance cost.

What it is:

Four steps: download the `.md` from a trusted source, audit it with the security checklist (M4.4), adapt the name/persona/tools to your context, put it in `.claude/agents/`, and test it.

Why learn:

The structured flow avoids the dangerous shortcut of downloading and using without auditing. The audit step is not optional, even for trusted sources.

Key concepts:

Quarantine; audit gate; minimal vs. complete adaptation; smoke test after import.

What it is:

Walkthrough of adapting a generic `security-reviewer` to the context of a specific Python project: adjusting the persona, project context, tools, and inline examples.

Why learn:

Adaptation is where most people get it wrong — either they don't adapt anything (the agent is too generic) or they rewrite everything (losing the benefits of reuse). The example shows the right balance.

Key concepts:

What to adapt (persona, context, examples) vs. what to keep (decision logic, output format, safety).

What it is:

Imported agents may receive updates from the source repository. You need to decide whether to sync with the original, maintain a local fork, or freeze the version. Each choice has trade-offs.

Why learn:

The lifecycle management of an imported agent is ignored during adoption and becomes technical debt later. Deciding on a strategy early saves rework.

Key concepts:

Fork vs. upstream sync; changelog tracking; minimum tested version; update policy.

What it is:

When and how to publish your adapted agents back—anonymizing project context, adding a README, choosing a license, and submitting a PR to curated catalogs.

Why learn:

Catalog quality depends on contributions. Publishing forces you to generalize the agent well, which often improves the internal version too.

Key concepts:

Sensitive data anonymization; minimal README; catalog quality criteria; compatible license.

View Full
4.6 ~25 min

🏭 Building your system

Your specialist library; ready-made templates; production checklist; full course recap — from the foundation to a system in production.

What it is:

A personal set of reusable agents organized in `.claude/agents/` — security-auditor, test-runner, doc-writer, db-expert, code-reviewer — that you maintain and evolve over time.

Why learn:

The library is an asset that grows with you. Each successfully completed project adds an agent to the collection; over time, you start new projects with specialists already at hand.

Key concepts:

Personal collection; library versioning; README for each agent; categories (security, testing, docs, infra, data).

What it is:

The 5 agents that cover 80% of needs in most software projects: security-reviewer (read-only), test-runner, doc-writer, code-reviewer, and db-migration-checker.

Why learn:

Having a defined starter pack eliminates decision paralysis. You start with a cohesive set and expand based on real needs, not anticipation.

Key concepts:

80% coverage; smallest cohesive set; criterion for adding (demonstrated real need); don't anticipate.

What it is:

`.md` templates with a standard structure (name, persona, description, tools, disallowed-tools, examples) that you can fill out in minutes for any new agent role.

Why learn:

A well-made template ensures you don’t forget critical fields (disallowed-tools, usage examples) and maintains consistency across all agents in the library.

Key concepts:

Minimum template vs. complete template; required vs. optional fields; consistency as the goal.

What it is:

A 10-point gate before putting any agent into real use: reviewed permissions, explicit disallowed-tools, tested examples, clear persona, no ambiguous instructions, security audit.

Why learn:

Agents that don’t go through a checklist before production accumulate unexpected behavior. The checklist is the equivalent of a code review for `.md`.

Key concepts:

Production gate; peer review; smoke test; "ready to use" criterion.

What it is:

The course capstone exercise: map the roles in your actual work, choose models for each one, create 3 agents from your personal library, and document the fleet you designed.

Why learn:

Learning is consolidated in the application. The final project closes the loop: from the mental model (T1) to the production fleet (T4).

Key concepts:

Application to a real-world context; at least 3 agents; fleet documentation; verification criterion — “how do I know I got it right?”

What it is:

Synthesis of the four tracks: T1 (mental model) → T2 (create the `.md`) → T3 (orchestrate and save) → T4 (scale, protect, and reuse). A panoramic view of what you learned.

Why learn:

The recap brings together the complete mental model and shows the progression from fundamentals to an advanced system—making it easier to review, teach, or adapt to new contexts.

Key concepts:

T1→T4 progression; anchor concepts for each track; next steps; where to go deeper.

View Full