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
- Distinctive: line 52
When a Jira ID is provided:
- Distinctive: line 54
Fetch Jira Details: Use the atlassian-mcp-server to fetch issue details
- Distinctive: line 61
Read the Jira story thoroughly
- Very specific: line 77
Follow Rust best practices and Habitat coding standards
- Common: line 78
Ensure thread safety and error handling
- Distinctive: line 79
Use appropriate logging levels
- Distinctive: line 80
Follow existing patterns in the codebase
- Distinctive: line 83
Create comprehensive unit tests for new functionality
- Distinctive: line 84
Ensure test coverage remains > 80%
- Distinctive: line 85
Use existing test patterns and utilities
- Common: line 86
Test error conditions and edge cases
- Distinctive: line 89
Run relevant integration tests
- Distinctive: line 90
Verify compatibility with existing functionality
- Distinctive: line 94
Code Coverage: Verify coverage is > 80%
- Distinctive: line 113
Branch Creation: Use Jira ID as branch name
- Distinctive: line 157
After successful PR creation, you MUST update the JIRA ticket to indicate AI assistance was used:
- Very specific: line 159
Use Atlassian MCP Server: Use the mcp_atlassian-mcp_editJiraIssue tool to update the ticket
- Very specific: line 160
Target Field: Update customfield_11170 ("Does this Work Include AI Assisted Code?")
- Very specific: line 162
Correct Format: Use exact format {"customfield_11170": {"value": "Yes"}}
- Distinctive: line 179
After each step, provide:
- Very specific: line 213
Use #[derive(Debug)] for structs
- Very specific: line 215
Use serde for serialization when needed
- Distinctive: line 216
Follow naming conventions (snake_case for functions/variables)
- Distinctive: line 222
Test both success and failure cases
- Distinctive: line 225
Add rustdoc comments for public APIs
- Distinctive: line 226
Update relevant markdown documentation
- Distinctive: line 270
When working with Jira issues, use the atlassian-mcp-server:
- Distinctive: line 274
Read comments and linked issues
- Distinctive: line 279
Add comments with implementation details
- Distinctive: line 283
Ensure GitHub CLI is properly authenticated:
- Distinctive: line 295
Before completing any task:
- Very specific: line 310
Build/Release Issues: Check .expeditor/ scripts
- Very specific: line 312
Testing: Check existing test patterns in tests/ directories
- Distinctive: line 317
Remember: Always follow the prompt-based workflow, asking for confirmation before proceeding to each next step, and maintain the >80% test β¦
β β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.
Files
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 numberCritical File Modification Rules
π¨ NEVER MODIFY THESE FILES:
.expeditor/config.yml- This controls the release pipeline- Files in
.expeditor/scripts/unless specifically requested POWERSHELL_VERSIONfile - This is managed by the release processRUST_NIGHTLY_VERSIONfile - This is managed by the release processRUSTFORMAT_VERSIONfile - This is managed by the release processVERSIONfile - This is managed by the release process
Task Implementation Workflow
1. Initial Setup and Jira Integration
When a Jira ID is provided:
- 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 - Analyze Requirements:
- Read the Jira story thoroughly
- Understand the scope and acceptance criteria
- Identify which components need modification
- Provide Summary: Give a clear summary of what needs to be implemented
2. Pre-Implementation Analysis
- Component Identification: Determine which Habitat components are affected
- Impact Assessment: Analyze potential breaking changes
- Test Strategy: Plan unit tests and integration tests needed
- File Review: Identify files that will be modified (avoiding prohibited files)
3. Implementation Phase
- 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
- 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
- Integration Testing:
- Run relevant integration tests
- Verify compatibility with existing functionality
4. Quality Assurance
- Code Coverage: Verify coverage is > 80%
cargo tarpaulin --out html --output-dir coverage/ - Linting and Formatting:
cargo clippy --all-targets --all-features cargo fmt --check - Build Verification:
cargo build --all-targets cargo test --all
5. Git Workflow, PR Creation, and Description
- Branch Creation: Use Jira ID as branch name
git checkout -b <JIRA-ID> - Commit Changes:
git add . git commit -s -m "<JIRA-ID>: Brief description of changes" - Push and Create PR:
git push origin <JIRA-ID> gh pr create --title "<JIRA-ID>: Brief title" --body "<HTML formatted description>" --label "ai-assisted" - 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:
- Use Atlassian MCP Server: Use the
mcp_atlassian-mcp_editJiraIssuetool to update the ticket - Target Field: Update
customfield_11170("Does this Work Include AI Assisted Code?") - Required Value: Set to "Yes"
- Correct Format: Use exact format
{"customfield_11170": {"value": "Yes"}} - 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:
- Summary of completed step
- Next step description
- Remaining steps overview
- 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
- Jira Analysis β Summary + "Continue with component analysis?"
- Component Analysis β Summary + "Continue with implementation?"
- Implementation β Summary + "Continue with testing?"
- Testing β Summary + "Continue with quality checks?"
- Quality Assurance β Summary + "Continue with PR creation?"
- PR Creation β Summary + "Continue with JIRA update?"
- JIRA Update β Summary + "Task completed!"
Development Guidelines
Code Standards
- Rust Best Practices:
- Use
#[derive(Debug)]for structs - Implement proper error handling with
Result<T, E> - Use
serdefor serialization when needed - Follow naming conventions (snake_case for functions/variables)
- Use
- 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
- Documentation:
- Add rustdoc comments for public APIs
- Update relevant markdown documentation
- Include examples in documentation when helpful
Environment Setup
- Required Tools:
# Ensure these are installed rustc --version # Rust compiler cargo --version # Cargo package manager hab --version # Habitat CLI gh --version # GitHub CLI - 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 fmtMCP Server Integration
Atlassian MCP Server
When working with Jira issues, use the atlassian-mcp-server:
- Fetch Issue Details:
- Get issue summary, description, and acceptance criteria
- Read comments and linked issues
- Understand priority and labels
- 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 --webFinal 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.
Trending
Quiet since June.about the whole repository
Who's talking about habitat-sh/habitat
- koalaman/shellcheckβWarn about using `grep` outside conditionals when `set -e` is in effectβGitHub Β· Mar 29, 2018 Β· 2 reactions
- est31/cargo-udepsβCurrent implementation cannot handle multiple crates with the same `lib` nameβGitHub Β· Sep 13, 2019 Β· 1 reactions
- yoshuawuyts/crossgenβ.travis.yml and appveyor.yml templates, snaps and badgesβGitHub Β· Aug 21, 2018 Β· 1 reactions
- inspec/inspecβAdd a CODE_OF_CONDUCT.mdβGitHub Β· Jul 12, 2018 Β· 1 reactions
- racer-rust/emacs-racerβassertion failed: structmatch.mtype == core::MatchType::StructβGitHub Β· Jun 25, 2018 Β· 1 reactions
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
- Mar 29, 2018Warn about using `grep` outside conditionals when `set -e` is in effect β koalaman/shellcheck2 reactions
- Sep 13, 2019Current implementation cannot handle multiple crates with the same `lib` name β est31/cargo-udeps1 reaction Β· 6 comments
- Aug 21, 2018.travis.yml and appveyor.yml templates, snaps and badges β yoshuawuyts/crossgen1 reaction Β· 2 comments
- Jul 12, 2018Add a CODE_OF_CONDUCT.md β inspec/inspec1 reaction Β· 4 comments
- Jun 25, 2018assertion failed: structmatch.mtype == core::MatchType::Struct β racer-rust/emacs-racer1 reaction Β· 2 comments
29 more on GitHub
- Oct 25, 2016using npm start results in multiple child processes upon reconfigure β habitat-sh/core-plans1 reaction Β· 3 comments
- Jun 11, 2026Add Hab 2.1 release notes β chef/chef-web-docs0 reactions Β· 1 comment
- Mar 4, 2026habitat: 1.6.1245 -> 2.1.23 β NixOS/nixpkgs0 reactions Β· 3 comments
- Oct 13, 2025Capture hab cli reference snapshot β habitat-sh/chef-habitat-docs0 reactions Β· 2 comments
- Sep 9, 2025habitat: 1.6.1244 -> 1.6.1245 β NixOS/nixpkgs0 reactions
- Aug 6, 2025habitat: 1.6.1243 -> 1.6.1244 β NixOS/nixpkgs0 reactions
- Jun 30, 2025Publish On-prem Builder docs β chef/chef-web-docs0 reactions Β· 2 comments
- May 23, 2025Update Hab docs β chef/chef-web-docs0 reactions Β· 2 comments
- Oct 22, 2024This is addressing a build error on habitat β chef/chef0 reactions Β· 1 comment
- Aug 23, 2023habitat: 1.6.652 -> 1.6.848 β NixOS/nixpkgs0 reactions Β· 2 comments
- May 12, 2023habitat: 0.90.6 -> 1.1.652, fix build, unpin openssl β NixOS/nixpkgs0 reactions Β· 1 comment
- Apr 13, 2023Add documentation guide on rotating builder SSL certificates β habitat-sh/on-prem-builder0 reactions
- Dec 6, 2021Multi valued flags and required argument do not work together very well β epage/clapng0 reactions Β· 3 comments
- Jul 9, 2021Removed bintray dependencies from deployment β chef/automate0 reactions Β· 2 comments
- Jan 27, 2021FIx issue with multi profile using automate dep β chef/effortless0 reactions Β· 1 comment
- Jan 12, 2021chef/automate: components/automate-cli/pkg/dev/hab/verify.go; 62 LoC β github-vet/preliminary-findings-jan-20210 reactions
- Dec 28, 2020chef/automate: components/automate-cli/pkg/dev/hab/verify.go; 62 LoC β github-vet/rangeloop-pointer-findings0 reactions
- Aug 24, 2020Update worker builds to use $hab_binary β habitat-sh/builder0 reactions
- Jul 29, 2020removes deprecated description and cause for std::error::Error β habitat-sh/retry0 reactions
- Jul 22, 2020modernize plan β chef-boneyard/contosouniversity0 reactions
- May 18, 2020Update builder-worker to use Buildah β habitat-sh/builder0 reactions Β· 4 comments
- Apr 23, 2020Add job cancelation ability to the UI β EasyVector/Issue-Feedback-Repo0 reactions Β· 11 comments
- Dec 20, 2019fileutils AtomicWriter is not concurrency safe β chef/automate0 reactions
- Jul 1, 2019Update installation method β chef-partners/terraform-provisioner-habitat0 reactions
- Mar 15, 2019Cargo update following release 0.78.0 β habitat-sh/builder0 reactions Β· 1 comment
- Dec 8, 2017Multi valued flags and required argument do not work together very well β clap-rs/clap0 reactions Β· 6 comments
- May 30, 2017review habitat CoC updates β sous-chefs/meta0 reactions Β· 2 comments
- May 5, 2017check if the hab service we loaded is running and fails bosh job if not. β cloudfoundry-community/habitat-boshrelease0 reactions
- Apr 27, 2017[core] Work on core to simplify / facilitate data cluster use case β starkandwayne-attic/habitat-plans0 reactions
On Hacker News Β· 1
- Jun 16, 2016A GitHub Issue in Three Acts for Habitat1 point
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.

