Skip to content

Implement skill persistence service (codex) - #2433

Merged
numnx merged 1 commit into
feature/CODUX-149-self-reflection-persisten-skillsfrom
task/feature-codux-149-self-reflection-persisten-skil-t02-codex-mr9yc28l
Jul 7, 2026
Merged

Implement skill persistence service (codex)#2433
numnx merged 1 commit into
feature/CODUX-149-self-reflection-persisten-skillsfrom
task/feature-codux-149-self-reflection-persisten-skil-t02-codex-mr9yc28l

Conversation

@numnx

@numnx numnx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Implement skill persistence service

Automated task PR opened by Code UX for T02.

📋 Summary

Sprint: Sprint 149 · Self Reflection & Persisten Skills · Task: T02

Add disabled-by-default persistent skill storage for shareable agent self-enhancement and a configurable self-reflection improvement loop for planning and QA agents, with MCP management/search surfaces, runtime prompt injection, dashboard controls, tests, and docs.

📝 Full Task Prompt
## Objective
Build the backend persistence and retrieval layer for persistent skills, including markdown import/export and semantic search, using the contracts from T01.

## Scope
- `src/repositories/skill-repository.ts` (new)
- `src/services/skill-service.ts` (new)
- `src/services/skill-markdown-parser.ts` (new)
- `src/services/embedding-service.ts` and `src/services/memory-service.ts` only as reference or minimal shared helper extraction if needed
- `src/contracts/skill-types.ts` (new, if T01 did not create a dedicated file)
- `tests/backend/repositories/skill-repository.test.ts` (new)
- `tests/backend/services/skill-service.test.ts` (new)
- `docs/dashboard/memory.md`
- `docs/architecture/agent-preset-foundation.md`

## Implementation Requirements
1. Implement `SkillRepository` methods for creating/listing/updating/deleting skill storages, attaching/detaching storages to agent presets, and CRUD for skills within a storage with project ownership checks.
2. Implement `SkillService` methods for writing a skill from markdown/frontmatter, rendering a skill back to markdown, listing by storage or agent, and searching skill content with bounded vector ranking similar to `MemoryService.search`.
3. Store embeddings in `skill_embeddings` with model and dimension metadata; skip or mark unembedded skills when no embedding provider is available rather than failing ordinary CRUD.
4. Parse skill markdown with YAML-like frontmatter fields such as `title`, `description`, `tags`, `appliesTo`, and `version`, while preserving the body as the authoritative skill instruction content.
5. Enforce project boundaries for every storage, skill, attachment, and search operation; deleting a storage must cascade or explicitly remove its skills, embeddings, and agent bindings.
6. Add deterministic tests for CRUD, project isolation, markdown round-trip, embedding dimension filtering, top-K ordering, and agent-attached storage search.
7. Update docs to explain how persistent skills differ from project memory and how vector search ranks skills.

## Constraints
- Depends on T01 contracts and tables; do not redefine incompatible schema names.
- Do not expose MCP tools or dashboard UI in this task.
- Keep vector search bounded and deterministic; avoid full-history dashboard-side reconciliation or unbounded scans.
- Do not write skill files into the project workspace or `.code-ux/` sprint directories.

## Verification
- Run `pnpm run lint`.
- Run `pnpm run test:backend -- tests/backend/repositories/skill-repository.test.ts tests/backend/services/skill-service.test.ts`.
- Success means persistent skill CRUD, markdown parsing, attachment lookup, and vector search work with project isolation and deterministic ordering.

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-07 01:09:57 UTC
Finished 2026-07-07 01:20:03 UTC
Duration 10m 6s

📊 Token Usage

Metric Value
Input tokens 222,351
Cached input tokens 2,799,872
Output tokens 23,412
Total tokens 3,045,635
Invocations 1
Tool calls 57
Active time 9m 41s

Included usage estimate (subscription/local login): $3.21

🌿 Branch Info

Base: feature/CODUX-149-self-reflection-persisten-skills
Head: task/feature-codux-149-self-reflection-persisten-skil-t02-codex-mr9yc28l


🤖 Generated by Code UX

@numnx
numnx merged commit 97361f8 into feature/CODUX-149-self-reflection-persisten-skills Jul 7, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-149-self-reflection-persisten-skil-t02-codex-mr9yc28l branch July 7, 2026 01:22
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