07. Extending the System Safely
Why This Page Exists
A good training course should not stop at “understand the code.” It should also teach:
- how to change the code without breaking the repo’s design
This project already has a strong docs-first workflow. The real playbook is visible in the repo and has been used through the first four slices.
This page explains that workflow from a newcomer’s point of view.
The Core Artifact Flow
The implementation flow is documented in Implementation Workflow.
The short version is:
- start from Requirements
- add or update an ADR if a cross-cutting design decision is involved
- write a spec for the slice
- write a task with exact scope and verification
- implement and test the slice
- close out the slice in docs when it is complete
This is one of the best habits in the repo. It creates durable project memory instead of leaving every future engineer or AI tool to reconstruct intent from code alone.
Quick Artifact Flow
Requirements
|
v
ADR (if cross-cutting decision is needed)
|
v
Spec
|
v
Task / Task Pack
|
v
Code Changes
|
v
Tests + Build Verification
|
v
Close-Out DocsThis is the shortest useful mental model for how the repo expects change to happen.
How Requirements, ADRs, Specs, Tasks, and Tests Fit Together
Requirements
Requirements define stable product and engineering expectations.
Use them for:
- vocabulary
- scope boundaries
- system-level rules
- non-functional expectations
Best starting point for newcomers:
ADRs
ADRs record choices that have cross-cutting architectural impact.
Examples in this repo:
- central app state
- file-backed run history before database persistence
- JSON recipe catalog before an in-app editor
- one merged operational maturity slice
Use an ADR when the decision changes more than one file or feature slice.
Specs
Specs translate requirements into one bounded feature slice.
A good spec defines:
- in-scope behavior
- out-of-scope behavior
- runtime expectations
- acceptance criteria
Tasks
Tasks turn the spec into an implementation handoff.
The task pack approach is especially important for AI-assisted work because it keeps prompts medium-sized and testable.
Tests
Tests are not just post-implementation validation here. They are part of how the repo preserves intended behavior:
- command guard semantics
- workflow transitions
- alarm lifecycle
- persistence rules
- streaming and backpressure behavior
- regression coverage for previously fixed bugs
How To Add One Bounded Feature Slice
Use this sequence:
- read the relevant requirement sections
- decide whether the change needs an ADR
- write one slice spec
- write one umbrella task
- split implementation into medium-sized task prompts if AI tools will be used
- implement one bounded concern at a time
- run tests and build verification
- update docs and close-out notes when done
The key is to keep the slice bounded. A good slice changes one coherent behavior area, not three unrelated subsystems.
Which Docs To Read Before Editing
Before Editing Runtime Logic
Read:
- Requirements: 02. Domain and State Model
- Requirements: 05. Failure Modes and Workflow Requirements
- ADR-001: Use Central App State Store
- 04. Workflow and Async Runtime
Before Editing UI Or View Models
Read:
Before Editing Infrastructure
Read:
- 02. Project and Layer Map
- 05. Design Patterns and .NET Techniques
- the relevant infrastructure abstractions in
Application.Abstractions
Mistakes To Avoid When Using AI Coding Tools
1. Handing The Entire Repo To One Prompt
This repo works better with medium-sized tasks. Large prompts tend to produce:
- scope drift
- shallow reasoning
- inconsistent state semantics
2. Letting The Tool Invent Runtime Rules
The vocabulary and behavior contracts already exist in:
- requirements
- ADRs
- specs
- tests
The AI should implement from those sources, not improvise them.
3. Changing UI Behavior Without Checking Canonical State
A common mistake is to “just make the button work” in the UI layer. In this repo, command semantics belong in the application layer and guards.
4. Adding Hidden State
If a change introduces a second truth source outside AppState, the repo becomes harder to reason about.
5. Skipping Verification
The task packs in this repo consistently expect:
- focused tests
- build verification
- docs updates when stable behavior changes
Skipping that is usually where AI-generated work becomes expensive later.
A Good Newcomer Workflow
If you want to contribute safely:
- reproduce the current behavior in the app
- read the related scenario page
- read the related architecture or course page
- find the relevant spec and task
- inspect the matching tests
- only then begin editing
This repo rewards engineers who build context before changing behavior.
Learning Paths By Role
Operator-Minded Learner
Focus on:
- scenarios
- run history
- diagnostics
- fault and recovery flows
Then read this page to understand how those behaviors should be extended safely.
.NET or WPF Developer
Focus on:
- architecture walkthrough
- runtime module
- design patterns and .NET techniques
- then this extension playbook
Architecture-Focused Learner
Focus on:
- requirements
- ADRs
- architecture pack
- implementation workflow
- then this page
Related Pages
Where To Go After This
If you want to keep learning:
- return to the Scenario Pack and trace one behavior end to end
- use the Architecture Pack while reading code
- use the Implementation Workflow whenever you prepare a real feature slice or AI task handoff
Diagram Brief
Title: Docs-first extension workflowPurpose: Show how a newcomer should move from requirements to ADR to spec to task to implementation to tests and close-outAudience: newcomer contributor using manual coding or AI-assisted codingNodes: Requirements, ADR, Spec, Task, Task Pack, Code Changes, Tests, Build Verification, Close-Out ReviewEdges: each artifact feeds the next; tests and verification confirm the implementation; close-out updates stable project memoryGrouping: Planning artifacts, implementation artifacts, verification artifactsCaption: Safe extension in this repo depends on respecting the docs-first flow, not skipping straight to codeDestination file path:docs/diagrams/source/course-07-extending-the-system.drawio