Add or update an Ichika Auto Assistant task by wiring everything around the task implementation itself. Use when Codex needs to create a new task placeholder, register a task, add scheduler enable switches, extend config models and default JSON files, expose task settings in the desktop GUI, or verify that a new task is reachable from CLI and GUI without implementing the business logic yet.
Use this skill to integrate a new task into the IAA project after or before the task logic exists. Focus on task registration, config schema changes, default config migration, desktop GUI wiring, and minimal validation.
Choose the task type before editing files.
Use a regular task when it should participate in the main scheduler run. Use a manual task when it should only be launched explicitly from GUI or CLI.
In this repo:
iaa/tasks/registry.py
Put scheduled tasks in REGULAR_TASKS.
Put explicit-run tasks in MANUAL_TASKS.iaa/config/schemas.py
Add scheduler.<task>_enabled only for regular tasks.iaa/application/desktop/tab_main.py
Regular tasks usually get a checkbox plus ▶.
Manual tasks usually get only a launch entry or custom dialog.iaa/tasks/registry.pyiaa/config/schemas.py and iaa/config/base.py.iaa/config/manager.py include the new section.conf/ so current users can load the new model.If the user only wants a placeholder, implement the smallest safe stub:
@task(...) decoratorExample pattern:
from kotonebot import task, logging
from iaa.context import conf as get_conf, task_reporter
logger = logging.getLogger(__name__)
@task('活动商店', screenshot_mode='manual')
def event_shop() -> None:
rep = task_reporter()
items = list(get_conf().event_shop.purchase_items)
rep.message('活动商店功能暂未实现')
logger.info('Placeholder invoked. purchase_items=%s', items)
Always update all three places in iaa/tasks/registry.py:
REGULAR_TASKS or MANUAL_TASKSname_from_id() and TASK_INFOSIf one of these is missed, the task often becomes runnable in one surface but invisible or mislabeled in another.
Split config into two concepts:
event_shop_enabled: bool = Trueevent_shop: EventStoreConfig = EventStoreConfig()Typical files:
iaa/config/schemas.py
Add the new BaseModel for task-specific settings.
Add scheduler enable flags for regular tasks.
Update SchedulerConfig.is_enabled().iaa/config/base.py
Add the new task config field to IaaConfig.iaa/config/manager.py
Make sure newly created config files contain the new section.Update every existing config file under conf/.
This repo validates with Pydantic defaults at runtime, so some missing fields may appear to work, but leaving old JSON files stale causes confusion:
For placeholder list settings, prefer a few meaningful sample values instead of an empty list so the GUI demonstrates the intended format.
There are usually two GUI surfaces to wire.
iaa/application/desktop/tab_main.py
Add the task enable checkbox and manual run button if needed.
Save the scheduler bool back to config.
Add any new BooleanVar to app.store if other UI code reads selected tasks.iaa/application/desktop/tab_conf.py
Add task-specific settings UI.
Keep placeholder settings simple.
For list[str], use a multiline Text widget and serialize one item per line.iaa/application/desktop/index.py
If the selected-task summary/store tracks that task, add the new variable there too.Usually no separate CLI parser change is needed because iaa/main.py builds task validation from REGULAR_TASKS and MANUAL_TASKS.
Still verify the behavior:
run
appears in task list
can be invoked manuallyRun the cheapest checks first.
python -m compileall iaa
python launch_desktop.py
If test tooling exists, run focused tests next.
Suggested spot checks:
name_from_id() or TASK_INFOS, which makes labels inconsistent.is_enabled(), so the task never runs.conf/*.json, so saved configs lag behind code.tab_main.py but forgetting to persist it in _save_scheduler().list[str], one line per item is clearer than JSON-in-a-textbox.