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

@sanity-labs/oclif-plugin-skills-flag

v0.2.1

Published

Expose per-command Markdown to coding agents through an oclif flag

Readme

@sanity-labs/oclif-plugin-skills-flag

Adds --llms and its --skill alias to every command in an oclif v4 CLI. The flag prints command-specific Markdown for coding agents, then exits without running the command.

Install

Install the plugin in the CLI:

npm install @sanity-labs/oclif-plugin-skills-flag

Register it in the CLI's package.json:

{
  "oclif": {
    "plugins": ["@sanity-labs/oclif-plugin-skills-flag"]
  }
}

Add a skills directory at the package root. Name each file after its oclif command ID, replacing colons with hyphens:

skills/
├── deploy.md
└── functions-test.md

These commands then print the matching files:

my-cli deploy --llms
my-cli functions test --skill

The second command uses skills/functions-test.md. A single-command CLI uses skills/index.md. Include skills in the CLI's npm files list if it has one.

Configuration

Add oclif-plugin-skills-flag at the top level of the CLI's package.json to change the runtime behavior:

{
  "oclif-plugin-skills-flag": {
    "flag": "agents",
    "aliases": ["agent-help"],
    "directory": "docs/agents",
    "fallThroughOnMissingSkill": false,
    "missingSkillMessage": "No agent instructions are available."
  }
}

| Option | Type | Default | Description | | --- | --- | --- | --- | | flag | string | "llms" | Main flag name, without leading dashes | | aliases | string[] | ["skill"] | Additional names; one-character aliases use a single dash | | directory | string | "skills" | Skills directory relative to the CLI package root | | fallThroughOnMissingSkill | boolean | false | Let oclif continue processing when the skill file is missing | | missingSkillMessage | string | Command-specific message with the expected file path | Error shown when the skill file is missing |

Configuration belongs to the CLI package that owns the command. If one oclif CLI is installed as a plugin in another, each CLI can use different flag names and directories for its own commands. Include the configured directory in the CLI's npm files list if it has one.

When fallThroughOnMissingSkill is true, it takes precedence over missingSkillMessage. The hook returns without printing an error, and oclif continues its normal command lifecycle. A strict command that calls this.parse() reports an undeclared skills flag as nonexistent and prints error help. A command can instead declare the flag or use non-strict parsing to handle it. Consumers that enable fallthrough are responsible for handling or rejecting the flag.

Show the flag in help

An oclif plugin cannot add flags to the host commands' generated help. The hook still recognizes the configured names before oclif parses the command, but they do not appear in help automatically. To advertise the default --llms flag, add the exported definition to the CLI's existing base command and set hidden to false:

import {Command, Flags} from '@oclif/core'
import {llmsFlagConfig} from '@sanity-labs/oclif-plugin-skills-flag'

export abstract class BaseCommand extends Command {
  static baseFlags = {
    ...super.baseFlags,
    llms: Flags.boolean({...llmsFlagConfig, hidden: false}),
  }
}

The plugin handles the flag, so command implementations do not need to read flags.llms.

For custom names, create a matching definition:

import {Command, Flags} from '@oclif/core'
import {createSkillsFlagDefinition} from '@sanity-labs/oclif-plugin-skills-flag'

const skillsFlag = createSkillsFlagDefinition(
  {
    flag: 'agents',
    aliases: ['agent-help'],
  },
  {
    description: 'Show instructions for coding agents',
    hidden: false,
  },
)

export abstract class BaseCommand extends Command {
  static baseFlags = {
    ...super.baseFlags,
    [skillsFlag.name]: Flags.boolean(skillsFlag.definition),
  }
}

The names passed to createSkillsFlagDefinition must match the package configuration. hidden and description affect only the flag definition owned by the host CLI; they do not change runtime plugin behavior.

Limitations

  • The plugin targets oclif v4.
  • When a matching skill exists, configured flag names take precedence over same-named host flags.
  • When a matching skill exists, the init hook writes it and exits immediately. Later oclif lifecycle hooks do not run.

Development

mise selects Node 24, which runs the TypeScript tests directly:

npm install
npm test

Run npm run build to create the publishable files in dist/. Use npm run lint:fix to apply Biome formatting and safe lint fixes.