webcraft-skills 0.1.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/CHANGELOG_zh_CN.md +67 -0
  3. package/LICENSE +21 -0
  4. package/README.md +148 -0
  5. package/README_zh_CN.md +148 -0
  6. package/commands/ui-audit.md +21 -0
  7. package/commands/ui-build.md +21 -0
  8. package/commands/ui-fix.md +21 -0
  9. package/commands/ui-polish.md +21 -0
  10. package/commands/ui-preset.md +15 -0
  11. package/commands/ui-review.md +21 -0
  12. package/package.json +36 -0
  13. package/scripts/install.mjs +101 -0
  14. package/skills/webcraft-skills/SKILL.md +45 -0
  15. package/skills/webcraft-skills/agents/openai.yaml +4 -0
  16. package/skills/webcraft-skills/references/checklists/ui-audit.md +621 -0
  17. package/skills/webcraft-skills/references/checklists/ui-audit.zh.md +675 -0
  18. package/skills/webcraft-skills/references/presets/cinematic-minimal.md +48 -0
  19. package/skills/webcraft-skills/references/presets/cinematic-minimal.zh.md +53 -0
  20. package/skills/webcraft-skills/references/workflows/audit-ui.md +272 -0
  21. package/skills/webcraft-skills/references/workflows/audit-ui.zh.md +299 -0
  22. package/skills/webcraft-skills/references/workflows/build-ui.md +12 -0
  23. package/skills/webcraft-skills/references/workflows/build-ui.zh.md +385 -0
  24. package/skills/webcraft-skills/references/workflows/fix-ui.md +261 -0
  25. package/skills/webcraft-skills/references/workflows/fix-ui.zh.md +261 -0
  26. package/skills/webcraft-skills/references/workflows/polish-ui.md +12 -0
  27. package/skills/webcraft-skills/references/workflows/polish-ui.zh.md +246 -0
  28. package/skills/webcraft-skills/references/workflows/review-ui.md +12 -0
  29. package/skills/webcraft-skills/references/workflows/review-ui.zh.md +207 -0
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ import { cpSync, existsSync, mkdirSync, readdirSync, rmSync } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { homedir } from "node:os";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const root = join(__dirname, "..");
9
+
10
+ const args = process.argv.slice(2);
11
+ const command = args[0] ?? "install";
12
+
13
+ const usage = `Usage:
14
+ npx webcraft-skills install --agent codex
15
+ npx webcraft-skills install --agent claude
16
+ npx webcraft-skills install --agent all
17
+
18
+ Options:
19
+ --agent <codex|claude|all> Target agent. Default: codex.
20
+ --copy Copy files. This installer always copies.
21
+ -y, --yes Non-interactive. This installer is non-interactive.
22
+ `;
23
+
24
+ if (command === "help" || args.includes("--help") || args.includes("-h")) {
25
+ console.log(usage);
26
+ process.exit(0);
27
+ }
28
+
29
+ if (command !== "install") {
30
+ console.error(`Unknown command: ${command}\n\n${usage}`);
31
+ process.exit(1);
32
+ }
33
+
34
+ function getOption(name, fallback) {
35
+ const index = args.indexOf(name);
36
+ if (index === -1) return fallback;
37
+ return args[index + 1] ?? fallback;
38
+ }
39
+
40
+ const agent = getOption("--agent", "codex").toLowerCase();
41
+ const targets =
42
+ agent === "all" || agent === "*"
43
+ ? ["codex", "claude"]
44
+ : [agent];
45
+
46
+ const skillName = "webcraft-skills";
47
+ const skillSource = join(root, "skills", skillName);
48
+ const commandSource = join(root, "commands");
49
+
50
+ if (!existsSync(skillSource)) {
51
+ console.error(`Skill source not found: ${skillSource}`);
52
+ process.exit(1);
53
+ }
54
+
55
+ if (!existsSync(commandSource)) {
56
+ console.error(`Command source not found: ${commandSource}`);
57
+ process.exit(1);
58
+ }
59
+
60
+ const agentConfig = {
61
+ codex: {
62
+ skillRoot: join(homedir(), ".codex", "skills"),
63
+ commandRoot: join(homedir(), ".codex", "commands")
64
+ },
65
+ claude: {
66
+ skillRoot: join(homedir(), ".claude", "skills"),
67
+ commandRoot: join(homedir(), ".claude", "commands")
68
+ }
69
+ };
70
+
71
+ for (const target of targets) {
72
+ const config = agentConfig[target];
73
+ if (!config) {
74
+ console.error(`Unsupported agent: ${target}. Use codex, claude, or all.`);
75
+ process.exit(1);
76
+ }
77
+
78
+ const skillTarget = join(config.skillRoot, skillName);
79
+ mkdirSync(config.skillRoot, { recursive: true });
80
+ mkdirSync(config.commandRoot, { recursive: true });
81
+
82
+ if (existsSync(skillTarget)) {
83
+ rmSync(skillTarget, { recursive: true, force: true });
84
+ }
85
+
86
+ cpSync(skillSource, skillTarget, { recursive: true });
87
+
88
+ for (const entry of readdirSync(commandSource, { withFileTypes: true })) {
89
+ if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
90
+ cpSync(join(commandSource, entry.name), join(config.commandRoot, entry.name));
91
+ }
92
+
93
+ console.log(`Installed ${skillName} skill to ${skillTarget}`);
94
+ console.log(`Installed UI slash commands to ${config.commandRoot}`);
95
+ }
96
+
97
+ console.log("\nTry:");
98
+ console.log(" /ui-audit current website");
99
+ console.log(" /ui-fix Critical and Major issues from the last audit");
100
+ console.log("\nStable commands: /ui-audit, /ui-fix");
101
+ console.log("Experimental commands are installed for iteration: /ui-review, /ui-polish, /ui-build, /ui-preset");
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: webcraft-skills
3
+ description: UI quality, generation, review, audit, and polish skill for Codex. Use when building, redesigning, reviewing, auditing, or fixing web pages, websites, landing pages, dashboards, portfolios, frontend prototypes, visual systems, component states, responsive layouts, typography, colors, borders, radius, modals, and AI-generated UI that feels rough, generic, inconsistent, or template-like.
4
+ ---
5
+
6
+ # Webcraft Skills
7
+
8
+ Use this skill as a senior UI/UX reviewer and frontend implementation guide. Treat UI quality as a system: information architecture, layout, typography, color, spacing, border/radius/shadow, interaction states, responsive behavior, accessibility, and visual restraint.
9
+
10
+ ## Operating Modes
11
+
12
+ Choose one locale before reading reference files:
13
+
14
+ - Use English references by default.
15
+ - Use `.zh.md` references when the user writes in Chinese, asks for Chinese UI/copy, or the task depends on Chinese-specific wording, line-breaking, mixed Chinese/English content, or Chinese visual nuance.
16
+ - Do not read both English and Chinese versions unless the user asks for translation, bilingual comparison, localization, or consistency checking between locales.
17
+
18
+ Reference files are paired by locale. For the selected locale, read only the matching workflow/checklist/preset files:
19
+
20
+ - **Build**: create a new page or site. Read `references/workflows/build-ui.md` or `references/workflows/build-ui.zh.md`.
21
+ - **Review**: inspect existing UI and report issues. Read `references/workflows/review-ui.md` or `references/workflows/review-ui.zh.md`, plus `references/checklists/ui-audit.md` or `references/checklists/ui-audit.zh.md`.
22
+ - **Audit**: deeply inspect a page or site across visual, responsive, interaction, and AI-template-smell dimensions. Read `references/workflows/audit-ui.md` or `references/workflows/audit-ui.zh.md`, plus `references/checklists/ui-audit.md` or `references/checklists/ui-audit.zh.md`.
23
+ - **Polish**: improve existing UI without changing product meaning. Read `references/workflows/polish-ui.md` or `references/workflows/polish-ui.zh.md`.
24
+ - **Fix**: implement fixes from review or audit findings. Read `references/workflows/fix-ui.md` or `references/workflows/fix-ui.zh.md`.
25
+
26
+ ## Presets
27
+
28
+ - Use the preset file that matches the selected locale: `references/presets/cinematic-minimal.md` for English or `references/presets/cinematic-minimal.zh.md` for Chinese.
29
+ - Do not force a preset when the product context suggests another style. Prefer usability and product fit over aesthetic purity.
30
+
31
+ ## Required Behavior
32
+
33
+ 1. Respect the existing codebase, framework, component system, and user-provided content.
34
+ 2. Before major UI work, check whether project-level `.webcraft-skills/EXTEND.md` or `.webcraft-skills/config.json` exists. If present, apply it after the built-in rules.
35
+ 3. Prefer concrete implementation or concrete findings over abstract design commentary.
36
+ 4. For UI review/audit, lead with issues ordered by severity.
37
+ 5. For UI build/fix/polish, verify responsive behavior and interactive states when possible.
38
+ 6. Check for AI-generated roughness: generic bento grids, excessive badges, gradient blobs, inconsistent radii, missing states, weak typography, cramped spacing, and fake marketing copy.
39
+ 7. Avoid inventing product facts, testimonials, metrics, logos, or case studies.
40
+
41
+ ## Output Standards
42
+
43
+ - Review/audit output: severity, location, problem, impact, fix.
44
+ - Build/polish/fix output: changed files, design decisions, verification result.
45
+ - Keep language direct and actionable.
@@ -0,0 +1,4 @@
1
+ display_name: Webcraft Skills
2
+ short_description: Build, review, audit, polish, and fix AI-generated web UI.
3
+ default_prompt: Audit this UI for layout, typography, color, radius, states, responsiveness, and AI-template smell.
4
+