PTENES
MODULE 1.3

⚙️ Building your arsenal

Time to turn on the machine. You install Claude Code, generate two free API keys, clone the repository, and run the first package—while controlling costs. By the end of this module, the Factory is up and running on your machine.

6
Topics
~40
Minutes
Basic
Level
Setup
Type
🤖 Claude Code orchestrates everything 🔑 Perplexity key live research ✨ Gemini key low-cost synthesis 📥 repo cloned ai-strategy-factory localhost:8888 A working factory you direct 1st package runs
1

🤖 Claude Code: your copilot

Claude Code is the centerpiece—the assistant that clones, installs, configures, and runs the Factory from instructions in Portuguese. You don’t type cryptic commands: you describes the objective and review the result.

// the request that triggers the entire setup

Clone o repo https://github.com/inematds/ai-strategy-factory,
me ajude a gerar e configurar as chaves de API no .env
e suba a interface web.

✓ What YOU do

  • ✓Describe what you want in natural language
  • ✓Paste the keys when prompted
  • ✓Check the result and request adjustments

✗ What CLAUDE CODE does

  • →Runs git clone e python setup.py
  • →Create the .env and install dependencies
  • →Starts the web app and fixes the errors
Copilot

does the grunt work

Portuguese

without cryptic commands

You drive

describes + reviews

Skill #1

asking well

2

🔑 Perplexity account + key

Perplexity is the research phase: it searches the internet for current facts about the company. The key is free and takes about 2 minutes to get. It’s what keeps the deliverables updated — not made up.

1

Create account

Access perplexity.ai and create a free account.

2

Generate the key

Go to Settings → API and click "Generate API Key." The key starts with pplx-.

3

Save for the .env

Copy and save it somewhere safe. When Claude Code builds the .env, you paste it there.

// .env — first line

PERPLEXITY_API_KEY=pplx-xxxxxxxxxxxxxxxxxxxx

💡 Why live research matters

Running in 2026, Perplexity searches for 2026 data. If a tool has been replaced or a better model has emerged, the recommendations reflect that. That’s what separates a living diagnosis from a generic report that becomes outdated in weeks.

Free

~2 minutes

pplx-…

key format

Live

search, don't guess

In .env

never commit

3

✨ Gemini account + key

Gemini 2.5 Flash is the synthesis phase: it’s the writing engine that generates the 15 documents. It was chosen because it is cheap and with huge context — it makes an entire package possible for less than US$1. The key is free, too.

1

Open AI Studio

Access aistudio.google.com/apikey and sign in with your Google account.

2

Create the key

Click "Create API Key". The key starts with AIzaSy.

3

Complete the .env

Save the key. It is the second line of the .env, alongside Perplexity.

// .env — complete

PERPLEXITY_API_KEY=pplx-xxxxxxxxxxxxxxxxxxxx
GEMINI_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxxxxxxxxx

✓ Why Gemini 2.5 Flash

  • ✓Very low entry cost (US$0.075/1M tokens)
  • ✓Huge context—lots of research fits at once
  • ✓Fast enough for 15 documents in a row

✗ Key precautions

  • ✗Never paste the key directly into the code
  • ✗Never commit the .env in Git
  • ✗No extra spaces or quotes around the key
2.5 Flash

writing engine

Cheap

package < US$1

Context

huge

AIzaSy…

key format

4

📥 Clone and Run the Repo

With the keys ready, it's time to download the Factory and get it running. You can ask Claude Code to do everything—but it's worth learning the commands under the hood so you know what's happening. When it's done, the interface opens at localhost:8888.

1

Clone the repository

Download the project ai-strategy-factory for your machine.

2

Run the setup

O setup.py creates the environment, installs dependencies, and prepares the .env. Works on Windows, macOS, and Linux.

3

Start the web app

The interface opens automatically in the browser at localhost:8888. Enter a company name and click Start.

// what Claude Code runs for you

git clone https://github.com/inematds/ai-strategy-factory
cd ai-strategy-factory
python setup.py            # cria venv, instala, prepara .env
# (cole suas chaves no .env)
python -m strategy_factory.webapp   # → http://localhost:8888

💡 If the port is busy

The web app automatically finds an available port. If you want to set a different one, ask Claude Code or run python -m strategy_factory.webapp --port 9000. On macOS, port 5000 is used by AirPlay—that’s why the default is 8888.

git clone

downloads the project

setup.py

prepares everything

web app

localhost:8888

Cross-platform

Win/Mac/Linux

5

📣 Build in Public

Building in public is the mindset that turns your setup into authority. The idea is simple: show the process, including the mistakes. Whoever built this Factory faced context limits, API errors, and even a wrong model name in the documentation—and showed it all.

✓ What to share

  • ✓The actual process, step by step
  • ✓The mistakes and how you solved them
  • ✓The first package the Factory generated

✗ The pitfall to avoid

  • ✗Show only the polished result
  • ✗Hide the stumbles (they build connection)
  • ✗Wait until it's "perfect" to post

🔧 The real stumbling blocks during development

There were several Claude Code sessions. What went wrong along the way—and became course content:

  • •Context limits (exceeded twice)
  • •API errors and incorrect model name in Perplexity docs
  • •Gemini chunking issue in a file
Transparency

show the mess

Authority

proof of work

Connection

errors bring you closer

Clients

come from the journey

6

🧮 Cost management

Low cost is what keeps margins high. The Factory has two research modes, and you choose in real time based on the budget. The difference is significant: quick costs ~US$0,05; deep costs ~US$0,50.

~US$0.05 quick · sonar ~9 queries · 2-3 min ~US$0,50 deep · sonar-pro ~18 queries · 5-10 min package market value: thousands

⚡ Quick mode

~9 queries on the model sonar. A quick assessment in 2-3 minutes, ~US$0,05. This is the mode for today's Mission.

🔬 Deep mode

~18 queries with sonar-pro. Full investigation in 5-10 minutes, ~US$0.50. Use it when the client is a large company.

💡 Break up large requests

Documentation is cheap in tokens—even on a basic plan, you can do a lot if you split up your requests. Always start with quick: it delivers a complete package for pennies, and you only move up to deep when the situation calls for it.

Quick

~US$0.05

Deep

~US$0,50

Margin

cost < value

Divide

smaller requests

✅ Module summary

✓
Claude Code is your copilot — clone, install, and run; you drive it in Portuguese.
✓
Two free keys — Perplexity (research) + Gemini (synthesis), both in .env.
✓
Clone and run — git clone → setup.py → webapp on localhost:8888.
✓
Cost under control — quick ~US$0,05, deep ~US$0,50; start with quick.

🎯 Mission 1.3 — Run the first package

With everything configured, ask Claude Code to run the Factory in quick mode for 1 company you know — and open the generated files:

  1. Make sure both keys are in the .env and the web app up and running.
  2. Run a quick analysis for the company you chose.
  3. Open the folder output/{empresa}/ and browse through the 19 files.

Success: the package generated, and you opened at least the roadmap, the deck, and the SOW. What you gained: your working Factory and the first real deliverable — living proof that the machine delivers.

Next:

Track 2 — Knowledge Synthesis (the frameworks worth their weight in gold and the cheat sheet foundation that makes the output look elite)