Skip to content

[init] --ai-assist flag for LLM-drafted persona bodies (Approach B fast-follow) #318

@dep0we

Description

@dep0we

Context

Filed at PR 1 close of the init-wizard arc (#94). PR 1 shipped Approach A (structured Q&A + one starter template, no LLM call mid-wizard). Approach B from the office-hours D2 question is the natural fast-follow: a --ai-assist flag that swaps the seven-question Q&A for a single open-ended question and uses the operator's configured LLM to draft IDENTITY/SOUL/USER bodies.

What

Add --ai-assist to atomic-agents init. When the flag is set:

  1. Wizard runs the same entry guards (non-TTY refusal, persona-backend warning, API key pre-flight).
  2. Instead of Q1-Q7 Q&A, the wizard asks ONE question: "Describe your agent in 2-3 sentences. What is its job, how should it behave, who is the operator?"
  3. Wizard calls the configured LLM (_llm._call_anthropic or equivalent) with a system prompt that produces a structured JSON response: {identity_md, soul_md, user_md, tools_md_hard_nos, autonomy_preset}.
  4. Wizard renders each field through the existing string.Template.safe_substitute templates so the file structure stays identical to the structured-Q&A path.
  5. Operator reviews each generated file inline (rich.panel) and can Accept / Edit / Regenerate.

Why

Persona text quality from day one matches what a thoughtful operator would hand-write. Closes the last "hand-edit afterward" gap from the half-day deploy that PR 1's structured Q&A leaves on the table.

ANTHROPIC_API_KEY is already required for the agent's first call, so no new dependency or auth surface.

Effort

human ~1.5 weeks / CC ~3 days. Reuses everything PR 1 builds; one new flag + one new code path + ~5 tests + spec/35 amendment.

Acceptance

  • atomic-agents init my-agent --ai-assist produces a doctor-clean scaffold whose persona text reflects the operator's description.
  • Tests cover the happy path (mocked LLM returns valid JSON), parse error (LLM returns malformed JSON), accept/edit/regenerate UX loop, and the existing entry guards still fire on this path.
  • spec/35 documents the flag + the prompt shape.

Deferred from

Office-hours D2 (Approach B fast-follow): #317

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions