Skip to main content

cmd_context

Function cmd_context 

Source
pub fn cmd_context(
    beans_dir: &Path,
    id: &str,
    json: bool,
    structure_only: bool,
) -> Result<()>
Expand description

Assemble complete agent context for a bean — the single source of truth.

Outputs everything an agent needs to implement this bean:

  1. Bean spec — ID, title, verify, priority, status, description, acceptance
  2. Previous attempts — what was tried and failed
  3. Project rules — conventions from RULES.md
  4. Dependency context — sibling beans that produce required artifacts
  5. File structure — function signatures and imports
  6. File contents — full source of referenced files

File paths are merged from explicit bean.paths field (priority) and regex-extracted paths from the description (fills gaps).

When structure_only is true, only structural summaries are emitted.