PreceptA free and open source requirements engineering tool for VS Code. Precept is a lightweight requirements management system built into VS Code. Write requirements in RST files, get IntelliSense, validation, traceability, live preview, and static HTML documentation — no external tools needed.
FeaturesIntelliSense & Autocomplete
Hover & Navigation
Validation & Diagnostics
Item Explorer
Link Explorer
Live Preview & Static HTML
Baseline & Release Management
Productivity
InstallationFrom VS Code Marketplace
From VSIX
From Source
Quick Start1. Project SetupOption A: Use the command (Recommended)
This creates a Option B: Manual setup Create a
2. Create RequirementsUse snippets - type
The snippet can then be navigated by tabbing field by field. Intellisense on the attributes
3. Link RequirementsAutocomplete helps with linking:
4. Navigate
|
| Setting | Default | Description |
|---|---|---|
validation.automatic |
true |
Enable real-time validation |
validation.onSave |
true |
Validate when files are saved |
validation.debounceMs |
500 |
Delay before validation runs |
validation.checkCircularDeps |
false |
Check circular dependencies (slower) |
validation.checkCoverage |
false |
Check coverage during auto-validation |
treeView.groupBy |
"type" |
Group by: type, file, or status |
treeView.showStatusIcons |
true |
Show status icons in tree view |
indexing.maxFiles |
1000 |
Maximum RST files to index |
indexing.excludePatterns |
["**/build/**"] |
Glob patterns to exclude |
Usage
Creating Requirements
Using snippets - type and press Tab:
req-req-> Requirementreq-spec-> Specificationreq-test-> Test Casereq-rationale-> Rationale
Manual creation:
.. item:: User authentication requirement
:id: 0042
:type: requirement
:status: approved
:satisfies: 0010, 0011
:baseline: v1.0.0
The system must authenticate users using OAuth 2.0.
Linking Requirements
:satisfies: 0001 # Single link
:implements: 0002, 0003 # Multiple links
:tests: 0004 # Test case link
Use Ctrl+Space after : for autocomplete suggestions.
Inline References
Reference items inline using roles:
The system communicates via the :termref:`0050`.
The timeout is :paramval:`0042`.
See :item:`0001` for details.
These are tracked as links in the Link Explorer.
Validation
Automatic: Errors appear as you type in Problems panel (Ctrl+Shift+M)
Manual: Command Palette -> "Precept: Deep Validation"
Error types:
- Broken links
- Duplicate IDs
- Invalid status/type
- Circular dependencies
- Status inconsistencies
- Orphaned requirements
Quick fixes: Press Ctrl+. on errors for solutions
Baseline Management
Tag a baseline:
- Command Palette -> "Precept: Tag Current Baseline"
- Enter version (e.g.,
v1.0.0) - Select which requirements to tag
Generate release report:
- Command Palette -> "Precept: Generate Release Report"
- Select baseline
- Choose comparison baseline (optional)
- View or save report
Create Git tag:
- Command Palette -> "Precept: Create Git Tag for Baseline"
- Select baseline
- Git tag
req-v1.0.0is created
Building HTML Documentation
Use the VS Code command palette:
- Precept: Build Documentation - generates static HTML in
_build/html/ - Precept: View Documentation - opens the built HTML in your browser
- Precept: Open RST Preview - live preview in VS Code
The static HTML builder is built into the extension — no external tools required.
Commands
| Command | Description |
|---|---|
Precept: New RMS Project |
Create a new Precept project with precept.json and sample requirements |
Precept: Reload Configuration |
Reload precept.json and rebuild index |
Precept: Open RST Preview |
Live rendered preview of the current RST file |
Precept: Build Documentation |
Generate static HTML documentation |
Precept: View Documentation |
Open built HTML in browser |
Precept: Deep Validation |
Comprehensive validation with detailed reports |
Precept: Tag Current Baseline |
Add baseline tags |
Precept: Remove Baseline Tags |
Remove baseline |
Precept: Generate Release Report |
Create release report |
Precept: Create Git Tag for Baseline |
Git tag for baseline |
Precept: Refresh Explorer |
Refresh tree view |
Deep Validation
The Precept: Deep Validation command provides comprehensive analysis of your requirements traceability:
What it checks:
- DV-001: Circular Dependencies - Detects cycles using Tarjan's algorithm, severity by length
- DV-002: Hierarchical Coverage - Stakeholder->System, System->Component coverage with thresholds
- DV-003: Orphaned Requirements - Categorizes true orphans, dead-ends, and source-only nodes
- DV-004: Status Consistency - Validates status propagation (approved->draft violations)
- DV-005: Hierarchical Completeness - Verifies complete traceability chains across levels
- DV-006: Priority-Weighted Coverage - Coverage targets by priority (critical: 100%, high: 95%, etc.)
- DV-007: Baseline Stability - Ensures baselined requirements are approved/implemented
- DV-010: Gap Analysis - Actionable recommendations prioritized by severity
Output: Detailed report in VS Code Output panel with:
- Summary statistics (total issues by severity)
- Top 10 prioritized recommendations with effort estimates
- Circular dependency cycles
- Coverage metrics by link type
- Detailed findings with actionable quick fixes
Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| Go to Definition | F12 or Ctrl+Click |
| Peek Definition | Alt+F12 |
| Find References | Shift+F12 |
| Autocomplete | Ctrl+Space |
| Quick Fix | Ctrl+. |
| Command Palette | Ctrl+Shift+P |
Tips
ID Conventions and Optional ID Prefix
- By default, IDs are plain numeric:
0001,0002,0003 - Use leading zeros for proper sorting
- Optionally configure a prefix in
precept.json(e.g.,REQ-0001)
Link Types
Link types can be set up in precept.json in the linkTypes array. A few link types are included by default.
A new link type is set up by adding an object to linkTypes. To demonstrate, here is a link type for linking rationale items to requirements:
{
"option": "motivates",
"incoming": "motivated_by",
"outgoing": "motivates"
}
Folder Structure
RST files can be organized in subdirectories. Use .. toctree:: to define the document hierarchy. The static HTML builder preserves the folder structure and generates correct cross-file links.
Status Workflow
- draft -> Initial creation
- review -> Ready for review
- approved -> Reviewed and approved
- implemented -> Implementation complete
Validation Strategy
- Keep automatic validation enabled during requirements development
- Run Deep Validation before releases
- Use quick fixes for efficiency
- Tag baselines only with approved/implemented requirements
Troubleshooting
Extension not activating
- Ensure
.rstfiles exist in workspace - Check file language is "reStructuredText" (status bar)
Configuration not loading
- Verify
precept.jsonexists in a supported location (see Configuration File Location above) - View Output panel: View -> Output -> "Requirements"
Autocomplete not working
- Ensure cursor is in link field (
:links:,:satisfies:, etc.) - Press
Ctrl+Spaceto manually trigger - Check requirements are indexed (status bar)
Performance issues
- Add build dirs to
requirements.indexing.excludePatterns - Increase
requirements.indexing.maxFilesif needed
Contributing
We welcome contributions! Here's how to get started:
Development Setup
git clone https://github.com/martinpalsson/precept.git
cd precept
npm install
npm run compile
Run extension: Press F5 in VS Code
Run tests: npm run test:unit
Lint: npm run lint
Project Structure
src/
├── extension.ts # Entry point
├── types.ts # TypeScript types
├── configuration/ # Config loading (precept.json parsing)
├── indexing/ # RST parsing & indexing
├── providers/ # VS Code language providers
├── views/ # Item Explorer & Link Explorer
├── commands/ # Command implementations
├── renderer/ # RST-to-HTML rendering engine
├── preview/ # Live preview panel
├── build/ # Static HTML site builder
├── themes/ # Selectable theme definitions
├── validation/ # Deep validation analyzers
└── utils/ # Utility functions
Adding Features
- New command: Add to
package.json, implement insrc/commands/ - New provider: Create in
src/providers/, register inextension.ts - New validation: Add to
diagnosticProvider.ts - New setting: Add to
package.json, updatetypes.tsandsettingsManager.ts
Coding Standards
- TypeScript strict mode
- 2-space indentation
- JSDoc comments on public APIs
- Unit tests for new features
- Conventional Commits
Requirements
- VS Code 1.80.0+
- Works on Windows, macOS, Linux
- No external dependencies required
License
MIT License - see LICENSE for details.






