Skip to content

feat(skill): add atomic skill folder import - #126

Closed
ObsisMc wants to merge 1 commit into
ora-space:demofrom
ObsisMc:skill-upload
Closed

feat(skill): add atomic skill folder import#126
ObsisMc wants to merge 1 commit into
ora-space:demofrom
ObsisMc:skill-upload

Conversation

@ObsisMc

@ObsisMc ObsisMc commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Add POST /api/skills/import to upload a local skill folder as one multipart request and commit it atomically across the filesystem and the database.

Files stream into an atoms/skills/<uuid>.tmp staging directory, the staged SKILL.md front matter resolves the skill name and description, then a unit of work inserts the row, renames staging to the committed <name> directory, and commits together — so a failure at any point leaves neither a row nor a promoted directory. Startup reconciliation discards *.tmp staging and any committed directory not backed by a visible skill row, and skill deletion now removes its committed folder.

Keep the orchestration hexagonal: a SkillPackageStore port with a local filesystem adapter, a SkillImportUnitOfWork closure port whose SQLite adapter holds the transaction open across the directory promote, and folder/manifest validation, all under crates/application/src/skill. Guard uploads with a 50MB body limit, a 1000-file cap, safe-name and safe-path checks, and empty/duplicate-path rejection, mapping failures to 422/409/413 responses.

Add POST /api/skills/import to upload a local skill folder as one
multipart request and commit it atomically across the filesystem and
the database.

Files stream into an `atoms/skills/<uuid>.tmp` staging directory, the
staged SKILL.md front matter resolves the skill name and description,
then a unit of work inserts the row, renames staging to the committed
`<name>` directory, and commits together — so a failure at any point
leaves neither a row nor a promoted directory. Startup reconciliation
discards `*.tmp` staging and any committed directory not backed by a
visible skill row, and skill deletion now removes its committed folder.

Keep the orchestration hexagonal: a SkillPackageStore port with a local
filesystem adapter, a SkillImportUnitOfWork closure port whose SQLite
adapter holds the transaction open across the directory promote, and
folder/manifest validation, all under crates/application/src/skill.
Guard uploads with a 50MB body limit, a 1000-file cap, safe-name and
safe-path checks, and empty/duplicate-path rejection, mapping failures
to 422/409/413 responses.
@EricWvi
EricWvi deleted the branch ora-space:demo July 27, 2026 10:49
@EricWvi EricWvi closed this Jul 27, 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