Caveman Discover

Caveman Discover

Guides a coding agent to find and label each LLM workflow in a repository so spend can be grouped by workflow, proposing changes before applying them.

Skill files1 file
SKILL.md116 lines
1
---
2
name: caveman-discover
3
description: >
4
Find and label every LLM workflow in the repository so Caveman Cloud groups
5
spend by workflow instead of one bucket. Use for "discover workflows" or
6
breaking LLM spend down by workflow.
7
---
8
9
You are labeling this repository's LLM workflows for Caveman Cloud. A
10
*workflow* is a job the code performs — "answer a support ticket", "build the
11
nightly digest", "run the eval suite" — not a technology. Every gateway
12
request can carry a workflow label; unlabeled traffic all lands in one
13
`unlabeled-workflow` bucket. Your job: find the workflows, name them well,
14
wire the labels, and verify nothing broke.
15
16
This changes code, so it goes through the user's normal review: **propose the
17
table first, apply after the user agrees.** Re-running on an already-labeled
18
repo must change nothing (idempotent).
19
20
This skill is operator-invoked. An `unlabeled-traffic` Cave Plan observation is
21
review-only and does not create an advisory file, proposal, or Draft PR. Do not
22
infer that telemetry selected a callsite or authorized an edit. Independently
23
inventory the repository, present the labeling table, and wait for the user's
24
approval before changing code.
25
26
## Step 1 — Inventory the workflows
27
28
Walk the repo from its entry points, not from its imports:
29
30
- HTTP/RPC handlers that call an LLM (directly or through layers)
31
- Scheduled jobs: cron definitions, queue consumers, workers, GitHub Actions
32
that invoke LLM code
33
- CLI commands and scripts (`scripts/`, `bin/`, package.json scripts)
34
- Eval / test harnesses that burn real tokens
35
- Distinct agents or chains inside a framework (each LangGraph graph, each
36
crew, each agent definition is usually its own workflow)
37
38
One workflow = one job a human would name. Ten callsites inside the same
39
request handler are one workflow; one shared `llm.ts` helper used by three
40
jobs is three workflows (label at the callers, never the shared helper).
41
42
## Step 2 — Name them
43
44
Slug grammar (the gateway enforces this): lowercase `[a-z0-9_-]`, 1–96 chars.
45
Name the job, not the tech:
46
47
- Good: `support-reply`, `nightly-digest`, `pr-review`, `eval-suite`,
48
`onboarding-email`
49
- Bad: `openai-calls` (tech), `main` (says nothing), `SupportReply` (invalid),
50
`johns-test-3` (won't age)
51
52
Names are forever-ish — renaming later splits the spend history. When a job's
53
purpose isn't clear from the code, derive the slug from the file name and mark
54
it `review` in the table rather than inventing a purpose.
55
56
## Step 3 — Propose, then apply
57
58
Present this table and ask to proceed:
59
60
```
61
| workflow | job | where | how it gets labeled |
62
|---|---|---|---|
63
| support-reply | answers inbound tickets | src/bot/reply.ts:41 | defaultHeaders on the reply client |
64
| nightly-digest | 02:00 summary job | jobs/digest.ts:12 | header on the digest client |
65
| eval-suite (review) | scripts/eval.ts:8 — purpose inferred from filename | scripts/eval.ts:8 | env override at invocation |
66
```
67
68
Then wire each label with the lightest mechanism available at that callsite:
69
70
- **@caveman-ai/sdk / caveman_cloud SDK**: per-trace `workflow` option, or
71
`defaultWorkflow` on the client a single-job service constructs.
72
- **Raw provider SDKs** (OpenAI/Anthropic/LangChain/LiteLLM/Vercel): add
73
`"x-cave-workflow": "<slug>"` to the same `defaultHeaders` /
74
`default_headers` / `extra_headers` block that already carries
75
`x-cave-api-key`. Shared client used by several jobs → pass the header per
76
call (every SDK above accepts per-request header overrides), or give each
77
job its own thin client.
78
- **Wrapped coding agents** (`caveman wrap`): `--workflow <slug>` flag or
79
`CAVE_WORKFLOW=<slug>` env at the invocation site (cron line, CI step).
80
- **Raw HTTP**: add the `x-cave-workflow` header to the request.
81
82
Label the callers, keep the diff minimal, match the repo's style. If a
83
callsite is not routed through the Caveman gateway at all, don't label it —
84
list it under "not wired" in the report (labels only travel on gateway
85
traffic; wiring is the caveman-setup skill's job).
86
87
## Step 4 — Verify
88
89
Run whatever the repo already uses to exercise one labeled path (a test, a
90
dev script, one curl). Then confirm: the request still succeeds (the gateway
91
rejects an invalid label with 400 `cave_invalid_request_header` — fix the slug
92
if so). Labeled spend appears on the dashboard at `/activity?tab=workflows` as
93
each workflow next runs; jobs on a schedule show up when the schedule fires,
94
and that's worth saying in the report rather than pretending they're live.
95
96
## Step 5 — Report
97
98
```
99
## Workflows labeled
100
101
| workflow | job | where |
102
|---|---|---|
103
| support-reply | answers inbound tickets | src/bot/reply.ts:41 |
104
| nightly-digest | 02:00 summary job | jobs/digest.ts:12 |
105
106
Verified: <the labeled path you actually exercised, and what you observed>
107
Lands at: <DASHBOARD>/activity?tab=workflows — each row appears as that workflow
108
next runs. Anything still unlabeled shows as `unlabeled-workflow`.
109
Not wired (no gateway routing, so no label): <list or "none">
110
Marked review: <slugs whose purpose was inferred from filenames, or "none">
111
```
112
113
If you found no LLM entry points at all: say exactly that, and point at the
114
setup skill (`<docs origin>/docs/agent-setup.md`) instead of manufacturing a
115
table.
116

© Julius Brussee · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…