@osdlc/corpus-sdlc-starter
v0.1.0
Published
A starter knowledge base for an sdlc planning corpus: shared principles as corpus-schema records, typed by @osdlc/corpus-profile-sdlc. A repo names it under references in its corpus's root file and cites its records by id.
Maintainers
Readme
@osdlc/corpus-sdlc-starter
The sdlc starter is a small knowledge base that a work repo references and cites. It holds shared
records, for now two draft principles, as a corpus-schema corpus. Its types come from the
sdlc profile, @osdlc/corpus-profile-sdlc, which it names under extends
and takes through uses: [sdlc/*].
| Record | Title | | ------------------------------------------------------------- | ------------------------------------------------------------------- | | P-0001 | Normalize equivalent inputs at the boundary, and reject invalid ones | | P-0002 | Favor deterministic over probabilistic judgement |
Both are open/draft and marked need_human_review: true.
Reference it from a repo
Install the starter and the profile in the folder that holds your corpus, or in any folder above it. The profile is a peer dependency of the starter, so your project holds one version of it:
pnpm add -D @osdlc/corpus-sdlc-starter @osdlc/corpus-profile-sdlcName both in your corpus's root file. The profile gives your corpus its types, under extends. The
starter gives it records to cite, under references. extends and uses need level 2:
---
corpus-schema: 0
level: 2
extends:
sdlc: "@osdlc/corpus-profile-sdlc"
references:
osdlc: "@osdlc/corpus-sdlc-starter"
uses: [sdlc/*]
---Your principles/ folder needs no schema file: uses gives it the profile's type, which the
starter's principles have too.
Cite a starter principle by id, as a quoted wikilink: related: ["[[P-0002]]"]. The validator
finds it among the starter's records. A wikilink to a referenced corpus's record is a link into its
copy, so write the copy and commit it:
npx @osdlc/corpus-schema sync docs/planning
npx @osdlc/corpus-schema validate --strict docs/planningsync writes _references/osdlc/ beside your root file. The profile gets no copy, since it gives
types only. Run sync again after you update the starter. A record of yours may share an id with a
starter record, but a reference by id that matches both is an error, so keep your ids apart.
packages/profiles/sdlc/tests/downstream/ is a corpus set up this way.
Add a principle
- Take the next free id:
P-0003. - Write
corpus/principles/P-0003.md. Copy the frontmatter of P-0002, and setid,titleandcreated. Keepstate: open/draftandneed_human_review: trueuntil it is reviewed. - Give it exactly one category tag:
principle/product,principle/technical,principle/projectorprinciple/llm-ai. - Write the body:
## Statement,## Whyand## How it applies. The profile does not check body sections yet. - Check it, from the repository root:
sh tools/build-corpus-schema.shandpnpm install --frozen-lockfile, thensh packages/profiles/sdlc/tests/package.shandsh tools/leak-check.sh. - Add a changeset for
@osdlc/corpus-sdlc-starter.
The starter names each record by its id alone, P-0003.md. A name with a slug, such as
P-0003-a-slug.md, works too: corpus-schema cuts the id out of the file name.
