Skip to content

feat: skill learning — record agent turns, rank skills and draft improvements - #195

Merged
cmdaltctr merged 4 commits into
mainfrom
feat/skill-learning
Oct 31, 2026
Merged

cmdaltctr merged 4 commits into
mainfrom
feat/skill-learning

Conversation

@cmdaltctr

Copy link
Copy Markdown
Owner

Summary

Adds opt-in skill learning on Pi, OpenCode and Claude Code. OMMS records how agents work, ranks the skills you use, and drafts better versions as reviewed proposals. OpenSpec change skill-learning (archived as 2026-10-31-skill-learning), decision recorded in ADR-036.

  • Recording (off by default). skillLearning records full turns (prompt, replies, tool calls with outcome and error) in a separate skills.db in the global storage path. Tool output is not stored. Redaction of <private> text and secrets is on by default and can be turned off after a confirmation.
  • One shared turn path. Live capture and history import both go through handleFinishedTurn. Memories and the profile get exactly the same input as before (tests check this byte for byte).
  • Import target. --skip-skills, a Skill turns checkbox, automatic backfill, and Record past turns (skills record-past) fill skills.db from history with no model call, including sessions whose worktree was deleted.
  • Ranking. Most used by default, plus a Needs attention order: attention = (failures + 1) / (uses + 2), counting only failures after the skill was used in that turn. Suggested needs at least 5 uses, attention ≥ 0.3 and a new failure since the last draft or review.
  • Proposals. Draft an improvement or a new skill through the external API, or let the coding agent fix it itself (skills tool modes evidence → propose, no external API call). Every change is a proposal with a diff. Apply by hand or per skill automatically, with a stale-file check and undo.
  • Surfaces. New Skills page and Skill learning settings card, skills tool on all three hosts (V1 and V2 OpenCode), and om-memory-system skills.

Also in this PR

  • busy_timeout and foreign keys are set again after every transaction. libSQL opened a fresh handle without them, so a second writer got SQLITE_BUSY at once.
  • Deleted turn text no longer stays readable in skills.db (VACUUM after delete). ai-sessions.db uses secure_delete and is compacted once when it has free pages.
  • Category cleanup routes move from web-server.ts into profile-cleanup-routes.ts (21 lines of headroom under the size ceiling).
  • Browser password fields no longer take the full width.
  • --skip-memories and --skip-profile help text corrected now that imports have three targets.

Checks

  • bun run ci:local on the merged branch: 460 test files. One stale V2 test was fixed afterwards and re-run with its related files.
  • bash scripts/test-claude-mod.sh: 69 pass.
  • openspec validate strict: the three new main specs pass (30 older specs already fail strict on main).
  • Live check on a second web app with a temporary home and copied history: Record past turns (98 turns across 3 hosts, re-run adds 0), one live turn per host stored once, one paid draft, apply, undo, refused undo after a hand edit, delete and compaction. Memories and the profile unchanged, no turn text in omms.log.
  • Browser check at 1280 px and 390 px, light and dark.

Follow-up issues

#189, #190, #191, #192, #193, #194

…ovements

Adds opt-in skill learning across Pi, OpenCode and Claude Code.

- Records full turns (prompt, replies, tool calls with outcome) into a
  separate skills.db through one shared turn path used by live capture and
  history import. Memories and the profile get the same input as before.
- Redaction of <private> text and secrets is on by default and can be
  turned off with a confirmation.
- Skill turns are a third import target (--skip-skills, Skill turns
  checkbox, automatic backfill) and Record past turns fills skills.db from
  history with no model call.
- Ranks skills by use and by an attention score that counts only failures
  after the skill was used; Suggested marks skills worth improving.
- Drafts improvements and new skills through the external API, or lets the
  coding agent propose a fix itself through the skills tool. Each change is
  a reviewed proposal with a diff, applied by hand or automatically, with a
  stale check and undo.
- New Skills page, Skill learning settings card, skills tool on every host
  and the om-memory-system skills command.
- Fixes found on the way: busy_timeout and foreign keys are set again after
  each transaction, deleted text no longer stays in skills.db or
  ai-sessions.db, category cleanup routes move into their route module, and
  the browser password fields no longer take the full width.

ADR-035 records the decision.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 192 files, which is 92 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 3c1155c and f99e004.

Files selected for processing: 192
  • AGENTS.md
  • CONTRIBUTING.md
  • README.md
  • docs/README.md
  • docs/adr/036-skill-learning-stores-full-turns-in-skills-db.md
  • docs/adr/ADR_README.md
  • docs/claude-code-adapter.md
  • docs/claude-code-history-import.md
  • docs/cli.md
  • docs/configuration.md
  • docs/opencode-adapter.md
  • docs/opencode-history-import.md
  • docs/pi-adapter.md
  • docs/pi-history-import.md
  • docs/shared-core.md
  • docs/skill-learning.md
  • docs/web-ui-memory.md
  • docs/web-ui-settings.md
  • docs/web-ui.md
  • hooks/omms-memory-tool.jsx
  • hooks/omms-memory-tool.test.ts
  • hooks/omms-skills-tool.jsx
  • hooks/omms-skills-tool.test.ts
  • hooks/omms.jsx
  • openspec/changes/archive/2026-10-31-skill-learning/.openspec.yaml
  • openspec/changes/archive/2026-10-31-skill-learning/design.md
  • openspec/changes/archive/2026-10-31-skill-learning/proposal.md
  • openspec/changes/archive/2026-10-31-skill-learning/specs/skill-learning-capture/spec.md
  • openspec/changes/archive/2026-10-31-skill-learning/specs/skill-learning-proposals/spec.md
  • openspec/changes/archive/2026-10-31-skill-learning/specs/web-skills/spec.md
  • openspec/changes/archive/2026-10-31-skill-learning/tasks.md
  • openspec/specs/skill-learning-capture/spec.md
  • openspec/specs/skill-learning-proposals/spec.md
  • openspec/specs/web-skills/spec.md
  • src/adapters/opencode/conversation.ts
  • src/adapters/opencode/skills-tool.ts
  • src/adapters/pi/capture.ts
  • src/adapters/pi/extension.ts
  • src/adapters/pi/skills-tool.ts
  • src/cli/index.ts
  • src/cli/skills-command.ts
  • src/cli/skills-record-past.ts
  • src/config-template.ts
  • src/config.ts
  • src/core/host.ts
  • src/core/profile-backoff.ts
  • src/core/skill-agent-modes.ts
  • src/core/skill-operation-reply.ts
  • src/core/skill-operations.ts
  • src/core/skills-tool.ts
  • src/core/tool-input.ts
  • src/core/tool-outcome.ts
  • src/core/turn-outputs.ts
  • src/importer/auto-backfill.ts
  • src/importer/claude-conversation.ts
  • src/importer/claude-hook-api.ts
  • src/importer/claude-import.ts
  • src/importer/claude-reader.ts
  • src/importer/claude-turn-units.ts
  • src/importer/import-args.ts
  • src/importer/import-project.ts
  • src/importer/import-runs.ts
  • src/importer/import-sessions.ts
  • src/importer/import-turn-outputs.ts
  • src/importer/importer.ts
  • src/importer/opencode-import.ts
  • src/importer/opencode-reader.ts
  • src/importer/pi-conversation.ts
  • src/importer/record-past-turns.ts
  • src/importer/run-import.ts
  • src/importer/web-import-api.ts
  • src/importer/web-import-group.ts
  • src/importer/web-import-jobs.ts
  • src/index.ts
  • src/services/ai/session/ai-session-manager.ts
  • src/services/auto-capture.ts
  • src/services/chat/chat-runtime.ts
  • src/services/global-config-writer.ts
  • src/services/profile-cleanup-routes.ts
  • src/services/settings-snapshot.ts
  • src/services/skill-learning/agent-proposals.ts
  • src/services/skill-learning/apply.ts
  • src/services/skill-learning/auto-review.ts
  • src/services/skill-learning/draft-turns.ts
  • src/services/skill-learning/drafting.ts
  • src/services/skill-learning/line-diff.ts
  • src/services/skill-learning/operations-deps.ts
  • src/services/skill-learning/proposal-store.ts
  • src/services/skill-learning/ranking.ts
  • src/services/skill-learning/settings-for.ts
  • src/services/skill-learning/skill-config.ts
  • src/services/skill-learning/skill-detect.ts
  • src/services/skill-learning/skill-folders.ts
  • src/services/skill-learning/skill-index.ts
  • src/services/skill-learning/skill-model.ts
  • src/services/skill-learning/store.ts
  • src/services/skill-learning/turn-output.ts
  • src/services/skill-learning/turn-summaries.ts
  • src/services/skill-learning/web-review.ts
  • src/services/skill-routes.ts
  • src/services/turso/connection-manager.ts
  • src/services/turso/table-lease.ts
  • src/services/turso/turso-db.ts
  • src/services/user-prompt/profile-catch-up-lease.ts
  • src/services/web-jobs.ts
  • src/services/web-route-modules.ts
  • src/services/web-server.ts
  • src/v2/adapter.ts
  • tests/ai-session-manager.test.ts
  • tests/auto-backfill.test.ts
  • tests/capture-prompt-tool-outcome.test.ts
  • tests/category-cleanup-routes.test.ts
  • tests/claude-conversation.test.ts
  • tests/claude-hook-api.test.ts
  • tests/history-import-commands.test.ts
  • tests/host-neutral-capture-boundary.test.ts
  • tests/import-args.test.ts
  • tests/opencode-auto-capture-conversation.test.ts
  • tests/opencode-reader.test.ts
  • tests/opencode-skills-tool.test.ts
  • tests/pi-conversation.test.ts
  • tests/pi-extension.test.ts
  • tests/skill-config.test.ts
  • tests/skill-draft-backoff.test.ts
  • tests/skill-learning-agent-fix.test.ts
  • tests/skill-learning-agent-hosts.test.ts
  • tests/skill-learning-apply.test.ts
  • tests/skill-learning-auto-review.test.ts
  • tests/skill-learning-cli.test.ts
  • tests/skill-learning-detect.test.ts
  • tests/skill-learning-drafting.test.ts
  • tests/skill-learning-import.test.ts
  • tests/skill-learning-live-sites.test.ts
  • tests/skill-learning-proposal-store.test.ts
  • tests/skill-learning-ranking.test.ts
  • tests/skill-learning-storage-path.test.ts
  • tests/skill-learning-store.test.ts
  • tests/skill-learning-turn-output.test.ts
  • tests/skill-learning-web-jobs.test.ts
  • tests/skill-learning-web-review.test.ts
  • tests/skill-operations.test.ts
  • tests/skills-record-past.test.ts
  • tests/turso-connection-manager.test.ts
  • tests/v2-plugin-adapter.test.ts
  • tests/web-import-group.test.ts
  • tests/web-skill-routes.test.ts
  • web/src/App.tsx
  • web/src/lib/components/explorer/AppSidebar.tsx
  • web/src/lib/components/explorer/sidebar-main-nav.tsx
  • web/src/lib/components/memory/ImportOptions.tsx
  • web/src/lib/components/memory/ImportProgressBar.tsx
  • web/src/lib/components/memory/ImportResults.tsx
  • web/src/lib/components/memory/ImportSection.tsx
  • web/src/lib/components/memory/import-draft.ts
  • web/src/lib/components/memory/import-finish.ts
  • web/src/lib/components/memory/import-host-choice.ts
  • web/src/lib/components/memory/import-model-blocker.ts
  • web/src/lib/components/memory/import-types.ts
  • web/src/lib/components/settings/KeysAccessSection.tsx
  • web/src/lib/components/settings/SettingsView.tsx
  • web/src/lib/components/settings/SkillLearningSection.tsx
  • web/src/lib/components/skills/Callout.tsx
  • web/src/lib/components/skills/DraftNotice.tsx
  • web/src/lib/components/skills/HuePill.tsx
  • web/src/lib/components/skills/ModeChoice.tsx
  • web/src/lib/components/skills/ProposalCard.tsx
  • web/src/lib/components/skills/ProposalDiff.tsx
  • web/src/lib/components/skills/RecordPast.tsx
  • web/src/lib/components/skills/SkillDetail.tsx
  • web/src/lib/components/skills/SkillFolders.tsx
  • web/src/lib/components/skills/SkillIdeas.tsx
  • web/src/lib/components/skills/SkillList.tsx
  • web/src/lib/components/skills/SkillSortChoice.tsx
  • web/src/lib/components/skills/SkillsView.tsx
  • web/src/lib/components/skills/TurnList.tsx
  • web/src/lib/components/skills/use-record-past.ts
  • web/src/lib/components/skills/use-skill-settings.ts
  • web/src/lib/i18n/settings.ts
  • web/src/lib/i18n/skills.ts
  • web/src/lib/i18n/translations.ts
  • web/src/lib/routes.ts
  • web/src/lib/settings-sections.ts
  • web/src/lib/skills-api.ts
  • web/src/lib/skills-model.ts
  • web/tests/import-scope-change.spec.ts
  • web/tests/memory-navigation.spec.tsx
  • web/tests/memory-workspace-import.spec.tsx
  • web/tests/settings-page-fixes.spec.tsx
  • web/tests/sidebar-settings-tree.spec.tsx
  • web/tests/skills-components.spec.tsx
  • web/tests/skills-import-option.spec.tsx
  • web/tests/skills-model.spec.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- Pass the project folder to the skills and memory tools' launcher, so the npx fallback no longer runs against the temp folder
- Keep a skill idea's reason and evidence when drafting from any host or the CLI
- Keep the saved Skill turns choice when the Re-analyse preset is used
- Let ai-sessions.db open when its one-time compaction fails
@cmdaltctr
cmdaltctr merged commit 81531ca into main Oct 31, 2026
5 checks passed
@cmdaltctr
cmdaltctr deleted the feat/skill-learning branch October 31, 2026 10:24
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.

1 participant