Skip to content

move @docs to docs mode #64

@kalil0321

Description

@kalil0321

Follow-up tracked from PR #63 (tag-system removal). The @docs tag was removed at the user-facing surface, but the underlying output_mode="docs" codepath is intentionally left dormant so a dedicated docs subcommand can be wired without re-implementing the engine.

What's already in place (dormant)

Location What it does
engineer.run_reverse_engineering(..., output_mode="docs") SDK dispatch already accepts output_mode
base_engineer._get_existing_client_guidance Switches existing_label/existing_artifact between "scripts"/"docs" automatically
cli.run_engineer(..., output_mode="client") Internal helper accepts output_mode, but no caller passes "docs" today
prompts/engineer/user.md Template variable tag_mode_label flips to "Documentation" when docs mode is active

What the follow-up PR needs

  1. New click subcommand docs:
    • Args/flags mirroring engineer: positional run_id (optional — defaults to latest run), -p/--prompt (override), -m/--model, -o/--output-dir
    • When called: run_engineer(run_id, output_mode="docs", ...)
    • Latest-run resolution: session_manager.get_history(limit=1)[0]["run_id"] when no positional given (mirrors what the old @docs standalone tag did)
  2. HAR-existence guard: the old @docs path validated that recording.har exists for the target run before running. Replicate that check in the new subcommand to keep the same error UX.
  3. Output directory: docs go under get_docs_dir(run_id, output_dir) (already exists in utils.py). Make sure the new subcommand surfaces the resulting path on success.
  4. README: add a Docs Mode section under Usage Modes between Engineer Mode and Agent Mode.
  5. CHANGELOG (Unreleased): document the new docs subcommand and reference this issue.
  6. Tests: a tests/test_cli_docs_command.py mirroring the structure of test_cli_engineer_command.py — covers docs (no args → latest run), docs <run_id>, docs <run_id> -p "...", missing-HAR error.

Out of scope here

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions