OpenSpec .md files should provide JSON metadata in the md file header that link back to the prompts used to create and/or modify them

Open
#2,036 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
typescript

Research direction

The issue does not name specific files, tests, or entry points. Start by locating the agent instructions and document-generation or check-in integration for OpenSpec markdown files, then determine whether the requested scope is prompt-URI tags, YAML creation metadata, update history, or all three. Done should be defined by the project’s chosen metadata schema and verified for both newly created and updated documents.

Written by the indexing model from the issue text.

Description

enhancement needs-triage
The problem, in one or two sentences

When .md files are written or updated by agents, I find it helpful to be able to trace them back to the specific agent, session, and prompt that writes them. The IETF Draft https://www.ietf.org/archive/id/draft-boone-prompt-uri-scheme-01.html descripts the prompt-uri scheme, and suggests how it might be used in check ins, and metadata enabling documentation of the prompt used to create or update the md file. This content enables agents to search prior sessions for prompts, and users to understand how the content came to be created, which gives additional historical context enabling a user to track how a change has progressed over time, giving more context to both the user and the agent.

In this feature request, I am minimally requesting that agents be directed that checkins of files using the @Prompt-URI tag in the check in.

I would love this feature even more if it guides the agents in creation of appropriate .md file yaml metadata to include some metadata in yaml format in the md file about each file creation. or update:

schema_version: '1.0'
document_type: openspec-proposal        # or openspec-design, openspec-spec, openspec-tasks
created:
  date: '2026-10-03T17:21:07.546Z'       # * strongly recommended — MCP-generated, RFC 3339 UTC, ms precision
  user: kboone                           # * strongly recommended — MCP-generated, OS username
  agent:
    name: claude-code                    #   less critical — e.g. claude-code, github-copilot-cli
    version: '2.1.263'                   #   less critical — actual CLI/tool version
  llm:
    name: claude-sonnet-5                #   less critical — e.g. claude-sonnet-5, claude-sonnet-4-6, gpt-5
    version: '20260101'                  #   less critical — model release-date snapshot, format varies by vendor
  prompt_uri: 'prompt:/claude-code/d4131666-810c-4b6e-b704-fe0024e84f15/~5f6d82c0-ab47-4e61-ae1b-c77e9fbd78a2'                             # * strongly recommended — MCP-generated, draft-boone-prompt-uri-scheme-01
  summary: 'Initial proposal for the X capability'   # * strongly recommended
updated:
  - date: '2026-10-03T18:05:44.112Z'     # * strongly recommended
    user: kboone                          # * strongly recommended
    agent:
      name: claude-code
      version: '2.1.263'
    llm:
      name: claude-sonnet-5
      version: '20260101'
    prompt_uri: 'prompt:/claude-code/d4131666-810c-4b6e-b704-fe0024e84f15/~a3bb21c4-...'  # * strongly recommended
    summary: 'Added Impact section after SME review'  # * strongly recommended 

The metadata makes it so much easier to track back the change request work through possibly several different agent sessions, even across multiple agents (something I've been known to do when I run out of tokens on one agent is switch to another one that has tokens left).

Who this affects

Anyone working with multiple changes, especially across different agents and sessions.

What you tried

I have existing MCPs which force agents to create MD files with appropriate metadata and prompt URIs, and github actions on checkin which forcibly add the @Prompt-URI tag to the checking (they are documented in the IETF draft), but I'd love to see this draft more broadly used in Agentic tooling.

What you have in mind

Minimally, When a specification is checked in, or a change is pushed the checkin comment, or push comment comment contains the @Prompt-URI metadata tag at the end so that folks can trace it back, or at least the developer creating it can trace it back to a specific session and prompt.

Ideally, When change request documents are created, the creation and update metadata is recorded so that history can be tracked over time in yaml metadata in the .md files.

Dominant language
TypeScript
Stars
76k
Forks
5.2k
Avg merge
1d 5h
Merged PRs (30d)
58

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Fission-AI/OpenSpec

All issues in Fission-AI/OpenSpec

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.