454 lines
16 KiB
Markdown
454 lines
16 KiB
Markdown
---
|
|
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 distinguish Git-managed repos from ZIP/manual-download folders.
|
|
- It will use Git update commands only when the local folder is a Git repo and the host has permission.
|
|
- It will instruct non-Git users to download the latest repo ZIP or specific updated files, then help compare and merge those files when available.
|
|
- 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.
|
|
- Optional downloaded latest repo ZIP or extracted latest repo folder for non-Git manual comparison and merge.
|
|
|
|
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.
|
|
- A downloaded latest repo ZIP or extracted latest repo folder for non-Git manual comparison and merge.
|
|
|
|
If Git or network access is unavailable, report that freshness could not be fully verified and continue using the local version. If the folder is not a Git repo, do not attempt Git updates; give the user manual download-and-merge instructions.
|
|
|
|
## 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.
|
|
- Non-Git users receive clear download-and-merge instructions instead of unsafe automatic overwrite behavior.
|
|
|
|
## 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`.
|
|
- Manual files: for non-Git users, compare the current folder to a user-downloaded latest repo folder or ZIP extraction before copying maintainer-owned files.
|
|
- 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. Detect whether the folder is Git-managed by checking for `.git` or successful Git metadata commands.
|
|
6. Optionally inspect local Git tags.
|
|
7. 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. State whether the current folder appears to be Git-managed or manually downloaded/copied.
|
|
5. For Git-managed folders, ask whether to apply the update now or continue with the current version.
|
|
6. For non-Git folders, explain that the agent cannot safely pull updates automatically. Tell the user to download the latest repo ZIP or specific updated files, then ask the agent to compare and merge them.
|
|
|
|
Stop here unless the user explicitly approves updating.
|
|
|
|
### Phase 5: Apply Approved Update
|
|
|
|
If the user approves:
|
|
|
|
1. If the repo is Git-managed:
|
|
- Confirm the worktree status before updating.
|
|
- Warn if there are uncommitted local changes that may conflict.
|
|
- Prefer normal Git update mechanisms such as fetch, pull, and tag fetch.
|
|
- Preserve user-owned files from `pid-release.json`.
|
|
- Re-read `VERSION`, `pid-release.json`, and relevant skill files after updating.
|
|
- Report success or any files that need manual review.
|
|
2. If the folder is not Git-managed:
|
|
- Do not run Git update commands.
|
|
- Ask the user to download the latest repo ZIP or specific updated files from the release source.
|
|
- Ask the user for the path to the extracted latest repo folder or downloaded files.
|
|
- Compare maintainer-owned files from the downloaded latest copy against the local folder.
|
|
- Copy or merge only maintainer-owned files after user approval.
|
|
- Do not overwrite user-owned files unless the user explicitly asks to reset them.
|
|
- Re-read `VERSION`, `pid-release.json`, and relevant skill files after the manual merge.
|
|
- Report files changed, files skipped, and any manual review needed.
|
|
|
|
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.
|
|
- [ ] Repo type is recorded as Git-managed, non-Git/manual, or unknown.
|
|
- [ ] Remote/latest version source is recorded, or unavailable status is recorded.
|
|
- [ ] Update status is classified.
|
|
- [ ] User approval was requested before any update was applied.
|
|
- [ ] Non-Git users were given download-and-merge instructions instead of Git commands.
|
|
- [ ] 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.
|
|
- Git-managed vs non-Git/manual folder status is classified.
|
|
- 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.
|
|
- For non-Git users, confirm the downloaded latest repo folder or files before merging.
|
|
- 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
|
|
- repo type: Git-managed, non-Git/manual, or unknown
|
|
- remote access available or unavailable
|
|
- downloaded latest files available or unavailable for manual update
|
|
- 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 has no Git installed
|
|
- user downloaded the latest ZIP but has not extracted it
|
|
- user points to a downloaded folder from the wrong repo or wrong version
|
|
- manual downloaded files omit `pid-release.json`
|
|
- 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
|
|
- run Git update commands in a non-Git folder
|
|
- tell non-Git users that updates were applied when the user has not downloaded the latest files
|
|
- copy files from a downloaded ZIP over user-owned files
|
|
- 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:
|
|
- Repo type: Git-managed / non-Git manual folder / unknown
|
|
- Manual latest files path:
|
|
|
|
## 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:
|
|
- Manual files copied or merged:
|
|
- User-owned files preserved:
|
|
- 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 the update path was Git-managed or manual download/merge
|
|
- 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, branch between Git-managed updates and manual download/merge instructions, ask before updating, preserve user-owned files, and record the result so future agents know what happened.
|