agentleFS
Microsoft AzureKnown publisherAzure/bicep-deploy/.github/copilot-instructions.md

bicep-deploy

Copilot instructions64 starsChanged 12 months agoMITView on GitHub

This repository contains the bicep-deploy GitHub Action and the shared @azure/bicep-deploy-common package. Before committing any changes, always run the following commands in order: All four steps must pass before committing. Important: The dist/ folder contains the compiled action code referenced by action.yml (main: dist/index.cjs). This folder must be rebuilt (npm run build) and committed whenever source code changes. The @azure/bicep-deploy-common package is a shared library that provides: - Azure deployment and deployment stack operations - Bicep file compilation - Configuration…

The file

Show its rules and text

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

15 rules. About 0 are common, 6 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before committing any changes, always run the following commands in order:

    line 7
  2. Distinctive:

    Run all tests: - Ensure all tests pass

    line 24
  3. Distinctive:

    All four steps must pass before committing.

    line 29
  4. Distinctive:

    When modifying the common package, remember that changes affect both:

    line 55
  5. Very specific:

    Run npm test -- --run for a single test run

    line 62
  6. Very specific:

    Run npm test for watch mode

    line 63
  7. Very specific:

    Run npm run test:live for live/integration tests (requires Azure credentials, tests in test-live/ folder)

    line 64
  8. Distinctive:

    When adding new logging to the common package:

    line 69
  9. Very specific:

    Add the message template to LoggingMessageConfig interface in src/loggingMessages.ts

    line 70
  10. Very specific:

    Add the default implementation to defaultLoggingMessages

    line 71
  11. Distinctive:

    When adding new public functions or types to the common package:

    line 84
  12. Very specific:

    Add exports to packages/bicep-deploy-common/src/index.ts

    line 85
  13. Very specific:

    Test mocks are in packages/bicep-deploy-common/test/mocks/

    line 90
  14. Very specific:

    Test fixtures/files are in packages/bicep-deploy-common/test/files/

    line 91
  15. Very specific:

    Use TestLogger from test/logging.ts for logging assertions in tests

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 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

Bicep Deploy - Copilot Instructions

This repository contains the bicep-deploy GitHub Action and the shared @azure/bicep-deploy-common package.

Pre-Commit Checklist

Before committing any changes, always run the following commands in order:

  1. Lint fix - Fix any linting issues
    npm run lint -- --fix
  2. Build common package - Build the shared common package
    cd packages/bicep-deploy-common && npm run build
  3. Build full repo - Build the main action
    cd /path/to/bicep-deploy && npm run build
  4. Run all tests - Ensure all tests pass
    npm test -- --run

All four steps must pass before committing.

Repository Structure

  • src/ - GitHub Action source code
  • dist/ - Bundled output that GitHub Actions runs (must be committed!)
  • packages/bicep-deploy-common/ - Shared library used by both the GitHub Action and the Azure DevOps task
  • test/ - Tests for the GitHub Action
  • packages/bicep-deploy-common/test/ - Tests for the common package

Important: The dist/ folder contains the compiled action code referenced by action.yml (main: dist/index.cjs). This folder must be rebuilt (npm run build) and committed whenever source code changes.

Common Package

The @azure/bicep-deploy-common package is a shared library that provides:

  • Azure deployment and deployment stack operations
  • Bicep file compilation
  • Configuration parsing
  • Logging and error handling utilities

Published Package: https://www.npmjs.com/package/@azure/bicep-deploy-common

Important: The GitHub Action and ADO Task consume this package differently:

  • GitHub Action (this repo): Uses the local file path (packages/bicep-deploy-common/), not the npm version
  • Azure DevOps Task (microsoft/azure-pipelines-tasks): Uses the published npm version with a pinned version in package.json (e.g., "@azure/bicep-deploy-common": "^0.0.3-dev")

When modifying the common package, remember that changes affect both:

  • The GitHub Action (this repo) - immediately, via local reference
  • The Azure DevOps BicepDeploy task - after publishing a new npm version and updating the version in the task's package.json

Testing

  • Unit tests use Vitest
  • Run npm test -- --run for a single test run
  • Run npm test for watch mode
  • Run npm run test:live for live/integration tests (requires Azure credentials, tests in test-live/ folder)
  • Live tests are typically run by CI/CD workflows, not locally during development

Adding New Logging Messages

When adding new logging to the common package:

  1. Add the message template to LoggingMessageConfig interface in src/loggingMessages.ts
  2. Add the default implementation to defaultLoggingMessages
  3. This pattern allows consumers (GitHub Action, ADO Task) to customize/localize messages. In practice only the ADO Task does this.
  4. For ADO Task localization, add message keys to the messages section in task.json - both task.loc.json and resources.resjson are auto-generated from task.json during build

Adding New Error Messages

Error messages follow the same pattern as logging messages:

  1. Add the message template to ErrorMessageConfig interface in src/errorMessages.ts
  2. Add the default implementation to defaultErrorMessages
  3. Consumers can customize error messages for localization

Exporting New Functions

When adding new public functions or types to the common package:

  1. Add exports to packages/bicep-deploy-common/src/index.ts
  2. Rebuild the common package to regenerate type definitions

Test File Structure

  • Test mocks are in packages/bicep-deploy-common/test/mocks/
  • Test fixtures/files are in packages/bicep-deploy-common/test/files/
  • Use TestLogger from test/logging.ts for logging assertions in tests
  • TestLogger provides getInfoMessages() and clear() methods for validating log output

Download now (ZIP)

Does it work?

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

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.