Quality skills and knowledge for Business Central development. The shared bar for humans and agents alike.
Find a file
waldo b7617fb48a
knowledge(events): ChangeCompany leaves triggers and trigger-event subscribers running in the calling company (#152)
* knowledge(events): ChangeCompany leaves triggers and trigger-event subscribers running in the calling company

ChangeCompany redirects only the data access of a record variable; Learn states that triggers still run in the current company. The database trigger events are raised on every database operation and only pass RunTrigger to the subscriber, so Insert(false) after ChangeCompany still runs every subscriber in the calling company. Generated code either assumes the record 'becomes' a target-company record, or switches RunTrigger off and hand-copies the trigger logic, leaving the subscribers writing to the wrong company; none of the tested runs reached StartSession with the company parameter.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* knowledge(events): qualify StartSession async semantics and fix concurrency-unsafe sample key

Addresses PR #152 review: StartSession is a fire-and-forget background
session (Ok reports only whether it started, not whether the codeunit
succeeded, and errors inside it do not propagate), so the Best Practice
now scopes the recommendation and calls out the durable status/error
channel a synchronous-success write needs. The good sample's
FindLast()+1 entry-number pattern raced under concurrent background
sessions; switched to AutoIncrement, which the platform guarantees is
unique across concurrent transactions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* knowledge(events): serialize the setup-counter increment; promote article and wire the review skill

PR #152 round 3 (JesperSchulz):
- The good sample's OnAfterInsertEvent subscriber still raced on the
  shared "Transfer Setup Good" singleton (Get/increment/Modify);
  AutoIncrement only protected the request key. Added
  TransferSetup.LockTable() before Get() to serialize concurrent
  background sessions.
- Promoted changecompany-runs-triggers-in-the-calling-company from
  community/knowledge/events/ to microsoft/knowledge/events/, and wired
  ChangeCompany/StartSession/RunTrigger tokens plus a targeted
  detection cue into microsoft/skills/review/al-events-review.md so a
  diff containing the anti-pattern reliably worklists this article,
  preserving the documented RunTrigger=false hand-off exception.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: waldo1001 <12088142+waldo1001@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 12:34:28 +02:00
.claude-plugin Simplify standalone AL code review skill (#150) 2026-09-03 10:25:44 +02:00
.github Fix reporting skill index expectation (#185) 2026-09-15 10:45:35 +02:00
community Add AL-focused AppSource validation guidance (#142) 2026-09-14 12:42:45 +02:00
custom Improve partner onboarding and documentation navigation (#174) 2026-09-09 17:31:03 +02:00
docs Add reporting review guidance and evaluation fixtures (#183) 2026-09-15 10:38:32 +02:00
evaluation Add reporting review guidance and evaluation fixtures (#183) 2026-09-15 10:38:32 +02:00
microsoft knowledge(events): ChangeCompany leaves triggers and trigger-event subscribers running in the calling company (#152) 2026-09-15 12:34:28 +02:00
schemas Add machine-readable review contracts (#182) 2026-09-15 10:27:40 +02:00
skills Add machine-readable review contracts (#182) 2026-09-15 10:27:40 +02:00
tools Add machine-readable review contracts (#182) 2026-09-15 10:27:40 +02:00
.gitignore Own the knowledge-index generator + index-aware review skills (#25) 2026-06-04 15:02:12 +02:00
CODEOWNERS Fix CODEOWNERS: correct @jeschulz -> @jesperschulz on base rules (#53) 2026-06-25 14:28:48 +02:00
LICENSE Add initial project structure with .gitignore, LICENSE, README, and CODEOWNERS 2026-04-17 05:56:10 +02:00
plugin.json Simplify standalone AL code review skill (#150) 2026-09-03 10:25:44 +02:00
README.md Separate analyzer rules from BCQuality knowledge (#178) 2026-09-11 09:26:14 +02:00
SECURITY.md Microsoft mandatory file 2026-04-17 03:58:13 +00:00

BCQuality

Quality skills and knowledge that help AI tools make better Business Central development decisions: catch BC-specific defects, avoid misleading advice, and explain findings with references you can read.

BCQuality contains knowledge and reusable skills, not agents or a Business Central extension. Your host supplies the agent. You can install the content as a plugin, use it from another integration, or browse the knowledge directly.

Quick start

The walkthrough below uses GitHub Copilot CLI in a terminal, not the Copilot Chat panel in VS Code. First install Copilot CLI and sign in. Your account and organization policy must allow its use. You do not need to clone BCQuality, build a runner, or deploy an app to Business Central for this source-review example.

Standalone plugin installation

Run these commands in your terminal:

copilot plugin install microsoft/BCQuality
copilot plugin list

The list should include bcquality. The plugin currently exposes the al-code-review skill. Installation and skill discovery are the general pattern; reviewing an app is one example of using it.

Example: Review a complete app folder

Start a new CLI session in your own app folder, replacing the example path:

cd "C:\Repos\MyBusinessCentralApp"
copilot

Approve access only to a project you trust, then ask:

Use the installed al-code-review skill to review the complete Business Central app in this folder without changing my source files. Return the complete BCQuality findings report.

The folder should contain app.json and your AL source; it does not need to be a Git repository. On macOS or Linux, use your app's local path instead.

Expect a report for each selected review, with findings, source locations, severity, confidence, and references to the relevant guidance. Some hosts show the structured JSON directly. completed with no findings means nothing was flagged in that review's scope; partial or failed is not a clean result. See reading your results.

PowerShell 7 (pwsh) is recommended for fast knowledge discovery. If it is unavailable, the review can still discover knowledge by reading the folders.

Documentation

I want to... Start here
Choose direct reading, a supplied skill, or my own agent Ways to use BCQuality
Review a file, changes, a branch, or a particular concern Using BCQuality
Resolve setup problems, incomplete reviews, or incorrect findings Troubleshooting and support
Browse the available guidance Knowledge by domain
Configure the plugin or use my organization's rules Customizing BCQuality
Contribute knowledge or improve a rule Your first contribution
Connect a host, agent, or CI integration Minimal integration example

All documentation and technical references.

Scope

Today's curated content focuses on technical AL code review. It augments the agent's judgment; it is not an exhaustive BC manual or a substitute for compilation, analyzers, tests, or human review. See coverage and limits for the available domains and the difference between a folder review and a comparison. Mechanical issues already enforced by the AL compiler or standard analyzers are intentionally left to those deterministic tools rather than duplicated here.

Functional areas such as Finance, Supply Chain Management, Manufacturing, Jobs, Warehousing, and Service, and technologies such as PowerShell, pipelines, and Power Platform, remain valid future scope, not current coverage claims.

What's in this repo

Knowledge articles cover one concern each. Skills tell an agent how to find and apply the relevant knowledge. Both live in three layers:

Layer Purpose
Microsoft Microsoft-endorsed skills and their knowledge.
Community Community-owned skills and their knowledge.
Custom Organization-specific additions and overrides in your own fork.

All three are enabled by default; Custom is empty upstream. You do not need to configure layers to get started.

Versioning

Update the installed plugin from your terminal, then start a new session:

copilot plugin update bcquality

Plugin versions and content-release tags are different. For reproducible runs and organization forks, see updates and versions.

What belongs here

Knowledge belongs here when it prevents a BC-specific mistake an otherwise capable agent would make, including false-positive findings. BC facts belong in knowledge articles, not skill instructions. See the admission test and examples.

Contributing

Partners are welcome to contribute to the layer that owns the domain, regardless of affiliation. Start with the contribution guide. To report a problem without authoring a rule, see support.

License

MIT