home / skills / quantmind-br / skills / factory

factory skill

/factory

This skill helps you automate development tasks with the Droid CLI, configure AI droids, and integrate AI into CI/CD pipelines.

npx playbooks add skill quantmind-br/skills --skill factory

Review the files below or copy the command above to add this skill to your agents.

Files (5)
SKILL.md
4.2 KB
---
name: factory
description: |
  Official CLI (droid) for Factory, an AI-native development platform.
  Use when you need to automate development tasks, run AI agents in CI/CD,
  configure custom subagents (droids), or manage AI skills and hooks.
  Principais funcionalidades: Interactive REPL, Headless execution, Custom Droids, MCP support.
compatibility: Requires `droid` CLI installed.
allowed-tools: Read, Bash, Write
metadata:
  source: https://docs.factory.ai/
  version: "1.x"
  updated: "2026-01-18"
---

# Factory (Droid CLI) Skill

## Overview

Factory is an AI-native development platform. Its primary tool is the **Droid CLI** (`droid`), which acts as an intelligent coding assistant capable of planning, coding, testing, and reviewing.

Use this skill when you need to:
- Automate coding tasks via CLI
- Configure AI behaviors (Skills, Hooks, Custom Droids)
- Integrate AI into CI/CD pipelines
- Manage Model Context Protocol (MCP) servers

## Installation

```bash
# Verify installation
droid --version

# Login
droid login

# Set API Key (for CI/CD or headless)
export FACTORY_API_KEY="your-key-here"
```

## Quick Start

### Interactive Mode
The main way to use Droid is the interactive REPL.

```bash
# Start a session
droid

# Start with a prompt
droid "Refactor src/utils.ts to use modern patterns"
```

**Key Interactive Shortcuts:**
- `!` (at empty prompt): Toggle **Bash Mode** (run shell commands directly)
- `/`: Access Slash Commands (e.g., `/review`, `/mcp`, `/settings`)

### Headless Mode (Exec)
For automation and scripting, use `droid exec`.

```bash
# Run a single task
droid exec "Check src/ for security vulnerabilities"

# Run with higher autonomy (allow editing)
droid exec --auto medium "Fix lint errors in src/components"
```

## Core Concepts

### Autonomy Levels
Control what Droid can do without permission.

| Level | Flag | Capabilities | Use Case |
|-------|------|--------------|----------|
| **Low** | `--auto low` | Safe edits, formatters | Refactoring, comments |
| **Medium** | `--auto medium` | Run tests, install deps, git commit | Feature dev, bug fixes |
| **High** | `--auto high` | Git push, deploy | CI/CD, full automation |

### Specification Mode (`--use-spec`)
Forces Droid to **plan before coding**. Essential for complex features.

```bash
droid exec --use-spec "Implement the user dashboard feature"
```
Droid will:
1. Analyze requirements
2. Create a detailed plan
3. Ask for approval
4. Execute the plan

## Common Patterns

### Code Review
Review changes against the base branch or uncommitted work.

```bash
# Interactive
/review

# Automation
droid exec "Review this PR for security issues and performance"
```

### Refactoring with Plan
```bash
droid exec --use-spec --auto low "Refactor the Auth service to use the new API client"
```

### Fixing Bugs
```bash
droid exec --auto medium "Run tests, identify the failure in UserTest, and fix it"
```

## Configuration Files

- **Global**: `~/.factory/settings.json` (User preferences)
- **Project**: `.factory/` (Shared configuration)
- **Context**: `AGENTS.md` (Project knowledge base for Droid)
- **Hooks**: `.factory/hooks/` (Lifecycle automation)
- **Skills**: `.factory/skills/` (Reusable capabilities)

## API Quick Reference

| Command | Description | Example |
|---------|-------------|---------|
| `droid` | Start interactive session | `droid` |
| `droid exec` | Run one-off task | `droid exec "Summarize changes"` |
| `droid login` | Authenticate | `droid login` |
| `/mcp` | Manage MCP servers | Type `/mcp` in REPL |
| `/droids` | Manage custom subagents | Type `/droids` in REPL |

## Common Gotchas

1. **Permission Prompts**: By default, `droid exec` prompts for every tool use. Use `--auto <level>` to reduce noise.
2. **Context Limits**: Large repos can overwhelm context. Use `AGENTS.md` to guide Droid on what's important.
3. **Model Selection**: Use `--model` to switch between Claude, GPT, etc., for specific tasks (e.g., use Claude Opus for complex reasoning).

## Additional Resources

- **CLI Reference**: [references/API.md](references/API.md)
- **Examples & Workflows**: [references/EXAMPLES.md](references/EXAMPLES.md)
- **Advanced Config (Hooks/Skills/MCP)**: [references/ADVANCED.md](references/ADVANCED.md)
- **Troubleshooting**: [references/TROUBLESHOOTING.md](references/TROUBLESHOOTING.md)

Overview

This skill provides the official Droid CLI for Factory, an AI-native development platform that automates planning, coding, testing, and reviewing. Use it to run interactive REPL sessions, execute headless tasks in CI/CD, and configure custom subagents (droids) and hooks. It targets developer workflows where AI-assisted automation and repeatable pipelines speed delivery.

How this skill works

The Droid CLI runs either interactively (REPL) or headless (droid exec). In interactive mode you can issue prompts, use slash commands, and toggle Bash mode to run shell commands. Headless mode executes one-off or scripted tasks with configurable autonomy levels and an optional specification mode that forces planning before code changes. Configuration files and project context files guide behavior and reuse.

When to use it

  • Automating development tasks in CI/CD pipelines or developer scripts
  • Running interactive, iterative coding sessions and code reviews
  • Configuring and managing custom subagents (droids) and lifecycle hooks
  • Executing reproducible refactors, bug fixes, or testing workflows
  • Managing Model Context Protocol (MCP) servers and model selection

Best practices

  • Use AGENTS.md to focus Droid on project-relevant context and reduce noise
  • Pick an autonomy level (--auto low|medium|high) that matches risk tolerance
  • Enable --use-spec for multi-step or complex feature work to require approval
  • Store shared settings in .factory/ and personal preferences in ~/.factory/settings.json
  • Prefer headless exec for CI tasks and interactive REPL for exploratory work

Example use cases

  • droid exec --auto medium "Run tests, find failing UserTest, and apply a fix" for automated bug repair
  • Start a REPL session to refactor a module interactively: droid "Refactor src/utils.ts"
  • CI job that runs static analysis and security checks via droid exec with appropriate API key
  • Create a custom droid subagent to handle release notes generation and changelog updates
  • Use --use-spec to plan and implement a new dashboard feature with staged approval

FAQ

How do I reduce prompts during automated runs?

Set an autonomy level with --auto (low/medium/high) to allow Droid to perform actions without interactive permission prompts.

Where do I configure project-wide settings and reusable skills?

Place shared config and skills under the .factory/ directory; user preferences go in ~/.factory/settings.json and hooks in .factory/hooks/.