update agents skill design

This commit is contained in:
2026-08-20 18:18:10 +05:30
parent 161b237695
commit b2e6868824
75 changed files with 14586 additions and 98 deletions

View File

@@ -79,7 +79,7 @@ export function parseFrontmatter(raw) {
* absent. A section that is present and unreadable is the failure this parser
* must never have: it looks exactly like a section the author did not write.
*/
function sectionSource(body, heading) {
export function sectionSource(body, heading) {
const escaped = String(heading).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const section = new RegExp(`##\\s+${escaped}\\s*\\n([\\s\\S]*?)(?=\\n##\\s|$)`, 'i').exec(body);
return section ? section[1] : null;
@@ -106,7 +106,7 @@ function sectionSource(body, heading) {
*/
const LIST_ITEM = /^\s*(?:-|\*|\d+[.)])\s+(.*)$/;
function sectionBullets(body, heading) {
export function sectionBullets(body, heading) {
const source = sectionSource(body, heading);
if (source == null) return [];
@@ -164,7 +164,7 @@ function sectionSteps(body, heading) {
* one line of summary. Used for a level's description, which is a sentence
* rather than a list.
*/
function sectionText(body, heading) {
export function sectionText(body, heading) {
const source = sectionSource(body, heading);
if (source == null) return '';
return source
@@ -373,6 +373,16 @@ export function parseSkill(raw, { path = 'custom', custom = false } = {}) {
facets: skillFacets({ data, kind, ui, owliver, conversation }),
name: data.name || 'Untitled skill',
description: data.description || '',
/**
* The family a definition belongs to, for grouping in a picker.
*
* Free text and entirely optional — a definition that omits it is
* uncategorized and behaves exactly as it did before this existed.
* Deliberately not a closed vocabulary: unlike a page or a data source,
* a category names nothing the runtime has to resolve, so constraining it
* would buy nothing and would make every new grouping a code change.
*/
category: typeof data.category === 'string' ? data.category.trim() : '',
status: data.status === 'inactive' ? 'inactive' : 'active',
pages,
/**