---
name: plan2scale
description: Use when a user wants to resize, enlarge, shrink, fit, tile, crop, or print an architectural, landscape, survey, or site plan PDF at a chosen paper size or physical scale.
compatibility: Requires local PDF access, Windows PowerShell 7+, and a Plan2Scale desktop build with the plan2scale-cli-v1 capability marker.
---

# Plan2Scale skill

Use Plan2Scale to create a new, print-ready PDF from a plan PDF. The original stays untouched. Processing happens on the user's Windows computer; never upload the plan to a website, cloud service, or remote agent.

## Check access before starting

1. Confirm that the current environment can access the user's PDF locally and can run Windows PowerShell 7 or later. If the agent is remote or cannot access the user's files, explain that and ask the user to run the desktop app locally.
2. Locate the installed `Plan2Scale.exe`. Do not search the whole drive. If its location is not already known and it is not on `PATH`, ask the user where they installed it.
3. Confirm the build supports this skill by checking for this file beside the installed app's `resources` folder:

   `resources\app\packages\desktop\cli-capability.txt`

   Its contents must be exactly `plan2scale-cli-v1`. If the file is missing or different, do not pass CLI flags to that app; an older build may open its graphical window instead. Tell the user to use the desktop interface or install a compatible release.

4. Check the PDF exists and is a `.pdf`. Do not convert CAD, image, or Word files without the user's request.

## Understand the requested result

- Distinguish the **source scale** (what the plan is now) from the **target scale** (what the user wants printed).
- Ask for the missing choice when it affects the result: target scale, paper, orientation, one-sheet fit versus exact-scale tiling, page selection, or whether to crop.
- A filename or detected title-block scale is only a clue. If the scale is absent, low-confidence, or contradictory, ask the user to confirm the source scale. Never invent or silently assume it.
- If the user only wants the whole plan on one sheet and has no target scale, explain that fit-to-sheet changes the scale, then use the largest available fit option only after the user agrees.

## Run safely

Use PowerShell 7's `ProcessStartInfo.ArgumentList` so paths with spaces remain separate arguments. Create a unique JSON receipt path under the user's temporary folder; it must not already exist. Pass `--cli-result` before or after the PDF arguments. For example:

```powershell
$exe = 'C:\path\to\Plan2Scale.exe'
$pdf = 'C:\path\to\plan.pdf'
function Invoke-Plan2Scale([string[]] $CliArgs) {
  $receipt = Join-Path $env:TEMP ('plan2scale-' + [guid]::NewGuid().ToString('N') + '.json')
  $psi = [System.Diagnostics.ProcessStartInfo]::new()
  $psi.FileName = $exe
  $psi.UseShellExecute = $false
  foreach ($arg in (@('--cli', '--cli-result', $receipt) + $CliArgs)) {
    [void]$psi.ArgumentList.Add($arg)
  }
  try {
    $process = [System.Diagnostics.Process]::Start($psi)
    $process.WaitForExit()
    if (-not (Test-Path -LiteralPath $receipt)) {
      throw "Plan2Scale did not write its receipt (exit $($process.ExitCode)). Do not retry against an unverified build."
    }
    $result = Get-Content -LiteralPath $receipt -Raw | ConvertFrom-Json
    if ($result.protocol -ne 'plan2scale-cli-v1') { throw 'Unexpected Plan2Scale result protocol.' }
    if ($process.ExitCode -ne 0 -or -not $result.ok) { throw ($result.lines -join "`n") }
    return $result
  } finally {
    if (Test-Path -LiteralPath $receipt) { Remove-Item -LiteralPath $receipt }
  }
}
$dryRun = Invoke-Plan2Scale -CliArgs @($pdf, '--dry-run')
$dryRun.lines
```

Start with `--dry-run`. It exports nothing and reports candidate print options. Show the options to the user when a choice remains. Once the user has confirmed the scale and output choice, make a new output folder and pass it with `--out`. Never reuse or overwrite an existing output folder without checking with the user.

For an agreed exact-scale job, continue with the same helper and a fresh output folder. This example assumes the user confirmed a 1:250 source, 1:100 target, A1 paper, and tiling after the dry run. Include `--tile` only when the user chose tiling or the dry-run calls for it; use `--crop` only on the user's instruction:

```powershell
$outDir = Join-Path (Split-Path -Parent $pdf) ('plan2scale-output-' + [guid]::NewGuid().ToString('N'))
if (Test-Path -LiteralPath $outDir) { throw 'Choose a fresh output folder.' }
$result = Invoke-Plan2Scale -CliArgs @($pdf, '--source-scale', '1:250', '--scale', '1:100', '--paper', 'A1', '--tile', '--out', $outDir)
$result.lines
```

Examples (substitute the full app path, PDF path, receipt path, and output folder):

```text
Plan2Scale.exe --cli --cli-result <new receipt.json> <plan.pdf> --dry-run
Plan2Scale.exe --cli --cli-result <new receipt.json> <plan.pdf> --source-scale 1:250 --scale 1:100 --paper A1 --tile --out <new output folder>
Plan2Scale.exe --cli --cli-result <new receipt.json> <plan-set.pdf> --all-pages --source-scale 1:250 --scale 1:50 --paper A1 --tile --out <new output folder>
```

## CLI options

```text
--page N             page to print (1-based; default 1)
--all-pages          treat the PDF as a plan set and export every page
--source-scale 1:250 current plan scale; skips scale detection
--scale 1:100        wanted physical scale
--percentage 150     enlarge or reduce by percent
--calibrate-known 5m correct scale drift using a labelled distance
--fit                fit the whole plan to one sheet (default when no --scale)
--paper A3           standard paper size (default A3)
--orientation best|landscape|portrait
--margin 5           printer-safe edge in mm
--overlap 5          tile join overlap in mm
--tile | --crop      force tiling or cropping at the wanted scale
--out DIR            output folder; default is plan2scale-output beside the PDF
                     (env P2S_OUT_DIR overrides the default for automated runs)
--dry-run            show options and export nothing
--no-proof-line      omit the 100 mm check line (only if the user asks)
--no-footer          omit the footer (only if the user asks)
--footer-text TEXT   replace default footer wording
--help               print CLI help
```

The app's headless wrapper also accepts `--cli-result <absolute-path>`. That path must be new. The JSON receipt includes `protocol`, `ok`, `lines`, and any structured run details such as `options`, `outputPath`, `pageCount`, and `detectedScale`. Check the `ok` value and the process exit code; do not report success if either indicates failure.

## Rules for correct, useful output

- Keep the 100 mm proof line unless the user explicitly asks to omit it. Tell the user to print at Actual Size (100%) and measure the line with a ruler.
- Use the actual target scale and paper from the receipt. Never claim exact scale from a fit-to-sheet result when the scale adjusts to fit.
- For multiple pages, use `--all-pages` only when the user wants every page processed as one plan set. Mixed or contradictory scales need the user's direction.
- Keep the default sheet footer (the scale stamp) unless the user asks to change or omit it (`--footer-text`, `--no-footer`); if you do, say so plainly. Never pass `--trial-brand` — that is the free web trial's ad stamp, not a desktop option.
- Report the exact scale, paper size, sheet count, output folder, and any warnings from `lines`. Keep the receipt lines so the user can verify the printout.
- If the CLI is unavailable, the source scale is uncertain, the PDF is protected or damaged, or the output folder already contains files, stop and explain the next safe step.

## References

- Agent page and setup: https://plan2scale.app/agents
- Download: https://plan2scale.app/download
- Privacy: https://plan2scale.app/privacy
- Support: https://plan2scale.app/support
