Skip to content

Add persistent agent instruction file output mode (Copilot, Claude Code, Cursor)#14

Merged
Alan-Jowett merged 5 commits intomainfrom
copilot/output-copilot-instructions-files
Mar 18, 2026
Merged

Add persistent agent instruction file output mode (Copilot, Claude Code, Cursor)#14
Alan-Jowett merged 5 commits intomainfrom
copilot/output-copilot-instructions-files

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

PromptKit currently only outputs ephemeral raw prompts that live in a single chat session. This adds a second output mode that produces persistent, version-controlled agent instruction files automatically loaded by agent runtimes.

New components

  • formats/agent-instructions.md — Format spec for platform-appropriate instruction files. Defines output structure, per-platform constraints (file paths, size limits, loading behavior, test verification), and formatting rules (second-person directives, no PromptKit section headers, no unresolved {{param}} placeholders).

  • templates/author-agent-instructions.md — Template that condenses a PromptKit persona + protocol set into a ready-to-commit instruction file. Handles per-platform size adaptation (Copilot ≤8 KB, Cursor ≤2 KB, Claude Code unconstrained) and explicit All multi-platform output generating three distinct files.

  • tests/references/copilot-instructions-memory-safety.md — Reference output for a systems-engineer + memory-safety-c instruction file targeting GitHub Copilot.

Modified components

  • bootstrap.md — Adds step 6: output mode selection (raw prompt vs. agent instruction file) with platform targeting and auto-computed output paths:

    Platform Output path
    GitHub Copilot .github/copilot-instructions.md
    Claude Code CLAUDE.md
    Cursor .cursorrules

    Also adds a guideline to proactively suggest agent instruction mode for recurring/project-wide tasks, and a second example interaction demonstrating the flow.

  • manifest.yaml — Registers agent-instructions format and adds new agent-authoring template category containing author-agent-instructions.

Original prompt

This section details on the original issue you should resolve

<issue_title>Output GitHub Copilot custom instructions / skill files instead of raw prompts</issue_title>
<issue_description>## Idea

Currently PromptKit assembles a raw prompt (Markdown) that the user copies into a fresh LLM session. Instead, PromptKit could output GitHub Copilot custom instructions files (e.g. .github/copilot-instructions.md, skill definitions) along with appropriate format variants for other agent platforms.

Motivation

  • Raw prompts are ephemeral — they live in a chat session and are lost when it ends.
  • Copilot custom instructions / skill files are persistent, version-controlled, and automatically loaded by the agent runtime.
  • This would make PromptKit a tool for authoring reusable agent behaviors, not just one-off prompts.

Possible scope

  • Output .github/copilot-instructions.md\ for GitHub Copilot.
  • Output platform-appropriate formats for other agent runtimes (Claude Code, Cursor, etc.).
  • Template metadata could declare which output formats are supported.
  • Bootstrap flow could ask the user which platform(s) they target.

Open questions

  • Should this replace raw prompt output or be an additional output mode?
  • Which agent platforms should be supported initially?
  • How should platform-specific constraints (e.g., file size limits, supported syntax) be handled?</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…e, and Cursor

Co-authored-by: Alan-Jowett <20480683+Alan-Jowett@users.noreply.github.com>
Copilot AI changed the title [WIP] Add output for GitHub Copilot custom instructions files Add persistent agent instruction file output mode (Copilot, Claude Code, Cursor) Mar 18, 2026
Copilot AI requested a review from Alan-Jowett March 18, 2026 21:49
@Alan-Jowett Alan-Jowett marked this pull request as ready for review March 18, 2026 21:50
Copilot AI review requested due to automatic review settings March 18, 2026 21:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 PromptKit output mode for generating persistent, version-controlled agent instruction files (for GitHub Copilot, Claude Code, and Cursor) in addition to the existing ephemeral “raw prompt” output.

Changes:

  • Introduces a new agent-instructions format spec describing structure and platform constraints.
  • Adds a new author-agent-instructions template to condense personas/protocols into platform-ready instruction files (including “All” multi-platform output).
  • Updates bootstrap.md and manifest.yaml to support selecting this new output mode and registering the new format/template.

Reviewed changes

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

Show a summary per file
File Description
tests/references/copilot-instructions-memory-safety.md Adds a reference instruction-file output targeting GitHub Copilot.
templates/author-agent-instructions.md New template for producing persistent agent instruction files across supported platforms.
manifest.yaml Registers the new agent-instructions format and the new agent-authoring template category.
formats/agent-instructions.md New format spec defining output structure, platform notes, and formatting rules for instruction-file output.
bootstrap.md Extends the bootstrap flow to support output mode selection (raw prompt vs instruction file) and platform-based default paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Alan Jowett and others added 3 commits March 18, 2026 14:59
…t-instructions.md

The original implementation produced a single .github/copilot-instructions.md
blob. This rework produces composable GitHub Copilot skill files under
.github/instructions/*.instructions.md — each with YAML frontmatter
(description, applyTo) for file-targeted activation.

This aligns with:
- Issue #8's request for 'skill files'
- PromptKit's own compositional architecture (one skill per protocol)
- Copilot's modern instruction file model (per-file targeting via applyTo)

Changes across all 5 files in this PR:

formats/agent-instructions.md:
  - Define skill file output structure with YAML frontmatter spec
  - Document decomposition strategy (persona+guardrails skill + per-protocol skills)
  - Add applyTo glob guidance per protocol category

templates/author-agent-instructions.md:
  - Add Step 2 (skill decomposition planning) before content generation
  - Generate one skill file per logical concern with applyTo targeting
  - Quality checklist validates frontmatter, filenames, and composability

bootstrap.md:
  - Output path: .github/instructions/<name>.instructions.md (not copilot-instructions.md)
  - Updated example shows multiple skill files with applyTo globs

manifest.yaml:
  - Updated descriptions to reference skill files

tests/references/:
  - Renamed to memory-safety-c-skill.instructions.md
  - Added proper YAML frontmatter (description, applyTo: **/*.c, **/*.h)
  - Restructured as a self-contained, independently-loadable skill

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The bootstrap must ask the user for their target project directory
before writing agent instruction files. The output belongs in the
user's project (.github/instructions/ etc.), not in the PromptKit
repository itself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move output-mode selection (now step 5b) before parameter collection
  (now step 6) so that switching to author-agent-instructions does not
  invalidate already-collected params.
- Restrict scope param to 'project' only since no platform defines
  user-level output paths or behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Alan-Jowett Alan-Jowett merged commit bd5737c into main Mar 18, 2026
2 checks passed
@Alan-Jowett Alan-Jowett deleted the copilot/output-copilot-instructions-files branch March 18, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output GitHub Copilot custom instructions / skill files instead of raw prompts

3 participants