Skip to main content

Module skill

Module skill 

Source
Expand description

Skills as proven capabilities: what the repository can show about each skill, derived.

A skill is data: SKILL.md under the layer’s skills section, discovered by the source class skill and validated against its schema by the index (ADR 0007). That makes a skill exist. It says nothing about whether the procedure is exercised by anything, reached by anything, published anywhere or held by any gate — and a catalogue whose entries are merely present is the hand-maintained registry this repository refuses, one level up.

So four facts are derived here, per skill, on every read, and none is authored:

  • tested — a behavioural case or crate test names the skill with the marker majordomus-skill: <id> on a comment line, and the evidence ledger holds a run of that test. The run is judged by the same judgement a rule’s named test gets, so a test cannot be current for a rule and stale for a skill;
  • documented — the site’s page projection for the skill is a tracked file;
  • enforced — a dispatched rule validates skills (its validator is skills) and a CI gate whose command runs the skills verification is selected by a change to the skill;
  • used — an invocation surface (a workflow, a prompt, a profile, a provider template, a recipe, a CI workflow, a root bootstrap) references the skill by its URI majordomus://skill/<id> or by the path of its SKILL.md.

An active skill that no test names, or that nothing invokes, is an orphan: a failure. A test that names a skill that does not exist, and an invocation that references one, are failures too — a binding to nothing reads as proof. Evidence that is not current, a missing page and a missing gate are warnings: each is a debt with a command that settles it, and none of them can be settled by the author of the skill alone. A draft or deprecated skill owes nothing.

use majordomus_cli::evidence::Ledger;
use majordomus_cli::skill::Skills;
use majordomus_cli::synthetic::SyntheticRepository;

let repo = SyntheticRepository::small().unwrap();
let index = repo.index().unwrap();
let skills = Skills::build(&index, &Ledger::empty());
// every skill the index holds is answered, and a repository with none owes nothing
assert_eq!(
    skills.skills.len(),
    index.objects.iter().filter(|o| o.kind == "skill").count()
);
assert_eq!(skills.failures() + skills.warnings(), skills.findings.len());

Structs§

SkillDocumented
The documented fact: the page the site projects for the skill.
SkillEnforced
The enforced fact: the doctrine that validates skills and the gates a change to this one selects.
SkillFinding
One thing the derivation found wrong, with the command that settles or reproduces it.
SkillInvocation
One place a skill is invoked from.
SkillProvenance
Where a skill came from, when it was not written here first: an opaque marker into a ledger kept outside the repository. The committed half names no source; the ledger entry it points at does, locally.
SkillStatus
One skill with everything derived about it.
SkillTest
One test that names a skill, and what the ledger says about it.
SkillTested
The tested fact: the tests that name the skill, and their weakest state.
SkillUsed
The used fact: every invocation surface that references the skill.
Skills
Every skill of a repository, derived, and every finding.

Enums§

SkillEvidence
What the evidence ledger can say about a skill’s tests, as a whole: the weakest state of the tests that name it, or untested when none does.
SkillFindingLevel
How bad a finding is: a failure refuses, a warning is reported.
SkillStanding
Where a skill stands, derived from the four facts.

Constants§

SKILL
The kind of a skill in the index.
SKILLS_VALIDATOR
The validator a dispatched rule names when it is the doctrine that validates skills.
SKILLS_VERIFY_COMMAND
The words a gate’s command carries when it runs the skills verification. A gate is read by what it runs, never by its id, so a gate renamed in the CI model is renamed here.
SKILL_PAGES_DIR
Where the site’s page for a skill is projected, repository-relative: <dir>/<id>.md.
SKILL_URI_PREFIX
The URI prefix an invocation references a skill by.
TEST_MARKER
The marker a test carries, on a comment line, to name the skills it exercises: # majordomus-skill: implement repo-review in a case, //! majordomus-skill: implement in a crate test.

Functions§

invocation_surfaces
The patterns of every invocation surface: the layer’s workflows, prompts, profiles and provider templates (read from the manifest’s sections, beside the skills section), and the recipes, CI workflows and root bootstraps.
marker_ids
The skill ids a marker line names, when the line is a comment carrying the marker.
references_in
The skill references one line makes: majordomus://skill/<id>, and <skills dir>/<id>/SKILL.md.