flowspec – Spec‑Driven Development with AI‑Powered Task Management (Clone: https://github.com/moses-y/flowspec)
Overview
flowspec implements spec‑kit and backlog.md with a task‑memory layer. The repo contains 2 407 files (≈1 800 markdown, 318 Python, 91 YAML, 66 Shell, plus Go, JSON, TOML). It is built with Docker, FastAPI, React, and Spring components; CI runs on GitHub Actions. The code base is organized into eight projects (src, .claude, scripts, templates, utils, examples, .stacks, build‑docs) and ships a CLI, hooks, telemetry, and a net‑log utility.
How It Is Wired
Entry points (real files, not guessed):
| Entry point | Purpose |
|---|---|
src/flowspec_cli/hooks/cli.py | CLI command dispatch |
src/flowspec_cli/logging/cli.py | Logging configuration |
src/flowspec_cli/memory/cli.py | Task‑memory bootstrap |
src/flowspec_cli/telemetry/cli.py | Telemetry start‑up |
utils/flowspec-netlog/main.go | Net‑log server (Go) |
Import graph (deterministic, 397 files analysed): 320 internal modules, 81 import edges, 0 circular dependencies.
Most connected modules (Ca = importers, Ce = imports, instability = Ce/(Ca+Ce)):
| Module | Ca | Ce | instability |
|---|---|---|---|
src/flowspec_cli/satellite/__init__ | 0 | 8 | 1 |
src/flowspec_cli/__init__ | 0 | 7 | 1 |
src/flowspec_cli/hooks/__init__ | 0 | 6 | 1 |
src/flowspec_cli/hooks/emitter | 2 | 4 | 0.67 |
src/flowspec_cli/hooks/runner | 3 | 3 | 0.5 |
src/flowspec_cli/hooks/cli | 0 | 5 | 1 |
src/flowspec_cli/hooks/events | 5 | 0 | 0 |
src/flowspec_cli/hooks/schema | 4 | 1 | 0.2 |
Hubs such as src/flowspec_cli/satellite/__init__ (instability 1) mean a change ripples widely; low‑instability modules (hooks/events) are leaf‑only.
What the code touches outside the repo – the CLI invokes backlog task create, beads issue tracking, and Docker builds; telemetry pushes metrics to a configurable endpoint (see src/flowspec_cli/telemetry/config.py). The Go net‑log binary listens on 0.0.0.0:9090 by default.
How To Use It
| Step | Command (from README) | Notes |
|---|---|---|
| Install CLI | uv tool install flowspec-cli --from git+https://github.com/jpoley/flowspec.git | Pulls the package from the repo; uv is the Python package installer. |
| Init project | flowspec init my-project --ai claude | Prompts to add backlog.md and beads if missing. |
| Specify a feature | /flow:specify Build a REST API for task management with JWT authentication | Generates spec files under backlog/ and templates/. |
| Plan / Implement / Validate | /flow:plan → /flow:implement → /flow:validate | Full SDD path; for lighter features skip plan/validate. |
| Run the app | uv run src/flowspec_cli/__main__.py (or flowspec serve) | Starts the FastAPI server; Docker image jpoley/flowspec-agents also available. |
Configuration: environment variables read from .env (not present by default) or from backlog/config.yml. Secrets are committed (see hygiene section) – avoid adding real keys.
Real‑World Use
A product team wants to ship a new “payment‑intent” feature. They run:
flowspec init payment‑app --ai claude– createsbacklog.mdand a beads workspace./flow:specify Implement payment‑intent flow with Stripe integration– generatesbacklog/payment-intent.mdand template hooks./flow:plan– produces a design doc underbuild-docs/./flow:implement– AI agents scaffold FastAPI routes insrc/flowspec_cli/backlog/parser.py, add Stripe webhook handling, and commit with formatted messages./flow:validate– runs the test suite (tests/e2e/upgrade/) and a Docker build (tests/e2e/upgrade/Dockerfile) to confirm the container runs as an unprivileged user.
The flow keeps task state in backlog/, tracks progress with beads, and each commit is validated by the CI pipeline before merge.
Code Health & Issues
Measured findings (static analysis, 141 total):
- HIGH cognitive_load – deep nesting (max indent 9) in
src/flowspec_cli/hooks/schema.py,src/flowspec_cli/backlog/parser.py,src/flowspec_cli/hooks/runner.py. Flatten with guard clauses. - MEDIUM resilience – broad
exceptclauses insrc/flowspec_cli/telemetry/config.py,src/flowspec_cli/telemetry/integration.py,.claude/hooks/logging_helper.py. Catch specific exceptions. - HIGH clarity – 1 737 repeated 6‑line blocks across 155 files (e.g.,
.claude/hooks/logging_helper.py,templates/hooks/logging_helper.py). Extract shared helpers. - HIGH cognitive_load – oversized files:
src/flowspec_cli/__init__.py(8 236 lines) andsrc/flowspec_cli/satellite/audit.py. Split by responsibility. - MEDIUM resource_safety –
open(...)without context manager in.claude/hooks/test-stop-quality-gate.py,src/flowspec_cli/security/mcp_server.py,src/flowspec_cli/security/triage/classifiers/path_traversal.py. Usewith open(...) as f:.
Code‑health audit (10 findings, 0 critical):
- [HIGH] Pin third‑party GitHub Actions to commit SHA –
.github/workflowsincludesastral-sh/setup-uv@v4; replace@v4with 40‑char SHA. - [HIGH] Commit a lockfile beside the manifest –
package.jsonhas no lockfile; run the package manager once and commit the generated file. - [HIGH] Remove
continue-on-errorfrom correctness‑gating steps –.github/workflows/security-parallel.ymlline 105; delete or move advisory step. - [MEDIUM] Declare least‑privilege GITHUB_TOKEN permissions – add
permissions: contents: readat workflow top. - [MEDIUM] Enable Dependabot / Renovate – no update bot configured; add
.github/dependabot.ymlcovering Python, Node, and GitHub‑Actions. - [MEDIUM] Pin container base image by digest –
tests/e2e/upgrade/Dockerfileusespython:3.11-slim; pin topython:3.11-slim@sha256<digest>and enable Dependabot Docker. - [MEDIUM] Gate PRs on dependency vulnerability scan – no scan in CI; add
dependency-review-actiononpull_requestorosv-scanner. - [MEDIUM] Set
persist-credentials: falseon checkout –.github/workflows/security-parallel.yml; addwith: persist-credentials: falseand explicit token only to push steps. - [MEDIUM] Add non‑root USER to the image –
tests/e2e/upgrade/Dockerfilehas noUSERdirective; create unprivileged user, chown needed paths, andUSERat Dockerfile end. - [LOW] Set
timeout-minuteson workflow jobs –ci.ymllacks job timeouts; add realistic bounds.
Repository hygiene (detected): tests yes, CI yes (GitHub Actions), Dockerfile yes, licence yes, lockfile no, committed secrets YES (several .backlog/hooks/pre-commit-secrets.sh, src/flowspec_cli/security/... files contain secret‑shaped paths).
The Bottom Line
flowspec delivers a structured, agent‑driven workflow for spec‑driven development and backlog tracking, with solid CI/Docker scaffolding. The code base is large and contains several high‑impact maintainability problems (deep nesting, duplicated logic, oversized files) and security hygiene gaps (missing lockfile, unpinned Actions, committed secrets). Teams comfortable with AI‑augmented SDLC and willing to invest in refactoring and CI hardening will get the most value; organisations requiring out‑of‑the‑box security and reproducible builds should address the audit items before production use.