diff --git a/AGENTS.md b/AGENTS.md index 733fc7c..04156ac 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,6 +1,7 @@ # AI Agent Notes ## Canonical AI References +- Public discovery: `https://lynglang.com/llms.txt`; workflow: `docs/ai_agents.md`. Keep these links current when moving canonical references. - Use `docs/ai_language_reference.md` as the primary, compiler-verified Lyng language reference for code generation. - For generics-heavy code generation, follow `docs/ai_language_reference.md` section `7.1 Generics Runtime Model and Bounds` and `7.2 Differences vs Java / Kotlin / Scala`. - Use `docs/ai_stdlib_reference.md` for default runtime/module APIs and stdlib surface. diff --git a/README.md b/README.md index bd81b9a..a200e3e 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ assertEquals(A.E.One, A.One) ## Resources: - [Language home](https://lynglang.com) +- [AI agent instructions](docs/ai_agents.md) and [machine-readable entry point](https://lynglang.com/llms.txt) - [introduction and tutorial](docs/tutorial.md) - start here please - [Latest release notes (1.5.6)](docs/whats_new.md) - [What's New in 1.5](docs/whats_new_1_5.md) diff --git a/docs/ai_agents.md b/docs/ai_agents.md new file mode 100644 index 0000000..fb1acbe --- /dev/null +++ b/docs/ai_agents.md @@ -0,0 +1,24 @@ +# Lyng instructions for AI agents + +Before writing Lyng, read the [current language reference](ai_language_reference.md) +and [compact standard-library reference](ai_stdlib_reference.md). These are the +canonical implementation-oriented references; older specifications and proposals +must not override them. Discover them from . + +Use the language reference for syntax, types, generic bounds, imports, and current +limitations. Use the stdlib reference to distinguish default globals from explicit +imports and optional host modules. Follow links to individual API pages when you +need more detail. Do not guess Kotlin/Java method names or assume optional modules +are installed. Check the host runtime version and validate uncertain constructs +with a small read-only script before changing user data. + +For offline embedding, copy both compact references from the same committed Lyng +revision, retain their paths and commit ID, and split long results at section +boundaries to fit the host's tool output limit. Keep host-specific capability and +permission documentation alongside them. In Tetradion, call `agent.docsList()` or +`agent.docsSearch("query")`, then `agent.docs("reference.syntax")`, +`agent.docs("reference.flow")`, `agent.docs("reference.types")`, +`agent.docs("reference.modules")`, or `agent.docs("reference.stdlib")`. + +The site publishes these Markdown files directly under `/docs/`, without requiring +JavaScript or browser automation. diff --git a/site/src/jsMain/resources/llms.txt b/site/src/jsMain/resources/llms.txt new file mode 100644 index 0000000..f443a30 --- /dev/null +++ b/site/src/jsMain/resources/llms.txt @@ -0,0 +1,14 @@ +# Lyng + +Lyng is a statically resolved scripting language. Read its current references before generating code; do not infer APIs from Kotlin or Java. + +## Canonical AI references +- [Language reference](https://lynglang.com/docs/ai_language_reference.md): implemented syntax, types, control flow, modules, and current limitations. +- [Standard-library reference](https://lynglang.com/docs/ai_stdlib_reference.md): default globals, collections, built-in imports, and optional modules. +- [Agent instructions](https://lynglang.com/docs/ai_agents.md): documentation workflow, version checks, and offline use. + +## Additional documentation +- [Tutorial](https://lynglang.com/docs/tutorial.md) +- [Source repository](https://gitea.sergeych.net/SergeychWorks/lyng) + +The two compact references above take precedence over older specs or proposals. Optional modules must be installed by the host. Verify uncertain constructs with a small read-only script on the actual runtime before editing user data.