Lockfile (skills.lock)
Theskills.lock file ensures reproducible installs by pinning exact versions and integrity hashes of all installed skills. It’s automatically generated by tank install and should be committed to version control.
Purpose
Lockfiles solve three critical problems:- Reproducibility — The same
skills.lockalways installs the exact same versions - Security — SHA-512 hashes verify package integrity and prevent tampering
- Performance — Resolved versions are cached, speeding up subsequent installs
Always commit
skills.lock to version control. This ensures everyone on your team and your CI/CD pipeline install identical dependencies.Schema
The lockfile is validated using Zod. Here’s the schema frompackages/shared/src/schemas/skills-lock.ts:
Structure
lockfileVersion
Type:1 (literal)
Lockfile format version. Currently, only version 1 is supported. This field allows for future breaking changes to the lockfile format.
skills
Type:Record<string, LockedSkill>
A map from skill name (with version) to locked metadata.
Key format: {name}@{version} (e.g., @tank/[email protected])
Value (LockedSkill):
resolved— Tarball download URLintegrity— SHA-512 hash of the tarball (Base64-encoded)permissions— Declared permissions (copied from skills.json)audit_score— Security audit score (0-10, or null if not scanned)
Example
SHA-512 Integrity Verification
Tank uses SHA-512 (via Subresource Integrity format) to verify package integrity:Format
Verification Process
When you runtank install:
- Download tarball from
resolvedURL - Compute SHA-512 hash of downloaded file
- Compare computed hash with
integrityfield - Reject if hashes don’t match (tampering detected)
- Extract only if verification passes
Lockfile Generation
The lockfile is automatically created or updated by:tank install
Installs dependencies from skills.json and generates/updates skills.lock:
tank add <skill>
Adds a new dependency and updates the lockfile:
tank remove <skill>
Removes a dependency and updates the lockfile:
Reproducible Installs
Lockfiles guarantee that everyone gets the same dependencies:Without Lockfile
- Developer A runs
tank installon Monday → gets2.1.0 - Developer B runs
tank installon Friday → gets2.2.0(new release)
With Lockfile
2.1.0 because the lockfile pins the exact version.
Updating Dependencies
To update dependencies while respecting semver ranges:Update All Dependencies
Update Specific Skill
Force Latest Version
FAQ: Should I commit skills.lock to version control?
FAQ: Should I commit skills.lock to version control?
Yes, always commit
skills.lock to Git. This ensures:- Reproducible installs across your team
- Reproducible CI/CD builds
- Security auditing — you can verify what was actually installed
- Rollback capability — if a dependency causes issues, you can revert the lockfile
Lockfile Conflicts
When merging branches, lockfile conflicts can occur:Resolving Conflicts
- Don’t manually edit — Let Tank regenerate it
- Merge skills.json first — Resolve conflicts in the manifest
- Regenerate lockfile:
- Commit the regenerated lockfile
Automatic Conflict Resolution
Some Git tools can auto-resolve lockfile conflicts:Audit Scores in Lockfile
Theaudit_score field tracks the security score of each locked skill:
- 10: Perfect — no findings
- 8-9: Excellent — minor notes
- 6-7: Good — some medium findings
- <6: Concerning — high or critical findings
Permissions Snapshot
The lockfile stores a snapshot of permissions declared in each skill’s manifest:- Audit trail — You can see what permissions were declared at install time
- Diff detection — Compare lockfile to detect permission changes in updates
- Offline validation — No need to fetch manifest to check permissions
If a skill updates its permissions in a new version,
tank update will show a diff and prompt for confirmation before updating the lockfile.Lockfile Version History
Tank currently useslockfileVersion: 1. Future versions may introduce breaking changes:
| Version | Status | Changes |
|---|---|---|
1 | Current | Initial format with SHA-512, permissions, audit scores |
2 | Planned | TBD (may add dependency tree, CVE data, etc.) |
Next Steps
- Permissions — Understand permission declarations
- Security Scanning — How audit scores are computed
- Manifest — Learn about skills.json structure