Skip to main content

Apply versioned line patches to OpenSpec skills

Project description

openspec-patcher

osp applies versioned, line-based patches to OpenSpec skills without maintaining an OpenSpec fork.

osp install <patch.json>
osp [patch-id]
osp status
osp list
osp restore [patch-id] [-f]

Installed patches are stored per user. A patched project receives an openspec.patch manifest containing immutable skill baselines, active patch references, and rendered hashes.

Patch positions always refer to the original skill content. Every apply or restore rerenders all active patches from that baseline.

Patch Format

{
  "schemaVersion": 1,
  "id": "zh-cn-output",
  "name": "Simplified Chinese output",
  "operations": {
    "1.4.0-1.4.3,1.5.0": [
      {
        "content": "replacement text",
        "positions": [
          {
            "tool": "opencode",
            "skill": "openspec-apply-change",
            "startLine": 12,
            "endLine": 12
          }
        ]
      }
    ]
  }
}

Version selectors accept MAJOR.MINOR.PATCH and inclusive from-to ranges separated by commas. Different selector keys in one patch must not overlap. Every position is resolved through src/openspec_patcher/resources/paths.json; positions for unavailable tools are skipped.

Storage and Recovery

On Windows, installed patches are stored in %LOCALAPPDATA%\openspec-patcher\patches. Linux uses $XDG_DATA_HOME/openspec-patcher/patches (or ~/.local/share), and macOS uses ~/Library/Application Support/openspec-patcher/patches. Set OSP_DATA_DIR to override the location, which is useful for isolated testing.

The project-level openspec.patch stores only active patch IDs and SHA-256 values. The matching patch documents must remain available locally to rerender any patch that stays active. osp restore -f ignores changed current skill hashes and rebuilds from the saved original content; it can overwrite manual skill edits.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openspec_patcher-0.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openspec_patcher-0.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file openspec_patcher-0.1.0.tar.gz.

File metadata

  • Download URL: openspec_patcher-0.1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openspec_patcher-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f4f6860f6fc7b8287e11308c4978646dd5bf6e96ed1f8f44ba70254d50974ac4
MD5 c6e26a6b76f6884b86cf0a78a5ec41bd
BLAKE2b-256 2d2182bb59905bed9477b4557690bfa8d0819016473c2edb2bb6482ebf735644

See more details on using hashes here.

Provenance

The following attestation bundles were made for openspec_patcher-0.1.0.tar.gz:

Publisher: publish.yml on DarkskyX15/openspec-patcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openspec_patcher-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openspec_patcher-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7238b409544a2b30be41414b9192a90d9a3f9f74d2b186968c12cf3ca397c2c
MD5 5922cc0f202f51be45b44b6cbe92f9a6
BLAKE2b-256 cec5b2ed9e724f1d976c4f4677d1912a727160af7d0fec2429e60c15ba031824

See more details on using hashes here.

Provenance

The following attestation bundles were made for openspec_patcher-0.1.0-py3-none-any.whl:

Publisher: publish.yml on DarkskyX15/openspec-patcher

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page