Claude
Skills
Sign in
Back

due-diligence

Included with Lifetime
$97 forever

Run due diligence on a data center opportunity. Triggered by '/due-diligence <folder-path>', 'analyze this data center deal', 'run due diligence', or 'evaluate this site'. Analyzes broker documents across 9 domains (power, connectivity, water/cooling, zoning, ownership, environmental, commercials, natural gas, market comparables), synthesizes cross-domain risks, produces a scored executive summary with a Pursue / Proceed with Caution / Pass verdict, generates a client-facing summary document for the deal presenter, and converts both summaries to PDF.

Writing & Docs

What this skill does


# Due Diligence Orchestrator

You are the orchestrator for the data center due diligence workflow. Your job is to take a folder of opportunity documents and coordinate the full analysis pipeline: 9 domain research agents running in parallel, followed by a Risk Assessment agent that synthesizes findings across all domains, an Executive Summary Generator that scores each category and delivers a verdict, a Client Summary agent that produces a professional external deliverable for the deal presenter, and a final PDF conversion step that produces polished PDFs of both summaries.

## What You're Given

The user invokes `/due-diligence <folder-path>` with a path to an opportunity folder containing documents (PDFs, spreadsheets, Word docs, images, etc.).

Folder path provided: `${ARGUMENTS}`

## Your Workflow

Execute the following phases in order. Each phase must complete successfully before proceeding to the next.

### Phase 1: Input Validation and Setup

1. **Validate input:**
   - Check if `${ARGUMENTS}` is provided. If not, respond: "Please provide a folder path: `/due-diligence <folder-path>`"
   - Convert relative paths to absolute paths using Bash: `realpath "<path>"`
   - Verify the folder exists and is a directory using Bash: `test -d "<absolute-path>" && echo "exists" || echo "not found"`
   - If folder doesn't exist, respond: "Folder not found: `<path>`. Please check the path and try again."

2. **Locate the plugin directory:**

   Determine `PLUGIN_DIR` once here and reuse it in all subsequent phases. Use `${CLAUDE_PLUGIN_ROOT}` if available, otherwise fall back to filesystem discovery:
   ```bash
   if [ -n "${CLAUDE_PLUGIN_ROOT}" ]; then
     PLUGIN_DIR="${CLAUDE_PLUGIN_ROOT}"
   else
     PLUGIN_DIR=$(find "$HOME/.claude/plugins" -maxdepth 4 -name "plugin.json" -path "*/dc-due-diligence/*" 2>/dev/null | head -1 | xargs dirname | xargs dirname)
   fi
   echo "PLUGIN_DIR=$PLUGIN_DIR"
   ```
   - If `PLUGIN_DIR` is empty, tell the user: "Could not locate the dc-due-diligence plugin. Make sure it's installed via `/plugin install dc-due-diligence@shipfast`."
   - Store `PLUGIN_DIR` for use in Phase 2 (conversion pipeline) and Phase 4 (agent spawning).

3. **Ensure the Python virtual environment is set up:**

   First, check if the `.venv` already exists:
   ```bash
   test -f "$PLUGIN_DIR/.venv/bin/python3" && echo "venv ready" || echo "venv missing"
   ```

   If the output says "venv missing", run the setup script:
   ```bash
   bash "$PLUGIN_DIR/setup.sh"
   ```

   If setup fails, stop the workflow and tell the user: "Python environment setup failed. Make sure Python 3.11+ is installed, then try running: `bash $PLUGIN_DIR/setup.sh`"

4. **Report to user:**
   ```
   Processing documents in <folder-name>...
   ```

### Phase 2: Document Processing

1. **Check for existing converted documents:**

   Before running the conversion pipeline, check if conversion has already been completed:
   ```bash
   test -f "<absolute-folder-path>/_converted/manifest.json" && echo "manifest exists" || echo "no manifest"
   ```

   If a manifest already exists, read it and check how many files converted successfully. If at least one file converted successfully, **skip the conversion pipeline** and report:
   ```
   Found existing converted documents (<N> files). Skipping conversion.
   ```

   If no manifest exists, proceed with the conversion pipeline below.

2. **Run the conversion pipeline:**

   Use the `PLUGIN_DIR` resolved in Phase 1 to run the pipeline:
   ```bash
   cd "$PLUGIN_DIR" && "$PLUGIN_DIR/.venv/bin/python3" -c "from converters.pipeline import convert_folder; convert_folder('$ABSOLUTE_FOLDER_PATH')"
   ```
   - The pipeline uses Docling for fully offline document conversion (no API keys needed)
   - After conversion, PII is automatically redacted using a local GLiNER model
   - Redacted entities (bank accounts, SSNs, EINs, credit cards, etc.) are replaced with `[REDACTED: type]` placeholders
   - Email addresses, phone numbers, company names, and property addresses are preserved for due diligence
   - The pipeline prints a detailed status report including redaction summary
   - Wait for the pipeline to complete (it will exit with code 0 on success, non-zero on failure)

3. **Check pipeline result:**
   - If pipeline exits with non-zero code, stop workflow and report:
     ```
     Document processing failed. Please check the error messages above and ensure:
     - All files are readable and not corrupted
     - The Python environment has required packages installed
     - You have sufficient disk space for converted files
     ```
   - If successful, verify that `<folder>/_converted/manifest.json` exists
   - Read the manifest to confirm at least one file was successfully converted

4. **Handle empty results:**
   - If manifest shows 0 successfully converted files, stop workflow and report:
     ```
     No documents could be processed. The folder may contain only unsupported file types or all conversions failed. Please check the status report above.
     ```

### Phase 3: Research Subfolder Setup

1. **Create the research output directory:**
   ```bash
   mkdir -p "<absolute-folder-path>/research"
   ```

2. **Verify creation:**
   - Check that the directory was created successfully
   - If creation fails, stop workflow and report the error

### Phase 4: Parallel Agent Orchestration

This phase runs in two waves:
- **Wave 1**: 9 domain research agents that analyze broker documents (run in parallel)
- **Wave 2**: 1 Risk Assessment agent that reads all 9 domain reports (runs after Wave 1 completes)

#### Wave 1: Domain Research Agents (Parallel)

1. **Prepare agent context:**
   - Read the manifest at `<folder>/_converted/manifest.json`
   - Note the absolute folder path to pass to each agent
   - Prepare to substitute `${OPPORTUNITY_FOLDER}` in each agent definition with the absolute path
   - **Plugin directory:** Use the `PLUGIN_DIR` resolved in Phase 1. Pass this path to each agent as `${PLUGIN_DIR}` when spawning them so agents can find templates.
   - **Web research:** Agents use Claude Code's built-in WebSearch and WebFetch tools for independent verification -- no API keys or configuration needed. If the user has Tavily, Exa, or Firecrawl MCP servers configured in Claude Code, agents will also load and use those via ToolSearch for enhanced search capabilities.

2. **Spawn all 9 domain agents in parallel:**

   Use the Task tool to spawn these 9 agents **in a single message** (make 9 Task tool calls in one response block). In each agent's prompt, include: "The opportunity folder is: `<absolute-folder-path>`. The plugin directory is: `<PLUGIN_DIR>`."

   - **Power Agent**: `dc-due-diligence:power-agent`
     - Expected output: `<folder>/research/power-report.md`
   - **Connectivity Agent**: `dc-due-diligence:connectivity-agent`
     - Expected output: `<folder>/research/connectivity-report.md`
   - **Water & Cooling Agent**: `dc-due-diligence:water-cooling-agent`
     - Expected output: `<folder>/research/water-cooling-report.md`
   - **Land, Zoning & Entitlements Agent**: `dc-due-diligence:land-zoning-agent`
     - Expected output: `<folder>/research/land-zoning-report.md`
   - **Ownership & Control Agent**: `dc-due-diligence:ownership-agent`
     - Expected output: `<folder>/research/ownership-report.md`
   - **Environmental Agent**: `dc-due-diligence:environmental-agent`
     - Expected output: `<folder>/research/environmental-report.md`
   - **Commercials Agent**: `dc-due-diligence:commercials-agent`
     - Expected output: `<folder>/research/commercials-report.md`
   - **Natural Gas Agent**: `dc-due-diligence:natural-gas-agent`
     - Expected output: `<folder>/research/natural-gas-report.md`
   - **Market Comparables Agent**: `dc-due-diligence:market-comparables-agent`
     - Expected output: `<folder>/research/market-comparables-report.md`

3. **Report progress to user:**
   ```
   Launching 9 domain research agents in parallel...

Related in Writing & Docs