Skip to content

feature:skill creation/improved from completed task#236

Merged
zfoong merged 2 commits into
V1.3.1from
feature/skill-creation-from-task
May 6, 2026
Merged

feature:skill creation/improved from completed task#236
zfoong merged 2 commits into
V1.3.1from
feature/skill-creation-from-task

Conversation

@zfoong
Copy link
Copy Markdown
Collaborator

@zfoong zfoong commented May 1, 2026

What and why?
CraftBot now create and improve skill from completed tasks. CraftBot distils the action trace into a reusable skills//SKILL.md for agent to read. The new skill auto-enables and can be called immediately.

Features/items added

  • "Create Skill" button on completed tasks (hidden for internal workflow tasks like planner, heartbeat, memory processing).
  • Added two skills, craftbot-skill-creator and craftbot-skill-improve
  • Auto-enable + auto-sync so the new skill is enabled and slash commands / settings page refresh
  • ActionItem persistence extended with selected_skills + workflow_id (SQLite migration + frontend payloads).
  • MAX_SKILL_INSTRUCTIONS_TOKENS raised 2000 to 16000 to stop truncating skills.
  • TASK_HISTORY.md auto-creates on first append (matches EVENT.md pattern).
  • Fix command shows user chat bubble issue. Command will not create user chat bubble.

Potential issue

  • Skills might be written in the wrong directory, for example agent_file_system/skills.

@zfoong zfoong requested a review from ahmad-ajmal May 1, 2026 00:22
//
// KEEP IN SYNC with _INTERNAL_WORKFLOW_IDS / _INTERNAL_SKILL_NAMES in
// app/ui_layer/adapters/browser_adapter.py
const INTERNAL_WORKFLOW_IDS = new Set<string>([
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single source for the new internal/reserved skill lists

What: Keep the lists in browser_adapter.py only; have the frontend receive them via a new skill_meta WS message
Where: _INTERNAL_WORKFLOW_IDS / _INTERNAL_SKILL_NAMES / _RESERVED_SKILL_NAMES stay in browser_adapter.py; delete INTERNAL_WORKFLOW_IDS + INTERNAL_SKILL_NAMES in TasksPage.tsx and RESERVED_NAMES in SkillCreatorModal.tsx
Why: All three sets are new in this PR and already drifting, modal's RESERVED_NAMES is missing day-planner / week-planner / month-planner. Every future internal skill = 3 places to update

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move _INTERNAL_WORKFLOW_IDS / _INTERNAL_SKILL_NAMES / _RESERVED_SKILL_NAMES away from TaskPage. We have to keep internal workflow IDs and internal skills names as it is, we can have better system to register CraftBot special workflow in the next update.


_SKILL_NAME_PATTERN = re.compile(r"^[a-z][a-z0-9-]{1,63}$")

async def _handle_create_skill_from_task(self, data: Dict[str, Any]) -> None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract SkillWorkflowSpawner from the WS handler

What: Move the validation / source lookup / SOURCE-write / spawn flow out of the WS handler into a dedicated module
Where: Refactor browser_adapter.py:_handle_create_skill_from_task (~180 new lines) so the handler shrinks to parse → spawn → broadcast
Why: A handler this large can't be unit-tested without a WS connection; future non-browser adapters will copy-paste it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. But let's keep this until the browser adapter refactor.

@zfoong zfoong requested a review from ahmad-ajmal May 2, 2026 09:04
@zfoong zfoong merged commit 5f97ae7 into V1.3.1 May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants