xiaohongshu
xiaohongshu
frontend-checker
Kiểm tra sức khỏe frontend tự động using Puppeteer. Invoke khi user muốn tìm broken pages, console errors, hoặc verify frontend stability.
Full skill instructions
Skill này tự động hóa việc phát hiện lỗi frontend (Console Errors, Network Failures, Broken Links) sử dụng Puppeteer.
Đảm bảo puppeteer đã được cài đặt:
cd frontend
npm install puppeteer
Đảm bảo frontend server đang chạy:
http://localhost:3000http://aicmr.local hoặc domain khácTạo Node.js script sử dụng Puppeteer để:
node _health_check.js
/ - Trang chủ/login - Đăng nhập/register - Đăng ký/blog - Blog/dashboard - Dashboard chính/dashboard/stats - Thống kê/dashboard/posts - Quản lý bài viết/dashboard/users-manager - Quản lý users/dashboard/settings - Cài đặt/user/profile - Profile userconst puppeteer = require('puppeteer');
const fs = require('fs');
const BASE_URL = process.env.BASE_URL || 'http://localhost:3000';
const RESULTS = [];
async function checkPage(page, url, name, options = {}) {
const errors = [];
const warnings = [];
const networkErrors = [];
// Console listeners
page.on('console', msg => {
const type = msg.type();
const text = msg.text();
if (type === 'error') {
errors.push({ type: 'console', text });
} else if (type === 'warning') {
warnings.push({ type: 'console', text });
}
});
// Network listener
page.on('response', response => {
const status = response.status();
if (status >= 400) {
networkErrors.push({
url: response.url(),
status: status,
text: response.statusText()
});
}
});
try {
await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 });
// Check for broken links
const links = await page.evaluate(() => {
return Array.from(document.querySelectorAll('a'))
.map(a => a.href)
.filter(href => href && !href.startsWith('javascript:'));
});
RESULTS.push({
page: name,
url: url,
status: 'success',
errors,
warnings,
networkErrors,
linksCount: links.length
});
} catch (error) {
RESULTS.push({
page: name,
url: url,
status: 'failed',
error: error.message
});
}
}
(async () => {
const browser = await puppeteer.launch({
headless: "new",
args: ['--no-sandbox', '--disable-setuid-sandbox', '--ignore-certificate-errors'],
defaultViewport: { width: 1280, height: 800 }
});
const page = await browser.newPage();
// Check public pages
const publicPages = [
['/', 'Home'],
['/login', 'Login'],
['/register', 'Register'],
['/blog', 'Blog']
];
for (const [path, name] of publicPages) {
await checkPage(page, `${BASE_URL}${path}`, name);
}
// TODO: Add auth flow if needed
// await page.goto(`${BASE_URL}/login`);
// await page.type('input[name="email"]', '[email protected]');
// await page.type('input[name="password"]', 'password');
// await page.click('button[type="submit"]');
// await page.waitForNavigation();
await browser.close();
// Generate report
console.log('\n=== FRONTEND HEALTH CHECK REPORT ===\n');
console.log(`Total pages checked: ${RESULTS.length}`);
const failedPages = RESULTS.filter(r => r.status === 'failed');
const pagesWithErrors = RESULTS.filter(r => r.errors && r.errors.length > 0);
const pagesWithNetworkErrors = RESULTS.filter(r => r.networkErrors && r.networkErrors.length > 0);
console.log(`Failed pages: ${failedPages.length}`);
console.log(`Pages with console errors: ${pagesWithErrors.length}`);
console.log(`Pages with network errors: ${pagesWithNetworkErrors.length}\n`);
// Detailed report
RESULTS.forEach(result => {
console.log(`\n--- ${result.page} (${result.url}) ---`);
console.log(`Status: ${result.status}`);
if (result.errors && result.errors.length > 0) {
console.log(`Console Errors (${result.errors.length}):`);
result.errors.forEach(e => console.log(` - ${e.text}`));
}
if (result.networkErrors && result.networkErrors.length > 0) {
console.log(`Network Errors (${result.networkErrors.length}):`);
result.networkErrors.forEach(e => console.log(` - ${e.url} [${e.status}]`));
}
});
})();
Format báo cáo nên bao gồm:
Tổng quan
Chi tiết từng trang
Đề xuất fix
# Sử dụng puppeteer-core nếu gặp vấn đề với Chrome
npm install puppeteer-core
# Hoặc cài đặt Chrome riêng
timeout trong page.goto()xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience