Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

requirements.cli.skill_conventions.workflow

Requirements index · View definition

evidence Valid

Requirement

Each bundled skill MUST open, before any other section, with its workflow as ordered steps. Each bundled skill, recognized by its front matter, is a site:
::{sites} skills
language: markdown
paths: [assets/skills]
rule:
  kind: minus_metadata
match:
  - "---\nname: example\n---\n\n# Example\n"
no_match:
  - "# Example\n"

:::

Rationale

Obligation. The requirement has one obligation: each bundled skill must open, before any other section, with its workflow as ordered steps. Each site upholds this on its own, so no implementing code is needed.

Site query skills. I ran requirements.cli.skill_conventions.workflow/skills. It matches the minus_metadata front matter of exactly five files:

  • assets/skills/habeas/SKILL.md
  • assets/skills/habeas-requirements/SKILL.md
  • assets/skills/habeas-evidence/SKILL.md
  • assets/skills/habeas-bootstrap-requirements/SKILL.md
  • assets/skills/habeas-refactor/SKILL.md

A search for --- lines under assets/skills found front matter only in those five files. The SKILLS constant in tests/authoring_cli.rs lists the same five skills. The query therefore misses no skill and selects nothing outside the requirement’s scope.

Query snippets. The match snippet is a document with front matter and a heading. The no_match snippet is the same heading without front matter. Together they show the condition “recognized by its front matter”.

Test. tests/authoring_cli.rs#fn[bundled_skills_open_with_their_workflow_as_ordered_steps] carries a {test} reference to the requirement. It runs over every skill in SKILLS and checks three things:

  • The first ## heading is ## Workflow, which covers “before any other section”.
  • The workflow has at least two numbered steps.
  • The step numbers are exactly 1..n, which covers “ordered steps”.

Inputs

Tests

Input 2: outline tests/authoring_cli.rs fn[bundled_skills_open_with_their_workflow_as_ordered_steps]
// {test}`requirements.cli.skill_conventions.workflow`
#[test]
fn bundled_skills_open_with_their_workflow_as_ordered_steps() {
    for name in SKILLS {
        let raw = skill_md(name);
        let first = raw.lines().find(|line| line.starts_with("## ")).unwrap();
        assert_eq!(first, "## Workflow", "{name}");
        let numbers = workflow_steps(name)
            .into_iter()
            .map(|(number, _)| number)
            .collect::<Vec<_>>();
        assert!(numbers.len() >= 2, "{name}: {numbers:?}");
        assert_eq!(
            numbers,
            (1..=numbers.len() as u32).collect::<Vec<_>>(),
            "{name}"
        );
    }
}

Other sources

Input 1: requirements selection requirements.cli.skill_conventions.workflow
::::{req} skill_conventions.workflow
Each bundled skill MUST open, before any other section, with its workflow as ordered steps. Each bundled skill, recognized by its front matter, is a site:

:::{sites} skills
```yaml
language: markdown
paths: [assets/skills]
rule:
  kind: minus_metadata
match:
  - "---\nname: example\n---\n\n# Example\n"
no_match:
  - "# Example\n"
```
:::
::::