Back to blog

Why I Built DevSpark

January 29, 20268 min read

An exploration of why I built DevSpark — adding constitution-powered pull request reviews, codebase audits, risk analysis, and brownfield discovery capabilities that make project constitutions valuable throughout the entire development lifecycle, not just during initial specification.

DevSpark Series — 24 articles
  1. DevSpark: Constitution-Driven AI for Software Development
  2. Getting Started with DevSpark: Requirements Quality Matters
  3. DevSpark: Constitution-Based Pull Request Reviews
  4. Why I Built DevSpark
  5. Taking DevSpark to the Next Level
  6. From Oracle CASE to Spec-Driven AI Development
  7. Fork Management: Automating Upstream Integration
  8. DevSpark: The Evolution of AI-Assisted Software Development
  9. DevSpark: Months Later, Lessons Learned
  10. DevSpark in Practice: A NuGet Package Case Study
  11. DevSpark: From Fork to Framework — What the Commits Reveal
  12. DevSpark v0.1.0: Agent-Agnostic, Multi-User, and Built for Teams
  13. DevSpark Monorepo Support: Governing Multiple Apps in One Repository
  14. The DevSpark Tiered Prompt Model: Resolving Context at Scale
  15. A Governed Contribution Model for DevSpark Prompts
  16. Prompt Metadata: Enforcing the DevSpark Constitution
  17. Bring Your Own AI: DevSpark Unlocks Multi-Agent Collaboration
  18. Workflows as First-Class Artifacts: Defining Operations for AI
  19. Observability in AI Workflows: Exposing the Black Box
  20. Autonomy Guardrails: Bounding Agent Action Safely
  21. Dogfooding DevSpark: Building the Plane While Flying It
  22. Closing the Loop: Automating Feedback with Suggest-Improvement
  23. Designing the DevSpark CLI UX: Commands vs Prompts
  24. The Alias Layer: Masking Complexity in Agent Invocations

The previous articles established two capabilities: requirements-driven development (Part 1) and constitution-based PR reviews (Part 2). Both assume you're building something new.

But most teams aren't starting fresh. They have existing codebases with implicit patterns, undocumented conventions, and years of accumulated decisions. This article introduces DevSpark—a fork that adds the brownfield capabilities I previewed in Part 1: discovering constitutions from existing code, auditing codebase-wide compliance, and analyzing risk before implementation.

What Was Missing

Spec-Driven Development introduced a powerful concept: the project constitution. The core idea — governing intent before generating code — was compelling. But working with the discipline, I kept running into situations where the constitution existed only during the spec workflow:

  1. /devspark.specify → Define requirements
  2. /devspark.plan → Create implementation plan
  3. /devspark.tasks → Break down into actionable tasks
  4. /devspark.implement → Execute the plan

Three opportunities emerged:

GapProblem
Constitution scopeWhy should constitutions only apply during feature development?
Brownfield blindnessHow do you retrofit a constitution onto existing code?
Risk analysisWhat could go wrong—before writing any code?

What DevSpark Adds

I created DevSpark as a community extension that keeps the original SDD workflow intact while adding four constitution-powered capabilities:

/devspark.pr-review — Constitution-Based Pull Request Reviews

This capability evolved from the custom extension I documented in Part 2, now integrated as a core DevSpark feature.

The problem: Traditional PR reviews depend on individual reviewer knowledge. Different reviewers catch different issues based on their experience and focus.

The solution: Use the constitution as an objective standard. Every PR gets evaluated against the same principles.

Key design decisions:

  • Works for any PR in any branch—not limited to feature branches
  • Only requires a constitution—no spec, plan, or tasks needed
  • Saves review history to /specs/pr-review/pr-{number}.md
  • Tracks commit SHAs so you can re-review after changes

This means constitution-powered reviews work for hotfixes to main, documentation updates to develop, and any contribution, regardless of whether it followed the SDD workflow.

/devspark.site-audit — Codebase-Wide Compliance Auditing

The problem: Constitution principles mean nothing if they're not enforced consistently across the entire codebase.

The solution: A comprehensive audit command that evaluates your entire codebase against constitution principles.

What it checks:

  • Constitution compliance (principle-by-principle)
  • Security vulnerabilities and patterns
  • Dependency health (outdated, unused, vulnerable packages)
  • Code quality metrics (complexity, duplication)
  • Unused code detection

Key design decisions:

  • Supports scoped audits (--scope=constitution, --scope=packages, etc.)
  • Produces trend-trackable reports in /docs/copilot/audit/
  • Compares against previous audits to show improvement or regression

/devspark.critic — Adversarial Risk Analysis

The problem: Plans and task lists can look perfect on paper but fail spectacularly in production. Teams with limited experience in a new tech stack often miss edge cases.

The solution: A skeptical reviewer that identifies showstoppers before implementation begins.

How it differs from /devspark.analyze:

  • /devspark.analyze = Consistency checking (are artifacts aligned?)
  • /devspark.critic = Adversarial analysis (what will fail in production?)

Severity levels include showstopper (production outage, data loss, security breach), critical (major user-facing issues), high (technical debt), and medium (development slowdown).

Key design decisions:

  • Constitution violations are automatically showstopper severity
  • Provides a clear Go/No-Go recommendation
  • Runs after /devspark.tasks but before /devspark.implement

/devspark.discover-constitution — Brownfield Constitution Discovery

The problem: Existing codebases have implicit patterns and conventions baked into the code. Teams adopting SDD need a way to extract these patterns into a constitution.

The solution: Analyze the codebase, discover patterns, and guide teams through interactive questions to formalize a constitution.

How it works:

  1. Scans for patterns (testing frameworks, security practices, architecture conventions)
  2. Reports high-confidence patterns (>80% consistent) vs. inconsistent areas
  3. Asks 8-10 targeted questions to validate findings
  4. Generates a draft constitution at /memory/constitution-draft.md

Key design decisions:

  • Discovery-first: analyze code before asking questions
  • Draft output: produces a starting point for team review, not a final document
  • Respects existing work: treats discovered patterns as valuable

Additional Improvements

Beyond the four major features, DevSpark includes:

PowerShell Parity

Every bash script has a corresponding PowerShell script. Windows developers get first-class support.

ScriptPurpose
site-audit.ps1Codebase auditing
get-pr-context.ps1PR data extraction via GitHub CLI
create-github-release.ps1Release management
generate-release-notes.ps1Automated changelog generation

Repository Health Analysis

Integrated Git Spark reports provide insights into contributor activity and bus factor, file hotspots (high churn, many authors), governance scores (commit message quality, traceability), and risk analysis based on code churn patterns.

Enhanced Documentation

The toolkit includes constitutional governance guides with examples, PR review usage documentation, site audit usage guides, critic command documentation, and local development instructions.

The Philosophy: Continuous Constitution Value

The core philosophy of DevSpark is straightforward:

A project constitution should provide value continuously, not just during feature development.

If you write a constitution that says "All public APIs must have input validation," that principle should guide new feature development (the core SDD workflow), catch violations in pull requests (/devspark.pr-review), identify existing violations in the codebase (/devspark.site-audit), and flag missing validation as a risk before implementation (/devspark.critic).

This creates a closed loop where constitution principles are enforced at every stage of the development lifecycle.

Attribution

DevSpark builds on the foundations of Specification-Driven Development. Full credit for those foundational ideas goes to Den Delimarsky and John Lam.

DevSpark extends the core SDD workflow. The specification pipeline remains intact. All additions maintain backward compatibility with existing SDD practices.

Try It Yourself

Install DevSpark:

uv tool install specify-cli --from git+https://github.com/markhazleton/devspark.git

Initialize in your existing project (brownfield):

cd /path/to/your-project
specify init --here --ai copilot

## Discover patterns and draft a constitution
## (use /devspark.discover-constitution in your AI agent)

Or start fresh (greenfield):

specify init my-project --ai claude

Then try the constitution-powered commands:

  • /devspark.discover-constitution — Draft a constitution from existing code
  • /devspark.pr-review #123 — Review a PR against your constitution
  • /devspark.site-audit — Audit your entire codebase
  • /devspark.critic — Identify risks before implementation

What This Means for Development Teams

The extension addresses a common challenge: how do you maintain consistency in a codebase as it grows and evolves? Traditional approaches rely on documentation that becomes stale, tribal knowledge that lives in senior developers' heads, or inconsistent code reviews that vary by reviewer.

Constitution-driven development offers an alternative. By codifying principles once and enforcing them continuously, teams can maintain consistency without constant vigilance. The constitution becomes a shared reference point that scales beyond individual knowledge.

Worth examining whether this approach fits your team's workflow. For projects with high governance requirements, regulatory compliance needs, or distributed teams where consistency is challenging, the investment in crafting a constitution may pay dividends throughout the development lifecycle.

Summary

CapabilityCommand
PR review/devspark.pr-review
Brownfield discovery/devspark.discover-constitution
Risk analysis/devspark.critic
Site audit/devspark.site-audit

The goal: maximize the return on investment for crafting a thoughtful project constitution—across the entire development lifecycle.