Skip to content

Commit 7be8845

Browse files
committed
feat: improve dumplingai skill discovery
1 parent 99eb1fd commit 7be8845

17 files changed

Lines changed: 603 additions & 100 deletions

File tree

‎AGENTS.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# AGENTS.md
2+
3+
Guidelines for contributors working on the DumplingAI CLI skills in this repository.
4+
5+
## Repository Focus
6+
7+
This repo ships:
8+
9+
- the `dumplingai-cli` npm package under `packages/cli/`
10+
- bundled agent skills under `skills/`
11+
- install-time copies of those skills embedded in `packages/cli/src/commands/setup-skill.ts`
12+
13+
## Skill Discovery Rule
14+
15+
For skill triggerability, the frontmatter `description` is retrieval copy, not just documentation.
16+
17+
Every skill description should cover:
18+
19+
1. What the skill helps the user accomplish
20+
2. The phrases a user is likely to say
21+
3. When to use this skill instead of a nearby one
22+
23+
Prefer multiple narrow, job-shaped skills over one generic integration skill when users commonly ask for the workflows in different language. Broad umbrella skills are still useful, but they should be backed by more specific entry points like search, scraping, transcripts, and SEO data.
24+
25+
Prefer:
26+
27+
```yaml
28+
description: When the user wants to find the right API for scraping or search. Also use when the user mentions Firecrawl, Serper, transcripts, or SEO APIs. For executing the chosen endpoint, see dumplingai-cli.
29+
```
30+
31+
Avoid descriptions that only describe the underlying tool, such as "CLI for DumplingAI" with no user-intent language.
32+
33+
## Keep Sources in Sync
34+
35+
When editing a bundled skill:
36+
37+
1. Update `skills/<name>/SKILL.md`
38+
2. Update the matching embedded string in `packages/cli/src/commands/setup-skill.ts`
39+
3. If trigger guidance changes, update `README.md`
40+
41+
## Validation
42+
43+
- Keep skill names aligned with directory names
44+
- Keep descriptions concise but rich in trigger phrases
45+
- Prefer concrete user intents and vendor/task synonyms over internal product terminology

‎README.md‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Get your API key at https://app.dumplingai.com/settings/api-keys
2424
| `dumplingai logout` | Remove stored credentials |
2525
| `dumplingai status` | Show CLI version, auth status, and v2 balance context |
2626
| `dumplingai view-config` | Display current configuration |
27-
| `dumplingai catalog search <prompt>` | Search v2 capabilities, providers, and endpoints |
27+
| `dumplingai catalog search <prompt>` | Search v2 capabilities, providers, and endpoints with short keyword queries |
2828
| `dumplingai catalog details <type> <id>` | Inspect a specific catalog object |
2929
| `dumplingai run <type> <id> --input '<json>'` | Execute a capability or endpoint |
3030
| `dumplingai balance` | Show balance and budget information |
@@ -37,7 +37,7 @@ Get your API key at https://app.dumplingai.com/settings/api-keys
3737

3838
```bash
3939
# Discover available capabilities
40-
dumplingai catalog search "google search capability"
40+
dumplingai catalog search "google search"
4141

4242
# Inspect a capability before running it
4343
dumplingai catalog details capability google_search
@@ -60,16 +60,39 @@ dumplingai run capability scrape_page --input '{"url":"https://example.com"}' >
6060
head -40 .dumplingai/page.json
6161
```
6262

63+
## Catalog Search Tips
64+
65+
`dumplingai catalog search` behaves more like keyword search than semantic search. Use short phrases such as `google search`, `scrape page`, `youtube transcript`, `keyword ideas`, or `firecrawl scrape`.
66+
67+
Avoid long natural-language prompts and avoid appending generic words like `capability` or `endpoint` unless they are actually part of the object name. If results are empty or weak, shorten the query first.
68+
6369
## Skill Installation
6470

6571
Packaged skills from this repo can be installed with the `skills` CLI:
6672

6773
```bash
6874
npx skills add dumplingai/cli
6975
npx skills add dumplingai/cli --list
70-
npx skills add dumplingai/cli --skill discovering-dumplingai-apis --skill dumplingai-cli --skill youtube-to-blog-post --skill social-media-post
76+
npx skills add dumplingai/cli --skill discovering-dumplingai-apis --skill dumplingai-cli --skill dumplingai-web-research --skill dumplingai-scraping-extraction --skill dumplingai-transcripts-media --skill dumplingai-seo-data --skill youtube-to-blog-post --skill social-media-post
7177
```
7278

79+
## When Skills Should Trigger
80+
81+
The main lesson from high-performing skill repos is that discovery copy should describe user intent, not just implementation details. These are the bundled skills and the kinds of requests they should catch:
82+
83+
| Skill | Trigger this when the user says things like |
84+
|-------|---------------------------------------------|
85+
| `discovering-dumplingai-apis` | "Find the best API for scraping/search/transcripts", "Can DumplingAI do this instead of Firecrawl/Serper/DataForSEO?", "I want one API key across providers" |
86+
| `dumplingai-cli` | "Run this through DumplingAI", "search the DumplingAI catalog", "inspect this capability", "check DumplingAI balance/usage", "test this endpoint from the terminal" |
87+
| `dumplingai-web-research` | "Search the web for this", "find sources on this topic", "run Google/Serper/Perplexity-style search through DumplingAI", "do competitor/topic research first" |
88+
| `dumplingai-scraping-extraction` | "Scrape this page", "crawl this site", "extract content from this URL", "pull structured content with Firecrawl-style tooling" |
89+
| `dumplingai-transcripts-media` | "Get the YouTube transcript", "transcribe this video", "extract captions from this media URL", "turn video/audio into text" |
90+
| `dumplingai-seo-data` | "Get keyword ideas", "pull SEO data", "use DataForSEO through DumplingAI", "find ranking/search-volume endpoints" |
91+
| `youtube-to-blog-post` | "Turn this YouTube video into a post", "extract the transcript and draft an article", "repurpose this creator video into a newsletter/blog" |
92+
| `social-media-post` | "Turn this topic/page/transcript into LinkedIn or X posts", "write thread variants", "give me channel-specific social copy" |
93+
94+
If a skill description only says what the tool is, it tends to under-trigger. If it says what the user is trying to accomplish and includes the phrases they are likely to use, it triggers more reliably.
95+
7396
## Development
7497

7598
```bash
@@ -80,3 +103,5 @@ pnpm --filter dumplingai-cli typecheck
80103
```
81104

82105
Local agent/runtime folders such as `.claude/`, `.agents/`, `.cursor/`, `.codex/`, and `.dumplingai/` are intentionally ignored. Keep checked-in skill sources under `skills/`.
106+
107+
Stored credentials are written to a local config file. Prefer `DUMPLINGAI_API_KEY` in CI or shared environments.

‎packages/cli/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ npm install -g dumplingai-cli
1616

1717
```bash
1818
dumplingai login --api-key sk_yourkey
19-
dumplingai catalog search "google search capability"
19+
dumplingai catalog search "google search"
2020
dumplingai run capability google_search --input '{"query":"latest TypeScript release"}'
2121
```
2222

@@ -27,7 +27,7 @@ dumplingai run capability google_search --input '{"query":"latest TypeScript rel
2727
- `dumplingai logout`
2828
- `dumplingai status`
2929
- `dumplingai view-config`
30-
- `dumplingai catalog search <prompt>`
30+
- `dumplingai catalog search <prompt>` # use short keyword queries like "google search"
3131
- `dumplingai catalog details <type> <id>`
3232
- `dumplingai run <type> <id> --input '<json>'`
3333
- `dumplingai balance`

‎packages/cli/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dumplingai-cli",
3-
"version": "0.1.7",
3+
"version": "0.1.9",
44
"description": "DumplingAI CLI — discover and execute Unified API Platform capabilities from the terminal",
55
"license": "MIT",
66
"type": "module",

‎packages/cli/src/commands/catalog.ts‎

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,51 @@ function parseOptionalInt(value?: string, flagName?: string): number | undefined
3131
return parsed;
3232
}
3333

34+
function getCatalogResultCount(result: Record<string, unknown>): number | undefined {
35+
const candidates = ['items', 'results', 'data', 'matches'];
36+
37+
for (const key of candidates) {
38+
const value = result[key];
39+
if (Array.isArray(value)) {
40+
return value.length;
41+
}
42+
}
43+
44+
return undefined;
45+
}
46+
3447
export function makeCatalogCommand(): Command {
3548
const command = new Command('catalog')
3649
.description('Search and inspect the DumplingAI v2 catalog');
3750

3851
command.addCommand(
3952
new Command('search')
40-
.description('Search capabilities, providers, and endpoints')
41-
.argument('<prompt>', 'Prompt describing the API need')
53+
.description('Search capabilities, providers, and endpoints with short keyword queries')
54+
.argument(
55+
'<prompt>',
56+
'Short keyword query, e.g. "google search" or "scrape page" rather than a long sentence',
57+
)
4258
.option('--type <type>', 'Filter to capability, provider, or endpoint')
4359
.option('--limit <n>', 'Maximum number of results to return')
4460
.option('--api-key <key>', 'Override API key for this request')
4561
.action(async (prompt: string, opts: { type?: string; limit?: string; apiKey?: string }) => {
62+
if (prompt.trim().split(/\s+/).length > 5) {
63+
process.stderr.write(
64+
'Tip: `catalog search` works best with short keyword queries. If results are weak, shorten the query and remove extra words like "capability" or "endpoint".\n',
65+
);
66+
}
4667
const client = await getClient(opts.apiKey);
4768
const result = await client.searchCatalog(prompt, {
4869
type: parseCatalogType(opts.type),
4970
limit: parseOptionalInt(opts.limit, '--limit'),
5071
});
72+
73+
if (getCatalogResultCount(result) === 0) {
74+
process.stderr.write(
75+
'No catalog results found. Retry with a shorter keyword query like "google search", "scrape page", or "keyword ideas", and remove extra words like "capability" or "endpoint".\n',
76+
);
77+
}
78+
5179
printResult(result);
5280
}),
5381
);

0 commit comments

Comments
 (0)