Open-source SEO, GEO, and marketing skills for AI agents.
feat(notfair-cmo): simplify onboarding — Codex-first runtime, drop team naming
Yuting Zhong7c4d5268475e
diff --git a/notfair-cmo/src/components/onboarding-flow.tsx b/notfair-cmo/src/components/onboarding-flow.tsxindex e82e98e5..1a956330 100644--- a/notfair-cmo/src/components/onboarding-flow.tsx+++ b/notfair-cmo/src/components/onboarding-flow.tsx@@ -185,53 +185,6 @@ function NameStep({ onCreated }: { onCreated: (slug: string) => void }) {/></div>- <div className="rounded-md border border-dashed bg-muted/30 p-3 space-y-3">- <div className="space-y-1">- <Label className="text-xs uppercase tracking-wide text-muted-foreground">- Your team- </Label>- <p className="text-xs text-muted-foreground">- Name your CMO and Google Ads specialist. Pick something- memorable — these stay fixed for the life of the project.- </p>- </div>- <div className="grid grid-cols-2 gap-3">- <div className="space-y-1.5">- <Label- htmlFor="agent_name_cmo"- className="text-xs font-medium text-foreground"- >- CMO- </Label>- <Input- id="agent_name_cmo"- name="agent_name_cmo"- defaultValue="Greg"- placeholder="Greg"- maxLength={32}- disabled={isPending}- required- />- </div>- <div className="space-y-1.5">- <Label- htmlFor="agent_name_google_ads"- className="text-xs font-medium text-foreground"- >- Google Ads- </Label>- <Input- id="agent_name_google_ads"- name="agent_name_google_ads"- defaultValue="Ana"- placeholder="Ana"- maxLength={32}- disabled={isPending}- required- />- </div>- </div>- </div><div className="space-y-2"><Label htmlFor="website_url">Website URL{" "}@@ -283,29 +236,32 @@ function NameStep({ onCreated }: { onCreated: (slug: string) => void }) {// ── Harness picker ─────────────────────────────────────────────────//-// Two recommended adapters: Claude Code (default) and Codex. Persisted on+// Two adapters: Codex (recommended default) and Claude Code. Persisted on// the project row so different projects can use different harnesses. The// chosen CLI must be on PATH when chats run — adapter testEnvironment is// surfaced via the doctor command for diagnostic feedback.function HarnessPicker({ disabled }: { disabled: boolean }) {const [value, setValue] = useState<"claude-code-local" | "codex-local">(- "claude-code-local",+ "codex-local",);const options: Array<{id: "claude-code-local" | "codex-local";label: string;description: string;+ recommended: boolean;}> = [- {- id: "claude-code-local",- label: "Claude Code",- description: "Uses your local `claude` CLI. Recommended.",- },{id: "codex-local",label: "Codex",- description: "Uses your local `codex` CLI.",+ description: "Uses your local `codex` CLI. Recommended.",+ recommended: true,+ },+ {+ id: "claude-code-local",+ label: "Claude Code",+ description: "Uses your local `claude` CLI.",+ recommended: false,},];return (@@ -338,9 +294,11 @@ function HarnessPicker({ disabled }: { disabled: boolean }) {><div className="flex w-full items-center justify-between"><span className="text-sm font-medium text-foreground">{opt.label}</span>- <span className="rounded-full bg-emerald-500/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-emerald-700 dark:text-emerald-300">- Recommended- </span>+ {opt.recommended && (+ <span className="rounded-full bg-emerald-500/10 px-1.5 py-0.5 text-[10px] uppercase tracking-wide text-emerald-700 dark:text-emerald-300">+ Recommended+ </span>+ )}</div><span className="text-xs text-muted-foreground">{opt.description}</span></button>diff --git a/notfair-cmo/src/server/actions/projects.ts b/notfair-cmo/src/server/actions/projects.tsindex e92d0fea..18b4143e 100644--- a/notfair-cmo/src/server/actions/projects.ts+++ b/notfair-cmo/src/server/actions/projects.ts@@ -104,19 +104,6 @@ export async function createProjectForOnboardingAction(? harness_raw: DEFAULT_HARNESS_ADAPTER;- // Personal names for the team. Pre-filled with template defaults on the- // client; we still read off the form rather than baking the defaults- // here so the user's choice is the single source of truth. Blank- // values fall back to template.default_name inside ensureProjectAgents.- const agent_name_cmo = String(formData.get("agent_name_cmo") ?? "").trim();- const agent_name_google_ads = String(- formData.get("agent_name_google_ads") ?? "",- ).trim();- const agent_names = {- ...(agent_name_cmo ? { cmo: agent_name_cmo } : {}),- ...(agent_name_google_ads ? { google_ads: agent_name_google_ads } : {}),- } as Partial<Record<"cmo" | "google_ads" | "seo", string>>;-const result = createProject({display_name,website_url,@@ -132,8 +119,15 @@ export async function createProjectForOnboardingAction(// can still find this task by title and set blocked_by_task_id// correctly. Kickoff (which needs the OpenClaw agent to exist) is// deferred to the provisionPromise.then() below.- const { agentNameFor } = await import("@/server/agent-templates");- const cmoName = agent_name_cmo || "Greg";+ //+ // Agent personal names are no longer user-configurable at onboarding —+ // we use the template defaults ("Greg" for CMO, "Ana" for Google Ads).+ // Letting users pick once-and-only-once at onboarding was a footgun+ // since agent_ids encode the name and are immutable; if we ever add a+ // proper rename feature (with cascade) it'll live in settings, not+ // here.+ const { agentNameFor, templateForKey } = await import("@/server/agent-templates");+ const cmoName = templateForKey("cmo")?.default_name ?? "Greg";const cmoAgentId = agentNameFor(result.project.slug, "cmo", cmoName);const { buildProjectOnboardingBrief } = await import("@/server/onboarding/cmo-task-brief"@@ -156,10 +150,10 @@ export async function createProjectForOnboardingAction(});// Same async-provisioning policy as createProjectAction (D4 + D6).+ // No `names` override — fall through to each template's default_name.const provisionPromise = ensureProjectAgents(result.project.slug,DEFAULT_ONBOARDING_TEMPLATE_KEYS,- agent_names,);startProvisioning(result.project.slug, provisionPromise);// After provisioning resolves, log + kick off the onboarding task.diff --git a/notfair-cmo/src/server/adapters/display-registry.ts b/notfair-cmo/src/server/adapters/display-registry.tsindex 2c867749..9d89b5e2 100644--- a/notfair-cmo/src/server/adapters/display-registry.ts+++ b/notfair-cmo/src/server/adapters/display-registry.ts@@ -18,15 +18,9 @@ export interface HarnessDisplay {binary: string;}+// Insertion order is the display order — Object.values preserves it.+// Codex first + recommended; Claude Code second, available but not promoted.export const HARNESS_DISPLAY: Record<HarnessAdapterId, HarnessDisplay> = {- "claude-code-local": {- id: "claude-code-local",- label: "Claude Code",- description: "Run agents through Anthropic's Claude Code CLI. Uses your existing claude login.",- recommended: true,- installUrl: "https://docs.claude.com/en/docs/agents-and-tools/claude-code/overview",- binary: "claude",- },"codex-local": {id: "codex-local",label: "Codex",@@ -35,6 +29,14 @@ export const HARNESS_DISPLAY: Record<HarnessAdapterId, HarnessDisplay> = {installUrl: "https://github.com/openai/codex",binary: "codex",},+ "claude-code-local": {+ id: "claude-code-local",+ label: "Claude Code",+ description: "Run agents through Anthropic's Claude Code CLI. Uses your existing claude login.",+ recommended: false,+ installUrl: "https://docs.claude.com/en/docs/agents-and-tools/claude-code/overview",+ binary: "claude",+ },};export function listRecommendedHarnesses(): HarnessDisplay[] {diff --git a/notfair-cmo/src/types/index.ts b/notfair-cmo/src/types/index.tsindex a59188d3..d79ad355 100644--- a/notfair-cmo/src/types/index.ts+++ b/notfair-cmo/src/types/index.ts@@ -23,8 +23,8 @@ export type Project = {codebase_path: string | null;/*** Which harness adapter runs this project's agents. Picked at- * onboarding. "claude-code-local" is the default and recommended;- * "codex-local" runs through OpenAI's Codex CLI instead.+ * onboarding. "codex-local" is the recommended default; "claude-code-local"+ * runs through Anthropic's Claude Code CLI instead.*/harness_adapter: "claude-code-local" | "codex-local";};