Optimize a Copilot customization artifact
Goal: produce a compact semantic rewrite with a usable draft and bounded verification,
not a guarantee of identical outputs or universal meaning preservation.
Workflow:
- Run
zen detect PATH for AGENTS.md, copilot-instructions.md, *.instructions.md, *.prompt.md, *.agent.md, or SKILL.md.
- Choose the actual target model and a strong rewrite/judge model.
- Set
--budget before an unfamiliar run. Semantic mode defaults to a small budget;
--max-metric-calls is for the opt-in GEPA engine only.
- Run
zen selfcheck after optimizer code changes.
- Run
zen optimize PATH.
- Read the report, differences and errors. Get this run's paths from the CLI or
manifest, not the path-free report. Review the draft
manually; never apply it automatically. For REVIEW_REQUIRED, the CLI asks whether
to accept. Yes sets CONFIRMED by user and records the earlier model assessment in
the report. Never supply --accept-draft without explicit user authorization;
acceptance does not mean the model checks passed or replace the source.
The default semantic engine reads the full body and rewrites it, consolidating
repetition while preserving actions, constraints, conditions, exceptions, priorities,
language, and required public formats. It saves a usable draft before evaluation,
then uses direct semantic review, bounded correction, and source-based task comparisons.
No supplied labeled dataset is required. GEPA search remains opt-in with --engine gepa.
Semantic interpretation:
- Verification is separate from draft availability. Incomplete evidence, important
meaning loss, or insufficient reduction requires review; a saved draft is retained.
- Complete but disputed evidence gets one final adjudication inside the shared budget
(one schema retry, no provider retry). Model-origin CONFIRMED means the final model resolved every
initial flag and found no material regression in either phase; it is not VERIFIED
or human approval. Keep the original findings visible. Missing/error evidence,
source/draft changes and deterministic token/line gates cannot be overridden.
- User-origin CONFIRMED means explicit acceptance of a REVIEW_REQUIRED draft, even
with unmet model gates. Keep the original model decision, findings and errors in
the report. Source and frozen-file integrity checks still block publication.
- Shared baseline defects are not automatically regressions, but cannot excuse lost
instructions. Final review reads frozen holdout evidence without changing the draft.
- Harmless wording/order/length differences are not regressions. Missing important
facts, changed exceptions, or added requirements can be.
- Exact answer quotations and unnecessary reasoning/verification narration are not
mandatory evaluation conditions. Explicit source requirements cannot be silently
removed just because they are verbose.
- Validation and holdout remain separate; freeze the candidate before holdout and
never use holdout findings as repair feedback.
- Malformed model responses have bounded retries; errors never become successful
scores. First-generation failure can leave no draft; filesystem failures can
prevent a report. Do not promise unconditional generation.
- Semantic judgments are model proxies, not proof of equivalence or human understanding.
Tokens are local estimates, not billing. Fresh calls do not establish independent samples.
- Source hash checks and frozen metadata protect the original. Use current report
paths, not a stale candidate from an older run.
Semantic mode has no default hard line cap. --aggressive LINES or
--aggressive PERCENT% requests one; it is not evidence of preserved meaning.
Optional --focus task / --focus communication requires exact comment-delimited
sections; it does not infer them.
GEPA interpretation: ACCEPT still requires complete aligned error-free trials,
zero candidate critical failures, at most a 5pp drop in independent behavior/reader
trial rates, at least one behavior and reader pass per case, non-increasing
artifact/median output/reader tokens, and at least 3% combined reduction.
Its single-trial validation and small samples can make that tolerance ineffective.
GEPA REJECT/INCONCLUSIVE do not publish candidates. Its default line cap is 50%;
--compare-concision is GEPA-only measurement, never a selected artifact or GEPA input.
See the runtime guide.
Limits: one artifact, response-only single-turn cases, no repository-changing tools, frozen metadata, no hidden reasoning, and no automatic source replacement.
1---2name: zen-prompt-measure3description: Use when optimizing a GitHub Copilot customization artifact with the Zen CLI, running zen optimize/detect/selfcheck, or interpreting a Zen report. Do not use for generic prompt rewriting, hooks, mcp.json, or automatic candidate application.4---56# Optimize a Copilot customization artifact78Goal: produce a compact semantic rewrite with a usable draft and bounded verification,9not a guarantee of identical outputs or universal meaning preservation.1011Workflow:121. Run `zen detect PATH` for `AGENTS.md`, `copilot-instructions.md`, `*.instructions.md`, `*.prompt.md`, `*.agent.md`, or `SKILL.md`.132. Choose the actual target model and a strong rewrite/judge model.143. Set `--budget` before an unfamiliar run. Semantic mode defaults to a small budget;15 `--max-metric-calls` is for the opt-in GEPA engine only.164. Run `zen selfcheck` after optimizer code changes.175. Run `zen optimize PATH`.186. Read the report, differences and errors. Get this run's paths from the CLI or19 manifest, not the path-free report. Review the draft20 manually; never apply it automatically. For REVIEW_REQUIRED, the CLI asks whether21 to accept. Yes sets CONFIRMED by user and records the earlier model assessment in22 the report. Never supply --accept-draft without explicit user authorization;23 acceptance does not mean the model checks passed or replace the source.2425The default semantic engine reads the full body and rewrites it, consolidating26repetition while preserving actions, constraints, conditions, exceptions, priorities,27language, and required public formats. It saves a usable draft before evaluation,28then uses direct semantic review, bounded correction, and source-based task comparisons.29No supplied labeled dataset is required. GEPA search remains opt-in with `--engine gepa`.3031Semantic interpretation:32- Verification is separate from draft availability. Incomplete evidence, important33 meaning loss, or insufficient reduction requires review; a saved draft is retained.34- Complete but disputed evidence gets one final adjudication inside the shared budget35 (one schema retry, no provider retry). Model-origin CONFIRMED means the final model resolved every36 initial flag and found no material regression in either phase; it is not VERIFIED37 or human approval. Keep the original findings visible. Missing/error evidence,38 source/draft changes and deterministic token/line gates cannot be overridden.39- User-origin CONFIRMED means explicit acceptance of a REVIEW_REQUIRED draft, even40 with unmet model gates. Keep the original model decision, findings and errors in41 the report. Source and frozen-file integrity checks still block publication.42- Shared baseline defects are not automatically regressions, but cannot excuse lost43 instructions. Final review reads frozen holdout evidence without changing the draft.44- Harmless wording/order/length differences are not regressions. Missing important45 facts, changed exceptions, or added requirements can be.46- Exact answer quotations and unnecessary reasoning/verification narration are not47 mandatory evaluation conditions. Explicit source requirements cannot be silently48 removed just because they are verbose.49- Validation and holdout remain separate; freeze the candidate before holdout and50 never use holdout findings as repair feedback.51- Malformed model responses have bounded retries; errors never become successful52 scores. First-generation failure can leave no draft; filesystem failures can53 prevent a report. Do not promise unconditional generation.54- Semantic judgments are model proxies, not proof of equivalence or human understanding.55 Tokens are local estimates, not billing. Fresh calls do not establish independent samples.56- Source hash checks and frozen metadata protect the original. Use current report57 paths, not a stale candidate from an older run.5859Semantic mode has no default hard line cap. `--aggressive LINES` or60`--aggressive PERCENT%` requests one; it is not evidence of preserved meaning.6162Optional `--focus task` / `--focus communication` requires exact comment-delimited63sections; it does not infer them.6465GEPA interpretation: `ACCEPT` still requires complete aligned error-free trials,66zero candidate critical failures, at most a 5pp drop in independent behavior/reader67trial rates, at least one behavior and reader pass per case, non-increasing68artifact/median output/reader tokens, and at least 3% combined reduction.69Its single-trial validation and small samples can make that tolerance ineffective.70GEPA `REJECT`/`INCONCLUSIVE` do not publish candidates. Its default line cap is 50%;71`--compare-concision` is GEPA-only measurement, never a selected artifact or GEPA input.72See [the runtime guide](../../../docs/documentation.md).7374Limits: one artifact, response-only single-turn cases, no repository-changing tools, frozen metadata, no hidden reasoning, and no automatic source replacement.