Create package

From datagrok-ai/public · View interactive version

Create package is an AI agent skill from the GitHub repository datagrok-ai/public. Scaffold, build, and publish a new Datagrok package

How to use this skill

Skill file

Create a Datagrok Package

Help the user scaffold a new Datagrok package, add functions to it, build, and publish.

Usage

/create-package [package-name] [--test] [--js]

Instructions

1. Scaffold the package

Run from the directory where the package folder should be created:

grok create <PackageName> --test
cd <PackageName>
npm install

2. Understand the package structure

The created package contains:

3. Add functions to the package

Functions are defined with annotation comments above the export. Common types:

Panel function (appears in context panel for matching data):

//name: MyPanel
//tags: panel, widgets
//input: string str {semType: text}
//output: widget result
export function myPanel(str: string) {
  return new DG.Widget(ui.divV([
    ui.divText('Result: ' + str.length)
  ]));
}

Add more function types via CLI:

grok add app <name>        # Application entry point
grok add viewer <name>     # Custom viewer
grok add detector <name>   # Semantic type detector

4. Build the package

npm run build

This runs grok api (auto-generates wrappers), grok check --soft (validates), and webpack (bundles). Do not modify the build script in package.json.

5. Publish the package

Publish to a configured server:

grok publish dev           # Debug mode (only visible to you)
grok publish dev --release # Release mode (visible to shared groups)

Return code 0 means success. After publishing in debug mode, find the package under Manage | Packages prefixed with v..

6. Share and release

Behavior

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.