Skip to content

[agentic-token-optimizer] Optimize Daily AI Poem — Prompt Compression for Consistent Token Savings #266

Description

@github-actions

Note: All top-5 workflows by AIC were optimized within the last 14 days. "Daily AI Poem" is selected as the least-recently optimized (9 days ago, 2026-07-01), making it the most eligible candidate under the 14-day exclusion rule.

Target Workflow

Daily AI Poem — posts a themed AI/developer poem as a GitHub Discussion daily at ~08:00 UTC.

  • Workflow file: .github/workflows/daily-ai-poem.md
  • Selected because: highest AIC among workflows exceeding the 14-day exclusion window
  • Analysis period: 7-day window ending 2026-07-10

Spend Profile

Metric Value
Runs analyzed 7
Total AIC 123.73
Avg AIC / run 17.68
Total tokens (observed) 48,974 (1 run with full data)
Avg tokens / run (est.) ~7,000
Avg turns / run 2
Conclusions 7/7 success (100%)
Cache efficiency Not measured (single-run token sample)

With only 2 turns per run, the workflow is already structurally lean. All spending flows through prompt size and model input overhead.


Ranked Recommendations

1. Compress Theme List to Inline Format

Estimated savings: ~1.5–2.0 AIC/run (8–12% prompt token reduction)

The theme section enumerates 7 bullet items with short prose descriptions, consuming ~90 tokens of input on every run. Collapsing these to a compact inline table removes the repetitive structure without losing any information.

Current (7 bullets × ~13 tokens each):

- **0**: AI agents and their curious habits
- **1**: The joy and pain of debugging
- **2**: Large language models trying to understand humans
- **3**: Pull requests, code reviews, and the art of "LGTM"
- **4**: Prompt engineering as a new form of poetry
- **5**: The future of developer tools and copilots
- **6**: Open-source community and the people who build it

Proposed (single inline line, ~30 tokens):

Themes (day-of-month mod 7): 0=AI agent habits · 1=debugging joy/pain · 2=LLMs vs humans · 3=PRs & LGTM culture · 4=prompt engineering · 5=dev tools & copilots · 6=open-source community

The mod-7 formula can also be pulled into the same line, removing the separate prose sentence introducing it.

Evidence: 7/7 runs observed, theme selection happens on every run, prompt tokens are the primary cost driver at 2 turns/run.


2. Tighten Instructions Section

Estimated savings: ~0.5–1.0 AIC/run (3–6% prompt token reduction)

The ## Instructions section contains four numbered steps. Steps 1 and 2 partially repeat the theme selection described above. Step 2's four sub-bullets can be compressed:

Current (~110 tokens):

1. Pick today's theme using the formula above (use today's date from the environment).
2. Write a poem of **3–4 stanzas** (4 lines each). It should:
   - Have a clear voice — playful, clever, and warm
   - Use concrete details (tool names, concepts, emojis welcome) to feel authentic
   - Be funny or touching, not generic — a developer reading this should nod and smile
   - Rhyming is encouraged but optional; rhythm matters more
3. Give the poem a punchy, memorable title (3–8 words).
4. Write a one-sentence "Inspiration Note" explaining what sparked today's theme.

Proposed (~70 tokens):

1. Select today's theme (theme index above).
2. Write 3–4 stanzas of 4 lines each: playful, clever, with concrete dev details (tool names, emojis ok). Rhythm over rhyme.
3. Give the poem a punchy title (3–8 words).
4. Add a one-sentence Inspiration Note.

Evidence: Instruction verbosity contributes to model input on every run with no differentiated output quality observed across runs.


3. Remove Redundant Output Format Caveat

Estimated savings: ~0.2–0.3 AIC/run (1–2% prompt token reduction)

The ## Output section ends with: "Keep it clean and emoji-tasteful. A developer should be able to share this on their team Slack without embarrassment. 🚀"

This duplicates guidance already implied by "playful, clever, and warm" and "a developer reading this should nod and smile" in Instructions. Removing it saves ~25 tokens per run.

Evidence: 7/7 successful runs produce clean, shareable content — the constraint is evidently well-understood without the reminder.


Combined Savings Estimate

Recommendation Est. AIC savings/run Confidence
Compress theme list 1.5–2.0 High
Tighten instructions 0.5–1.0 Medium
Remove output caveat 0.2–0.3 High
Total 2.2–3.3

At 7 runs/week, this equates to ~15–23 AIC/week in avoided spend.


Caveats

  • Token data is available for only 1 of 7 runs; per-run token estimates are extrapolated from that sample.
  • All savings estimates are based on input token reduction; output token count (the poem itself) is fixed by the 3–4 stanza constraint and unaffected.
  • The workflow is already highly reliable (100% success, 2 turns/run) — no reliability improvements are warranted.
  • No inline sub-agents are recommended: the entire workflow is a single creative generation task; sub-agents would add overhead with no parallelism benefit.

References: §29083082328

Generated by Agentic Workflow AIC Usage Optimizer · 117.7 AIC · ⊞ 21.6K ·

  • expires on Jul 17, 2026, 3:23 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions