@gilangjavier/agent-taskfile
v0.1.0
Published
Validate and normalize AI agent task files (JSON/YAML) with deterministic lint rules.
Maintainers
Readme
@gilangjavier/agent-taskfile
Validate and normalize AI agent task files (JSON/YAML) with deterministic lint rules.
Why
Agent task files are often hand-written and drift into footguns: missing timeouts, duplicate step ids, dangerous shell snippets, and hardcoded secrets. agent-taskfile gives a small, deterministic validator + normalizer usable by both AI agents and humans.
1) For AI agents (copy-paste friendly)
Install (ephemeral)
npm i -D @gilangjavier/agent-taskfileValidate with deterministic machine-readable output
npx agent-taskfile validate ./task.yaml --strict --format jsonExpected behavior:
- Exit code
0=> no errors/warnings in strict mode. - Exit code
1=> at least one error or warning. - JSON output contains:
valid,summary,issueCount,issues[].
Normalize then validate again
npx agent-taskfile normalize ./task.yaml --write
npx agent-taskfile validate ./task.yaml --strict --format json2) For humans
Install
npm i -g @gilangjavier/agent-taskfileUsage
agent-taskfile validate ./task.yaml
agent-taskfile normalize ./task.yaml --writeCommands
agent-taskfile validate <file> [--strict] [--format text|json]
agent-taskfile normalize <file> [--write] [--format json|yaml]Example task file
title: Release prep
goal: Validate and run release checks safely
deterministic: true
env:
GITHUB_TOKEN:
fromEnv: GITHUB_TOKEN
steps:
- id: test
run: npm test
timeoutSec: 600
- uses: npm/publish
with:
tag: nextLint rules included (MVP)
- Required fields:
title,goal, non-emptysteps. - Step action rules: exactly one of
runoruses. - Duplicate
steps[].iddetection. - Missing
timeoutSecwarning (normalize defaults to300). - Dangerous command heuristic warnings.
- Hardcoded secret heuristic warnings in
envvalues. - Non-deterministic command warnings when
deterministicis true.
Library usage
import { validateTask, normalizeTask } from "@gilangjavier/agent-taskfile";
const result = validateTask(taskObject, { strict: true });
if (!result.valid) {
console.error(result.issues);
}
const normalized = normalizeTask(result.task!);Development
npm ci
npm run typecheck
npm test
npm run buildLicense
MIT
