Skip to content

[agentic-token-optimizer] Optimization: Release workflow — prompt condensation, tool scoping, and CHANGELOG sub-agent #80

@github-actions

Description

@github-actions

Target Workflow

Release — selected as the highest-value agentic workflow with the oldest meaningful optimization entry (2026-05-19, 3,079 tokens analyzed). Subsequent optimization log entries from 2026-05-20–2026-05-26 all show 0 tokens analyzed, suggesting no effective re-analysis was performed. The prompt body is 1,201 words / 130 lines — the longest of any readable agentic workflow source in this repo.

Data note: All pre-aggregated token snapshots (top-workflows.json, daily .json files) report zero tokens across all workflows for the current 7-day window. Recommendations below are derived from static prompt analysis and run history.


Analysis Period

Metric Value
Period 2026-05-14 → 2026-05-27 (13 days)
Runs available 2 (2026-05-14, 2026-05-20)
All conclusions ✅ success
Avg run duration ~4 min
Token data Not available (all snapshots at 0)

Token Profile

Metric Value
Total tokens (last meaningful audit) ~3,079
Avg tokens/run (estimated) ~1,540
Avg turns/run Not available
Cache efficiency Not available
Prompt body size 1,201 words, 130 lines
Configured tools bash: ["*"] (all bash tools)

Ranked Recommendations

1. Condense Overlapping Prompt Sections — Est. ~350 tokens/run

The ## What to Write section (106 lines) contains three partially overlapping subsections that cover the same exclusion logic from different angles:

  • "Selection rubric for whether a change belongs in the release notes" (8 bullets) — include/exclude criteria
  • "Exclude internal-only changes unless they materially affect users" (10 bullets) — overlaps heavily with the rubric
  • "Release-note anti-patterns to avoid" (8 bullets) — several overlap with writing quality constraints

Action: Merge the selection rubric and exclusion list into one 6-bullet decision table. Move the anti-patterns into a two-line addendum at the end of the quality constraints.

Evidence: Both the rubric and the exclusion section explicitly list: CI/build/test changes, commit SHAs, contributor mentions, and dependency bumps as exclusions. This duplication adds ~30 lines that fire on every run.

Estimated savings: ~300–400 tokens/run from reduced prompt size.


2. Scope bash Tool List — Est. ~150–250 tokens/run

The workflow declares tools: bash: ["*"], which exposes documentation for every available bash sub-tool to the agent on each run. Based on the prompt and setup step, the agent only needs bash (for git, gh, and file operations).

Action: Replace bash: ["*"] with an explicit allowlist:

tools:
  bash:
    - bash

Evidence: The prompt contains no instructions referencing view, edit, create, grep, or glob tools — only bash commands. Both observed runs completed successfully with standard git/gh operations.

Estimated savings: ~150–250 tokens/run (fewer tool descriptions loaded into context).


3. Compress Semver-Awareness Section — Est. ~80 tokens/run

The semver guidance block spans 20+ lines to describe 4 tag patterns. These can be replaced by a 5-line table:

Semver guidance by tag type:
- major (vX.0.0): lead with breaking changes and migration steps
- minor (vX.Y.0): lead with new capabilities and behavior changes
- patch (vX.Y.Z): lead with fixes and reliability improvements
- 0.y.z: treat as pre-1.0; still name breaking changes explicitly

The verbose form adds no information beyond what the agent already knows from semver semantics.


Structural Optimization

Inline Sub-Agent: CHANGELOG Update

The ## What to Write section bundles two distinct tasks: (1) writing the release notes body, and (2) updating CHANGELOG.md and pushing the commit. The second task is purely mechanical — read the file, insert a formatted entry, commit, push.

Scoring:

Dimension Score Rationale
Independence 2/3 Needs final release body; can run once main agent confirms
Small-model adequacy 3/3 Pure formatting + git operations — no strategic synthesis
Parallelism 1/2 Sequential (needs notes first)
Size 2/2 Multi-step: read, write, commit, push
Total 8/10 Strong candidate

Why a smaller model fits: Updating CHANGELOG.md is template insertion — the format is fixed (Keep a Changelog), the content is already derived, and the only operation is a structured file edit followed by git commit && git push. No cross-referencing or synthesis required.

Proposed change: Replace the CHANGELOG update instructions in ## What to Write with an inline sub-agent block after the release body is finalized:

## agent: Update CHANGELOG

Insert a Keep a Changelog entry for `${RELEASE_TAG}` into `CHANGELOG.md`.
- Format: `## [x.y.z] - YYYY-MM-DD` above the previous version entry
- Sections: only `Added`, `Changed`, `Fixed`, `Removed`, `Security` — omit empty ones
- Content: the user-facing bullets from the finalized release body
- Commit: `docs: update changelog for ${RELEASE_TAG}` as `github-actions[bot]`
- Push: `git push origin HEAD:${RELEASE_TARGET}` (skip if RELEASE_TARGET is a commit SHA)

Estimated savings on main agent: ~200–300 tokens/run (removes 30+ lines of git/CHANGELOG instructions from main context); remainder charged to a smaller model.


Summary

Recommendation Est. savings/run Effort
Condense overlapping prompt sections ~350 tokens Medium
Scope bash tool list ~200 tokens Low
Compress semver section ~80 tokens Low
CHANGELOG sub-agent ~250 tokens (main model) Medium
Total ~880 tokens/run

Caveats

  • Token data is unavailable across all snapshots; savings estimates are based on prompt line/word counts and typical tool-registration overhead.
  • Only 2 runs were available for analysis; estimates cannot be validated statistically.
  • Prompt condensation must preserve all behavioral requirements — review proposed merges manually before applying.
  • The sub-agent recommendation assumes the gh-aw framework supports inline agent blocks; verify before implementing.
  • Tool scope narrowing should be validated in a test run to confirm no required tool is removed.

References: §26163733067 · §25873066389

Generated by Agentic Workflow Token Usage Optimizer · ● 10.2M ·

  • expires on Jun 3, 2026, 3:44 PM UTC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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