New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

speci

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

speci

CLI tool for orchestrating Copilot-driven development workflows

latest
Source
npmnpm
Version
0.13.3
Version published
Maintainers
1
Created
Source

speci

CI Release codecov npm version Node.js TypeScript License: MIT

AI-powered implementation loop orchestrator for GitHub Copilot. Speci automates development workflows by dispatching Copilot agents to plan, implement, review, and fix code, with quality gate validation (lint, typecheck, test) between each step.

Speci Run Screenshot

How It Works

Speci operates as an autonomous loop that reads a PROGRESS.md file to determine what needs to be done, then dispatches the appropriate Copilot agent:

  • Plan your feature or change (generates a structured plan)
  • Task breaks the plan into trackable tasks with a PROGRESS.md file
  • Run enters the implementation loop:
  • When tasks remain incomplete (state: WORK_LEFT), an implementation agent is dispatched
  • Gate validation runs your lint, typecheck, and test commands
  • If gates fail, a fix agent attempts repairs (up to a configurable limit)
  • Tasks marked IN_REVIEW get a review agent
  • When all remaining tasks are blocked (state: BLOCKED), a tidy agent is dispatched
  • The loop continues until all tasks are DONE or limits are reached

Workflow Diagram

  ┌─────────────────────────────────────────────────────────────────────┐
  │                        speci workflow                               │
  └─────────────────────────────────────────────────────────────────────┘

  ┌──────────┐      ┌──────────┐      ┌──────────────────────────────┐
  │          │      │          │      │          speci run           │
  │  plan    ├─────►│  task    ├─────►│    (implementation loop)     │
  │  agent   │      │  agent   │      │                              │
  └──────────┘      └──────────┘      └──────────────┬───────────────┘
   Generates a       Breaks plan                     │
   structured        into tasks &                    ▼
   plan              PROGRESS.md          ┌─────────────────────┐
                                          │  Read PROGRESS.md   │◄─────────────┐
                                          │  Determine STATE    │              │
                                          └────────┬────────────┘              │
                         ┌─────────────────────────┼──────────────────┐        │
                         │                         │                  │        │
                         ▼                         ▼                  ▼        │
                  ┌─────────────┐         ┌──────────────┐   ┌────────────┐    │
                  │  WORK_LEFT  │         │  IN_REVIEW   │   │  BLOCKED   │    │
                  └──────┬──────┘         └──────┬───────┘   └─────┬──────┘    │
                         │                       │                 │           │
                         ▼                       ▼                 ▼           │
                  ┌─────────────┐         ┌──────────────┐   ┌────────────┐    │
                  │    impl     │         │   review     │   │   tidy     │    │
                  │    agent    │         │   agent      │   │   agent    │    │
                  └──────┬──────┘         └──────┬───────┘   └─────┬──────┘    │
                         │                       │                 │           │
                         ▼                       │                 │           │
                  ┌─────────────┐                │                 │           │
                  │  run gates  │                │                 │           │
                  │ lint/type/  │                │                 │           │
                  │   test      │                │                 │           │
                  └──┬──────┬───┘                │                 │           │
                     │      │                    │                 │           │
                pass ▼      ▼ fail               │                 │           │
                     │ ┌─────────┐               │                 │           │
                     │ │  fix    │               │                 │           │
                     │ │  agent  │               │                 │           │
                     │ └────┬────┘               │                 │           │
                     │      │                    │                 │           │
                     │      ▼                    │                 │           │
                     │ ┌─────────┐               │                 │           │
                     │ │ re-run  │               │                 │           │
                     │ │ gates   ├──► (retry up  │                 │           │
                     │ └─────────┘    to N times)│                 │           │
                     │                           │                 │           │
                     └───────────┬───────────────┘                 │           │
                                 │                                 │           │
                                 └────────────┬────────────────────┘           │
                                              │                                │
                                              ▼                                │
                                    ┌───────────────────┐                      │
                                    │  State changed?   │                      │
                                    │  DONE? ─► exit    │                      │
                                    │  otherwise ───────┼──────────────────────┘
                                    └───────────────────┘

Agent Summary

AgentTriggered ByPurpose
planspeci planGenerate a structured implementation plan
taskspeci taskBreak plan into tasks and create PROGRESS.md
refactorspeci refactorAnalyze codebase for refactoring opportunities
implWORK_LEFTImplement the next task
reviewIN_REVIEWReview completed work for correctness
fixGate failureRepair lint, typecheck, or test failures
tidyBLOCKEDClean up or unblock dependencies

Quick Start

# Initialize speci in your project
npx speci init

# Create a plan from a prompt or design doc
npx speci plan -p "Add user authentication with JWT"

# Break the plan into tasks and generate PROGRESS.md
npx speci task --plan docs/plan.md

# Run the implementation loop
npx speci run

Or run the entire plan → task → run pipeline in one command:

npx speci yolo -p "Add user authentication with JWT"

Prerequisites

  • Node.js 22.0.0 or later
  • GitHub Copilot CLI installed and authenticated
  • Git repository initialized in your project

Install GitHub Copilot CLI

# Install via npm (all platforms)
npm install -g @github/copilot

# Or via WinGet (Windows)
winget install GitHub.Copilot

# Or via Homebrew (macOS/Linux)
brew install copilot-cli

On first launch, use the /login slash command to authenticate, or set the GH_TOKEN environment variable with a personal access token.

See https://docs.github.com/en/copilot/how-tos/copilot-cli/install-copilot-cli for more details.

Installation

# Run directly without installing
npx speci --help

# Or install globally
npm install -g speci

Commands

All commands support -v, --verbose for detailed output and --no-color to disable colored output.

Speci Commands Screenshot

speci init (alias: i)

Initialize speci in your current project. Creates configuration files, task directories, and Copilot agent definitions.

npx speci init

Options:

FlagDescription
-u, --update-agentsUpdate agent files even if they already exist

Creates:

  • speci.config.json in the project root
  • docs/tasks/ directory for task definitions
  • .speci-logs/ directory for execution logs
  • .github/agents/ directory with Copilot agent definitions
# Update bundled agent files to the latest version
npx speci init --update-agents

speci plan (alias: p)

Generate an implementation plan using Copilot. Requires at least --prompt or --input.

npx speci plan -p "Build a REST API for user authentication"

Options:

FlagDescription
-p, --prompt <text>Initial prompt describing what to plan
-i, --input <files...>Input files for context (design docs, specs)
-o, --output <path>Save plan to a specific file
--sleep-afterPut machine to sleep after command completes
# Plan using a design doc as context
npx speci plan -i docs/design.md

# Combine input files with a prompt
npx speci plan -i spec.md -p "Focus on the authentication module"

# Save plan to a specific file
npx speci plan -i design.md -o docs/plan.md

speci task (alias: t)

Generate task definitions and a PROGRESS.md file from an implementation plan.

npx speci task --plan docs/plan.md

Options:

FlagDescription
-p, --plan <path>Path to plan file (required)
-c, --cleanClean task files and progress before generating
--sleep-afterPut machine to sleep after command completes
# Clean existing tasks and regenerate from a new plan
npx speci task --clean --plan docs/plan.md

speci refactor (alias: r)

Analyze the codebase for refactoring opportunities using Copilot.

npx speci refactor

Options:

FlagDescription
-s, --scope <path>Directory or glob pattern to analyze
-o, --output <path>Save refactoring plan to a file
# Analyze a specific directory
npx speci refactor --scope src/

# Analyze only TypeScript files
npx speci r -s "src/**/*.ts"

# Save the refactoring plan
npx speci refactor -o docs/refactor-plan.md

speci status (alias: s)

Show current loop state and task statistics. By default, opens a live fullscreen dashboard that refreshes automatically. Press q or ESC to exit the dashboard.

npx speci status

Options:

FlagDescription
--jsonOutput status as JSON and exit
--onceShow status once and exit (non-interactive)

Status fields:

  • Current loop state (WORK_LEFT, IN_REVIEW, BLOCKED, DONE)
  • Task statistics (total, completed, remaining, in review, blocked)
  • Lock status and current task
# Static one-time output
npx speci status --once

# Machine-readable output for scripts
npx speci s --json

speci run

Execute the implementation loop. This is the main command that drives autonomous development. It acquires a lock file to prevent concurrent runs and logs all agent activity to .speci-logs/.

npx speci run

Options:

FlagDescription
--max-iterations <n>Maximum loop iterations (default: 100)
--dry-runShow what would execute without running
--verifyPause on manual verification tasks (MVTs) at milestone boundaries
--forceOverride an existing lock file
-y, --yesSkip the confirmation prompt
--sleep-afterPut machine to sleep after command completes

This command has no short alias, by design, to prevent accidental execution.

# Preview what would happen
npx speci run --dry-run

# Limit to 10 iterations
npx speci run --max-iterations 10

# Skip confirmation and force past a stale lock
npx speci run -y --force

Verify Mode (Human-in-the-Loop)

Speci supports milestone verification testing (MVT) - manual checkpoints at milestone boundaries where a human reviews the completed work before the loop continues.

Enable verify mode with the --verify flag:

npx speci run --verify

Startup check: Before acquiring the lock, speci checks if any milestones have all tasks completed but an unfinished MVT. If found, it warns and prompts Continue anyway? [y/N].

In-loop pause: During each iteration, if the current milestone's tasks are all done and an MVT is ready, speci pauses the loop, releases the lock, and exits cleanly. Perform the manual verification, mark the MVT as COMPLETE in PROGRESS.md, then re-run speci run --verify.

Flag interactions:

  • --yes auto-continues past the startup MVT warning without prompting
  • --dry-run displays MVT status per milestone without executing
  • Non-TTY environments abort automatically if --yes is not set

Note: speci yolo intentionally does not support --verify - it is designed for fully unattended operation.

speci yolo

Run the full plan → task → run pipeline in a single unattended command. Accepts the same options as speci plan and forwards them automatically through each phase. The run phase is started with --yes automatically, so no confirmation prompt is shown.

npx speci yolo -p "Build a REST API for user authentication"

Options:

FlagDescription
-p, --prompt <text>Initial prompt describing what to plan
-i, --input <files...>Input files for context (design docs, specs)
-o, --output <path>Save plan to a specific file
--forceOverride an existing lock file
--sleep-afterPut machine to sleep after command completes

Requires at least --prompt or --input. Only one yolo command can run at a time - a lock file prevents concurrent executions.

# Run full pipeline from a design doc
npx speci yolo -i docs/design.md

# Combine input files with a prompt
npx speci yolo -i spec.md -p "Focus on the authentication module"

# Override a stale lock
npx speci yolo -p "Build feature" --force

speci clean (alias: c)

Remove generated task files and the PROGRESS.md file. Useful for resetting before re-running the full pipeline. This command is safe to run multiple times (idempotent) and refuses to run while a lock file is present.

npx speci clean

Options:

FlagDescription
-v, --verboseShow detailed output
# Reset and regenerate tasks from a plan
npx speci clean
npx speci task --plan docs/plan.md

# Or combine into a single task command
npx speci task --clean --plan docs/plan.md

Configuration

speci.config.json

Created by speci init. Speci discovers this file by walking up from the current directory, similar to how ESLint finds its config.

{
  "version": "1.0.0",
  "paths": {
    "progress": "docs/PROGRESS.md",
    "tasks": "docs/tasks",
    "logs": ".speci-logs",
    "lock": ".speci-lock"
  },
  "copilot": {
    "permissions": "allow-all",
    "models": {
      "plan": "claude-opus-4.6",
      "task": "claude-sonnet-4.6",
      "refactor": "claude-sonnet-4.6",
      "impl": "gpt-5.3-codex",
      "review": "claude-sonnet-4.6",
      "fix": "claude-sonnet-4.6",
      "tidy": "gpt-5.2"
    },
    "extraFlags": []
  },
  "gate": {
    "commands": ["npm run lint", "npm run typecheck", "npm test"],
    "maxFixAttempts": 5,
    "strategy": "sequential"
  },
  "loop": {
    "maxIterations": 100
  }
}

Configuration Reference

paths - File and directory locations used by speci.

FieldDefaultDescription
progressdocs/PROGRESS.mdPath to the progress tracking file
tasksdocs/tasksDirectory for task definition files
logs.speci-logsDirectory for execution logs
lock.speci-lockLock file to prevent concurrent runs

copilot - Copilot CLI settings.

FieldDefaultDescription
permissionsallow-allPermission mode: allow-all, yolo, strict, or none
models(see above)Model to use for each agent type
extraFlags[]Additional flags passed to the Copilot CLI

gate - Quality gate configuration. Gate commands run after each implementation step.

FieldDefaultDescription
commands["npm run lint", ...]Shell commands to run as quality gates
maxFixAttempts5Maximum automatic fix attempts after gate failures (0 to disable)
strategysequentialsequential or parallel execution of gate commands

Parallel strategy can be 30-50% faster but requires that gate commands are independent (no shared resources like lock files or ports).

loop - Loop behavior settings.

FieldDefaultDescription
maxIterations100Maximum loop iterations before stopping

Environment Variables

Environment variables override corresponding config file settings.

VariableConfig PathDescription
SPECI_PROGRESS_PATHpaths.progressPath to PROGRESS.md file
SPECI_TASKS_PATHpaths.tasksPath to tasks directory
SPECI_LOG_PATHpaths.logsPath to log directory
SPECI_LOGS_PATHpaths.logsAlias for SPECI_LOG_PATH
SPECI_LOCK_PATHpaths.lockPath to lock file
SPECI_MAX_ITERATIONSloop.maxIterationsMaximum loop iterations
SPECI_MAX_FIX_ATTEMPTSgate.maxFixAttemptsMaximum fix attempts
SPECI_COPILOT_PERMISSIONScopilot.permissionsPermission mode
SPECI_DEBUGN/AEnable debug logging (1 or true)
SPECI_ASCIIN/AForce ASCII glyph fallback
SPECI_NO_ANIMATIONN/ADisable banner animation
NO_COLORN/ADisable colored output

Speci warns if it detects an unknown SPECI_* environment variable that looks like a typo of a known one.

Error Codes

Speci uses structured error codes for diagnostics. Use --verbose to see full error details including causes and suggested solutions.

Prerequisite Errors (ERR-PRE-*)

CodeMessageSolution
ERR-PRE-01Copilot CLI is not installedRun npm install -g @github/copilot
ERR-PRE-02Copilot CLI is not authenticatedRun /login in Copilot CLI or set GH_TOKEN
ERR-PRE-03Not a git repositoryRun git init in your project root
ERR-PRE-04Configuration file not foundRun npx speci init
ERR-PRE-05PROGRESS.md file not foundRun npx speci task --plan <plan-file>
ERR-PRE-06No PROGRESS.md found during runGenerate tasks first with npx speci task

Input Errors (ERR-INP-*)

CodeMessageSolution
ERR-INP-01Required argument missingCheck command usage with --help
ERR-INP-02Agent file not foundVerify the path, or set to null in config for bundled agents
ERR-INP-03Config file is malformedFix JSON syntax in speci.config.json
ERR-INP-04Config validation failedCheck config values against the reference above
ERR-INP-05Plan file not foundProvide a valid path with --plan
ERR-INP-06Config version is not compatibleUpdate to version 1.x or re-run npx speci init
ERR-INP-07Path escapes project directoryUse paths within the project root, avoid ../ traversal
ERR-INP-08Invalid permissions valueUse allow-all, yolo, strict, or none
ERR-INP-09Invalid maxFixAttempts valueMust be a non-negative integer (0 disables fix attempts)
ERR-INP-10Invalid maxIterations valueMust be a positive integer
ERR-INP-11Subagent prompt not foundReinstall speci or provide a custom agent path

State Errors (ERR-STA-*)

CodeMessageSolution
ERR-STA-01Another speci instance is runningWait for it to finish or use --force
ERR-STA-02Cannot parse PROGRESS.mdVerify the markdown table format in PROGRESS.md
ERR-STA-03Invalid state transitionCheck PROGRESS.md state markers
ERR-STA-04Malformed milestone headerCheck the ## Milestone: heading format in PROGRESS.md
ERR-STA-05Unknown MVT statusVerify the MVT status column value in PROGRESS.md
ERR-STA-06Failed to read milestone stateCheck file permissions and PROGRESS.md path in config

Execution Errors (ERR-EXE-*)

CodeMessageSolution
ERR-EXE-01Gate command failedFix lint, typecheck, or test errors in your code
ERR-EXE-02Copilot execution failedCheck Copilot authentication and permissions
ERR-EXE-03Max iterations reachedReview progress and increase --max-iterations if needed
ERR-EXE-04Max fix attempts exceededReview gate failures and fix issues manually
ERR-EXE-05Failed to create directoryCheck file system permissions and disk space
ERR-EXE-06Failed to write fileCheck file system permissions and disk space
ERR-EXE-07Agent templates directory not foundReinstall speci
ERR-EXE-08Failed to copy agent filesCheck file system permissions and disk space
ERR-EXE-09Failed to read tasks directoryCheck directory permissions and ensure the path exists
ERR-EXE-10Failed to delete during cleanCheck file permissions and ensure no other process has the file open

Exit Codes

CodeMeaning
0Success
1General error
2Invalid command or arguments
130Interrupted by SIGINT (Ctrl+C)
143Terminated by SIGTERM

Troubleshooting

"Copilot CLI not found"

The GitHub Copilot CLI must be installed and available in your PATH:

# Install via npm
npm install -g @github/copilot

# Or via WinGet (Windows)
winget install GitHub.Copilot

# Or via Homebrew (macOS/Linux)
brew install copilot-cli

# Verify installation
copilot --version

"Another speci instance is running"

A lock file from a previous run may still exist:

# Check if speci is actually running
# On Linux/macOS:
ps aux | grep speci
# On Windows:
tasklist | findstr speci

# If the process is not running, force past the stale lock
npx speci run --force

# Or remove the lock file manually
rm .speci-lock

"Config file not found"

Initialize speci in your project:

npx speci init

"PROGRESS.md file not found"

Generate tasks from a plan first. The task command creates the PROGRESS.md file:

npx speci plan -p "Describe what you want to build"
npx speci task --plan docs/plan.md

Gate commands failing

Speci runs gate commands defined in speci.config.json. Make sure your project has the corresponding scripts in package.json:

{
  "scripts": {
    "lint": "eslint .",
    "typecheck": "tsc --noEmit",
    "test": "vitest run"
  }
}

You can customize which commands speci runs by editing the gate.commands array in speci.config.json.

Verbose mode

Use --verbose (or -v) with any command for detailed output including stack traces, config loading details, state transitions, and timing information:

npx speci run --verbose

# Or set the environment variable
SPECI_DEBUG=1 npx speci run

License

MIT

FAQs

Package last updated on 13 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts