Skip to content

Commit 214e510

Browse files
mnriemCopilot
andauthored
docs: add existing project adoption guide (#4263)
Add a safe brownfield onboarding path and connect it to the docs homepage, quick start, navigation, and spec maintenance guidance. Assisted-by: GitHub Copilot (model: GPT-5.6 Sol, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 663b4e07-d79f-4bd1-aa86-8aeea21a2643
1 parent 9a2c265 commit 214e510

5 files changed

Lines changed: 119 additions & 0 deletions

File tree

‎docs/guides/evolving-specs.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Evolving Specs in Existing Projects
22

3+
If the repository has not been initialized with Spec Kit yet, start with
4+
[Adopting Spec Kit in an Existing Project](existing-projects.md). This page
5+
covers how to maintain artifacts after adoption.
6+
37
Existing projects need two separate maintenance loops:
48

59
- **Spec Kit project-file updates** refresh managed commands, scripts,

‎docs/guides/existing-projects.md‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Adopting Spec Kit in an Existing Project
2+
3+
You do not need to recreate an existing system from specifications before using
4+
Spec Kit. Initialize the repository in place, capture the rules that matter,
5+
and use the workflow for the next bounded change.
6+
7+
## 1. Start from a Reviewable Baseline
8+
9+
Before initialization, commit or stash existing work and create a branch for the
10+
adoption. This makes every generated file visible in a normal code review.
11+
12+
Choose the [integration key](../reference/integrations.md) for the coding agent
13+
you use. Then run the command from the repository root:
14+
15+
```bash
16+
specify init --here --force --integration <key>
17+
```
18+
19+
`--here` targets the current directory. `--force` allows initialization in a
20+
non-empty directory and may replace files at conflicting managed paths, so use
21+
it only after creating a reviewable baseline. It does not delete the rest of
22+
your application.
23+
24+
Review the resulting diff before continuing. Initialization adds the shared
25+
`.specify/` project files and the command or skill files required by your
26+
selected integration. It does not rewrite your application or infer
27+
specifications for existing behavior.
28+
29+
> [!NOTE]
30+
> Git initialization and feature branches are optional and are managed by the
31+
> **git** extension. Add it with `specify extension add git` if you want that
32+
> workflow.
33+
34+
## 2. Capture Project Guardrails
35+
36+
Run `/speckit.constitution` with principles that are already true for the
37+
repository or that the team has explicitly agreed to adopt:
38+
39+
```text
40+
/speckit.constitution Preserve public API compatibility. Follow the existing
41+
service boundaries. Every database migration must include a rollback plan.
42+
Run the repository's established unit and integration test suites.
43+
```
44+
45+
Use the repository's README, architecture decisions, contribution guide, and
46+
CI configuration as evidence. Do not invent standards merely to fill the
47+
constitution template. The constitution governs later planning and analysis,
48+
so unrealistic rules create noise instead of useful constraints.
49+
50+
## 3. Choose a Bounded First Change
51+
52+
Start with a feature, bug fix, or modernization slice that can be reviewed
53+
independently. Do not make "document the entire existing system" your first
54+
feature unless that inventory is itself the intended deliverable.
55+
56+
Describe both the requested outcome and the compatibility boundaries that must
57+
remain intact:
58+
59+
```text
60+
/speckit.specify Add CSV export to the existing orders page. Preserve current
61+
filters and authorization behavior. Export only the rows visible to the signed-in
62+
user, and do not change the existing JSON API response.
63+
```
64+
65+
The codebase remains implementation context. The new `spec.md` defines the
66+
change you intend to make, not a retroactive specification of every existing
67+
behavior.
68+
69+
## 4. Plan Against the Repository
70+
71+
Continue through the normal workflow:
72+
73+
1. Run `/speckit.clarify` to resolve uncertain behavior and compatibility
74+
requirements.
75+
2. Run `/speckit.plan` and verify that the proposed design reuses the existing
76+
architecture, dependencies, and test conventions.
77+
3. Run `/speckit.tasks`, then `/speckit.analyze` to check consistency before
78+
implementation.
79+
4. Run `/speckit.implement` and review code and artifact changes together.
80+
5. Run `/speckit.converge` to find remaining gaps. If it adds tasks, repeat
81+
implementation and convergence until the feature is complete.
82+
83+
For command details and optional quality gates, see the
84+
[Quick Start Guide](../quickstart.md) and
85+
[Agentic SDD reference](../reference/agentic-sdd.md).
86+
87+
## 5. Decide How Specs Will Age
88+
89+
After the first change, agree on how the team will maintain completed feature
90+
artifacts:
91+
92+
- Keep each feature directory as an immutable historical record.
93+
- Maintain `spec.md` as a living contract and regenerate downstream artifacts.
94+
- Allow discoveries to flow back from code, tasks, or plans, then reconcile the
95+
full artifact set.
96+
97+
The [Spec Persistence Models](../concepts/spec-persistence.md) page compares
98+
these choices. The [Evolving Specs guide](evolving-specs.md) provides the
99+
maintenance loop for each model.
100+
101+
## Existing-Project Examples
102+
103+
The [community walkthroughs](../community/walkthroughs.md) include brownfield
104+
examples across .NET, Java, and Go/React codebases. Community extensions for
105+
architecture discovery and brownfield bootstrapping are listed in the
106+
[extension catalog](../community/extensions.md).

‎docs/index.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ Community extensions like CI Guard and Architecture Guard add compliance gates a
124124
<strong>Getting Started</strong>
125125
<span>Install, configure, and run your first SDD workflow</span>
126126
</a>
127+
<a href="guides/existing-projects.md" class="nav-card">
128+
<strong>Existing Projects</strong>
129+
<span>Adopt Spec Kit safely in an established codebase</span>
130+
</a>
127131
<a href="reference/overview.md" class="nav-card">
128132
<strong>Reference</strong>
129133
<span>Core commands, integrations, extensions, presets, and workflows</span>

‎docs/quickstart.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ specify init taskify # or: specify init . to use the current directory
4747

4848
> [!NOTE]
4949
> Prefer `pipx`, one-time `uvx` runs, a pinned release, or an offline/air-gapped setup? See the [Installation Guide](installation.md) for all supported methods.
50+
> Adding Spec Kit to a repository that already contains code? Follow
51+
> [Adopting Spec Kit in an Existing Project](guides/existing-projects.md) before
52+
> starting the workflow below.
5053
5154
### Step 1: `/speckit.constitution` — set the ground rules
5255

‎docs/toc.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
href: installation.md
1616
- name: Quick Start
1717
href: quickstart.md
18+
- name: Existing Projects
19+
href: guides/existing-projects.md
1820
- name: Upgrade
1921
href: upgrade.md
2022
- name: Install uv

0 commit comments

Comments
 (0)