-
Notifications
You must be signed in to change notification settings - Fork 0
3. MVP Development Task List
Version baseline: Minecraft 26.2, Fabric Loader 0.19.5, Loom 1.17-SNAPSHOT, Fabric API 0.161.0+26.2, Java 25.
Version configuration: All version numbers are centrally managed inmodsmith/config.py.
Current MVP scope: Supports three item types:basic,food, andtool(fuelis not implemented for now due to Fabric API version compatibility issues).
Interaction modes: Dual modes: Chat (requirements clarification) + Execute (direct generation). The Web UI opens Chat by default.
Corresponding document: 3.1 Project Initialization and Environment Setup.md
Goal: Create the Python project skeleton, configure dependencies and the development environment, and implement the LLM invocation module.
Key outputs:
-
pyproject.toml,.venv/, directory structure -
modsmith/config.py(centralized version management) -
modsmith/cli.py(basic CLI skeleton) -
.env(Zhipu API key) -
generate_blueprint()function inmodsmith/llm/client.py
Notes:
- Write all version numbers to
config.pyto avoid hardcoding. - Use Zhipu GLM as the LLM backend. Base URL:
https://open.bigmodel.cn/api/anthropic. - The system prompt includes the complete Schema, few-shot examples, required-field descriptions, and version requirements.
- When loading examples, override version fields with values from
config.py. - Dependencies include
anthropic,jsonschema,jinja2,pillow,typer,rich, andpython-dotenv.
Corresponding document: 3.2 Define Blueprint Schema.md
Goal: Write a JSON Schema to constrain the blueprint structure output by the LLM.
Key outputs:
modsmith/blueprint/schema.json- Three examples under
modsmith/blueprint/examples/(basic, food, tool)
Notes:
- Use
allOf+if-thento implement conditional required fields. -
mod_idand itemidusepatternto restrict naming format. - Keep version field descriptions generic; concrete values are determined by
config.py. - Version numbers in example files are automatically overridden by
_load_examples().
Corresponding document: 3.3 Prepare Fabric Project Template.md
Goal: Convert fabric-example-mod into a parameterized template compatible with Minecraft 26.2+.
Key outputs:
- Parameterized templates under
modsmith/templates/fabric-project/ -
render_project()function inmodsmith/generator/project.py
Notes:
- Remove Yarn mappings; use official Mojang mappings.
- Use the
net.fabricmc.fabric-loomplugin, Java 25, and Gradle 9.5.1. - Remove all Mixin and
cliententry points. - In
fabric.mod.json,dependsuses~{{ minecraft_version }}. -
ExampleMod.javadoes not callModItemsGeneratedfor now.
Corresponding document: 3.4 Implement Blueprint Validation.md
Goal: Validate the blueprint returned by the LLM against the Schema; on failure, feed back corrections.
Key outputs:
-
validate_blueprint()andgenerate_validated_blueprint()inmodsmith/blueprint/validator.py
Notes:
- In retry feedback, list required fields and suggested default values for each type.
- Handle
jsonschema.ValidationErrorandjson.JSONDecodeErrorseparately. - Retry at most 3 times; throw
RuntimeErroron failure.
Corresponding document: 3.5 Implement Project Generator.md
Goal: Generate a complete project directory from the blueprint, integrating template rendering, Java code generation, and resource generation.
Key outputs:
-
generate_project()function inmodsmith/generator/project.py -
modsmith/generator/java.pyskeleton -
modsmith/generator/resources.pyskeleton
Notes:
-
generate_project()callsrender_project(),generate_java_items(),generate_resources(), andgenerate_all_textures()in sequence. - The
contextinproject.pyreads version defaults fromconfig.py; the blueprint cannot override versions.
Corresponding document: 3.6 Implement Java Code Generator.md
Goal: Generate complete, compilable Java registration code for each item.
Key outputs:
modsmith/templates/java/ModItemIds.java.jinjamodsmith/templates/java/ModItems.java.jinjamodsmith/templates/java/ModItemsGenerated.java.jinja- Complete implementation in
modsmith/generator/java.py
Notes:
- Supports
basic,food, andtooltypes (fuelis not implemented for now). - Tools use
Item.Propertiesmethods such as.sword()and.axe(). - Food uses
FoodPropertiesandConsumable; effects useApplyStatusEffectsConsumeEffect(package path updated). - Static field declaration order: declare
FoodProperties,Consumable, andToolMaterialfirst, thenItem. -
ModItemsGeneratedhandles creative tab registration and outputs item registration logs (for runtime verification). -
ExampleMod.javacallsModItemsGenerated.initialize().
Corresponding document: 3.7 Implement Resource File Generator.md
Goal: Generate client item definitions, model JSON, and translation files for each item.
Key outputs:
- Complete implementation in
modsmith/generator/resources.py
Notes:
- Tool types use the
minecraft:item/handheldparent; others useminecraft:item/generated. - Translation key format:
item.<mod_id>.<item_id>. - Generate
en_us.jsonandzh_cn.json(if there is a Chinese name).
Corresponding document: 3.8 Implement Texture Generator.md
Goal: Generate a 16x16 pixel texture for each item; shape, color, and pattern are determined by the visual field in the blueprint. The LLM proactively infers visual from the item name, type, and effects; users do not need to mention textures in the description.
Key outputs:
-
modsmith/generator/textures.py:generate_texture(),generate_all_textures()
Notes:
- The
visualobject as a whole is optional, but its internal fields are required if provided. If missing, fall back to defaults; if partially filled, trigger a retry. - Fallback mechanism: when there is no
visual, use an MD5 hash to generate a deterministic color; the default shape isabstract.
Corresponding document: 3.9 Implement Compilation Verification Module.md
Goal: Automatically run ./gradlew build; on failure, feed errors back to the LLM to correct the blueprint.
Key outputs:
-
run_gradle_build()andbuild_with_retry()inmodsmith/verifier/gradle.py
Notes:
- Use
subprocess.runto executegradlew buildwith a 5-minute timeout. -
project_diruses.resolve()to convert to an absolute path. -
_extract_errorsextracts error lines from stdout/stderr and normalizes them tostr. - Retry at most 3 times; each time feed the error information back to the LLM to correct the blueprint.
Corresponding document: 3.10 Implement Packaging Output.md
Goal: Package the project as a zip, copy the jar, and save the blueprint and README.
Key outputs:
-
package_output()inmodsmith/packager/archive.py -
run_pipeline()inmodsmith/pipeline.py
Notes:
- Source zip excludes
build/,.gradle/,.idea/, andrun/directories. - Find the non-sources, non-dev jar under
build/libs/. - README includes installation instructions and the complete blueprint JSON.
-
run_pipeline()integrates blueprint generation, project generation, compilation verification, and packaging output.
Corresponding document: 3.11 Implement CLI Entry Point.md
Goal: Integrate ModSmith into a user-friendly command-line tool.
Key outputs:
-
version,generate,chat, andwebcommands inmodsmith/cli.py
Notes:
- The
generatecommand supports--output,--project-dir, and--max-retriesoptions. - The
chatcommand supports one-shot questions and interactive conversation (/quit,/clear,/history). - Use
richto beautify output (panels, colored text). - Catch exceptions and provide friendly messages.
Corresponding document: 3.12 End-to-End Testing and Documentation.md
Goal: Write unit tests, perform end-to-end verification, and improve the README.
Key outputs:
- Test files under
tests/ test_e2e.pyREADME.md
Notes:
- Unit tests use mocks to avoid real calls to the LLM and Gradle.
- Fix the
SCHEMA_PATHpath in tests to avoid adding an extramodsmithlayer. - End-to-end tests cover at least 1-2 item types.
- README includes installation, configuration, usage, and development instructions.
Corresponding document: 3.13 Implement Web UI.md
Goal: Provide a browser-based graphical interface supporting generation, download, viewing blueprint/README, and one-click game launch verification.
Key outputs:
-
modsmith/web/app.py(FastAPI backend) -
modsmith/web/static/index.html(frontend page) -
modsmith webCLI command
Notes:
- Use SSE to push real-time logs.
- After generation completes, display the contents of
blueprint.jsonandREADME.mddirectly on the page. - Provide a "🎮 Verify in Game" button that runs
./gradlew runClientwhen clicked. - All file paths use
.resolve()to convert to absolute paths. -
run_clientusessubprocess.Popento launch the game in the background without blocking the response. - Do not reference Google Fonts; use system font stacks (
--font-sans,--font-mono) so they load directly in mainland China environments. - Test file
test_web.pyverifies basic APIs.
Corresponding document: 3.14 Automatic Verification Loop Upgrade.md
Goal: Upgrade "launch game + manual check" to "launch game + parse logs to automatically determine mod loading and item registration."
Key outputs:
-
run_client_with_log()inmodsmith/verifier/runtime.py - Output item registration logs in
ModItemsGenerated.java.jinja - Add a
/api/auto_verifyendpoint inmodsmith/web/app.py - Add a "🔍 Log Verification" button in
index.html
Notes:
-
subprocess.PopenreadsrunClientoutput line by line and detects key logs in real time. -
mod_loadedis determined byHello Fabric world from. -
item_registeredis determined byitem.<mod_id>.<item_id> registered. - Set a
timeoutto prevent waiting indefinitely when game startup fails. - Results are returned to the frontend via SSE or direct JSON.
Corresponding document: 3.15 Implement Chat Mode.md
Goal: Make ModSmith act as a requirements consultant, helping users clarify vague ideas into clear, executable mod descriptions. Chat mode does not generate code; it only outputs natural-language answers.
Key outputs:
-
chat_response()and_build_chat_system_prompt()inmodsmith/llm/chat.py - Add a
chatcommand inmodsmith/cli.py - Test script
test_chat.py
Notes:
- Role: requirements consultant, not technical mentor.
- Clear capability boundaries: only
basic,food, andtoolare supported; out-of-scope requests (blocks, crops, entities, etc.) are gently declined and guided to a similar type. - Clarification dimensions are limited: only ask about type, name, effects, values, and appearance; do not ask about acquisition methods, crafting, planting, enchanting, or other content ModSmith does not generate.
- Do not answer technical questions: if the user asks "how many hearts" or "what acquisition methods are there," briefly acknowledge and steer back to requirements.
- Do not fabricate out-of-scope content: do not design planting steps or crafting recipes.
- End with a fixed format: mark with
【需求摘要】(Requirements Summary) for easy frontend extraction. - Answer style: Simplified Chinese, conversational, 3-4 sentences, no technical jargon, no code blocks.
- Support multi-turn conversation (
historyparameter); CLI interactive mode supports/quit,/clear,/history.
Corresponding document: 3.16 Implement Mode Routing and Frontend Integration.md
Goal: Support both Chat and Execute modes in the Web UI with tab switching; open Chat by default; after a Chat conversation ends, generate a requirements summary in one click and switch to Execute to generate the mod.
Key outputs:
- Add four endpoints in
modsmith/web/app.py:/api/chat,/api/chat/stream/{session_id},/api/chat/clear,/api/chat/summarize - Add mode-switching tabs in
index.html(Chat first, Execute second), with Chat open by default - Chat UI: message bubbles, input box, send button, quick chips, clear button, organize-requirements button
-
summarizeToExecute()calls the backend summary endpoint and fills the result into the Execute description box
Notes:
-
CHAT_SESSIONSin-memory storage is completely independent fromTASKS. - Chat supports SSE streaming output (typewriter effect).
- Chat history is persisted with
localStorage, restored after refresh, and remains on the Chat tab. -
/api/chat/summarizefirst extracts the【需求摘要】marker, with LLM rewrite as fallback. - If the summary is empty or "not specified," prompt the user to continue the conversation instead of generating a junk description.
- Mode switching does not lose existing Execute results.
- The default tab is Chat:
currentMode = 'chat', andDOMContentLoadedexplicitly callsswitchMode('chat', ...). - Tab order: Concept Q&A (Chat) → Generate Mod (Execute).
- Support more item types (blocks, armor, entities)
- Add fuel support (waiting for a stable Fabric API solution on 26.2+)
- Change
/api/auto_verifyto an async task + SSE progress push - True streaming output for Chat (calling Zhipu API's streaming endpoint)
- Persist Chat conversations to SQLite so they survive service restarts
- Multi-item requirements: describe multiple items in one conversation and clarify them one by one
- Multi-user concurrency and task history
- Publish to PyPI
- Integrate more LLM backends
End of task list. Execute in order; commit to Git after each completed task to keep it rollback-friendly. Record and resolve issues as they arise.