okfreq CLI reference¶
okfreq creates and maintains the requirements subset. Commands accept either
a project root or a requirements-bundle root; bundle discovery finds
.agents/requirements/ or requirements/ where applicable.
okfreq COMMAND --help
Inspect and validate¶
Command |
Purpose |
|---|---|
|
Validate metadata, configuration, IDs, hierarchy, exemptions, derivation, supersession and |
`okfreq lint [PATH] [–prose] [–check-links] [–project-root DIR] [–check |
–diff]` |
|
Print the stable requirement ID index. |
|
Search IDs, titles, and descriptions. |
|
Print one requirement document. |
|
Print configured scope-to-source/test mappings as JSON. |
|
Show computed |
|
Scan configured source and test locations for markers. |
|
Print lifecycle counts and structural health. |
trace separates valid leaf coverage, unknown IDs, non-leaf markers, and scan
warnings. The same ID may be marked several times in one file, for example beside
distinct tests; the file is listed once. The duplicates key remains in the JSON
reports for compatibility and is always empty. Marker spellings and the ID regular
expression come from config.yml.
Every non-reserved Markdown document under tiers/ must have mapping
frontmatter and a non-empty string id. Missing or malformed documents fail
with their file path before indexing or reporting; they are never silently
omitted from requirement counts. Repair them rather than deleting them to
make validation pass. index.md, log.md, schemas and guidelines are excluded.
Check annotated file targets¶
okfreq init writes x-okf-link annotations into the generated requirement
schemas. The defaults include filename-stem links for requirement relationships,
project-relative links for generated source and test evidence, marker navigation
hints, requirement description hints for tooltips/previews, and line-number
hints for source/test markers. These presentation hints are advisory: okfreq
does not render the UI. Existing schemas are preserved and are not migrated.
Checking targets is deliberately opt-in:
okfreq validate . --check-links --project-root .
The --project-root option controls project-relative source and test paths.
Without it, the containing Git root of each requirement document is used. The
checker does not use the current working directory or an editor workspace as an
implicit root. Requirement relationships use case-sensitive Markdown filename
stems; source and test evidence uses exact project-relative paths. E10 reports
malformed annotations, missing exact files, root escapes, and ambiguous stems.
W15 reports a skipped check when a required root or filename-stem workspace is
unavailable. A missing stem in a known bundle is E10. Warnings do not make okfreq lint fail on their own.
Generated coverage and reports¶
Command |
Purpose |
|---|---|
`okfreq update-coverage [PATH] [–check |
–diff]` |
|
Generate a detailed JSON report and concise Markdown summary with SwRS source/test-link coverage, configured StRS test coverage, and combined leaf traceability coverage. StRS source coverage is not applicable. Each requirement record also lists |
Without output options, the command writes JSON, JSON Schema and Markdown
under the resolved bundle’s parent directory in dist/ and prints their paths.
Use explicit output paths when reports must live in the project root’s dist/.
Generated artifacts should be regenerated rather than edited manually.
Lifecycle changes¶
Command |
Purpose |
|---|---|
|
Set the target lifecycle to |
|
Set the target to |
Lifecycle mutations require explicit --yes. They preserve the requirement
body, stable ID, UUID, and unrelated frontmatter. Like okfreq new, they also
write the generated OKF status mapped from the new lifecycle and refresh the
generated Links section at the end of the body.
Retire a draft¶
Command |
Purpose |
|---|---|
|
Delete a never-published draft, add its ID to |
Use retire for a draft that was never published, for example one merged into
another requirement. A published requirement is archived or superseded instead,
because other documents, commits and reviews may cite it.
retire changes nothing and exits non-zero when --yes is absent, the ID is
unknown, the requirement is not a draft, another requirement lists it in
derives_from, depends_on or relates_to or in superseded_by, or a configured source or
test marker still names it. The error says which. After a successful retirement,
run okfreq update-coverage and okfreq lint to refresh generated fields and
indexes of the parents that lost a child.
okfreq new allocates one more than the highest number ever used for the tier
prefix and scope, counting existing requirements and retired IDs, so the retired
number, and any number freed by a deletion below the highest, is never handed out
again:
$ okfreq new swrs "Palette search" … --scope palette # SwRS-…-PALETTE-140
$ okfreq retire SwRS-…-PALETTE-140 --reason "Merged into 139" --yes
Retired SwRS-…-PALETTE-140; its number will not be reused
$ okfreq new swrs "Palette filters" … --scope palette # SwRS-…-PALETTE-141
Deleting a file by hand records nothing: a number freed below the highest is
still skipped, but the highest one would be allocated again. Use retire.
okfreq validate reports an error for a requirement whose ID is in retired_ids.
See also¶
Configuration — hierarchy, scopes, markers, and generated fields.
Frontmatter — authored and generated field ownership.
Requirements traceability tutorial — end-to-end workflow.
Coverage boundaries — why test execution and pass/fail results are not parsed yet.