npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agentic-task-spec

v0.1.0

Published

Framework-agnostic TypeScript schema for declaring agentic task definitions — tools, budgets, approval gates, and constraints.

Downloads

82

Readme

agentic-task-spec

Framework-agnostic TypeScript schema for declaring agentic task definitions — tools, budgets, approval gates, and constraints.

Problem

Teams building AI agent workflows hand-roll YAML/JSON task definitions with no validation or type safety. There's no standard schema for expressing what an agent can do, what it costs, and who needs to approve it.

Solution

agentic-task-spec provides:

  • Zod v4 schemas for task spec validation
  • TypeScript types inferred from schemas
  • CLI to validate, inspect, and scaffold task specs
  • JSON Schema export for editor autocomplete and CI integration
  • Zero runtime overhead — just schema + types

Install

npm install agentic-task-spec

Example Task Spec

id: code-review
title: Automated Code Review
description: Run code review on pull requests
trigger:
  type: pr_event
  config:
    action: opened
steps:
  - id: analyze
    name: Analyze changes
    tool: code-review
    input:
      target: changed-files
    requires_approval: false
    timeout_ms: 60000
  - id: report
    name: Post review comment
    tool: github-comment
    input:
      body: "{{analyze.output}}"
    requires_approval: true
constraints:
  allowed_tools:
    - code-review
    - github-comment
  max_tokens: 200000
  max_cost_usd: 2.00
on_exit:
  failure:
    notify: "#engineering"
    escalate: true
metadata:
  author: platform-team
  version: "1.0.0"
  tags: [code-review, ci]
  schema_version: "0.1.0"

CLI

# Validate a task spec file
agentic-task-spec validate task.yaml

# Validate all specs in a directory
agentic-task-spec validate specs/

# Create a starter task.yaml
agentic-task-spec init

# Inspect a task spec
agentic-task-spec inspect task.yaml

API

import {
  TaskSpecSchema,
  type TaskSpec,
  defineTask,
  validateTaskSpec,
  parseTaskSpec,
  loadTaskSpecFile,
  taskSpecJsonSchema,
} from 'agentic-task-spec';

// Type-safe task definition
const task = defineTask({
  id: 'my-task',
  title: 'My Task',
  trigger: { type: 'manual' },
  steps: [{ id: 'step-1', name: 'Run analysis' }],
});

// Validate unknown input
const result = validateTaskSpec(data);
if (!result.success) {
  console.error(result.errors);
}

// Parse or throw
const spec = parseTaskSpec(data);

// Load from file (YAML or JSON)
const loaded = loadTaskSpecFile('task.yaml');

// JSON Schema for editor integration
console.log(JSON.stringify(taskSpecJsonSchema, null, 2));

Schema Fields

| Field | Type | Required | Description | |-------|------|----------|-------------| | id | string | yes | Unique task identifier | | title | string | yes | Human-readable task name | | description | string | no | Task description | | trigger | object | yes | How the task is triggered (manual, schedule, webhook, pr_event, push_event) | | steps | array | yes | Ordered list of steps (min 1) | | steps[].id | string | yes | Step identifier | | steps[].name | string | yes | Step name | | steps[].tool | string | no | Tool to invoke | | steps[].input | object | no | Tool input parameters | | steps[].requires_approval | boolean | no | Whether step needs human approval | | steps[].timeout_ms | number | no | Step timeout in milliseconds | | steps[].retry | object | no | Retry policy (max_attempts, delay_ms) | | constraints | object | no | Execution constraints | | constraints.allowed_tools | string[] | no | Allowlisted tools | | constraints.denied_tools | string[] | no | Blocklisted tools | | constraints.denied_paths | string[] | no | Blocklisted file paths | | constraints.max_tokens | number | no | Token budget | | constraints.max_cost_usd | number | no | Cost budget in USD | | constraints.max_wall_time_ms | number | no | Wall time budget in ms | | on_exit | object | no | Exit handlers for success/failure | | metadata | object | no | Author, version, tags, schema_version |

License

MIT