@skhema/method
v0.3.0
Published
The complete public Skhema method: canonical vocabulary, element and component definitions, and structural validation
Maintainers
Readme
@skhema/method
The complete, public Skhema method as one installable artifact: the canonical vocabulary of strategic components and element types, the curated definitions that make each element buildable (slots, expected moods, examples, relationships), and a structural validator — with zero runtime dependencies. Validate your own strategy artifacts without the platform.
Install
npm i @skhema/methodRequires Node ≥ 18. ESM only.
The vocabulary
@skhema/method/vocabulary is the identity layer of the method: the 5
strategic components, the 19 element types, and the mapping between them. It is
the same vocabulary that renders in Skhema embeds and API payloads.
import {
COMPONENT_TYPES,
ELEMENT_TYPES,
SKHEMA_MAPPING,
getElementsForComponent,
isValidElementValue,
} from '@skhema/method/vocabulary'
ELEMENT_TYPES.KEY_CHALLENGE
// { value: 'key_challenge', label: 'Key Challenge', acronym: 'CHL' }
getElementsForComponent(COMPONENT_TYPES.DIAGNOSIS.value).map((e) => e.value)
// ['key_challenge', 'supporting_fact', 'impact']
isValidElementValue('experiment') // trueStability: additive-only
Within a major version, the vocabulary only grows. Existing component and element values, labels, and acronyms are never renamed or removed; new entries may be added in minor releases. You can persist vocabulary values in your own systems and trust them across upgrades.
The definitions
The package root adds the definitions layer — what each element is and what a well-formed one contains — and re-exports the vocabulary, so a full consumer needs one import.
import {
getElementDefinition,
getRequiredMethodSlots,
listElementRelationships,
validateMethodSpec,
} from '@skhema/method'
const challenge = getElementDefinition('key_challenge')
challenge?.expectedMood // 'indicative'
challenge?.examples[0] // a worked example of a well-formed key challenge
getRequiredMethodSlots('key_challenge').map((slot) => slot.id)
// the semantic slots a complete key challenge must fill
// Relationships describe how elements connect across a strategy.
listElementRelationships().find(
(r) => r.source === 'key_challenge' && r.target === 'solution'
)
// The spec validates itself — the same check runs in this package's CI.
validateMethodSpec() // [] when the shipped definitions are internally consistentSome historical element-type names are kept as aliases so older artifacts keep
resolving: associated_impact → impact, solution_alternative → solution.
getElementDefinition accepts either form.
Which package do I want?
| Package | Purpose |
| --------------------------- | --------------------------------------------------------------------------------------- |
| @skhema/method (this) | The method itself — vocabulary, definitions, validation. No network, no account needed. |
| @skhema/sdk | Typed client for the Skhema Public API (api.skhema.com/v1). |
| @skhema/cli | The same API as a terminal command (skhema), plus agent onboarding. |
| @skhema/embed | Render Skhema elements on your own site. |
License
MIT
