一键导入
prompt-version
Track prompt iterations with diffs, scores, and rollback capability. Version control for prompts — the "source code" of AI automations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Track prompt iterations with diffs, scores, and rollback capability. Version control for prompts — the "source code" of AI automations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run AI-specific inversion analysis on a requirement before implementation. Dispatches the `ai-invert-analyst` agent on a separate thread. Use before complex or high-stakes AI tasks that touch prompts, models, RAG, or AI-powered outputs.
Autonomously improve any skill or agent prompt via measure-change-test hill-climbing. Dispatches the `auto-improver` agent on a separate thread. Use when a skill gives inconsistent results, when asked to "improve/optimize/autoresearch" a skill, or when output quality needs iterative tightening.
Capture a reproducible AI performance baseline before changes. Dispatches the `baseline-capturer` agent on a separate thread. Use before any change to a client-facing AI output. Triggered automatically by the Q3 gate in CLAUDE.md.
Generate AI tool configuration for an existing project. Explores the codebase and produces context files, path-scoped pattern rules, landmine rules, and agents for Claude Code and VS Code Copilot. Run once per project.
Inject managed sections into existing CLAUDE.md and AGENTS.md after a North Starr GenAI plugin update without re-bootstrapping. Preserves all project-specific content.
Generate executable pytest test files for AI outputs. Produces assertion-based tests for deterministic AI components (classification, extraction, routing, structured output) that run in CI/CD. Complements /eval-suite which produces statistical evaluation datasets for non-deterministic outputs.
| name | prompt-version |
| description | Track prompt iterations with diffs, scores, and rollback capability. Version control for prompts — the "source code" of AI automations. |
| argument-hint | <prompt name> |
Track prompt iterations with diffs, eval scores, and rollback capability. Prompts are the "source code" of AI automations — a single word change in a prompt can dramatically alter system behavior, accuracy, cost, and safety. Yet prompts often live in code files or config strings without the version control discipline applied to application code.
This skill provides structured prompt versioning: every change is snapshotted with metadata, diffed against the previous version, scored against evals, and logged in a changelog. When a prompt change causes a regression, you can identify exactly what changed and roll back to a known-good version.
Run this whenever a prompt changes — whether during development, optimization, or production maintenance. The versioned history becomes an invaluable artifact for debugging, auditing, and the /handoff-doc skill.
Before starting, read the root CLAUDE.md (if it exists). If ## How to Approach Tasks appears AFTER ## Tech Stack or ## Architecture, the file has an outdated section order. Silently run /genai-sync to fix it before continuing with this skill.
The user provides the name of the prompt to version. This can be:
.plans/PROMPTS-*/The user may also specify an action:
Actions:
prompts/, src/prompts/, config files, inline prompt strings).plans/PROMPTS-<name>/ directory exists: read the latest version from thereCLAUDE.md, AGENTS.md) for prompt conventionsActions:
support-classifier, invoice-extractor, summarization-instructions).plans/PROMPTS-<name>/ directory if it does not existchangelog.md — version historyv1.md, v2.md, etc. — version snapshotsactive-version.md — pointer to the currently active versionActions:
.plans/PROMPTS-<name>/v<N>.md with this structure:# <prompt name> — Version <N>
**Version:** <N>
**Created:** <date and time>
**Author:** <who made this change — from user context or git>
**Model:** <model name and version this prompt is designed for>
**Model Config:** temperature=<T>, max_tokens=<N>, top_p=<P>, [other params]
**Reason for Change:** <why this version was created — what was the goal of the change?>
**Status:** <active / inactive>
## Prompt Text
```text
<full prompt text, exactly as it would be sent to the model>
<include system prompt, few-shot examples, format instructions, guardrail instructions>
<mark dynamic sections with clear delimiters: {{user_input}}, {{retrieved_context}}, etc.>
<1-3 sentences describing what changed from the previous version and why. For v1: "Initial version." with a brief description of the prompt's purpose.>
<If eval results are available at the time of versioning, record them here. If not available, note "Evals not yet run for this version.">
| Metric | Score | Threshold | Status |
|---|---|---|---|
| <PASS/FAIL> | |||
| <PASS/FAIL> |
2. If this is v1, the Change Summary should describe the prompt's purpose and initial design rationale
3. If this is v2+, the Change Summary should specifically describe what changed and why
### Step 4: Generate Diff from Previous Version
**Actions:**
1. If a previous version exists (v<N-1>.md), generate a readable diff:
- Show added lines, removed lines, and changed lines
- Highlight significant changes (not just whitespace or formatting)
- Call out changes to: instructions, examples, output format, guardrail language, model config
2. Write the diff as a section in the version file or present it to the user
3. Classify the change magnitude:
- **Minor**: Formatting, typo fixes, minor wording adjustments (low risk)
- **Moderate**: New examples, adjusted instructions, refined output format (medium risk, test recommended)
- **Major**: Structural changes, new capabilities, changed model, removed guardrails (high risk, evals required)
**Diff format:**
```markdown
## Diff from v<N-1>
**Change magnitude:** <Minor / Moderate / Major>
### Added
- <line or section added>
### Removed
- <line or section removed>
### Changed
- <before> -> <after>
### Model Config Changes
- <parameter>: <old value> -> <new value>
Actions:
.plans/EVAL-*/results.md — look for results timestamped near this version.plans/BASELINE-*.md) — flag if below threshold## Score Comparison
| Metric | v<N-1> | v<N> | Delta | Status |
|--------|--------|------|-------|--------|
| <metric> | <score> | <score> | <+/- delta> | <Improved / Regressed / Unchanged> |
Actions:
.plans/PROMPTS-<name>/changelog.md (create if it does not exist)## Changelog: <prompt name>
### v<N> — <date>
- **Author:** <who>
- **Reason:** <why this change was made>
- **Change magnitude:** <Minor / Moderate / Major>
- **Summary:** <1-2 sentence description of the change>
- **Eval status:** <Passed / Failed / Not yet run>
- **Status:** <Active / Inactive>
### v<N-1> — <date>
- ...
.plans/PROMPTS-<name>/active-version.md:# Active Version: <prompt name>
**Current active version:** v<N>
**Activated:** <date>
**Last eval:** <date and result, or "not yet run">
Actions (when the user requests a rollback):
.plans/PROMPTS-<name>/v<target>.mdactive-version.md to point to the target version### Rollback to v<target> — <date>
- **Author:** <who>
- **Reason:** <why rolling back — e.g., "v<N> caused accuracy regression">
- **Rolled back from:** v<N>
- **Rolled back to:** v<target>
- **Action required:** Update the prompt in the codebase to match v<target>
<path> to match v. The version tracking has been updated."After completing the requested action, present a concise summary:
For save operations:
## Prompt Version: <name>
**Action:** Saved v<N>
**Change magnitude:** <Minor / Moderate / Major>
**Change:** <1-sentence summary>
**Eval status:** <Passed / Failed / Not yet run>
**Active version:** v<N>
Prompt version saved to `.plans/PROMPTS-<name>/v<N>.md`.
Changelog updated at `.plans/PROMPTS-<name>/changelog.md`.
For rollback operations:
## Prompt Version: <name>
**Action:** Rolled back to v<target>
**Rolled back from:** v<N>
**Reason:** <reason>
**Active version:** v<target>
Version tracking updated. Update the prompt in the codebase at `<path>` to match v<target>.
For history/diff operations:
## Prompt Version: <name>
**Total versions:** <count>
**Active version:** v<N>
**Last change:** <date> — <summary>
<changelog or diff content>
The skill produces and maintains a directory at .plans/PROMPTS-<name>/ with this structure:
.plans/PROMPTS-<name>/
changelog.md — Version history with dates, authors, reasons, and scores
active-version.md — Pointer to the currently active version
v1.md — First version snapshot (full prompt + metadata)
v2.md — Second version snapshot
v3.md — Third version snapshot
...
Each version file is self-contained — it includes the full prompt text, model config, change summary, diff from previous, and eval scores. This means any version can be understood and restored without reading the entire history.
{{variable_name}}) so the static and dynamic portions are distinguishable/handoff-doc (the version history informs the Prompt Modification Guide) and /deploy-checklist (the checklist verifies prompt versions are tracked)