Catalog
mastra-ai/mastra-factory

mastra-ai

mastra-factory

Operate and supervise Mastra Factory through `mastra api factory`. Use for first-time Factory connection and login, status or queue summaries, project and work-item inspection, thread history and memory, metrics, health, decisions, attention, and user-authorized autonomous or interactive Factory operations on hosted, local, remote, or self-hosted servers.

NewUpdated Nov 27, 2026

Mastra Factory

Use mastra api factory as the operational control plane for Factory.

First use: connect before inspecting

Read references/connection.md. Check CLI availability, establish the user's actual Factory URL, and for platform-hosted deployments run mastra auth whoami. If logged out, offer mastra auth login rather than silently starting browser login. Local/self-hosted authentication may differ.

An explicit mastra api --url "$FACTORY_URL" factory project list works from an empty directory; no deployed repository or .mastra-project.json is required. Never assume a shared host, organization, project name, or ID. Preserve the explicit target on subsequent commands.

Default behavior

For status, inspection, diagnosis, queue review, or recommendation requests:

  1. Stay read-only.
  2. Select the sole or explicitly named project; report choices when ambiguous.
  3. Inspect project state, work items, metrics, thresholds, decisions, and attention.
  4. Correlate stages, revisions, sessions, decisions, and attention items.
  5. Report active/queued work, blocked or unhealthy items, running sessions, pending decisions, human attention, and one recommended next action.
  6. Execute a recommendation only when the current request or a previously granted operating scope authorizes it.

Required reference

Read references/factory-cli.md before running Factory commands for output control, contracts, the read-only workflow, mutation protocol, governance constraints, durable-session limitations, and error handling.

For “my work,” actual execution progress, thread messages, memory, or health interpretation, also read references/session-inspection.md. Distinguish card stages from running agents, historical messages from current memory, and agent claims from verified repository outcomes.

Safety boundary

  • Never read or reveal .env, bearer tokens, saved login contents, or platform/provider credentials.
  • Never invent IDs, stages, revisions, request IDs, or sessions.
  • Establish the user's operating scope before mutating. Authorization may cover one action or grant standing autonomy over named projects, resources, action types, or objectives.
  • Within a clear delegated scope, act without asking for confirmation before every mutation. Ask only when an action is ambiguous, outside scope, or materially more destructive than the granted authority.
  • Fetch current state before a write, make the smallest in-scope change, then refetch and report IDs, revisions, and final state.
  • Use transitions—not metadata updates—for stage changes, with the current revision and a fresh UUID request ID.
  • Never use private HTTP routes to bypass unsupported CLI operations.
  • If work-item start lacks a supported durable user session, report the block; never substitute another session or invent a session UUID.
Files4
4 files · 37.4 KB

Select a file to preview

Overall Score

88/100

Grade

A

Excellent

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

92

Quality

87

Clarity

85

Completeness

83

Summary

Mastra Factory is an operational control plane skill for inspecting and managing Factory projects, work items, decisions, and sessions through the `mastra api factory` CLI. It guides agents through read-only inspection workflows, mutation protocols with authority verification, and error handling patterns for hosted, local, remote, or self-hosted deployments.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Credential Exposure
SEC-020Direct .env File Access2x in 2 files

Direct .env file access

SKILL.md.env
references/factory-cli.md.env

Detected Capabilities

CLI executionJSON parsing and filteringHTTP requests (through CLI)File reading (references, connection config)Environment variable usageShell scripting and command chainingAuthentication (CLI-managed login)Project/resource inspectionData mutation (transitions, creates, decisions)

Trigger Keywords

Phrases that agents use to match this skill to user intent.

factory queue healthwork item statusapprove decisiontransition work itemfactory project inspectthread and memoryautonomous delegation

Risk Signals

INFO

Direct .env file access mentioned in context

SKILL.md | 'Never read or reveal `.env`'
INFO

Security boundary explicitly states .env should NEVER be read or revealed

SKILL.md, line ~50 | Safety boundary section
INFO

Direct .env file access in references

references/factory-cli.md | 'Never read or expose `.env`'
INFO

Bearer tokens and credentials access forbidden

SKILL.md | Safety boundary
INFO

No prompt injection patterns detected

N/A
INFO

No pipe-to-shell or remote code execution patterns

N/A
INFO

No recursive deletion or privilege escalation

N/A

Referenced Domains

External domains referenced in skill content, detected by static analysis.

github.comlocalhostwww.apache.org

Use Cases

  • Inspect Factory project status and queue health
  • Review work items, running sessions, and decisions
  • Manage work-item transitions and approval workflows
  • Diagnose blocked or stale work and attention items
  • Start autonomous work runs with delegated authority
  • Read thread history and observational memory
  • Execute high-impact mutations (transitions, starts) within delegated scope

Quality Notes

  • Excellent safety boundary documentation: explicitly forbids .env access, credential reads, and secret exfiltration with rationale
  • Clear delegation model distinguishes between read-only, single-action, and standing-delegation authority; prevents unauthorized mutations
  • Comprehensive error handling guidance for shell failures, CLI JSON errors, revision conflicts, and pagination edge cases
  • Well-structured reference files with separation of concerns: connection setup (connection.md), CLI contracts and mutation protocol (factory-cli.md), session/memory interpretation (session-inspection.md)
  • Authoritative contract discovery pattern using `--schema` and `--help` prevents argument guessing and accidental CLI misuse
  • Detailed pagination and compatibility fallback guidance prevents silent data loss or false claims of complete coverage
  • Strong emphasis on fetching current state before mutations and refetching afterward — prevents race conditions and ensures audit trail
  • Practical examples with correct variable scoping and explicit target preservation on every command
  • Distinguishes deployed state from agent claims and validates outcomes independently (e.g., 'tests passed' in text vs. test result objects)
  • Safety boundary section is placed early and prominently; reinforced throughout the skill with specific action-class constraints
Model: claude-haiku-4-5-20251001Analyzed: Nov 27, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

  1. v2.4

    Content updated

    ✦ AIReference documentation updated in factory-cli.md.

    2026-11-27

    LATEST
  2. v2.3

    Content updated

    ✦ AIUpdates reference documentation in factory-cli.md.

    2026-11-12

    View This Version
  3. v2.2

    Content updated

    ✦ AIReference documentation updated in factory-cli.md.

    2026-11-10

    View This Version
  4. v2.1

    Content updated

    ✦ AIReference documentation in factory-cli.md updated.

    2026-11-05

    View This Version
  5. v2.0

    Contract changed: description

    ✦ AIRemoves supervisor session and health inspection scope; replaces factory-supervisor.md reference with factory-cli.md; updates safety guidance on session substitution.

    triggering2026-11-03

    View This Version
  6. v1.0

    2026-10-12

    View This VersionInitial version

Use mastra-ai/mastra-factory in your dev environment

Command Palette

Search for a command to run...