agentleFS
habitat-shhabitat-sh/habitat/.github/copilot-instructions.md

habitat

Copilot instructions2.8k starsChanged 7 years agoApache-2.0View on GitHub

Habitat is Chef's application automation framework that builds, deploys, and manages the applications. This repository contains the core Habitat components written primarily in Rust. 🚨 NEVER MODIFY THESE FILES: - .expeditor/config.yml - This controls the release pipeline - Files in .expeditor/scripts/ unless specifically requested - POWERSHELLVERSION file - This is managed by the release process - RUSTNIGHTLYVERSION file - This is managed by the release process - RUSTFORMATVERSION file - This is managed by the release process - VERSION file…

  • Commits and pushes

We split this copilot-instructions.md into the rules it gives an agent

34 rules. About 2 are common, 24 are distinctive, and 8 are very specific to this project.

  • β‰ˆ2

    Common Β· estimate

    Many files like this have a rule of this kind.

  • β‰ˆ24

    Distinctive Β· estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When a Jira ID is provided:

    line 52
  2. Distinctive:

    Fetch Jira Details: Use the atlassian-mcp-server to fetch issue details

    line 54
  3. Distinctive:

    Read the Jira story thoroughly

    line 61
  4. Very specific:

    Follow Rust best practices and Habitat coding standards

    line 77
  5. Common:

    Ensure thread safety and error handling

    line 78
  6. Distinctive:

    Use appropriate logging levels

    line 79
  7. Distinctive:

    Follow existing patterns in the codebase

    line 80
  8. Distinctive:

    Create comprehensive unit tests for new functionality

    line 83
  9. Distinctive:

    Ensure test coverage remains > 80%

    line 84
  10. Distinctive:

    Use existing test patterns and utilities

    line 85
  11. Common:

    Test error conditions and edge cases

    line 86
  12. Distinctive:

    Run relevant integration tests

    line 89
  13. Distinctive:

    Verify compatibility with existing functionality

    line 90
  14. Distinctive:

    Code Coverage: Verify coverage is > 80%

    line 94
  15. Distinctive:

    Branch Creation: Use Jira ID as branch name

    line 113
  16. Distinctive:

    After successful PR creation, you MUST update the JIRA ticket to indicate AI assistance was used:

    line 157
  17. Very specific:

    Use Atlassian MCP Server: Use the mcp_atlassian-mcp_editJiraIssue tool to update the ticket

    line 159
  18. Very specific:

    Target Field: Update customfield_11170 ("Does this Work Include AI Assisted Code?")

    line 160
  19. Very specific:

    Correct Format: Use exact format {"customfield_11170": {"value": "Yes"}}

    line 162
  20. Distinctive:

    After each step, provide:

    line 179
  21. Very specific:

    Use #[derive(Debug)] for structs

    line 213
  22. Very specific:

    Use serde for serialization when needed

    line 215
  23. Distinctive:

    Follow naming conventions (snake_case for functions/variables)

    line 216
  24. Distinctive:

    Test both success and failure cases

    line 222
  25. Distinctive:

    Add rustdoc comments for public APIs

    line 225
  26. Distinctive:

    Update relevant markdown documentation

    line 226
  27. Distinctive:

    When working with Jira issues, use the atlassian-mcp-server:

    line 270
  28. Distinctive:

    Read comments and linked issues

    line 274
  29. Distinctive:

    Add comments with implementation details

    line 279
  30. Distinctive:

    Ensure GitHub CLI is properly authenticated:

    line 283
  31. Distinctive:

    Before completing any task:

    line 295
  32. Very specific:

    Build/Release Issues: Check .expeditor/ scripts

    line 310
  33. Very specific:

    Testing: Check existing test patterns in tests/ directories

    line 312
  34. Distinctive:

    Remember: Always follow the prompt-based workflow, asking for confirmation before proceeding to each next step, and maintain the >80% test …

    line 317

β‰ˆ β€œCommon” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. β€œVery specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

GitHub Copilot Instructions for Habitat Repository

Repository Overview

Habitat is Chef's application automation framework that builds, deploys, and manages the applications. This repository contains the core Habitat components written primarily in Rust.

Repository Structure

habitat/
β”œβ”€β”€ .expeditor/                   # Build and release automation scripts
β”‚   β”œβ”€β”€ config.yml                # Expeditor configuration
β”‚   └── scripts/                  # Build, test, and release scripts
β”œβ”€β”€ .github/                      # GitHub workflows and templates
β”œβ”€β”€ components/                   # Main Habitat components
β”‚   β”œβ”€β”€ builder-api-client/       # Builder API client library
β”‚   β”œβ”€β”€ builder-api/              # Builder API service
β”‚   β”œβ”€β”€ common/                   # Shared utilities and common code
β”‚   β”œβ”€β”€ core/                     # Core Habitat functionality
β”‚   β”œβ”€β”€ hab/                      # Main hab CLI tool
β”‚   β”œβ”€β”€ launcher/                 # Habitat launcher service
β”‚   β”œβ”€β”€ pkg-export-container/     # Container export functionality
β”‚   β”œβ”€β”€ pkg-export-tar/           # Tar export functionality
β”‚   β”œβ”€β”€ plan-build/               # Plan building utilities
β”‚   β”œβ”€β”€ studio/                   # Habitat Studio environment
β”‚   └── sup/                      # Habitat Supervisor
β”œβ”€β”€ support/                      # Build support files and scripts
β”œβ”€β”€ test/                         # End-to-end tests
β”œβ”€β”€ tools/                        # Development and build tools
β”œβ”€β”€ Cargo.toml                    # Rust workspace configuration
β”œβ”€β”€ Dockerfile                    # Docker build configuration
β”œβ”€β”€ Justfile                      # Just command runner configuration
β”œβ”€β”€ Makefile                      # Build automation
└── VERSION                       # Current version number

Critical File Modification Rules

🚨 NEVER MODIFY THESE FILES:

  • .expeditor/config.yml - This controls the release pipeline
  • Files in .expeditor/scripts/ unless specifically requested
  • POWERSHELL_VERSION file - This is managed by the release process
  • RUST_NIGHTLY_VERSION file - This is managed by the release process
  • RUSTFORMAT_VERSION file - This is managed by the release process
  • VERSION file - This is managed by the release process

Task Implementation Workflow

1. Initial Setup and Jira Integration

When a Jira ID is provided:

  1. Fetch Jira Details: Use the atlassian-mcp-server to fetch issue details
    # Use MCP server to get Jira issue information
    # Read the story description, acceptance criteria, and requirements
  2. Analyze Requirements:
    • Read the Jira story thoroughly
    • Understand the scope and acceptance criteria
    • Identify which components need modification
  3. Provide Summary: Give a clear summary of what needs to be implemented

2. Pre-Implementation Analysis

  1. Component Identification: Determine which Habitat components are affected
  2. Impact Assessment: Analyze potential breaking changes
  3. Test Strategy: Plan unit tests and integration tests needed
  4. File Review: Identify files that will be modified (avoiding prohibited files)

3. Implementation Phase

  1. Code Implementation:
    • Follow Rust best practices and Habitat coding standards
    • Ensure thread safety and error handling
    • Use appropriate logging levels
    • Follow existing patterns in the codebase
  2. Unit Test Creation:
    • Create comprehensive unit tests for new functionality
    • Ensure test coverage remains > 80%
    • Use existing test patterns and utilities
    • Test error conditions and edge cases
  3. Integration Testing:
    • Run relevant integration tests
    • Verify compatibility with existing functionality

4. Quality Assurance

  1. Code Coverage: Verify coverage is > 80%
    cargo tarpaulin --out html --output-dir coverage/
  2. Linting and Formatting:
    cargo clippy --all-targets --all-features
    cargo fmt --check
  3. Build Verification:
    cargo build --all-targets
    cargo test --all

5. Git Workflow, PR Creation, and Description

  1. Branch Creation: Use Jira ID as branch name
    git checkout -b <JIRA-ID>
  2. Commit Changes:
    git add .
    git commit -s -m "<JIRA-ID>: Brief description of changes"
  3. Push and Create PR:
    git push origin <JIRA-ID>
    gh pr create --title "<JIRA-ID>: Brief title" --body "<HTML formatted description>" --label "ai-assisted"
  4. PR Description Format (HTML):
    <h2>Summary</h2>
    <p>Brief description of changes made</p>
    
    <h2>Changes Made</h2>
    <ul>
      <li>Change 1</li>
      <li>Change 2</li>
    </ul>
    
    <h2>Testing</h2>
    <ul>
      <li>Unit tests added/updated</li>
      <li>Integration tests verified</li>
      <li>Coverage maintained > 80%</li>
    </ul>
    
    <h2>AI Assistance</h2>
    <p>This work was completed with AI assistance following Progress AI policies</p>
    
    <h2>Jira Link</h2>
    <p><a href="link-to-jira-issue">JIRA-ID</a></p>

6. Update JIRA Ticket (MANDATORY)

After successful PR creation, you MUST update the JIRA ticket to indicate AI assistance was used:

  1. Use Atlassian MCP Server: Use the mcp_atlassian-mcp_editJiraIssue tool to update the ticket
  2. Target Field: Update customfield_11170 ("Does this Work Include AI Assisted Code?")
  3. Required Value: Set to "Yes"
  4. Correct Format: Use exact format {"customfield_11170": {"value": "Yes"}}
  5. Verification: Confirm the field update was successful

Example MCP Call:

mcp_atlassian-mcp_editJiraIssue with:
- cloudId: [your-atlassian-cloud-id]
- issueIdOrKey: [JIRA-ID]  
- fields: {"customfield_11170": {"value": "Yes"}}

CRITICAL: This step is mandatory for all AI-assisted work and must be completed before declaring the task finished.

Prompt-Based Workflow

Step-by-Step Process

After each step, provide:

  1. Summary of completed step
  2. Next step description
  3. Remaining steps overview
  4. Prompt asking if you want to continue

Example format:

βœ… **Step X Completed**: [Description of what was done]

πŸ”„ **Next Step**: [Description of next step]

πŸ“‹ **Remaining Steps**:
- Step Y: [Description]
- Step Z: [Description]

❓ **Ready to continue with the next step?** (Yes/No)

Complete Workflow Example

  1. Jira Analysis β†’ Summary + "Continue with component analysis?"
  2. Component Analysis β†’ Summary + "Continue with implementation?"
  3. Implementation β†’ Summary + "Continue with testing?"
  4. Testing β†’ Summary + "Continue with quality checks?"
  5. Quality Assurance β†’ Summary + "Continue with PR creation?"
  6. PR Creation β†’ Summary + "Continue with JIRA update?"
  7. JIRA Update β†’ Summary + "Task completed!"

Development Guidelines

Code Standards

  1. Rust Best Practices:
    • Use #[derive(Debug)] for structs
    • Implement proper error handling with Result<T, E>
    • Use serde for serialization when needed
    • Follow naming conventions (snake_case for functions/variables)
  2. Testing Standards:
    • Unit tests in the same file as implementation (when appropriate)
    • Integration tests in tests/ directory
    • Mock external dependencies
    • Test both success and failure cases
  3. Documentation:
    • Add rustdoc comments for public APIs
    • Update relevant markdown documentation
    • Include examples in documentation when helpful

Environment Setup

  1. Required Tools:
    # Ensure these are installed
    rustc --version  # Rust compiler
    cargo --version  # Cargo package manager
    hab --version    # Habitat CLI
    gh --version     # GitHub CLI
  2. Build Environment:
    # Set up development environment
    export HAB_LICENSE=accept-no-persist
    export RUST_LOG=debug

Testing Commands

# Run all tests
cargo test --all

# Run specific component tests
cargo test -p habitat_core

# Run with coverage
cargo tarpaulin --all --out html

# Lint code
cargo clippy --all-targets --all-features

# Format code
cargo fmt

MCP Server Integration

Atlassian MCP Server

When working with Jira issues, use the atlassian-mcp-server:

  1. Fetch Issue Details:
    • Get issue summary, description, and acceptance criteria
    • Read comments and linked issues
    • Understand priority and labels
  2. Update Issue Status (if required):
    • Transition issue status as work progresses
    • Add comments with implementation details

GitHub CLI Configuration

Ensure GitHub CLI is properly authenticated:

# Check authentication status
gh auth status

# Login if needed (without .profile references)
gh auth login --web

Final Checklist

Before completing any task:

  • Jira issue requirements fully understood and implemented
  • No prohibited files modified
  • Unit tests created with >80% coverage
  • All tests passing
  • Code properly formatted and linted
  • Branch created with Jira ID
  • PR created with HTML description and "ai-assisted" label
  • JIRA ticket updated with customfield_11170 set to "Yes"
  • All steps completed with user confirmation

Emergency Contacts

For questions about:

  • Build/Release Issues: Check .expeditor/ scripts
  • Component Architecture: Review components/ README files
  • Testing: Check existing test patterns in tests/ directories
  • Habitat Concepts: Review documentation in components/docs-chef-io/

Remember: Always follow the prompt-based workflow, asking for confirmation before proceeding to each next step, and maintain the >80% test coverage requirement throughout development.

Download now (ZIP)

Trending

Quiet since June.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the habitat-sh/habitat repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about habitat-sh/habitat

The biggest 5 of 35 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 35

Talked about on GitHub and Hacker News (35 times).

On GitHub Β· 34

29 more on GitHub

On Hacker News Β· 1

  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.