PTENES
Skip to content
MODULE 6 PREPARATION

Masterclass Preparation

Consolidate all the knowledge you've acquired and get ready for the final journey: designing autonomous agent systems that operate in complex contexts.

6
Topics
80
Minutes
1
Final Project
1

Recap of the 5 Modules

Connecting the concepts

Before moving on to the Masterclass, let’s consolidate the journey so far and understand how each module connects to the next.

M1

Context Engineering

A prompt is not text — it is context system. We learned to structure context in layers (System, Global, Task, Data) with a clear hierarchy.

→ Foundational concept for everything that came later
M2

Long Context Management

With 100K-1M+ token windows, we've learned to organize large volumes of context without degrading the quality of responses.

→ Enables rich contexts without excessive reliance on RAG
M3

Skill Engineering

Prompts such as modular, reusable skills. Specialized skills that can be activated, composed, and versioned.

→ Foundation for building agents with specific capabilities
M4

Orchestration

Combining contexts and skills in complex workflows. Conflict resolution, skill chains, and context-driven systems.

→ Architecture for multi-skill systems
M5

Modern RAG

RAG as complement, not a dependency. Hybrid context, selective injection, and grounding-based anti-hallucination strategies.

→ Intelligent integration of dynamic data

The Synthesis

Together, these modules form a new way of thinking about AI: Context Engineering + Skills = Intelligent Agents. The Masterclass will apply this to autonomous production systems.

2

Agent Engineer Mindset

Systems thinking for AI

The Shift in Perspective

An Agent Engineer is not an "advanced prompt engineer." It is a discipline of systems design where the central component is an LLM.

❌ Old-School Mindset

  • • "How do I make the model respond with X?"
  • • "What magic prompt solves this?"
  • • "The model got it wrong; I need a better prompt"
  • • Focus on specific words

✓ Agent Mindset

  • • "What context does the agent need?"
  • • "Which skills should be available?"
  • • "Is the context system complete?"
  • • Focus on architecture and flows

Fundamental Principles

🎯
Context First

Before writing any instructions, define the necessary context. Context determines 80% of the response quality.

🧩
Skills over Instructions

Build reusable skills, not one-off instructions. Skills can be tested, versioned, and composed.

🔄
Iterate on Systems

Don't adjust prompts indefinitely. Iterate on the system design: flows, fallbacks, orchestration.

📊
Measure & Ground

Every claim must have a source. Every system must have metrics. Without measurement, there is no improvement.

3

Consolidated Patterns

Patterns that work in production

Emerging patterns in production agent systems that you will apply in the Masterclass.

🏗️

Layered Context

Context organized in layers with defined priorities and scopes.

System → Global → Session → Task → Data
🎭

Skill Registry

Catalog of available skills with triggers and context requirements.

skill.register(name, triggers, context_reqs)
🔀

Context Router

Intelligent routing based on intent and available context.

router.match(intent) → [context, skill]
🛡️

Grounded Response

Answers always grounded in verifiable sources from the context.

response.cite(source) | response.unknown()
📦

Context Budget

Token allocation and management by context layer.

budget.allocate(layer, tokens, priority)
🔗

Skill Chain

Composition of skills with context passing between steps.

chain(skill_a).then(skill_b).with(context)

Standard Agent Architecture

┌────────────────────────────────────────────────────────┐
│                    AGENT CORE                           │
├────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐    │
│  │   Context   │  │    Skill    │  │   Memory    │    │
│  │   Manager   │  │   Registry  │  │   Store     │    │
│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘    │
│         │                │                │            │
│         └────────┬───────┴────────┬───────┘            │
│                  │                │                    │
│           ┌──────▼──────┐  ┌──────▼──────┐            │
│           │   Router    │  │  Orchestrator│            │
│           └──────┬──────┘  └──────┬──────┘            │
│                  │                │                    │
│                  └───────┬────────┘                    │
│                          │                             │
│                   ┌──────▼──────┐                      │
│                   │     LLM     │                      │
│                   │   (Core)    │                      │
│                   └─────────────┘                      │
└────────────────────────────────────────────────────────┘
4

Anti-Patterns to Avoid

Common errors in agent systems

🚫

God Prompt

A giant prompt that tries to do everything. Impossible to maintain, test, or debug.

Symptom: Prompt with 10K+ tokens, frequent edits that break things
✓ Solution: Break down into modular skills
🚫

Context Dump

Throw all available information into the context without organization or prioritization.

Symptom: Inconsistent answers, model ignores important information
✓ Solution: Layered context with a clear hierarchy
🚫

RAG-First

Use RAG by default when it would be more efficient and accurate than Long Context.

Symptom: Fragmented answers, loss of nuance and context
✓ Solution: Hybrid context, RAG only when needed
🚫

Skill Spaghetti

Skills with cross-dependencies, no clear interface, or defined contract.

Symptom: A change in one skill breaks others, making debugging complex
✓ Solution: Skills with defined inputs/outputs, no side dependencies
🚫

Hallucination Denial

Try to fix hallucinations with "don't hallucinate" or longer instructions.

Symptom: Hallucinations persist despite repeated instructions
✓ Solution: Ground responses in sources, require citations, allow "I don't know"
5

Integrated Case Study

Applying all the concepts

Scenario: Code Review Agent

Let’s design a code review agent that applies all the patterns learned.

1. Context System


  identity: "Code Review Agent"
  model: "claude-3-opus"
  capabilities: [analyze_code, suggest_fixes, check_style]



  project_conventions: "{coding_standards}"
  tech_stack: [Python, FastAPI, PostgreSQL]
  style_guide: "{style_guide_content}"



  pr_diff: "{diff_content}"
  related_files: ["{file_contents}"]
  recent_reviews: ["{last_3_reviews}"]

2. Available Skills

security_check

Detects common vulnerabilities

style_review

Checks compliance with the style guide

logic_analysis

Identifies potential logic bugs

suggest_improvements

Suggests constructive refactoring

3. Orchestration Flow

async def review_pr(pr_id):
    # 1. Carregar contexto
    context = load_context(
        global=["conventions", "style_guide"],
        task=["pr_diff", "related_files"]
    )

    # 2. Executar skills em paralelo
    results = await parallel(
        security_check(context),
        style_review(context),
        logic_analysis(context)
    )

    # 3. Consolidar e gerar sugestões
    if results.has_issues():
        suggestions = await suggest_improvements(
            context.extend(issues=results.issues)
        )

    # 4. Formatar output com citações
    return format_review(
        results, suggestions,
        require_citations=True
    )

4. Grounding and Anti-Hallucination


Cada issue reportado deve:
1. Citar linha específica do diff: [L{line_number}]
2. Referenciar regra do style_guide se aplicável
3. Incluir snippet do código problemático

Se não tiver certeza:
- Use "Possível issue: {descrição}"
- Não afirme bugs sem evidência no diff

Nunca assuma:
- Contexto não fornecido
- Código fora do diff
- Intenção do desenvolvedor

6

Advanced Level Final Project

Your ticket to the Masterclass

Challenge: Design an Agent System

Choose a domain and design a complete agent by applying all the advanced-level concepts. This project will be your foundation for the Masterclass.

🛒
E-commerce

Sales assistant with catalog, orders, and support

💻
Developer Tools

Code assistant, debugging helper, documentation generator

📊
Data Analysis

Data analyst with queries, visualizations, and insights

Project Requirements

1
Complete Context System

Define all context layers (System, Global, Task, Data) with a clear hierarchy.

2
Minimum 4 Skills

Create at least 4 specialized skills with triggers and context requirements.

3
Orchestration Flow

Document how skills are activated and how context flows between them.

4
Grounding Strategy

Define how the agent avoids hallucinations and keeps answers grounded in facts.

5
Hybrid Context (if applicable)

If you use dynamic data, define a RAG + Long Context strategy.

🎓

Next Step: Masterclass

In the Masterclass, you will implement your project with:

Multi-agent architecture
Autonomy and self-correction
Production deployment
Observability and metrics

Download this module

Save for offline study

Previous
Module 5: Modern RAG
Next Level
Masterclass