Skip to content
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This repo builds the Grill CLI and project setup tooling. The generated map-project agent notes live in `templates/AGENTS.md`; keep this root file focused on WurstSetup itself.

## Editing templates/AGENTS.md

- The first line marker must stay in lockstep with `SetupApp.AGENTS_TEMPLATE_VERSION` (a test enforces this); bump both when changing the template.
- Keep the intro line starting with "WurstScript Warcraft III map project notes" — `AGENTS_TEMPLATE_SOURCE_HINT` matches on it to detect template-derived files.
- Grill fetches the template from the raw GitHub URL on master, so pushing template changes publishes them to `grill install` users immediately. Only document language features after a compiler release ships them.
- Keep the template token-lean: it is loaded into every agent session in user projects. Prefer pointers to on-demand docs (stdlib/dependency `AGENTS.md`, the online manual) over inlining more content.

## Current Architecture

- Project config models come from `com.github.wurstscript:wurst-project-config`; do not reintroduce local DAO copies.
Expand Down
6 changes: 1 addition & 5 deletions src/main/kotlin/file/SetupApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object SetupApp {

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

internal const val AGENTS_TEMPLATE_VERSION = "2026-06-22"
internal const val AGENTS_TEMPLATE_VERSION = "2026-07-16"
private const val AGENTS_TEMPLATE_MARKER_PREFIX = "<!-- WURST_AGENTS_TEMPLATE_VERSION:"
private const val AGENTS_TEMPLATE_MARKER = "<!-- WURST_AGENTS_TEMPLATE_VERSION: $AGENTS_TEMPLATE_VERSION -->"
private const val AGENTS_TEMPLATE_SOURCE_HINT = "WurstScript Warcraft III map project notes"
Expand Down Expand Up @@ -546,10 +546,6 @@ object SetupApp {
internal var installPatchPrompt: ((String, String?) -> String?)? = null

internal fun prepareGenerate(setup: SetupMain): Boolean {
Comment thread
Frotty marked this conversation as resolved.
if (setup.commandArg.isNotBlank()) {
return true
}

val prompt = generatePrompt ?: terminalPrompt()
Comment thread
Frotty marked this conversation as resolved.

while (setup.commandArg.isBlank()) {
Expand Down
21 changes: 21 additions & 0 deletions src/test/kotlin/GenerateTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,27 @@ class GenerateTests {
Assert.assertTrue(setup.curatedDependencyIds.isEmpty())
}

@Test(priority = 10)
fun testGenerateWithNameUsesWizardPrompt() {
val setup = SetupMain()
setup.parseArgs(listOf("generate", "wizardproject"))
val answers = java.util.ArrayDeque(listOf("jass", "pre1.29", "none", "y", "y", "n"))
val prevPrompt = SetupApp.generatePrompt
try {
SetupApp.generatePrompt = { _, _ -> answers.removeFirst() }
Assert.assertTrue(SetupApp.prepareGenerate(setup))
} finally {
SetupApp.generatePrompt = prevPrompt
}

Assert.assertEquals(setup.commandArg, "wizardproject")
Assert.assertEquals(setup.scriptMode, ScriptMode.JASS)
Assert.assertEquals(setup.wc3Patch, CoreJassProvider.PRE_129_PATCH)
Assert.assertTrue(setup.addAgents)
Assert.assertTrue(setup.addGithubWorkflow)
Assert.assertTrue(setup.curatedDependencyIds.isEmpty())
}

@Test(priority = 10)
fun testGenerateWizardRejectsUnsupportedScriptModeAndPatchInput() {
val setup = SetupMain()
Expand Down
Loading
Loading