@uibot/skills 0.0.0-stage → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/agents/artifact-lite.md +33 -0
- package/content/agents/default.md +57 -0
- package/content/craft/accessibility-baseline.md +6 -0
- package/content/craft/animation-discipline.md +6 -0
- package/content/craft/anti-ai-slop.md +7 -0
- package/content/craft/color.md +6 -0
- package/content/craft/density-and-spacing.md +6 -0
- package/content/craft/form-validation.md +6 -0
- package/content/craft/laws-of-ux.md +6 -0
- package/content/craft/rtl-and-bidi.md +5 -0
- package/content/craft/state-coverage.md +5 -0
- package/content/craft/typography.md +6 -0
- package/content/skills/apply-design-md/SKILL.md +73 -0
- package/content/skills/extract-design-tokens/SKILL.md +80 -0
- package/content/skills/generate-admin-page/SKILL.md +200 -0
- package/content/skills/generate-landing-page/SKILL.md +114 -0
- package/content/skills/html-deck/SKILL.md +53 -0
- package/content/skills/html-mobile-mockup/SKILL.md +49 -0
- package/content/skills/html-prototype/SKILL.md +49 -0
- package/content/skills/html-social-carousel/SKILL.md +90 -0
- package/content/skills/html-social-carousel/example.html +219 -0
- package/content/skills/uibot-yaml-spec/SKILL.md +166 -0
- package/dist/builtin-pack.d.ts +36 -0
- package/dist/capability.d.ts +16 -0
- package/dist/evolver.d.ts +85 -0
- package/dist/fs-source.d.ts +10 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +162 -0
- package/dist/loader.d.ts +11 -0
- package/dist/match.d.ts +12 -0
- package/dist/reflection-store.d.ts +21 -0
- package/dist/registry.d.ts +10 -0
- package/dist/regression-store.d.ts +37 -0
- package/dist/schema.d.ts +9 -0
- package/dist/selector.d.ts +19 -0
- package/dist/usage-store.d.ts +24 -0
- package/package.json +38 -4
- package/README.md +0 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Skill } from "@uibot/contracts";
|
|
2
|
+
/** In-memory registry of loaded Skill entries, keyed by id. */
|
|
3
|
+
export declare class SkillRegistry {
|
|
4
|
+
private readonly skills;
|
|
5
|
+
register(skill: Skill): void;
|
|
6
|
+
list(): Skill[];
|
|
7
|
+
get(id: string): Skill | undefined;
|
|
8
|
+
addAll(skills: Skill[]): void;
|
|
9
|
+
size(): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { SkillRegressionRecord } from "@uibot/contracts";
|
|
2
|
+
export interface RegressionStoreOptions {
|
|
3
|
+
/** Root dir where `.uibot/skills/<id>/regressions.jsonl` lives */
|
|
4
|
+
rootDir: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Append-mostly JSONL store for skill regression cases (Darwin-Skill inspired).
|
|
8
|
+
*
|
|
9
|
+
* Each record captures a concrete failure that became a persistent test case;
|
|
10
|
+
* future `AutoPromoter` promotions must not regress any `active` case.
|
|
11
|
+
*
|
|
12
|
+
* `markResolved` is the sole non-append operation (status transition). It
|
|
13
|
+
* rewrites the whole file since JSONL is line-oriented and we need to update
|
|
14
|
+
* individual records' status in place.
|
|
15
|
+
*/
|
|
16
|
+
export declare class RegressionStore {
|
|
17
|
+
private readonly options;
|
|
18
|
+
constructor(options: RegressionStoreOptions);
|
|
19
|
+
/** Append one new regression record. */
|
|
20
|
+
append(record: SkillRegressionRecord): void;
|
|
21
|
+
/** All regressions (chronological, oldest first). */
|
|
22
|
+
list(skillId: string): SkillRegressionRecord[];
|
|
23
|
+
/** Active regressions only (status === "active"). */
|
|
24
|
+
active(skillId: string): SkillRegressionRecord[];
|
|
25
|
+
/**
|
|
26
|
+
* Mark one or more regression records as resolved by a proposal.
|
|
27
|
+
* Rewrites the JSONL file (only mutation path — all other ops are append-only).
|
|
28
|
+
*/
|
|
29
|
+
markResolved(skillId: string, ids: string[], proposalId: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Re-activate previously resolved regressions that failed re-verify (v2.27 SC-4).
|
|
32
|
+
* Records `reactivatedAt` + `reactivationReason` as optional context fields.
|
|
33
|
+
*/
|
|
34
|
+
markActive(skillId: string, ids: string[], reason: string): void;
|
|
35
|
+
/** Resolved regressions only. */
|
|
36
|
+
resolved(skillId: string): SkillRegressionRecord[];
|
|
37
|
+
}
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SkillFrontmatter } from "@uibot/contracts";
|
|
2
|
+
export type { SkillFrontmatter };
|
|
3
|
+
/** Split a markdown file into frontmatter YAML + body text. */
|
|
4
|
+
export declare function splitFrontmatter(raw: string): {
|
|
5
|
+
meta: string;
|
|
6
|
+
body: string;
|
|
7
|
+
};
|
|
8
|
+
/** Parse and validate a SKILL.md frontmatter block. */
|
|
9
|
+
export declare function parseSkillFrontmatter(raw: string): SkillFrontmatter;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Skill, SkillSelectOptions, SkillSelector } from "@uibot/contracts";
|
|
2
|
+
import type { SkillRegistry } from "./registry.js";
|
|
3
|
+
export declare class SkillSelectorImpl implements SkillSelector {
|
|
4
|
+
private readonly registry;
|
|
5
|
+
constructor(registry: SkillRegistry);
|
|
6
|
+
/**
|
|
7
|
+
* Select skills relevant to the given intent.
|
|
8
|
+
* - Scores each skill by whole-word trigger matches (see `scoreSkillMatch`).
|
|
9
|
+
* - Keeps at most one `html-artifact` skill (the best match).
|
|
10
|
+
* - Filters to those with matching tags if `opts.tags` provided.
|
|
11
|
+
* - Applies `maxTokens` budget (rough estimate: body.length / 4).
|
|
12
|
+
*/
|
|
13
|
+
select(opts: SkillSelectOptions): Skill[];
|
|
14
|
+
/**
|
|
15
|
+
* Score all skills against an input string by trigger keyword matching.
|
|
16
|
+
* Returns skills sorted by score descending (all skills, even those with score 0).
|
|
17
|
+
*/
|
|
18
|
+
score(input: string): Skill[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SkillInvocationRecord, SkillScoring } from "@uibot/contracts";
|
|
2
|
+
export interface SkillUsageStoreOptions {
|
|
3
|
+
/** Root dir where .uibot/skills/<id>/ directories are */
|
|
4
|
+
rootDir: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class SkillUsageStore {
|
|
7
|
+
private readonly options;
|
|
8
|
+
constructor(options: SkillUsageStoreOptions);
|
|
9
|
+
/** Append a usage record to usage.jsonl */
|
|
10
|
+
recordInvocation(id: string, record: SkillInvocationRecord): void;
|
|
11
|
+
/**
|
|
12
|
+
* Bayesian-smoothed scoring update.
|
|
13
|
+
* avgScore = (successCount + 1) / (usageCount + 2)
|
|
14
|
+
*/
|
|
15
|
+
updateScoring(id: string, signal: "render-ok" | "render-fail" | "user-thumb-up" | "user-thumb-down"): void;
|
|
16
|
+
/**
|
|
17
|
+
* Read the last `limit` invocation records from usage.jsonl and return
|
|
18
|
+
* their scores as a number[] (1 = success, 0 = failure).
|
|
19
|
+
* Useful for rendering a sparkline trend.
|
|
20
|
+
*/
|
|
21
|
+
recentScores(id: string, limit?: number): number[];
|
|
22
|
+
/** Read current scoring for a skill. Returns default if not found. */
|
|
23
|
+
getScoring(id: string): SkillScoring;
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uibot/skills",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Foundj/uibot.git",
|
|
8
|
+
"directory": "packages/skills"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"module": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"content",
|
|
22
|
+
"dist",
|
|
23
|
+
"!dist/**/*.map",
|
|
24
|
+
"!dist/**/*.test.d.ts",
|
|
25
|
+
"!dist/**/*.spec.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@uibot/contracts": "^0.2.1",
|
|
32
|
+
"@uibot/plugin-sdk": "^0.2.1",
|
|
33
|
+
"yaml": "2.9.1"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "rm -rf dist && bun build --minify ./src/index.ts --outdir ./dist --format esm --target bun && bun x tsc -p tsconfig.json",
|
|
37
|
+
"typecheck": "bun x tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"test": "bun test"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/README.md
DELETED