Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 28, 2025

This PR implements comprehensive Copilot instructions for the Zephyr repository as requested in issue #XX. The instructions are designed to help AI-assisted development maintain consistency with Zephyr's established patterns and architecture.

What's Added

A new .github/copilot-instructions.md file that provides:

Project-Specific Guidance

  • Architecture Overview: Detailed explanation of Zephyr's modular design with modules, profiles, and the zephyrctl controller
  • Directory Structure: Clear mapping of how components are organized across bin/, profiles/, and category-based module directories
  • Core Components: Documentation of key files like zephyrctl, library.sh, bootstrap.sh, and the module ecosystem

Development Standards

  • Bash Scripting Guidelines: Strict mode usage (set -eufo pipefail), consistent function naming (kebab-case), and proper error handling
  • Module Development Patterns: Standardized templates and best practices for creating new customization modules
  • Configuration Management: How to properly handle INI-style configs, global/local variants, and profile inheritance

Quality Assurance

  • Testing Requirements: Integration with existing CI pipeline, idempotent module design, and the dual-pass testing approach
  • Security Practices: Safe privilege management, input validation, and secure temporary file handling
  • Output Consistency: Proper use of print-status, print-error, and other library functions for uniform user experience

Practical Examples

The instructions include working code templates based on actual repository patterns:

# Proper module structure with error handling
source "${PROJECT_ROOT}/bin/bootstrap.sh"
check-not-root

if ! is-empty-section "${config_file}" "section_name"; then
    for line in $(cfg-read "${config_file}" "section_name"); do
        # Process configuration...
    done
fi

Why This Matters

Zephyr is a sophisticated Ubuntu customization framework with specific architectural patterns and conventions. These instructions ensure that AI-assisted development:

  1. Maintains Consistency: Follows established naming, structure, and coding patterns
  2. Preserves Security: Respects privilege boundaries and safe file handling practices
  3. Supports Maintainability: Uses the existing library functions and testing infrastructure
  4. Enhances User Experience: Maintains consistent output formatting and error handling

The instructions are tailored specifically to Zephyr's Bash-based architecture and modular design, providing context that generic coding guidelines cannot offer.

Original prompt

This section details on the original issue you should resolve

<issue_title>✨ Set up Copilot instructions</issue_title>
<issue_description>Configure instructions for this repository as documented in Best practices for Copilot coding agent in your repository.

</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #215

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: semseysandor <51154903+semseysandor@users.noreply.github.com>
Copilot AI changed the title [WIP] ✨ Set up Copilot instructions ✨ Set up Copilot instructions for Zephyr repository Sep 28, 2025
Copilot AI requested a review from semseysandor September 28, 2025 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Set up Copilot instructions

2 participants