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

@n1k1t/promptkit

v0.1.0

Published

CLI util that collects project code examples to make AI prompts better

Readme

License npm version Dynamic XML Badge

Install

npm i -D @n1k1t/promptkit

How it works?

The promptkit uses custom JSDoc tags @ai to define what some code is actually do in a JavaScript/TypeScript project for AI perspective. It takes all segments of described code and compiles into batch of formats to use it for AI fine-tuning or rules of ContinueDEV and so on...

For example you have a NodeJs/Typescript project with some code:

// src/index.ts

const Property = (options?: object): PropertyDecorator => () => {/** ...code */};
const Class = (options?: object): ClassDecorator => () => {/** ...code */};

/** @ai Create a class Foo */
@Class()
export class Foo {
  /** @ai Create a property foo */
  @Property({ parameter: 'foo' })
  foo!: string;

  /** @ai Create a property bar */
  @Property({ parameter: 'bar' })
  bar!: string;

  /**
   * @ai Create a method baz
   * @description A baz method
   */
  public baz(): boolean {
    return true;
  }
}

Using the promptkit command npx promptkit collect src/**/*.ts the promptkit will generate a promptkit.md file in the root of project that contains:

... "promptkit.md" file content

After that you'll able to use the generated file for prompting as project context to get better results

API

General

$ npx promptkit -h

Usage: cli [options] [command]

It helps to setup AI code assistants with prompt annotations

Options:
  -h, --help                   display help for command

Commands:
  collect [options] [pattern]  Collects @ai annotations with code by provided path pattern
  help [command]               display help for command

Command collect

$ npx promptkit collect -h

Usage: cli collect [options] [pattern]

Collects @ai annotations with code by provided path pattern

Options:
  -f --format [json|md|yaml|continuedev|finetuning]  Annotations format (default: "md")
  -o --output [stdout|file]                          Annotations output (default: "file")
  -d --dest [value]                                  Destination path for a file
  -i --ignore [value]                                Ignore pattern (default: "node_modules/**")
  -h, --help                                         display help for command

Examples

$ npx promptkit collect -f json -o stdout src/*.js

[{"path":"src/index.js","lang":"js","prompt":"Create a class method test","code":"test() {\n  return true;\n}"},{"path":"src/index.js","lang":"js","prompt":"Create a class","code":"export class Test1 {\n  constructor() {}\n\n  test() {\n    return true;\n  }\n}"}]
$ npx promptkit collect -f finetuning -o stdout src/*.js

{"messages":[{"role":"user","content":"Create a class method test"},{"role":"assistant","content":"```js\ntest() {\n  return true;\n}\n```\n"}]}
{"messages":[{"role":"user","content":"Create a class"},{"role":"assistant","content":"```js\nexport class Test1 {\n  constructor() {}\n\n  test() {\n    return true;\n  }\n}\n```\n"}]}
$ npx promptkit collect -f continuedev -o stdout src/*.js

name: PROMPTKIT
version: 0.0.1
schema: v1
rules:
  - |
    # Use examples below to generate code by prompt

    ### Create a class method test

    ```js
    test() {
      return true;
    }
    ```

    ### Create a class

    ```js
    export class Test1 {
      constructor() {}

      test() {
        return true;
      }
    }
    ```

Features

Groups

The promptkit supports a grouping of segments of code using @ai {...group} format

Examples

... TypeScript code

// src/index.ts

import { ConvertTupleToUnion } from '../../types';

const Property = (options?: object): PropertyDecorator => () => {/** ...code */};
const Class = (options?: object): ClassDecorator => () => {/** ...code */};

/** @ai {enum} Create enum test with values FOO, BAR, BAZ */
export type TTest = ConvertTupleToUnion<typeof LTest>;
/** @ai {enum} */
export const LTest = <const>['FOO', 'BAR', 'BAZ'];

/** @ai {class} Create a prepared class with properties */
@Class()
class Foo {
  @Property()
  foo!: number;
}

/** @ai {class} */
@Class()
class Bar extends Foo {
  @Property()
  bar!: string;
}

... Executing the "collect" command

npx promptkit collect -f md -o stdout src/*.ts

... Console stdout

Additional

ENV

# Ignore pattern
export PROMPTKIT_IGNORE = "node_modules/**"
# A header title that will be placed as H1 tag into markdown content
export PROMPTKIT_MD_HEADER = "Use examples below to generate code by prompt"