Skip to content

Requirements (Speclink)

Speclink makes the requirements of your application browsable at runtime. Requirements are written as Go files with spec.Declare from github.com/worldiety/speclink/spec and compiled into the binary; only the requirement packages which are linked appear. Administrators browse them in the admin center, and the AI assistant can read them through tools.

Requirements

Enable

import cfgspeclink "go.wdy.de/nago/application/speclink/cfg"

spec := std.Must(cfgspeclink.Enable(cfg)) // cfgspeclink.Management

The optional cfgspeclink.Options{SourceDocuments: fsys} adds the documents the requirements were derived from, usually an embed.FS. cfgspeclink.Management has the fields UseCases speclink.UseCases and Pages uispeclink.Pages with the path Requirements. Speclink declares the system role Requirements Reader.

Use with the AI assistant

aispeclink.Tools(spec.UseCases) from go.wdy.de/nago/application/speclink/ai returns tools to list and read requirements, capabilities and source documents; aispeclink.Index(subject, spec.UseCases) returns an index for the system prompt.

Use cases

Use caseDescription
FindAllRequirementsLists the requirements, filtered and limited by their disclosure level.
FindRequirementByIDLoads a requirement.
FindAllCapabilitiesLists what the binary can do, derived from the bindings to the requirements.
FindSourceDocumentLoads a source document.

Permissions

PermissionAllows to
nago.speclink.requirement.find_alllist requirements
nago.speclink.requirement.find_by_idread a requirement
nago.speclink.capability.find_alllist capabilities
nago.speclink.source.find_by_idread source documents
nago.speclink.requirement.read_internalread internal, not only public, requirements

The system role nago.speclink.reader contains the four find permissions, but not read_internal.

UI

admin/speclink/requirements lists the requirements. The admin center shows the card Requirements in the group Specification.

Related