Instruction file imported from rjmurillo/moq.analyzers (
.github/instructions/yaml.instructions.md). Copyright stays with the author.
YAML File Instructions (Quick Reference)
- Read this file before editing any .yml or .yaml 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
- json.instructions.md - For configuration files
- shell.instructions.md - For scripts used in workflows
Validation Checklist
Before submitting any changes, verify:
Workflow & Security:
- YAML syntax is valid
- All workflow requirements met
- Security scan completed after dependency changes
- Performance impact assessed
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 CI/CD workflow? → Yes → Request expert guidance
- Is this a breaking change to workflow or security? → Yes → Document thoroughly and request review
- Are you uncertain about workflow or security requirements? → Yes → Stop and request guidance
When to Stop and Ask for Help
- Uncertain about workflow or security requirements
- Major changes to CI/CD process
- 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 workflow and security 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 workflow or security
- You're uncertain about CI/CD process
- You cannot trace the logic in workflow 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 workflow and security validation checks pass
- Security scan is clean
- PR description is complete and accurate
- All checklist items completed
- No automated bot feedback ignored
CI/CD Workflow Requirements
Workflow Configuration Standards
- Use consistent YAML formatting and indentation
- Follow GitHub Actions best practices
- Ensure proper workflow syntax
- Use descriptive job and step names
- Maintain consistent structure across workflows
CI Workflow Requirements
When making CI/CD changes:
- Test locally first: Ensure workflows run successfully locally
- Include validation evidence: Provide logs or screenshots showing successful execution
- Update documentation: Document new CI features or changes
- Consider performance impact: Ensure changes don't significantly impact CI duration
Workflow Validation
Before submitting CI/CD changes:
- Syntax Validation: Ensure YAML syntax is correct
- Local Testing: Test workflows locally when possible
- Performance Impact: Assess impact on CI duration
- Security Review: Ensure no security vulnerabilities are introduced
- Documentation Update: Update relevant documentation
Performance Testing Guidelines
When Performance Testing is Required
- New analyzers or fixers
- Changes to existing analyzer logic
- Dependency updates that might affect performance
- CI/CD changes that impact build times
Performance Testing Process
- Run benchmarks locally using
dotnet run --project tests/Moq.Analyzers.Benchmarks/ - Compare results against baseline
- Document any performance regressions or improvements
- Include benchmark results in PR description
Performance Validation Evidence
- Benchmark output showing no significant regressions
- Comparison with previous baseline results
- Explanation of any performance changes
Security Considerations
Security Scanning Requirements
- All dependency updates require security scanning
- Run Trivy scan after dependency changes
- Address any security vulnerabilities before merging
- Document security implications in PR description
Security Workflow Configuration
- Configure security scanning in CI/CD workflows
- Set up automated vulnerability detection
- Ensure proper security reporting
- Configure security alerts and notifications
Code Quality Standards
Required Checks
Before submitting a PR, ensure your changes pass all quality checks:
- YAML Validation: Ensure valid YAML syntax
- Workflow Testing: Test workflows locally when possible
- Performance Impact: Assess impact on CI duration
- Security Review: Ensure no security vulnerabilities
- Documentation: Update relevant documentation
YAML-Specific Requirements
- Use consistent indentation (2 spaces recommended)
- Follow YAML best practices
- Ensure proper syntax and structure
- Use descriptive names for jobs, steps, and variables
- Maintain consistent formatting across workflows
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:
- YAML syntax is valid
- Workflows work as expected
- Documentation is updated
- Performance impact is assessed
- Security implications are considered
- CI checks pass
- PR description includes validation evidence
Validation Evidence Requirements
What Constitutes Validation Evidence:
- YAML validation output
- Workflow execution logs
- Performance benchmark results
- Screenshots of successful CI runs
- Manual testing results for workflow changes
Evidence Format:
- Include 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
- Workflow Accuracy: Proper workflow configuration
- Documentation: Proper documentation updates
- Performance: No significant performance regressions
- 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
Common Review Feedback
Frequently Requested Changes:
- Add missing workflow validation
- Update documentation for new workflows
- Improve error handling and logging
- Add performance benchmarks for new workflows
- Clarify PR description or validation evidence
PRs That May Be Rejected:
- Missing validation evidence
- Incomplete workflow testing
- Performance regressions without justification
- Security vulnerabilities
- Insufficient documentation updates
Formatting and Linting
- You must address all feedback from automated bots (e.g., YAML 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.
Workflow Best Practices
GitHub Actions Guidelines
- Use reusable workflows where appropriate
- Implement proper error handling and retry logic
- Use appropriate triggers for workflows
- Configure proper permissions for jobs
- Use caching to improve performance
Workflow Security
- Use minimal required permissions
- Avoid hardcoding secrets in workflows
- Use GitHub secrets for sensitive information
- Implement proper access controls
- Regular security reviews of workflows
Code of Conduct
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.