Repository navigation
How to Adopt Spec Kit in a Complex Brownfield Microservices Architecture with Multiple Repositories and Teams? #5018
Unanswered
KamalAlsabah
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I'm looking for advice from people who have adopted Spec Kit, or a similar Spec-Driven Development (SDD) approach, in a large, existing brownfield system with multiple repositories, independently deployed microservices, shared libraries, and multiple engineering teams.
I'm particularly interested in real-world experiences, architectural approaches, and lessons learned rather than just the basic Spec Kit workflow.
1. Our Current Architecture
We have an existing application that originally started as a monolith. Over time, we have been migrating parts of it toward a microservices architecture, but the migration is still ongoing.
Our codebase is distributed across several types of repositories:
1. Main Application Repository
2. Independent Microservice Repositories
Some capabilities have already been extracted into separate repositories and are developed and deployed independently.
Examples include:
3. Building Blocks Repository
We also have a shared repository containing reusable libraries and infrastructure components used across multiple services, such as:
These repositories are interconnected. A change in one repository can affect other services, shared contracts, infrastructure components, or the overall application behavior.
2. Our Organizational Context
This is not a small project maintained by one developer.
We have a relatively large organization with different teams and responsibilities, including:
Multiple teams work on the same overall product, but they may own different repositories and services.
Our goal is to introduce Spec-Driven Development in a way that works at this organizational scale, rather than simply adding Spec Kit to every repository and letting each team operate independently.
3. What We Want to Achieve
Ideally, we want a workflow in which:
We also want to avoid an approach that requires manually documenting every detail of the existing system before we can start using Spec Kit.
The system is already large and evolving, so we need a practical way to introduce SDD incrementally.
4. Questions About the Architecture and Workflow
A. Should We Have a Central Repository for System-Level Specifications?
Would it make sense to create a dedicated repository that acts as the central source of truth for system-level specifications and architectural knowledge?
For example, this repository could contain:
Individual repositories would then contain their own service-level specifications, plans, tasks, and implementation details.
Is this a good pattern for a large brownfield system, or would you recommend a different structure?
How do you distinguish between system-level specifications and repository-level specifications without duplicating information or creating conflicting sources of truth?
B. How Should We Handle Contract-Driven Development Across Repositories?
Suppose we want to implement a feature that affects the Customer microservice, the main application, and a shared Building Blocks library.
The change might involve:
How would you organize this workflow with Spec Kit?
Specifically:
Most importantly, how do we ensure that the overall feature specification remains consistent with the individual service specifications and the actual contracts?
C. How Can We Keep System-Level Specifications Aware of Changes in Individual Repositories?
One of our biggest concerns is keeping the overall architecture and its specifications synchronized as individual repositories evolve.
For example, if a team changes an API, moves a responsibility to another service, or modifies a shared Building Blocks component, how should that change be reflected in the system-level architecture and dependency information?
Would you recommend:
What should be automated, and what should remain an explicit architectural or team decision?
I'm particularly interested in approaches that avoid duplicating documentation and do not depend entirely on developers remembering to update multiple documents manually.
D. How Should Spec Kit Be Used in a Brownfield System?
This is probably our most important practical question.
We already have a large codebase with existing business rules, architectural decisions, integrations, and historical constraints that are not necessarily documented in one place.
Should we first spend time building comprehensive specifications for the entire existing system before introducing Spec Kit?
Or should we start with new features and document the relevant existing behavior as we go?
For example, would the following incremental approach make sense?
If you have adopted SDD in an existing system, what did your initial onboarding process look like?
How much architectural documentation did you create upfront, and how did you decide what was worth documenting?
E. How Should We Structure the Specifications Themselves?
For a system like ours, what information belongs in each layer?
For example:
Is this separation practical when using Spec Kit, or does it introduce too much process overhead?
How would you map this structure to Spec Kit's existing
specify,plan, andtasksworkflow?Also, how do you handle a feature that spans multiple repositories without ending up with several disconnected specifications that each describe only part of the same change?
F. How Should We Introduce This Across Multiple Teams?
Assuming we have a central system-level specification and individual repositories with their own specifications, how should the workflow operate in practice?
For example, should a typical cross-service feature follow a process like this?
Would you organize the process differently?
How do you maintain traceability from a business requirement to the system-level specification, individual repository specifications, implementation tasks, pull requests, and integration tests?
And how do you avoid making this workflow too heavyweight for normal development?
5. A Particularly Important Concern: Architecture Awareness for AI Agents
One of our long-term goals is to make AI-assisted development reliable enough that an agent can work on a feature without treating each repository as an isolated project.
For example, if we ask an agent to change authentication from username/email-based login to phone-number-based login, we want it to understand the relevant architecture before proposing changes.
It should be able to identify:
We do not want to put the entire architecture and every repository's documentation into the agent's context for every task. That would be expensive, difficult to maintain, and potentially counterproductive.
Instead, we want a reliable way to discover the relevant architectural knowledge and dependencies for each feature.
Has anyone combined Spec Kit with a service catalog, architecture documentation, dependency mapping, contract testing, or other mechanisms to achieve this?
What worked well in practice, and what did not?
6. Keeping the Process Practical and Efficient
We are also concerned about the ongoing maintenance cost.
A solution that requires every team to manually maintain multiple layers of documentation for every small change is unlikely to scale.
How do you decide:
We want specifications to provide useful, reliable context for both developers and AI agents, not become another documentation system that gradually loses credibility.
7. What I Would Especially Like to Learn From the Community
If you have worked on a similar system, I would really appreciate hearing about your actual experience.
In particular:
Links to real-world examples, public repositories, architectural diagrams, workflow definitions, or write-ups would be especially valuable.
I am not looking for a theoretically perfect architecture. I am trying to find an approach that can evolve with an existing system, support multiple teams, preserve architectural consistency, and make AI-assisted development more reliable without introducing excessive overhead.
If you were starting today with Spec Kit in this kind of environment, what would your recommended architecture and adoption roadmap look like, from the first experiment to a mature, organization-wide workflow?
Thanks!
All reactions