This commit is contained in:
eddiesoehnel committed 2026-06-20 08:13:36 -06:00
1 parent ebe51a5ea3
commit 0e19967e40
11 files changed
+739 -26

No files matched your search

+415
View File
@@ -0,0 +1,415 @@
---
name: pid-version-checker
description: Check whether a local Portable Identity Document template repo, PID template, and PID skills are current; compare local release metadata against Git tags or a remote manifest when available; summarize available updates; preserve user-owned files; and ask for approval before applying updates.
---
# PID Version Checker Skill
## Compatibility Notes
- Version: 0.2.0
- Status: draft
- Intended hosts:
- Codex Desktop
- Claude Desktop
- ChatGPT with file/context access
- other local or cloud AI agent apps that can read files and optionally use Git or network access
## Purpose
Help a user keep the Portable Identity Document template repo, skills, and process documents current without silently overwriting user-owned configuration or PID content.
This skill is a freshness preflight for the other PID skills. It checks the local repo version, compares it to the latest available version when possible, explains what changed, asks the user whether to update, and records what happened.
## Contract
This skill guarantees:
- It will identify the local PID repo version from `VERSION`, `pid-release.json`, Git tags, or file timestamps when version files are missing.
- It will check for newer versions using local Git metadata first, then remote Git tags or a remote manifest only when the host has access and the user permits the check.
- It will summarize the local version, latest known version, and relevant changelog entries.
- It will ask for explicit user approval before applying updates.
- It will preserve user-owned files, especially `skills/PID-update-maintenance-skill-user-variables.md`, review drafts, receipts, and personal PID files.
- It will continue the calling workflow when remote freshness cannot be verified, unless the user explicitly asks to stop.
- It will create or update a durable receipt for serious update checks or any applied update.
## Inputs
The skill expects:
- A local PID template repo path.
- Optional remote URL or Git remote.
- Optional user preference about whether to check remote versions.
- Optional user preference about whether to apply updates now or only report status.
Default local repo files:
- `VERSION`
- `pid-release.json`
- `CHANGELOG.md`
- `skills/PID-version-checker-skill.md`
## Outputs
This skill produces:
- A freshness status report.
- If updates are available, a concise update proposal.
- If the user approves updating, an update result report.
- `skills-receipts/PID-version-check-run-receipt-[YYYY-MM-DD].md` for serious checks or update runs.
## Skill Shape
`service`
This is one bounded workflow with clear inputs and outputs. It may be used as a preflight by other PID skills.
## Requires
This skill requires:
- Ability to read the local PID repo files.
- Ability to ask the user before applying updates.
- Ability to write a receipt when file writing is available.
Optional:
- Git CLI access for tags, remotes, fetch, pull, and status.
- Network access for remote version checks.
If Git or network access is unavailable, report that freshness could not be fully verified and continue using the local version.
## Ensures
Before finishing, this skill ensures:
- Local version status is reported.
- Remote/latest version status is reported when available.
- Available update details are summarized before any update.
- User-owned files are not overwritten without explicit user request.
- Update status is recorded in the calling skill receipt when this skill is used as a preflight.
- A standalone update-check receipt is created for serious checks or any applied update.
## Capabilities
Required host capabilities:
- CLI tools: optional but useful for Git version checks.
- MCP/connectors: optional.
- Browser access: optional; use only if the user wants to inspect a web release page.
- Filesystem access: required for local version checks and receipts.
- Network access: optional for remote checks.
- Subagent support: not required.
- Image/document/spreadsheet support: not required.
If remote capabilities are unavailable, do not fake the result. Say that only local version status was verified.
## State Scope
`project`
Persistent writes:
- `skills-receipts/PID-version-check-run-receipt-[YYYY-MM-DD].md`
Do not write cross-project or long-term user memory.
## Host Primitive Adapter
Map abstract workflow needs to available host actions:
- Ask user: ask before remote checks if required by host policy, and always before applying updates.
- Read/write files: read version files, changelog, and manifest; write receipts.
- Run shell command: optionally run Git commands such as `git status`, `git tag --list`, `git fetch --tags`, `git describe`, and `git pull`.
- Use connector: not normally required.
- Use browser: optional for public release pages.
- Create durable report: write the update-check receipt when possible.
If the host cannot provide a required primitive, narrow the workflow and record the limitation.
## Workflow
### Phase 1: Locate Repo And Local Version
1. Confirm the local PID repo path.
2. Read `VERSION` if present.
3. Read `pid-release.json` if present.
4. Read the top of `CHANGELOG.md` if present.
5. Optionally inspect local Git tags.
6. Determine the best local version value.
Completion criteria:
- Local version is known, or the missing metadata is reported.
### Phase 2: Check Latest Available Version
Use the safest available method:
1. If the repo has local Git tags, identify the highest SemVer tag.
2. If remote Git access is available and approved, fetch tags or inspect the remote.
3. If a remote manifest is available and approved, compare `repo_version`.
4. If no remote check is possible, mark latest version as unknown.
Completion criteria:
- Latest known version is known, or the inability to check is clearly recorded.
### Phase 3: Compare Versions
1. Compare local version to latest known version.
2. Classify status:
- `current`
- `update_available`
- `ahead_of_remote`
- `unknown_remote`
- `missing_local_metadata`
3. If an update is available, read changelog entries between local and latest when available.
Completion criteria:
- User gets a clear status and next action.
### Phase 4: Propose Update
If update is available:
1. Summarize what changed.
2. List likely files to update.
3. List user-owned files that will be preserved.
4. Ask whether to apply the update now or continue with the current version.
Stop here unless the user explicitly approves updating.
### Phase 5: Apply Approved Update
If the user approves:
1. Confirm the worktree status before updating.
2. Warn if there are uncommitted local changes that may conflict.
3. Prefer normal Git update mechanisms when the repo is Git-managed.
4. Preserve user-owned files from `pid-release.json`.
5. Re-read `VERSION`, `pid-release.json`, and relevant skill files after updating.
6. Report success or any files that need manual review.
Do not use destructive Git commands such as reset, checkout, clean, or force overwrite unless the user explicitly requests them.
### Phase 6: Receipt
Write `skills-receipts/PID-version-check-run-receipt-[YYYY-MM-DD].md` when:
- the user asked specifically to check or update versions
- an update was available
- an update was applied
- remote checking failed in a way future agents should know about
- the calling skill is doing a serious PID creation or maintenance workflow
## Validation
Before finishing, verify:
- [ ] Local version source is recorded.
- [ ] Remote/latest version source is recorded, or unavailable status is recorded.
- [ ] Update status is classified.
- [ ] User approval was requested before any update was applied.
- [ ] User-owned files were preserved.
- [ ] Receipt was written when required, or inability to write it was reported.
## Validation Tiers
### Tier 1: Fast Deterministic Checks
Run every time:
- `VERSION` and `pid-release.json` agree when both exist.
- Manifest JSON parses when available.
- The changelog contains the current version when available.
- User-owned files are listed before any update proposal.
### Tier 2: Realistic Workflow Review
Run before applying updates:
- Check Git worktree status.
- Confirm update source.
- Re-read version metadata after update.
- Confirm user-owned files still exist.
### Tier 3: LLM-As-Judge Or Reviewer Panel
Use only when changelog interpretation is subjective:
- whether release notes imply breaking changes
- whether the user should update now or continue current work first
## Test Surface
This skill can be tested through:
- Static checks: required sections exist; no unresolved placeholders; frontmatter has only `name` and `description`.
- Schema checks: `pid-release.json` parses as JSON and contains required keys.
- Invariant checks: no update without user approval; user-owned files preserved.
- Fixture tests: missing `VERSION`; missing manifest; local version older than remote; remote unavailable.
- Behavioral tests: agent asks before update; agent records skipped remote checks.
- Freshness checks: skill version matches `pid-release.json`.
## Coverage And Edge-Case Audit
Before finishing a serious update check, map:
- local metadata files found or missing
- Git metadata found or missing
- remote access available or unavailable
- user-owned files detected
- update status
- receipt status
- risks requiring manual review
Mark gaps as:
- `[MANUAL]` user decision required
- `[SOURCE]` version source missing
- `[CONNECTOR]` remote check unavailable
- `[PRIVACY]` user-owned or sensitive file at risk
- `[FUTURE]` good candidate for improved release tooling
## Edge Cases
Actively handle:
- repo has no tags
- repo has uncommitted local changes
- `VERSION` and `pid-release.json` disagree
- changelog is missing current version
- remote fetch fails
- network access is unavailable
- local repo is ahead of remote
- user variables file contains private paths
- user downloaded a ZIP and is not in a Git repo
- user wants to continue current skill without updating
## Regression Rule
If this skill discovers that update checking previously worked and now breaks, create a regression artifact immediately.
Acceptable regression artifacts:
- updated validation checklist item
- manifest schema rule
- anti-pattern
- edge-case note
- release-process note
- STOP gate before applying updates
## Ratchet Rules
When this skill discovers a recurring versioning mistake, ambiguous update path, failed validation, or risky overwrite case, convert the lesson into at least one durable artifact:
- update this skill
- update `pid-release.json`
- update README release instructions
- update changelog format
- add a manifest field
- add an anti-pattern
- add a validation item
Do not merely fix the current update.
## Anti-Patterns
Do not:
- update files before the user approves
- overwrite user variables or personal PID files
- pretend remote status is known when remote access failed
- treat informal changelog notes as the only source of version truth
- use destructive Git commands without explicit user request
- ignore uncommitted local changes
- block a PID workflow only because remote freshness could not be checked
- bury available updates without telling the user
## Run Receipt
Use this Markdown structure when writing `PID-version-check-run-receipt-[YYYY-MM-DD].md`:
```md
# PID Version Check Run Receipt
## Skill Run
- Skill name:
- Skill source/path:
- Skill version:
- Run date:
- Executor/host:
- User request:
## Repo
- Local repo path:
- Remote:
## Local Version
- VERSION:
- Manifest version:
- Git tags:
- Changelog version:
## Latest Known Version
- Source:
- Version:
- Remote check status:
## Comparison Result
- Status:
- Update available:
## User-Owned Files To Preserve
## User Decision
- Update approved:
- Continue with current version:
## External State Changed
- Files modified:
- Git commands run:
- Nothing changed without explicit approval:
## Validation Results
## Failures Or Gaps Found
## Ratchet Lessons
## Resume / Audit Notes
## Recommended Next Steps
```
## Receipt Vs Final Report
The final report is for the user.
The run receipt is for future agents, auditors, and maintainers.
Do not rely on the final response as the only record when update status was checked, remote checks failed, files were updated, or a user decision was made.
## Final Report
When finished, report concisely:
- local version
- latest known version
- whether update is available
- whether update was applied or declined
- whether user-owned files were preserved
- where the receipt was written, or why it was not written
## One-Sentence Version
Check local PID template and skill versions, compare them to the latest available release when possible, ask before updating, preserve user-owned files, and record the result so future agents know what happened.