-
Notifications
You must be signed in to change notification settings - Fork 0
Add CLAUDE.md with project context and architecture overview #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cbcdefe
Add CLAUDE.md with project context and architecture overview
claude e860d9e
Fix README directory names, remove non-existent output/ dir, add Outp…
claude b161008
Fix bugs: dead loop, IndexError, KeyError, unreachable code, silent p…
claude 1ddd363
Major feature expansion: maps, aircraft, mission types, co-op, kneebo…
claude 278ab51
Add .gitignore; remove cached pycache files
claude 8fdf5b8
Modernize GUI: card panels, status dots, progress bar, tagged output
claude d5978bb
Fix critical bugs causing DCS mission loading freeze
claude b5f225c
Remove tracked pyc file (covered by .gitignore)
claude 80854c2
Update pyproject.toml
2DoorDevelopment a57a1cc
Update kneeboard_generator.py
2DoorDevelopment 1c18aa5
Update README.md
2DoorDevelopment File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, "claude/**"] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Smoke tests — Python ${{ matrix.python-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Run tests | ||
| run: python -m pytest tests/ -v --tb=short | ||
|
|
||
| lint: | ||
| name: Import sanity check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Check all modules import cleanly | ||
| run: | | ||
| python -c " | ||
| import sys, importlib, pathlib | ||
| sys.path.insert(0, '.') | ||
| failures = [] | ||
| for f in pathlib.Path('src').rglob('*.py'): | ||
| mod = str(f).replace('/', '.').replace('.py', '') | ||
| try: | ||
| importlib.import_module(mod) | ||
| except Exception as e: | ||
| failures.append(f'{mod}: {e}') | ||
| if failures: | ||
| print('IMPORT FAILURES:') | ||
| for fail in failures: | ||
| print(' ', fail) | ||
| sys.exit(1) | ||
| print(f'All {len(list(pathlib.Path(\"src\").rglob(\"*.py\")))} modules import cleanly.') | ||
| " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| __pycache__/ | ||
| *.pyc | ||
| *.pyo | ||
| *.pyd | ||
| .pytest_cache/ | ||
| dist/ | ||
| build/ | ||
| *.spec | ||
| output/ | ||
| mission_history.json | ||
| *.miz | ||
| *.txt.bak |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # DCS Mission Manager — Claude Context | ||
|
|
||
| ## Project Overview | ||
|
|
||
| DCS Mission Generator v2.0 is a Python tool that generates realistic DCS World `.miz` mission files from plain-English descriptions. Users describe a mission (e.g., "SEAD mission in the F-16 on Caucasus with SA-11s") and the tool builds a complete, playable mission with waypoints, threat placement, friendly packages, briefings, and win/loss conditions. | ||
|
|
||
| **No external Python dependencies** — stdlib only, with optional Ollama (local LLM) for natural language parsing. | ||
|
|
||
| ## Running the Project | ||
|
|
||
| ```bash | ||
| # Console interface | ||
| python main.py | ||
|
|
||
| # Headless generation (no interactive prompt) | ||
| python main.py --generate "SEAD in the F-16 on Persian Gulf, hard" | ||
|
|
||
| # GUI interface (tkinter) | ||
| python gui.py | ||
|
|
||
| # Run tests | ||
| python -m pytest tests/ -v | ||
|
|
||
| # Build standalone Windows EXE | ||
| build_exe.bat | ||
| ``` | ||
|
|
||
| **Console commands:** `quick <desc>`, `maps`, `examples`, `history`, `campaign`, `settings`, `quit` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ``` | ||
| main.py Console entry point | ||
| gui.py GUI entry point (tkinter) | ||
| tests/ | ||
| test_smoke.py 22-test smoke suite (units, maps, builder, kneeboard) | ||
| src/ | ||
| generators/ | ||
| mission_builder.py Core: plan → mission data structures | ||
| lua_generator.py Mission data → DCS Lua table files | ||
| miz_packager.py Lua files → .miz zip archive (incl. kneeboard PNG) | ||
| briefing_generator.py 13-section tactical briefing generator | ||
| kneeboard_generator.py Pure-stdlib PNG renderer for DCS kneeboard cards | ||
| llm/ | ||
| ollama_client.py Ollama REST API client | ||
| mission_parser.py Natural language → structured plan (LLM + fallback) | ||
| maps/ | ||
| caucasus.py Caucasus map | ||
| syria.py Syria map | ||
| cold_war_germany.py Cold War Germany map | ||
| persian_gulf.py Persian Gulf map (UAE, Iran, Strait of Hormuz) | ||
| mariana_islands.py Mariana Islands map (Guam, Saipan, Pacific carrier ops) | ||
| units.py Aircraft, SAM, ground unit databases | ||
| difficulty.py Easy/Medium/Hard scaling logic | ||
| naming.py Operation name generator | ||
| callsigns.py Callsign and frequency assignment | ||
| flight_profile.py Altitude/speed/fuel calculations | ||
| mission_events.py Radio messages, win/loss, reinforcements | ||
| campaign.py Campaign system with debrief logic | ||
| custom_mods.py JSON mod loader for custom aircraft | ||
| dcs_detect.py DCS install auto-detection and deploy | ||
| validator.py Pre-flight mission validation | ||
| history.py Mission log tracker (JSON) | ||
| custom_aircraft/ User-extensible aircraft mod configs (JSON) | ||
| ``` | ||
|
|
||
| ## Key Concepts | ||
|
|
||
| - **Mission plan**: A structured dict produced by `mission_parser.py` from user input — contains aircraft, map, task type, difficulty, threat types, etc. | ||
| - **Mission builder**: `src/generators/mission_builder.py` takes a plan and produces DCS-ready data structures (waypoints, units, groups, etc.). | ||
| - **Lua generator + packager**: Converts data structures to DCS Lua tables, then zips them into a `.miz` file. The packager also renders a kneeboard PNG card and places it inside `KNEEBOARD/<aircraft_type>/` in the archive. | ||
| - **Custom aircraft**: Drop a JSON file in `custom_aircraft/` following `_template.json` to add modded aircraft without editing source. | ||
| - **Multiplayer**: Set `player_count` > 1 to generate co-op slots (slot 1 = `Player` skill, additional slots = `Client` skill for DCS multiplayer). | ||
|
|
||
| ## Player Aircraft | ||
|
|
||
| F-16C Viper, F/A-18C Hornet, F-15C Eagle, F-15E Strike Eagle, AV-8B Harrier II, Mirage 2000C, A-10C II Thunderbolt, JF-17 Thunder, AH-64D Apache — plus any custom mods in `custom_aircraft/`. | ||
|
|
||
| ## Maps | ||
|
|
||
| Caucasus, Syria, Cold War Germany, Persian Gulf, Mariana Islands. | ||
|
|
||
| ## Mission Types | ||
|
|
||
| SEAD, CAS, CAP, Strike, Anti-Ship, Escort, Convoy Attack, Convoy Defense, CSAR, FAC(A). | ||
|
|
||
| ## Code Style | ||
|
|
||
| - Python 3.10+, snake_case functions/variables, CamelCase classes | ||
| - Type hints used throughout (e.g., `str | None`, `list[dict]`) | ||
| - Module-level docstrings on all source files | ||
| - No linting or formatting tools are configured — follow existing style | ||
|
|
||
| ## Testing | ||
|
|
||
| ```bash | ||
| python -m pytest tests/ -v | ||
| ``` | ||
|
|
||
| 22 smoke tests cover: unit registry, map registry, flight profiles, mission builder (incl. multiplayer slots), kneeboard PNG generation, naming, and difficulty scaling. Run these after any change to verify nothing is broken. | ||
|
|
||
| ## Output | ||
|
|
||
| Generated `.miz` files are saved to the current directory (or auto-deployed to DCS Saved Games if DCS is detected). Each `.miz` includes an embedded kneeboard card PNG. `mission_history.json` is auto-created to log generated missions. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR title suggests this change only adds
CLAUDE.md, but the diff includes substantial functional changes (new maps, kneeboard PNG generation, validator changes, CI workflow, packaging config, etc.). Please update the PR title/description to reflect the full scope, or split into smaller PRs to make review and rollback safer.