agentleFS
MicrosoftKnown publishermicrosoft/AL-Go/.github/copilot-instructions.md

AL-Go

Copilot instructions505 starsChanged 8 months agoMITView on GitHub

AL-Go for GitHub is a set of GitHub Actions and Templates for building, testing, and deploying Business Central extensions using GitHub workflows. It consists of PowerShell actions, reusable YAML workflows, and Pester-based unit tests.

The file

Show its rules and text

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

29 rules. About 0 are common, 7 are distinctive, and 22 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 22

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every action script must start with the standard header:

    line 11
  2. Very specific:

    Use try/catch/finally with structured error propagation.

    line 15
  3. Very specific:

    Check $LASTEXITCODE after running external commands.

    line 16
  4. Very specific:

    Use Write-Host "::Error::<message>" for GitHub Actions error annotations.

    line 17
  5. Very specific:

    Use Write-Host "::Warning::<message>" for non-blocking warnings.

    line 18
  6. Very specific:

    Always use ConvertTo-HashTable -recurse after ConvertFrom-Json to ensure nested objects and arrays are converted to hashtables for …

    line 22
  7. Very specific:

    Always specify -Encoding UTF8 when reading or writing JSON files.

    line 23
  8. Distinctive:

    Use PascalCase for function names and camelCase for variables.

    line 27
  9. Very specific:

    Import modules with explicit paths: Join-Path $PSScriptRoot pattern.

    line 31
  10. Very specific:

    Use -Force -DisableNameChecking for re-imports.

    line 32
  11. Distinctive:

    Never log raw secrets; use clean/placeholder URLs in error messages.

    line 39
  12. Very specific:

    Check for path traversal using Test-PathWithinWorkspace or equivalent.

    line 46
  13. Distinctive:

    Never hardcode credentials or tokens in source code.

    line 51
  14. Distinctive:

    Use GitHub secrets or Azure KeyVault for credential storage.

    line 52
  15. Very specific:

    Use defaults.run.shell: pwsh for cross-platform compatibility.

    line 57
  16. Very specific:

    Use ${{ needs.JobName.outputs.key }} for cross-job communication.

    line 59
  17. Very specific:

    Add ::Notice:: steps when conditionally skipping workflow steps.

    line 60
  18. Very specific:

    All new functions must have Pester unit tests in the Tests/ folder.

    line 64
  19. Very specific:

    Test files follow the naming convention *.Test.ps1.

    line 65
  20. Very specific:

    Use Describe/It blocks with descriptive names.

    line 66
  21. Very specific:

    Use InModuleScope for testing private module functions.

    line 69
  22. Very specific:

    All new or modified AL-Go settings must be:

    line 73
  23. Distinctive:

    When adding new user-facing behaviors, workflows, or commands:

    line 78
  24. Very specific:

    Update the relevant scenario(s) under Scenarios/ or the appropriate README.md so users can discover and understand the change.

    line 79
  25. Very specific:

    Call out breaking changes and notable new capabilities in RELEASENOTES.md.

    line 80
  26. Very specific:

    Before using or accepting settings, check DEPRECATIONS.md for deprecated settings:

    line 84
  27. Very specific:

    Use [System.IO.Path]::DirectorySeparatorChar instead of hardcoded separators.

    line 93
  28. Very specific:

    Use Replace('\', '/') for path normalization in URLs and artifact names.

    line 95
  29. Distinctive:

    When reviewing PRs, verify:

    line 99

≈ “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

Copilot Instructions for AL-Go

Project Overview

AL-Go for GitHub is a set of GitHub Actions and Templates for building, testing, and deploying Business Central extensions using GitHub workflows. It consists of PowerShell actions, reusable YAML workflows, and Pester-based unit tests.

PowerShell Conventions

Error Handling

  • Every action script must start with the standard header:
    $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
  • Use try/catch/finally with structured error propagation.
  • Check $LASTEXITCODE after running external commands.
  • Use Write-Host "::Error::<message>" for GitHub Actions error annotations.
  • Use Write-Host "::Warning::<message>" for non-blocking warnings.

JSON Processing

  • Always use ConvertTo-HashTable -recurse after ConvertFrom-Json to ensure nested objects and arrays are converted to hashtables for consistent access.
  • Always specify -Encoding UTF8 when reading or writing JSON files.

Function Declarations

  • Use PascalCase for function names and camelCase for variables.

Module Loading

  • Import modules with explicit paths: Join-Path $PSScriptRoot pattern.
  • Use -Force -DisableNameChecking for re-imports.

Security Patterns

Secret Handling

  • Mask secrets with Write-Host "::add-mask::$secret" before any output.
  • Never log raw secrets; use clean/placeholder URLs in error messages.
  • Be aware that secrets in URLs use ${{ secretName }} syntax — replacement is done before use.
  • URL-encode secret values when injecting into URLs.

Input Sanitization

  • Sanitize filenames using [System.IO.Path]::GetInvalidFileNameChars().
  • Check for path traversal using Test-PathWithinWorkspace or equivalent.
  • Sanitize container names with -replace "[^a-z0-9\-]".

Authentication

  • Never hardcode credentials or tokens in source code.
  • Use GitHub secrets or Azure KeyVault for credential storage.

YAML Workflow Conventions

  • Declare minimal required permissions (e.g., contents: read, actions: read).
  • Use defaults.run.shell: pwsh for cross-platform compatibility.
  • Prefix internal environment variables with _ to distinguish from GitHub context.
  • Use ${{ needs.JobName.outputs.key }} for cross-job communication.
  • Add ::Notice:: steps when conditionally skipping workflow steps.

Testing Requirements

  • All new functions must have Pester unit tests in the Tests/ folder.
  • Test files follow the naming convention *.Test.ps1.
  • Use Describe/It blocks with descriptive names.
  • Mock external dependencies to isolate units under test.
  • Tests must pass on both Windows (PowerShell 5) and Linux (PowerShell 7).
  • Use InModuleScope for testing private module functions.

Documentation Requirements

  • All new or modified AL-Go settings must be:
    • Documented in Scenarios/settings.md with a clear description, type, default/required status, valid values (e.g., enum), and which templates/workflows honor the setting.
    • Added or updated in the settings schema (Actions/.Modules/settings.schema.json) with aligned description, type, enum, default, and required metadata.
    • Marked as deprecated in both Scenarios/settings.md and the schema description when applicable, with guidance on the replacement setting, and listed in DEPRECATIONS.md.
  • New public functions (in .ps1 / .psm1 files, or used as entry points from workflows) should include comment-based help with at least .SYNOPSIS and, when appropriate, .DESCRIPTION, .PARAMETER, and .EXAMPLE blocks. Parameter names and descriptions in the help should stay in sync with the function signature.
  • When adding new user-facing behaviors, workflows, or commands:
    • Update the relevant scenario(s) under Scenarios/ or the appropriate README.md so users can discover and understand the change.
    • Call out breaking changes and notable new capabilities in RELEASENOTES.md.

Deprecated Features

Before using or accepting settings, check DEPRECATIONS.md for deprecated settings:

  • unusedALGoSystemFiles → use customALGoFiles.filesToExclude
  • alwaysBuildAllProjects → use incrementalBuilds.onPull_Request
  • <workflow>Schedule → use workflowSchedule with conditional settings
  • cleanModePreprocessorSymbols → use preprocessorSymbols with conditional settings

Cross-Platform Considerations

  • Use [System.IO.Path]::DirectorySeparatorChar instead of hardcoded separators.
  • Account for PowerShell 5 vs 7 differences (e.g., encoding parameters, $IsWindows).
  • Use Replace('\', '/') for path normalization in URLs and artifact names.

Pull Request Checklist

When reviewing PRs, verify:

  • Standard error handling header is present in new scripts
  • Secrets are masked before any output
  • JSON is converted with ConvertTo-HashTable -recurse
  • File encoding is explicitly specified
  • Unit tests are added or updated
  • RELEASENOTES.md is updated for user-facing changes
  • No deprecated settings are introduced
  • YAML workflows declare minimal permissions
  • Cross-platform compatibility is maintained
  • New or changed settings are documented in Scenarios/settings.md and reflected in Actions/.Modules/settings.schema.json with consistent metadata
  • New public functions have appropriate comment-based help and any new workflows/user-facing behaviors are documented in scenarios/READMEs

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.