Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .tegami/github-skill-import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
packages:
orgmemory: minor
subject: Import governed Skills from GitHub
---

## Improvements

Discover Skills in a public or administrator-approved private GitHub
repository, preview the exact commit and valid packages, then import selected
Skills as independent governed Drafts. Private access stays server-side through
an approved GitHub App connection, and every Draft retains immutable source
provenance.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
import com.orgmemory.core.assetregistry.AssetType;
import com.orgmemory.core.assetregistry.AssetView;
import com.orgmemory.core.assetregistry.SkillRegistryService;
import com.orgmemory.core.assetregistry.SkillGitHubImportService;
import com.orgmemory.core.assetregistry.SkillPackageInspection;
import com.orgmemory.core.permission.KnowledgeClassification;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.io.IOException;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -50,14 +55,17 @@ AssetType domainType() {

private final AssetRegistryService assets;
private final SkillRegistryService skills;
private final SkillGitHubImportService skillGitHub;
private final CurrentActorProvider actors;

AssetRegistryController(
AssetRegistryService assets,
SkillRegistryService skills,
SkillGitHubImportService skillGitHub,
CurrentActorProvider actors) {
this.assets = assets;
this.skills = skills;
this.skillGitHub = skillGitHub;
this.actors = actors;
}

Expand Down Expand Up @@ -109,6 +117,26 @@ record PublishAssetReleaseRequest(UUID revisionId, String versionLabel) {
record PublishSkillReleaseRequest(String versionLabel) {
}

record GitHubSkillSourceRequest(
@NotBlank @Size(max = 512) String repository,
String revision,
String subpath,
String connectionKey,
@NotNull UUID knowledgeSpaceId) {

SkillGitHubImportService.SourceRequest source() {
return new SkillGitHubImportService.SourceRequest(
repository, revision, subpath, connectionKey, knowledgeSpaceId);
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

record GitHubSkillImportRequest(
@Valid @NotNull GitHubSkillSourceRequest source,
@NotNull @Size(min = 1, max = 20) List<@NotBlank String> paths,
@NotBlank @Size(max = 128) String namespace,
KnowledgeClassification classification) {
}

record AssetAvailabilityRequest(String reason) {
}

Expand Down Expand Up @@ -181,6 +209,47 @@ SkillPackageInspection inspectSkill(
}
}

@PostMapping("/skills/github/preview")
@Operation(
operationId = "previewGitHubSkills",
summary = "Discover and validate Skills at one GitHub repository revision")
SkillGitHubImportService.Preview previewGitHubSkills(
@Valid @RequestBody GitHubSkillSourceRequest request,
Authentication authentication) {
return skillGitHub.preview(
actors.current(authentication), request.source());
}

@GetMapping("/skills/github/connections")
@Operation(
operationId = "listGitHubSkillConnections",
summary = "List approved GitHub connections available for private Skill import")
List<com.orgmemory.core.assetregistry.SkillGitHubSourcePort.ConnectionOption>
listGitHubSkillConnections(
@RequestParam UUID knowledgeSpaceId,
Authentication authentication) {
return skillGitHub.availableConnections(
actors.current(authentication), knowledgeSpaceId);
}

@PostMapping("/skills/github/import")
@Operation(
operationId = "importGitHubSkills",
summary = "Import selected Skills from an exact GitHub commit")
SkillGitHubImportService.ImportResult importGitHubSkills(
@Valid @RequestBody GitHubSkillImportRequest request,
Authentication authentication) {
return skillGitHub.importSelected(
actors.current(authentication),
new SkillGitHubImportService.ImportRequest(
request.source().source(),
request.paths(),
request.namespace(),
request.classification() == null
? KnowledgeClassification.INTERNAL
: request.classification()));
}

@PutMapping(
path = "/{assetId}/skill-draft",
consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
Expand Down
105 changes: 105 additions & 0 deletions apps/docs/content/docs/product-guides/create-governed-skills.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: Create governed Skills
description: Author, upload, or import reusable AI Skills as private Drafts with exact package provenance.
audience:
- user
- adopter
status: public
sourceRefs:
- docs/specs/domains/asset-registry.md
- apps/api/src/main/java/com/orgmemory/api/assetregistry/AssetRegistryController.java
- apps/web/src/features/assets/components/skill-creation-page.tsx
- apps/web/src/features/assets/components/skill-github-import-page.tsx
- apps/web/test/e2e/asset-registry-golden-poc.spec.ts
lastReviewed: '2026-08-01'
---

Use this guide to turn a reusable set of AI instructions and supporting files
into a governed Skill. You need permission to create Assets in the destination
Knowledge Space. Every creation path stops at a private Draft; publishing is a
separate accountable action.

<Steps>
<Step>

### Choose how to create the Skill

Open **Assets**, select **Add asset → Skill**, then choose one path:

- **Start from scratch** to write `SKILL.md` instructions and add supporting
files in the browser;
- **Upload a skill** to inspect an existing `SKILL.md`, folder, or ZIP;
- **Import from GitHub** to discover one or more Skills in a repository.

OrgMemory validates package structure but does not execute the Skill or treat
structural validation as a security or content review.

</Step>
<Step>

### Preview a GitHub repository

First choose the destination Knowledge Space. OrgMemory uses that choice to
verify your Skill-creation permission before it reveals private repository
connections or reads repository content. Then enter `owner/repository` or the
repository HTTPS URL. You may also supply a branch, tag, commit, and directory.
Public repositories are read anonymously by the server. For a private
repository, choose a GitHub App connection that an administrator has explicitly
enabled for Skill import; credentials never enter the browser.

Select **Preview Skills**. The preview resolves the requested revision to a
full commit SHA, discovers bounded `SKILL.md` roots, and marks packages that
cannot be imported. Choose up to 20 valid Skills.

<ArchitectureDiagram
alt="Organizational AI Memory GitHub Skill import showing a private repository, exact commit preview, selectable valid Skills, and a bounded invalid package."
description="The repository is resolved to an exact commit before selection. Each valid Skill can be imported independently; invalid packages remain visible with an actionable reason. This screenshot uses synthetic documentation data captured from the current product UI."
height={910}
src="/images/product-guides/skill-github-import.png"
title="Preview and select exact repository Skills"
width={1598}
/>

</Step>
<Step>

### Place the Drafts

Choose one namespace and classification for the already-selected Knowledge
Space. Import fetches the exact previewed commit again and records the server-derived
repository, commit SHA, and `SKILL.md` path in each Draft's package
provenance.

Each selected Skill is imported independently. A duplicate or invalid package
appears under **Not imported** without rolling back successful Drafts. Open a
successful result to continue in the ordinary Governance workspace.

</Step>
<Step>

### Review and publish deliberately

In Governance, inspect the package digest, file manifest, compatibility, and
source provenance. Replace the mutable Draft package when necessary. An
authorized owner may then publish a version directly or use the reviewed
route when organizational policy requires it. Published revisions and
releases keep their original immutable package bytes.

</Step>
</Steps>

## If import cannot continue

- **Repository unavailable:** confirm the repository, revision, and optional
directory without assuming a private repository exists.
- **Private import disabled:** ask an administrator to select the repository in
the GitHub App installation and enable private Skill imports on that
connection.
- **Package rejected:** fix the reported `SKILL.md`, path, file-count, or size
issue at the pinned revision, then preview again.
- **One Skill conflicts:** open the successful Drafts and resolve the duplicate
namespace/slug before retrying only the failed Skill.

## Continue

- Learn how to [work with an exact released Asset](/docs/product-guides/work-with-governed-assets).
103 changes: 103 additions & 0 deletions apps/docs/content/docs/product-guides/create-governed-skills.vi.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
title: Tạo Skill được quản trị
description: Soạn, tải lên hoặc import AI Skill tái sử dụng thành Draft riêng tư với provenance package chính xác.
audience:
- user
- adopter
status: public
sourceRefs:
- docs/specs/domains/asset-registry.md
- apps/api/src/main/java/com/orgmemory/api/assetregistry/AssetRegistryController.java
- apps/web/src/features/assets/components/skill-creation-page.tsx
- apps/web/src/features/assets/components/skill-github-import-page.tsx
- apps/web/test/e2e/asset-registry-golden-poc.spec.ts
lastReviewed: '2026-08-01'
---

Dùng hướng dẫn này để đưa một bộ instruction AI và file hỗ trợ có thể tái sử
dụng thành Skill được quản trị. Bạn cần quyền tạo Asset trong Knowledge Space
đích. Mọi cách tạo đều dừng ở Draft riêng tư; publish là một hành động có trách
nhiệm riêng biệt.

<Steps>
<Step>

### Chọn cách tạo Skill

Mở **Assets**, chọn **Add asset → Skill**, sau đó chọn một cách:

- **Start from scratch** để viết instruction `SKILL.md` và thêm file hỗ trợ
trong trình duyệt;
- **Upload a skill** để kiểm tra `SKILL.md`, folder hoặc ZIP có sẵn;
- **Import from GitHub** để tìm một hoặc nhiều Skill trong repository.

OrgMemory kiểm tra cấu trúc package nhưng không thực thi Skill và không coi
structural validation là bước review nội dung hoặc bảo mật.

</Step>
<Step>

### Preview repository GitHub

Trước tiên, chọn Knowledge Space đích. OrgMemory dùng lựa chọn này để kiểm tra
quyền tạo Skill của bạn trước khi hiển thị private repository connection hoặc
đọc nội dung repository. Sau đó nhập `owner/repository` hoặc URL HTTPS của
repository. Bạn cũng có thể nhập branch, tag, commit và directory. Repository
public được server đọc ẩn danh. Với repository private, chọn GitHub App
connection đã được administrator bật rõ ràng cho Skill import; credential
không bao giờ đi vào trình duyệt.

Chọn **Preview Skills**. Preview resolve revision đã nhập thành commit SHA đầy
đủ, tìm các root `SKILL.md` trong giới hạn và đánh dấu package không thể
import. Chọn tối đa 20 Skill hợp lệ.

<ArchitectureDiagram
alt="Màn GitHub Skill import của Organizational AI Memory hiển thị repository private, preview commit chính xác, các Skill hợp lệ có thể chọn và một package vượt giới hạn."
description="Repository được resolve thành commit chính xác trước khi chọn. Mỗi Skill hợp lệ có thể được import độc lập; package không hợp lệ vẫn hiển thị kèm lý do có thể xử lý. Screenshot dùng dữ liệu tài liệu giả lập được chụp từ giao diện sản phẩm hiện tại."
height={910}
src="/images/product-guides/skill-github-import.png"
title="Preview và chọn đúng Skill trong repository"
width={1598}
/>

</Step>
<Step>

### Đặt các Draft

Chọn namespace và classification cho Knowledge Space đã chọn. Import tải lại
đúng commit đã preview rồi ghi repository, commit SHA và đường dẫn
`SKILL.md` do server xác định vào package provenance của từng Draft.

Mỗi Skill được import độc lập. Package trùng hoặc không hợp lệ xuất hiện dưới
**Not imported** mà không rollback các Draft đã tạo thành công. Mở một kết quả
thành công để tiếp tục trong Governance workspace thông thường.

</Step>
<Step>

### Kiểm tra và publish có chủ đích

Trong Governance, kiểm tra package digest, file manifest, compatibility và
source provenance. Thay package của Draft mutable khi cần. Owner được cấp
quyền có thể publish trực tiếp một version hoặc dùng luồng review khi chính
sách tổ chức yêu cầu. Revision và Release đã publish giữ nguyên package bytes
bất biến ban đầu.

</Step>
</Steps>

## Khi không thể tiếp tục import

- **Repository unavailable:** kiểm tra repository, revision và directory tùy
chọn mà không giả định repository private đó tồn tại.
- **Private import disabled:** yêu cầu administrator chọn repository trong
GitHub App installation và bật private Skill import trên connection đó.
- **Package rejected:** sửa lỗi `SKILL.md`, path, file-count hoặc size được báo
tại revision đã pin, sau đó preview lại.
- **Một Skill bị conflict:** mở các Draft thành công, xử lý namespace/slug trùng
rồi chỉ retry Skill thất bại.

## Tiếp tục

- Tìm hiểu cách [làm việc với một Asset release chính xác](/vi/docs/product-guides/work-with-governed-assets).
3 changes: 2 additions & 1 deletion apps/docs/content/docs/product-guides/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"root": true,
"pagesIndex": "work-with-governed-assets",
"pages": [
"work-with-governed-assets"
"work-with-governed-assets",
"create-governed-skills"
]
}
3 changes: 2 additions & 1 deletion apps/docs/content/docs/product-guides/meta.vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"root": true,
"pagesIndex": "work-with-governed-assets",
"pages": [
"work-with-governed-assets"
"work-with-governed-assets",
"create-governed-skills"
]
}
Loading