Skip to content

API Reference parrot.cli.devloop.intake

github-actions[bot] edited this page Nov 10, 2026 · 4 revisions

parrot.cli.devloop.intake

View source

Free-text feature intake for parrot devloop (FEAT-388, Module 2).

Turns a user's free-text feature request into a structured :class:FeatureDraft (via a configurable light LLM, DEV_LOOP_INTAKE_LLM), renders it as a brainstorm markdown document under sdd/proposals/ (FEAT-145 frontmatter, never overwriting an existing file), and assembles the resulting :class:~parrot.flows.dev_loop.models.FeatureBrief.

This module is CLI-side only — FeatureDraft and FeatureIntake are NOT part of parrot.flows.dev_loop.models (spec §2). Heavy imports (parrot.conf, parrot.clients.factory, parrot.flows.dev_loop.*) are deferred into method bodies so importing this module (and therefore parrot devloop --help) stays fast.

Attribute DEFAULT_INTAKE_LLM

Alias DevAgentSpec

Re-exported from parrot.flows.dev_loop.models.DevAgentSpec.

Alias FeatureBrief

Re-exported from parrot.flows.dev_loop.models.FeatureBrief.

Class FeatureDraft

Structured draft the intake LLM fills from the user's free text.

Fields:

Field Type Default Description
title str
slug str '' kebab-case, used for the document filename; sanitized/derived from title if empty or invalid.
problem_statement str
requirements list[str]
acceptance_criteria list[str]
affected_areas list[str]
out_of_scope list[str]
open_questions list[str]

Class FeatureIntake

Free text → :class:FeatureDraft → brainstorm document → FeatureBrief.

Parameter Type Default Description
llm str | None None Explicit "provider:model" spec. When None, resolved lazily from DEV_LOOP_INTAKE_LLM (default :data:DEFAULT_INTAKE_LLM).
proposals_dir Path | None None Directory generated brainstorm documents are written to. Defaults to sdd/proposals (relative to the process cwd, matching every other SDD command).

Attributes:

Attribute Type Description
logger Module logger.

Method FeatureIntake.generate

Draft a :class:FeatureDraft from a user's free-text request.

generate(text: str) -> FeatureDraft

Parameter Type Default Description
text str The user's free-text feature request.

Returns: FeatureDraft — The parsed, structured draft.

Raises:

  • ValueError — If the LLM fails to produce a valid draft twice in a row (one retry, per spec §3 Module 2).

Method FeatureIntake.regenerate

Re-draft the :class:FeatureDraft, incorporating user guidance.

regenerate(text: str, guidance: str) -> FeatureDraft

Parameter Type Default Description
text str The original free-text feature request.
guidance str The user's redo <guidance> feedback on the last draft.

Returns: FeatureDraft — The parsed, structured draft.

Raises:

  • ValueError — If the LLM fails to produce a valid draft twice in a row (one retry, per spec §3 Module 2).

Method FeatureIntake.write_document

Render draft as a brainstorm markdown document.

Never overwrites an existing file — collides on slug append -2, -3, … suffixes.

write_document(draft: FeatureDraft) -> Path

Parameter Type Default Description
draft FeatureDraft The structured draft to render.

Returns: Path — The path the document was written to.

Method FeatureIntake.build_brief

Assemble the :class:FeatureBrief for this intake session.

build_brief(draft: FeatureDraft, document_path: Path, *, dev_agents: list[DevAgentSpec] | None = None, judge_panel: JudgePanelConfig | None = None) -> FeatureBrief

Parameter Type Default Description
draft FeatureDraft The confirmed structured draft (unused beyond having driven document_path's contents; kept in the signature for symmetry/future use).
document_path Path Path returned by :meth:write_document.
dev_agents list[DevAgentSpec] | None None Optional explicit dev-agent pool.
judge_panel JudgePanelConfig | None None Optional QA judge-panel override.

Returns: FeatureBrief — A FeatureBrief(document_kind="brainstorm") ready for dispatch.

Alias JudgePanelConfig

Re-exported from parrot.flows.dev_loop.models.JudgePanelConfig.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally