bc-al-project-context
Skill28 starsChanged 7 months agoMITView on GitHub
Maintains persistent project context for Business Central AL extensions across sessions, developers, and AI agents. Combines two complementary mechanisms: Architecture Decision Records (ADRs) that capture why technical decisions were made, and Session Handoff documents that capture where the project is right now. Generates, updates, and queries both document types. Use this skill whenever starting a new coding session on an existing project, ending a session and need to document progress, onboarding a new developer or AI agent to an existing codebase, explaining why a technical decision was made, wondering why something is designed a certain way, resuming work after a break, or handing off work between team members. Also trigger when the user says 'document this decision', 'why is this designed like this', 'where did we leave off', 'catch me up', 'what was decided', 'create an ADR', 'end of session', 'handoff', or 'context for next session'.
In this repository38 other files it gives its agents.
- bc-agent-instructions-debuggerSkill
- bc-al-bug-fixSkill
- bc-al-code-reviewerSkill
- bc-api-page-generatorSkill
- bc-api-query-generatorSkill
- bc-approval-workflow-generatorSkill
- bc-attachments-generatorSkill
- skill-batch-processingSkill
- bc-business-events-generatorSkill
- bc-cds-page-generatorSkill
- bc-dataverse-entity-generatorSkill
- bc-dataverse-mapping-generatorSkill
- bc-field-propagationSkill
- bc-install-codeunit-generatorSkill
- bc-isolated-storage-generatorSkill
- bc-job-queueSkill
- bc-manifest-handoff-generatorSkill
- bc-matrix-page-generatorSkill
- bc-number-series-generatorSkill
- bc-pricing-refactorSkill
- bc-report-selection-generatorSkill
- bc-reportsSkill
- bc-setup-table-generatorSkill
- bc-setup-wizard-generatorSkill
- bc-table-dimensions-generatorSkill
- bc-telemetry-generatorSkill
- bc-test-codeunit-generatorSkill
- bc-upgrade-codeunit-generatorSkill
- documentation-bc-analysis-generatorSkill
- documentation-bc-architecture-generatorSkill
- documentation-bc-ccn-generatorSkill
- documentation-bc-md-to-docx-converterSkill
- documentation-bc-phase-plan-generatorSkill
- documentation-bc-release-note-generatorSkill
- documentation-bc-technical-spec-generatorSkill
- documentation-bc-user-story-generatorSkill
- onprem-remote-deploySkill
- skill-contribution-assistantSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 17 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Read references/adr-format.md when creating or querying an ADR (Modes 1 and 2) — it contains the template, status values, and three …
- Very specific: line 11
Read references/handoff-format.md when creating or reading a Session Handoff (Modes 3 and 4) — it contains the template and two complete …
- Distinctive: line 28
Create an ADR when a decision:
- Distinctive: line 40
Rule of thumb: If a future developer looking at the code would ask "why did they do it this way?", that's an ADR.
- Distinctive: line 46
Create a Session Handoff:
- Distinctive: line 48
Before handing off to another developer
- Distinctive: line 49
Before handing off to an AI agent (Claude Code, GitHub Copilot)
- Distinctive: line 50
When pausing work that will resume in a different context
- Distinctive: line 51
When a sprint or milestone ends
- Distinctive: line 61
Ask the user to describe the decision if not already clear:
- Very specific: line 81
Search .github/decisions/ for ADRs related to the topic
- Distinctive: line 82
If found: summarize the decision, the alternatives considered, and the status
- Distinctive: line 83
If not found: say so, and offer to create one if the decision is known
- Distinctive: line 91
Ask the user to confirm or provide:
- Distinctive: line 100
If the session produced significant decisions not yet captured as ADRs, prompt the user to create them before closing
- Very specific: line 103
If multiple sessions in one day: handoff-{YYYY-MM-DD}-{N}.md
- Distinctive: line 118
Ask: "Ready to continue from here, or do you want to update the context first?"
- Very specific: line 129
Read all .github/decisions/ADR-*.md and extract: title, decision, status
- Distinctive: line 169
Never create an ADR retroactively to justify a bad decision.
- Distinctive: line 175
If the user ends a session with significant uncommitted decisions, prompt to create ADRs before closing.
- Distinctive: line 177
When reading a handoff to start a session, always state the immediate next action first — not the history.
- Very specific: line 179
Keep ADR titles in kebab-case, descriptive, and short enough to be readable as a filename.
- Distinctive: line 181
Do not create a handoff if nothing meaningful happened.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
BC AL Project Context
Maintains persistent project context for Business Central AL extensions. Solves the two most expensive context problems in AL development: why things are designed the way they are (Architecture Decision Records), and where the project is right now (Session Handoff).
Read references/adr-format.md when creating or querying an ADR (Modes 1 and 2) — it contains the template, status values, and three complete BC AL examples.
Read references/handoff-format.md when creating or reading a Session Handoff (Modes 3 and 4) — it contains the template and two complete examples including a handoff to an AI agent.
The two mechanisms
| Mechanism | File location | Answers | Created when |
| ADR | .github/decisions/ADR-NNN-title.md | Why was this decided? | A significant technical decision is made |
| Session Handoff | .github/context/handoff-YYYY-MM-DD.md | Where are we right now? | Ending a session or handing off to someone else |
Both mechanisms are file-based — they live in the repository alongside the code, are version-controlled, and are readable by any developer or AI agent without special tools.
When to create an ADR
Create an ADR when a decision:
- Affects the overall architecture of the extension (not a local implementation choice)
- Will be hard to reverse or expensive to change later
- Could be misunderstood by a future developer or AI agent
- Involves a tradeoff where the rejected alternatives matter
- Contradicts a common pattern or best practice (and there's a good reason)
Do NOT create an ADR for:
- Routine implementation choices (which variable name, which loop structure)
- Decisions that are obviously correct given the context
- Decisions that can be changed cheaply at any time
Rule of thumb: If a future developer looking at the code would ask "why did they do it this way?", that's an ADR.
When to create a Session Handoff
Create a Session Handoff:
- At the end of every significant work session (>1 hour of work)
- Before handing off to another developer
- Before handing off to an AI agent (Claude Code, GitHub Copilot)
- When pausing work that will resume in a different context
- When a sprint or milestone ends
Execution workflow
Mode 1 — Create ADR
Trigger phrases: "document this decision", "create an ADR", "why did we choose X", "record this"
- Ask the user to describe the decision if not already clear:
- What was decided?
- What alternatives were considered?
- Why was this option chosen over the others?
- What are the known consequences or tradeoffs?
- Assign the next ADR number by checking existing files in
.github/decisions/ - Generate the ADR file using the template in
references/adr-format.md - Confirm the file path and content with the user before saving
Output: .github/decisions/ADR-{NNN}-{kebab-title}.md
Mode 2 — Query ADR
Trigger phrases: "why is this designed like this", "what was decided about X", "catch me up on decisions", "why do we use this pattern"
- Search
.github/decisions/for ADRs related to the topic - If found: summarize the decision, the alternatives considered, and the status
- If not found: say so, and offer to create one if the decision is known
Mode 3 — Create Session Handoff
Trigger phrases: "end of session", "handoff", "context for next session", "where did we leave off", "documenting progress"
- Ask the user to confirm or provide:
- What was accomplished in this session
- What is in progress (started but not finished)
- What is the immediate next action
- Any open questions or blockers
- Any decisions made (offer to create ADRs for significant ones)
- Generate the Handoff document using the template in
references/handoff-format.md - If the session produced significant decisions not yet captured as ADRs, prompt the user to create them before closing
Output: .github/context/handoff-{YYYY-MM-DD}.md
If multiple sessions in one day: handoff-{YYYY-MM-DD}-{N}.md
Mode 4 — Read Session Handoff (Start of session)
Trigger phrases: "catch me up", "where did we leave off", "start of session", "what's the current state", "brief me"
- Find the most recent handoff file in
.github/context/ - Summarize in this order:
- Immediate next action (first, most important)
- What was in progress (what to pick up)
- What was completed (for orientation)
- Open questions or blockers (what needs a decision)
- Relevant ADRs (link to decisions that affect current work)
- Ask: "Ready to continue from here, or do you want to update the context first?"
Mode 5 — Generate Context Brief
Trigger phrases: "onboard this agent", "context for Copilot", "brief for new developer", "project summary"
Combines the most recent Handoff with a summary of all ADRs into a single onboarding document:
- Read
.github/context/handoff-{most-recent}.md - Read all
.github/decisions/ADR-*.mdand extract: title, decision, status - Generate a
CONTEXT.mdbrief (not saved permanently — for immediate use)
Format:
# Project Context Brief — {extension name}
Generated: {date}
## Current state
{from most recent handoff: immediate next action + in progress}
## Key decisions
{ADR number, title, one-line decision summary — most recent first}
## Open questions
{from handoffs: unresolved items}File structure
.github/
├── decisions/
│ ├── ADR-001-use-event-subscribers-not-base-modification.md
│ ├── ADR-002-posting-routine-level-1-only.md
│ └── ADR-003-separate-test-app-project.md
└── context/
├── handoff-2026-03-15.md
├── handoff-2026-03-18.md
└── handoff-2026-04-09.mdBoth directories should be committed to the repository. Add them to .gitignore only if the decisions and context are confidential — but typically they are valuable for the whole team.
Behaviour rules
- Never create an ADR retroactively to justify a bad decision. ADRs capture honest decisions including their known weaknesses.
- ADR status must be kept current. When a decision is superseded by a later ADR, update the status of the old one to
Superseded by ADR-NNN. - Session Handoffs are not meeting minutes. They are action-oriented: the immediate next action must always be the first thing stated.
- If the user ends a session with significant uncommitted decisions, prompt to create ADRs before closing. Do not let decisions live only in chat history.
- When reading a handoff to start a session, always state the immediate next action first — not the history. The developer/agent needs to know what to do, not what happened.
- Keep ADR titles in kebab-case, descriptive, and short enough to be readable as a filename.
ADR-004-why-we-use-isolated-storage-for-secrets.mdis good.ADR-004-decision.mdis not. - Do not create a handoff if nothing meaningful happened. A handoff with "worked on the code" is worse than no handoff.
Reference files
references/adr-format.md— ADR template, status values, and three complete examplesreferences/handoff-format.md— Session Handoff template and two complete examples
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
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.

