PTENES
TRACK 4 · 💎 ENGINEER LEVEL

🏭 The Factory

Connect the three phases into a single pipeline. Live research in Perplexity, the 15 deliverable prompts in Gemini, and orchestration that resumes automatically when the context fills up. At the end, your Factory runs end to end—two text boxes go in, the package comes out.

3
Modules
18
Topics
~3h
Duration
Advanced
Level
name +description Orchestratorstate.json 1 · Research (Perplexity) 2 · Synthesis (Gemini) 3 · Generation (PPTX/DOCX) 📦 package.zip

Learning path map

Detailed content

4.1~60 min

🔎 Live research with Perplexity

Phase 1 of the Factory. Why live research beats static knowledge, how to choose between quick and deep, and how to build the 9 query categories in a ResearchOutput solid — even when a search fails.

What it is:

Perplexity searches for company facts in real time. Run in June 2026, it pulls information through June 2026—if a better model comes along, the recommendation changes automatically.

Why learn:

It’s what makes the package feel alive and not like an off-the-shelf template. An LLM on its own makes things up; with research, it cites the present.

Key concepts:

Live research · facts vs. hallucinations · information freshness.

What it is:

Quick (~9 queries, sonar model, ~US$0,05) for a fast assessment; Comprehensive (~18 queries, sonar-pro and deep-research, ~US$0,50) for a complete strategy.

Why learn:

It’s the Factory’s cost lever. You choose the depth based on the budget and the client’s value.

Key concepts:

Quick mode · comprehensive mode · cost × depth trade-off.

What it is:

O TemporalContext injects the current year and month into the templates ({current_year}, {current_month_year}) and sets the recency filter (day/week/month/year).

Why learn:

Without a date in the query, the search tool returns old results. Temporal context is what ensures you get “news from this month,” not from 2023.

Key concepts:

Time-based placeholders · recency filter · dated query.

What it is:

Company profile, industry, competition, technology, AI initiatives, regulatory landscape, news, leadership, and investment — each category with a priority and a quick mode flag.

Why learn:

They’re the nine lenses that cover the entire company. Without them, the diagnosis is skewed and incomplete.

Key concepts:

QueryCategory · priority · required_for_quick_mode.

What it is:

If a query fails, the pipeline continues with partial data. Retries with exponential backoff and a 2s pause between calls help avoid rate limits.

Why learn:

A search failure can’t bring down the entire package. Graceful degradation is what keeps the Factory running.

Key concepts:

Graceful degradation · retry/backoff · rate limit.

What it is:

An object with company_name, raw_research, sources e cost. It’s what Synthesis consumes and what becomes research_cache.json.

Why learn:

It’s the contract between Phase 1 and Phase 2. Structured output makes the next stage reliable and cacheable.

Key concepts:

ResearchOutput · sources · research_cache.json.

View Full
4.2~60 min

📝 The 15 Deliverable Prompts

Phase 2 of the Factory. The anatomy of a prompt that generates a consulting document and the 15 prompts organized into five groups—Assessment, Planning, Implementation, Governance, and Resources. And how to adapt each one to Brazilian Portuguese.

What it is:

Every prompt follows the same pattern: Task → Required Sections (with Markdown tables) → Output Format. The context (research + cheat sheets) comes first.

Why learn:

Understanding the template lets you edit any prompt and create new ones without breaking the pipeline.

Key concepts:

Task/Sections/Format · Markdown tables · injected context.

What it is:

Three prompts that diagnose where the company stands: tech_inventory, pain_points e maturity_assessment (scale of 1–5).

Why learn:

It’s the package’s factual foundation. Without an honest assessment, the roadmap is just a guess.

Key concepts:

Technical inventory · pain point matrix · AI readiness.

What it is:

roadmap (30/60/90/180/360), quick_wins (effort × impact, <60 days) and roi_calculator (ROI, payback, 3-year NPV).

Why learn:

It’s the part the client opens on Monday and executes. A plan with numbers is what closes the contract.

Key concepts:

Phased roadmap · quick wins · ROI/NPV.

What it is:

vendor_comparison (build vs. buy), license_consolidation (cut costs) and use_case_library (cases by department).

Why learn:

Turns strategy into concrete purchasing and usage decisions. This is where the plan meets operational reality.

Key concepts:

Build vs buy · license consolidation · use cases.

What it is:

ai_policy (acceptable use), data_governance (data and privacy) and change_management (training and adoption).

Why learn:

It’s what separates a pilot from a serious program. Governance is what legal and HR demand.

Key concepts:

AI policy · data governance · change management.

What it is:

prompt_library (starter prompt kit) and glossary (AI terms). And a language instruction so the output comes out in Portuguese.

Why learn:

Resources make the client self-sufficient after delivery. Adapting the language is the detail that sells in Brazil.

Key concepts:

Prompt library · glossary · language instruction.

View Full
4.3~60 min

⚙️ Orchestration, resumption, and diagrams that sell

The glue that connects everything. The orchestrator that confirms each step, the state.json which lets you pick up where you left off when context fills up, render the Mermaid diagrams (current state vs. future state) as PNGs, and package the final download.

What it is:

Research → Synthesis → Generation, in sequence. Each phase confirms completion before the next begins — nothing moves forward in the dark.

Why learn:

It’s the Factory’s backbone. Confirmation at each stage is what makes the pipeline auditable and resumable.

Key concepts:

Pipeline orchestrator · phase confirmation · chained order.

What it is:

O state.json stores the current phase, the status of each deliverable, and the session's total accumulated cost.

Why learn:

It’s the Factory’s memory. Without a checkpoint, any interruption forces you to redo everything—and pay again.

Key concepts:

Checkpoint · state.json · total_cost.

What it is:

The Claude Code context can fill up (it happened twice during development). You open a new session and run resume "Empresa" — it picks up where it left off.

Why learn:

It’s what lets the Factory survive long sessions. Resuming from the task list is the skill that separates those who finish from those who get stuck.

Key concepts:

Context limit · summary · persisted task list.

What it is:

Two flowcharts: today’s stack (with bottlenecks marked) and the AI-enabled architecture (unified data layer, AI services, automations).

Why learn:

The "before and after" is the slide that sells. Seeing the leap laid out is more convincing than three pages of text.

Key concepts:

Current state · future state · marked bottlenecks.

What it is:

O mermaid_renderer converts the code into a PNG for insertion into the PPTX. Alternatives: the skill beautiful-mermaid and eraser.io.

Why learn:

Client doesn't open the file .mmd; it opens an image on the slide. Rendering is what makes the diagram presentable.

Key concepts:

Mermaid → PNG · beautiful-mermaid · eraser.io.

What it is:

Phase 3 organizes everything into folders (markdown/, presentations/, documents/, mermaid_images/) and wraps up the package for download.

Why learn:

Delivery is half the work. A well-organized package is what makes the client feel they paid for something substantial.

Key concepts:

Folder structure · final package · download.

View Full
← Track 3 Next track: Consultant →