Skip to content

Self-Improvement System: Agent autonomously builds tools, creates skills, and extends itself #143

Description

@priyanshujain

Summary

Build a self-improvement system that lets the agent autonomously extend its own capabilities — building tools, creating skills, modifying config, and installing external skills — with user approval as the safety guardrail.

Full requirements document: docs/self-improvement-requirements.md

Philosophy

The agent is autonomous. It decides how to accomplish tasks. No hard-wired rules — just capabilities (tools, workspace, skills) and guardrails (guarded actions for user approval). Analogous to Claude Code building tools for users, except the agent builds tools for itself.

Core Capabilities

1. Skill Creator (Meta-Skill)

A skill that teaches the agent the obk skill format and how to create/update skills. Foundation for all self-improvement — agent uses this to create skills from scratch, from user requests, or by adapting external sources.

2. Workspace

Configurable directory (~/.obk/workspace/ default) where the agent builds and maintains tools (CLIs, scripts, utilities). User can set custom path via config.

3. Tool Building

Agent builds executable tools to extend its own capabilities. Delegates heavy coding to Claude Code via delegate_task when available, falls back to bash/subagent. Agent orchestrates the full lifecycle: plan → implement → verify → install.

4. Config Self-Modification

Agent uses obk CLI to modify its own config. All changes go through GuardedAction (user approval). No scope restrictions — agent can change any config field.

5. External Skill Installation

User pastes a GitHub link → agent clones to staging, explores, creates obk-compatible skills via skill-creator. No format requirements on external repos — agent adapts whatever it finds.

6. Web UI for Credentials

Extend existing web server with one-time credential input forms. Agent generates URL, shares via Telegram, user enters key in browser, key saved to keyring. Works through ngrok/cloudflare reverse proxy.

Architecture

  • Main Go agent is the orchestrator — delegates heavy work to Claude Code or subagents
  • Both Claude Code assistant and Telegram Go agent benefit from created skills (shared ~/.obk/skills/)
  • No dedicated "coding agent" — just the main agent + delegation capabilities
  • User can stop/change scope mid-task; agent adapts

Safety

All write operations use existing GuardedAction flow:

  • Skill creation/update → user approval
  • Tool building/install → user approval
  • Config changes → user approval
  • External repo cloning → user approval
  • Skills can include [!CAUTION] markers and confirmation rules (existing pattern)

Testing

End-result verification (black-box):

  • Skill creation → verify files exist, manifest/index updated, skill loadable
  • Tool building → verify tool exists, is executable, associated skill works
  • Config modification → verify config updated, value takes effect
  • External install → verify skills created from arbitrary repo
  • Credential UI → verify form renders, credential stored, form invalidated

Tests in usecase/self_improvement/.

Implementation Components

Component Location
skill-creator skill skills/skill-creator/SKILL.md + REFERENCE.md
Workspace config config/config.go (WorkspaceConfig)
Credential handler internal/server/credential_handler.go
Workspace initialization internal/workspace/workspace.go
Integration tests usecase/self_improvement/

Relationship to Existing Plan

Supersedes the "Self-Modification Capabilities" and "Self-Authored Skills" sections in docs/agent-requirements.md (Phase 5 in dev plan). This is a significantly deeper, more agentic version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions