# Prompting recipes

> PROMPTING query workflows: community technique extraction, KEY PATTERNS output shape, and copy-paste prompt generation patterns.

- Repository: mvanhorn/last30days-skill
- GitHub: https://github.com/mvanhorn/last30days-skill
- Human docs: https://grok-wiki.com/public/docs/mvanhorn-last30days-skill-50b5421a8cca
- Complete Markdown: https://grok-wiki.com/public/docs/mvanhorn-last30days-skill-50b5421a8cca/llms-full.txt

## Source Files

- `README.md`
- `skills/last30days/SKILL.md`
- `skills/last30days/scripts/lib/planner.py`
- `tests/test_pipeline_v3.py`
- `skills/last30days/scripts/lib/render.py`

---

---
title: "Prompting recipes"
description: "PROMPTING query workflows: community technique extraction, KEY PATTERNS output shape, and copy-paste prompt generation patterns."
---

`/last30days` treats **PROMPTING** as a skill-level `QUERY_TYPE` in `SKILL.md`: the hosting model classifies the user topic, runs the v3 engine with resolved communities and a JSON `--plan`, synthesizes community techniques into the canonical `What I learned:` + `KEY PATTERNS from the research:` shape, then—only after the user describes what to create—writes one paste-ready prompt that matches the format the research surfaced. The Python engine does not expose a `PROMPTING` enum; it plans with intents such as `how_to`, `product`, and `concept` via `scripts/lib/planner.py`.

## PROMPTING vs engine intent

| Layer | Identifier | Where it lives | Role for prompting runs |
|-------|------------|----------------|-------------------------|
| Skill | `QUERY_TYPE = PROMPTING` | `skills/last30days/SKILL.md` | Voice contract, WebSearch supplements, invitation, follow-up prompt rules |
| Engine | `intent` on `QueryPlan` | `scripts/lib/planner.py`, `--plan` JSON | Source priority, `freshness_mode`, `cluster_mode` (often `how_to` → `workflow`, `evergreen_ok`) |
| Search modules | Local `_infer_query_intent` | e.g. `scripts/lib/reddit.py` | Reddit query expansion only (`how_to`, `product`, …)—not the skill `QUERY_TYPE` |

<Note>
Eval fixtures label topics like `nano banana pro prompting` as engine `product` or `how_to`, while the skill still classifies the same phrasing as **PROMPTING** for synthesis and the post-research invitation. Plan for both: skill workflow + engine `how_to`/`product` subqueries.
</Note>

## Classify a PROMPTING query

The model parses **TOPIC**, optional **TARGET_TOOL**, and **QUERY_TYPE** before any engine call.

| User phrasing | `QUERY_TYPE` | `TARGET_TOOL` |
|---------------|--------------|---------------|
| `X prompts`, `prompting for X`, `X best practices` | PROMPTING | From `for [tool]` if present; else `unknown` until after research |
| `UI design prompts for Midjourney` | PROMPTING | `Midjourney` (specified in query) |
| `iOS design mockups` (no tool) | PROMPTING or GENERAL | `unknown`—do **not** ask for tool before research |

Confirmation line (same shape as GENERAL/NEWS/RECOMMENDATIONS):

```
/last30days - searching {ACTIVE_SOURCES_LIST} for what people are saying about {TOPIC}.
```

Do not emit a multi-line `Parsed intent:` block with `TOPIC=` / `QUERY_TYPE=` variables.

## End-to-end workflow

```mermaid
sequenceDiagram
  participant User
  participant Model as Hosting model (SKILL.md)
  participant Engine as last30days.py
  participant Sources as Reddit X YouTube TikTok …

  User->>Model: /last30days {topic} [for {tool}]
  Model->>Model: QUERY_TYPE=PROMPTING, Step 0.45 pre-flight
  Model->>Model: Step 0.55 resolve + category peers
  Model->>Model: Step 0.75 JSON --plan
  Model->>Engine: --emit=compact --plan --x-handle --subreddits …
  Engine->>Sources: parallel fan-out
  Sources-->>Engine: ranked clusters + footer
  Engine-->>Model: evidence envelope + PASS-THROUGH FOOTER
  Model->>Model: WebSearch supplements (prompting queries)
  Model->>User: badge, What I learned, KEY PATTERNS, footer, invitation
  User->>Model: describe what to create
  Model->>User: one prompt in research-recommended format
```

<Steps>
<Step title="Pre-flight and reframe (Step 0.45)">
Tutorial-shaped topics (`how to use X`, `tutorial for Z`) are **Class 3 keyword traps**. Reframe to discussion vocabulary (`Docker tips tricks workflows`) before the engine runs. Wait for user confirmation if you asked a clarifying question.
</Step>
<Step title="Resolve communities (Step 0.55)">
Run 2–3 WebSearches for subreddits and news context. For product topics, **mandatory category-peer expansion**: brand subs alone miss cross-product technique threads (documented `GPT Image 2` failure). Merge WebSearch subs with peers from `scripts/lib/categories.py`; cap at 10; annotate `(+ ai_image_generation peers)` on the Resolved line when peers were added.
</Step>
<Step title="Plan and execute (Steps 0.75 + Research Execution)">
Generate 1–4 subqueries as JSON; primary subquery must include `reddit`, `x`, `youtube`, `tiktok`, `instagram`, `hackernews`, `polymarket`. Pass `--plan` via a tmpfile (never inline JSON with apostrophes). Use `--emit=compact`, resolved `--x-handle`, `--subreddits`, hashtags, creators. Named-entity topics require `--plan` (LAW 7).
</Step>
<Step title="Supplement and synthesize (Steps 2 + Judge)">
Run 2–3 WebSearches: `{TOPIC} prompts examples 2026`, `{TOPIC} techniques tips`. Append bullets to the saved raw file under `## WebSearch Supplemental Results`. Transform engine clusters into prose—do not dump `## Ranked Evidence Clusters` (LAW 6).
</Step>
<Step title="Invite, then write one prompt">
After synthesis, use the PROMPTING invitation. When the user describes something to **create** or asks for a **prompt**, deliver **one** paste-ready prompt in the format the research recommends (JSON, structured params, etc.).
</Step>
</Steps>

## Community technique extraction

### Query stripping (`scripts/lib/query.py`)

Platform search uses `extract_core_subject()` to remove prompting meta-words (`prompt`, `prompts`, `prompting`, `techniques`, `tips`, …) and prefixes like `how to use`, `tips for`, `best practices for`. Multi-word suffixes `prompting techniques` / `prompting tips` strip when `strip_suffixes=True` (used on some modules). Compound terms (`Claude Code`, `multi-agent`) stay quoted in expansion.

### Category-peer subreddits (`scripts/lib/categories.py`)

`detect_category(topic)` returns IDs such as `ai_image_generation`, `ai_coding_agent`, `ai_video_generation`. `peer_subs_for()` returns priority-ordered subs—for image gen: `StableDiffusion`, `midjourney`, `dalle2`, `aiArt`, `PromptEngineering`, `MediaSynthesis`. Tests in `tests/test_categories.py` lock the **Prompting GPT Image 2** regression: OpenAI-brand subs only → thin technique signal; peers required.

| Category ID | Example trigger terms | Peer subs (first entries) |
|-------------|----------------------|---------------------------|
| `ai_image_generation` | GPT Image, Nano Banana, Midjourney, Stable Diffusion | `StableDiffusion`, `midjourney`, `dalle2` |
| `ai_coding_agent` | Claude Code, Cursor, OpenClaw, Hermes Agent | `ChatGPTCoding`, `LocalLLaMA`, `singularity` |
| `ai_video_generation` | Sora, Veo, Runway Gen, Kling | `aivideo`, `StableDiffusion`, `runwayml` |

### Planner hints for technique-heavy topics

When building `--plan` JSON for prompting runs, align with Step 0.75 rules:

- **Product-style topics**: route subqueries to YouTube (reviews/demos), Reddit (discussions), TikTok (demos).
- **How-to-shaped retrieval**: `intent: "how_to"`, `cluster_mode: "workflow"`, `freshness_mode: "evergreen_ok"`.
- **Search queries**: keyword-heavy, match how posts are **titled**; no `last 30 days`, `recent`, or year literals in `search_query`.
- Strip intent modifiers (`tutorial`, `workflow`, `examples`) from `search_query`; keep meaning in `ranking_query`; prefer 4–5 paraphrased subqueries for broad retrieval.

### WebSearch supplements (Step 2)

| Query type | Supplement searches | Goal |
|------------|---------------------|------|
| PROMPTING | `{TOPIC} prompts examples 2026`, `{TOPIC} techniques tips` | Examples and structures for copy-paste prompts |
| All types | Exclude `reddit.com`, `x.com`, `twitter.com` (engine already covers) | Blogs, tutorials, docs, GitHub |

Use the user's **exact terminology** in supplements—do not substitute model-known aliases.

### Evidence → synthesis fields

From **Judge Agent** instructions (all query types; critical for PROMPTING):

- **PROMPT FORMAT** — JSON vs natural language vs tag lists, as stated in sources
- **Top 3–5 patterns** across platforms
- **Keywords/structures** and **pitfalls** cited by sources—not invented

## KEY PATTERNS output shape

PROMPTING uses the same voice contract as GENERAL, NEWS, and RECOMMENDATIONS (not the COMPARISON template).

### Required sequence

1. **Line 1**: Badge pass-through — `🌐 last30days v{VERSION} · synced {YYYY-MM-DD}` (engine emits on `--emit=compact`).
2. **Line 3**: Prose label `What I learned:` (no invented title, no `#` heading).
3. **Body**: 3+ paragraphs, each starting `**Headline phrase** - ` then 1–2 sentences with inline `[name](url)` citations (LAW 8).
4. **Prose label**: `KEY PATTERNS from the research:` then a **numbered** list (typically 3–5 items).
5. **Engine footer**: `<!-- PASS-THROUGH FOOTER -->` block verbatim (LAW 5).
6. **Invitation**: PROMPTING-specific block (below).
7. **End**: No trailing `Sources:` (LAW 1).

### KEY PATTERNS list rules

| Rule | Requirement |
|------|-------------|
| Structure | Numbered list only; no `## Key patterns` header (LAW 4) |
| Bold | Skill template uses `**bold**` for pattern lead-ins; do not strip for global "no bold" prefs |
| Citations | One source per pattern: `per [@handle](url)` or `per [r/sub](url)` |
| Separators | Use ` - ` (spaced hyphen), never em-dash or en-dash (LAW 3) |
| Density | Do not chain `per @a, @b, @c`; pick the strongest source |

<RequestExample>
```text
🌐 last30days v3.3.1 · synced 2026-06-04

What I learned:

**JSON blocks are replacing tag soup** - Creators on X describe nested JSON fields to stop concept bleed between subjects, per [@pictsbyai](https://x.com/pictsbyai).

**Edit-first beats full regeneration** - r/StableDiffusion threads treat img2img and mask edits as the default loop for iteration, per [r/StableDiffusion](https://reddit.com/r/StableDiffusion).

KEY PATTERNS from the research:
1. **Nested JSON with explicit device/scene keys** - per [@pictsbyai](https://x.com/pictsbyai)
2. **Separate negative prompt channel** - per [r/midjourney](https://reddit.com/r/midjourney)
3. **Reference image + strength slider for style lock** - per [r/dalle2](https://reddit.com/r/dalle2)

--- 
✅ All agents reported back!
…
---

---
I'm now an expert on Nano Banana Pro prompting for Nano Banana Pro. What do you want to make? For example:
- …

Just describe your vision and I'll write a prompt you can paste straight into Nano Banana Pro.
```
</RequestExample>

HTML briefs (`--emit=html`) map labels via `scripts/lib/html_render.py`: `KEY PATTERNS from the research:` → display title "Key patterns from the research". Synthesis temp files include `What I learned:` + KEY PATTERNS only—not the badge or footer (`references/save-html-brief.md`).

## Copy-paste prompt generation

Research completes in one turn; **prompt delivery is a second turn** after the invitation.

### PROMPTING invitation (after synthesis)

```
---
I'm now an expert on {TOPIC} for {TARGET_TOOL}. What do you want to make? For example:
- [specific idea from popular technique in research]
- [specific idea from trending style in research]
- [specific idea from what people are actually creating]

Just describe your vision and I'll write a prompt you can paste straight into {TARGET_TOOL}.
```

If `TARGET_TOOL` was `unknown`, infer or ask **after** showing results—not before the engine run.

### When the user responds

| User intent | Action |
|-------------|--------|
| Question about the topic | Answer from research only—no new WebSearch, no prompt |
| Go deeper on a subtopic | Elaborate from existing findings |
| Describe something to **create** or asks for a **prompt** | Write **one** tailored prompt |
| Different topic | New `/last30days` run |

### Prompt quality contract

<Warning>
**Anti-pattern:** Research recommends JSON or structured params but the model outputs plain prose. That voids the research pass.
</Warning>

<Check>
**Pre-delivery checklist**
- Format matches research (JSON / structured / natural language)
- Addresses the user's stated creation goal
- Uses patterns and keywords from KEY PATTERNS and narrative
- Paste-ready with clear `[PLACEHOLDERS]` only where needed
- Length and style fit `TARGET_TOOL`
</Check>

**Delivery shape:**

```
Here's your prompt for {TARGET_TOOL}:

---

[Prompt in the format the research recommends]

---

This uses [one-line research insight applied].
```

Provide 2–3 variations **only** if the user asks for more options. After each prompt, optional expert footer with source counts; then: `Want another prompt? Just tell me what you're creating next.`

**Context memory** for the session: retain `TOPIC`, `TARGET_TOOL`, KEY PATTERNS list, and findings; answer follow-ups without re-searching unless the topic changes.

## Recipe catalog

### Slash command (primary)

| Goal | Example invocation | Notes |
|------|-------------------|-------|
| Tool-specific prompting | `/last30days Nano Banana Pro prompting` | README exemplar: JSON prompts, edit-first workflow |
| Image model techniques | `/last30days Prompting GPT Image 2` | Requires `ai_image_generation` peer subs in Resolved block |
| Coding agent prompts | `/last30days Claude Code prompting` | Category `ai_coding_agent`; plan with `how_to`/`product` subqueries |
| Video model | `/last30days Seedance prompting` | `ai_video_generation` peers + prompting supplements |

### Direct CLI (dev/scripting only)

```bash
python3 skills/last30days/scripts/last30days.py "Nano Banana Pro prompting" \
  --emit=compact \
  --plan /tmp/query-plan.json \
  --subreddits=StableDiffusion,midjourney,dalle2,aiArt \
  --save-dir="${LAST30DAYS_MEMORY_DIR}"
```

The hosting model must still perform Step 0.55 resolution and Step 0.75 planning when using the skill; bare CLI omits synthesis, KEY PATTERNS, invitation, and prompt generation unless a separate agent applies `SKILL.md`.

### Depth and timing

| Flag | Effect on prompting runs |
|------|--------------------------|
| `--quick` | Fewer items per source (faster, thinner technique coverage) |
| (default) | Balanced counts |
| `--deep` | More Reddit/X items—use when peer subs are broad |
| `--days=N` | Lookback window (default 30) |

## Failure modes and fixes

| Symptom | Likely cause | Fix |
|---------|--------------|-----|
| Brand-only subreddits, weak patterns | Skipped category-peer expansion | Re-run Step 0.55; add `(+ {category_id} peers)` subs from `categories.py` |
| Literal `how to use X` retrieval noise | Class 3 keyword trap | Reframe to tips/workflows phrasing in Resolved block |
| Raw `## Ranked Evidence Clusters` in chat | LAW 6 violation | Regenerate synthesis from evidence envelope only |
| Plain `@handle` without links | LAW 8 violation | Regenerate with `[name](url)` from raw dump |
| Prose prompt after JSON-heavy research | Format anti-pattern | Re-read PROMPT FORMAT from Judge section; output structured prompt |
| `Sources:` after invitation | LAW 1 / WebSearch override | Delete trailing list; keep engine `🌐 Web:` footer only |

## Related pages

<CardGroup>
<Card title="Query types" href="/query-types">
GENERAL, NEWS, PROMPTING, RECOMMENDATIONS, COMPARISON classification and pre-flight refusal paths.
</Card>
<Card title="Output contract" href="/output-contract">
Badge, LAWs voice contract, `--emit` modes, evidence blocks, footer pass-through.
</Card>
<Card title="Research pipeline" href="/research-pipeline">
Planner sub-queries, fan-out, fusion, clustering, dedupe, rerank, depth profiles.
</Card>
<Card title="Skill contract" href="/skill-contract">
SKILL.md authority: Step 0, pre-flight, engine invocation, `SKILL_DIR` substitution.
</Card>
<Card title="Configure sources" href="/configure-sources">
Credentials and `--diagnose` for Reddit, X, YouTube, ScrapeCreators, and web backends.
</Card>
<Card title="Per-client setup" href="/per-client-setup">
Project-scoped `.claude/last30days.env` and save-dir isolation for recurring prompt research.
</Card>
</CardGroup>
