Build a Multi-Agent Sales Research Tool
Orchestrate 3 AI subagents to auto-generate prospect briefs as PDFs.
Introduction
30 Second Summary
Every salesperson knows the grind of pre-call research. Googling a prospect, checking their competitors, and figuring out what to pitch can eat 2-3 hours before you even send the first email.
In this project, you will build a slash command that turns a company name into a branded 1-page AI-Readiness Brief. One command triggers three AI subagents that research the prospect in parallel and deliver a polished PDF in under 15 minutes.
What You'll Build
A custom /dossier slash command for Claude Code that orchestrates three parallel subagents to research Austin SMBs and produce a branded AI-Readiness Brief as a PDF for PineappleExpressAI, an Austin-based AI advisory consultancy.
By the end of this project, you'll have:
- A working /dossier <company_name> slash command that spawns three parallel subagents to research any Austin prospect and output a branded PDF brief in under 15 minutes.
- Two validated briefs across different Austin verticals (real estate and healthcare) with fact-checked AI use cases, competitor maps, and a $3,000 audit proposal.
- A Mermaid C4 architecture diagram, a Langfuse observability trace, and a Claude Design polished visual brief as portfolio-grade artifacts.
- A scale test across three Austin verticals using headless mode, with performance benchmarks and bottleneck analysis.
Are there any prerequisites?
You need a Claude Max subscription with Claude Code already installed and working, along with Node.js 16 or later. You should be comfortable running commands in a terminal and have a basic understanding of Markdown.
Install Your Toolkit
The dossier system chains together several tools behind the scenes. Pandoc converts your final brief from Markdown to PDF. MiKTeX provides the LaTeX engine that Pandoc needs under the hood. Mermaid CLI renders your architecture diagrams to SVG.
You also need Langfuse for observability so you can trace every subagent run and spot bottlenecks. In this step, you will install all four tools and verify each one works.
In this step, get ready to:
- Install Pandoc and MiKTeX for PDF generation.
- Install Mermaid CLI for architecture diagram rendering.
- Set up Langfuse Cloud and the claude-langfuse-monitor for agent tracing.
Install Pandoc and MiKTeX on Windows
Pandoc is the tool that converts your final Markdown brief into a polished PDF. It relies on a LaTeX engine to handle the actual PDF rendering, and MiKTeX provides that engine on Windows.
- Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Terminal (macOS) or PowerShell (Windows) and press Enter to open it.
- Install Pandoc by running this command:
winget install --source winget --exact --id JohnMacFarlane.Pandoc
What does this command do?
winget is the Windows Package Manager. The --exact --id flags ensure you get the official Pandoc package and not a similarly named one.
- Install MiKTeX by running this command:
winget install -e --id MiKTeX.MiKTeX
Why do I need MiKTeX?
Pandoc converts Markdown to many formats, but for PDF output it needs a LaTeX engine to handle layout, fonts, and page formatting. MiKTeX provides the pdflatex engine that Pandoc calls behind the scenes.
Pro tip: restart your terminal
After installing both tools, close and reopen your terminal. This ensures the new commands are on your system PATH.
- Verify Pandoc is installed by running:
pandoc --version
I see a version number
Pandoc is ready to go.
Command not found
- Close and reopen your terminal to refresh the PATH.
- Run pandoc --version again.
- If it still does not work, re-run the install command above and look for any error messages.
help me troubleshoot Pandoc not being found after installing via winget
- Verify MiKTeX is installed by running:
pdflatex --version
I see a version number
MiKTeX is ready. Pandoc will use pdflatex automatically when you generate PDFs.
Command not found
- Close and reopen your terminal to refresh the PATH.
- Run pdflatex --version again.
- If it still does not work, open the MiKTeX Console app and check if there is a PATH setup option in its settings.
help me get pdflatex working on my Windows machine
Install Mermaid CLI globally
Mermaid CLI gives you the mmdc command, which renders .mmd diagram files into SVG images. You will use this later to create C4 architecture diagrams of the dossier system.
What is Mermaid?
Mermaid is a diagramming language that lets you define charts, flowcharts, and architecture diagrams in plain text. It supports C4 architecture diagrams natively, which is what you will use to document the dossier system's design.
- Mermaid CLI requires Node.js and npm. Confirm Node.js is installed by running:
node --version
I see a version number
Node.js is ready. Move on to the Mermaid CLI install below.
Command not found
- Download and install Node.js from nodejs.org.
- Choose the LTS version.
- After installation, close and reopen your terminal.
- Run node --version again to confirm.
- Install Mermaid CLI globally by running:
npm install -g @mermaid-js/mermaid-cli
- Verify the install by running:
mmdc --version
You should see a version number printed in the terminal.
Seeing a permission error or command not found?
- On macOS/Linux, you may need to prefix the install command with sudo.
- On Windows, make sure you are running PowerShell as Administrator.
- If mmdc is not found after a successful install, close and reopen your terminal.
help me fix my Mermaid CLI install
Set up Langfuse Cloud and claude-langfuse-monitor
When your dossier command runs, three subagents fire in parallel. Without observability, you have no way to see which agent ran, how long it took, or where things went wrong.
Langfuse Cloud captures a trace of every agent run. The claude-langfuse-monitor package connects Claude Code to Langfuse automatically with zero code changes.
What is Langfuse?
Langfuse is an open-source observability platform for LLM applications. It records traces of every AI call your system makes, so you can see execution timelines, token usage, and where time is being spent. The free Cloud tier gives you 50,000 units per month with 30-day retention.
- Open langfuse.com in your browser.
- Click Sign Up and create a free account.
- Create a new project. Name it pineapple-dossier.
- Navigate to your project's Settings page.
- Click API Keys.
- Click Create API Key.
- Copy both the Public Key and Secret Key. Save them somewhere safe. You will need them in a moment.
Keep your Secret Key safe
The Secret Key is only shown once when you create it. If you lose it, you will need to generate a new API key pair.
- Install claude-langfuse-monitor globally by running:
npm install -g claude-langfuse-monitor@1.1.0
What does this package do?
claude-langfuse-monitor watches Claude Code's conversation logs at ~/.claude/projects/ and automatically sends execution traces to your Langfuse project. No code changes needed in your slash commands or agent prompts.
- Configure the monitor with your Langfuse credentials by running the command below. Replace the placeholder values with your actual keys and email:
claude-langfuse config --host https://cloud.langfuse.com --public-key your-public-key-here --secret-key your-secret-key-here --user-id your-email@example.com
- Start the monitor by running:
claude-langfuse start
You should see a confirmation message indicating the monitor is running and watching for Claude Code activity.
Monitor not starting?
- Make sure you have Node.js 16 or higher installed. Check with node --version.
- Double-check that your public key starts with pk-lf- and your secret key starts with sk-lf-.
- If you see a connection error, confirm the host is set to https://cloud.langfuse.com.
help me troubleshoot claude-langfuse-monitor
Your toolkit is locked in. Next up, you will scaffold the entire project structure and load PineappleExpressAI's Austin market intelligence using Claude Code.
Scaffold the Project with AI Assist
Your toolkit is installed. Pandoc, MiKTeX, and Mermaid CLI are ready to convert Markdown to PDFs and render architecture diagrams.
Now you need the project itself. You'll prompt Claude Code to scaffold directories, configuration files, Austin market data, and templates for PineappleExpressAI's dossier system.
In this step, get ready to:
- Create the project directory structure and CLAUDE.md memory file.
- Configure Claude Code permissions and load Austin market intelligence data.
- Build the brief template, scoring rubric, and LinkedIn post template.
Create the project structure and CLAUDE.md
Claude Code uses a file called CLAUDE.md as its project memory. Every time Claude Code opens a directory, it reads this file to learn the project context, business rules, and constraints.
What is CLAUDE.md?
CLAUDE.md is the first file Claude Code looks for when it opens a project. It tells Claude Code who PineappleExpressAI is, which Austin verticals to target, what market data to cite, and how to write.
Every subagent that the dossier system spawns inherits this context automatically. One well-written memory file means every agent speaks with the same voice and cites the same data.
- Move to your Desktop by running this command:
cd ~/Desktop
- Create your project directory and move into it by running these commands:
mkdir dossier-system
cd dossier-system
- Confirm the directory was created by running:
ls
You should see an empty directory. That is expected.
- Open Claude Code by running:
claude
Claude Code not opening?
Make sure you have a Claude Max subscription and that Claude Code is installed. If you see command not found, revisit the Claude Code installation in your prerequisites.
Help me get Claude Code running in my terminal.
- Paste this prompt into Claude Code to generate the project structure and CLAUDE.md:
Create a project called dossier-system for PineappleExpressAI, an Austin AI advisory. I need directories for: .claude/commands, output/briefs, output/diagrams, scratchpad, templates, and data. Create a CLAUDE.md that positions this as PineappleExpressAI's prospect research system. Include these 5 target Austin verticals with real market data: Healthcare (200+ health-tech companies in Austin, $1.58M avg SMB revenue), Real Estate (Austin median home $550k, tech-forward market), Professional Services (4.5M+ firms nationally, largest SMB category), Construction ($1.15M avg revenue, 16.8% 2-year growth), Creative/Media ($1.5B contribution to Austin economy). Entry wedge is a $3,000 AI Readiness Audit. Tone: 7th-grade reading level.
What does this prompt create?
- Six directories: .claude/commands for slash commands, data/ for market intelligence, scratchpad/ for temporary subagent work, templates/ for reusable formats, and output/briefs and output/diagrams for deliverables.
- A CLAUDE.md file with PineappleExpressAI's business context, Austin market data for all 5 verticals, the $3,000 audit entry wedge, and writing guidelines.
Claude Code generates the files and shows you what it created in the terminal output.
- Review the output. Claude Code lists every file and directory it created.
- Verify that CLAUDE.md includes sections for About PineappleExpressAI, Austin Market Context, Entry Wedge, Key Rules, and Project Structure.
- If any sections are missing or the tone does not feel right, ask Claude Code to revise. You can iterate as many times as you need.
Directories missing or CLAUDE.md incomplete?
If directories are missing, name the missing ones in a follow-up prompt. For example: "Please also create the output/briefs and output/diagrams directories."
If CLAUDE.md is too short or generic, paste the specific market data points (like the $1.58M healthcare revenue or 12.6x tech growth) back into a follow-up prompt and ask Claude Code to include them.
Help me fix my CLAUDE.md or missing directories.
My CLAUDE.md looks good
Great. Make sure you have reviewed the full CLAUDE.md before moving on to permissions.
I'd like to double check CLAUDE.md
Here is the reference version of CLAUDE.md. Your version does not need to match word-for-word, but it should cover all the same sections and data points. If yours is missing content, ask Claude Code to update it.
# PineappleExpressAI - Dossier System
You are the prospect research coordinator for PineappleExpressAI, an Austin-based AI advisory consultancy.
## About PineappleExpressAI
PineappleExpressAI helps Austin SMBs adopt AI to reduce costs, increase revenue, and outpace competitors. We focus on 5 key Austin verticals:
1. **Healthcare**: 200+ health-tech companies in Austin MSA. $1.58M avg SMB revenue, 13.7% 2-year growth. AI opportunities: patient scheduling, clinical documentation, billing automation.
2. **Real Estate**: Austin median home price ~$550k. 3.27M real estate SMBs nationally. AI opportunities: lead scoring, property valuation, document processing, virtual staging.
3. **Professional Services**: Largest SMB category (4.59M firms). $1.42M avg revenue. AI opportunities: proposal automation, time tracking, client communication, knowledge management.
4. **Construction**: $1.15M avg revenue, 16.8% 2-year growth (fastest growing). AI opportunities: project estimation, safety monitoring, supply chain optimization, bid analysis.
5. **Creative/Media**: Austin's creative sector contributes $1.5B to the economy. AI opportunities: content generation, campaign optimization, asset management, audience targeting.
## Austin Market Context
- Austin tech ecosystem grew 12.6x since 2017
- Tech sector accounts for ~20% of Austin's total economy
- 50+ AI-focused startups founded in Austin in 2023
- Austin ranked #1 best state to start a business in 2024
## Entry Wedge
$3,000 AI Readiness Audit (2-week engagement). This is what we propose to every prospect.
## Key Rules
- Always use WebSearch and WebFetch for research. Never fabricate company data.
- Read data/austin-verticals.md for pre-researched market stats to cite in briefs.
- Write all intermediate results to the `scratchpad/` directory.
- Final briefs go to `output/briefs/`.
- Diagrams go to `output/diagrams/`.
- Keep the brief to 1 page. Concise, specific, actionable.
- Tone: informative, plain English, 7th-grade reading level.
- Define any technical term in one short sentence before using it again.
- Frame everything through the lens of ROI for a $1M-$10M revenue Austin SMB.
- If a prospect has thin web presence, research the vertical generally and note the data gap as an opportunity.
## Project Structure
- `.claude/commands/` - Custom slash commands
- `data/` - Pre-researched Austin market data
- `scratchpad/` - Temporary working files for subagents
- `templates/` - Brief, scoring rubric, and LinkedIn post templates
- `output/briefs/` - Final PDF briefs and LinkedIn posts
- `output/diagrams/` - C4 architecture diagrams
Configure permissions and load Austin market data
The dossier system spawns three subagents that run autonomously. Subagents cannot pause to ask for permission mid-task. Every tool they need must be pre-approved in a permissions file.
Why pre-approve permissions?
When Claude Code spawns a subagent, that subagent runs as a background task. It cannot pop up a dialog box asking you to approve a web search or file write. If the tool is not pre-approved, the subagent silently fails.
The .claude/settings.local.json file controls which tools are auto-approved for this project.
- Paste this prompt into Claude Code to create the permissions file and Austin reference data:
Create two files. First: .claude/settings.local.json that auto-approves WebSearch, WebFetch, Read, Write, Edit, Glob, Grep, and Bash commands for pandoc and mmdc. Subagents need all of these pre-approved because they cannot ask for permission. Second: data/austin-verticals.md with pre-researched Austin market stats that subagents can cite directly: tech ecosystem grew 12.6x since 2017, tech is 20% of Austin economy, 50+ AI startups founded in 2023, and the revenue/growth stats for each of our 5 target verticals.
What does this prompt create?
- .claude/settings.local.json pre-approves all the tools that subagents need: web search, web fetch, file reading and writing, and shell commands for pandoc and mmdc.
- data/austin-verticals.md is a pre-researched market intelligence file. Subagents read this file during every dossier run so they can cite real Austin market stats instead of making up numbers.
- Review the output. Claude Code should confirm both files were created.
- Verify that .claude/settings.local.json includes WebSearch, WebFetch, Read, Write, Edit, and Bash entries for pandoc and mmdc in the allow list.
- Verify that data/austin-verticals.md includes sections for all 5 verticals (Healthcare, Real Estate, Professional Services, Construction, Creative/Media) with revenue and growth stats.
Permissions file missing tools?
The most common issue is missing Bash permission entries. The permissions file needs specific patterns like Bash(pandoc:*) and Bash(mmdc:*) to allow shell commands for those tools.
If Claude Code created a simpler format, ask it to update: "Update .claude/settings.local.json to use the Bash(command:*) pattern for pandoc, mmdc, del, mkdir, and rm."
Help me fix my Claude Code permissions file.
My files look correct
Make sure both files are saved. The permissions file is especially important because subagents will silently fail without the right approvals.
I'd like to double check both files
Here are the reference versions of both files. Compare yours against these. The permissions file must have the exact tool names in the allow list. The verticals file should cover the same data points.
{
"permissions": {
"allow": [
"WebFetch",
"WebSearch",
"Bash(pandoc:*)",
"Bash(mmdc:*)",
"Bash(del:*)",
"Bash(mkdir:*)",
"Bash(rm:*)",
"Read",
"Write",
"Edit",
"Glob",
"Grep"
]
}
}
# Austin SMB Market Intelligence for PineappleExpressAI
Last updated: April 2026. Sources: Integritek, BizBen, ZipDo, WifiTalents, VotedNumberOne.
## Austin Economy Overview
- Austin tech ecosystem grew 12.6x since 2017 (nearly 2x Silicon Valley pace)
- Austin GDP: $248B in 2023 (39% increase over 5 years, highest among top 50 US metros)
- Tech sector: ~20% of Austin's total economy
- Tech employs 16.3% of Austin labor force (2025) vs 9% national average
- 47,000+ new jobs added in Austin-Round Rock MSA in 2023
- 3,000+ startups, 15-25 unicorns
- 50+ AI-focused startups founded in Austin in 2023
- Ranked #1 best state to start a business in 2024
## Healthcare
- 200+ health-tech companies in Austin MSA
- 120+ biotech/life sciences firms
- $1.58M average SMB revenue
- 13.7% 2-year revenue growth
- Growth drivers: aging population, telehealth expansion, staffing shortages
- AI applications: patient scheduling, clinical documentation, billing automation, telehealth triage
## Real Estate
- Austin median home price: ~$550k
- 3.27M real estate SMBs nationally
- $875K average SMB revenue, 4.2 average employees
- Austin real estate tech is a recognized startup vertical
- AI applications: lead scoring, automated property valuation, document processing, virtual staging
## Professional Services
- 4.59M firms nationally (largest SMB category)
- $1.42M average SMB revenue, 6.8 average employees
- Austin is "best for professional services" per Texas business analysis
- AI applications: proposal automation, time tracking, client communication, knowledge management
## Construction
- $1.15M average SMB revenue
- 16.8% 2-year revenue growth (fastest growing service industry)
- 3.48M firms nationally
- Growth drivers: infrastructure spending, reshoring manufacturing, housing demand
- AI applications: project estimation, safety monitoring, supply chain optimization, bid analysis
## Creative/Media
- Austin's creative tech sector (gaming/VR) contributes $1.5B to economy
- Local gaming industry: 25% of Texas's total gaming workforce
- Includes design agencies, gaming studios, digital media, marketing firms
- SXSW ecosystem drives cross-industry collaboration
- AI applications: content generation, campaign optimization, asset management, audience targeting
Create the brief template, rubric, and LinkedIn post
Templates ensure every brief follows the same structure. The scoring rubric acts as a quality gate so that no brief ships without meeting a minimum bar.
- Paste this prompt into Claude Code to generate all three template files:
Create three template files. First: templates/brief-template.md for PineappleExpressAI's 1-page AI-Readiness Brief with sections for Company Snapshot, Industry AI Landscape, Competitor AI Map (table), 3 AI Use-Case Hypotheses (with estimated impact for each), Common Concerns (table), and Next Step ($3,000 AI Readiness Audit). Second: templates/scoring-rubric.md with a 1-10 scoring system for three criteria: Specificity (are the AI use cases specific to this company or generic?), Accuracy (are competitors real? is industry context correct?), and Actionability (would an Austin SMB founder read this and want to book a call?). Include examples of what a 3, 7, and 10 look like for each. Third: templates/linkedin-post.md with a short template post that says something like: I just built an AI system that turns a company name into a personalized AI-readiness brief in 15 minutes. Here is a sample for [company]. If you run an Austin SMB, DM me for yours.
What do these three templates do?
- brief-template.md is the structure every AI-Readiness Brief follows. It includes placeholder sections for the company snapshot, competitor map, three AI use-case hypotheses, common concerns, and the $3,000 audit call-to-action.
- scoring-rubric.md defines three criteria (Specificity, Accuracy, Actionability) scored 1-10. A brief must score 7+ on all three before delivery. This prevents generic or fabricated briefs from going out.
- linkedin-post.md is a fill-in-the-blanks post template. After every dossier run, the system generates a LinkedIn post with the company name and three use-case titles already filled in.
- Review the output. Claude Code should confirm all three files were created in the templates/ directory.
- Verify that brief-template.md includes all six sections: Company Snapshot, Industry AI Landscape, Competitor AI Map, 3 AI Use-Case Hypotheses, Common Concerns, and Next Step.
- Verify that scoring-rubric.md includes examples of what a 3, 7, and 10 look like for each criterion.
- Verify that linkedin-post.md has placeholder variables for the company name and three use-case titles.
Templates missing sections or too generic?
If the brief template is missing sections, ask Claude Code to add them by name. For example: "Add a Common Concerns table to templates/brief-template.md with rows for too expensive, too complex, takes too long, and I do not trust AI."
If the scoring rubric does not include concrete examples for each score level, ask Claude Code to add them. The examples are what make the rubric useful.
Help me fix my template files.
My templates look good
You now have all the scaffolding in place. Save your work before moving on.
I'd like to double check all three templates
Here are the reference versions of all three template files. Compare yours against these. If your versions are missing content, ask Claude Code to update them.
# AI-Readiness Brief: {COMPANY_NAME}
**Prepared by:** PineappleExpressAI | **Date:** {DATE} | **Austin, TX**
---
## Company Snapshot
{Brief description of what the company does, their approximate size, location in Austin, and industry vertical.}
## Industry AI Landscape
{2-3 paragraphs on AI adoption trends in this specific Austin vertical. What are leaders in this space doing with AI? Where is the opportunity gap for this company? Cite at least one specific Austin market data point from data/austin-verticals.md.}
## Competitor AI Map
| Competitor | Location | AI Adoption | What They Are Doing |
|-----------|----------|-------------|-------------------|
| {name} | {city} | {yes/no} | {description} |
| {name} | {city} | {yes/no} | {description} |
| {name} | {city} | {yes/no} | {description} |
## 3 AI Use-Case Hypotheses
1. **{Use Case Title}**: {What it does in one sentence.} {Why it matters for this specific company.} {Estimated impact: hours saved, dollars saved, or revenue gained per month.}
2. **{Use Case Title}**: {What it does in one sentence.} {Why it matters for this specific company.} {Estimated impact: hours saved, dollars saved, or revenue gained per month.}
3. **{Use Case Title}**: {What it does in one sentence.} {Why it matters for this specific company.} {Estimated impact: hours saved, dollars saved, or revenue gained per month.}
## Common Concerns
| Concern | Our Response |
|---------|-------------|
| "Too expensive" | {Response framed around ROI and the low-cost $3k entry point} |
| "Too complex" | {Response about managed implementation and training} |
| "Takes too long" | {Response about the 2-week audit timeline} |
| "I do not trust AI" | {Response about human-in-the-loop and gradual adoption} |
## Next Step: $3,000 AI Readiness Audit
A 2-week engagement where PineappleExpressAI maps your workflows, identifies your top 3 AI opportunities, and delivers a prioritized implementation roadmap.
**What you get:**
- Full workflow audit (interviews + process mapping)
- AI opportunity scoring matrix
- 90-day implementation roadmap
- Executive summary presentation
---
*Ready to explore? Book a 30-minute discovery call at [pineappleexpressai.com/book]*
# PineappleExpressAI Brief Quality Scoring Rubric
Use this rubric to score every AI-Readiness Brief before delivery. Each criterion is scored 1-10.
## Criterion 1: Specificity
Are the AI use cases specific to THIS company, or could they apply to any business?
- **Score 3**: Generic use cases like "use AI to improve efficiency" with no company-specific detail
- **Score 7**: Use cases reference the company's industry and approximate size, with some tailoring
- **Score 10**: Each use case names a specific workflow this company likely performs, explains exactly how AI would change it, and estimates a dollar or time impact
## Criterion 2: Accuracy
Are the competitors real companies? Is the industry context factually correct?
- **Score 3**: Competitors appear to be fabricated. Industry stats are vague or incorrect.
- **Score 7**: Competitors are real companies found via web search. Industry context is broadly correct but may lack Austin-specific data.
- **Score 10**: All competitors verified via web search. Industry context cites specific Austin market data from data/austin-verticals.md. No fabricated facts.
## Criterion 3: Actionability
Would an Austin SMB founder read this and want to book a call?
- **Score 3**: Reads like a generic industry report. No clear next step. No urgency.
- **Score 7**: The CTA is clear. The use cases are interesting. But the brief does not create urgency or show the prospect what they are missing.
- **Score 10**: The brief shows competitors who are already using AI (creating urgency). The 3 use cases each have a concrete estimated impact. The $3k audit feels like an obvious first step. A founder would forward this to their partner and say "we should take this call."
## Minimum Quality Bar
A brief must score 7+ on all three criteria before delivery. If any criterion scores below 7, apply the suggested improvements and regenerate.
I just built an AI system that turns a company name into a personalized AI-readiness brief in 15 minutes.
Here is a sample brief for {COMPANY_NAME}.
It covers:
- {USE_CASE_1}
- {USE_CASE_2}
- {USE_CASE_3}
Each use case includes estimated ROI specific to their business.
If you run an Austin SMB and want to see what AI could do for yours, DM me. The first 10 briefs are free.
#AI #AustinBusiness #SmallBusiness #AIConsulting #PineappleExpressAI
Your project structure is built. Six directories, a memory file, permissions, market intelligence data, and three templates. Next, you'll open Claude Desktop to design the three subagent contracts that power the dossier system.
Design Subagent Contracts in Claude Desktop
Your project structure is scaffolded, your Austin market data is loaded, and your templates are ready. Now it's time to design the brains of the system: the three subagent contracts that tell each researcher exactly what to do.
A subagent contract is a detailed prompt that defines a single job: what to research, where to write the output, and what to do when information is scarce. You'll draft all three contracts in Claude Desktop, where the Projects and Artifacts features make it easy to iterate on long prompts before deploying them into Claude Code.
In this step, get ready to:
- Draft 3 subagent contracts (Industry Researcher, Competitor Scanner, Pitch Drafter) as Artifacts in Claude Desktop.
- Refine each contract with fallback logic, structured output, and specificity requirements.
- Export the finalized contract text so you can embed it in the coordinator slash command.
Open Claude Desktop and draft all 3 subagent contracts
The dossier system splits prospect research into three parallel jobs. Each job gets its own subagent with a dedicated contract that defines the research scope, output format, and failure behavior.
- Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
- Type Claude and press Enter to open Claude Desktop.
- Click Projects in the sidebar.
- Click Create Project.
- Name the project PineappleExpressAI - Dossier System.
- Open the project and start a new conversation.
Why design prompts in Claude Desktop?
Claude Desktop's Projects feature gives you a dedicated workspace with Artifacts, which are editable documents that persist across your conversation. This makes it much easier to iterate on long prompts than editing Markdown files directly in Claude Code.
The workflow is: design and refine your contracts in Claude Desktop, then deploy them into Claude Code.
- Type this prompt into the chat to draft all 3 subagent contracts as Artifacts:
I am building a multi-agent prospect research system for PineappleExpressAI, an Austin AI advisory. I need 3 subagent contracts, each as a separate Artifact.
Agent 1: Industry Researcher.
Searches the web for the prospect company, identifies their industry, researches AI adoption trends in that Austin vertical, finds 2-3 AI use cases deployed by similar companies. Must also read data/austin-verticals.md and cite specific market stats. If web search returns little data about the company, research the industry vertical in Austin generally and note data is sparse. Frame sparse data as an opportunity: companies with weak digital presence are often the most underserved by AI. Output goes to scratchpad/industry.md.
Agent 2: Competitor Scanner.
Searches for the prospect's direct Austin-area competitors, checks which are using AI publicly, maps the competitive landscape. Output goes to scratchpad/competitors.md.
Agent 3: Pitch Drafter.
Reads industry.md and competitors.md from the scratchpad, synthesizes 3 specific AI use-case hypotheses with estimated ROI for a $1M-$10M revenue Austin SMB, builds an objection map, proposes PineappleExpressAI's $3,000 AI Readiness Audit entry wedge. Output goes to scratchpad/pitch.md.
Draft all three as separate Artifacts so I can review and refine each one.
What do these 3 agents do?
- Industry Researcher is the context builder. It figures out what the prospect does and what AI trends are happening in their Austin vertical. It writes to scratchpad/industry.md.
- Competitor Scanner creates urgency. It finds competitors who are already using AI publicly, so the prospect can see what they are missing. It writes to scratchpad/competitors.md.
- Pitch Drafter is the closer. It reads both scratchpad files, synthesizes 3 tailored AI use-case hypotheses, and frames the $3,000 audit as the obvious next step. It writes to scratchpad/pitch.md.
Claude Desktop should generate 3 separate Artifacts in the conversation, one for each subagent contract. Each Artifact contains the full prompt text for that agent.
Don't see 3 Artifacts?
- If Claude Desktop generated inline text instead of Artifacts, add a follow-up message: "Please create each contract as a separate Artifact so I can edit them independently."
- If you see fewer than 3 Artifacts, ask Claude to generate the missing one by name (e.g. "Create the Competitor Scanner contract as an Artifact").
Help me get Claude Desktop to generate Artifacts for my subagent contracts.
Refine the contracts for quality and specificity
The first draft gets the structure right. The second pass makes each contract specific enough to produce reliable, high-quality output on real prospects.
- Type this refinement prompt into the same Claude Desktop conversation:
Refine each subagent contract with these improvements:
1. The Industry Researcher must include a fallback strategy for companies with thin web presence. If web search returns limited data, research the industry vertical in Austin generally and note the data gap. Frame it as an opportunity: companies with weak digital presence are often the most underserved by AI.
2. The Competitor Scanner should prioritize Austin-area competitors and check LinkedIn, Google Maps, and company websites for AI signals.
3. The Pitch Drafter must frame each AI use case with a specific estimated impact: hours saved, dollars saved, or revenue gained per month.
4. All three must produce structured Markdown with clear headers so the coordinator can merge them cleanly.
Update each Artifact with these refinements.
What do these refinements add?
- Fallback logic ensures the system still produces useful output when a prospect has little web presence. Many Austin SMBs have minimal online footprints. Without fallback logic, the Industry Researcher would return empty results.
- Specific data sources (LinkedIn, Google Maps, company websites) tell the Competitor Scanner exactly where to look instead of running generic searches.
- Estimated impact numbers (hours, dollars, revenue) make each AI use case concrete. A founder reads "save 20 hours/month on patient scheduling" and immediately sees the ROI.
- Structured Markdown with consistent headers means the coordinator can merge all three scratchpad files into the brief template without reformatting.
- Review each updated Artifact in Claude Desktop.
- Confirm the Industry Researcher Artifact mentions the fallback strategy for sparse data.
- Confirm the Pitch Drafter Artifact specifies estimated impact for each use case (hours, dollars, or revenue per month).
- Confirm all three Artifacts specify their output file path (scratchpad/industry.md, scratchpad/competitors.md, scratchpad/pitch.md).
Contracts feel too generic?
If the contracts read like they could apply to any company in any city, they need more Austin-specific grounding. Add a follow-up prompt: "Each contract should instruct the subagent to read data/austin-verticals.md and cite specific Austin market stats in its output."
Help me make my subagent contracts more specific to Austin SMBs.
Export the finalized contracts
The contracts are designed. Now you need to extract them from Claude Desktop so you can embed them in the coordinator slash command you'll build in Step 4.
- Click on the Industry Researcher Artifact to open it.
- Select all the text inside the Artifact and copy it to your clipboard.
- Paste it into a temporary note or text file so you can access it in the next step.
- Repeat for the Competitor Scanner and Pitch Drafter Artifacts.
Why not save these as separate agent files?
Claude Code supports custom agent files in .claude/agents/. In theory, each subagent contract could live in its own file. In practice, there is a known bug (GitHub issue #13627) where agent body content is ignored when subagents are spawned via the Task tool. The metadata (name, description) is recognized, but the actual instructions are not.
The workaround is to embed the full contract text directly in the coordinator slash command's Task tool prompts. That is exactly what you'll do in the next step.
Your three subagent contracts are designed, refined, and ready to deploy. In the next step, you'll wire them into a single /dossier slash command that orchestrates all three in parallel and produces a finished PDF brief.
Build the Coordinator Slash Command
Your three subagent contracts are designed, refined, and ready to deploy. Each one knows exactly what to research, where to write its output, and how to handle sparse data.
Now you need a single entry point that wires them together. The coordinator slash command clears the workspace, spawns all three subagents in parallel, merges their research into PineappleExpressAI's branded brief template, converts it to PDF, and generates a LinkedIn post. One command, six steps, zero manual research.
In this step, get ready to:
- Create the /dossier slash command by prompting Claude Code.
- Review the generated command for correct frontmatter, subagent prompts, and PDF pipeline.
- Dry run the command to verify the full pipeline works end-to-end.
Prompt Claude Code to create the /dossier command
Claude Code custom slash commands live as Markdown files inside .claude/commands/. The file uses YAML frontmatter to declare which tools the command can use, and the body contains the full coordinator instructions.
- Copy the following prompt and paste it into Claude Code:
Create .claude/commands/dossier.md for PineappleExpressAI.
Frontmatter: allowed-tools for Task, Read, Write, Bash, WebSearch, WebFetch, Glob, Grep. Argument hint: <company_name>. Description: Generate a PineappleExpressAI 1-page AI-Readiness Brief for a prospect company.
The command body should follow these steps exactly:
1. Clear the scratchpad directory.
2. Spawn 3 research subagents in parallel via the Task tool using the exact prompts I am about to paste below. Each subagent is general-purpose type. Every subagent prompt must use $ARGUMENTS to reference the company name.
3. After all three subagents complete, read all scratchpad files and merge them into a single brief following templates/brief-template.md. Write the result to scratchpad/final-brief.md.
4. Run pandoc to convert the merged brief to PDF in output/briefs/. Use these flags: -V geometry:margin=0.75in -V fontsize=11pt -V colorlinks=true
5. Generate a LinkedIn post from templates/linkedin-post.md with the company name and the 3 AI use-case titles filled in. Save to output/briefs/$ARGUMENTS-linkedin.md.
6. Report completion to the user with the file paths and a summary of the 3 use-case hypotheses.
Here are the 3 subagent prompts:
--- INDUSTRY RESEARCHER ---
[Paste your Industry Researcher contract here]
--- COMPETITOR SCANNER ---
[Paste your Competitor Scanner contract here]
--- PITCH DRAFTER ---
[Paste your Pitch Drafter contract here]
- Before pressing Enter, replace each [Paste your ... contract here] placeholder with the full contract text you copied from your Claude Desktop Artifacts in Step 3.
- Press Enter to send the prompt. Claude Code generates the dossier.md file.
Why are subagent prompts pasted inline?
Claude Code has a known bug (GitHub issue #13627) where agent body content in .claude/agents/*.md files is ignored when subagents are spawned via the Task tool. The workaround is to embed the full subagent instructions directly in the slash command's Task tool prompts.
Claude Code not generating the file?
Make sure you pasted all three contracts before pressing Enter. If the prompt was too long and got cut off, try pasting each contract one at a time and telling Claude Code to add it to the file.
help me debug why Claude Code didn't generate my dossier.md slash command
Review the generated command
Claude Code generated the file, but you need to verify it matches PineappleExpressAI's pipeline requirements. A missing tool in the frontmatter or a wrong file path silently breaks the pipeline at runtime.
- Open .claude/commands/dossier.md in Claude Code or your text editor.
Check these six elements against your file. Each one is critical for the pipeline to work.
- Verify the frontmatter includes all required tools. It should look like this:
---
description: Generate a PineappleExpressAI 1-page AI-Readiness Brief for a prospect company
allowed-tools: Task, Read, Write, Bash, WebSearch, WebFetch, Glob, Grep
argument-hint: <company_name>
---
What do these frontmatter fields do?
- allowed-tools declares every tool the coordinator and its subagents need. Missing WebSearch or WebFetch means subagents cannot research online.
- argument-hint tells the user what to type after the slash command. The value becomes $ARGUMENTS in the command body.
- Confirm each subagent prompt uses $ARGUMENTS to reference the company name. Search the file for $ARGUMENTS. It should appear in all three subagent prompts and in the pandoc output path.
- Confirm the merge step references templates/brief-template.md and writes the merged result to scratchpad/final-brief.md.
- Confirm the Pandoc command includes the correct flags. It should look like this:
pandoc scratchpad/final-brief.md -o "output/briefs/$ARGUMENTS.pdf" -V geometry:margin=0.75in -V fontsize=11pt -V colorlinks=true
What do these Pandoc flags do?
- geometry:margin=0.75in sets narrow margins so the brief fits on one page.
- fontsize=11pt keeps text readable without wasting space.
- colorlinks=true makes hyperlinks visible in the PDF instead of hiding them in black text.
- Confirm the LinkedIn post step reads from templates/linkedin-post.md and saves to output/briefs/$ARGUMENTS-linkedin.md.
- Confirm the Pitch Drafter subagent is instructed to wait for scratchpad/industry.md and scratchpad/competitors.md to exist before it starts reading. This is the dependency that keeps the pipeline sequential where it needs to be.
If anything is missing, tell Claude Code what to fix. For example: "Add the -V colorlinks=true flag to the pandoc command" or "Make sure the Pitch Drafter waits for the other two scratchpad files."
Awesome, I've got everything!
Double check that you have saved .claude/commands/dossier.md. You are ready for the dry run.
I'd like to double check the full code
Here is the complete dossier.md file. Your subagent prompt wording may differ since you wrote the contracts in Claude Desktop, but the overall structure and the six coordinator steps should match.
---
description: Generate a PineappleExpressAI 1-page AI-Readiness Brief for a prospect company
allowed-tools: Task, Read, Write, Bash, WebSearch, WebFetch, Glob, Grep
argument-hint: <company_name>
---
You are the prospect research coordinator for PineappleExpressAI, an Austin-based AI advisory consultancy. PineappleExpressAI helps Austin SMBs in healthcare, real estate, professional services, construction, and creative/media adopt AI to reduce costs, increase revenue, and outpace competitors.
The user has requested a dossier for: $ARGUMENTS
Follow these steps exactly:
1. **Clear the scratchpad.** Delete any existing files in the `scratchpad/` directory.
2. **Spawn 3 research subagents in parallel** using the Task tool:
a) **Industry Researcher** (general-purpose subagent):
- Search the web for "$ARGUMENTS" to understand what this company does, their size, location, and industry
- Identify which of PineappleExpressAI's 5 target verticals this company falls into (healthcare, real estate, professional services, construction, creative/media)
- Read `data/austin-verticals.md` for pre-researched Austin market stats to cite
- Research AI adoption trends in that specific Austin vertical
- Find 2-3 specific AI use cases already being deployed by similar companies in Austin
- **Fallback**: If web search returns little data about the company, research the industry vertical in Austin generally. Note that the company has limited online presence. Frame this as an opportunity: companies with weak digital presence are often the most underserved by AI.
- Write structured findings to `scratchpad/industry.md` with clear headers
b) **Competitor Scanner** (general-purpose subagent):
- Search the web for direct competitors of "$ARGUMENTS" in the Austin area
- For each competitor, check if they are publicly using AI (chatbots on website, AI-powered services, automation mentions)
- Map the competitive landscape: who is ahead on AI adoption, who is behind
- Write a structured competitor table to `scratchpad/competitors.md`
c) **Pitch Drafter** (general-purpose subagent):
- Wait for `scratchpad/industry.md` and `scratchpad/competitors.md` to exist, then read both
- Also read `data/austin-verticals.md` for market context
- Synthesize 3 specific AI use-case hypotheses for "$ARGUMENTS" based on the research
- Each hypothesis must include: what it does, why it matters for this company, estimated impact (hours saved, dollars saved, or revenue gained per month)
- Build an objection map with responses for: "too expensive", "too complex", "takes too long", "I do not trust AI"
- Propose PineappleExpressAI's entry wedge: a $3,000 AI Readiness Audit (2-week engagement)
- Write the complete draft to `scratchpad/pitch.md`
3. **Merge results.** Read all three scratchpad files. Combine them into a single Markdown file following the template in `templates/brief-template.md`. Replace all placeholder variables with the researched content. Write the merged result to `scratchpad/final-brief.md`.
4. **Generate the PDF.** Run this command:
```
pandoc scratchpad/final-brief.md -o "output/briefs/$ARGUMENTS.pdf" -V geometry:margin=0.75in -V fontsize=11pt -V colorlinks=true
```
5. **Generate LinkedIn post.** Read `templates/linkedin-post.md`, fill in the company name and the 3 AI use-case titles, and save to `output/briefs/$ARGUMENTS-linkedin.md`.
6. **Report completion.** Tell the user the brief is ready at `output/briefs/$ARGUMENTS.pdf`, the LinkedIn post is at `output/briefs/$ARGUMENTS-linkedin.md`, and summarize the 3 AI use-case hypotheses.
Dry run the command
The structure looks right on paper. Now you need to see it run. A dry run against a test company name catches broken file paths, missing permissions, and Pandoc errors before you run it on a real prospect.
- In Claude Code, run the following command:
/dossier TestCompany
- Watch Claude Code's output as the command runs. You should see the coordinator clear the scratchpad, spawn three subagents, and begin researching "TestCompany" online.
What should I see during the run?
- The coordinator deletes old scratchpad files (if any exist).
- Three Task tool calls appear, one for each subagent. The Industry Researcher and Competitor Scanner run in parallel. The Pitch Drafter waits for their output.
- Scratchpad files appear: industry.md, competitors.md, pitch.md, then final-brief.md.
- Pandoc runs and creates output/briefs/TestCompany.pdf.
- The LinkedIn post is saved to output/briefs/TestCompany-linkedin.md.
- Claude Code reports completion with a summary of the 3 AI use-case hypotheses.
- After the run completes, verify the output files exist by running:
ls output/briefs/
- You should see TestCompany.pdf and TestCompany-linkedin.md in the output.
- Open TestCompany.pdf to confirm it contains a formatted brief with company snapshot, competitor map, use-case hypotheses, and the $3,000 audit CTA.
- Open TestCompany-linkedin.md to confirm it includes the company name and three use-case bullet points.
What if "TestCompany" does not exist online?
That is expected. "TestCompany" is not a real company. The Industry Researcher's fallback logic should kick in. It researches the general industry vertical instead and notes the sparse data as an opportunity. This is exactly how the system handles real Austin SMBs with thin web presence.
Common dry run errors
- "Tool not allowed" error: Open .claude/settings.local.json and confirm WebSearch and WebFetch are in the permissions.allow array. Subagents cannot prompt for permission, so everything must be pre-approved.
- Pandoc error "pdflatex not found": MiKTeX is not installed or not on your PATH. Run pdflatex --version in a new terminal to check. You may need to restart your terminal after installing MiKTeX.
- Scratchpad files not created: Check that the subagent prompts in dossier.md include Write in the frontmatter's allowed-tools and that each prompt tells the subagent to write to the correct scratchpad/ path.
help me debug my /dossier dry run
- If any errors occurred, fix them by prompting Claude Code with the specific issue. Re-run /dossier TestCompany until the full pipeline completes successfully.
Your pipeline works end-to-end. Next up, you will point it at a real Austin company and see what PineappleExpressAI's research engine can actually produce.
Validate on Real Austin SMBs
Your /dossier command is built and the dry run passed. Now it is time to point it at real Austin companies and see what comes out the other side.
You will run two full dossier generations across two different PineappleExpressAI verticals: real estate and healthcare. Between the runs, you will score the first brief against your quality rubric and force improvements before accepting it.
In this step, get ready to:
- Generate a complete AI-Readiness Brief for an Austin real estate company.
- Score the brief against PineappleExpressAI's quality rubric and apply improvements.
- Validate cross-vertical capability by generating a second brief for an Austin healthcare company.
Run the dossier on Barton Creek Real Estate Group
Barton Creek Real Estate Group is a realistic Austin real estate SMB. The system will search the web for this company and build a brief from whatever it finds.
If the company has a thin web presence, your fallback logic kicks in. The Industry Researcher subagent researches the Austin real estate vertical generally and frames the data gap as an opportunity.
- In Claude Code, run the following slash command:
/dossier Barton Creek Real Estate Group
What should I see?
This takes a few minutes. Watch for these milestones as the coordinator works:
- The coordinator clears the scratchpad/ directory.
- Three subagents spawn in parallel: Industry Researcher, Competitor Scanner, and Pitch Drafter.
- Scratchpad files appear: industry.md, competitors.md, then pitch.md.
- The coordinator merges everything into scratchpad/final-brief.md.
- Pandoc converts the brief to PDF. A LinkedIn post is generated alongside it.
- Once the run completes, confirm the output files exist by running this in your terminal:
ls output/briefs/
You should see Barton Creek Real Estate Group.pdf and Barton Creek Real Estate Group-linkedin.md in the output.
- Open the PDF to confirm it contains all the expected sections: Company Snapshot, Industry AI Landscape, Competitor AI Map, 3 AI Use-Case Hypotheses, Common Concerns, and the $3,000 AI Readiness Audit CTA.
PDF not generated?
- If you see a pdflatex not found error, MiKTeX is not installed or not on your PATH. Run pdflatex --version to verify. You may need to restart your terminal after installing MiKTeX.
- If the slash command is not recognized, check that .claude/commands/dossier.md exists in your project directory. Claude Code loads custom commands from this path.
- If subagents fail silently and scratchpad files are empty, check that .claude/settings.local.json has all tools pre-approved. Subagents cannot ask for permission during execution.
- Still stuck? Help me debug why my /dossier command is not generating a PDF.
Score the brief with the quality gate
A brief that sounds good is not the same as a brief that books a call. PineappleExpressAI's scoring rubric measures three things: how specific the use cases are to this company, how accurate the competitor data is, and how likely a founder is to take action after reading it.
Every brief must score 7 or above on all three criteria before delivery. If any criterion falls below 7, improvements are required.
- In Claude Code, paste the following prompt to trigger the quality gate:
Read scratchpad/final-brief.md and templates/scoring-rubric.md. Score the brief on all three criteria using the rubric. For each criterion, give a score 1-10, explain why, and suggest one concrete improvement. Then apply all three improvements to scratchpad/final-brief.md and regenerate the PDF by running: pandoc scratchpad/final-brief.md -o "output/briefs/Barton Creek Real Estate Group.pdf" -V geometry:margin=0.75in -V fontsize=11pt -V colorlinks=true
What do the three scoring criteria measure?
- Specificity checks whether the AI use cases name workflows this company actually performs. A score of 3 means generic advice like "use AI to improve efficiency." A score of 10 means each use case names a specific workflow with an estimated dollar or time impact.
- Accuracy checks whether competitors are real and whether Austin market data is cited correctly from data/austin-verticals.md. Fabricated competitors score a 3.
- Actionability measures whether an Austin SMB founder would read this and want to book a call. A 10 means the brief creates urgency by showing competitors ahead on AI, presents concrete ROI estimates, and makes the $3,000 audit feel like an obvious next step.
- Review the scores Claude Code produces. All three should be 7 or above after the improvements are applied.
- Open the regenerated PDF at output/briefs/Barton Creek Real Estate Group.pdf to confirm the improvements are reflected.
Pro tip: iterate if scores are low
If a criterion scores below 7 even after improvements, prompt Claude Code again with something like: "The Specificity score is still a 5. Rewrite the 3 AI use-case hypotheses to reference specific real estate workflows like listing coordination, CMA generation, and client follow-up automation." The more specific your feedback, the better the output.
Scores look suspiciously high?
If all three criteria score 9 or 10 on the first pass, read the brief yourself. Check whether the competitors listed are real companies by searching for them. Self-grading can be generous. The rubric is designed to catch vague output, but your judgment is the final quality gate.
Having trouble interpreting the scores? Help me evaluate whether my brief quality scores are accurate.
Validate on a different vertical
One successful brief proves the command works. Two successful briefs across different industries prove the system works for PineappleExpressAI's entire target market.
Austin Regional Clinic is a healthcare company. The system should automatically detect this vertical, pull different market stats from data/austin-verticals.md, and produce completely different AI use-case hypotheses than the real estate brief.
- In Claude Code, run the dossier on the healthcare company:
/dossier Austin Regional Clinic
- Wait for the run to complete. This follows the same flow as the Barton Creek run.
- Confirm the output files exist by running:
ls output/briefs/
You should now see four files: the PDFs and LinkedIn posts for both Barton Creek Real Estate Group and Austin Regional Clinic.
- Open Austin Regional Clinic.pdf and compare it against the Barton Creek brief.
What to look for in the comparison
A system that truly adapts to each prospect produces noticeably different output across verticals. Check for these signals:
- The Industry AI Landscape section should reference healthcare-specific trends like clinical documentation, patient scheduling, and billing automation. It should not repeat real estate trends.
- Austin market stats should cite healthcare data: 200+ health-tech companies, $1.58M average SMB revenue, 13.7% two-year growth.
- The 3 AI Use-Case Hypotheses should be entirely different from the real estate brief. Healthcare use cases might include telehealth triage, clinical note generation, or automated appointment reminders.
- The Competitor AI Map should list healthcare competitors, not real estate ones.
Healthcare brief looks too similar to real estate?
- Check scratchpad/industry.md from the Austin Regional Clinic run. If it references real estate data, the Industry Researcher subagent may not have correctly identified the company's vertical.
- If the scratchpad still contains data from the Barton Creek run, the coordinator may not have cleared it before starting. Manually delete the files in scratchpad/ and re-run the command.
- Need help diagnosing the issue? Help me figure out why my healthcare dossier looks similar to my real estate one.
Two validated briefs across two verticals. The system detects the industry, pulls the right market data, and produces tailored output every time. Next up, you will capture the Langfuse trace for one of these runs to see exactly how the subagents performed under the hood.
Capture the Langfuse Trace
Your dossier system just passed its quality gate across two Austin verticals. You have validated briefs for both real estate and healthcare, proving the pipeline adapts to different industries.
The claude-langfuse-monitor you set up in Step 1 has been silently capturing every conversation turn, tool invocation, and subagent spawn. In this step, you will open the Langfuse Cloud dashboard, find the trace for your Barton Creek run, and see exactly how your three subagents performed.
In this step, get ready to:
- Find the Barton Creek Real Estate Group trace in Langfuse Cloud.
- Capture a screenshot of the full trace timeline.
- Analyze subagent performance to establish a baseline.
Open Langfuse Cloud and find the trace
Every time you ran /dossier, the monitor pushed traces to your Langfuse project in real time. Each trace captures user prompts, Claude responses, and tool calls including the Task tool spawns that created your subagents.
- Open your browser and navigate to your Langfuse Cloud dashboard. If you chose the US region during setup, the URL is us.cloud.langfuse.com. For the EU region, use cloud.langfuse.com.
- Log in with the account you created in Step 1.
- Select the project you connected to claude-langfuse-monitor during configuration.
- Click Traces in the left sidebar.
You should see a list of traces from your Claude Code sessions. Each trace corresponds to a conversation turn.
- Look for traces grouped under the session that matches your Barton Creek Real Estate Group run. The traces are named claude_code_user (your prompts) and claude_response (Claude's replies).
- Click on the trace for the /dossier Barton Creek Real Estate Group conversation turn to open the detail view.
What am I looking at?
Langfuse's trace view shows a hierarchy of every operation that happened during that conversation turn. You can toggle between a Tree view (nested hierarchy) and a Timeline view (chronological with duration bars). The Timeline view is especially useful here because it visualizes which subagents ran in parallel and how long each one took.
Inside the trace you should see the coordinator's Task tool calls that spawned each subagent. Each tool call shows input (the subagent prompt) and output (the subagent's result). Metadata includes token usage and latency per operation.
Not seeing any traces?
Make sure claude-langfuse-monitor is still running. Check by running claude-langfuse status in your terminal. If it stopped, restart it with claude-langfuse start and re-run /dossier Barton Creek Real Estate Group.
Also verify your API keys match. Run claude-langfuse config and confirm the host, public key, and secret key match what Langfuse Cloud shows in your project settings.
Traces from claude-langfuse-monitor can take up to a minute to appear. Refresh the page if you do not see them immediately.
Help me troubleshoot why my Langfuse traces are not appearing for my Claude Code session.
Capture and annotate the screenshot
This screenshot becomes a portfolio artifact. It proves you built a multi-agent system and can observe it in production.
- In the trace detail view, switch to the Timeline view using the toggle at the top of the trace panel.
- Expand the trace so you can see the coordinator, each of the three Task tool calls (Industry Researcher, Competitor Scanner, Pitch Drafter), and the final Bash call for pandoc.
- Take a screenshot of the full trace timeline. Press Cmd+Shift+4 (macOS) or Win+Shift+S (Windows) to capture a selected area.
- Save the screenshot to output/langfuse-trace.png in your project folder.
Pro tip: annotate the screenshot
Open the screenshot in your system's image editor (Paint on Windows, Preview on macOS). Label the coordinator call, each subagent spawn, and the pandoc PDF generation step. Annotated screenshots are far more impressive in a portfolio than raw screenshots.
Analyze the trace
The trace data tells you exactly where time is being spent. This baseline matters because the Secret Mission will compare performance across multiple verticals.
- Look at the duration bars for each of the three subagent Task tool calls. Note which subagent took the longest.
- Calculate the total execution time from the start of the coordinator trace to the end of the pandoc call.
- Check the token usage for each subagent. The Pitch Drafter typically uses the most tokens because it reads and synthesizes output from the other two subagents.
Why does the Pitch Drafter usually take the longest?
The Industry Researcher and Competitor Scanner can run in parallel because they do not depend on each other. The Pitch Drafter depends on both. It waits for scratchpad/industry.md and scratchpad/competitors.md to exist before it starts reading. This makes it the natural bottleneck in the pipeline.
In the timeline view, you can see this visually. The first two subagents overlap (parallel). The Pitch Drafter starts after both finish (sequential).
- Document your findings by prompting Claude Code: "Create output/trace-analysis.md with the following data from my Langfuse trace: which subagent took the longest, total execution time, approximate token count per subagent, and the bottleneck explanation. This is the baseline for the Secret Mission scale test."
What should I see in the analysis?
A typical dossier run takes 3-10 minutes depending on web search latency. The Industry Researcher and Competitor Scanner usually take 1-3 minutes each, running in parallel. The Pitch Drafter takes 1-2 minutes but starts later because of its dependency on the other two. The pandoc PDF generation is near-instant (under 5 seconds).
You now have a traced, observable multi-agent pipeline. Next up, you will generate C4 architecture diagrams that map this entire system visually.
Generate the C4 Architecture Diagram
Your Langfuse trace captured the full lifecycle of a dossier run, from coordinator to subagents to PDF output. Now you have observability. Next up: a visual map of the entire system.
A C4 architecture diagram shows how a software system fits together at different zoom levels. You will create two diagrams using Mermaid syntax: a Context diagram (the big picture) and a Container diagram (the internal components).
In this step, get ready to:
- Create a C4 Context diagram showing the Dossier System and its external dependencies.
- Create a C4 Container diagram showing the internal components and data flows.
- Render both diagrams to SVG using the Mermaid CLI.
Prompt Claude Code to write the C4 Context diagram
The Context diagram is the highest zoom level of C4. It shows who uses the system, the system itself, and all external systems it talks to.
- In Claude Code, enter this prompt:
Create output/diagrams/c4-context.mmd using Mermaid C4Context syntax. Show Roy as a Person working for PineappleExpressAI, the Dossier System as the main System, Public Web as System_Ext, Langfuse Cloud as System_Ext, and Claude Design as System_Ext. Define all relationships. Remember: start directly with C4Context, no mermaid keyword.
What do these C4 elements mean?
- Person() represents a human user of the system. Roy is the solo consultant running PineappleExpressAI.
- System() represents the software you built. This is the Dossier System.
- System_Ext() represents external systems you depend on but do not control, like Public Web and Langfuse Cloud.
- Rel() defines a relationship between two elements, describing how data flows between them.
- After Claude Code generates the file, open output/diagrams/c4-context.mmd and review it.
- Verify the file starts with C4Context (not mermaid or graph).
- Confirm the diagram includes Roy as a Person, the Dossier System as a System, and three System_Ext elements (Public Web, Langfuse Cloud, Claude Design).
Awesome, I've got everything!
Double check you have saved c4-context.mmd before moving on.
I'd like to double check the expected output
Your c4-context.mmd file should look like this:
C4Context
title System Context - PineappleExpressAI Prospect Research Desk
Person(roy, "Roy (PineappleExpressAI)", "Solo AI consultant targeting Austin SMBs across 5 verticals")
System(dossier, "Dossier System", "Multi-agent research pipeline producing branded AI-Readiness Briefs")
System_Ext(web, "Public Web", "Company websites, news, industry reports, LinkedIn")
System_Ext(langfuse, "Langfuse Cloud", "Observability and tracing for agent runs")
System_Ext(design, "Claude Design", "Visual brief polishing and brand export")
Rel(roy, dossier, "Runs /dossier <company>")
Rel(dossier, web, "Searches and fetches prospect data", "WebSearch + WebFetch")
Rel(dossier, langfuse, "Sends execution traces", "HTTPS")
Rel(dossier, roy, "Delivers PDF brief + LinkedIn post")
Rel(roy, design, "Polishes brief into branded visual", "Manual handoff")
Diagram starts with the wrong keyword?
Mermaid C4 diagrams must start directly with C4Context. If Claude Code prefixed the file with mermaid or wrapped it in a code fence, remove that prefix. The first line of the .mmd file must be C4Context.
Fix this by prompting Claude Code: "Remove the mermaid keyword from the top of c4-context.mmd. The file should start directly with C4Context."
Why is my C4 Context diagram not generating correctly?
Prompt Claude Code to write the C4 Container diagram
The Container diagram zooms one level deeper. It shows the internal components of the Dossier System and how data flows between them.
- In Claude Code, enter this prompt:
Create output/diagrams/c4-container.mmd using C4Container syntax. Inside the Dossier System boundary, show: Coordinator (slash command), Industry Researcher (subagent), Competitor Scanner (subagent), Pitch Drafter (subagent), Markdown Scratchpad (ContainerDb), Austin Verticals Data (ContainerDb), and Pandoc + MiKTeX (CLI tools). Show all data flow relationships including the parallel spawn pattern.
What are the new C4 elements in this diagram?
- Container_Boundary() groups related containers inside a named boundary. Everything inside this boundary is part of the Dossier System.
- Container() represents a running process or deployable unit. Each subagent and the coordinator are containers.
- ContainerDb() represents a data store. The Markdown Scratchpad and Austin Verticals Data are both file-based data stores.
- After Claude Code generates the file, open output/diagrams/c4-container.mmd and review it.
- Confirm the file starts with C4Container on the first line.
- Check that all three subagents (Industry Researcher, Competitor Scanner, Pitch Drafter) appear inside the Container_Boundary.
- Verify the relationships show the parallel spawn pattern from the Coordinator to all three subagents.
Awesome, I've got everything!
Double check you have saved c4-container.mmd before moving on.
I'd like to double check the expected output
Your c4-container.mmd file should look like this:
C4Container
title Container Diagram - PineappleExpressAI Dossier System
Person(roy, "Roy", "")
Container_Boundary(dossier, "Dossier System") {
Container(coordinator, "Coordinator", "Claude Code slash command", "Orchestrates subagents, merges results, triggers PDF + LinkedIn post")
Container(industry, "Industry Researcher", "Claude Code subagent", "Researches Austin vertical AI trends for prospect")
Container(competitor, "Competitor Scanner", "Claude Code subagent", "Maps Austin competitor AI adoption")
Container(pitcher, "Pitch Drafter", "Claude Code subagent", "Synthesizes 3 hypotheses + $3k audit proposal")
ContainerDb(scratchpad, "Markdown Scratchpad", "File system", "industry.md, competitors.md, pitch.md, final-brief.md")
ContainerDb(data, "Austin Verticals Data", "Markdown file", "Pre-researched market stats for 5 target verticals")
Container(pandoc, "Pandoc + MiKTeX", "CLI tools", "Converts Markdown to PDF via LaTeX")
}
System_Ext(web, "Public Web", "")
System_Ext(langfuse, "Langfuse Cloud", "")
Rel(roy, coordinator, "Runs /dossier <company>")
Rel(coordinator, industry, "Spawns via Task tool", "parallel")
Rel(coordinator, competitor, "Spawns via Task tool", "parallel")
Rel(coordinator, pitcher, "Spawns via Task tool", "parallel")
Rel(industry, web, "WebSearch + WebFetch")
Rel(industry, data, "Reads Austin market stats")
Rel(competitor, web, "WebSearch + WebFetch")
Rel(pitcher, scratchpad, "Reads industry.md + competitors.md")
Rel(pitcher, data, "Reads Austin market context")
Rel(industry, scratchpad, "Writes industry.md")
Rel(competitor, scratchpad, "Writes competitors.md")
Rel(pitcher, scratchpad, "Writes pitch.md")
Rel(coordinator, scratchpad, "Reads all, writes final-brief.md")
Rel(coordinator, pandoc, "Runs pandoc CLI")
Rel(coordinator, langfuse, "Traced by claude-langfuse-monitor")
Missing subagents or relationships?
If Claude Code produced fewer than three subagent containers or skipped the data flow relationships, prompt it again with more specifics. Try: "Update c4-container.mmd to include all 3 subagents (Industry Researcher, Competitor Scanner, Pitch Drafter), both data stores (Markdown Scratchpad, Austin Verticals Data), and all Rel() relationships showing which subagent reads and writes to which store."
Why is my C4 Container diagram missing components?
Render both diagrams to SVG
The .mmd files are plain text. To turn them into visual diagrams, you need to render them to SVG using the Mermaid CLI you installed in Step 1.
- In Claude Code, enter this prompt:
Run mmdc to render both .mmd files to SVG in output/diagrams/.
What commands does this run?
Claude Code will run two mmdc commands behind the scenes:
mmdc -i output/diagrams/c4-context.mmd -o output/diagrams/c4-context.svg
mmdc -i output/diagrams/c4-container.mmd -o output/diagrams/c4-container.svg
Each command takes a .mmd source file (-i) and outputs a rendered SVG (-o).
- Confirm the SVG files exist by running:
ls output/diagrams/
You should see four files: c4-context.mmd, c4-context.svg, c4-container.mmd, and c4-container.svg.
- Open c4-context.svg in your browser to verify it renders correctly.
- Open c4-container.svg in your browser to verify all components and relationships are visible.
What should I see?
The Context diagram should show five boxes connected by labeled arrows: Roy, the Dossier System, Public Web, Langfuse Cloud, and Claude Design.
The Container diagram should show a large boundary labeled "Dossier System" containing seven components. Three parallel arrows from the Coordinator to each subagent show the fan-out pattern.
SVG files are empty or mmdc failed?
C4 support in Mermaid is still experimental, so syntax errors can cause silent failures. Open the .mmd file and check that the very first line is C4Context or C4Container with no prefix.
If mmdc throws a "command not found" error, the Mermaid CLI may not be installed globally. Reinstall it by running:
npm install -g @mermaid-js/mermaid-cli
Why are my Mermaid C4 diagrams not rendering to SVG?
Pro tip: keep diagrams focused
Mermaid C4 layout can get unpredictable with too many elements. Keep each diagram under 15 elements for clean rendering. If you need more detail, create a separate C4 Component diagram for a specific container instead of cramming everything into one view.
You now have portfolio-grade architecture diagrams that show exactly how PineappleExpressAI's dossier system works. Next up, you will take the Barton Creek Real Estate Group brief into Claude Design and polish it into a branded visual that is ready to send to prospects.
Polish the Brief in Claude Design
Your C4 architecture diagrams are rendered and saved. The dossier system is fully documented from a technical perspective.
The Pandoc-generated PDF is functional, but it is not something you would email to a prospect. Claude Design turns your Markdown brief into a polished, branded visual that is ready for LinkedIn or a prospect's inbox.
In this step, get ready to:
- Set up PineappleExpressAI's brand identity in Claude Design.
- Create a polished, print-ready visual brief from your Barton Creek research.
- Export the final PDF for prospect distribution.
Open Claude Design and create a PineappleExpressAI brand system
Claude Design has two main areas: a chat interface on the left and a canvas on the right. You describe what you want in the chat, and Claude generates a working design on the canvas. Before creating the brief, you need to set up PineappleExpressAI's visual identity so that every design uses consistent branding.
What is Claude Design?
Claude Design is Anthropic's visual design tool at claude.ai/design. It takes text prompts and produces polished visuals like landing pages, presentations, and print-ready documents. It is included with Pro, Max, Team, and Enterprise plans.
First, gather the brand assets PineappleExpressAI needs. You will use three free resources from the awesome-design collection on GitHub.
- Open coolors.co/generate in a new browser tab.
- Press the spacebar to generate random palettes until you find one with a tropical green, a navy blue, and a warm white.
- Lock each color you like by clicking the lock icon on that color swatch.
- Press the spacebar again to regenerate only the unlocked colors.
- Once you have a 3-5 color palette you are happy with, copy the hex codes (e.g. #2D6A4F, #1B2A4A, #FAF9F6) somewhere you can reference them later.
Pro tip: pick colors that feel right
PineappleExpressAI's brand should feel tropical yet professional. A saturated green paired with a deep navy conveys "tech-forward but approachable." Warm white keeps it clean without feeling sterile.
- Open fonts.google.com in a new tab.
- Search for Inter and note it as your primary typeface.
- Open unsplash.com in another tab.
- Search for pineapple icon or pineapple minimal and download a subtle, clean pineapple image to use as PineappleExpressAI's logo.
Now set up the brand in Claude Design.
- Navigate to claude.ai/design in your browser.
- In the lower-left corner, click the organization name.
- Select your organization, or create a new one called PineappleExpressAI.
- Complete the onboarding flow when prompted.
- When asked to upload brand assets, upload the pineapple image you downloaded from Unsplash.
- If the onboarding asks for color or typography preferences, enter your hex codes from Coolors and specify Inter as the primary font.
What happens after uploading assets?
Claude Design analyzes your uploads and generates a design system. It extracts colors, typography, and layout patterns. Every project you create afterward automatically inherits this brand system. You only need to do this once.
You should see your extracted design system with a color palette, font settings, and any components Claude identified from your assets.
Design system not matching your brand?
If the extracted colors or fonts do not match what you uploaded, click Remix in the upper right corner of the design system view. This opens the chat interface where you can tell Claude to adjust specific colors or swap the font to Inter.
Help me fix my Claude Design brand system.
Prompt Claude Design to create the polished brief
With the brand system in place, every new project automatically uses PineappleExpressAI's colors and fonts. Now you will paste your Barton Creek brief and prompt Claude Design to turn it into a visual one-pager.
- Open scratchpad/final-brief.md in your code editor and copy its entire contents.
- Back in Claude Design, click to create a new project.
- Paste the full Markdown content of your brief into the chat as context.
- After pasting the brief, enter this prompt in the chat:
Create a 1-page AI-Readiness Brief for PineappleExpressAI, an Austin AI advisory.
Audience: Austin SMB founder with $1M-$10M revenue.
Tone: confident, warm, professional.
Layout: single-page, print-ready A4.
Requirements:
- Company name prominent at top with PineappleExpressAI logo
- 3 AI use-case hypotheses as visual cards with icons
- Competitor AI map as a clean table
- Clear CTA for the $3,000 AI Readiness Audit at bottom
- Use the brand colors from my design system
The brief content is in the Markdown I just pasted above.
What does this prompt do?
This prompt tells Claude Design five things: the document type (one-page brief), the audience (SMB founder), the visual style (confident, warm, print-ready), the specific layout requirements (cards, table, CTA), and where to pull content from (the pasted Markdown). The more specific your prompt, the closer the first draft will be to what you want.
Claude generates the design on the canvas to the right of the chat. You should see a branded one-pager with PineappleExpressAI's colors, the three AI use-case hypotheses displayed as visual cards, a competitor table, and the $3,000 audit CTA at the bottom.
Canvas showing a blank or broken layout?
If the canvas is empty or the layout looks broken, try pasting your brief content directly into the chat again and resend the prompt. If you see a "chat upstream error," start a new chat tab within the same project.
Inline comments can occasionally disappear before Claude reads them. If your feedback is not being applied, paste it into the chat instead.
Help me troubleshoot my Claude Design canvas.
Iterate, export, and distribute
The first generation is a starting point. The real value comes from iterating in Claude Design's chat until the brief is print-ready.
- Review the brief on the canvas. Check that all three AI use-case hypotheses are visible and that estimated impacts are included.
- Use the chat to request refinements. Try prompts like:
- "Tighten the spacing so everything fits on one page."
- "Make the CTA section at the bottom more prominent with a colored background."
- "Increase the font size of the company name at the top."
- "Show me 2 alternative layouts for the use-case cards."
Pro tip: use inline comments for precision
Click directly on a specific element on the canvas to leave an inline comment like "make this padding larger" or "use the primary green here." This is faster than describing the location in chat. If a comment disappears before Claude reads it, paste the same feedback into the chat as a workaround.
- Verify the brief fits on exactly one A4 page. If content overflows, ask Claude to reduce spacing or font sizes.
- Check that the brief reads well at 7th-grade reading level. No jargon should appear without a one-sentence definition.
- Click the Export button in the upper right corner of the canvas.
- Select Export as PDF.
- Save the downloaded file to output/briefs/Barton-Creek-Real-Estate-Group-polished.pdf in your project folder.
Open the saved PDF and confirm it looks print-ready. The PineappleExpressAI branding, use-case cards, competitor table, and audit CTA should all be clearly visible on a single page.
What are the other export options?
Claude Design also supports exporting as PPTX (for presentations), standalone HTML, Canva, and direct handoff to Claude Code. For this project, PDF is the right choice because it is the format you email to prospects and share on LinkedIn.
PDF not fitting on one page?
Go back to the Claude Design chat and ask: "Reduce all section spacing by 20% and shrink the competitor table font to fit everything on one A4 page." Re-export after each adjustment until the content fits cleanly.
Help me fit my brief on one page in Claude Design.
This polished PDF is the visual artifact that gets emailed to prospects and pinned on LinkedIn. Combined with the LinkedIn post template from your output/briefs/ folder, you now have a complete prospect distribution package.
Secret mission
Scale Test with Headless Mode
You have validated the dossier system on two companies. But PineappleExpressAI needs to run this across dozens of prospects per week. In this mission, you will run 3 dossiers back-to-back using Claude Code's headless mode, compare the Langfuse traces side-by-side, and identify which subagent is the performance bottleneck.
Before you go
Clean Up Your Resources
Decide whether to keep your resources running, pause them to come back later, or delete them entirely. This project runs entirely locally with a free-tier Langfuse Cloud account, so there are no ongoing costs.
Resources you used:
- Dossier system project directory (all local files including CLAUDE.md, commands, templates, data, scratchpad, and output).
- Pandoc (installed via winget).
- MiKTeX (installed via winget).
- Mermaid CLI (installed globally via npm).
- claude-langfuse-monitor (installed globally via npm).
- Langfuse Cloud account (free tier, 50K units/month).
- Claude Desktop Project (PineappleExpressAI - Dossier System).
Keep everything running
No action needed. Choose this if you are still actively building on the dossier system or plan to run more prospects through it soon.
- Your project directory, templates, and Austin market data stay in place and ready to use.
- The claude-langfuse-monitor process keeps running in the background and traces future /dossier runs automatically.
- Langfuse Cloud free tier has a 30-day retention window, so older traces will expire on their own.
- Pandoc, MiKTeX, and Mermaid CLI remain installed and available for other projects.
Pause - I'll come back to this later
Stop running processes to free up memory, but keep all your files and installed tools in place.
- Stop the Langfuse monitor by pressing Ctrl+C in the terminal where it is running.
- Keep the project directory as-is. Your templates, Austin market data, slash command, and output briefs will all be there when you return.
- Keep Pandoc, MiKTeX, and Mermaid CLI installed. They take up disk space but cost nothing to keep.
- To resume later, restart the monitor with claude-langfuse start and open Claude Code in your project directory.
Delete - I don't want to use this again
Remove all project resources and uninstall the tools you installed during this project.
- Delete the entire dossier system project directory.
- Uninstall the Langfuse monitor by running:
npm uninstall -g claude-langfuse-monitor
- Uninstall the Mermaid CLI by running:
npm uninstall -g @mermaid-js/mermaid-cli
- Uninstall Pandoc by running:
winget uninstall --id JohnMacFarlane.Pandoc
- Uninstall MiKTeX by running:
winget uninstall --id MiKTeX.MiKTeX
- To delete your Langfuse Cloud account, go to langfuse.com, open Settings, and select Delete Account.
- Delete the Claude Desktop Project by opening Claude Desktop, navigating to your PineappleExpressAI - Dossier System project, and removing it.
Mission accomplished
That's a Wrap!
Nice work. You just built PineappleExpressAI's prospect research pipeline. One command, three parallel subagents, and a branded PDF brief that would have taken 2-3 hours to research by hand.
Here's what you learned:
- Built a /dossier slash command that orchestrates 3 parallel subagents via the Task tool, merges their research into a branded 1-page AI-Readiness Brief, and converts it to PDF with Pandoc.
- Validated the system across 2 Austin verticals (real estate and healthcare) using a formal scoring rubric with quality gates for specificity, accuracy, and actionability. Every brief scores 7+ before delivery.
- Set up a full production toolkit around the system: Langfuse tracing for observability, Mermaid C4 diagrams for architecture documentation, a Claude Design polished visual brief, and a LinkedIn post template for distribution.
- Scale-tested across 3 Austin verticals in headless mode, compared Langfuse traces side-by-side, and identified which subagent is the bottleneck.
Ready to quiz yourself?