# Naïve — Recruiting Agent Onboarding (skill.md)

> Connect your ATS and calendar, build a live candidate pipeline, and let the agent source, screen, and run personalized outreach with interview scheduling on its own inbox.

## Start here — read the base manifest first

This is a **use-case-specific** skill. It builds on Naïve's general agent onboarding manifest. Before doing anything below, read the base manifest and follow its operating rules (authenticate *with* the user, clarify scope, gate real-world/spending actions, respect budgets, be idempotent):

- **Base onboarding manifest:** https://usenaive.ai/skill.md

Do the base manifest's onboarding first (authenticate the user, install the CLI/SDK, verify connectivity). Then return here and layer this use-case on top.

## What you're building

A **recruiting agent**: a database + a web-deployed dashboard, plus a governed `recruiter` agent profile running on a Naïve runtime. Declare all of it as code in `naive.config.ts` and provision it with `naive up`.

## Step 1 — ask the user (discovery)

Before provisioning anything, ask the user these and confirm the answers:

- Which ATS do you use, and should the agent write back into it or run its own pipeline?
- Which roles are open right now, and what are the must-haves vs. nice-to-haves for each?
- What tone and cadence should outreach use, and from which domain/identity should it send?
- Whose calendars should interviews be booked against, and what interview stages exist?
- What compliance rules apply (EEO, data retention, regions to include/exclude)?

## Step 2 — connect their existing systems

Use the `connections` primitive (autonomous OAuth) and the `vault` (per-tenant encrypted credential storage) to wire up what the user already runs on. Only connect what they confirmed in Step 1.

- ATS — Greenhouse, Lever, Ashby, Workable
- Sourcing surfaces — LinkedIn, job boards, and the open web (via the cloud browser)
- Calendar & email — Google/Microsoft calendar and the agent's own outreach inbox
- Enrichment — profile and contact enrichment providers

```bash
naive connections connect <service>     # OAuth into an existing system
naive vault put <service>.api_key <key> # store any keys the user pastes
```

## Step 3 — declare the database + web app + agent (naive.config.ts)

Scaffold with `naive init`, then adapt the config below. It declares a managed Postgres database, a Vercel-hosted Next.js dashboard, object storage, a hosted runtime pool, and the governed agent-profile template — then `naive up` provisions all of it (idempotent; shows a diff).

**What goes in the config:**
- `infrastructure.web` — the web-deployed dashboard (Next.js on Vercel).
- `infrastructure.database` — managed Postgres for the app's normalized data store.
- `infrastructure.documents`/`storage` — object storage for files the agent handles.
- `runtime.pool` — a hosted microVM pool the recruiter agent runs on (or omit for bring-your-own-runtime).
- `agentProfiles.recruiter` — the governed profile (identity + comms + `policy` with an allow-list, a spend cap, and human approvals on real-world/money actions).

```ts
import { defineConfig, cloud, agentTemplate, policy, runtime } from "@usenaive-sdk/iac";

export default defineConfig({
  project: "recruiting-agent",

  // Path A — the pipeline dashboard + candidate store, hosted by Naïve.
  infrastructure: {
    web: cloud.web({ framework: "nextjs", dir: "." }),           // candidate pipeline dashboard (Vercel)
    database: cloud.postgres({ name: "candidates", size: "serverless" }),
    resumes: cloud.bucket({ name: "recruiting-resumes" }),
  },

  // Path B — a hosted runtime for the sourcing/outreach agent.
  runtime: {
    pool: runtime.pool({ name: "sourcing", size: "small" }),
  },

  // The governed agent profile the recruiter runs as.
  agentProfiles: {
    recruiter: agentTemplate({
      identity: { kind: "business", verify: "kyb" },
      comms: { email: { domain: "per-tenant" }, phone: { sms: true } }, // outreach inbox + SMS
      policy: policy({
        allow: ["connections", "browser", "email", "phone", "llm", "search", "vault", "apps"],
        budget: { cap: "$75/mo", alertAt: 0.8, hard: true },
        approvals: [
          { when: "email.sequence.start", via: "email" },        // approve outreach before it sends
          { when: "phone.provision", via: "email" },
        ],
      }),
    }),
  },
});
```

Then provision it:
```bash
naive up                                              # plan + apply everything above
naive agent-profiles provision recruiter --user <tenant-id>   # one per tenant/customer
```

## Step 4 — primitives this agent uses

The `recruiter` profile's `policy.allow` should grant exactly these — nothing more (least privilege):

- connections (OAuth into ATS + calendar)
- browser (source candidates and enrich profiles autonomously)
- email + phone (custom-domain outreach + SMS follow-ups)
- llm (screening, ranking, message drafting)
- search (open-web sourcing and enrichment)
- vault (store ATS + provider credentials per tenant)
- apps + database + storage (dashboard, candidate store, resumes)
- cron (daily sourcing + follow-up sweeps)

## Step 5 — build the dashboard + data model

Use the provisioned Postgres + web app to build:

- A web-deployed candidate pipeline dashboard — stages, scorecards, and outreach status per role
- A Postgres candidate store normalizing profiles, roles, and interactions across every source
- Resume/attachment storage tied to each candidate record

## Step 6 — automate the ongoing work

Wire the recurring work to `cron` jobs that run the agent on the runtime pool. Keep every money-movement or irreversible action behind an approval (see the `policy.approvals` in the config).

- Sourcing — find and rank candidates against each open role's rubric
- Screening — summarize profiles, score against must-haves, and shortlist
- Outreach — personalized multi-step email/SMS sequences from a custom-domain inbox
- Scheduling — propose times against your calendar and book interviews automatically

```bash
naive cron create --name "monthly-run" --schedule "0 9 1 * *" --task "<what the agent should do>"
```

## Reference

- Base onboarding manifest: https://usenaive.ai/skill.md
- Infrastructure as Code: https://usenaive.ai/docs/getting-started/iac
- Connections (OAuth): https://usenaive.ai/docs/api-reference/overview
- CLI reference: https://usenaive.ai/docs/cli/overview
- SDK reference: https://usenaive.ai/docs/sdk/overview
- All templates: https://usenaive.ai/templates
