Skip to content

About

Skill to help workflow system analyst with Agentic AI

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

FSD Analyzer

Transform Functional Specification Documents (FSD) into Markdown-first technical artifacts — API specs, ERD schemas, UML diagrams, developer task cards, HTML Gantt timeline charts, and a Requirement Traceability Matrix — using AI-powered coding assistants like Cursor, Claude Code, OpenCode, or any agent that supports custom skills.

What It Does

FSD Analyzer is a skill/plugin for AI coding assistants that acts as a Senior System Analyst. It reads your FSD or business requirements and produces:

Output Purpose
spec_api.md REST API contract (endpoints, auth, validation, errors, examples)
erd.md + DBML Database schema + paste-ready for dbdiagram.io
UML diagrams PlantUML — sequence, class, activity, state, component, use case diagrams
task.md Developer task cards with Story Points, dependencies, critical path (copy to Monday, Jira, Confluence)
task_fe.md Frontend task cards (component breakdown, API integration, UI states, acceptance criteria)
timeline.html Self-contained HTML Gantt chart with Story Points, dependencies, critical path, developer utilization
RTM Requirement Traceability Matrix — business requirements → FR → design solution → test case (output/rtm/RTM.md / RTM_<scope>.md)
openapi.yaml OpenAPI 3.0 consolidating all endpoint specs with x-status / x-phase (output/spec/openapi.yaml)
Gap Report Structured diff: FSD vs existing ERD/API + migration plan
Consistency Report Cross-check: ERD ↔ API spec ↔ tasks
Discovery Questions Structured QUESTION_FOR_BA, ASSUMPTION, CONFLICT list for ambiguous FSDs
Auth & Security Spec Auth patterns, role-permission matrix, security requirements
Migration Plan Zero-downtime migration strategy, rollback plan, deployment sequence

Features

  • Generate artifacts — From FSD to full API spec, ERD, UML diagrams, and task cards
  • UML diagrams — PlantUML code blocks for PlantUML / PlantText: sequence, class, activity, state, component, and use case diagrams
  • Gap analysis — Compare new FSD against existing database schema and API specs
  • Consistency checks — Validate alignment across ERD, API spec, and task cards
  • Timeline estimation — Story Points (1 SP = 4 hours), developer assignment, dependency tracking, critical path analysis, HTML Gantt chart visualization
  • RTM generation — Trace every business requirement to its design solution and test case. One scope = one RTM; the user picks the scope name and which FSD files to trace (a single FSD split into several files is traced together) into a single output/rtm/RTM_<scope>.md; uncovered requirements stay as empty cells the dashboard highlights
  • OpenAPI generation — Consolidate MASTER_SPEC_API.md + output/spec/*.md into one output/spec/openapi.yaml with x-status/x-phase
  • Discovery mode — Structured questions for ambiguous FSDs before generating specs
  • Auth & security — JWT patterns, role-permission matrix, brute force protection, data protection
  • Error catalog — Standardized error envelope, error codes, HTTP status mapping
  • Frontend tasks — FE-specific cards with component breakdown, API integration, UI states
  • Migration planning — Zero-downtime strategy, rollback plan, deployment sequence
  • Master files — Rolling MASTER_ERD.md and MASTER_SPEC_API.md for incremental FSD-by-section work
  • Project context — Template for tech stack, conventions, environments
  • Copy-paste friendly — Markdown tables, fenced sql/json/plantuml blocks ready for spreadsheets, Jira, Monday, dbdiagram.io, or PlantUML renderers
  • Optional Python scripts — Validate DBML, check spec structure, extract entity hints, compare artifacts (no external dependencies)
  • Optional Streamlit UI — Browser-based interface for the validation scripts

Quick Start

1. Use with Cursor / Claude Code / OpenCode

Point your AI assistant to this repo as a skill. For example in OpenCode, add to your project's .agents/skills/ directory or reference the SKILL.md directly.

2. Create project context (recommended, one-time)

Copy references/project_context_template.md to your project root as project_context.md and fill in your project details (tech stack, naming conventions, environments, auth patterns).

3. In your chat, @-reference your FSD and existing artifacts

@project_context.md @fsd_user_management.md — generate spec_api, erd, and tasks

Usage Examples

Discovery / Discussion Mode

When the FSD is still ambiguous or incomplete:

FSD ini masih draft. List semua pertanyaan dan asumsi — jangan buat spec dulu.
@fsd_draft.md

Generate Artifacts from FSD

Analisis FSD ini dan generate ERD, API spec, task cards
@fsd_user_management.md

Generate UML Diagrams Only

Generate PlantUML sequence and class diagrams from this FSD. Only UML, no spec.
@fsd_user_management.md

Document Auth & Security

Dokumentasikan auth flow dan role matrix dari FSD ini
@fsd_user_management.md

Frontend Task Cards

Generate frontend task cards from this FSD. Include component breakdown, API integration, and acceptance criteria.
@fsd_user_management.md

Gap Analysis

Compare this new FSD with our existing ERD and API spec. Produce a Gap Report.
@fsd_new_feature.md @erd_current.md @spec_api_current.md

Consistency Check

Check consistency between the ERD, API spec, and task cards. List errors and warnings.
@erd.md @spec_api.md @task.md

Development Timeline with Gantt Chart

Assign tasks to developers and generate a visual timeline:

Generate development timeline with Gantt chart from these task cards.
Team: Andi (Senior), Budi (Mid), Citra (Junior)
@task_user_management.md

Or directly from FSD:

Analisis FSD ini, generate task cards dengan story points, lalu buat timeline HTML dengan Gantt chart.
Assign: Andi (Senior), Budi (Mid), Citra (Junior)
@fsd_user_management.md

This generates:

  • Task cards with Story Points (1 SP = 4 hours)
  • Dependency tracking (Depends On / Blocks)
  • Critical path identification
  • Developer utilization analysis (no idle devs, no overload)
  • timeline_<feature>.html — open in browser for interactive Gantt chart

Using Master Files for Incremental Work

@MASTER_ERD.md @MASTER_SPEC_API.md @fsd_section_3.md — merge changes into master

Requirement Traceability Matrix

Trace business requirements down to design solutions and test cases after artifacts exist:

Generate RTM dari FSD dan artifacts yang sudah ada. Output ke output/rtm/RTM.md

This reads input/fsd/*.md, output/spec/*.md, output/erd/*.md (and .dbml), output/task/*.md, plus MASTER_SPEC_API.md / MASTER_ERD.md and produces a single output/rtm/RTM.md (or RTM_<scope>.md when scoped to one FSD/phase) with BR → FR → DS → TC tables. Requirements with no design or test yet keep empty cells — that is the coverage gap.

OpenAPI 3.0

Consolidate all endpoint specs into one machine-readable file:

Generate openapi.yaml dari semua spec yang ada

Reads MASTER_SPEC_API.md + output/spec/*.md and writes a single valid output/spec/openapi.yaml with summary/description/tags per operation plus x-status: done|in-develop and x-phase where derivable.


Story Points

SP Hours Criteria
1 SP 4h Single simple CRUD, no dependency
2 SP 8h 1 endpoint + medium logic, or standard FE page
3 SP 12h Multi-endpoint, medium logic, light integration
5 SP 20h Full feature, multi-table, approval flow
8 SP 32h New module, third-party integration, complex
13 SP 52h Epic: cross-module, large migration, architecture

SP per Sprint (2 weeks): Senior ~15 SP, Mid ~10 SP, Junior ~7 SP


Project Structure

fsd-analyzer/
├── SKILL.md                         # Agent instructions (main skill definition)
├── references/                      # Format templates & procedures
│   ├── spec_api_format.md           # API spec structure
│   ├── erd_format.md                # ERD tables + DBML format
│   ├── uml_format.md                # UML diagrams (PlantUML)
│   ├── task_format.md               # Developer task cards + Story Points + dependencies
│   ├── gap_analysis.md              # Gap analysis procedure + report template
│   ├── consistency_check.md         # Consistency check procedure + report template
│   ├── master_artifacts.md          # MASTER_ERD + MASTER_SPEC workflow
│   ├── api_conventions.md           # API standards (pagination, naming, versioning, sorting)
│   ├── auth_security.md             # Auth patterns, role-permission matrix, security
│   ├── error_catalog.md             # Error envelope, error codes, HTTP status mapping
│   ├── discovery_questions.md       # Discovery mode: structured questions for ambiguous FSD
│   ├── frontend_task_format.md      # Frontend task cards (components, API integration, UI states)
│   ├── migration_strategy.md        # DB migration plan (zero-downtime, rollback, deployment)
│   ├── project_context_template.md  # Project context template (tech stack, conventions)
│   ├── timeline_estimation.md       # Timeline + HTML Gantt + SP + dependency + critical path
│   ├── rtm_format.md                # Requirement Traceability Matrix (BR → FR → DS → TC)
│   └── openapi_format.md            # OpenAPI 3.0 consolidation (x-status / x-phase)
├── scripts/                         # Optional local validation (Python, stdlib only)
│   ├── validate_erd.py              # DBML table + ref validation
│   ├── validate_spec.py             # Spec markdown structure heuristics
│   ├── extract_entities.py          # Extract table/entity hints from FSD
│   └── compare_artifacts.py         # Compare FSD table mentions vs ERD tables
├── evals/                           # Evaluation prompts & sample data
│   ├── evals.json                   # Test prompts and expected outputs (11 scenarios)
│   ├── sample_fsd.md                # Sample Functional Specification Document
│   └── sample_dbml.dbml             # Sample DBML for script smoke tests
├── optional_web/                    # Streamlit UI for running scripts
│   ├── app.py
│   ├── requirements.txt
│   └── .env.example
└── assets/templates/                # Project-specific snippet placeholders

Workflow Overview

flowchart TD
    FSD[FSD / Requirements] --> DISC{Clear enough?}
    DISC -->|No| QUESTIONS[Discovery Questions<br/>QUESTION_FOR_BA / ASSUMPTION]
    QUESTIONS --> DISC
    DISC -->|Yes| SPEC[Spec API]
    SPEC --> ERD[ERD + DBML]
    ERD --> UML[UML Diagrams]
    SPEC --> TASKS[Task Cards<br/>SP + Dependencies]
    TASKS --> FE_TASKS[FE Task Cards]
    TASKS --> TIMELINE[Timeline HTML<br/>Gantt Chart]
    SPEC --> RTM[RTM<br/>output/rtm/RTM.md]
    ERD --> RTM
    TASKS --> RTM
    ERD --> GAP[Gap Analysis<br/>vs existing artifacts]
    GAP --> MIGRATION[Migration Plan]
    SPEC --> CONSISTENCY[Consistency Check]
Loading

Typical SA Workflow

  1. Discovery — List questions, assumptions (don't generate specs yet)
  2. Spec API — Define endpoints, auth, validation, errors
  3. ERD — Design tables, columns, indexes, relationships + DBML
  4. UML — Generate PlantUML diagrams (sequence, class, activity, etc.)
  5. Tasks — Create task cards with Story Points and dependencies
  6. FE Tasks — Frontend-specific cards (if applicable)
  7. Timeline — Assign developers, generate HTML Gantt chart
  8. Gap Analysis — Compare against existing system (if applicable)
  9. Consistency Check — Validate all artifacts aligned
  10. RTM — Trace BR → FR → DS → TC into output/rtm/RTM.md / RTM_<scope>.md
  11. OpenAPI — Consolidate specs into output/spec/openapi.yaml

Running the Scripts

All scripts use Python standard library only (no pip install needed for the scripts themselves).

# Extract entity/table hints from an FSD
python scripts/extract_entities.py path/to/fsd.md

# Validate DBML structure (tables + foreign key refs)
python scripts/validate_erd.py path/to/schema.dbml

# Check API spec markdown structure
python scripts/validate_spec.py path/to/spec_api.md

# Compare FSD table mentions vs ERD tables (heuristic)
python scripts/compare_artifacts.py --fsd path/to/fsd.md --erd path/to/erd.md

Quick smoke test

python scripts/extract_entities.py evals/sample_fsd.md
python scripts/validate_erd.py evals/sample_dbml.dbml

Optional Web UI

A minimal Streamlit interface to paste FSD/spec/DBML text and run validators in the browser.

cd optional_web
pip install -r requirements.txt
streamlit run app.py

Workflow: Master Artifacts

For projects where you work FSD-by-section (common in large systems):

  1. Create MASTER_ERD.md and MASTER_SPEC_API.md in your project root
  2. For each FSD section, @-reference the master files + the new FSD slice
  3. The agent merges changes into the master files incrementally
  4. No need to re-attach every legacy file each time

See references/master_artifacts.md for the full workflow.

Workflow: Project Context

Create project_context.md once per project so the agent has consistent conventions:

  1. Copy template from references/project_context_template.md to project root
  2. Fill in tech stack, naming conventions, environments, auth patterns
  3. @-reference it in every prompt alongside FSD

Quality Gates

Every output is checked against:

  • All FSD requirements covered or explicitly flagged
  • REST consistency with auth and error documentation
  • API conventions followed (pagination, naming, versioning)
  • Error codes follow standard catalog
  • Auth pattern and role-permission matrix documented
  • Normalized schema with justified FKs and indexes
  • Cross-artifact alignment (spec ↔ ERD ↔ tasks ↔ UML)
  • UML diagram entity names, endpoint paths, and statuses consistent with ERD and spec
  • Developer-ready task granularity with QA acceptance criteria
  • All tasks have Story Points and dependency fields
  • Timeline HTML with balanced developer utilization
  • Critical path identified and risks flagged
  • sql/json/plantuml code fences for easy copy-paste

Compatible AI Assistants

Works with any AI coding assistant that supports custom skill instructions:


Companion Tool: Monday to Technical Documentation Generator

Untuk workflow lengkap dari Monday.com board export ke Technical Documentation (DOCX), gunakan skill companion monday-td-generator yang tersedia di .agents/skills/monday-td-generator/.

Apa itu monday-td-generator?

Skill otomatis yang mengubah export board Monday.com menjadi Technical Documentation profesional dengan:

  1. Parse Excel Export - Baca file .xlsx dari Monday.com, extract items & subitems dengan status DONE/GO-LIVE
  2. Enrich dari Updates - Parse detail API (request/response body, flow logic) dari updates di setiap subitem
  3. Generate Technical Documentation - Hasilkan TD lengkap dengan:
    • Modul terpisah (Authentication, Management, API endpoints, dll)
    • Front End & Back End specifications
    • Detail API endpoints dengan 2-column table format
    • Request/Response body dan flow logic dari updates
    • Mermaid diagrams (system architecture + ERD)
  4. Export ke DOCX - Convert ke Word document dengan template Onesist profesional

Cara Penggunaan monday-td-generator

Quick Start (Otomatis)

Cukup jalankan script utama dengan file export Monday:

python3 .agents/skills/monday-td-generator/scripts/generate_td.py \
  --excel path/to/monday-export.xlsx \
  --output technical-documentation.md

Script akan:

  • Setup environment otomatis (install dependencies jika belum ada)
  • Parse Excel dan filter items DONE
  • Enrich dengan updates
  • Generate Technical Documentation
  • Export ke DOCX dengan mermaid diagrams

Manual Step-by-Step

Untuk kontrol lebih detail, jalankan setiap step terpisah:

Step 1: Setup Environment

python3 .agents/skills/monday-td-generator/scripts/setup_env.py

Step 2: Parse Monday Export

python3 .agents/skills/monday-td-generator/scripts/parse_monday.py \
  path/to/monday-export.xlsx \
  --output parsed.json

Step 3: Enrich dengan Updates

python3 .agents/skills/monday-td-generator/scripts/parse_updates.py \
  parsed.json \
  enriched.json

Step 4: Generate Technical Documentation

python3 .agents/skills/monday-td-generator/scripts/generate_td.py \
  enriched.json \
  technical-documentation.md

Step 5: Export ke DOCX (Optional)

python3 .agents/skills/monday-td-generator/scripts/export_docx.py \
  technical-documentation.md \
  --output technical-documentation.docx

Struktur File monday-td-generator

.agents/skills/monday-td-generator/
├── SKILL.md                              # Definisi skill
├── templates/
│   └── technical-documentation.md        # Template markdown
├── references/
│   ├── generation-prompt.md              # Prompt untuk generate TD
│   └── monday-format-guide.md            # Dokumentasi format Monday
└── scripts/
    ├── setup_env.py                      # Setup environment (Python + dependencies)
    ├── parse_monday.py                   # Parse Excel → JSON
    ├── parse_updates.py                  # Parse API details dari updates
    ├── generate_td.py                    # Generate TD dari enriched JSON
    └── export_docx.py                    # Export ke DOCX dengan mermaid rendering

Contoh Penggunaan

Export single phase:

python3 .agents/skills/monday-td-generator/scripts/generate_td.py \
  --excel PRJ_Teman_SEVA_ACC_Phase_1_0.xlsx \
  --output td-phase-1.md

Export multiple phases:

# Parse semua phase
python3 .agents/skills/monday-td-generator/scripts/parse_monday.py \
  PRJ_Teman_SEVA_ACC_Phase_1_0.xlsx \
  PRJ_Teman_SEVA_ACC_Phase_2_0.xlsx \
  PRJ_Teman_SEVA_ACC_Phase_3_0_MVP_1_0.xlsx \
  --output all-phases.json

# Enrich dan generate
python3 .agents/skills/monday-td-generator/scripts/parse_updates.py all-phases.json all-phases-enriched.json
python3 .agents/skills/monday-td-generator/scripts/generate_td.py all-phases-enriched.json td-complete.md
python3 .agents/skills/monday-td-generator/scripts/export_docx.py td-complete.md --output td-complete.docx

Contoh Prompt untuk AI Assistant

Berikut adalah contoh-contoh prompt yang bisa Anda gunakan saat berinteraksi dengan AI assistant (Cursor, Claude Code, dll) untuk menjalankan skill monday-td-generator:

1. Generate Technical Documentation dari Single File

Tolong buatkan Technical Documentation dari export Monday ini:
@monday-export.xlsx

Generate dokumen lengkap dengan:
- Parse Excel dan filter items DONE/GO-LIVE
- Enrich dengan request/response dari updates
- Generate TD dalam format markdown
- Export ke DOCX dengan mermaid diagrams

2. Generate dari Multiple Board Files

Saya punya 3 file export Monday untuk project ini:
- @board-phase-1.xlsx
- @board-phase-2.xlsx
- @board-phase-3.xlsx

Tolong generate Technical Documentation yang menggabungkan semua phase menjadi satu dokumen lengkap.

3. Generate dengan Custom Metadata

Generate Technical Documentation dari @monday-export.xlsx dengan metadata berikut:
- Project Name: My Project
- Customer: Client Company
- Version: 1.0.0
- Author: System Analyst Team
- Date: 2026-01-15

Pastikan metadata ini muncul di cover page dan header/footer DOCX.

4. Parse dan Enrich Saja (Tanpa Generate TD)

Parse file @board-export.xlsx dan extract semua API details dari updates.
Saya hanya butuh JSON enriched-nya saja, belum perlu generate TD.
Simpan hasilnya di api-details.json

5. Generate TD dari JSON yang Sudah Ada

Saya sudah punya enriched JSON di @enriched-data.json.
Tolong generate Technical Documentation markdown dari data tersebut.
Gunakan template dari .agents/skills/monday-td-generator/templates/technical-documentation.md

6. Export Markdown ke DOCX Saja

Saya sudah punya Technical Documentation di @td-output.md.
Tolong convert ke DOCX dengan:
- Template Onesist (header/footer profesional)
- Render semua mermaid diagrams sebagai PNG
- Output: td-output.docx

7. Generate untuk Phase Tertentu Saja

Dari file @all-phases.xlsx, saya hanya mau generate Technical Documentation untuk:
- Phase 2 items saja
- Filter status: DONE dan GO-LIVE
- Output: td-phase-2.md dan td-phase-2.docx

8. Troubleshooting - Setup Environment

Saya mau pakai skill monday-td-generator tapi belum yakin dependencies-nya lengkap.
Tolong jalankan setup_env.py untuk memastikan:
- Python 3.8+ terinstall
- openpyxl, python-docx, mmdc tersedia
- Semua dependencies siap digunakan

9. Debug - Cek Parsed Data

Parse file @monday-export.xlsx dan tampilkan summary:
- Berapa total items dan subitems?
- Berapa items dengan status DONE/GO-LIVE?
- Berapa API endpoints yang terdeteksi dari updates?
- Berapa subitems yang punya updates dengan request/response details?

Jangan generate TD dulu, saya mau review datanya terlebih dahulu.

10. Generate dengan Filter Status Custom

Generate Technical Documentation dari @board.xlsx tapi gunakan filter status berikut:
- DONE
- GO-LIVE
- COMPLETED
- RELEASED
- DEPLOYED

Jangan filter "In Progress" atau "Testing", hanya yang sudah benar-benar selesai.

11. Regenerate dengan Update Data Baru

Saya sudah punya @td-existing.md dari generate sebelumnya.
Sekarang ada update di board, ini file barunya: @monday-export-updated.xlsx

Tolong:
1. Parse file baru
2. Bandingkan dengan TD yang sudah ada
3. Regenerate TD dengan data terbaru
4. Highlight section yang berubah (added/modified/removed)

12. Generate untuk Modul Spesifik

Dari @enriched-data.json, saya hanya mau generate Technical Documentation untuk modul:
- Authentication & Login
- User Management
- Payment Processing

Skip modul lainnya. Output: td-auth-user-payment.md

Tips Penggunaan Prompt

  1. Selalu attach file Excel menggunakan @filename.xlsx agar AI assistant bisa mengaksesnya
  2. Sebutkan output yang diinginkan (markdown saja, DOCX saja, atau keduanya)
  3. Spesifikasikan filter jika tidak ingin menggunakan default (DONE/GO-LIVE)
  4. Berikan metadata jika ingin customize cover page dan header
  5. Minta summary dulu sebelum generate full TD untuk review data
  6. Gunakan path lengkap untuk file input/output jika working directory tidak jelas

Dependencies

Skill ini membutuhkan:

  • Python 3.8+
  • openpyxl (parse Excel)
  • python-docx (generate DOCX)
  • mmdc (mermaid-cli untuk render diagrams)

Semua dependencies akan di-install otomatis oleh setup_env.py.

Output yang Dihasilkan

Markdown (td-*.md):

  • Cover page dengan metadata
  • Approvals & Knowledge section
  • Introduction (Purpose, Background, Objectives)
  • Project Scope (In Scope & Out of Scope)
  • Effort Estimation (Story Points breakdown)
  • System Overview (Architecture diagram)
  • 17 Modul Detail (Authentication, TSL Management, Agent Management, dll)
    • Front End & Back End specifications
    • API endpoints dengan request/response
    • Flow logic detail
  • Lampiran ERD (Mermaid diagram)
  • Data Specification (table schemas)

DOCX (td-*.docx):

  • Template Onesist profesional
  • Header/footer dengan metadata
  • Mermaid diagrams di-render sebagai PNG
  • Formatting konsisten dengan fsd-analyzer output

License

MIT — use freely in your software projects.

About

Skill to help workflow system analyst with Agentic AI

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages