Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A requirements management system that processes JSON specifications, analyzes task dependencies, and provides multiple interfaces for project planning.

License

Notifications You must be signed in to change notification settings

Abimael10/specrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

specrs - Requirements Processor

A requirements management system that processes JSON specifications, analyzes task dependencies, and provides multiple interfaces for project planning.

CI License: MIT Rust

Features

  • 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

Screenshots

Terminal User Interface

TUI Screenshot Interactive TUI view

Help modal for input information

HELP Screenshot Help modal options

Analysis Log

Analysis Screenshot Dependency analysis with path and health metrics

Installation

Build from Source

git clone https://github.com/abimael10/specrs.git
cd specrs
make build

Using Cargo

cargo install --path crates/requirements-cli
cargo install --path crates/requirements-tui
cargo install --path crates/requirements-daemon

Quick Start

1. Validate Requirements

cargo run -p requirements-cli -- validate -i examples/roadmap.json

2. Analyze Project Health

cargo run -p requirements-cli -- analyze -i examples/roadmap.json --report json

3. Launch Interactive TUI

cargo run -p requirements-tui -- examples/roadmap.json

4. Export Reports

# 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.dot

5. Start REST Daemon

cargo run -p requirements-daemon -- --port 3000
curl http://localhost:3000/health

JSON Schema

Requirements 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.

Terminal Interface

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 Bindings

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

Analysis Features

Dependency Analysis

  • 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

Health Metrics

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

Risk Factors

  • Overdue tasks
  • High-priority pending tasks
  • Blocked task percentage
  • Deadline proximity warnings

REST API

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 /docs

See API.md for complete documentation.

Plugin System

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.

Architecture

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
Loading

Crate Structure

  • 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

Development

Prerequisites

  • Rust 1.70+ (stable toolchain)
  • Git 2.0+

Building

git clone https://github.com/abimael10/specrs.git
cd specrs
make build

Testing

# Run all tests
./target/debug/test-runner run

# Run specific test suite
./target/debug/test-runner --suite api run

# Run unit tests
cargo test --all

See Testing Documentation for details.

Documentation

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

About

A requirements management system that processes JSON specifications, analyzes task dependencies, and provides multiple interfaces for project planning.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published