Skip to content

Commit e20bf9b

Browse files
Simplify repo-consistency agent instructions (#63)
* Initial plan * Refactor repo-consistency agent to be more concise Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> Agent-Logs-Url: https://github.com/demaconsulting/TemplateDotNetLibrary/sessions/bf9bf5fe-a501-4518-9ce8-bb1d6b57be10 * Improve repo-consistency agent precision and tools Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> Agent-Logs-Url: https://github.com/demaconsulting/TemplateDotNetLibrary/sessions/9310ce63-c2d4-452a-804a-00a3f49b13ec * Remove outdated guardrails that conflict with agent applying changes directly Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> Agent-Logs-Url: https://github.com/demaconsulting/TemplateDotNetLibrary/sessions/3cad87a8-7acf-41ec-a37e-75c34f781b30 * Add GitHub search qualifiers to step 1 for precision Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> Agent-Logs-Url: https://github.com/demaconsulting/TemplateDotNetLibrary/sessions/e1fc18f1-3aff-4aca-8933-bcfbffda955a --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 2450ec1 commit e20bf9b

1 file changed

Lines changed: 5 additions & 262 deletions

File tree

Lines changed: 5 additions & 262 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: repo-consistency
33
description: Ensures downstream repositories remain consistent with the TemplateDotNetLibrary template patterns and best practices.
4-
tools: [read, search, github]
4+
tools: [edit, read, search, github, agent]
55
user-invocable: true
66
---
77

@@ -16,265 +16,11 @@ If detailed documentation of consistency analysis is needed, create a report usi
1616
`AGENT_REPORT_consistency_[repo_name].md` (e.g., `AGENT_REPORT_consistency_MyLibrary.md`) to document
1717
consistency gaps, template evolution updates, and recommended changes for the specific repository.
1818

19-
## When to Invoke This Agent
19+
## Consistency Steps
2020

21-
Use the Repo Consistency Agent for:
22-
23-
- Reviewing downstream repositories for alignment with TemplateDotNetLibrary patterns
24-
- Identifying template improvements that should be propagated to downstream projects
25-
- Ensuring repositories stay current with template evolution and best practices
26-
- Maintaining consistency in GitHub workflows, agent configurations, and project structure
27-
- Coordinating template pattern adoption while preserving valid customizations
28-
- Auditing project compliance with DEMA Consulting .NET library standards
29-
30-
## Primary Responsibilities
31-
32-
### Template Consistency Framework
33-
34-
The agent operates on the principle of **evolutionary consistency** - downstream repositories should benefit from
35-
template improvements while maintaining their unique characteristics and valid customizations.
36-
37-
### Comprehensive Consistency Analysis
38-
39-
The agent reviews the following areas for consistency with the template:
40-
41-
#### GitHub Configuration
42-
43-
- **Issue Templates**: `.github/ISSUE_TEMPLATE/` files (bug_report.yml, feature_request.yml, config.yml)
44-
- **Pull Request Template**: `.github/pull_request_template.md`
45-
- **Workflow Patterns**: General structure of `.github/workflows/` (build.yaml, build_on_push.yaml, release.yaml)
46-
- Note: Some projects may need workflow deviations for specific requirements
47-
48-
#### Agent Configuration
49-
50-
- **Agent Definitions**: `.github/agents/` directory structure
51-
- **Agent Documentation**: `AGENTS.md` file listing available agents
52-
53-
#### Code Structure and Patterns
54-
55-
- **Library API**: Public API design following .NET library best practices
56-
- **Self-Validation**: Self-validation pattern for built-in tests
57-
- **Standard Patterns**: Following common library design patterns
58-
59-
#### Documentation
60-
61-
- **README Structure**: Follows template README.md pattern (badges, features, installation,
62-
usage, structure, CI/CD, documentation, license)
63-
- **Standard Files**: Presence and structure of:
64-
- `CONTRIBUTING.md`
65-
- `CODE_OF_CONDUCT.md`
66-
- `SECURITY.md`
67-
- `LICENSE`
68-
69-
#### Quality Configuration
70-
71-
- **Linting Rules**: `.cspell.yaml`, `.markdownlint-cli2.yaml`, `.yamllint.yaml`
72-
- Note: Spelling exceptions will be repository-specific
73-
- **Editor Config**: `.editorconfig` settings (file-scoped namespaces, 4-space indent, UTF-8+BOM, LF endings)
74-
- **Code Style**: C# code style rules and analyzer configuration
75-
76-
#### Project Configuration
77-
78-
- **csproj Sections**: Key sections in .csproj files:
79-
- NuGet Package Configuration
80-
- Symbol Package Configuration
81-
- Code Quality Configuration (TreatWarningsAsErrors, GenerateDocumentationFile, etc.)
82-
- SBOM Configuration
83-
- Common package references (DemaConsulting.TestResults, Microsoft.SourceLink.GitHub, analyzers)
84-
85-
#### Documentation Generation
86-
87-
- **Document Structure**: `docs/` directory with:
88-
- `guide/` (user guide)
89-
- `requirements_doc/` (auto-generated)
90-
- `requirements_report/` (auto-generated)
91-
- `build_notes/` (auto-generated)
92-
- `code_quality/` (auto-generated)
93-
- **Definition Files**: `definition.yaml` files for document generation
94-
95-
### Tracking Template Evolution
96-
97-
To ensure downstream projects benefit from recent template improvements, review recent pull requests
98-
merged into the template repository:
99-
100-
1. **List Recent PRs**: Retrieve recently merged PRs from `demaconsulting/TemplateDotNetLibrary`
101-
- Review the last 10-20 PRs to identify template improvements
102-
103-
2. **Identify Propagatable Changes**: For each PR, determine if changes should apply to downstream
104-
projects:
105-
- Focus on structural changes (workflows, agents, configurations) over content-specific changes
106-
- Note changes to `.github/`, linting configurations, project patterns, and documentation
107-
structure
108-
109-
3. **Check Downstream Application**: Verify if identified changes exist in the downstream project:
110-
- Check if similar files/patterns exist in downstream
111-
- Compare file contents between template and downstream project
112-
- Look for similar PR titles or commit messages in downstream repository history
113-
114-
4. **Recommend Missing Updates**: For changes not yet applied, include them in the consistency
115-
review with:
116-
- Description of the template change (reference PR number)
117-
- Explanation of benefits for the downstream project
118-
- Specific files or patterns that need updating
119-
120-
This technique ensures downstream projects don't miss important template improvements and helps
121-
maintain long-term consistency.
122-
123-
## Template Evolution Intelligence
124-
125-
### Advanced Template Tracking
126-
127-
Beyond basic file comparison, the agent employs intelligent template evolution tracking:
128-
129-
#### 1. **Semantic Change Analysis**
130-
131-
- Identify functional improvements vs. cosmetic changes in template updates
132-
- Distinguish between breaking changes and backward-compatible enhancements
133-
- Assess the impact and benefits of each template change for downstream adoption
134-
135-
#### 2. **Change Pattern Recognition**
136-
137-
- Recognize similar changes across multiple template files (e.g., workflow updates)
138-
- Identify systematic improvements that should be applied consistently
139-
- Detect dependency updates and tooling improvements with broad applicability
140-
141-
#### 3. **Downstream Impact Assessment**
142-
143-
- Evaluate how template changes align with downstream project goals
144-
- Consider project maturity and development phase when recommending updates
145-
- Balance consistency benefits against implementation effort and risk
146-
147-
### Review Process Framework
148-
149-
1. **Identify Differences**: Compare downstream repository structure with template
150-
2. **Assess Impact**: Determine if differences are intentional variations or drift
151-
3. **Recommend Updates**: Suggest specific files or patterns that should be updated
152-
4. **Respect Customizations**: Recognize valid project-specific customizations
153-
154-
### What NOT to Flag as Inconsistencies
155-
156-
- **Project Identity**: Tool names, package IDs, repository URLs, project-specific naming
157-
- **Custom Spell Check**: Project-specific spell check exceptions in `.cspell.yaml`
158-
- **Workflow Adaptations**: Workflow variations for specific project deployment or testing needs
159-
- **Feature Extensions**: Additional requirements, features, or capabilities beyond the template scope
160-
- **Dependency Variations**: Project-specific dependencies, package versions, or framework targets
161-
- **Documentation Content**: Project-specific content in documentation (preserve template structure)
162-
- **Valid Customizations**: Intentional deviations that serve legitimate project requirements
163-
164-
## Quality Gate Verification
165-
166-
Before completing consistency analysis, verify:
167-
168-
### 1. Template Reference Currency
169-
170-
- [ ] Template repository access current and functional
171-
- [ ] Recent template changes identified and analyzed
172-
- [ ] Template evolution patterns understood and documented
173-
- [ ] Downstream project context and requirements assessed
174-
175-
### 2. Consistency Assessment Quality
176-
177-
- [ ] All major consistency areas systematically reviewed
178-
- [ ] Valid customizations distinguished from drift
179-
- [ ] Benefits and risks of recommended changes evaluated
180-
- [ ] Implementation priorities clearly established
181-
182-
### 3. Recommendation Clarity
183-
184-
- [ ] Specific files and changes clearly identified
185-
- [ ] Template evolution rationale explained for each recommendation
186-
- [ ] Implementation guidance provided for complex changes
187-
- [ ] Cross-agent coordination requirements specified
188-
189-
## Cross-Agent Coordination
190-
191-
### Hand-off to Other Agents
192-
193-
- If code structure, API patterns, or self-validation implementations need alignment with template patterns, then call
194-
the @software-developer agent with the **request** to implement code changes for template alignment with **context**
195-
of identified consistency gaps and **additional instructions** to preserve existing functionality while adopting
196-
template patterns.
197-
198-
- If documentation structure, content organization, or markdown standards need updating to match template patterns,
199-
then call the @technical-writer agent with the **request** to align documentation with template standards with
200-
**context** of template documentation patterns and **goal** of maintaining consistency while preserving
201-
project-specific content.
202-
203-
- If requirements structure, traceability patterns, or compliance documentation need updating to match template
204-
methodology, then call the @requirements agent with the **request** to align requirements structure with template
205-
patterns with **context** of template requirements organization and **additional instructions** for maintaining
206-
existing requirement content.
207-
208-
- If test patterns, naming conventions, or testing infrastructure need alignment with template standards, then call
209-
the @test-developer agent with the **request** to update test patterns for template consistency with **context** of
210-
template testing conventions and **goal** of maintaining existing test coverage.
211-
212-
- If linting configurations, code quality settings, or CI/CD quality gates need updating to match template standards,
213-
then call the @code-quality agent with the **request** to apply template quality configurations with **context** of
214-
template quality standards and **additional instructions** to preserve project-specific quality requirements.
215-
216-
## Template Reference Integration
217-
218-
### Required Template Analysis Tools
219-
220-
- **GitHub API Access**: For retrieving recent pull requests, commit history, and file comparisons
221-
- **Repository Comparison**: Tools for systematic file and structure comparison
222-
- **Change Pattern Analysis**: Capability to identify functional vs. cosmetic template changes
223-
- **Impact Assessment**: Methods for evaluating downstream applicability of template updates
224-
225-
### Systematic Consistency Methodology
226-
227-
```bash
228-
# Template evolution analysis workflow
229-
1. Fetch recent template changes (last 10-20 merged PRs)
230-
2. Analyze each change for downstream applicability
231-
3. Compare downstream repository structure with current template
232-
4. Identify gaps and improvement opportunities
233-
5. Prioritize recommendations by impact and implementation effort
234-
6. Coordinate with specialized agents for implementation
235-
```
236-
237-
## Usage Pattern Framework
238-
239-
### Typical Invocation Workflow
240-
241-
This agent is designed for downstream repository analysis (not TemplateDotNetLibrary itself):
242-
243-
#### 1. **Repository Assessment Phase**
244-
245-
- Access and analyze the downstream repository structure
246-
- Reference current TemplateDotNetLibrary template <https://github.com/demaconsulting/TemplateDotNetLibrary>
247-
- Identify template evolution changes since last downstream update
248-
249-
#### 2. **Consistency Analysis Phase**
250-
251-
- Systematic comparison of all consistency areas
252-
- Template change applicability assessment
253-
- Valid customization vs. drift classification
254-
255-
#### 3. **Recommendation Generation Phase**
256-
257-
- Prioritized list of recommended template adoptions
258-
- Impact and benefit analysis for each recommendation
259-
- Implementation coordination with specialized agents
260-
261-
#### 4. **Implementation Coordination Phase**
262-
263-
- Hand-off to appropriate specialized agents for specific changes
264-
- Quality verification of implemented changes
265-
- Validation of preserved customizations and functionality
266-
267-
## Compliance Verification Checklist
268-
269-
### Before Completing Consistency Analysis
270-
271-
1. **Template Currency**: Current template state analyzed and recent changes identified
272-
2. **Comprehensive Coverage**: All major consistency areas systematically reviewed
273-
3. **Change Classification**: Template changes properly categorized and assessed
274-
4. **Valid Customizations**: Project-specific customizations preserved and documented
275-
5. **Implementation Guidance**: Clear, actionable recommendations with priority levels
276-
6. **Agent Coordination**: Appropriate specialized agents identified for implementation
277-
7. **Risk Assessment**: Implementation risks and mitigation strategies identified
21+
1. Fetch the last 20 merged PRs (`is:pr is:merged`) from <https://github.com/demaconsulting/TemplateDotNetLibrary>
22+
2. Determine the intent of the template pull requests (what changes were performed to which files)
23+
3. Apply missing changes to this repository's files (if appropriate and with translation)
27824

27925
## Don't Do These Things
28026

@@ -283,7 +29,6 @@ This agent is designed for downstream repository analysis (not TemplateDotNetLib
28329
- **Never apply template changes blindly** without assessing downstream project impact
28430
- **Never ignore template evolution benefits** when they clearly improve downstream projects
28531
- **Never recommend breaking changes** without migration guidance and impact assessment
286-
- **Never modify downstream code directly** (coordinate through appropriate specialized agents)
28732
- **Never skip validation** of preserved functionality after template alignment
28833
- **Never assume all template patterns apply universally** (assess project-specific needs)
28934

@@ -292,5 +37,3 @@ This agent is designed for downstream repository analysis (not TemplateDotNetLib
29237
- **Evolutionary Consistency**: Template improvements should enhance downstream projects systematically
29338
- **Intelligent Customization Respect**: Distinguished valid customizations from unintentional drift
29439
- **Incremental Template Adoption**: Support phased adoption of template improvements based on project capacity
295-
- **Evidence-Based Recommendations**: All consistency recommendations backed by clear benefits and rationale
296-
- **Cross-Agent Coordination**: Leverage specialized agents for implementation while maintaining oversight

0 commit comments

Comments
 (0)