| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.103.0/coding/ai/skills/logtalk-scaffolding/SKILL.md |
name: logtalk-scaffolding description: Scaffold a new Logtalk application (directory, settings.lgt, loader.lgt, optional tester/tests). Use when starting a project from scratch or setting up loaders, settings, and unit-test drivers. license: Apache-2.0 metadata: copyright: "2026 Paulo Moura <pmoura@logtalk.org>" ---
Create a clean Logtalk application layout outside the Logtalk user folder, with settings, loader, and optional tests. Prefer the official sample files over inventing a parallel structure.
samples/settings-sample.lgt, samples/loader-sample.lgt, samples/tester-sample.lgt, samples/tests-sample.lgtCUSTOMIZE.md in the Logtalk distribution (and comments inside the sample files)testing, documenting, coding-style, libraries, portability, packs
Do not put application sources under the Logtalk user directory; that tree is refreshed when Logtalk is updated.loader.lgt / tester.lgt / settings.lgt to an existing ad-hoc projectUse the LOGTALKUSER environment variable to locate the sample files in the user local Logtalk installation.
settings.lgt)samples/settings-sample.lgt from the Logtalk distribution to settings.lgt.CUSTOMIZE.md); relying on a settings file only inside the application directory requires always starting Logtalk from that directory.help, debugger)application(s) via logtalk_library_path/2CUSTOMIZE.mdLoader
samples/loader-sample.lgt into the application directory as loader.lgt.samples/tester-sample.lgt â tester.lgt and samples/tests-sample.lgt â tests.lgt (or a `tests/` directory later if the suite grows).tests.lgt so the test object extends lgtunit and defines your tests.tester.lgt to load lgtunit, the code under test (often via loader or explicit loads), the tests with hook(lgtunit), and run them (see the testing skill and handbook).tester.lgt that way so logtalk_tester finds it by default.test_files directory with the tests.lgt file and additional testing resources. But keep the tester.lgt file in the main directory, side-by-side with the application main loader.lgt file. / .logtalk` files following the coding-style and documenting skills.loader.lgt (and ensure tests cover them via tester.lgt).
my_app/
loader.lgt
tester.lgt % optional but recommended
tests.lgt % optional but recommended
... application sources ...
NOTES.md % optional
Plus a configured settings.lgt in the location Logtalk uses for startup settings (often the Logtalk user directory), defining a library alias that points at my_app if you load via library notation.
Ask the user if a SBOM would be required for the application. If true:
application library using the goal logtalk_load(application(loader)) in the loader.lgt and tester.lgt files.application_common and defining the application metadata.| ?- logtalk_load(loader). % from the app directory or via library alias | ?- logtalk_load(tester). % compile/run tests
Automated tests from the app directory:
logtalk_tester -p <backend>
lgtunit conventionsloader.lgthook(lgtunit) when compiling test objectssettings.lgt is based on settings-sample.lgt and sets needed tools, aliases, and flagsloader.lgt loads dependencies then application sources successfullytester.lgt / tests.lgt run cleanly with lgtunitCUSTOMIZE.md