Skip to content

Add enhance-prompt workflow for upgrading prompt assets#261

Open
abeltrano wants to merge 4 commits into
mainfrom
add-enhance-prompt-template
Open

Add enhance-prompt workflow for upgrading prompt assets#261
abeltrano wants to merge 4 commits into
mainfrom
add-enhance-prompt-template

Conversation

@abeltrano

Copy link
Copy Markdown
Collaborator

Summary

Adds enhance-prompt, an interactive PromptKit workflow that takes an
existing prompt asset (raw prompt, Copilot prompt file, agent definition,
instruction/skill file, or a combination) and enhances it with current
PromptKit capabilities — enriching non-PromptKit assets and upgrading
PromptKit-generated ones to features added since they were authored. Supports a
document mode (enhancement plan) and an action mode (apply in place after
confirmation). Closes #260.

New Components

Type Name Path Description
template enhance-prompt templates/enhance-prompt.md Interactive, dual-mode (document/action) workflow that enhances an existing prompt asset with current PromptKit capabilities.
protocol (reasoning) prompt-enhancement protocols/reasoning/prompt-enhancement.md Ingest → provenance/version detect → capability baseline → gap analysis → propose → apply → verify; preserves intent and user customizations.
format enhancement-report formats/enhancement-report.md Structures provenance/version detection, capability baseline, a prioritized category-classified enhancement plan, applied changes, residual gaps, and coverage.
taxonomy enhancement-categories taxonomies/enhancement-categories.md Classification scheme (E1–E8) of enhancement opportunities; doubles as a user-selectable focus filter.

Reuses the existing promptkit-contributor persona and the anti-hallucination
and self-verification guardrails. manifest.yaml updated with all four
components.

Design Decisions

  • Distinct from decompose-prompt, and complementary. decompose-prompt
    extracts reusable components from a prompt into the library (output: a
    library contribution). enhance-prompt goes the other direction: it enriches
    the user's asset from the library (output: the improved asset + a report).
    No functional overlap. It reuses the same persona/guardrail set as
    decompose-prompt for consistency.
  • Naming: "prompt", not "primitive". "primitive" is already used throughout
    the corpus for language/synchronization/cryptographic primitives; reusing it
    for prompt-like assets would collide. Following decompose-prompt and
    lint-prompt, "prompt" is used as the loose umbrella and the body defines
    "prompt asset" explicitly. "artifact" was avoided because it denotes pipeline
    document outputs.
  • Dual-mode, modeled on review-pull-request. Document mode produces a
    plan; action mode applies confirmed enhancements in place. A mandatory
    confirmation gate precedes any edit.
  • Provenance/version detection degrades gracefully. The protocol reads a
    <!-- Generated by PromptKit … --> marker when present and infers from
    structure otherwise; a missing marker is a normal result. E3 (version
    upgrade) labels require provenance evidence, otherwise gaps are E2 (new
    capability) — the protocol never fabricates a prior version.
  • Taxonomy is dual-purpose. Users may name categories to scope the work; if
    none is given, the workflow scans the asset and suggests categories.
  • Out of scope (low-priority follow-up, tracked in New enhance-prompt workflow: continuously enhance existing prompt assets with current PromptKit capabilities #260). Library-level
    version-stamping of generated outputs (extending the provenance marker to
    carry a version in bootstrap.md and the output formats) is intentionally
    not implemented here; enhance-prompt only reads such markers and can add one
    to a user asset (category E8). The workflow does not depend on it.

Follow-ups (not in this PR)

Checklist

  • All files have SPDX license headers
  • YAML frontmatter is valid and complete
  • Component names match file names (kebab-case)
  • manifest.yaml updated with all new components
  • No vague instructions in protocols or templates
  • Protocols have numbered, ordered phases
  • Templates have a quality checklist section
  • New components do not conflict with existing ones
  • python tests/validate-manifest.py passes
  • python tests/validate-graph-integrity.py passes

Add an interactive workflow that takes an existing prompt asset (raw
prompt, Copilot prompt file, agent definition, instruction/skill file, or
a combination) and enhances it with current PromptKit capabilities. It
enriches non-PromptKit assets and upgrades PromptKit-generated ones to
features added since they were authored, with a document mode (enhancement
plan) and an action mode (apply in place after explicit confirmation).

New components:
- template: enhance-prompt (agent-authoring, interactive, dual-mode)
- protocol (reasoning): prompt-enhancement
- format: enhancement-report
- taxonomy: enhancement-categories (E1-E8)

Reuses the promptkit-contributor persona and the anti-hallucination and
self-verification guardrails. Updates manifest.yaml; both the
validate-manifest and validate-graph-integrity checks pass.

Closes #260.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 18, 2026 00:16
@abeltrano abeltrano added the enhancement New feature or request label Jun 18, 2026
@abeltrano abeltrano self-assigned this Jun 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new interactive PromptKit workflow, enhance-prompt, to upgrade/enrich existing prompt assets (both PromptKit-generated and non-PromptKit) using current library components, producing an enhancement report and optionally applying confirmed edits in-place.

Changes:

  • Introduces the enhance-prompt interactive template orchestrating a dual-mode (document/action) enhancement flow.
  • Adds the prompt-enhancement reasoning protocol plus the enhancement-report format and enhancement-categories taxonomy to structure classification, planning, application, and verification.
  • Updates manifest.yaml to register the new protocol/format/taxonomy/template.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
templates/enhance-prompt.md New interactive template coordinating the enhancement workflow and confirmation gates.
protocols/reasoning/prompt-enhancement.md New end-to-end reasoning protocol for ingestion → provenance/version detect → baseline → gap analysis → propose → apply → verify.
formats/enhancement-report.md New report format defining full/abbreviated structures, statuses, and required sections.
taxonomies/enhancement-categories.md New E1–E8 taxonomy to classify enhancement opportunities and allow user scoping.
manifest.yaml Registers the new template/protocol/format/taxonomy in the library manifest.

Comment thread formats/enhancement-report.md Outdated
Comment thread protocols/reasoning/prompt-enhancement.md Outdated
Comment thread templates/enhance-prompt.md Outdated
Comment thread taxonomies/enhancement-categories.md Outdated
Resolve four review threads on #261:

- enhancement-report: expand the abbreviated Coverage section to the full
  four self-verification fields (Examined/Method/Excluded/Limitations) so it
  no longer contradicts the format's own coverage rule.
- prompt-enhancement: ground the E8 provenance version stamp in the top-level
  version: scalar in manifest.yaml (the source bootstrap.md uses), and fall
  back to "version unknown" instead of guessing.
- enhance-prompt / enhancement-categories / prompt-enhancement: replace
  references to undefined "short names" with the supported identifiers
  (numeric IDs E1-E8 and full label IDs like E1_MISSING_GUARDRAIL).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread formats/enhancement-report.md Outdated
Comment thread protocols/reasoning/prompt-enhancement.md Outdated
Comment thread templates/enhance-prompt.md Outdated
Resolve three more review threads on #261:

- enhancement-report: add the Preserves field to the abbreviated Enhancement
  Plan block so it satisfies the format's own rule requiring every edit to
  name the customizations it preserves.
- prompt-enhancement: correct the Phase 1 asset-type heuristics to match the
  repository's formats - tools frontmatter is optional for .prompt.md files
  (only description/agent are required), and custom agents use the .agent.md
  suffix.
- enhance-prompt: stop hard-coding the full-format "summary table" structure
  and defer to the enhancement-report format's own abbreviated/full selection
  rule, removing the conflicting instruction.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@abeltrano abeltrano requested a review from Copilot June 18, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread templates/enhance-prompt.md Outdated
Comment thread templates/enhance-prompt.md Outdated
Comment thread templates/enhance-prompt.md Outdated
Comment thread formats/enhancement-report.md Outdated
Ran PromptKit's own review-code + self-verification methodology over the four
enhance-prompt components. It confirmed the recurring abbreviated-format
issues from the GitHub review share a single root cause and surfaced four
additional latent issues. Fix them all so the component set is internally
consistent:

- enhancement-report: remove the abbreviated format variant entirely. The
  only consumer (enhance-prompt) already requires the full structure in both
  modes, and the abbreviated variant lacked the provenance, applied-changes,
  and residual-gaps sections the workflow needs. This resolves the section-3 /
  section-6 cross-reference breakage (review threads on the template) at the
  source. The report now has one required structure.
- enhance-prompt: reference report sections by name (Provenance and Version
  Detection, Applied Changes) instead of by number, for resilience.
- enhance-prompt: split the confirmation vocabulary by mode - action mode
  offers apply/defer/skip; document mode offers recommend/defer/skip (document
  mode cannot produce Applied status).
- enhance-prompt / enhancement-report: include Deferred in the "no changes
  applied" wording (was "Proposed or Skipped", omitting a valid status).
- enhance-prompt: validate output_mode up front - it must be exactly document
  or action; ask when blank/invalid; never enter action mode without an
  explicit action.
- prompt-enhancement / enhancement-report: rename provenance labels to
  "PromptKit provenance detected (version known/unknown)" / "No PromptKit
  provenance detected" to match the detection model, which includes
  structurally inferred (not only generated) provenance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New enhance-prompt workflow: continuously enhance existing prompt assets with current PromptKit capabilities

2 participants