Foreign template engines would split validation and documentation across ecosystems.
Flow and algorithm
Platform spec article
Flow and algorithm
Spec standingStandard
-
Use beskid.template.v1 only
Context
Decision
The platform must use
beskid.template.v1only. Foreign engine schemas are forbidden in spec, CLI, and pckg.Consequences
Single parser and validator in tooling; template docs stay in-repo.
Verification anchors
CI grep excluding foreign schema identifiers under
compiler/and platform-spec tooling tree. -
Use {{symbolId}} delimiters in template text
Context
Template authors need delimiter syntax distinct from Beskid source.
Decision
Text files must use
{{symbolName}}placeholders; optionalsourceNamerewriting applies to paths and identifiers.Consequences
Editors can highlight unmatched braces; substitution tests stay deterministic.
Verification anchors
Golden substitution tests under planned
beskid_teststemplate fixtures. -
Validation runs on instantiation output only, not template project build.
Context
Requiring
beskid buildon template sources slows authoring and blocks non-host template layouts.Decision
Template packages need not compile at the template project root. Tooling must validate via instantiation output builds.
Consequences
Faster template iteration; CI runs instantiate-then-build on consumer output.
Verification anchors
beskid.templates.*CI pipeline; plannedbeskid_teststemplate fixtures. -
Implicit corelib
Context
Hosts need standard library.
Decision
Inject corelib; forbid noCorelib flags.
Consequences
Simpler manifests.
Verification anchors
E18xx linter.
-
Three template kinds
Context
Workspace, project, item flows.
Decision
Support all three via tags.type.
Consequences
One engine.
Verification anchors
Three beskid_tests fixtures.
-
Path and git sources
Context
Local workflows.
Decision
Resolve registry, path, and git.
Consequences
beskid new flags.
Verification anchors
Git/path integration tests.
-
No constraints
Context
DSL delay.
Decision
No constraint blocks in schema.
Consequences
Simpler v1.
Verification anchors
Reject constraints key.
-
Post-actions
Context
Extensibility.
Decision
Documented action ids, no v1 whitelist.
Consequences
Operator sandbox policy.
Verification anchors
Action registry docs.
-
Update on use
Context
Stale cache.
Decision
Compare cache on every use when online.
Consequences
Update prompts.
Verification anchors
Mock HTTP test.
-
Yanked warning
Context
Yank policy.
Decision
Warn on yanked; optional continue flag.
Consequences
Registry alignment.
Verification anchors
Yank API test.
- Contracts and edge cases Normative MUST/SHOULD rules for template instantiation, updates, yanked packages, and post-actions.
- Decisions record (legacy index) Migration index pointing to per-decision ADR files under adr/.
- Design model `beskid.template.v1` schema, symbols, sources, placeholders, GUIDs, and corelib policy.
- Examples Sample `beskid.template.v1` manifests and first-party `beskid.templates.*` packages.
- FAQ and troubleshooting Common questions about Beskid templates and `beskid new`.
- Flow and algorithm End-to-end lifecycle for install, update check, and instantiate.
- Verification and traceability Tests, CI, and registry checks for template conformance.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose and scope
Section titled “Purpose and scope”Normative ordering for beskid new install, beskid new list, and beskid new <shortName> (and equivalents).
Install (beskid new install)
Section titled “Install (beskid new install)”- Resolve source (registry id,
--path, or--git). - For registry: download
.bpkor extract template roots per template packages; verifypackageKind: template. - Locate
.beskid/template.json; parse and validatebeskid.template.v1. - Store snapshot in tooling cache keyed by
identity. - Register
shortName→ cache entry forbeskid new list.
List (beskid new list)
Section titled “List (beskid new list)”- Merge installed cache entries with optional registry search (when
--online). - Display:
shortName,name,tags.type, package id + version, yanked marker if applicable.
Instantiate (beskid new)
Section titled “Instantiate (beskid new)”sequenceDiagram participant User participant CLI as beskid new participant Cache participant Registry as pckg participant Engine as template engine participant FS as output filesystem User->>CLI: select template + output path CLI->>Cache: load snapshot alt registry template CLI->>Registry: query latest version Registry-->>CLI: version metadata CLI-->>User: warn if yanked or update available end CLI->>Engine: load template.json Engine->>User: interactive prompts optional CLI->>Engine: symbol values Engine->>FS: apply sources, placeholders, guids Engine->>CLI: postActions list CLI->>CLI: run postActions CLI->>CLI: ensure corelib via lock/fetch policyStep detail
Section titled “Step detail”- Resolve template — cache hit by
shortName, or one-shot path/git without install. - Update check — for registry-backed templates, query latest semver; if greater than cached, print:
A newer template version is available: <id>@<ver>. Run 'beskid new install <id>' to update. - Yanked check — if requested version is yanked, emit warning (see contracts).
- Load manifest —
beskid.template.v1. - Collect symbols — merge CLI flags, defaults, interactive prompts.
- Evaluate conditions — skip source blocks whose
conditionis false. - Process sources — copy, text-process, rename; apply
copyOnlywithout substitution. - Substitute —
{{ }},sourceName,forms. - Regenerate guids — per
guidsarray. - Post-actions — sequential; failures honor
--strict-post-actions. - Corelib — run default post-action
beskidLock(or equivalent) so corelib is materialized without user declaring opt-out.
Workspace templates
Section titled “Workspace templates”- Write
Workspace.projfirst (substituted). - For each member in
workspaceMemberssymbol or fixed layout insources, write memberProject.projand sources. - Post-action
beskidLockat workspace root must lock all members.
workspaceMembers is a choice or structured symbol when the template offers optional members; fixed layouts may omit the symbol.
Item templates
Section titled “Item templates”- Resolve host
Project.projroot. - Apply
sourceswithtargetrelative to chosen file path. - Must not run workspace-level lock unless
--lockpassed.
Git and path sources
Section titled “Git and path sources”| Source | Behavior |
|---|---|
--path | Read .beskid/template.json directly; no cache unless --install |
--git | Clone to cache subdirectory keyed by url+ref; optional sparse checkout for subpath |
Implementation anchors
Section titled “Implementation anchors”compiler/crates/beskid_cli/src/commands/new.rs(planned)compiler/crates/beskid_pckgregistry fetch (existing client)