PROJECT AUTOMATION → BEELZEBUB 2.0

Let an AI agent turn script sprawl into testable components.

Give an agent this playbook. It will audit package scripts, shell files, CI commands, and other task runners; map them into named Beelzebub components; add focused tests; preserve the commands people already use; and prove the migrated workflows still work.

Agent-ready playbook Shell → Tested code package.json · shell · CI · task runners
GIVE THIS TO YOUR AGENT

A complete implementation contract, ready to paste.

The Markdown guide tells an AI coding agent what to inspect, how to model the task graph, which behavior to preserve, what to test, and how to report the result.

01 Discover

Inventory scripts, shell files, task runners, CI, runtime, and existing tests.

02 Design

Map ordering, parallelism, inputs, cleanup, and reusable task boundaries.

03 Implement

Create composable tasks and keep current package and CI entry points stable.

04 Verify

Compare behavior, run the full validation suite, and report every result.

Agent prompt
Migrate this project's task automation from package.json scripts, shell scripts,
CI-only commands, and other task runners to Beelzebub 2.0.

Follow https://beelzebub.io/migrate/agent-guide.md as the implementation contract.

First inventory every public and private automation entry point and run the existing
validation. Preserve command names and behavior. Replace complex command chains with
named, composable Beelzebub tasks; model ordering with $sequence(), independent work
with $parallel(), and reuse or extend shared task packages where useful. Keep package.json
scripts and CI steps as short wrappers around the same task graph.

Use Node 24.15 or newer, choose the project's existing ESM or CommonJS format, and
configure TypeScript task-file loading when needed. Run the full project validation and
representative Beelzebub CLI tasks. Report changed files, commands run, results, risks,
and manual follow-up. Do not commit, push, publish, or deploy unless explicitly authorized.
START WITH THE PROJECT

Move shell logic into workflow code you can test.

The goal is not a dependency swap. It is to move scattered orchestration into one readable task graph without changing the public commands, inputs, or behavior that developers and CI depend on.

01 Package scripts

Untangle long chains, repeated flags, nested npm calls, and concurrency tools.

02 Shell + task runners

Map opaque scripts, Make targets, and tool-specific pipelines into named tasks.

03 CI-only commands

Stop duplicating workflow logic across local scripts, containers, and CI jobs.

DESIGN THE TASK GRAPH

Preserve the commands. Replace the sprawl.

An agent should inventory every entry point before editing, then translate how the work behaves—not merely copy shell strings into task methods. Each public workflow should end with a focused behavioral test.

Existing automation Beelzebub task model
Long && chains Explicit ordered work with $sequence()
concurrently and background jobs Independent work with $parallel()
Commands copied across scripts, CI, and docs One named task called from every interface
Opaque shell entry points Focused, typed task classes organized by domain
Shared steps copied between repositories Imported task packages, subtasks, or extended task classes

Keep familiar npm script names as short wrappers. Developers and CI keep using npm run verify; Beelzebub owns the orchestration behind it.

BEFORE + AFTER

Turn a release script into a task graph.

This is the kind of automation the agent should convert: repeated work, hidden ordering, and multiple entry points that can quietly drift apart.

package.json · before
{
  "scripts": {
    "clean": "rimraf dist artifacts",
    "lint": "eslint .",
    "typecheck": "tsc --noEmit",
    "test": "vitest run",
    "build": "tsc -p tsconfig.build.json",
    "package": "node tools/package.mjs",
    "publish:artifacts": "node tools/publish.mjs",
    "verify": "concurrently --kill-others-on-fail \"npm:lint\" \"npm:typecheck\" \"npm:test\"",
    "release": "npm run clean && npm run verify && npm run build && npm run package && npm run publish:artifacts",
    "ci": "npm ci && npm run clean && npm run lint && npm run typecheck && npm test && npm run build"
  }
}
beelzebub.js · after
import bz from 'beelzebub';
import {
  cleanOutput, lintProject, typecheckProject, testProject,
  buildProject, packageProject, publishArtifacts
} from './tools/project.js';

export default class Project extends bz.Tasks {
  verify() {
    return this.$parallel('.lint', '.typecheck', '.test');
  }

  release() {
    return this.$sequence('.clean', '.verify', '.build', '.package', '.publish');
  }

  async clean() { await cleanOutput(); }
  async lint() { await lintProject(); }
  async typecheck() { await typecheckProject(); }
  async test() { await testProject(); }
  async build() { await buildProject(); }
  async package() { await packageProject(); }
  async publish() { await publishArtifacts(); }
}
package.json · after
{
  "scripts": {
    "clean": "bz Project.clean",
    "lint": "bz Project.lint",
    "typecheck": "bz Project.typecheck",
    "test": "bz Project.test",
    "build": "bz Project.build",
    "package": "bz Project.package",
    "publish:artifacts": "bz Project.publish",
    "verify": "bz Project.verify",
    "release": "bz Project.release",
    "ci": "npm ci && bz Project.clean Project.verify Project.build"
  }
}

Every original script still has an equivalent entry point. The CI dependency install stays before bz because it must install Beelzebub before the task runner can start.

COMPOSE ACROSS PROJECTS

Import shared tasks. Extend only what is different.

Beelzebub tasks can come from installed packages as well as local files. Load task classes together, organize them as subtasks, or extend a shared task class and override only the project-specific behavior.

beelzebub.js
import SharedQuality from '@acme/beelzebub-quality';
import ProjectTasks from './tasks/project.js';

class Quality extends SharedQuality {
  async lint() {
    await lintWithProjectRules();
  }
}

export default [Quality, ProjectTasks];
PROVE THE MIGRATION

Behavior first. Green checks at the end.

  1. Inventory every automation entry point and record pre-existing failures.
  2. Preserve command names, inputs, environment variables, order, and exit behavior.
  3. Use Node 24.15 or newer and install Beelzebub 2.0 with the project’s package manager.
  4. Exercise both bz --file ./tasks.js and bz -f ./tasks.js when documented.
  5. Run the project’s format, lint, typecheck, test, build, and package validation.
  6. Compare every converted workflow with its previous behavior and report the evidence.