
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@specd/core
Advanced tools
The domain library for [specd](https://github.com/specd-sdd/SpecD) — a spec-driven development platform. For more information, visit [getspecd.dev](https://getspecd.dev).
The domain library for specd — a spec-driven development platform. For more information, visit getspecd.dev.
pnpm add @specd/core
@specd/core requires Node.js 18 or later and is published as ESM.
| Concept | Description |
|---|---|
| Change | An in-progress spec change moving through a schema-defined lifecycle (e.g. drafting → designing → implementing ⇄ verifying → done). |
| Spec | A directory of artifact files that defines one capability (e.g. default:auth/oauth). |
| Schema | A YAML file that declares artifact types, workflow steps, hooks, validation rules, and extraction rules for a project. |
| Kernel | A fully-wired set of use cases constructed from a resolved SpecdConfig. The recommended way to consume the library. |
| Port | An abstract interface (repository, VCS adapter, hook runner, etc.) that the application layer depends on. Infrastructure adapters implement ports; callers receive port types. |
@specd/core is organized in three layers with a strict one-way dependency flow:
┌──────────────────────────────────────┐
│ domain/ │
│ Entities · Value objects · Errors │
│ No I/O. No external dependencies. │
└──────────────────┬───────────────────┘
│
┌──────────────────▼───────────────────┐
│ application/ │
│ Use cases · Ports (interfaces) │
│ Depends on domain only. │
└──────────────────┬───────────────────┘
│
┌──────────────────▼───────────────────┐
│ infrastructure/ │
│ Fs adapters · Git · Hooks │
│ Internal. Never imported directly. │
└──────────────────┬───────────────────┘
│
┌──────────────────▼───────────────────┐
│ composition/ │
│ createKernel · factory functions │
│ Exported. Returns abstract types. │
└──────────────────────────────────────┘
The infrastructure/ layer is intentionally not importable directly. All concrete adapters are created through the factory functions in composition/, keeping callers decoupled from storage and VCS implementation details.
The Kernel is the standard entry point. Load config with createConfigLoader, then pass it to createKernel:
import { createConfigLoader, createKernel } from '@specd/core'
const loader = createConfigLoader({ startDir: process.cwd() })
const config = await loader.load()
const kernel = await createKernel(config)
const schema = await kernel.schemas.resolve(config.schemaRef)
const change = await kernel.changes.create.execute({
name: 'add-oauth-login',
specIds: ['default:auth/oauth'],
schemaName: schema.name,
schemaVersion: schema.version,
})
await kernel.changes.transition.execute({
name: 'add-oauth-login',
to: 'implementing',
approvalsSpec: config.approvals.spec,
approvalsSignoff: config.approvals.signoff,
})
When you only need one or two use cases, the individual create* factory functions wire a single use case to the filesystem without constructing the full kernel:
import { createConfigLoader, createListChanges } from '@specd/core'
const loader = createConfigLoader({ startDir: process.cwd() })
const config = await loader.load()
const listChanges = createListChanges(config)
const changes = await listChanges.execute()
Everything exported from @specd/core is a domain type, an application type, or a composition factory. The public surface includes:
Change, Spec, ChangeArtifact, Delta, ArchivedChangeChangeRepository, SpecRepository, ArchiveRepository, SchemaRegistry, HookRunner, VcsAdapter, FileReader, ArtifactParser, and morekernel.changes.*, kernel.specs.*, kernel.project.*createKernel, createConfigLoader, createSchemaRegistry, createVcsAdapter, VCS adapter classesSpecdError and carry a typed code propertySee the full export reference in docs/core/overview.md.
| Document | Read when you need to… |
|---|---|
| docs/core/overview.md | Full export reference — every public type, port, use case, and factory |
| docs/core/domain-model.md | Understand the entities and value objects returned from use cases |
| docs/core/ports.md | Implement a custom repository, schema registry, or other port |
| docs/core/use-cases.md | Wire and call use cases from a delivery adapter |
| docs/core/errors.md | Handle errors in a delivery layer |
| docs/core/services.md | Use domain service functions such as hashFiles and buildSchema |
MIT
FAQs
The domain library for [specd](https://github.com/specd-sdd/SpecD) — a spec-driven development platform. For more information, visit [getspecd.dev](https://getspecd.dev).
The npm package @specd/core receives a total of 14 weekly downloads. As such, @specd/core popularity was classified as not popular.
We found that @specd/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.