Initialize an ok-script App
Configure the cloned template only after collecting the user's project details.
Gather requirements first
Before editing files, ask the user for the following information in one concise questionnaire:
- Game name and desired application name/title.
- Runtime target(s): native Windows game, Android emulator/device, browser, or any combination. Require at least one.
- For Windows: executable filename(s) and window class, if known.
- For Android: package name(s) and emulator type, if known.
- For browser: initial URL, display name, and browser resolution.
- Source repository URL and update strategy: a dedicated update repository or the source repository during early testing.
- Replacement
icon.pngandicon.icofiles, or whether to keep the placeholders temporarily. - First task: class name, user-visible name, one-time or background trigger, and a short description of its behavior.
- Whether to integrate MirrorChyan and, if so, its resource ID and upload-token secret name.
- Supported aspect ratio/minimum resolution and any project/community links, if known.
Allow unknown optional values. Offer to retain safe template defaults or inspect runtime information later. Do not invent executable names, package names, repository URLs, or icons.
Inspect before editing
- Read
README.md,src/config.py,pyappify.yml,mkdocs.yml,.github/workflows, relevant files undersrc/tasks, and the relevant Chinese and English pages underdocs. - Check
git statusand preserve unrelated user changes. - Search for remaining
ok-script-app,ok-oldking, template repository URLs, and template-only release integrations. - Use the repository-local
.venvfor Python commands when it exists.
Apply the initialization
- Update
src/config.py:- Set
gui_titleand relevantlinks. - Configure
windows.exeandwindows.hwnd_classonly from supplied values. - Configure
adb.packagesonly from supplied values. - Configure
browser.url,browser.nick, andbrowser.resolutiononly from supplied values. - Require at least one of
windows,adb, orbrowser; retain every target type the user wants to support. - Adjust
supported_resolutionwhen specified. - Keep compatible capture and interaction defaults unless the user requests or the target requires a change.
- Set
- Replace
icons/icon.pngandicons/icon.icofrom user-provided assets. Keep their filenames unless there is a reason to rename them, and synchronize all references if renamed. - Update
pyappify.yml:- Set the application and profile names.
- Point each
git_urlto the chosen source or dedicated update repository. - Preserve Python 3.12 unless the project has a verified reason to change it.
- Review
.github/workflows/build.yml:- Replace project-specific repository URLs, artifact names, release links, and Git identity.
- For a dedicated update repository, configure the sync target around the user's chosen secret names and clearly report which repository secrets must be created.
- For source-repository testing, remove or disable update-repository sync steps that require unavailable template secrets.
- If using MirrorChyan, update
mirrorchyan_uploading.ymlandmirrorchyan_release_note.ymlwith the user's owner, repository, resource ID, installer filename, and secret name; retain the dispatch steps inbuild.yml. - If not using MirrorChyan, delete both MirrorChyan workflow files and remove their dispatch step from
build.yml. - Remove CNB integration when the user does not use it.
- Create the first task under
src/tasksand register its module/class pair inonetime_tasksortrigger_tasksinsrc/config.py.- Follow the repository's
$ok-script-tasksskill for task structure. - Use
$ok-script-codegenwhen implementing automation actions from a behavior description or screenshots. - Keep user-facing task strings translatable and use
$ok-script-i18nwhen translations are requested.
- Follow the repository's
- Update the documentation site:
- Set
site_name,site_description,repo_name,repo_url, andedit_uriinmkdocs.ymlfrom the initialized project. - Update template identity, repositories, installer names, targets, links, and setup details in both the Chinese pages under
docs/and the English pages underdocs/en/. - Keep the two languages structurally aligned and update
mkdocs.ymlnavigation when pages are added, moved, or removed. - Retain
.github/workflows/docs.ymlwhen the user wants GitHub Pages; otherwise explain that it may be removed.
- Set
- Keep
README.mdandREADME_en.mdas concise repository landing pages that link to the canonical MkDocs documentation.
Verify
- Parse modified Python files with
python -m compileallor run the relevant tests using the local.venv. - Validate YAML syntax when a YAML parser is available.
- Install
requirements-docs.txtin the local.venvand runpython -m mkdocs build --strictafter documentation changes. - Run
python main_debug.pyonly when launching the GUI is appropriate for the environment. - Search again for stale template names and URLs; distinguish intentional upstream documentation/action references from project-specific leftovers.
- Show the resulting diff and summarize any values still awaiting user input.
Do not create or push a tag unless the user explicitly asks to release. When requested, use a semantic tag such as v0.1.0; .github/workflows/build.yml triggers on v*.