Skip to content

[Feature]: Skill lifecycle management — auto-optimization on failure + usage-based retirement #95516

Description

@JIRBOY

Summary

Introduce a skill lifecycle management system with two complementary capabilities: (1) automatic skill optimization when execution fails or underperforms, and (2) a usage-based retirement mechanism that archives and eventually removes inactive skills.

Problem to solve

OpenClaw skills are treated as static artifacts. Once created, they never evolve in response to real-world execution results. This creates two pain points:

No feedback loop on failure. When a skill execution fails, produces incorrect output, or underperforms, the user must manually diagnose the issue and edit the skill definition. The system has all the information needed (error traces, user corrections, task outcome) but discards it. Over time, skills drift out of sync with the tools, APIs, or workflows they target.

Skill bloat with no cleanup path. Users accumulate skills over months. Active skills get buried under hundreds of rarely-used ones, inflating skill search noise and context overhead. There is no built-in mechanism to identify, archive, or retire stale skills. The existing skills.workshop.autonomous.enabled can create proposals but has no corresponding retirement pathway.

Proposed solution

A. Auto-optimization on failure

After a skill execution, detect signals of poor performance:

  • Hard failure: skill threw an error or produced an unparseable result
  • Soft failure: user provided a correction or override ("no, do it this way")
  • Performance degradation: skill took significantly longer than historical average, or required retries

When detected, automatically generate a Skill Workshop proposal (not a direct edit — safety first) that:

  1. Captures the failure context (error type, relevant input/output, user correction)
  2. Proposes a concrete modification to the skill definition
  3. Tags the proposal as auto-optimization with the failure signal as provenance
  4. Presents it for user approval through the existing Workshop review flow

This is distinct from #95477's "post-task self-reflection" (which focuses on discovering new skills from successful tasks). This proposal focuses on repairing existing skills from failure signals. Both are valuable and complementary.

B. Usage-based retirement mechanism

Track per-skill usage metrics:

Metric Purpose
Last execution timestamp Inactivity detection
Total execution count Popularity ranking
Success/failure ratio Quality signal
Average execution time Performance trend

Apply a tiered retirement policy:

Inactivity threshold Action
90 days Flag as "low activity" — lower in skill search ranking
180 days Auto-archive — removed from active skill list but preserved in a recoverable archive
365 days Candidate for retirement — prompt user for deletion confirmation, or auto-delete if user has enabled skills.retirement.autoDelete

Archived skills should remain readable and restorable. The archive is a visibility filter, not a data deletion.

Integration with existing systems

  • Skill Workshop: proposals from auto-optimization flow through the existing Workshop approval gate (like skills.workshop.autonomous.enabled proposals)
  • ClawHub: skill retirement telemetry (anonymized) could inform ClawHub skill quality rankings
  • Dashboard: a openclaw skills lifecycle command showing active / archived / retiring skills with their metrics

Alternatives considered

Impact

  • Affected users: All OpenClaw skill users, especially those with 50+ skills or long-running workspaces
  • Severity: Medium — skill bloat is a gradual productivity drag, not a blocker
  • Frequency: Continuous — every session uses the skill registry
  • Consequence of inaction: Users manually manage skill lifecycle or accept degraded skill search quality as their collection grows

Evidence/examples

Additional information

The auto-optimization and retirement features should be independently toggleable:

skills:
  autoOptimization:
    enabled: true
    triggerOn: [hard_failure, user_correction]  # soft_failure optional
  retirement:
    enabled: true
    archiveAfterDays: 180
    retireAfterDays: 365
    autoDelete: false  # requires explicit confirmation by default

This ensures users who want only one feature (e.g., retirement without auto-optimization) can configure it independently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low-priority cleanup, docs, polish, ergonomics, or speculative work.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions