A requirements management system that processes JSON specifications, analyzes task dependencies, and provides multiple interfaces for project planning.
- JSON-based Requirements: Define project requirements in structured, validated JSON format
- Dependency Analysis: Cycle detection, critical path calculation, and blocked task identification
- Health Metrics: Project health scoring based on priority, certainty, and deadlines
- Terminal Interface: Interactive TUI built on crossterm
- Command-line Tools: CLI for validation, analysis, export, and data generation
- REST API: HTTP daemon for web integration
- Plugin System: Extensible validation and enrichment plugins
- Multiple Exports: Markdown reports, CSV data, and Graphviz DOT diagrams
- Git Integration: Automatic commit tracking for TUI changes
Dependency analysis with path and health metrics
git clone https://github.com/abimael10/specrs.git
cd specrs
make buildcargo install --path crates/requirements-cli
cargo install --path crates/requirements-tui
cargo install --path crates/requirements-daemoncargo run -p requirements-cli -- validate -i examples/roadmap.jsoncargo run -p requirements-cli -- analyze -i examples/roadmap.json --report jsoncargo run -p requirements-tui -- examples/roadmap.json# Markdown report
cargo run -p requirements-cli -- export -i examples/roadmap.json --format md -o project-report.md
# CSV data export
cargo run -p requirements-cli -- export -i examples/roadmap.json --format csv -o tasks.csv
# Graphviz dependency graph
cargo run -p requirements-cli -- export -i examples/roadmap.json --format dot -o dependencies.dotcargo run -p requirements-daemon -- --port 3000
curl http://localhost:3000/healthRequirements are defined in structured JSON format:
{
"project": "My Project",
"phases": [
{
"id": "phase1",
"title": "Foundation",
"goal": "Establish project foundation",
"tasks": [
{
"id": "t1.1",
"description": "Setup development environment",
"status": "pending",
"dependencies": [],
"tags": ["setup", "dev"],
"priority": "high",
"estimated_hours": 4.0,
"certainty": 0.9,
"deadline": "2025-12-31",
"assignee": "Alice"
}
],
"deliverables": ["Development environment"]
}
]
}See SCHEMA.md for complete specification.
The TUI provides CRUD operations with vim-like navigation:
ββ π Project Tree βββββββββββββββββ π Task Details ββββββββββββββββββ
ββΌ phase0 - Foundation ββTask: t0.1 β
β β³ t0.1 - Initialize Cargo... ββ β
β β³ t0.2 - Configure rustfmt...ββDescription: Initialize Cargo... β
ββΌ phase1 - Core Development ββStatus: Pending β
β β³ t1.1 - Define core structs ββPriority: High β
β π t1.2 - Implement parsing ββEstimated Hours: 4.0 β
β β
t1.3 - Create JSON Schema ββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββ Status βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βProject: Rust TUI Requirements Processor [Modified] [AutoSave] β
β? Help | q Quit | Tab Switch | ββ Navigate | Enter Edit | a Add | d Del β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Key | Action |
|---|---|
β/k, β/j |
Navigate up/down |
β/h, β/l |
Navigate left/right |
Tab |
Switch between tree and details |
Enter |
Expand/collapse or edit |
a |
Add new task |
e |
Edit current task |
d |
Delete current task |
p/i/c |
Set status (Pending/In Progress/Complete) |
u |
Undo last action |
Ctrl+r |
Redo |
/ |
Search tasks |
f |
Filter by status/priority/tags |
Ctrl+s |
Save file |
S |
Toggle autosave |
? |
Show help |
q/Esc |
Quit |
- Cycle Detection: Identifies circular dependencies using Tarjan's SCC algorithm
- Critical Path: Longest path by estimated hours
- Blocked Tasks: Tasks waiting on incomplete dependencies
- Missing References: Dependencies pointing to non-existent tasks
The health index (0.0-1.0) combines multiple factors:
health_index =
completion_rate Γ 0.30 +
certainty_factor Γ 0.20 +
priority_factor Γ 0.20 +
deadline_factor Γ 0.15 +
dependency_factor Γ 0.15
- Overdue tasks
- High-priority pending tasks
- Blocked task percentage
- Deadline proximity warnings
The daemon provides a RESTful API:
GET /health
POST /load
GET /analyze/{doc_id}
GET /validate/{doc_id}
GET /export/{doc_id}?format=md|csv|dot
GET /docs/{doc_id}
POST /docs/{doc_id}
GET /docsSee API.md for complete documentation.
Extend functionality with custom plugins:
use requirements_plugins::RequirementsPlugin;
struct MyPlugin;
impl RequirementsPlugin for MyPlugin {
fn name(&self) -> &'static str { "my_plugin" }
fn validate(&self, spec: &ProjectSpec) -> Vec<String> {
vec![]
}
fn enrich(&self, spec: &mut ProjectSpec) {
// Custom logic
}
}Built-in plugins:
- deadline_guard: Flags overdue tasks
- dependency_validator: Validates dependency references
- task_id_validator: Ensures proper ID format
- priority_enricher: Sets default estimates based on priority
See PLUGINS.md for development guide.
graph TB
CLI[CLI Tool] --> Core[Requirements Core]
TUI[TUI Interface] --> Core
Daemon[REST Daemon] --> Core
Core --> Parser[JSON Parser]
Core --> Validator[Schema Validator]
Core --> Analysis[Analysis Engine]
Core --> Exports[Export Engine]
Analysis --> Graph[Dependency Graph]
Plugins[Plugin System] --> Core
- requirements-core: Core data model, parsing, validation, and analysis
- requirements-cli: Command-line interface
- requirements-tui: Terminal interface (crossterm-based)
- requirements-daemon: REST API server (axum-based)
- requirements-plugins: Plugin system and built-in plugins
- Rust 1.70+ (stable toolchain)
- Git 2.0+
git clone https://github.com/abimael10/specrs.git
cd specrs
make build# Run all tests
./target/debug/test-runner run
# Run specific test suite
./target/debug/test-runner --suite api run
# Run unit tests
cargo test --allSee Testing Documentation for details.
- Architecture Guide - System design and data flow
- Schema Reference - JSON schema specification
- TUI Guide - Terminal interface usage
- API Reference - REST endpoint documentation
- Plugin Development - Creating custom plugins
- Testing Documentation - Testing guide
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
MIT License - see LICENSE file for details.