[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71DZW43N6CZNT6M93BDZX96":3,"skill-same:01M71DZW43N6CZNT6M93BDZX96":73},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M71DZW43N6CZNT6M93BDZX96","newcompany",null,"Scaffold a new HQ company, optionally through to operational: knowledge, workers, brand, integrations, access rules, and invites.","indigoai-us\u002Fhq-core","indigoai-us","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F122242446?v=4","01M71DTQ5NGD10GT1Z7E6XKWC5","HQ","01M71DTQ6BKSYYBNC9RAKT3YDK",95,"MIT","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fnewcompany\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"edit","scaffold","board","operational","id","workers","Rules","core","integrations","brand","write","read","scripts","Bash","access","new","knowledge","company","project","2026-11-10 10:12:30",false,"---\nname: newcompany\ndescription: \"Scaffold a new HQ company, optionally through to operational: knowledge, workers, brand, integrations, access rules, and invites.\"\nallowed-tools: Read, Write, Edit, Bash, AskUserQuestion, Bash(bash core\u002Fscripts\u002Fboard-project-id.sh:*)\n---\n\n# \u002Fnewcompany — Company Scaffolding → Operational Setup\n\nCreate a new company. **Phase 0 (scaffold) always runs and yields a working local\ncompany in seconds.** Everything after Phase 0 is an optional, skippable, fail-soft\nguided path that takes the company from \"empty folder\" to \"operational\" — populated\nknowledge\u002Fworkers\u002Fskills\u002Fprojects, connected tools, an org model with streamlined ACL\nrules, invited teammates, and (optionally) cloud agents.\n\n**Args:** $ARGUMENTS\n\n## Operating principles\n\n- **Fail-soft after Phase 0.** Reaching a working company never depends on any later\n  phase. Each phase is independently skippable; skipped items roll into the closing\n  \"finish later\" checklist (Phase 9).\n- **One question at a time.** Use `AskUserQuestion` per decision (policy\n  `decision-queue-one-at-a-time`). Offer a \"skip\"\u002F\"not now\" choice on every optional phase.\n- **Tenant isolation.** Every `hq` call is company-scoped with `--company {slug}`.\n- **Reuse, don't reinvent.** This skill orchestrates existing primitives\n  (`\u002Fdesignate-team`, `\u002Fnewworker`, `\u002Fidea`, `\u002Fprd`, `hq groups`, `hq secrets`,\n  `hq files`, `hq members invite`, cloud-agent provisioning). It adds the interview + the\n  tool-classification logic, nothing more.\n- **Secret hygiene.** Never collect a raw credential in chat. Mint a submission link\n  (`hq secrets generate-link`) and render it ONLY as a Markdown inline link at mint time\n  (policies `hq-share-session-urls-are-capabilities`, `hq-secure-link-render-as-markdown`).\n\n---\n\n## Phase 0 — Scaffold (ALWAYS runs)\n\n### 0.1 Get Company Slug\n\nIf no args, ask: \"Company slug (lowercase, hyphens only)?\"\nValidate: no spaces, lowercase only, hyphens allowed, doesn't already exist in `companies\u002Fmanifest.yaml`.\n\n### 0.2 Basics (batch)\n\nAsk (batch is fine here — these are simple facts):\n1. Company name (human-readable)?\n2. GitHub org? (or \"none\")\n3. Existing repos to associate? (paths or \"none\")\n4. Existing workers to assign? (or \"none\")\n\n(Credentials are NOT collected here — Phase 4 handles them properly via minted links.)\n\n### 0.3 Scaffold Directory\n\n```bash\n# The default-off HQ flag keeps the existing local scaffold. When enabled, bootstrap\n# the cloud company first, pull the shared seed, then render only machine-local paths.\nHQ_CLI_BIN=\"$(command -v hq)\" node core\u002Fscripts\u002Fnewcompany-bootstrap.cjs \"{slug}\" \"{Name}\" \"companies\u002F{slug}\" \"$PWD\"\n# Obsidian preferences stay on this machine and are not part of the company seed.\n[ -e companies\u002F_template\u002F.obsidian ] && cp -rL companies\u002F_template\u002F.obsidian \"companies\u002F{slug}\u002F.obsidian\"\n```\n\nThe bootstrap prints exactly one mode line after it completes:\n`newcompany mode: cloud-first` or `newcompany mode: newcompany`. Use that output\nas the mode for the rest of this run; do not read the flag again. In cloud-first mode,\n`hq onboard create-company` provisions the entity, bucket,\nowner membership, verifies STS access, and writes `.hq\u002Fconfig.json` before the\nshared company seed is pulled. The renderer then writes only `newcompany_only`\npaths, so cloud-owned seed files are not overwritten.\n\nThe `workspace\u002F` directory is the per-company audit trail of HQ sessions that touch this\ncompany. Sessions are hardlinked here from `workspace\u002Fthreads\u002F` by the mirror hook\n(`mirror-thread-to-company.sh`); `index.jsonl` is committed, individual session JSONs are gitignored.\n\n`company.yaml` is the HQ Desktop App \u002F cloud-state marker. Local mode preserves the\nexisting `cloud: false` scaffold. Cloud-first mode writes `cloud: true` after onboarding\nhas provisioned the company. The server seed never writes this per-machine file.\n\n### 0.4 Create Knowledge Directory\n\nScaffold `companies\u002F{slug}\u002Fknowledge\u002F` as a **plain real directory**. Company\nfolders sync to every member's devices, so company knowledge must never contain\nGit metadata and must never be a symlink into `repos\u002F`.\n\n```bash\nmkdir -p companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\n# Run this legacy README write only when the bootstrap did not report cloud-first.\ncat > companies\u002F{slug}\u002Fknowledge\u002FREADME.md \u003C\u003C'EOF'\n# {Name} Knowledge\n\nCompany reference material synced through the company vault.\nEOF\n```\n\nWhen the bootstrap reports cloud-first, skip only the README write above because\nthat shared file was pulled from the cloud. The local path continues to use the\nsame README content as before.\n\nVerify (must pass before continuing):\n\n```bash\ntest -d companies\u002F{slug}\u002Fknowledge && ! test -L companies\u002F{slug}\u002Fknowledge \\\n  && echo \"OK: knowledge is a plain real directory\"\n```\n\nKeep this as a plain directory. Never initialize Git inside it, move it under\n`repos\u002F`, or replace it with a symlink.\n\nThe `design-styles\u002Fpacks\u002F` subdir is where company-scoped brand packs live.\n\n### 0.5 Update Registries\n\n**manifest.yaml**: Add entry with ALL fields populated (no nulls):\n```yaml\n{slug}:\n  prefix: {auto-computed}\n  github_org: {org or omit}\n  repos: [{repo paths or empty array}]\n  settings: [{setting names or empty array}]\n  knowledge: companies\u002F{slug}\u002Fknowledge\u002F # plain directory, synced with the company\n  deploy: []\n  vercel_projects: []\n  qmd_collections: [{slug}]\n```\n\n> Company workers are discovered automatically from `worker.company:` inside each\n> `companies\u002F{slug}\u002Fworkers\u002F*\u002Fworker.yaml`. No `workers:` array in the manifest —\n> `core\u002Fworkers\u002Fregistry.yaml` is the regenerated index.\n\n**Compute `prefix`** before writing the entry:\n1. Strip hyphens from `{slug}`, lowercase, take first 3 chars (e.g. `acme-corp` → `acm`).\n2. Read existing prefixes: `python3 -c \"import yaml; d=yaml.safe_load(open('companies\u002Fmanifest.yaml')); print('\\n'.join(v.get('prefix','') for v in d['companies'].values()))\"`.\n3. If your candidate collides, fall back to first 4 chars (no hyphens). If still collides, append `-2`, `-3`, ….\n4. Surface the chosen prefix in the final report.\n5. Reindex uses this prefix to surface company skills as generated, namespaced\n   runtime wrappers. Never write those wrappers directly.\n\n### 0.6 qmd Collection\n\n```bash\nqmd collection add companies\u002F{slug}\u002Fknowledge --name {slug} --mask \"**\u002F*.md\"\nqmd update 2>\u002Fdev\u002Fnull || true\n```\n\n### 0.7 Company Details + Companies List\n\n- Write `companies\u002F{slug}\u002Fcompany-details.md` with the display name, GitHub org,\n  associated repos, and workers from Phase 0.2. The shared `README.md` is rendered\n  from the seed template and stays unchanged; Phase 1 records the business purpose\n  after discovery.\n- If CLAUDE.md `## Companies` line doesn't include the new slug, update it.\n\n**Checkpoint — the company now works locally.** Announce it, then offer the operational\npath: \"Want me to set **{Name}** up the rest of the way — learn your business, seed\nknowledge, model your team, and connect your tools? (You can stop at any step.)\" If they\ndecline, jump to Phase 9 (finish + report).\n\n---\n\n## Phase 1 — Business Discovery (NEW, optional)\n\nThe interview that drives every downstream phase. One question at a time\n(`AskUserQuestion`), pattern adapted from `\u002Fpersonal-interview`. Keep it tight (~6–8 Qs);\ntake a position on vague answers, don't flatter.\n\nAsk, in order:\n1. **What does {Name} do?** One-paragraph description of the business + stage\u002Fsize.\n2. **Departments \u002F functions.** Which functions exist or matter (e.g. sales, marketing,\n   product\u002Feng, finance, ops, support, HR)? Offer multi-select + free text.\n3. **Source-of-truth tool per function.** For each named function, what tool is the\n   system of record (e.g. Sales→HubSpot\u002FSalesforce, Finance→QuickBooks\u002FStripe,\n   Eng→GitHub, Docs→Notion\u002FGoogle Drive, Comms→Slack)?\n4. **Top priorities.** The 2–3 things they most want HQ to help with first.\n5. **Existing knowledge\u002Fassets.** Website, brand docs, existing wikis, repos.\n6. **Team.** Who's on the team (names\u002Femails) and rough roles\u002Fgroupings.\n\n**Write the results** (so downstream phases + future sessions can use them):\n- `companies\u002F{slug}\u002Fknowledge\u002Fcompany-info.md` — frontmatter (`type: overview`,\n  `domain: [operations]`, `status: canonical`, `tags: [company-info, {slug}]`,\n  `generated_at: \u003CISO>`, `source: newcompany`) + the business description, functions,\n  priorities. Follow `core\u002Fknowledge\u002Fpublic\u002Fhq-core\u002Fknowledge-taxonomy.md`.\n- `companies\u002F{slug}\u002Fdata\u002Fbusiness-model.json` — machine-readable:\n  `{ domain, functions:[{name, sourceOfTruthTool}], priorities:[], team:[{name,email,role,group}] }`.\n  Phases 2–7 read this.\n\nSkip → company stays scaffold-only; later phases that need this prompt for it inline.\n\n---\n\n## Phase 2 — Seed Knowledge \u002F Projects (NEW, optional)\n\nFrom Phase 1, populate the folder so it isn't empty:\n\n- **Knowledge:** create taxonomy subdirs only for functions that have content\n  (threshold rule: a subdir per domain with ≥1 doc). Seed e.g.\n  `knowledge\u002Fmarket\u002Fcompetitive-landscape.md`, `knowledge\u002Foperations\u002Fworkflows.md`,\n  `knowledge\u002F\u003Cfunction>\u002Foverview.md` from the interview — each with standard frontmatter.\n  Keep seeds short and clearly marked `status: draft` where synthesized.\n- **Projects:** for each stated priority, create a board idea via the `\u002Fidea` shape\n  (append to `companies\u002F{slug}\u002Fboard.json`, `status: idea`, id from\n  `bash core\u002Fscripts\u002Fboard-project-id.sh next {slug} --prefix {prefix}`; run\n  `bash core\u002Fscripts\u002Fboard-project-id.sh check {slug}` after the last append).\n  Offer to `\u002Fprd` the top one into a full PRD (skippable — that's a heavier flow).\n\nSkip → leave knowledge\u002Fprojects empty (still valid).\n\n---\n\n## Phase 2.5 — Brand & Design Packs (NEW, optional)\n\nTurn the company's existing brand into one or more **design packs** so every downstream\nsurface (deploy reports, landing pages, decks, project summaries, worker-generated UI)\nships on-brand from day one. Governing policies: `hq-company-brand-pack-location`,\n`hq-bind-company-brand-pack-as-deploy-default`, `hq-worker-dynamic-context-company-packs`.\n\n### 2.5.1 Pick the brand source\n\nAsk (`AskUserQuestion`): \"Where's the best source to learn {Name}'s brand from?\"\n- **Website** — ask for the URL; fetch key pages, extract palette, type, spacing, voice,\n  imagery style from live CSS + rendered pages.\n- **Brand guide PDF** — ask for the file path (or drop path `companies\u002F{slug}\u002Fdata\u002Fimports\u002F`);\n  read via the pdf skill and extract the codified system.\n- **Google Drive \u002F Notion \u002F Figma doc** — ask for a link or an export; if not directly\n  readable, give export instructions + the drop path and record a finish-later task.\n- **Existing repo** — point at a repo with a `design.md` \u002F tokens \u002F component library and\n  extract from source.\n- **No brand yet** — offer to synthesize a starter brand from the Phase 1 business\n  description (industry, audience, positioning), clearly marked `status: draft`.\n- **Skip** — no packs; note \"run brand-pack creation later\" in the finish checklist.\n\nIf the source is only partially readable (e.g. Drive link without access), fail soft:\nextract what you can, record the gap as a finish-later task. Never block the phase.\n\n### 2.5.2 Decide pack count\n\nDefault is **one** brand pack (`{slug}-brand`). Offer more only when the interview or\nsource reveals genuinely distinct visual systems (e.g. separate product brands, or a\n\"marketing\" vs \"internal docs\" split). One pack per distinct system, each with its own id.\n\n### 2.5.3 Build each pack\n\nCreate `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F{pack-id}\u002F` with the five required\nfiles (schema: `core\u002Fknowledge\u002Fpublic\u002Fdesign-styles\u002FPACK-SCHEMA.md`; reference example:\nany existing pack under `companies\u002F{co}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F`):\n\n- `pack.yaml` — `type: brand`, `scope` implied company; fill `aesthetic`, `origin`\n  (cite the source used), `contents`, `compatibility`, `context_paths` (required:\n  `implementation.md`, `design-tokens.css`).\n- `style-guide.md` — the visual reference: palette with hex values, type roles, spacing,\n  imagery\u002Fvoice notes extracted from the source.\n- `implementation.md` — code-level system: component patterns, layout rules, do\u002Fdon't.\n- `design-tokens.css` — CSS custom properties.\n- `design-tokens.json` — same tokens in DTCG format.\n\nNEVER place company packs under `knowledge\u002Fpublic\u002Fdesign-styles\u002Fpacks\u002F` — that's shared\npacks only.\n\n### 2.5.4 Register the pack\n\nRegistry entry fields: `type: brand`, `status: active`, `scope: company`,\n`company: {slug}`, `path: companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F{pack-id}\u002F`,\nplus the one-line `aesthetic`. Consumers reference packs by `id` only — the\nregistry resolves the path.\n\nWhere to write it depends on the layout: if `core\u002Fknowledge\u002Fpublic\u002Fdesign-styles`\nis a real HQ-tracked directory (`! test -L`), add the entry to its\n`registry.yaml`. If it is a package contribution mounted from `core\u002Fpackages\u002F`\n(installed via `hq install @indigoai-us\u002Fhq-pack-design-styles`), that content is\nimmutable — never edit through the mount. Write the entry to the company scope\ninstead: `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fregistry.yaml` (create it if\nmissing); company brand packs under `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F`\nauto-load when the company is bound, and resolution merges company entries over\nthe shared registry.\n\n### 2.5.5 Wire packs to use cases via policies\n\nAsk which surfaces should default to the pack (multi-select; pre-select deploy):\n- **Deploy artifacts** (reports, dashboards, share pages) — write a company-scoped\n  **hard** policy at `companies\u002F{slug}\u002Fpolicies\u002F{slug}-deploy-report-brand-pack.md`\n  binding the pack path as the `\u002Fdeploy` default (pattern:\n  `hq-bind-company-brand-pack-as-deploy-default`). The global\n  Midnight Editorial default already cedes to a bound company pack — no core edits.\n- **Marketing \u002F landing pages** — extend the same policy (or a sibling) to cover\n  landing-page and public-site artifacts, naming the marketing pack if distinct.\n- **Repos** — for each associated repo that ships UI, offer to add\u002Fupdate the repo's\n  `design.md` with `style-pack: {pack-id}`.\n- **Project summaries \u002F decks** — note in the policy that `\u002Fproject-summary` and deck\n  artifacts use the pack.\n\nOne policy file per pack-binding decision, company-scoped, standard policy frontmatter\n(`scope: company`, `enforcement: hard`, `when: deploy || design`, `on: [PreToolUse, UserPromptSubmit, AssistantIntent]`). The write hook requires `on:`; omitting it blocks the first policy write.\n\nSkip → no packs; deploy artifacts fall back to HQ Midnight Editorial.\n\n---\n\n## Phase 3 — Synthesize Workers + Skills (NEW, optional)\n\nCluster the functions\u002Fworkflows from Phase 1 into proposed workers, reusing the\n`import-context` cluster pattern + `\u002Fnewworker`:\n\n1. Propose 1 worker per high-value function (e.g. a \"growth\" worker, a \"finance-reporting\"\n   worker). Present the proposed set via `AskUserQuestion` — create \u002F edit \u002F skip each.\n2. For each accepted worker, inline-invoke `\u002Fnewworker` with pre-filled fields (name,\n   `worker.company: {slug}`, candidate skills, knowledge paths, description). It writes\n   `companies\u002F{slug}\u002Fworkers\u002F{name}\u002Fworker.yaml`; `core\u002Fworkers\u002Fregistry.yaml`\n   regenerates automatically on reindex.\n3. Propose any function-specific **skills** → invoke `\u002Fcreate-skill` for each accepted\n   skill. That flow reserves its immutable ID before authoring, writes the canonical\n   `companies\u002F{slug}\u002Fskills\u002F{name}\u002FSKILL.md`, and lets reindex surface the generated\n   namespaced runtime wrapper. Do NOT write a wrapper yourself.\n4. **Design-pack wiring:** if Phase 2.5 created packs, any pack-consuming worker\n   (frontend-designer-style roles) MUST get a `dynamic` context entry pointing to\n   `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F` in its worker.yaml — without it the\n   registry resolves the pack but the worker can't load it (policy\n   `hq-worker-dynamic-context-company-packs`).\n\nSkip → no workers\u002Fskills synthesized.\n\n---\n\n## Phase 4 — Team & Cloud (NEW, opt-in gate for Phases 5–8)\n\nIf Phase 0 printed `newcompany mode: cloud-first`, skip this phase's prompt and\ndo not run `\u002Fdesignate-team` or `hq cloud provision company {slug}`. The company\nand vault already exist, and `hq files get` already pulled the shared company\nfolder. Continue directly to Phase 5. Do not repeat the company-wide `@all`\nfolder grants described in Phase 6. Phase 6 may still add group-specific grants\nthe user selects; those do not replace or repeat the existing baseline.\n\nOnly when Phase 0 printed `newcompany mode: newcompany`, ask:\n\nShared secrets, group ACLs, invites, and cloud agents require a provisioned vault. Ask once:\n\n> \"Set **{Name}** up for your team now? This provisions a cloud vault so you can connect\n> tools, share access by group, invite teammates, and add AI agents.\"\n\n- **Yes** → run `\u002Fdesignate-team {slug}` inline (writes `cloud: true`, runs\n  `hq cloud provision company {slug}`, self-checks `GET \u002Fmembership\u002Fme`). Gate Phases 5–8\n  on exit 0. On failure, report and continue to Phase 9 (don't loop).\n- **Not now** → skip Phases 5–8; note \"run `\u002Fdesignate-team {slug}` later to enable team\n  features\" in the finish checklist.\n\n---\n\n## Phase 5 — Connect Integrations (NEW, business-discovery-driven, fail-soft)\n\nFor each function's source-of-truth tool from Phase 1, **classify the connection method**\nand route accordingly — do NOT assume any specific tool list:\n\n| Class | Signal | Action |\n|-------|--------|--------|\n| **Personal API key** | user-scoped token (Notion personal key, GitHub PAT, Slack user token) | Mint `hq secrets generate-link \u003CTOOL>\u002F\u003CKEY> --company {slug}` → present Markdown link + 1-line \"how to get the key\" instructions. |\n| **Org \u002F admin API key** | workspace\u002Fadmin token (Google Workspace, Slack bot, Stripe restricted key) | Same minted link, but flag \"needs an admin of {tool}\" and who to ask. |\n| **Manual export** | no usable API for their plan (some CRMs, spreadsheets) | Give export instructions + the drop path (`companies\u002F{slug}\u002Fdata\u002Fimports\u002F`); record a finish-later task. |\n| **Ingestion script \u002F process** | recurring\u002Fcustom pull needed | Create a board idea (`{prefix}-proj-NNN`, label `ingestion`) so it's tracked as real work; do not fake it. |\n\nProcess: for each tool, ask \"how do you connect this?\" with the four classes as options\n(pre-fill the likely class). Mint links for the API-key classes; write instructions\u002Ftasks\nfor the others. Every tool is skippable.\n\n**Link rules (hard):** show each minted URL only at mint time, as `[Connect {Tool} ›](url)`.\nNever persist it to disk, journal, board, or git.\n\n---\n\n## Phase 6 — Org Model + ACL Rules (NEW, optional)\n\nTurn the team\u002Ffunctions into **groups with streamlined, rule-based access** — not one-off grants.\n\n1. **Groups:** one per function\u002Frole from Phase 1 (presets: admins, ops, finance, eng,\n   contractor; editable). `hq groups create grp_\u003Cname> --name \"\u003CHuman>\" --company {slug}`\n   (ids must match `grp_*`).\n2. **ACL rules (prefix-based, streamlined):** grant by prefix tree, not file-by-file:\n   - `hq files share '\u003Cfunction>\u002F*' --with grp_\u003Cfunction> --permission read --company {slug}` (the `\u002F*` shared glob; a bare `\u003Cfunction>\u002F` is a private create-only folder)\n   - `hq secrets share \u003CFUNCTION>\u002F\u003CFULL\u002FPATH> --with grp_\u003Cfunction> --permission read --company {slug}`\n     (full key path required — policy `hq-secrets-share-needs-full-key-path`).\n   - Company-wide baseline is already written by `\u002Fdesignate-team` (Phase 4): `@all write`\n   on `knowledge\u002F*`, `projects\u002F*`, `policies\u002F*`, `skills\u002F*` as four separate shared-folder\n   prefix grants. A trailing slash without `*` is the private create-only pattern.\n     Do not repeat it here and never widen it to a bucket-wide `*`. To keep part of a\n     folder private, run `\u002Fteam-access {slug}` — it narrows the baseline to chosen\n     subfolders, granting the new paths before it removes the broad one.\n   - A `\u002F*` shared-folder glob covers its whole subtree; a trailing slash is a private\n   create-only folder whose first uploaded child is locked to its creator. `reports\u002F*`\n   and `reports\u002F` are mutually exclusive patterns, not equivalent grants. Keep\n   sensitive material out of the four baseline folders or move it under a group-scoped\n   prefix.\n3. **Role reminder (hybrid ACL split):** owners\u002Fadmins get role-bypass on files; **secrets\n   are owner-only** (admins do NOT bypass secrets). Don't promise admins secret-grant power —\n   this files\u002Fsecrets asymmetry is intentional.\n\nSkip → no groups\u002Frules (owner still has full access).\n\n---\n\n## Phase 7 — Invite Teammates (NEW, optional)\n\nFor each teammate from Phase 1 (or ask): email + role + group.\n- `hq members --company {slug} invite \u003Cemail> --role \u003Cadmin|member>` (owner is provisioning-only; not via CLI).\n- If a group was chosen: `hq groups add grp_\u003Cname> \u003Cemail> --company {slug}`.\n- They accept via `\u002Faccept` on first sign-in. Surface pending vs joined state.\n\nSkip → invite later.\n\n---\n\n## Phase 8 — Cloud Agents (NEW, optional — \"invite an agent\")\n\nTeam Agents are GA (hq-pro vault-service). Offer: \"Want to add an AI teammate (agent) that\nlives in the cloud and can work in Slack\u002Femail?\"\n\n- Provision via the vault-service agent flow (`hq cloud provision company {slug}` must have\n  run in Phase 4; then the agent provisioning endpoints `POST \u002Fagents`, status via\n  `GET \u002Fagents\u002F{uid}\u002Fstatus`). Prefer any `hq` CLI agent subcommand if present; otherwise\n  follow the cloud-agents provisioning path. Route agent\u002Fvault work to the vault-service backend.\n- The agent becomes a first-class team member (appears in the team list with an `Agent` tag;\n  assignable in ACL pickers). Guardrail: agents cannot hold owner\u002Fadmin in v1.\n- Assign the agent to a group (Phase 6) so its access is scoped like a person's.\n\nSkip → no agents (the most likely default; it's a deliberate step).\n\n---\n\n## Phase 9 — Explain + Finish\n\n1. **Plain-language explainer** (always, even on the scaffold-only path):\n   > \"There's a file on your computer, with a **company** folder and a **personal** folder.\n   > It stores your business context — and that's what HQ works from.\"\n2. **Reindex:** `qmd update 2>\u002Fdev\u002Fnull || true`\n3. **Report** what was set up + a **finish-later checklist** of skipped items:\n\n```\n{Name} is ready ✓\n  Directory: companies\u002F{slug}\u002F  (prefix: {prefix})\n  Cloud: {provisioned | local-only — run \u002Fdesignate-team {slug} to enable team features}\n  Knowledge: {N seeded docs | empty}\n  Design packs: {pack ids + bound surfaces | none — deploy falls back to HQ Midnight Editorial}\n  Workers\u002FSkills: {list | none}\n  Projects: {N ideas on the board | none}\n  Integrations: {connected list | none} · Finish later: {classified manual\u002Fscript items}\n  Team: {N invited} · Groups: {list} · Agents: {N | none}\n```\n\n---\n\n## Rules\n\n- Phase 0 always runs and must leave a working local company; everything else is fail-soft\u002Fskippable.\n- All manifest.yaml fields non-null (empty arrays, not `null`). The company knowledge directory is mandatory.\n- Never create a company that already exists. Validate slug: lowercase, hyphens only, no spaces.\n- Always write `company.yaml` with `cloud: false`; only `\u002Fdesignate-team` flips it. Never default to `cloud: true`.\n- Every `hq` call carries `--company {slug}`. Never collect raw secrets in chat — mint links.\n- Don't fake integrations: tools without an easy key become tracked tasks (manual export \u002F ingestion script), not silent no-ops.\n- Design packs go in `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F`, not the shared public packs directory. Register them per §2.5.4: use the shared registry when it is a real HQ-tracked file, or a company-scoped `registry.yaml` when design-styles is an immutable package mount. Bind packs to surfaces through company-scoped policies. Do not symlink them into `repos\u002F` or edit core deploy infrastructure.\n- Reuse `\u002Fdesignate-team`, `\u002Fnewworker`, `\u002Fidea`, `\u002Fprd`, `hq groups|secrets|files|members invite`, and the cloud-agent provisioning path — don't reimplement them.\n\n## See also\n\n- `\u002Fonboard` — provision the vault for it\n- `\u002Fdesignate-team` — turn on cloud\u002Fteam sync\n","# \u002Fnewcompany — Company Scaffolding → Operational Setup\n\nCreate a new company. **Phase 0 (scaffold) always runs and yields a working local\ncompany in seconds.** Everything after Phase 0 is an optional, skippable, fail-soft\nguided path that takes the company from \"empty folder\" to \"operational\" — populated\nknowledge\u002Fworkers\u002Fskills\u002Fprojects, connected tools, an org model with streamlined ACL\nrules, invited teammates, and (optionally) cloud agents.\n\n**Args:** $ARGUMENTS\n\n## Operating principles\n\n- **Fail-soft after Phase 0.** Reaching a working company never depends on any later\n  phase. Each phase is independently skippable; skipped items roll into the closing\n  \"finish later\" checklist (Phase 9).\n- **One question at a time.** Use `AskUserQuestion` per decision (policy\n  `decision-queue-one-at-a-time`). Offer a \"skip\"\u002F\"not now\" choice on every optional phase.\n- **Tenant isolation.** Every `hq` call is company-scoped with `--company {slug}`.\n- **Reuse, don't reinvent.** This skill orchestrates existing primitives\n  (`\u002Fdesignate-team`, `\u002Fnewworker`, `\u002Fidea`, `\u002Fprd`, `hq groups`, `hq secrets`,\n  `hq files`, `hq members invite`, cloud-agent provisioning). It adds the interview + the\n  tool-classification logic, nothing more.\n- **Secret hygiene.** Never collect a raw credential in chat. Mint a submission link\n  (`hq secrets generate-link`) and render it ONLY as a Markdown inline link at mint time\n  (policies `hq-share-session-urls-are-capabilities`, `hq-secure-link-render-as-markdown`).\n\n---\n\n## Phase 0 — Scaffold (ALWAYS runs)\n\n### 0.1 Get Company Slug\n\nIf no args, ask: \"Company slug (lowercase, hyphens only)?\"\nValidate: no spaces, lowercase only, hyphens allowed, doesn't already exist in `companies\u002Fmanifest.yaml`.\n\n### 0.2 Basics (batch)\n\nAsk (batch is fine here — these are simple facts):\n1. Company name (human-readable)?\n2. GitHub org? (or \"none\")\n3. Existing repos to associate? (paths or \"none\")\n4. Existing workers to assign? (or \"none\")\n\n(Credentials are NOT collected here — Phase 4 handles them properly via minted links.)\n\n### 0.3 Scaffold Directory\n\n```bash\n# The default-off HQ flag keeps the existing local scaffold. When enabled, bootstrap\n# the cloud company first, pull the shared seed, then render only machine-local paths.\nHQ_CLI_BIN=\"$(command -v hq)\" node core\u002Fscripts\u002Fnewcompany-bootstrap.cjs \"{slug}\" \"{Name}\" \"companies\u002F{slug}\" \"$PWD\"\n# Obsidian preferences stay on this machine and are not part of the company seed.\n[ -e companies\u002F_template\u002F.obsidian ] && cp -rL companies\u002F_template\u002F.obsidian \"companies\u002F{slug}\u002F.obsidian\"\n```\n\nThe bootstrap prints exactly one mode line after it completes:\n`newcompany mode: cloud-first` or `newcompany mode: newcompany`. Use that output\nas the mode for the rest of this run; do not read the flag again. In cloud-first mode,\n`hq onboard create-company` provisions the entity, bucket,\nowner membership, verifies STS access, and writes `.hq\u002Fconfig.json` before the\nshared company seed is pulled. The renderer then writes only `newcompany_only`\npaths, so cloud-owned seed files are not overwritten.\n\nThe `workspace\u002F` directory is the per-company audit trail of HQ sessions that touch this\ncompany. Sessions are hardlinked here from `workspace\u002Fthreads\u002F` by the mirror hook\n(`mirror-thread-to-company.sh`); `index.jsonl` is committed, individual session JSONs are gitignored.\n\n`company.yaml` is the HQ Desktop App \u002F cloud-state marker. Local mode preserves the\nexisting `cloud: false` scaffold. Cloud-first mode writes `cloud: true` after onboarding\nhas provisioned the company. The server seed never writes this per-machine file.\n\n### 0.4 Create Knowledge Directory\n\nScaffold `companies\u002F{slug}\u002Fknowledge\u002F` as a **plain real directory**. Company\nfolders sync to every member's devices, so company knowledge must never contain\nGit metadata and must never be a symlink into `repos\u002F`.\n\n```bash\nmkdir -p companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\n# Run this legacy README write only when the bootstrap did not report cloud-first.\ncat > companies\u002F{slug}\u002Fknowledge\u002FREADME.md \u003C\u003C'EOF'\n# {Name} Knowledge\n\nCompany reference material synced through the company vault.\nEOF\n```\n\nWhen the bootstrap reports cloud-first, skip only the README write above because\nthat shared file was pulled from the cloud. The local path continues to use the\nsame README content as before.\n\nVerify (must pass before continuing):\n\n```bash\ntest -d companies\u002F{slug}\u002Fknowledge && ! test -L companies\u002F{slug}\u002Fknowledge \\\n  && echo \"OK: knowledge is a plain real directory\"\n```\n\nKeep this as a plain directory. Never initialize Git inside it, move it under\n`repos\u002F`, or replace it with a symlink.\n\nThe `design-styles\u002Fpacks\u002F` subdir is where company-scoped brand packs live.\n\n### 0.5 Update Registries\n\n**manifest.yaml**: Add entry with ALL fields populated (no nulls):\n```yaml\n{slug}:\n  prefix: {auto-computed}\n  github_org: {org or omit}\n  repos: [{repo paths or empty array}]\n  settings: [{setting names or empty array}]\n  knowledge: companies\u002F{slug}\u002Fknowledge\u002F # plain directory, synced with the company\n  deploy: []\n  vercel_projects: []\n  qmd_collections: [{slug}]\n```\n\n> Company workers are discovered automatically from `worker.company:` inside each\n> `companies\u002F{slug}\u002Fworkers\u002F*\u002Fworker.yaml`. No `workers:` array in the manifest —\n> `core\u002Fworkers\u002Fregistry.yaml` is the regenerated index.\n\n**Compute `prefix`** before writing the entry:\n1. Strip hyphens from `{slug}`, lowercase, take first 3 chars (e.g. `acme-corp` → `acm`).\n2. Read existing prefixes: `python3 -c \"import yaml; d=yaml.safe_load(open('companies\u002Fmanifest.yaml')); print('\\n'.join(v.get('prefix','') for v in d['companies'].values()))\"`.\n3. If your candidate collides, fall back to first 4 chars (no hyphens). If still collides, append `-2`, `-3`, ….\n4. Surface the chosen prefix in the final report.\n5. Reindex uses this prefix to surface company skills as generated, namespaced\n   runtime wrappers. Never write those wrappers directly.\n\n### 0.6 qmd Collection\n\n```bash\nqmd collection add companies\u002F{slug}\u002Fknowledge --name {slug} --mask \"**\u002F*.md\"\nqmd update 2>\u002Fdev\u002Fnull || true\n```\n\n### 0.7 Company Details + Companies List\n\n- Write `companies\u002F{slug}\u002Fcompany-details.md` with the display name, GitHub org,\n  associated repos, and workers from Phase 0.2. The shared `README.md` is rendered\n  from the seed template and stays unchanged; Phase 1 records the business purpose\n  after discovery.\n- If CLAUDE.md `## Companies` line doesn't include the new slug, update it.\n\n**Checkpoint — the company now works locally.** Announce it, then offer the operational\npath: \"Want me to set **{Name}** up the rest of the way — learn your business, seed\nknowledge, model your team, and connect your tools? (You can stop at any step.)\" If they\ndecline, jump to Phase 9 (finish + report).\n\n---\n\n## Phase 1 — Business Discovery (NEW, optional)\n\nThe interview that drives every downstream phase. One question at a time\n(`AskUserQuestion`), pattern adapted from `\u002Fpersonal-interview`. Keep it tight (~6–8 Qs);\ntake a position on vague answers, don't flatter.\n\nAsk, in order:\n1. **What does {Name} do?** One-paragraph description of the business + stage\u002Fsize.\n2. **Departments \u002F functions.** Which functions exist or matter (e.g. sales, marketing,\n   product\u002Feng, finance, ops, support, HR)? Offer multi-select + free text.\n3. **Source-of-truth tool per function.** For each named function, what tool is the\n   system of record (e.g. Sales→HubSpot\u002FSalesforce, Finance→QuickBooks\u002FStripe,\n   Eng→GitHub, Docs→Notion\u002FGoogle Drive, Comms→Slack)?\n4. **Top priorities.** The 2–3 things they most want HQ to help with first.\n5. **Existing knowledge\u002Fassets.** Website, brand docs, existing wikis, repos.\n6. **Team.** Who's on the team (names\u002Femails) and rough roles\u002Fgroupings.\n\n**Write the results** (so downstream phases + future sessions can use them):\n- `companies\u002F{slug}\u002Fknowledge\u002Fcompany-info.md` — frontmatter (`type: overview`,\n  `domain: [operations]`, `status: canonical`, `tags: [company-info, {slug}]`,\n  `generated_at: \u003CISO>`, `source: newcompany`) + the business description, functions,\n  priorities. Follow `core\u002Fknowledge\u002Fpublic\u002Fhq-core\u002Fknowledge-taxonomy.md`.\n- `companies\u002F{slug}\u002Fdata\u002Fbusiness-model.json` — machine-readable:\n  `{ domain, functions:[{name, sourceOfTruthTool}], priorities:[], team:[{name,email,role,group}] }`.\n  Phases 2–7 read this.\n\nSkip → company stays scaffold-only; later phases that need this prompt for it inline.\n\n---\n\n## Phase 2 — Seed Knowledge \u002F Projects (NEW, optional)\n\nFrom Phase 1, populate the folder so it isn't empty:\n\n- **Knowledge:** create taxonomy subdirs only for functions that have content\n  (threshold rule: a subdir per domain with ≥1 doc). Seed e.g.\n  `knowledge\u002Fmarket\u002Fcompetitive-landscape.md`, `knowledge\u002Foperations\u002Fworkflows.md`,\n  `knowledge\u002F\u003Cfunction>\u002Foverview.md` from the interview — each with standard frontmatter.\n  Keep seeds short and clearly marked `status: draft` where synthesized.\n- **Projects:** for each stated priority, create a board idea via the `\u002Fidea` shape\n  (append to `companies\u002F{slug}\u002Fboard.json`, `status: idea`, id from\n  `bash core\u002Fscripts\u002Fboard-project-id.sh next {slug} --prefix {prefix}`; run\n  `bash core\u002Fscripts\u002Fboard-project-id.sh check {slug}` after the last append).\n  Offer to `\u002Fprd` the top one into a full PRD (skippable — that's a heavier flow).\n\nSkip → leave knowledge\u002Fprojects empty (still valid).\n\n---\n\n## Phase 2.5 — Brand & Design Packs (NEW, optional)\n\nTurn the company's existing brand into one or more **design packs** so every downstream\nsurface (deploy reports, landing pages, decks, project summaries, worker-generated UI)\nships on-brand from day one. Governing policies: `hq-company-brand-pack-location`,\n`hq-bind-company-brand-pack-as-deploy-default`, `hq-worker-dynamic-context-company-packs`.\n\n### 2.5.1 Pick the brand source\n\nAsk (`AskUserQuestion`): \"Where's the best source to learn {Name}'s brand from?\"\n- **Website** — ask for the URL; fetch key pages, extract palette, type, spacing, voice,\n  imagery style from live CSS + rendered pages.\n- **Brand guide PDF** — ask for the file path (or drop path `companies\u002F{slug}\u002Fdata\u002Fimports\u002F`);\n  read via the pdf skill and extract the codified system.\n- **Google Drive \u002F Notion \u002F Figma doc** — ask for a link or an export; if not directly\n  readable, give export instructions + the drop path and record a finish-later task.\n- **Existing repo** — point at a repo with a `design.md` \u002F tokens \u002F component library and\n  extract from source.\n- **No brand yet** — offer to synthesize a starter brand from the Phase 1 business\n  description (industry, audience, positioning), clearly marked `status: draft`.\n- **Skip** — no packs; note \"run brand-pack creation later\" in the finish checklist.\n\nIf the source is only partially readable (e.g. Drive link without access), fail soft:\nextract what you can, record the gap as a finish-later task. Never block the phase.\n\n### 2.5.2 Decide pack count\n\nDefault is **one** brand pack (`{slug}-brand`). Offer more only when the interview or\nsource reveals genuinely distinct visual systems (e.g. separate product brands, or a\n\"marketing\" vs \"internal docs\" split). One pack per distinct system, each with its own id.\n\n### 2.5.3 Build each pack\n\nCreate `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F{pack-id}\u002F` with the five required\nfiles (schema: `core\u002Fknowledge\u002Fpublic\u002Fdesign-styles\u002FPACK-SCHEMA.md`; reference example:\nany existing pack under `companies\u002F{co}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F`):\n\n- `pack.yaml` — `type: brand`, `scope` implied company; fill `aesthetic`, `origin`\n  (cite the source used), `contents`, `compatibility`, `context_paths` (required:\n  `implementation.md`, `design-tokens.css`).\n- `style-guide.md` — the visual reference: palette with hex values, type roles, spacing,\n  imagery\u002Fvoice notes extracted from the source.\n- `implementation.md` — code-level system: component patterns, layout rules, do\u002Fdon't.\n- `design-tokens.css` — CSS custom properties.\n- `design-tokens.json` — same tokens in DTCG format.\n\nNEVER place company packs under `knowledge\u002Fpublic\u002Fdesign-styles\u002Fpacks\u002F` — that's shared\npacks only.\n\n### 2.5.4 Register the pack\n\nRegistry entry fields: `type: brand`, `status: active`, `scope: company`,\n`company: {slug}`, `path: companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F{pack-id}\u002F`,\nplus the one-line `aesthetic`. Consumers reference packs by `id` only — the\nregistry resolves the path.\n\nWhere to write it depends on the layout: if `core\u002Fknowledge\u002Fpublic\u002Fdesign-styles`\nis a real HQ-tracked directory (`! test -L`), add the entry to its\n`registry.yaml`. If it is a package contribution mounted from `core\u002Fpackages\u002F`\n(installed via `hq install @indigoai-us\u002Fhq-pack-design-styles`), that content is\nimmutable — never edit through the mount. Write the entry to the company scope\ninstead: `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fregistry.yaml` (create it if\nmissing); company brand packs under `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F`\nauto-load when the company is bound, and resolution merges company entries over\nthe shared registry.\n\n### 2.5.5 Wire packs to use cases via policies\n\nAsk which surfaces should default to the pack (multi-select; pre-select deploy):\n- **Deploy artifacts** (reports, dashboards, share pages) — write a company-scoped\n  **hard** policy at `companies\u002F{slug}\u002Fpolicies\u002F{slug}-deploy-report-brand-pack.md`\n  binding the pack path as the `\u002Fdeploy` default (pattern:\n  `hq-bind-company-brand-pack-as-deploy-default`). The global\n  Midnight Editorial default already cedes to a bound company pack — no core edits.\n- **Marketing \u002F landing pages** — extend the same policy (or a sibling) to cover\n  landing-page and public-site artifacts, naming the marketing pack if distinct.\n- **Repos** — for each associated repo that ships UI, offer to add\u002Fupdate the repo's\n  `design.md` with `style-pack: {pack-id}`.\n- **Project summaries \u002F decks** — note in the policy that `\u002Fproject-summary` and deck\n  artifacts use the pack.\n\nOne policy file per pack-binding decision, company-scoped, standard policy frontmatter\n(`scope: company`, `enforcement: hard`, `when: deploy || design`, `on: [PreToolUse, UserPromptSubmit, AssistantIntent]`). The write hook requires `on:`; omitting it blocks the first policy write.\n\nSkip → no packs; deploy artifacts fall back to HQ Midnight Editorial.\n\n---\n\n## Phase 3 — Synthesize Workers + Skills (NEW, optional)\n\nCluster the functions\u002Fworkflows from Phase 1 into proposed workers, reusing the\n`import-context` cluster pattern + `\u002Fnewworker`:\n\n1. Propose 1 worker per high-value function (e.g. a \"growth\" worker, a \"finance-reporting\"\n   worker). Present the proposed set via `AskUserQuestion` — create \u002F edit \u002F skip each.\n2. For each accepted worker, inline-invoke `\u002Fnewworker` with pre-filled fields (name,\n   `worker.company: {slug}`, candidate skills, knowledge paths, description). It writes\n   `companies\u002F{slug}\u002Fworkers\u002F{name}\u002Fworker.yaml`; `core\u002Fworkers\u002Fregistry.yaml`\n   regenerates automatically on reindex.\n3. Propose any function-specific **skills** → invoke `\u002Fcreate-skill` for each accepted\n   skill. That flow reserves its immutable ID before authoring, writes the canonical\n   `companies\u002F{slug}\u002Fskills\u002F{name}\u002FSKILL.md`, and lets reindex surface the generated\n   namespaced runtime wrapper. Do NOT write a wrapper yourself.\n4. **Design-pack wiring:** if Phase 2.5 created packs, any pack-consuming worker\n   (frontend-designer-style roles) MUST get a `dynamic` context entry pointing to\n   `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F` in its worker.yaml — without it the\n   registry resolves the pack but the worker can't load it (policy\n   `hq-worker-dynamic-context-company-packs`).\n\nSkip → no workers\u002Fskills synthesized.\n\n---\n\n## Phase 4 — Team & Cloud (NEW, opt-in gate for Phases 5–8)\n\nIf Phase 0 printed `newcompany mode: cloud-first`, skip this phase's prompt and\ndo not run `\u002Fdesignate-team` or `hq cloud provision company {slug}`. The company\nand vault already exist, and `hq files get` already pulled the shared company\nfolder. Continue directly to Phase 5. Do not repeat the company-wide `@all`\nfolder grants described in Phase 6. Phase 6 may still add group-specific grants\nthe user selects; those do not replace or repeat the existing baseline.\n\nOnly when Phase 0 printed `newcompany mode: newcompany`, ask:\n\nShared secrets, group ACLs, invites, and cloud agents require a provisioned vault. Ask once:\n\n> \"Set **{Name}** up for your team now? This provisions a cloud vault so you can connect\n> tools, share access by group, invite teammates, and add AI agents.\"\n\n- **Yes** → run `\u002Fdesignate-team {slug}` inline (writes `cloud: true`, runs\n  `hq cloud provision company {slug}`, self-checks `GET \u002Fmembership\u002Fme`). Gate Phases 5–8\n  on exit 0. On failure, report and continue to Phase 9 (don't loop).\n- **Not now** → skip Phases 5–8; note \"run `\u002Fdesignate-team {slug}` later to enable team\n  features\" in the finish checklist.\n\n---\n\n## Phase 5 — Connect Integrations (NEW, business-discovery-driven, fail-soft)\n\nFor each function's source-of-truth tool from Phase 1, **classify the connection method**\nand route accordingly — do NOT assume any specific tool list:\n\n| Class | Signal | Action |\n|-------|--------|--------|\n| **Personal API key** | user-scoped token (Notion personal key, GitHub PAT, Slack user token) | Mint `hq secrets generate-link \u003CTOOL>\u002F\u003CKEY> --company {slug}` → present Markdown link + 1-line \"how to get the key\" instructions. |\n| **Org \u002F admin API key** | workspace\u002Fadmin token (Google Workspace, Slack bot, Stripe restricted key) | Same minted link, but flag \"needs an admin of {tool}\" and who to ask. |\n| **Manual export** | no usable API for their plan (some CRMs, spreadsheets) | Give export instructions + the drop path (`companies\u002F{slug}\u002Fdata\u002Fimports\u002F`); record a finish-later task. |\n| **Ingestion script \u002F process** | recurring\u002Fcustom pull needed | Create a board idea (`{prefix}-proj-NNN`, label `ingestion`) so it's tracked as real work; do not fake it. |\n\nProcess: for each tool, ask \"how do you connect this?\" with the four classes as options\n(pre-fill the likely class). Mint links for the API-key classes; write instructions\u002Ftasks\nfor the others. Every tool is skippable.\n\n**Link rules (hard):** show each minted URL only at mint time, as `[Connect {Tool} ›](url)`.\nNever persist it to disk, journal, board, or git.\n\n---\n\n## Phase 6 — Org Model + ACL Rules (NEW, optional)\n\nTurn the team\u002Ffunctions into **groups with streamlined, rule-based access** — not one-off grants.\n\n1. **Groups:** one per function\u002Frole from Phase 1 (presets: admins, ops, finance, eng,\n   contractor; editable). `hq groups create grp_\u003Cname> --name \"\u003CHuman>\" --company {slug}`\n   (ids must match `grp_*`).\n2. **ACL rules (prefix-based, streamlined):** grant by prefix tree, not file-by-file:\n   - `hq files share '\u003Cfunction>\u002F*' --with grp_\u003Cfunction> --permission read --company {slug}` (the `\u002F*` shared glob; a bare `\u003Cfunction>\u002F` is a private create-only folder)\n   - `hq secrets share \u003CFUNCTION>\u002F\u003CFULL\u002FPATH> --with grp_\u003Cfunction> --permission read --company {slug}`\n     (full key path required — policy `hq-secrets-share-needs-full-key-path`).\n   - Company-wide baseline is already written by `\u002Fdesignate-team` (Phase 4): `@all write`\n   on `knowledge\u002F*`, `projects\u002F*`, `policies\u002F*`, `skills\u002F*` as four separate shared-folder\n   prefix grants. A trailing slash without `*` is the private create-only pattern.\n     Do not repeat it here and never widen it to a bucket-wide `*`. To keep part of a\n     folder private, run `\u002Fteam-access {slug}` — it narrows the baseline to chosen\n     subfolders, granting the new paths before it removes the broad one.\n   - A `\u002F*` shared-folder glob covers its whole subtree; a trailing slash is a private\n   create-only folder whose first uploaded child is locked to its creator. `reports\u002F*`\n   and `reports\u002F` are mutually exclusive patterns, not equivalent grants. Keep\n   sensitive material out of the four baseline folders or move it under a group-scoped\n   prefix.\n3. **Role reminder (hybrid ACL split):** owners\u002Fadmins get role-bypass on files; **secrets\n   are owner-only** (admins do NOT bypass secrets). Don't promise admins secret-grant power —\n   this files\u002Fsecrets asymmetry is intentional.\n\nSkip → no groups\u002Frules (owner still has full access).\n\n---\n\n## Phase 7 — Invite Teammates (NEW, optional)\n\nFor each teammate from Phase 1 (or ask): email + role + group.\n- `hq members --company {slug} invite \u003Cemail> --role \u003Cadmin|member>` (owner is provisioning-only; not via CLI).\n- If a group was chosen: `hq groups add grp_\u003Cname> \u003Cemail> --company {slug}`.\n- They accept via `\u002Faccept` on first sign-in. Surface pending vs joined state.\n\nSkip → invite later.\n\n---\n\n## Phase 8 — Cloud Agents (NEW, optional — \"invite an agent\")\n\nTeam Agents are GA (hq-pro vault-service). Offer: \"Want to add an AI teammate (agent) that\nlives in the cloud and can work in Slack\u002Femail?\"\n\n- Provision via the vault-service agent flow (`hq cloud provision company {slug}` must have\n  run in Phase 4; then the agent provisioning endpoints `POST \u002Fagents`, status via\n  `GET \u002Fagents\u002F{uid}\u002Fstatus`). Prefer any `hq` CLI agent subcommand if present; otherwise\n  follow the cloud-agents provisioning path. Route agent\u002Fvault work to the vault-service backend.\n- The agent becomes a first-class team member (appears in the team list with an `Agent` tag;\n  assignable in ACL pickers). Guardrail: agents cannot hold owner\u002Fadmin in v1.\n- Assign the agent to a group (Phase 6) so its access is scoped like a person's.\n\nSkip → no agents (the most likely default; it's a deliberate step).\n\n---\n\n## Phase 9 — Explain + Finish\n\n1. **Plain-language explainer** (always, even on the scaffold-only path):\n   > \"There's a file on your computer, with a **company** folder and a **personal** folder.\n   > It stores your business context — and that's what HQ works from.\"\n2. **Reindex:** `qmd update 2>\u002Fdev\u002Fnull || true`\n3. **Report** what was set up + a **finish-later checklist** of skipped items:\n\n```\n{Name} is ready ✓\n  Directory: companies\u002F{slug}\u002F  (prefix: {prefix})\n  Cloud: {provisioned | local-only — run \u002Fdesignate-team {slug} to enable team features}\n  Knowledge: {N seeded docs | empty}\n  Design packs: {pack ids + bound surfaces | none — deploy falls back to HQ Midnight Editorial}\n  Workers\u002FSkills: {list | none}\n  Projects: {N ideas on the board | none}\n  Integrations: {connected list | none} · Finish later: {classified manual\u002Fscript items}\n  Team: {N invited} · Groups: {list} · Agents: {N | none}\n```\n\n---\n\n## Rules\n\n- Phase 0 always runs and must leave a working local company; everything else is fail-soft\u002Fskippable.\n- All manifest.yaml fields non-null (empty arrays, not `null`). The company knowledge directory is mandatory.\n- Never create a company that already exists. Validate slug: lowercase, hyphens only, no spaces.\n- Always write `company.yaml` with `cloud: false`; only `\u002Fdesignate-team` flips it. Never default to `cloud: true`.\n- Every `hq` call carries `--company {slug}`. Never collect raw secrets in chat — mint links.\n- Don't fake integrations: tools without an easy key become tracked tasks (manual export \u002F ingestion script), not silent no-ops.\n- Design packs go in `companies\u002F{slug}\u002Fknowledge\u002Fdesign-styles\u002Fpacks\u002F`, not the shared public packs directory. Register them per §2.5.4: use the shared registry when it is a real HQ-tracked file, or a company-scoped `registry.yaml` when design-styles is an immutable package mount. Bind packs to surfaces through company-scoped policies. Do not symlink them into `repos\u002F` or edit core deploy infrastructure.\n- Reuse `\u002Fdesignate-team`, `\u002Fnewworker`, `\u002Fidea`, `\u002Fprd`, `hq groups|secrets|files|members invite`, and the cloud-agent provisioning path — don't reimplement them.\n\n## See also\n\n- `\u002Fonboard` — provision the vault for it\n- `\u002Fdesignate-team` — turn on cloud\u002Fteam sync\n",{"name":5,"description":7,"allowed-tools":43},"Read, Write, Edit, Bash, AskUserQuestion, Bash(bash core\u002Fscripts\u002Fboard-project-id.sh:*)","main","205cf61728a27ef15e9153aa38df5856fc8d82f5",".claude\u002Fskills\u002Fnewcompany",18,"https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core","https:\u002F\u002Fgithub.com\u002Findigoai-us","https:\u002F\u002Fhqforwork.com\u002F","The AI Context Layer for Teams","2026-11-12 06:53:38",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add indigoai-us\u002Fhq-core --skill newcompany",{"tool":59,"command":60},"bunx","bunx skills add indigoai-us\u002Fhq-core --skill newcompany",{"tool":62,"command":63},"pnpm","pnpm dlx skills add indigoai-us\u002Fhq-core --skill newcompany","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fnewcompany\u002FSKILL.md",true,[67],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"agents\u002Fopenai.yaml","REFERENCE","参考文档",111,"https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fnewcompany\u002Fagents\u002Fopenai.yaml",[74,82,89,96,103,110],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":81},"01M73NTNKZ3T2KJNDP2ZF23645","job","Deprecated alias for \u002Fschedule — Outpost recurring agent jobs. Prefer \u002Fschedule.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fjob\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":81},"01M73NTE0H9DQTT6DNHDKRWTXW","import-claude","Deprecated alias for \u002Fimport-context — bootstrap HQ from your prior AI footprint (Claude Code, Codex, Grok, claude.ai history plus on-disk artifacts).","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimport-claude\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":81},"01M73NT67433KKX96CCJWDQQ0X","hq-whoami","Show current HQ Cognito identity and session expiry.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-whoami\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":81},"01M73NT17SVXZV2QPT14C2RPJP","hq-share","Share HQ vault paths through single-use links or direct ACL grants.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-share\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":81},"01M73NSXYFMD7EHGT8TFDZA3C8","hq-secrets","Use HQ CLI secrets safely through env injection or one-off exec.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-secrets\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":81},"01M73NSWCXJK29Q8CNG8AS3ZZQ","hq-logout","Sign out of HQ Cognito and clear local tokens.","https:\u002F\u002Fgithub.com\u002Findigoai-us\u002Fhq-core\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fhq-logout\u002FSKILL.md",[],[]]