Feature Development
Purpose
Deliver a production-ready feature with the smallest coherent change that satisfies the requested behavior and fits the existing C#/.NET/WPF architecture.
Treat repository conventions, AGENTS.md, solution/project structure, existing tests, and existing patterns as the source of truth. User instructions take precedence over this skill when they conflict.
Operating principles
- Understand the repository before editing code.
- Prefer existing patterns over inventing new abstractions.
- Make the smallest coherent change; avoid unrelated refactors.
- Keep View, ViewModel, domain/application logic, and infrastructure responsibilities aligned with the existing architecture.
- Treat UI-threading, async behavior, cancellation, lifetime, and binding semantics as part of correctness in WPF.
- Add or update meaningful automated tests for behavior that can be tested below the UI layer.
- Validate with the repository's real build/test commands and report evidence.
- Do not claim success for checks that were not actually run.
Workflow
1. Understand the request
Extract:
- desired behavior
- acceptance criteria
- affected user flow or component
- explicit constraints
- likely non-functional requirements such as performance, threading, persistence, or compatibility
If the request is underspecified, inspect the repository for established behavior and analogous features first. Ask a question only when the missing information materially changes the implementation or makes safe progress impossible; otherwise proceed with a clearly stated assumption.
2. Discover the codebase
Before editing:
- Read applicable
AGENTS.md files and repository-local instructions.
- Identify the solution/project(s) that own the behavior.
- Find the closest existing feature with similar UI, command, service, persistence, or validation behavior.
- Trace the relevant flow from WPF View/XAML through ViewModel into application/domain/infrastructure code as applicable.
- Locate existing tests and test helpers for the affected behavior.
- Inspect dependency injection, navigation, resource dictionaries, converters, command patterns, and state-management conventions only as relevant to the feature.
Do not explore the entire repository indiscriminately. Start with the smallest set of files that can establish the architectural path, then expand only when needed.
3. Plan before implementation
Create a concise implementation plan that names:
- files/components likely to change
- the existing pattern to follow
- the main behavior/data flow
- tests to add or update
- notable risks or assumptions
For non-trivial changes, wait for the plan to be reviewed before making broad edits when the surrounding workflow requires human approval. For ordinary execution, move directly from plan to implementation without unnecessary ceremony.
4. Implement incrementally
Implement the feature in coherent slices.
C#/.NET
- Preserve nullability and existing API contracts.
- Reuse dependency injection and service abstractions already present.
- Prefer clear domain/application logic over putting business rules in ViewModels.
- Preserve async all the way through I/O boundaries; do not introduce
.Result, .Wait(), or blocking waits in UI paths.
- Propagate
CancellationToken when the repository already uses cancellation or the operation can be long-running.
- Preserve exception/error-handling conventions and user-facing error behavior.
- Avoid speculative abstractions or new dependencies unless the feature genuinely requires them.
WPF/XAML
- Follow the repository's MVVM conventions.
- Keep business logic out of code-behind unless the repository explicitly uses code-behind for that concern.
- Respect existing
DataContext, command, binding, validation, and navigation patterns.
- Keep UI-bound collections and properties consistent with the application's established notification strategy.
- Do not update WPF-bound state from a background thread; marshal to the UI thread using the repository's established pattern when needed.
- Consider binding modes, element names, converters, resources, styles, templates, and design-time behavior only when relevant to the change.
- Preserve keyboard/accessibility behavior and existing visual conventions unless the request explicitly changes them.
5. Add focused tests
Prefer tests that prove behavior, not implementation details.
For a feature, consider the smallest useful set of:
- application/domain/service unit tests
- ViewModel behavior tests
- integration tests for persistence or external boundaries
- UI tests only when the repository already has a reliable UI-test strategy and the behavior cannot be meaningfully covered lower in the stack
Do not manufacture tests solely to increase line coverage. A test should encode an important acceptance criterion or protect a meaningful regression boundary.
6. Validate
At minimum, run the repository's applicable validation commands, typically:
- format/analyzer checks if required by the repo
- build of affected project(s) or solution
- relevant tests
- broader test suite when practical and appropriate
For WPF changes, also inspect for likely runtime issues that compilation will not catch, such as:
- incorrect binding paths
- missing resources/styles/templates
- invalid
DataContext assumptions
- dispatcher/thread-affinity problems
- command enablement/state transitions
- navigation/lifetime issues
If a required check cannot run, state exactly what was not run and why.
7. Review the final diff
Before finishing:
- inspect the complete diff
- remove accidental changes, dead code, debug output, and unused usings/resources
- confirm the implementation matches the acceptance criteria
- check that tests cover the important behavior
- check API and architectural boundaries
- look for duplicated logic that should reuse an existing path
- verify no unrelated files changed
8. Report
Finish with a concise report containing:
- What changed
- Main design/implementation decision
- Tests/builds/checks actually run
- Any assumptions or known limitations
- Files or areas the reviewer should pay particular attention to
Feature-specific guardrails
- Do not silently broaden scope because you discover unrelated technical debt.
- Do not perform large refactors merely to make the new feature easier unless the refactor is necessary for correctness or explicitly requested.
- Do not introduce a new WPF framework, MVVM toolkit, DI container, state-management library, or persistence technology when an existing repository mechanism can satisfy the requirement.
- Do not rewrite working XAML or code simply to make it stylistically different.
- When multiple designs are viable, prefer the one that best matches surrounding code and minimizes long-term surprise.
- Preserve backward compatibility unless the requirement explicitly permits a breaking change.
1---2name: feature-development3description: Implement new C#/.NET/WPF features using the repository's existing architecture, patterns, tests, and build conventions. Use for new capabilities, user stories, enhancements, commands, views, ViewModels, services, workflows, and feature extensions; do not use for defect-first investigations where the primary task is diagnosing existing incorrect behavior.4---56# Feature Development78## Purpose910Deliver a production-ready feature with the smallest coherent change that satisfies the requested behavior and fits the existing C#/.NET/WPF architecture.1112Treat repository conventions, `AGENTS.md`, solution/project structure, existing tests, and existing patterns as the source of truth. User instructions take precedence over this skill when they conflict.1314## Operating principles1516- Understand the repository before editing code.17- Prefer existing patterns over inventing new abstractions.18- Make the smallest coherent change; avoid unrelated refactors.19- Keep View, ViewModel, domain/application logic, and infrastructure responsibilities aligned with the existing architecture.20- Treat UI-threading, async behavior, cancellation, lifetime, and binding semantics as part of correctness in WPF.21- Add or update meaningful automated tests for behavior that can be tested below the UI layer.22- Validate with the repository's real build/test commands and report evidence.23- Do not claim success for checks that were not actually run.2425## Workflow2627### 1. Understand the request2829Extract:3031- desired behavior32- acceptance criteria33- affected user flow or component34- explicit constraints35- likely non-functional requirements such as performance, threading, persistence, or compatibility3637If the request is underspecified, inspect the repository for established behavior and analogous features first. Ask a question only when the missing information materially changes the implementation or makes safe progress impossible; otherwise proceed with a clearly stated assumption.3839### 2. Discover the codebase4041Before editing:4243- Read applicable `AGENTS.md` files and repository-local instructions.44- Identify the solution/project(s) that own the behavior.45- Find the closest existing feature with similar UI, command, service, persistence, or validation behavior.46- Trace the relevant flow from WPF View/XAML through ViewModel into application/domain/infrastructure code as applicable.47- Locate existing tests and test helpers for the affected behavior.48- Inspect dependency injection, navigation, resource dictionaries, converters, command patterns, and state-management conventions only as relevant to the feature.4950Do not explore the entire repository indiscriminately. Start with the smallest set of files that can establish the architectural path, then expand only when needed.5152### 3. Plan before implementation5354Create a concise implementation plan that names:5556- files/components likely to change57- the existing pattern to follow58- the main behavior/data flow59- tests to add or update60- notable risks or assumptions6162For non-trivial changes, wait for the plan to be reviewed before making broad edits when the surrounding workflow requires human approval. For ordinary execution, move directly from plan to implementation without unnecessary ceremony.6364### 4. Implement incrementally6566Implement the feature in coherent slices.6768#### C#/.NET6970- Preserve nullability and existing API contracts.71- Reuse dependency injection and service abstractions already present.72- Prefer clear domain/application logic over putting business rules in ViewModels.73- Preserve async all the way through I/O boundaries; do not introduce `.Result`, `.Wait()`, or blocking waits in UI paths.74- Propagate `CancellationToken` when the repository already uses cancellation or the operation can be long-running.75- Preserve exception/error-handling conventions and user-facing error behavior.76- Avoid speculative abstractions or new dependencies unless the feature genuinely requires them.7778#### WPF/XAML7980- Follow the repository's MVVM conventions.81- Keep business logic out of code-behind unless the repository explicitly uses code-behind for that concern.82- Respect existing `DataContext`, command, binding, validation, and navigation patterns.83- Keep UI-bound collections and properties consistent with the application's established notification strategy.84- Do not update WPF-bound state from a background thread; marshal to the UI thread using the repository's established pattern when needed.85- Consider binding modes, element names, converters, resources, styles, templates, and design-time behavior only when relevant to the change.86- Preserve keyboard/accessibility behavior and existing visual conventions unless the request explicitly changes them.8788### 5. Add focused tests8990Prefer tests that prove behavior, not implementation details.9192For a feature, consider the smallest useful set of:9394- application/domain/service unit tests95- ViewModel behavior tests96- integration tests for persistence or external boundaries97- UI tests only when the repository already has a reliable UI-test strategy and the behavior cannot be meaningfully covered lower in the stack9899Do not manufacture tests solely to increase line coverage. A test should encode an important acceptance criterion or protect a meaningful regression boundary.100101### 6. Validate102103At minimum, run the repository's applicable validation commands, typically:1041051. format/analyzer checks if required by the repo1062. build of affected project(s) or solution1073. relevant tests1084. broader test suite when practical and appropriate109110For WPF changes, also inspect for likely runtime issues that compilation will not catch, such as:111112- incorrect binding paths113- missing resources/styles/templates114- invalid `DataContext` assumptions115- dispatcher/thread-affinity problems116- command enablement/state transitions117- navigation/lifetime issues118119If a required check cannot run, state exactly what was not run and why.120121### 7. Review the final diff122123Before finishing:124125- inspect the complete diff126- remove accidental changes, dead code, debug output, and unused usings/resources127- confirm the implementation matches the acceptance criteria128- check that tests cover the important behavior129- check API and architectural boundaries130- look for duplicated logic that should reuse an existing path131- verify no unrelated files changed132133### 8. Report134135Finish with a concise report containing:136137- What changed138- Main design/implementation decision139- Tests/builds/checks actually run140- Any assumptions or known limitations141- Files or areas the reviewer should pay particular attention to142143## Feature-specific guardrails144145- Do not silently broaden scope because you discover unrelated technical debt.146- Do not perform large refactors merely to make the new feature easier unless the refactor is necessary for correctness or explicitly requested.147- Do not introduce a new WPF framework, MVVM toolkit, DI container, state-management library, or persistence technology when an existing repository mechanism can satisfy the requirement.148- Do not rewrite working XAML or code simply to make it stylistically different.149- When multiple designs are viable, prefer the one that best matches surrounding code and minimizes long-term surprise.150- Preserve backward compatibility unless the requirement explicitly permits a breaking change.