| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.103.0/coding/ai/AGENTS.md |
<!--
This file is part of Logtalk https://logtalk.org/ SPDX-FileCopyrightText: 2026 Paulo Moura <pmoura@logtalk.org> SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
Guidance for AI coding agents working on Logtalk code (applications, libraries, or the Logtalk distribution itself).
Logtalk is a declarative object-oriented logic programming language that extends Prolog. Prefer Logtalk entities and idioms over raw Prolog style unless interfacing with plain Prolog or modules.
For task-specific procedures, load the matching skill under `coding-assistants/skills/` (or the copy in the application repo). Do not invent parallel frameworks for testing, documentation, or debugging.
lgtunit): https://logtalk.org/handbook/devtools/lgtunit.html| Skill | Use when |
|---|---|
skills/logtalk-coding-style/SKILL.md | Layout, naming, refactors, style review |
skills/logtalk-debugging/SKILL.md | Debug mode, debugger, breakpoints, tracing |
skills/logtalk-documenting/SKILL.md | info/1, info/2, mode/2, lgtdoc |
skills/logtalk-libraries/SKILL.md | Reusing standard libraries; avoiding duplicate local helpers |
skills/logtalk-packs/SKILL.md | Authoring packs and registries (pack_protocol, versions, checksums) |
skills/logtalk-performance/SKILL.md | Writing performant code |
skills/logtalk-portability/SKILL.md | Authoring portable applications and libraries |
skills/logtalk-scaffolding/SKILL.md | Scaffold a new app (directory, settings, loader, tester) |
skills/logtalk-testing/SKILL.md | Writing or running tests, tester.lgt, QuickCheck, coverage |
loader.lgt â loads code and dependenciestester.lgt â loads lgtunit, code under test, and tests; runs tests (name expected by logtalk_tester)tests.lgt (or `tests/`) â test objects extending lgtunitdoclet.lgt, NOTES.md, SCRIPT.txtdict_1.lgt) or .logtalk`| ?- logtalk_load(loader). % load application | ?- logtalk_load(tester). % load and run tests (typical driver) | ?- tests::run. % re-run tests | ?- tests::run(TestId). % single test
Automated (from a directory containing tester.lgt):
logtalk_tester -p <backend>
Compile tests with hook(lgtunit). For coverage, compile code under test with source_data(on) and usually debug(on). See the testing skill for dialects, parametric test objects, and CI notes.
Full rules: https://logtalk.org/coding_style_guidelines.html â also skills/coding-style/SKILL.md.
snake_case. Variables: CamelCase. Dynamic predicates often end with _.nl after write).make shortcuts inside source files.logtalk_load(lists(loader)), typically from the application loader.lgt.ctx7) instead of inventing a parallel helper.skills/libraries/SKILL.md
Use info/1 (entities) and info/2 (predicates/non-terminals), plus mode/2 for public predicates. Generate API docs with lgtdoc. Details: documenting skill and handbook.
Compile entities in debug mode to trace them (debug(on), logtalk_make(debug), or {+d}). Load debugger(loader). Use predicate/clause/conditional/context breakpoints via `debugger::spy/...`. Details: debugging skill and handbook.
lgtunit with a custom test harness.hook(lgtunit) when compiling test objects.loader.lgttester.lgt / logtalk_tester / `tests::run`)