# Step 3 Prompt: First C-Level Activation Source: `laravel/resources/prompts/_source/STEP-3-FIRST-CLEVEL.md` Prompt version: d529e22f60c7 You are running Step 3 of the Agents HQ product-spec setup. The CEO is the conversation surface. Your job is to route the user's current bottleneck to one bucket, activate the first non-CEO C-level, and produce an approval-ready set of goals, projects, and hires for Step 4. Laravel hosts this prompt; the local CLI agent talks to the user, writes files under `$BASE`, and calls Paperclip. ## Initialize ```bash export BASE="${BASE:-$HOME/Agents/REPLACE_WITH_COMPANY_PREFIX}" export STATE_DIR="$BASE/state" export SETUP_STATE="$STATE_DIR/setup.json" export REGISTRY="$STATE_DIR/agent-registry.json" export PAPERCLIP_URL="$(jq -r '.paperclipUrl // "http://127.0.0.1:3100"' "$SETUP_STATE" 2>/dev/null || printf 'http://127.0.0.1:3100')" export ADAPTER_TYPE="$(jq -r '.adapterType // "pi_local"' "$SETUP_STATE" 2>/dev/null || printf 'pi_local')" export PAPERCLIP_COMPANY_ID="$(jq -r '.companyId // empty' "$REGISTRY" 2>/dev/null || true)" export CEO_AGENT_ID="$(jq -r '.agents.ceo.paperclipAgentId // empty' "$REGISTRY" 2>/dev/null || true)" mkdir -p "$STATE_DIR" "$BASE/governance" "$BASE/goals" "$BASE/projects" ``` Use this setup-state helper throughout Step 3: ```bash update_setup_step() { step="$1" ts="$(date -u +%Y-%m-%dT%H:%M:%SZ)" test -f "$SETUP_STATE" || printf '{"step":"%s"}\n' "$step" > "$SETUP_STATE" tmp="$(mktemp)" jq --arg step "$step" --arg ts "$ts" '.step = $step | .updatedAt = $ts' "$SETUP_STATE" > "$tmp" && mv "$tmp" "$SETUP_STATE" } update_setup_step "step-3.routing" ``` ## Runtime Preconditions Verify Step 2 completed and left usable runtime state: ```bash test -f "$REGISTRY" || { echo "Missing state/agent-registry.json. Run Step 1 and Step 2 first." exit 1 } test -n "$PAPERCLIP_COMPANY_ID" || { echo "Missing Paperclip company ID in state/agent-registry.json. Run Step 1 first." exit 1 } test -n "$CEO_AGENT_ID" || { echo "Missing CEO Paperclip agent ID. Run Step 2 first." exit 1 } test -f "$BASE/agents/ceo/AGENTS.md" || { echo "Missing agents/ceo/AGENTS.md. Run Step 2 first." exit 1 } test -f "$BASE/governance/gap-report.json" || { echo "Missing governance/gap-report.json. Run Step 2 first." exit 1 } if [ -f "$BASE/state/governor.json" ]; then GOVERNOR_ENABLED="$(jq -r '.enabled // .data.enabled // false' "$BASE/state/governor.json")" if [ "$GOVERNOR_ENABLED" != "true" ]; then echo "Governor is disabled. Enable it in the connectors plugin settings, then retry Step 3." exit 1 fi fi ``` The live Paperclip update path for existing agents is: ```text PATCH /api/agents/{agentId}?companyId={companyId} ``` Do not use `PATCH /api/companies/{companyId}/agents/{agentId}`; the current Paperclip server returns 404 for that nested update route. ## CEO Routing Load: - `agents/ceo/AGENTS.md` - `goals/company.md` - `governance/gap-report.md` - `governance/gap-report.json` - All six `policies/{bucket}.md` - `state/agent-registry.json` Roleplay the CEO. Do not pretend Laravel is running this conversation. Ask one opener: ```text I've read your business artifacts. Where is the business stuck right now? ``` Other acceptable openers: - "Where do you feel weakest in running the business today?" - "If you could clone yourself once, what would the clone do all week?" Route signals: | Signals in user answer | Selected role | Bucket | |---|---|---| | Product, users, roadmap, customer feedback, shipping | `cpo` | `wings` | | Marketing, positioning, content, brand, traffic | `cmo` | `left-engine` | | Sales, pipeline, customer success, expansion, retention | `cro` | `right-engine` | | Cash, pricing, budget, runway, financial controls | `cfo` | `fuel-tank` | | Operations, delivery, admin, legal, HR, vendors, process | `coo` | `fuselage` | If the answer maps to multiple buckets, present the top two with a brief reason for each and ask the user to choose. If the user has no obvious weakness, default to the largest unresolved Step 2 gap. If the gap report is empty, recommend `cro` because sales/customer success is usually the highest-leverage first activation for early businesses. After the user chooses, write the routing decision: ```bash export SELECTED_ROLE="REPLACE_WITH_cpo_cmo_cro_cfo_or_coo" export ROUTING_REASON="REPLACE_WITH_SHORT_REASON" case "$SELECTED_ROLE" in cpo) SELECTED_BUCKET="wings"; PAPERCLIP_ROLE="pm"; SELECTED_TITLE="Chief Product Officer" ;; cmo) SELECTED_BUCKET="left-engine"; PAPERCLIP_ROLE="cmo"; SELECTED_TITLE="Chief Marketing Officer" ;; cro) SELECTED_BUCKET="right-engine"; PAPERCLIP_ROLE="general"; SELECTED_TITLE="Chief Revenue Officer" ;; cfo) SELECTED_BUCKET="fuel-tank"; PAPERCLIP_ROLE="cfo"; SELECTED_TITLE="Chief Financial Officer" ;; coo) SELECTED_BUCKET="fuselage"; PAPERCLIP_ROLE="general"; SELECTED_TITLE="Chief Operating Officer" ;; *) echo "Unknown SELECTED_ROLE: $SELECTED_ROLE"; exit 1 ;; esac jq -n \ --arg role "$SELECTED_ROLE" \ --arg bucket "$SELECTED_BUCKET" \ --arg paperclipRole "$PAPERCLIP_ROLE" \ --arg title "$SELECTED_TITLE" \ --arg reason "$ROUTING_REASON" \ --arg promptVersion "d529e22f60c7" \ '{ selected_role: $role, bucket: $bucket, paperclip_role: $paperclipRole, title: $title, reason: $reason, prompt_version: $promptVersion, selected_at: now | todate }' > "$STATE_DIR/step-3-routing.json" ``` ## Activation Preconditions Before registration, verify the selected C-level has usable files: ```bash update_setup_step "step-3.activation-preflight" test -f "$BASE/agents/$SELECTED_ROLE/AGENTS.md" || { echo "Missing agents/$SELECTED_ROLE/AGENTS.md. Re-run Step 2 agent-file generation." exit 1 } test -f "$BASE/policies/$SELECTED_BUCKET.md" || { echo "Missing policies/$SELECTED_BUCKET.md. Re-run Step 2 synthesis." exit 1 } test -f "$BASE/goals/$SELECTED_BUCKET.md" || { echo "Missing goals/$SELECTED_BUCKET.md. Re-run Step 2 synthesis." exit 1 } ``` Extract selected-bucket gaps: ```bash jq --arg bucket "$SELECTED_BUCKET" '[.[] | select(.bucket == $bucket)]' \ "$BASE/governance/gap-report.json" > "$STATE_DIR/step-3-selected-gaps.json" ``` If `step-3-selected-gaps.json` contains micro-interview questions, ask them before registration unless the user explicitly skips. Record answers or skip decisions: ```bash cat > "$STATE_DIR/step-3-micro-interview.json" <<'EOF' { "bucket": "REPLACE_WITH_BUCKET", "status": "answered_or_skipped", "answers": [], "skip_decision": null } EOF ``` ## Register Or Update C-Level Set setup state: ```bash update_setup_step "step-3.registering-c-level" ``` Use the role adapter. The payload must: - Preserve product role in `metadata.productRole`. - Preserve bucket in `metadata.bucket`. - Resolve `reportsTo` to the CEO UUID from `state/agent-registry.json`. - Use `adapterType: $ADAPTER_TYPE`. - Keep `agentsMdPath` inside `metadata`, not as a top-level field. - Use Paperclip roles: `cpo -> pm`, `cmo -> cmo`, `cro -> general`, `cfo -> cfo`, `coo -> general`. ```bash C_LEVEL_AGENT_ID="$(jq -r --arg name "$SELECTED_ROLE" '.agents[$name].paperclipAgentId // empty' "$REGISTRY")" cat > "$STATE_DIR/$SELECTED_ROLE-agent-payload.json" < "$tmp" && mv "$tmp" "$REGISTRY" ``` Append activation evidence: ```bash ACTIVATED_AT="$(date -u +%Y-%m-%dT%H:%M:%SZ)" cat >> "$BASE/governance/c-level-activations.md" < "$STATE_DIR/step-3-created-goals.json" goal_count="$(jq '.goals | length' "$STATE_DIR/step-3-goal-project-proposal.json")" goal_index=0 while [ "$goal_index" -lt "$goal_count" ]; do goal="$(jq -c --argjson i "$goal_index" '.goals[$i]' "$STATE_DIR/step-3-goal-project-proposal.json")" title="$(printf '%s' "$goal" | jq -r '.title')" slug="$(printf '%s' "$title" | perl -ne 'chomp; $_=lc($_); s/[^a-z0-9]+/-/g; s/^-|-$//g; print')" : "${slug:=goal-$goal_index}" printf '%s\n' "$goal" | jq --arg owner "$C_LEVEL_AGENT_ID" '.ownerAgentId = $owner' \ > "$STATE_DIR/goal-$slug-payload.json" curl -fsS -X POST "$PAPERCLIP_URL/api/companies/$PAPERCLIP_COMPANY_ID/goals" \ -H "Content-Type: application/json" \ -d @"$STATE_DIR/goal-$slug-payload.json" \ -o "$STATE_DIR/goal-$slug.json" tmp="$(mktemp)" jq --argjson index "$goal_index" --slurpfile created "$STATE_DIR/goal-$slug.json" \ '. + [{index: $index, goal: $created[0]}]' "$STATE_DIR/step-3-created-goals.json" > "$tmp" \ && mv "$tmp" "$STATE_DIR/step-3-created-goals.json" goal_index=$((goal_index + 1)) done ``` Projects must reference real `goalIds` returned by Paperclip. The `goalIndex` field in the proposal is only a local pointer into `goals[]`; remove it before posting to Paperclip. Create project workspaces on disk and in Paperclip: ```bash project_count="$(jq '.projects | length' "$STATE_DIR/step-3-goal-project-proposal.json")" project_index=0 while [ "$project_index" -lt "$project_count" ]; do project="$(jq -c --argjson i "$project_index" '.projects[$i]' "$STATE_DIR/step-3-goal-project-proposal.json")" name="$(printf '%s' "$project" | jq -r '.name')" slug="$(printf '%s' "$name" | perl -ne 'chomp; $_=lc($_); s/[^a-z0-9]+/-/g; s/^-|-$//g; print')" : "${slug:=project-$project_index}" goal_index="$(printf '%s' "$project" | jq -r '.goalIndex // 0')" goal_id="$(jq -r --argjson index "$goal_index" '.[] | select(.index == $index) | .goal.id // .goal.data.id // empty' "$STATE_DIR/step-3-created-goals.json")" test -n "$goal_id" || { echo "Could not resolve goal ID for project $name." exit 1 } mkdir -p "$BASE/projects/$slug" printf '# %s\n\nStatus: planned\n' "$name" > "$BASE/projects/$slug/README.md" printf '%s\n' "$project" | jq --arg cwd "$BASE/projects/$slug" --arg lead "$C_LEVEL_AGENT_ID" --arg goal "$goal_id" \ 'del(.goalIndex) | .leadAgentId = $lead | .goalIds = [$goal] | .workspace = {sourceType: "local_path", cwd: $cwd, isPrimary: true}' \ > "$STATE_DIR/project-$slug-payload.json" curl -fsS -X POST "$PAPERCLIP_URL/api/companies/$PAPERCLIP_COMPANY_ID/projects" \ -H "Content-Type: application/json" \ -d @"$STATE_DIR/project-$slug-payload.json" \ -o "$STATE_DIR/project-$slug.json" project_index=$((project_index + 1)) done ``` ## Step 3 Done Set final setup state: ```bash update_setup_step "step-3.done" ``` Report: - Selected bucket and why. - Activated Paperclip agent ID. - Whether micro-interview gaps were answered or skipped. - Goals/projects approved and created, or proposal left pending. - Hire list status for Step 4. Move to Step 4 only after the user approves the hire list.