ShtukbaseStandard

Package and lock format

На этом сайте пакеты ставятся из его реестра: shtuk install <id> после install.sh. Команды ниже с адресом GitHub работают, только если есть доступ к репозиторию Shtukbase: он пока закрыт.

Этот текст ещё не переведён. Ниже английский оригинал.

A definition: how a package is written and how the tool records what is installed in a project.

The tool is shtuk (apps/shtuk/ of the Shtukbase repository). The main way to install is straight from git:

shtuk install https://github.com/Shtukbase/shtukbase.git#main:apps/standard/packages/basic --dir <project>

It can also be from a folder on disk: shtuk install <package-folder> --dir <project>. Then shtuk update, shtuk check, shtuk run <package> <action>.

Package

A package is a folder. In it are the file package.md and the folder pages/.

---
type: Package
id: core                 # a simple name: letters, digits, . _ -
version: 0.1.0
title: "Core"
icon: icon.svg            # the package's picture: an SVG inside the package folder
description: "One line: what the package gives."
requires: {norms-core: ^0.1.0}    # without what the package does not work
follows: [design/conventions/style]   # optional: the conventions it follows (a pointer, never a check)
includes:                          # what is installed together with it
  - {package: tasks, version: ^0.1.0}
actions:
  - name: levels                   # unique inside the package
    run: checks/levels.py          # a file inside the package
    check: true                    # a check: shtuk check runs it
    norm: /norms/rules/norms-core/NS-R01.md
    title: "One line"
  - name: setup
    run: bin/setup.ts
    on: install                    # a step after install: install and/or update (a string or a list)
---
  • pages/ is copied into the project root: pages/base/kernel.md goes to /base/kernel.md. The marks project, name and today in double curly braces are replaced with the folder name, the project's title and the day of first install.
  • Everything else, except pages/, seeds/ and project/, goes to .shtukbase/packages/<id>/. Actions are run from there; the working folder is the project root.
  • An action is run by its extension: .py — python3, .ts, .js, .mjs — bun, anything else — itself, if the file is executable.
  • An action with on runs by itself after the files are laid: on: install — at the package's first install, on: update — at a new version. Only for a package from a trusted source: the Shtukbase repository, the owner's list trusted.md next to its packages, the field trusted: in the project's /base/packages.md, the flag --trust <id> for one run. Otherwise the tool skips the action and writes the command shtuk run <id> <action>. A failed action is exit code 1, the files stay (norm CORE-R01).
  • icon is the package's icon: a path to an SVG inside the package folder, the file is installed with the package. The style is the same as for map pictures (patterns/pictures.md of the "Lenses" package): viewBox="0 0 96 96", the Notion palette, no outline and no text. If an icon is set but the file is missing or is not an SVG, the package is not read. If there is no icon, install writes a warning. Package cards on the map take the picture from the icon.
  • A version range: 0.1.0 — exactly it, ^0.1.0, ~1.2.3, >=0.1.0 <0.3.0, *.
  • follows lists conventions (pages type: Convention, see Conventions) that the package follows, as paths without the leading slash and .md. The tool only shows them in shtuk list and notes a page that is not in the project; nothing is refused.
  • Including a package of a new kind is always installed; if it is missing, install is an error.
  • The tool reads no other fields. Packages may read them: for example, the field hooks: is read by the package "Hooks" (Claude Code hooks as norm enforcers).

Lock

The lock is .shtukbase/packages.lock. The tool writes it; people do not need to edit it, except for the state removed.

lockVersion: 1
project: my-project
name: "My project"
packages:
  core:
    kind: package
    version: 0.1.0
    registry: /path/to/registry      # or source: a folder or a git address
    sha256: "…"                       # the hash of the package's file tree
    follows: [design/conventions/style]   # only when the package says so
    installed: 2026-11-28             # the day of first install
    scripts: {setup: 0}               # actions with on that ran last time: an exit code or skipped
    pages:
      base/kernel.md: {base: "…", state: clean}
  • base is the hash of the page as the package laid it. By it the tool knows whether the page was touched.
  • state is the page's state: clean (as the package laid it), edited (edited in the project), removed (deleted on purpose, do not bring back). shtuk list also shows missing — the page is gone and will be laid again.
  • A page stands in the pages of exactly one package: that is its owner.
  • Record keys that the tool does not know are kept as they were.

The rules by which the tool reads and writes a package and the lock are the norms CORE-R01 … CORE-R14 in /norms/rules/core/.

Страница собрана из apps/standard/packages/core/pages/base/package-format.md.Исходный текст