Merge pull request #408 from Cb2i/chore/repo-health-and-e2e-tests

chore: repo health files, CI test wiring, and a real SVG bug fix
This commit is contained in:
Clark Cant 2026-07-14 05:30:34 +07:00 committed by GitHub
commit e2964b533e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 336 additions and 3 deletions

48
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Bug Report
description: Report something broken in the skill, CLI, or generated design system
labels: [bug]
body:
- type: input
id: assistant
attributes:
label: AI assistant / platform
description: Claude Code, Cursor, Windsurf, etc.
validations:
required: true
- type: input
id: version
attributes:
label: ui-ux-pro-max-cli version
description: Output of `npm list -g ui-ux-pro-max-cli` or `uipro --version`
validations:
required: true
- type: input
id: os
attributes:
label: OS
placeholder: macOS 15 / Windows 11 / Ubuntu 24.04
validations:
required: true
- type: textarea
id: command
attributes:
label: Exact command or prompt that triggered the bug
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
id: actual
attributes:
label: Actual behavior
validations:
required: true
- type: textarea
id: logs
attributes:
label: Error messages / screenshots
render: shell

View File

@ -0,0 +1,29 @@
name: Feature Request
description: Suggest a new UI style, color palette, industry rule, stack, or CLI feature
labels: [enhancement]
body:
- type: dropdown
id: category
attributes:
label: Category
options:
- New UI style
- New color palette
- New industry reasoning rule
- New tech stack support
- CLI improvement
- Other
validations:
required: true
- type: textarea
id: description
attributes:
label: What do you want to see added or changed?
validations:
required: true
- type: textarea
id: motivation
attributes:
label: Why is this useful? (use case, example project)
validations:
required: true

15
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,15 @@
## What does this PR change?
<!-- One or two sentences. -->
## Why?
<!-- Closes #123, or describe the problem this solves. -->
## Checklist
- [ ] Changes were made in `src/ui-ux-pro-max/` (source of truth), not directly in `.claude/` or `.factory/`
- [ ] Ran `npm run sync:assets && npm run check:assets` in `cli/` if data/scripts/templates changed
- [ ] Added or updated tests if behavior changed (`.claude/skills/*/scripts/tests/`, `cli/tests/e2e/`)
- [ ] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) (`feat:`, `fix:`, `docs:`, etc.)
- [ ] This PR targets a feature branch, not pushed directly to `main`

51
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Tests
on:
pull_request:
paths:
- '.claude/skills/**'
- 'cli/assets/skills/**'
- '.github/workflows/tests.yml'
push:
branches: [main]
workflow_dispatch:
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install pytest
run: pip install pytest
- name: Run skill regression tests
run: python3 -m pytest .claude/skills -v
- name: Install Playwright deps
working-directory: cli
run: |
npm ci
npx playwright install --with-deps chromium
- name: Run preview e2e smoke tests
working-directory: cli
run: npx playwright test
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: cli/playwright-report/
retention-days: 7

3
.gitignore vendored
View File

@ -51,3 +51,6 @@ out/
.claude/settings.local.json
.claude/session-state/
ui-ux-pro-max-website/*
cli/playwright-report/
cli/test-results/

38
CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,38 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to a positive environment:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing for mistakes
Examples of unacceptable behavior:
- The use of sexualized language or imagery, and sexual attention of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information without explicit permission
- Other conduct which could reasonably be considered inappropriate
## Enforcement Responsibilities
Maintainers are responsible for clarifying and enforcing standards of acceptable behavior and will take appropriate, fair corrective action in response to any behavior deemed inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all community spaces (issues, pull requests, discussions) and also applies when an individual is officially representing the project in public spaces.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the maintainers by opening a [GitHub Discussion](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/discussions) marked private/moderation, or via the contact listed on [uupm.cc](https://www.uupm.cc). All complaints will be reviewed and investigated promptly and fairly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.

35
SECURITY.md Normal file
View File

@ -0,0 +1,35 @@
# Security Policy
## Supported Versions
Only the latest released version of `ui-ux-pro-max-cli` and the latest `main` branch of this skill receive security fixes.
| Version | Supported |
|---------|-----------|
| Latest release | ✅ |
| Older releases | ❌ |
## Reporting a Vulnerability
Please **do not** open a public GitHub issue for security vulnerabilities.
Instead, report it privately using [GitHub's private vulnerability reporting](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/security/advisories/new) (Security tab → "Report a vulnerability").
Include as much of the following as possible:
- A description of the vulnerability and its potential impact
- Steps to reproduce (command, prompt, or CLI flags used)
- The version of `ui-ux-pro-max-cli` and the AI assistant/platform involved
- Any relevant logs or output
We aim to acknowledge reports within 5 business days and to provide a fix or mitigation timeline within 14 days for confirmed issues.
## Scope
This project is a design-system generation skill: a Python search/CLI tool and static data (CSV/JSON) consumed by AI coding assistants. In-scope concerns include:
- Arbitrary code execution via the CLI installer or search scripts
- Path traversal or unsafe file writes when running `uipro init` / `uipro uninstall`
- Supply-chain issues in the `ui-ux-pro-max-cli` npm package or its release pipeline
Out of scope: the design output itself (colors, fonts, UI recommendations) is not a security surface.

64
cli/package-lock.json generated
View File

@ -18,12 +18,29 @@
"uipro": "dist/index.js"
},
"devDependencies": {
"@playwright/test": "^1.61.1",
"@types/bun": "^1.1.14",
"@types/node": "^22.10.1",
"@types/prompts": "^2.4.9",
"typescript": "^5.7.2"
}
},
"node_modules/@playwright/test": {
"version": "1.61.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz",
"integrity": "sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.61.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/@types/bun": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.3.5.tgz",
@ -131,6 +148,21 @@
"integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
"license": "MIT"
},
"node_modules/fsevents": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/get-east-asian-width": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.4.0.tgz",
@ -254,6 +286,38 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/playwright": {
"version": "1.61.1",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.61.1.tgz",
"integrity": "sha512-DWnY5o3YbLWK4GovuAVwpqL+1VwGNdUGrRr++8j8PtQQzvAVZUIMjKQ90fY689sEJZJBbZVw1rXaOKSTitkzPQ==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"playwright-core": "1.61.1"
},
"bin": {
"playwright": "cli.js"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"fsevents": "2.3.2"
}
},
"node_modules/playwright-core": {
"version": "1.61.1",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.61.1.tgz",
"integrity": "sha512-h7Qlt6m4REp25qvIdvbDtVmD4LqVXfpRxhORv9L0jzETM05p4fuPJ3dKyuSXQxDSbXnmS79HAgi9589lGSpLkg==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"playwright-core": "cli.js"
},
"engines": {
"node": ">=18"
}
},
"node_modules/prompts": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",

View File

@ -40,12 +40,13 @@
"author": "",
"license": "MIT",
"dependencies": {
"commander": "^12.1.0",
"chalk": "^5.3.0",
"commander": "^12.1.0",
"ora": "^8.1.1",
"prompts": "^2.4.2"
},
"devDependencies": {
"@playwright/test": "^1.61.1",
"@types/bun": "^1.1.14",
"@types/node": "^22.10.1",
"@types/prompts": "^2.4.9",

18
cli/playwright.config.ts Normal file
View File

@ -0,0 +1,18 @@
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: 'html',
use: {
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});

View File

@ -0,0 +1,31 @@
import { test, expect } from '@playwright/test';
import path from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/**
* Smoke test for the generated design-system preview pages under /preview.
* These files are shipped as proof that the design system generator produces
* working, self-contained HTML (see README "How Design System Generation Works").
* This guards against a preview shipping with broken markup or JS errors.
*/
const PREVIEW_DIR = path.resolve(__dirname, '../../../preview');
const PREVIEW_FILE = 'xiaomaomi-app.html';
test.describe('generated preview pages', () => {
test(`${PREVIEW_FILE} renders without console errors`, async ({ page }) => {
const consoleErrors: string[] = [];
page.on('console', (msg) => {
if (msg.type() === 'error') consoleErrors.push(msg.text());
});
page.on('pageerror', (err) => consoleErrors.push(err.message));
const fileUrl = pathToFileURL(path.join(PREVIEW_DIR, PREVIEW_FILE)).href;
await page.goto(fileUrl);
await expect(page.locator('body')).toBeVisible();
expect(consoleErrors, `console errors: ${consoleErrors.join('\n')}`).toHaveLength(0);
});
});

View File

@ -299,7 +299,7 @@
<header class="header">
<div class="logo">
<div class="logo-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2.5 0 4 1.5 5 3.5 1 .9 1.5 2.1 1.5 3.5 0 2.8-2.2 5-5 5-1.2 0-2.3-.4-3.2-1-.1.4-.3.8-.5 1.2-.6 1.2-1.5 2.2-2.6 2.8-.3.2-.7.3-1 .5-.4.2-.8.4-1.2.5-.5.2-1 .3-1.5.3-1.7 0-3.2-1.4-3.5-3.1-.1-.5 0-1 .2-1.5.2-.4.5-.7.8-1 .4-.4.8-.7 1.2-1 .5-.3 1-.5 1.5-.6.6-.2 1.2-.2 1.8-.1.5.1 1 .3 1.5.5.4.2.8.4 1.2.7.3.2.6.5.9.8.2.2.4.4.6.7.2.2.3.5.5.7.2.3.3.6.5 1 .2.4.3.8.4 1.2.1.5.1 1 .1 1.5 0 .5-.1 1-.3 1.5-.2.5-.5.9-.8 1.3-.4.4-.9.7-1.4.9-.5.2-1 .4-1.6.4-.5 0-1-.1-1.5-.3-.4-.2-.8-.4-1.2-.7-.3-.2-.6-.5-.9-.8-.2-.2-.4-.5-.6-.7-.2-.3-.4-.5-.6-.8-.2-.2-.4-.5-.6-.7-.2-.2-.4-.5-.5-.7-.2-.2-.3-.5-.5-.7-.1-.2-.3-.4-.4-.6-.1-.2-.2-.4-.3-.6-.1-.2-.2-.4-.2-.6-.1-.2-.1-.4-.2-.6 0-.2-.1-.4-.1-.6 0-.2 0-.4.1-.6.1-.2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16 1.42-.44l.02 2.44c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5l.02-2.44c.4.28.89.44 1.42.44 1.38 0 2.5-1.12 2.5-2.5 0-1-.6-1.86-1.44-2.28.19-.59.31-1.23.31-1.91 0-3.31-2.69-6-6-6z"/></svg>
</div>
小猫咪
</div>
@ -317,7 +317,7 @@
<section class="hero">
<div class="hero-card">
<div class="cat-avatar" role="img" aria-label="猫咪头像">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2.5 0 4 1.5 5 3.5 1 .9 1.5 2.1 1.5 3.5 0 2.8-2.2 5-5 5-1.2 0-2.3-.4-3.2-1-.1.4-.3.8-.5 1.2-.6 1.2-1.5 2.2-2.6 2.8-.3.2-.7.3-1 .5-.4.2-.8.4-1.2.5-.5.2-1 .3-1.5.3-1.7 0-3.2-1.4-3.5-3.1-.1-.5 0-1 .2-1.5.2-.4.5-.7.8-1 .4-.4.8-.7 1.2-1 .5-.3 1-.5 1.5-.6.6-.2 1.2-.2 1.8-.1.5.1 1 .3 1.5.5.4.2.8.4 1.2.7.3.2.6.5.9.8.2.2.4.4.6.7.2.2.3.5.5.7.2.3.3.6.5 1 .2.4.3.8.4 1.2.1.5.1 1 .1 1.5 0 .5-.1 1-.3 1.5-.2.5-.5.9-.8 1.3-.4.4-.9.7-1.4.9-.5.2-1 .4-1.6.4-.5 0-1-.1-1.5-.3-.4-.2-.8-.4-1.2-.7-.3-.2-.6-.5-.9-.8-.2-.2-.4-.5-.6-.7-.2-.3-.4-.5-.6-.8-.2-.2-.4-.5-.6-.7-.2-.2-.4-.5-.5-.7-.2-.2-.3-.5-.5-.7-.1-.2-.3-.4-.4-.6-.1-.2-.2-.4-.3-.6-.1-.2-.2-.4-.2-.6-.1-.2-.1-.4-.2-.6 0-.2-.1-.4-.1-.6 0-.2 0-.4.1-.6.1-.2.2-.4.3-.5.1-.2.3-.3.4-.5.2-.1.3-.3.5-.4.2-.1.3-.3.5-.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.02-2.44c.4.28.89.44 1.42.44 1.38 0 2.5-1.12 2.5-2.5 0-1-.6-1.86-1.44-2.28.19-.59.31-1.23.31-1.91 0-3.31-2.69-6-6-6z"/></svg>
</div>
<h1>喵小橘</h1>
<p class="subtitle">橘猫 · 1岁2个月</p>