---
name: deepline-setup
description: Set up, install, authenticate, repair, or resume Deepline in the user's current environment. Use when a user asks to install or set up Deepline, sends this SKILL.md URL, or when Deepline setup is incomplete. Execute the workflow instead of merely explaining it. Skip when a healthy Deepline CLI is already installed and the user wants GTM work; use the installed deepline-gtm skill instead.
---

# Set up Deepline

Execute this setup workflow now. Do not merely summarize these instructions or install this setup skill with a skill manager. State what the commands change, then proceed. Do not ask for extra conversational confirmation; the agent's native command approval is the confirmation boundary.

## 1. Check the environment once

Use one terminal invocation to gather the runtime and existing CLI status:

~~~bash
node --version; npm --version; deepline setup --help
~~~

Do not enforce a Node.js version in advance. Attempt the install and let npm or Deepline report any runtime incompatibility. If Node.js or npm is missing, or installation reports an unsupported runtime, use an existing runtime manager or the platform's trusted package manager to install or activate the current Node.js LTS release, then rerun this check. Keep the harness's native approval boundary for system changes. Do not execute a remote shell installer, change npm's prefix, edit shell profiles, or edit PATH. If the environment cannot provision Node.js safely, report the exact blocker, direct the user to https://nodejs.org/en/download, and resume setup after they install it.

## 2. Use or install the CLI

If **deepline setup --help** succeeds, run:

~~~bash
deepline setup --json
~~~

Otherwise try the first-party global npm install:

~~~bash
npm install -g --no-audit --no-fund --include=optional --allow-scripts=esbuild deepline@latest &&
npm exec --yes --allow-scripts=esbuild --package=deepline@latest -- deepline setup --json
~~~

The npm-exec step deliberately runs the current package even when an old Deepline wrapper appears earlier on PATH.

## 3. Use the project-local fallback for sandbox policy failures

If the global install fails because the global prefix is unwritable, the sandbox denies writes outside the workspace, or managed policy permits project writes but denies global writes, announce the fallback and continue automatically in one unambiguous persistent project folder. Do the same when global setup returns **GLOBAL_CLI_NOT_ON_PATH** or **GLOBAL_CLI_NOT_INSTALLED**; a global executable the user cannot invoke is not a successful installation.

Do not use this fallback for registry, network, integrity, package-not-found, dependency, or lifecycle-script failures. Those are not scope failures; report the error and stop. Handle unsupported-runtime errors through the environment recovery workflow in step 1, then retry the normal install.

Install into **{project}/.deepline/runtime**:

~~~bash
npm install -g --prefix {project}/.deepline/runtime --no-audit --no-fund --include=optional --allow-scripts=esbuild deepline@latest &&
{project}/.deepline/runtime/bin/deepline setup --scope local --json
~~~

On Windows, run the npm-created **{project}/.deepline/runtime/deepline.cmd** shim. Never install into a temporary directory, transient session directory, guessed home folder, or ambiguous Cowork mount.

## 4. Recover by phase

Read the final JSON envelope from **deepline setup --json**. It contains **phases**, **failedPhase**, and an exact **retry.command**. On failure, run **retry.command** once. Setup resumes at the failed phase and keeps completed CLI installation, cleanup, and skill phases.

Do not run **deepline skills**, **deepline doctor**, or other diagnostic commands before setup asks for one. If the same phase fails again and the envelope includes **diagnostic.command**, run that command and explain the failed check.

## 5. Complete browser authorization

Setup always attempts a blocking browser launch first, including in restricted agent environments. Only when that launch explicitly fails does setup return the authorization URL as a clickable fallback.

When **status** is **authorization_pending** and **browserOpenStatus** is **opened**, tell the user to approve the page Deepline opened without repeating or requesting the URL. When **browserOpenStatus** is **failed**, show the exact **authorizationUrl** and ask the user to open it. This human browser action is the only required interaction. Do not request, paste, print, or inspect a Deepline API key.

After approval, run **retry.command**. Bare setup resumes pending authorization automatically.

## 6. Verify and hand off

Setup verifies CLI, skills, auth, workspace, and API state before returning **complete** without launching a separate diagnostic command. Do not claim success for **authorization_pending**.

When setup is complete, report the scope, CLI version, installed agent targets, and workspace without printing secrets. Then tell the user that Deepline is ready through the installed **/deepline-gtm** skill.

The user may not know what Deepline can do or how to write a useful prompt yet. Before asking them to choose, show the complete reusable prompts and explain the workflow pattern each one demonstrates. A sentence containing only the example titles is incomplete. Do not collapse, abbreviate, or paraphrase the prompts, even when the setup JSON already contains them.

Present this walkthrough in the normal response:

## Ready to use /deepline-gtm!

Deepline can take a plain-English GTM outcome from research through enrichment and a usable deliverable. Start with one of these patterns:

1. **Waterfall email lookup**
   `/deepline-gtm Find 5 CTOs in NYC and get their verified work emails.`
   Use this pattern to define the buyer, company or location filters, result count, and enrichment you need.

2. **Signal-based outbound**
   `/deepline-gtm Find 5 leads engaging with Gong's competitors on LinkedIn. Score against CMO or VP of Marketing. Waterfall enrich their emails. Build a sequence-ready list with personalized first lines.`
   Use this pattern to combine a buying signal with qualification, contact enrichment, and an outbound-ready deliverable.

3. **VC portfolio scrape**
   `/deepline-gtm Pull 5 companies from Y Combinator W26. Find the Head of Marketing or VP Sales at each one. Waterfall their emails and write a personalized first line.`
   Use this pattern to start from a public company list, find the right buyers, enrich them, and personalize the output.

If you have usable context about the user, their company, market, customers, or current work, add a fourth example tailored to that context. Make it a simple GTM workflow like the examples above: find a small, specific set of relevant leads, then enrich them with one or two useful contact or company fields. Write the complete prompt beginning with **/deepline-gtm**, give it a short title, and explain the pattern it demonstrates. Keep it concrete and similar in length to the fixed examples. Use only context you actually have; do not invent facts about the user. If the setup request contains no usable context, keep the three fixed examples and invite the user's own problem instead of fabricating a personalized example or adding another setup question.

Choose one of these examples, including the personalized example when present, or describe your GTM or business problem. I will turn it into a ready-to-run **/deepline-gtm** prompt, show you the exact reusable prompt, and run it.

In Claude, use **AskUserQuestion** after this walkthrough to present a single-choice intervention. In another agent harness, an equivalent native choice UI is optional and comes after the walkthrough; never use it as a substitute for showing the full prompts. Use:

- Header: **Get started**
- Question: **Would you like to try one of these examples, or tell me your own business problem?**
- Multi-select: **false**
- Options:
- Label: **Waterfall email lookup**
  Description: **/deepline-gtm Find 5 CTOs in NYC and get their verified work emails.**
- Label: **Signal-based outbound**
  Description: **/deepline-gtm Find 5 leads engaging with Gong's competitors on LinkedIn. Score against CMO or VP of Marketing. Waterfall enrich their emails. Build a sequence-ready list with personalized first lines.**
- Label: **VC portfolio scrape**
  Description: **/deepline-gtm Pull 5 companies from Y Combinator W26. Find the Head of Marketing or VP Sales at each one. Waterfall their emails and write a personalized first line.**
- When a personalized fourth example was generated, append one more option using its short title as the label and its complete **/deepline-gtm** prompt as the description.

Claude's **Other** response is the custom-business-problem path. If the harness has no native choice UI, ask the same question conversationally after showing the walkthrough; the personalized fourth example remains one of the choices when present. Wait for the answer. If the user chooses any fixed or personalized example, show the exact prompt already presented and immediately execute that same prompt with the installed **/deepline-gtm** skill. If the user gives their own business problem, turn it into one concrete prompt beginning with **/deepline-gtm**, show that exact prompt so they learn the reusable format, then immediately execute the same prompt. Do not make the user copy, paste, or resend it.

For a project-local install, operational skills resolve the executable in this order: the Deepline command on PATH, then **{workspace-root}/.deepline/runtime/bin/deepline** (or the Windows npm shim), then this setup flow.
