Skip to content

Add Craft headless agents as an agent runner #14

@Lukavyi

Description

@Lukavyi

Feature Request

Add support for Craft headless agents as an agent runner in mdflow.

What is Craft?

Craft is a modern document and notes app for Mac, iPad, and iPhone with rich formatting, real-time collaboration, and a powerful block-based editor. Craft recently introduced Craft Agents — AI-powered assistants that can read, analyze, and act on your workspace content.

Why Craft Agents?

Craft Agents provides a headless CLI designed specifically for non-interactive automation of AI workflows, making it a natural fit for mdflow's markdown-driven approach:

  • Headless Mode: Runs without user interaction, ideal for automation pipelines
  • Structured Output: Supports --output-format json for easy parsing and integration
  • Model Selection: Allows choosing appropriate models (Haiku for simple queries, Claude for complex tasks)
  • MCP Integration: Connects to external services via Model Context Protocol servers
  • Scheduling-Ready: Designed for cron jobs and recurring automation tasks

Craft Headless Mode Flags

Flag Description
-p "prompt" The prompt to execute
-a "agent" Activate a sub-agent by name
-w "workspace" Select workspace by name
--model Choose model (opus, sonnet, haiku)
--output-format Output format (text, json, stream-json)
--max-turns Limit conversation turns

CLI Example:

craft -p "Summarize my project notes" --output-format text

Potential Integration Points

  1. Filename convention: agent.craft.md (following mdflow's agent.<runner>.md pattern)
  2. Frontmatter mapping: Map frontmatter keys to Craft CLI flags
  3. Output format: Leverage JSON output for chaining workflows
  4. Timeout handling: Built-in timeout support for robust automation

Example Usage

agent.craft.md:

---
model: haiku
output-format: json
max-turns: 5
workspace: my-workspace
---

Summarize the key points from the following content...

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