Skip to content

Commit 6830a63

Browse files
committed
Slim Wurst agent template
1 parent 5784151 commit 6830a63

4 files changed

Lines changed: 75 additions & 223 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This repo builds the Grill CLI and project setup tooling. The generated map-proj
1515
- Local helpers in `config/ProjectConfigModels.kt` should stay thin: typealiases plus immutable copy helpers for shared records.
1616
- `YamlHelper.dumpProjectConfig` intentionally serializes a pruned YAML map instead of the shared records directly. This preserves the old user-facing `wurst.build` behavior by omitting null/default nested fields.
1717
- `wbschema.json` should stay lenient and aligned with the shared config parser, especially for `scriptMode`, `wc3Patch`, and nullable legacy fields.
18+
- Compiler-owned agent references belong in `~/.wurst/wurst-compiler/agent-docs/`. Generated project notes should prefer those version-matched local files when present and retain an online fallback until compiler releases ship them.
1819

1920
## WC3 Patch And Core JASS
2021

src/main/kotlin/file/SetupApp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object SetupApp {
3232

3333
private data class WurstProcessResult(val exitCode: Int, val output: List<String>)
3434

35-
internal const val AGENTS_TEMPLATE_VERSION = "2026-08-05"
35+
internal const val AGENTS_TEMPLATE_VERSION = "2026-08-08"
3636
private const val AGENTS_TEMPLATE_MARKER_PREFIX = "<!-- WURST_AGENTS_TEMPLATE_VERSION:"
3737
private const val AGENTS_TEMPLATE_MARKER = "<!-- WURST_AGENTS_TEMPLATE_VERSION: $AGENTS_TEMPLATE_VERSION -->"
3838
private const val AGENTS_TEMPLATE_SOURCE_HINT = "WurstScript Warcraft III map project notes"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import org.testng.Assert
2+
import org.testng.annotations.Test
3+
import java.nio.file.Files
4+
import java.nio.file.Paths
5+
6+
class AgentsTemplateTests {
7+
private val templatePath = Paths.get("templates", "AGENTS.md")
8+
9+
@Test
10+
fun testTemplateStaysTokenLean() {
11+
val content = Files.readString(templatePath)
12+
val wordCount = Regex("""\S+""").findAll(content).count()
13+
14+
Assert.assertTrue(wordCount <= 900, "AGENTS template grew to $wordCount words (limit: 900)")
15+
Assert.assertTrue(content.length <= 7000, "AGENTS template grew to ${content.length} characters (limit: 7000)")
16+
}
17+
18+
@Test
19+
fun testLanguageDocsPreferCompilerMatchedLocalReference() {
20+
val content = Files.readString(templatePath)
21+
val localReference = "~/.wurst/wurst-compiler/agent-docs/WURST_LANGUAGE.md"
22+
val onlineFallback = "https://wurstlang.org/manual.html"
23+
val localIndex = content.indexOf(localReference)
24+
val onlineIndex = content.indexOf(onlineFallback)
25+
26+
Assert.assertTrue(localIndex >= 0, "Missing compiler-matched local language reference")
27+
Assert.assertTrue(onlineIndex > localIndex, "Online manual must remain a fallback after the local reference")
28+
}
29+
}

0 commit comments

Comments
 (0)