From 512a3f86539fa295967099ba82c410e8d671b880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=A2=A8?= Date: Thu, 28 May 2026 06:39:36 +0000 Subject: [PATCH] refactor(skill): remove non-scenario skill commands, add navigation to user reference Removed: cli, architecture, yaml, moderator, actor skill subcommands Kept: user, author, developer, adapter (scenario-based) Added: scenario navigation table to user-reference.ts --- .../cli-workflow/src/__tests__/skill.test.ts | 59 ------------------- packages/cli-workflow/src/cli.ts | 40 ------------- packages/cli-workflow/src/commands/skill.ts | 10 ---- packages/workflow-util/src/user-reference.ts | 10 ++++ 4 files changed, 10 insertions(+), 109 deletions(-) diff --git a/packages/cli-workflow/src/__tests__/skill.test.ts b/packages/cli-workflow/src/__tests__/skill.test.ts index 9ab9fd0..1472e60 100644 --- a/packages/cli-workflow/src/__tests__/skill.test.ts +++ b/packages/cli-workflow/src/__tests__/skill.test.ts @@ -6,27 +6,17 @@ import { describe, expect, test } from "vitest"; const __dirname = dirname(fileURLToPath(import.meta.url)); import { - cmdSkillActor, cmdSkillAdapter, - cmdSkillArchitecture, cmdSkillAuthor, - cmdSkillCli, cmdSkillDeveloper, cmdSkillList, - cmdSkillModerator, cmdSkillUser, - cmdSkillYaml, } from "../commands/skill.js"; describe("skill commands", () => { test("skill list returns all skill names", () => { const result = cmdSkillList(); expect(result).toBeInstanceOf(Array); - expect(result).toContain("cli"); - expect(result).toContain("architecture"); - expect(result).toContain("yaml"); - expect(result).toContain("moderator"); - expect(result).toContain("actor"); expect(result).toContain("user"); expect(result).toContain("author"); expect(result).toContain("developer"); @@ -36,50 +26,6 @@ describe("skill commands", () => { } }); - test("skill architecture returns non-empty markdown string", () => { - const result = cmdSkillArchitecture(); - expect(typeof result).toBe("string"); - expect(result).toContain("CAS"); - expect(result).toContain("Thread"); - expect(result).toContain("Workflow"); - expect(result).toContain("Step"); - expect(result.length).toBeGreaterThan(200); - }); - - test("skill yaml returns non-empty markdown string", () => { - const result = cmdSkillYaml(); - expect(typeof result).toBe("string"); - expect(result).toContain("roles"); - expect(result).toContain("graph"); - expect(result).toContain("frontmatter"); - expect(result.length).toBeGreaterThan(200); - }); - - test("skill moderator returns non-empty markdown string", () => { - const result = cmdSkillModerator(); - expect(typeof result).toBe("string"); - expect(result).toContain("routing"); - expect(result).toContain("status"); - expect(result.length).toBeGreaterThan(200); - // Check for edge or graph - expect(result).toMatch(/edge|graph/i); - }); - - test("skill cli returns CLI reference markdown", () => { - const result = cmdSkillCli(); - expect(typeof result).toBe("string"); - expect(result).toContain("uwf"); - }); - - test("skill actor returns non-empty markdown string", () => { - const result = cmdSkillActor(); - expect(typeof result).toBe("string"); - expect(result).toContain("frontmatter"); - expect(result).toContain("CAS"); - expect(result).toContain("status"); - expect(result.length).toBeGreaterThan(200); - }); - test("skill user returns non-empty markdown string", () => { const result = cmdSkillUser(); expect(typeof result).toBe("string"); @@ -126,11 +72,6 @@ describe("skill commands", () => { env: { ...process.env, PATH: `/opt/homebrew/bin:${process.env.PATH}` }, }); expect(output).not.toMatch(/help\s+\[command\]/i); - expect(output).toContain("cli"); - expect(output).toContain("architecture"); - expect(output).toContain("yaml"); - expect(output).toContain("moderator"); - expect(output).toContain("actor"); expect(output).toContain("user"); expect(output).toContain("author"); expect(output).toContain("developer"); diff --git a/packages/cli-workflow/src/cli.ts b/packages/cli-workflow/src/cli.ts index 6ac27ea..05c563d 100755 --- a/packages/cli-workflow/src/cli.ts +++ b/packages/cli-workflow/src/cli.ts @@ -17,16 +17,11 @@ import { cmdConfigGet, cmdConfigList, cmdConfigSet } from "./commands/config.js" import { cmdLogClean, cmdLogList, cmdLogShow } from "./commands/log.js"; import { cmdSetup, cmdSetupInteractive } from "./commands/setup.js"; import { - cmdSkillActor, cmdSkillAdapter, - cmdSkillArchitecture, cmdSkillAuthor, - cmdSkillCli, cmdSkillDeveloper, cmdSkillList, - cmdSkillModerator, cmdSkillUser, - cmdSkillYaml, } from "./commands/skill.js"; import { cmdStepFork, cmdStepList, cmdStepRead, cmdStepShow } from "./commands/step.js"; import { @@ -493,34 +488,6 @@ For more information, see: uwf help thread list const skill = program.command("skill").description("Built-in skill references for agents"); skill.addHelpCommand(false); -skill - .command("cli") - .description("Print a markdown reference of all uwf commands") - .action(() => { - console.log(cmdSkillCli()); - }); - -skill - .command("architecture") - .description("Print the architecture reference") - .action(() => { - console.log(cmdSkillArchitecture()); - }); - -skill - .command("yaml") - .description("Print the workflow YAML schema reference") - .action(() => { - console.log(cmdSkillYaml()); - }); - -skill - .command("actor") - .description("Print the actor reference (frontmatter protocol + CAS)") - .action(() => { - console.log(cmdSkillActor()); - }); - skill .command("adapter") .description("Print the adapter reference (building agent adapters)") @@ -542,13 +509,6 @@ skill console.log(cmdSkillDeveloper()); }); -skill - .command("moderator") - .description("Print the moderator reference") - .action(() => { - console.log(cmdSkillModerator()); - }); - skill .command("user") .description("Print the user reference (CLI guide + typical workflows)") diff --git a/packages/cli-workflow/src/commands/skill.ts b/packages/cli-workflow/src/commands/skill.ts index d685664..5364b3a 100644 --- a/packages/cli-workflow/src/commands/skill.ts +++ b/packages/cli-workflow/src/commands/skill.ts @@ -1,21 +1,11 @@ export { - generateActorReference as cmdSkillActor, generateAdapterReference as cmdSkillAdapter, - generateArchitectureReference as cmdSkillArchitecture, generateAuthorReference as cmdSkillAuthor, - generateCliReference as cmdSkillCli, generateDeveloperReference as cmdSkillDeveloper, - generateModeratorReference as cmdSkillModerator, generateUserReference as cmdSkillUser, - generateYamlReference as cmdSkillYaml, } from "@uncaged/workflow-util"; const SKILL_NAMES = [ - "cli", - "architecture", - "yaml", - "moderator", - "actor", "user", "author", "developer", diff --git a/packages/workflow-util/src/user-reference.ts b/packages/workflow-util/src/user-reference.ts index c515d1e..29cd9b0 100644 --- a/packages/workflow-util/src/user-reference.ts +++ b/packages/workflow-util/src/user-reference.ts @@ -121,5 +121,15 @@ uwf log clean --before # delete old logs uwf --format # output format (default: json) uwf -V, --version # print version \`\`\` + +## Other Skill References + +For specific scenarios, run the corresponding \`uwf skill\` command: + +| Scenario | Command | When to use | +|----------|---------|-------------| +| Writing workflow YAML | \`uwf skill author\` | Designing roles, conditions, graphs, and edge prompts | +| Contributing to the engine | \`uwf skill developer\` | Modifying the workflow engine codebase itself | +| Building a new agent adapter | \`uwf skill adapter\` | Creating a new \`uwf-\` CLI adapter | `; }