Naming Conventions¶
Overview¶
ubFlow uses descriptive, human-readable IDs for all specification elements.
Unlike traditional sequential numbering (e.g., REQ_001), descriptive IDs are
self-documenting, grep-friendly, and eliminate the “insert pain” of numbered sequences.
Why Descriptive IDs?¶
Aspect |
Sequential ( |
Descriptive ( |
|---|---|---|
Self-documenting |
No — must look it up |
Yes — readable inline |
Insert new items |
Renumber or use gaps |
Just pick a name |
Grep-friendly |
Not really |
|
Link readability |
|
|
Ordering bias |
Implies priority/sequence |
No false hierarchy |
Duplicate safety |
Manual tracking |
sphinx-needs catches at build time |
The only trade-off is length, but with short slugs (2–4 words) this is very manageable.
ID Format¶
<TYPE>_<THEME>_<SHORT_SLUG>
TYPE: The specification level prefix (
NEED,REQ,SPEC)THEME: Abbreviated domain/component identifier (2–5 chars)
SHORT_SLUG: Descriptive name in 2–4 words, UPPERCASE, underscores
Note: Although need types are now need, swreq, and swdesign (ASPICE aligned),
ID prefixes are NEED_, REQ_, and SPEC_ for clarity and consistency.
Theme Abbreviations¶
Abbreviation |
Full Name |
Used at Levels |
|---|---|---|
|
Core Methodology |
NEED (need), REQ (swreq) |
|
Workflows |
NEED (need), REQ (swreq) |
|
Change Management |
NEED (need), REQ (swreq) |
|
Traceability & Quality |
NEED (need), REQ (swreq) |
|
Installation & Setup |
NEED (need), REQ (swreq) |
|
Developer Experience |
NEED (need), REQ (swreq) |
|
Release |
NEED (need), REQ (swreq) |
Level 2 (Software Detailed Design) uses component-based themes instead of domain themes:
Abbreviation |
Full Name |
Level |
|---|---|---|
|
Agent Architecture |
SPEC (swdesign) |
|
Documentation Structure |
SPEC (swdesign) |
|
Installation Scripts |
SPEC |
|
Release Process |
SPEC |
Examples by Level¶
Level 0 — Stakeholder Needs¶
NEED_CORE_SPEC_AS_CODE # Core: manage specs as code
NEED_CHG_ANALYZE # Change Mgmt: analyze changes
NEED_INST_BOOTSTRAP # Installation: environment bootstrap
NEED_REL_CREATE # Release: create a release
NEED_DX_PROJECT_MEMORY # Dev Experience: maintain project memory
Level 1 — Software Requirements¶
REQ_CORE_SPHINX_NEEDS # Core: requirements management with sphinx-needs
REQ_CHG_ANALYSIS_AGENT # Change Mgmt: change analysis agent
REQ_INST_AUTO_SETUP # Installation: automatic environment setup
REQ_REL_SEMVER # Release: semantic versioning
REQ_TRACE_MECE # Traceability: MECE review
Note: Uses swreq directive, REQ_ prefix.
Level 2 — Software Detailed Design¶
SPEC_AGENT_WORKFLOW # Agent component: four-agent workflow
SPEC_DOC_STRUCTURE # Documentation component: sphinx-needs structure
SPEC_INST_INIT_SCRIPTS # Installation component: init scripts
SPEC_REL_VERSION_FORMAT # Release component: version format
Note: Uses swdesign directive, SPEC_ prefix, component-based themes.
Slug Guidelines¶
Keep slugs short: 2–4 words maximum
Be specific:
ANALYZEnotDO_ANALYSIS_OF_CHANGESUse domain language: terms stakeholders recognize
Avoid ambiguity:
NEW_PROJECTvsADOPT_EXISTING, notINSTALL_1vsINSTALL_2ALL CAPS:
NEED_CHG_ANALYZEnotNEED_chg_analyzeUnderscores only: no hyphens, no dots
Cross-Level Consistency¶
The theme abbreviation in a requirement ID does not need to match the theme of the linked Stakeholder Need. Requirements follow the 1:1 file mapping with Stakeholder Needs (see Methodology: Specification Hierarchy & File Organization), but the slug describes the requirement, not the parent story.
.. swreq:: Change Analysis Agent
:id: REQ_CHG_ANALYSIS_AGENT
:links: NEED_CHG_ANALYZE
.. (theme CHG matches because the REQ and NEED are in the same domain)
For Software Detailed Designs, the theme shifts to component names, so mismatches are expected and healthy:
.. swdesign:: Setup Agent Design
:id: SPEC_INST_SETUP_AGENT
:links: REQ_INST_NEW_PROJECT, REQ_INST_ADOPT_EXISTING, REQ_INST_SPHINX_NEEDS_DEP
.. (SPEC theme is INST because it's an installation component,
even though REQs come from multiple domains)
Uniqueness¶
sphinx-needs enforces global uniqueness across all .rst files at build time.
If two items share an ID, the build fails with an explicit error. This makes
descriptive IDs safer than sequential numbers (where duplicates across files
are easy to create accidentally).
Migration from Sequential IDs¶
When renaming from sequential to descriptive IDs:
Build a complete mapping table (old → new)
Rename
:id:directives in specification filesUpdate all
:links:directives referencing renamed IDsUpdate references in agent files, scripts, release notes
Run
sphinx-buildto validate — it will catch any missed references