acbr-components
Skill53 starsChanged 8 months agoMITView on GitHub
The ACBr Project is vital for issuing NFe, CTe, NFCe, SAT, TEF and controlling fiscal/non-fiscal scales/printers in Brazil. It contains fantastic components, but due to its background and history of strong VCL coupling that accompanies older developers, the best practices below ensure maintainability in modernizations. Do not instantiate components TACBrNFe, TACBrCTe, TACBrPosPrinter, etc., directly in the View Forms of the interface (.dfm/.fmx). This breaks the clean architecture, MVC and makes unit testing immensely difficult. Create Service "Wrapper" classes or Infrasctructure…
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/acbr-patterns.mdCursor rule
- .cursor/rules/delphi-conventions.mdCursor rule
- .cursor/rules/design-patterns.mdCursor rule
- .cursor/rules/dext-patterns.mdCursor rule
- .cursor/rules/dmvc-patterns.mdCursor rule
- .cursor/rules/firebird-patterns.mdCursor rule
- .cursor/rules/horse-patterns.mdCursor rule
- .cursor/rules/intraweb-patterns.mdCursor rule
- .cursor/rules/memory-exceptions.mdCursor rule
- .cursor/rules/mysql-patterns.mdCursor rule
- .cursor/rules/postgresql-patterns.mdCursor rule
- .cursor/rules/refactoring.mdCursor rule
- .cursor/rules/solid-patterns.mdCursor rule
- .cursor/rules/tdd-patterns.mdCursor rule
- .cursor/rules/threading-patterns.mdCursor rule
- Delphi Clean CodeSkill
- Delphi Code ReviewSkill
- Delphi Memory and ExceptionsSkill
- Delphi SOLID PatternsSkill
- Design Patterns GoF — DelphiSkill
- DevExpress/DEXT ComponentsSkill
- Dext Framework PatternsSkill
- DelphiMVCFrameworkSkill
- DUnitX Testing PatternsSkill
- Firebird DatabaseSkill
- Horse FrameworkSkill
- Intraweb FrameworkSkill
- MySQL DatabaseSkill
- PostgreSQL DatabaseSkill
- Delphi Code RefactoringSkill
- Delphi Test-Driven Development (TDD) and DUnitXSkill
- Threading & Multi-ThreadingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Do not instantiate components TACBrNFe, TACBrCTe, TACBrPosPrinter, etc., directly in the View Forms of the interface (.dfm/.fmx).
- Distinctive: line 16
Create Service "Wrapper" classes or Infrasctructure Repositories that inject (via constructor or Service Locator) the system configurations …
- Distinctive: line 55
If you instantiate sub-function components (e.g.
- Very specific: line 76
When dealing with design-time components in DataModules created to facilitate events, use these mappings:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Standards for ACBr Project
The ACBr Project is vital for issuing NFe, CTe, NFCe, SAT, TEF and controlling fiscal/non-fiscal scales/printers in Brazil. It contains fantastic components, but due to its background and history of strong VCL coupling that accompanies older developers, the best practices below ensure maintainability in modernizations.
1. Rule of Thumb: No Strong Visual Coupling
Do not instantiate components TACBrNFe, TACBrCTe, TACBrPosPrinter, etc., directly in the View Forms of the interface (.dfm/.fmx). This breaks the clean architecture, MVC and makes unit testing immensely difficult.
O Que Fazer?
Create Service "Wrapper" classes or Infrasctructure Repositories that inject (via constructor or Service Locator) the system configurations to the Fiscal Engine.
type
INFeEmissor = interface
['{GUID}']
function EmitirNota(ANota: TBaseNFeModel): TEmissionResult;
end;
TNFeEmissorACBr = class(TInterfacedObject, INFeEmissor)
private
FAcbrNFe: TACBrNFe;
FConfig: IAppConfig;
procedure ConfigureComponent;
public
constructor Create(AConfig: IAppConfig);
destructor Destroy; override;
function EmitirNota(ANota: TBaseNFeModel): TEmissionResult;
end;2. Abstracting Signing and Cryptography Libraries (OpenSSL vs WinCrypt)
It is a documented good practice to also isolate the libraries for each OS version if the project is cross-platform or supports VMs (e.g. Linux Docker vs Windows).
Configure this Always via code dynamically within the wrapper referenced in Session 1, never at fixed design-time, using LAcbrNFe.Configuracoes.Geral.SSLLib := libWinCrypt; (or OpenSSL).
3. Handle Callbacks and Events (ex: TEF)
ACBrTEFD works heavily based on VCL events (OnExibeMensagem, OnAguardaDigitacao). Implement them by sending native bus events or defining a generic UI "Handler" injected into the class so that the component code remains in the Business/Gateway Layer, delegating only the "Draw to Screen" to specific interfaces that can be overridden in Headless/REST API scenarios.
ITefPresentationHandler = interface
procedure ShowTefMessage(const Msg: string);
procedure ClearTefMessage;
end;4. Dynamic Memory Management
If you instantiate sub-function components (e.g. ACBrCEP) dynamically, avoid memory leaks.
function RetrieveAddress(const AZipCode: string): TAddressResponse;
var
LCepComponent: TACBrCEP;
begin
LCepComponent := TACBrCEP.Create(nil);
try
LCepComponent.WebService := wsViaCep;
//Perform the logic
LCepComponent.BuscarPorCEP(AZipCode);
Result := MapToResponse(LCepComponent.Enderecos[0]);
finally
LCepComponent.Free;
end;
end;5. Component Prefixes
When dealing with design-time components in DataModules created to facilitate events, use these mappings:
| ACBr component | Description | Typical Prefix |
TACBrNFe | Electronic Invoice | acbrNfe |
TACBrNFCe | Consumer Note | acbrNfce |
TACBrCTe | Knowledge of Transp. | acbrCte |
TACBrBoleto | Bills | acbrBoleto |
TACBrTEFD | TEF | acbrTef |
TACBrPosPrinter | Printers (EscPOS) | acbrPosPrinter |
TACBrSAT | SAT CF-e equipment | acbrSat |
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.

