Instruction file imported from rjmurillo/moq.analyzers (
.github/instructions/json.instructions.md). Copyright stays with the author.
JSON File Instructions (Quick Reference)
- Read this file before editing any .json file
- Cross-reference with related instruction files
- Complete the Validation Checklist before submitting
- Stop and request help if uncertain
Context Loading for Copilot
When working on this file type, you MUST:
- Read this entire instruction file before making any changes
- Cross-reference with related instruction files (listed below)
- Validate your understanding by checking the "Validation Checklist" section
- If uncertain about any requirement, stop and request clarification
Related Instruction Files:
- project.instructions.md - For project and build configuration
- yaml.instructions.md - For CI/CD workflows
- text.instructions.md - For plain text configuration
Validation Checklist
Before submitting any changes, verify:
Configuration:
- JSON syntax is valid
- Schema compliance is maintained
- All configuration standards followed
- Security scan completed after dependency changes
Process:
- Conventional commit format used
- PR description includes validation evidence
- All checklist items completed
- No breaking changes introduced (or documented if necessary)
Decision Trees
When to Request Human Review
- Is this a new configuration standard? → Yes → Request expert guidance
- Is this a breaking change to configuration? → Yes → Document thoroughly and request review
- Are you uncertain about JSON schema or configuration? → Yes → Stop and request guidance
When to Stop and Ask for Help
- Uncertain about configuration requirements
- Major changes to project configuration
- Security or legal implications
Common Mistakes to Avoid
DO NOT:
- Skip validation steps
- Ignore security scanning after dependency changes
- Submit changes without validation evidence
ALWAYS:
- Read the entire instruction file first
- Validate all configuration changes
- Include comprehensive documentation updates
- Document all changes thoroughly
Context Management
Before Starting:
- Read the complete instruction file
- Understand the current file's purpose and structure
- Identify all related files that may need updates
During Editing:
- Keep track of all changes made
- Validate each change against requirements
- Maintain consistency with existing patterns
After Completing:
- Review all changes against the validation checklist
- Ensure all requirements are met
- Prepare comprehensive PR description with evidence
Handling Uncertainty
Stop and Request Help When:
- You cannot explain your approach clearly
- You're making "educated guesses" about configuration
- You're uncertain about project configuration
- You cannot trace the logic in configuration without narration
Escalation Process:
- Stop all work immediately
- Document what you were trying to accomplish
- Explain what specific aspect is unclear
- Request expert guidance with specific questions
- Do not proceed until you have clear, confident understanding
Success Criteria
Your changes are successful when:
- All configuration validation checks pass
- Security scan is clean
- PR description is complete and accurate
- All checklist items completed
- No automated bot feedback ignored
Configuration Standards
JSON Formatting
- Use consistent indentation (2 spaces recommended)
- Follow JSON schema standards where applicable
- Ensure valid JSON syntax
- Use descriptive property names
- Maintain consistent structure across similar files
Configuration File Types
This repository contains several types of JSON configuration files:
- version.json - Version management
- renovate.json - Dependency management
- nuget.config - NuGet package configuration
- global.json - .NET SDK configuration
- Moq.Analyzers.lutconfig - Project-specific configuration
Version Management
version.json Requirements
- Follow semantic versioning principles
- Update version numbers appropriately for changes
- Ensure version consistency across all project files
- Document version changes in release notes
Version Update Guidelines
When updating version numbers:
- Check current version in version.json
- Determine appropriate version increment based on change type
- Update all related files that reference version
- Update release notes in AnalyzerReleases.Unshipped.md
- Test build process with new version
Dependency Management
renovate.json Configuration
- Configure appropriate update schedules
- Set dependency update policies
- Include security scanning requirements
- Configure automated testing for updates
Dependency Update Guidelines
For Renovate PRs:
- Review changelog and release notes
- Test locally to ensure compatibility
- Check for breaking changes
- Verify all tests pass with new dependency
- Include testing evidence in PR description
For Manual Dependency Updates:
- Follow the same process as automated updates
- Document the reason for the update
- Include compatibility testing results
Security Considerations
- All dependency updates require security scanning
- Run Trivy scan after dependency changes
- Address any security vulnerabilities before merging
- Document security implications in PR description
Build Configuration
global.json Requirements
- Specify correct .NET SDK version
- Ensure compatibility with target framework (.NET 9)
- Maintain consistent SDK version across development team
- Update when new SDK versions are required
NuGet Configuration
- Configure appropriate package sources
- Set package restore policies
- Ensure secure package sources
- Configure package signing where applicable
Code Quality Standards
Required Checks
Before submitting a PR, ensure your changes pass all quality checks:
- JSON Validation: Ensure valid JSON syntax
- Schema Compliance: Follow JSON schema where applicable
- Formatting: Use consistent formatting
- Testing: Verify configuration changes work as expected
- Documentation: Update relevant documentation
Configuration Validation
- JSON Syntax: Validate JSON syntax using appropriate tools
- Schema Compliance: Ensure compliance with JSON schemas
- Functionality: Test that configuration changes work as expected
- Documentation: Update documentation for configuration changes
Git Commit Messages
Guidelines
- Capitalization and Punctuation: Capitalize the first word and do not end in punctuation. If using Conventional Commits, remember to use all lowercase.
- Mood: Use imperative mood in the subject line.
- Type of Commit: Specify the type of commit using conventional commit types.
- Length: The first line should ideally be no longer than 50 characters, and the body should be restricted to 72 characters.
- Content: Be direct, try to eliminate filler words and phrases.
Conventional Commits
Follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksci: CI/CD changesperf: Performance improvementsbuild: Build system changes
Pull Request Guidelines
PR Title and Description
Title Format:
Follow conventional commit format: type(scope): description
Description Requirements:
- Clear summary of changes
- Problem statement (what issue does this solve?)
- Solution description (how does this solve the problem?)
- Validation evidence (how was this tested?)
- Related issues (link to GitHub issues)
- Breaking changes (if any)
Required PR Checklist
Before submitting a PR, ensure:
- JSON syntax is valid
- Configuration changes work as expected
- Documentation is updated
- Security implications are considered
- CI checks pass
- PR description includes validation evidence
Validation Evidence Requirements
What Constitutes Validation Evidence:
- JSON validation output
- Configuration testing results
- Screenshots of successful CI runs
- Manual testing results for configuration changes
Evidence Format:
- Include validation logs, screenshots, or links to CI runs
- Provide clear, readable evidence
- Ensure evidence is recent and relevant
- Link to specific test results or validation output
Review Process
What Maintainers Look For
Maintainers will review PRs for:
- Code Quality: Adherence to project standards
- Configuration Accuracy: Proper configuration settings
- Documentation: Proper documentation updates
- Security: No security vulnerabilities introduced
- Validation: Proper evidence of testing and validation
Review Timeline
- Initial review: Within 2-3 business days
- Follow-up reviews: Within 1-2 business days after changes
- Final approval: After all concerns are addressed
Formatting and Linting
- You must address all feedback from automated bots (e.g., JSON linters, formatting bots) as you would human reviewers.
- All formatting and linting issues flagged by bots or CI must be resolved before requesting review or merging.
- If you disagree with a bot's suggestion, explain why in the PR description.
- If a bot's feedback is not addressed and a human reviewer must repeat the request, the PR will be closed until all automated feedback is resolved.
Test Data & Sample Inputs/Outputs
What Constitutes Good JSON Test Data?
- Validate against schema (if available)
- Include both valid and invalid examples
- Test for missing required fields, extra fields, and type mismatches
- Check for correct handling of comments (if allowed)
Example: Valid Config
{
"settingA": true,
"maxItems": 10
}
Example: Negative/Edge Case
{
"settingA": "yes",
"maxItems": null
}
Coverage Strategy
- For every config change, validate with schema and test both valid and invalid cases
- Document test data rationale in comments or PR description
Code of Conduct
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.