diff --git a/.agents/skills/backend-patterns/SKILL.md b/.agents/skills/backend-patterns/SKILL.md index 42c0cbee..30898b4d 100644 --- a/.agents/skills/backend-patterns/SKILL.md +++ b/.agents/skills/backend-patterns/SKILL.md @@ -23,7 +23,7 @@ Backend architecture patterns and best practices for scalable server-side applic ### RESTful API Structure ```typescript -// ✅ Resource-based URLs +// PASS: Resource-based URLs GET /api/markets # List resources GET /api/markets/:id # Get single resource POST /api/markets # Create resource @@ -31,7 +31,7 @@ PUT /api/markets/:id # Replace resource PATCH /api/markets/:id # Update resource DELETE /api/markets/:id # Delete resource -// ✅ Query parameters for filtering, sorting, pagination +// PASS: Query parameters for filtering, sorting, pagination GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -131,7 +131,7 @@ export default withAuth(async (req, res) => { ### Query Optimization ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -139,7 +139,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -148,13 +148,13 @@ const { data } = await supabase ### N+1 Query Prevention ```typescript -// ❌ BAD: N+1 query problem +// FAIL: BAD: N+1 query problem const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N queries } -// ✅ GOOD: Batch fetch +// PASS: GOOD: Batch fetch const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 query diff --git a/.agents/skills/coding-standards/SKILL.md b/.agents/skills/coding-standards/SKILL.md index 70d36239..200b55c0 100644 --- a/.agents/skills/coding-standards/SKILL.md +++ b/.agents/skills/coding-standards/SKILL.md @@ -48,12 +48,12 @@ Universal coding standards applicable across all projects. ### Variable Naming ```typescript -// ✅ GOOD: Descriptive names +// PASS: GOOD: Descriptive names const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ BAD: Unclear names +// FAIL: BAD: Unclear names const q = 'election' const flag = true const x = 1000 @@ -62,12 +62,12 @@ const x = 1000 ### Function Naming ```typescript -// ✅ GOOD: Verb-noun pattern +// PASS: GOOD: Verb-noun pattern async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ BAD: Unclear or noun-only +// FAIL: BAD: Unclear or noun-only async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -76,7 +76,7 @@ function email(e) { } ### Immutability Pattern (CRITICAL) ```typescript -// ✅ ALWAYS use spread operator +// PASS: ALWAYS use spread operator const updatedUser = { ...user, name: 'New Name' @@ -84,7 +84,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ NEVER mutate directly +// FAIL: NEVER mutate directly user.name = 'New Name' // BAD items.push(newItem) // BAD ``` @@ -92,7 +92,7 @@ items.push(newItem) // BAD ### Error Handling ```typescript -// ✅ GOOD: Comprehensive error handling +// PASS: GOOD: Comprehensive error handling async function fetchData(url: string) { try { const response = await fetch(url) @@ -108,7 +108,7 @@ async function fetchData(url: string) { } } -// ❌ BAD: No error handling +// FAIL: BAD: No error handling async function fetchData(url) { const response = await fetch(url) return response.json() @@ -118,14 +118,14 @@ async function fetchData(url) { ### Async/Await Best Practices ```typescript -// ✅ GOOD: Parallel execution when possible +// PASS: GOOD: Parallel execution when possible const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ BAD: Sequential when unnecessary +// FAIL: BAD: Sequential when unnecessary const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -134,7 +134,7 @@ const stats = await fetchStats() ### Type Safety ```typescript -// ✅ GOOD: Proper types +// PASS: GOOD: Proper types interface Market { id: string name: string @@ -146,7 +146,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ BAD: Using 'any' +// FAIL: BAD: Using 'any' function getMarket(id: any): Promise { // Implementation } @@ -157,7 +157,7 @@ function getMarket(id: any): Promise { ### Component Structure ```typescript -// ✅ GOOD: Functional component with types +// PASS: GOOD: Functional component with types interface ButtonProps { children: React.ReactNode onClick: () => void @@ -182,7 +182,7 @@ export function Button({ ) } -// ❌ BAD: No types, unclear structure +// FAIL: BAD: No types, unclear structure export function Button(props) { return } @@ -191,7 +191,7 @@ export function Button(props) { ### Custom Hooks ```typescript -// ✅ GOOD: Reusable custom hook +// PASS: GOOD: Reusable custom hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -213,25 +213,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### State Management ```typescript -// ✅ GOOD: Proper state updates +// PASS: GOOD: Proper state updates const [count, setCount] = useState(0) // Functional update for state based on previous state setCount(prev => prev + 1) -// ❌ BAD: Direct state reference +// FAIL: BAD: Direct state reference setCount(count + 1) // Can be stale in async scenarios ``` ### Conditional Rendering ```typescript -// ✅ GOOD: Clear conditional rendering +// PASS: GOOD: Clear conditional rendering {isLoading && } {error && } {data && } -// ❌ BAD: Ternary hell +// FAIL: BAD: Ternary hell {isLoading ? : error ? : data ? : null} ``` @@ -254,7 +254,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### Response Format ```typescript -// ✅ GOOD: Consistent response structure +// PASS: GOOD: Consistent response structure interface ApiResponse { success: boolean data?: T @@ -285,7 +285,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ GOOD: Schema validation +// PASS: GOOD: Schema validation const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -348,14 +348,14 @@ types/market.types.ts # camelCase with .types suffix ### When to Comment ```typescript -// ✅ GOOD: Explain WHY, not WHAT +// PASS: GOOD: Explain WHY, not WHAT // Use exponential backoff to avoid overwhelming the API during outages const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Deliberately using mutation here for performance with large arrays items.push(newItem) -// ❌ BAD: Stating the obvious +// FAIL: BAD: Stating the obvious // Increment counter by 1 count++ @@ -395,12 +395,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ GOOD: Memoize expensive computations +// PASS: GOOD: Memoize expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ GOOD: Memoize callbacks +// PASS: GOOD: Memoize callbacks const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -411,7 +411,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ GOOD: Lazy load heavy components +// PASS: GOOD: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -426,13 +426,13 @@ export function Dashboard() { ### Database Queries ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -459,12 +459,12 @@ test('calculates similarity correctly', () => { ### Test Naming ```typescript -// ✅ GOOD: Descriptive test names +// PASS: GOOD: Descriptive test names test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ BAD: Vague test names +// FAIL: BAD: Vague test names test('works', () => { }) test('test search', () => { }) ``` @@ -475,12 +475,12 @@ Watch for these anti-patterns: ### 1. Long Functions ```typescript -// ❌ BAD: Function > 50 lines +// FAIL: BAD: Function > 50 lines function processMarketData() { // 100 lines of code } -// ✅ GOOD: Split into smaller functions +// PASS: GOOD: Split into smaller functions function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -490,7 +490,7 @@ function processMarketData() { ### 2. Deep Nesting ```typescript -// ❌ BAD: 5+ levels of nesting +// FAIL: BAD: 5+ levels of nesting if (user) { if (user.isAdmin) { if (market) { @@ -503,7 +503,7 @@ if (user) { } } -// ✅ GOOD: Early returns +// PASS: GOOD: Early returns if (!user) return if (!user.isAdmin) return if (!market) return @@ -515,11 +515,11 @@ if (!hasPermission) return ### 3. Magic Numbers ```typescript -// ❌ BAD: Unexplained numbers +// FAIL: BAD: Unexplained numbers if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ GOOD: Named constants +// PASS: GOOD: Named constants const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/.agents/skills/frontend-patterns/SKILL.md b/.agents/skills/frontend-patterns/SKILL.md index 7ce38802..ef0de63f 100644 --- a/.agents/skills/frontend-patterns/SKILL.md +++ b/.agents/skills/frontend-patterns/SKILL.md @@ -23,7 +23,7 @@ Modern frontend patterns for React, Next.js, and performant user interfaces. ### Composition Over Inheritance ```typescript -// ✅ GOOD: Component composition +// PASS: GOOD: Component composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -294,17 +294,17 @@ export function useMarkets() { ### Memoization ```typescript -// ✅ useMemo for expensive computations +// PASS: useMemo for expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback for functions passed to children +// PASS: useCallback for functions passed to children const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo for pure components +// PASS: React.memo for pure components export const MarketCard = React.memo(({ market }) => { return (
@@ -320,7 +320,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Lazy load heavy components +// PASS: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -515,7 +515,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ List animations +// PASS: List animations export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -534,7 +534,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animations +// PASS: Modal animations export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/.agents/skills/security-review/SKILL.md b/.agents/skills/security-review/SKILL.md index 35403243..af848b95 100644 --- a/.agents/skills/security-review/SKILL.md +++ b/.agents/skills/security-review/SKILL.md @@ -22,13 +22,13 @@ This skill ensures all code follows security best practices and identifies poten ### 1. Secrets Management -#### ❌ NEVER Do This +#### FAIL: NEVER Do This ```typescript const apiKey = "sk-proj-xxxxx" // Hardcoded secret const dbPassword = "password123" // In source code ``` -#### ✅ ALWAYS Do This +#### PASS: ALWAYS Do This ```typescript const apiKey = process.env.OPENAI_API_KEY const dbUrl = process.env.DATABASE_URL @@ -108,14 +108,14 @@ function validateFileUpload(file: File) { ### 3. SQL Injection Prevention -#### ❌ NEVER Concatenate SQL +#### FAIL: NEVER Concatenate SQL ```typescript // DANGEROUS - SQL Injection vulnerability const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ ALWAYS Use Parameterized Queries +#### PASS: ALWAYS Use Parameterized Queries ```typescript // Safe - parameterized query const { data } = await supabase @@ -140,10 +140,10 @@ await db.query( #### JWT Token Handling ```typescript -// ❌ WRONG: localStorage (vulnerable to XSS) +// FAIL: WRONG: localStorage (vulnerable to XSS) localStorage.setItem('token', token) -// ✅ CORRECT: httpOnly cookies +// PASS: CORRECT: httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -300,18 +300,18 @@ app.use('/api/search', searchLimiter) #### Logging ```typescript -// ❌ WRONG: Logging sensitive data +// FAIL: WRONG: Logging sensitive data console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ CORRECT: Redact sensitive data +// PASS: CORRECT: Redact sensitive data console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### Error Messages ```typescript -// ❌ WRONG: Exposing internal details +// FAIL: WRONG: Exposing internal details catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -319,7 +319,7 @@ catch (error) { ) } -// ✅ CORRECT: Generic error messages +// PASS: CORRECT: Generic error messages catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/.agents/skills/tdd-workflow/SKILL.md b/.agents/skills/tdd-workflow/SKILL.md index 90c0a6df..63c6309e 100644 --- a/.agents/skills/tdd-workflow/SKILL.md +++ b/.agents/skills/tdd-workflow/SKILL.md @@ -314,39 +314,39 @@ npm run test:coverage ## Common Testing Mistakes to Avoid -### ❌ WRONG: Testing Implementation Details +### FAIL: WRONG: Testing Implementation Details ```typescript // Don't test internal state expect(component.state.count).toBe(5) ``` -### ✅ CORRECT: Test User-Visible Behavior +### PASS: CORRECT: Test User-Visible Behavior ```typescript // Test what users see expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ WRONG: Brittle Selectors +### FAIL: WRONG: Brittle Selectors ```typescript // Breaks easily await page.click('.css-class-xyz') ``` -### ✅ CORRECT: Semantic Selectors +### PASS: CORRECT: Semantic Selectors ```typescript // Resilient to changes await page.click('button:has-text("Submit")') await page.click('[data-testid="submit-button"]') ``` -### ❌ WRONG: No Test Isolation +### FAIL: WRONG: No Test Isolation ```typescript // Tests depend on each other test('creates user', () => { /* ... */ }) test('updates same user', () => { /* depends on previous test */ }) ``` -### ✅ CORRECT: Independent Tests +### PASS: CORRECT: Independent Tests ```typescript // Each test sets up its own data test('creates user', () => { diff --git a/.claude-plugin/PLUGIN_SCHEMA_NOTES.md b/.claude-plugin/PLUGIN_SCHEMA_NOTES.md index 0483945e..21b68c99 100644 --- a/.claude-plugin/PLUGIN_SCHEMA_NOTES.md +++ b/.claude-plugin/PLUGIN_SCHEMA_NOTES.md @@ -120,7 +120,7 @@ Assume the validator is hostile and literal. ## The `hooks` Field: DO NOT ADD -> ⚠️ **CRITICAL:** Do NOT add a `"hooks"` field to `plugin.json`. This is enforced by a regression test. +> WARNING: **CRITICAL:** Do NOT add a `"hooks"` field to `plugin.json`. This is enforced by a regression test. ### Why This Matters diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 557b5c92..a2980545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,6 +198,10 @@ jobs: run: node scripts/ci/catalog.js --text continue-on-error: false + - name: Check unicode safety + run: node scripts/ci/check-unicode-safety.js + continue-on-error: false + security: name: Security Scan runs-on: ubuntu-latest diff --git a/.github/workflows/reusable-validate.yml b/.github/workflows/reusable-validate.yml index 6612b683..15c567c2 100644 --- a/.github/workflows/reusable-validate.yml +++ b/.github/workflows/reusable-validate.yml @@ -44,3 +44,6 @@ jobs: - name: Validate rules run: node scripts/ci/validate-rules.js + + - name: Check unicode safety + run: node scripts/ci/check-unicode-safety.js diff --git a/.kiro/README.md b/.kiro/README.md index 844a8d5c..6b105d5b 100644 --- a/.kiro/README.md +++ b/.kiro/README.md @@ -597,7 +597,7 @@ For more detailed information, see the `docs/` directory: ## Contributers -- Himanshu Sharma [@ihimanss](https://github.com/ihimanss) +- Himanshu Sharma [@ihimanss](https://github.com/ihimanss) - Sungmin Hong [@aws-hsungmin](https://github.com/aws-hsungmin) diff --git a/.kiro/scripts/quality-gate.sh b/.kiro/scripts/quality-gate.sh index fddeaedb..4d93a026 100755 --- a/.kiro/scripts/quality-gate.sh +++ b/.kiro/scripts/quality-gate.sh @@ -36,7 +36,7 @@ detect_pm() { } PM=$(detect_pm) -echo "📦 Package manager: $PM" +echo "Package manager: $PM" echo "" # ── Helper: run a check ───────────────────────────────────── diff --git a/.kiro/skills/agentic-engineering/SKILL.md b/.kiro/skills/agentic-engineering/SKILL.md index 219f2470..72831ba1 100644 --- a/.kiro/skills/agentic-engineering/SKILL.md +++ b/.kiro/skills/agentic-engineering/SKILL.md @@ -62,10 +62,10 @@ Choose model tier based on task complexity: - **Haiku**: Classification, boilerplate transforms, narrow edits - Example: Rename variable, add type annotation, format code - + - **Sonnet**: Implementation and refactors - Example: Implement feature, refactor module, write tests - + - **Opus**: Architecture, root-cause analysis, multi-file invariants - Example: Design system, debug complex issue, review architecture @@ -75,10 +75,10 @@ Choose model tier based on task complexity: - **Continue session** for closely-coupled units - Example: Implementing related functions in same module - + - **Start fresh session** after major phase transitions - Example: Moving from implementation to testing - + - **Compact after milestone completion**, not during active debugging - Example: After feature complete, before starting next feature diff --git a/.kiro/skills/backend-patterns/SKILL.md b/.kiro/skills/backend-patterns/SKILL.md index ec9faf89..fc183380 100644 --- a/.kiro/skills/backend-patterns/SKILL.md +++ b/.kiro/skills/backend-patterns/SKILL.md @@ -25,7 +25,7 @@ Backend architecture patterns and best practices for scalable server-side applic ### RESTful API Structure ```typescript -// ✅ Resource-based URLs +// PASS: Resource-based URLs GET /api/markets # List resources GET /api/markets/:id # Get single resource POST /api/markets # Create resource @@ -33,7 +33,7 @@ PUT /api/markets/:id # Replace resource PATCH /api/markets/:id # Update resource DELETE /api/markets/:id # Delete resource -// ✅ Query parameters for filtering, sorting, pagination +// PASS: Query parameters for filtering, sorting, pagination GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -133,7 +133,7 @@ export default withAuth(async (req, res) => { ### Query Optimization ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -141,7 +141,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -150,13 +150,13 @@ const { data } = await supabase ### N+1 Query Prevention ```typescript -// ❌ BAD: N+1 query problem +// FAIL: BAD: N+1 query problem const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N queries } -// ✅ GOOD: Batch fetch +// PASS: GOOD: Batch fetch const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 query diff --git a/.kiro/skills/coding-standards/SKILL.md b/.kiro/skills/coding-standards/SKILL.md index 8718676e..100f15c8 100644 --- a/.kiro/skills/coding-standards/SKILL.md +++ b/.kiro/skills/coding-standards/SKILL.md @@ -50,12 +50,12 @@ Universal coding standards applicable across all projects. ### Variable Naming ```typescript -// ✅ GOOD: Descriptive names +// PASS: GOOD: Descriptive names const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ BAD: Unclear names +// FAIL: BAD: Unclear names const q = 'election' const flag = true const x = 1000 @@ -64,12 +64,12 @@ const x = 1000 ### Function Naming ```typescript -// ✅ GOOD: Verb-noun pattern +// PASS: GOOD: Verb-noun pattern async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ BAD: Unclear or noun-only +// FAIL: BAD: Unclear or noun-only async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -78,7 +78,7 @@ function email(e) { } ### Immutability Pattern (CRITICAL) ```typescript -// ✅ ALWAYS use spread operator +// PASS: ALWAYS use spread operator const updatedUser = { ...user, name: 'New Name' @@ -86,7 +86,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ NEVER mutate directly +// FAIL: NEVER mutate directly user.name = 'New Name' // BAD items.push(newItem) // BAD ``` @@ -94,7 +94,7 @@ items.push(newItem) // BAD ### Error Handling ```typescript -// ✅ GOOD: Comprehensive error handling +// PASS: GOOD: Comprehensive error handling async function fetchData(url: string) { try { const response = await fetch(url) @@ -110,7 +110,7 @@ async function fetchData(url: string) { } } -// ❌ BAD: No error handling +// FAIL: BAD: No error handling async function fetchData(url) { const response = await fetch(url) return response.json() @@ -120,14 +120,14 @@ async function fetchData(url) { ### Async/Await Best Practices ```typescript -// ✅ GOOD: Parallel execution when possible +// PASS: GOOD: Parallel execution when possible const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ BAD: Sequential when unnecessary +// FAIL: BAD: Sequential when unnecessary const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -136,7 +136,7 @@ const stats = await fetchStats() ### Type Safety ```typescript -// ✅ GOOD: Proper types +// PASS: GOOD: Proper types interface Market { id: string name: string @@ -148,7 +148,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ BAD: Using 'any' +// FAIL: BAD: Using 'any' function getMarket(id: any): Promise { // Implementation } @@ -159,7 +159,7 @@ function getMarket(id: any): Promise { ### Component Structure ```typescript -// ✅ GOOD: Functional component with types +// PASS: GOOD: Functional component with types interface ButtonProps { children: React.ReactNode onClick: () => void @@ -184,7 +184,7 @@ export function Button({ ) } -// ❌ BAD: No types, unclear structure +// FAIL: BAD: No types, unclear structure export function Button(props) { return } @@ -193,7 +193,7 @@ export function Button(props) { ### Custom Hooks ```typescript -// ✅ GOOD: Reusable custom hook +// PASS: GOOD: Reusable custom hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -215,25 +215,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### State Management ```typescript -// ✅ GOOD: Proper state updates +// PASS: GOOD: Proper state updates const [count, setCount] = useState(0) // Functional update for state based on previous state setCount(prev => prev + 1) -// ❌ BAD: Direct state reference +// FAIL: BAD: Direct state reference setCount(count + 1) // Can be stale in async scenarios ``` ### Conditional Rendering ```typescript -// ✅ GOOD: Clear conditional rendering +// PASS: GOOD: Clear conditional rendering {isLoading && } {error && } {data && } -// ❌ BAD: Ternary hell +// FAIL: BAD: Ternary hell {isLoading ? : error ? : data ? : null} ``` @@ -256,7 +256,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### Response Format ```typescript -// ✅ GOOD: Consistent response structure +// PASS: GOOD: Consistent response structure interface ApiResponse { success: boolean data?: T @@ -287,7 +287,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ GOOD: Schema validation +// PASS: GOOD: Schema validation const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -350,14 +350,14 @@ types/market.types.ts # camelCase with .types suffix ### When to Comment ```typescript -// ✅ GOOD: Explain WHY, not WHAT +// PASS: GOOD: Explain WHY, not WHAT // Use exponential backoff to avoid overwhelming the API during outages const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Deliberately using mutation here for performance with large arrays items.push(newItem) -// ❌ BAD: Stating the obvious +// FAIL: BAD: Stating the obvious // Increment counter by 1 count++ @@ -397,12 +397,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ GOOD: Memoize expensive computations +// PASS: GOOD: Memoize expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ GOOD: Memoize callbacks +// PASS: GOOD: Memoize callbacks const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -413,7 +413,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ GOOD: Lazy load heavy components +// PASS: GOOD: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -428,13 +428,13 @@ export function Dashboard() { ### Database Queries ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -461,12 +461,12 @@ test('calculates similarity correctly', () => { ### Test Naming ```typescript -// ✅ GOOD: Descriptive test names +// PASS: GOOD: Descriptive test names test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ BAD: Vague test names +// FAIL: BAD: Vague test names test('works', () => { }) test('test search', () => { }) ``` @@ -477,12 +477,12 @@ Watch for these anti-patterns: ### 1. Long Functions ```typescript -// ❌ BAD: Function > 50 lines +// FAIL: BAD: Function > 50 lines function processMarketData() { // 100 lines of code } -// ✅ GOOD: Split into smaller functions +// PASS: GOOD: Split into smaller functions function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -492,7 +492,7 @@ function processMarketData() { ### 2. Deep Nesting ```typescript -// ❌ BAD: 5+ levels of nesting +// FAIL: BAD: 5+ levels of nesting if (user) { if (user.isAdmin) { if (market) { @@ -505,7 +505,7 @@ if (user) { } } -// ✅ GOOD: Early returns +// PASS: GOOD: Early returns if (!user) return if (!user.isAdmin) return if (!market) return @@ -517,11 +517,11 @@ if (!hasPermission) return ### 3. Magic Numbers ```typescript -// ❌ BAD: Unexplained numbers +// FAIL: BAD: Unexplained numbers if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ GOOD: Named constants +// PASS: GOOD: Named constants const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/.kiro/skills/frontend-patterns/SKILL.md b/.kiro/skills/frontend-patterns/SKILL.md index 2e38fcaf..0c87affb 100644 --- a/.kiro/skills/frontend-patterns/SKILL.md +++ b/.kiro/skills/frontend-patterns/SKILL.md @@ -25,7 +25,7 @@ Modern frontend patterns for React, Next.js, and performant user interfaces. ### Composition Over Inheritance ```typescript -// ✅ GOOD: Component composition +// PASS: GOOD: Component composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -296,17 +296,17 @@ export function useMarkets() { ### Memoization ```typescript -// ✅ useMemo for expensive computations +// PASS: useMemo for expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback for functions passed to children +// PASS: useCallback for functions passed to children const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo for pure components +// PASS: React.memo for pure components export const MarketCard = React.memo(({ market }) => { return (
@@ -322,7 +322,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Lazy load heavy components +// PASS: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -517,7 +517,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ List animations +// PASS: List animations export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -536,7 +536,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animations +// PASS: Modal animations export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/.kiro/skills/golang-patterns/SKILL.md b/.kiro/skills/golang-patterns/SKILL.md index c1c02ae1..311de73c 100644 --- a/.kiro/skills/golang-patterns/SKILL.md +++ b/.kiro/skills/golang-patterns/SKILL.md @@ -192,7 +192,7 @@ func TestValidate(t *testing.T) { {"valid", "test@example.com", false}, {"invalid", "not-an-email", true}, } - + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := Validate(tt.input) diff --git a/.kiro/skills/golang-testing/SKILL.md b/.kiro/skills/golang-testing/SKILL.md index df952d82..ddc5d4cf 100644 --- a/.kiro/skills/golang-testing/SKILL.md +++ b/.kiro/skills/golang-testing/SKILL.md @@ -49,7 +49,7 @@ func TestValidateEmail(t *testing.T) { t.Run(tt.name, func(t *testing.T) { err := ValidateEmail(tt.email) if (err != nil) != tt.wantErr { - t.Errorf("ValidateEmail(%q) error = %v, wantErr %v", + t.Errorf("ValidateEmail(%q) error = %v, wantErr %v", tt.email, err, tt.wantErr) } }) @@ -95,19 +95,19 @@ Use `t.Cleanup()` for resource cleanup: ```go func testDB(t *testing.T) *sql.DB { t.Helper() - + db, err := sql.Open("sqlite3", ":memory:") if err != nil { t.Fatalf("failed to open test db: %v", err) } - + // Cleanup runs after test completes t.Cleanup(func() { if err := db.Close(); err != nil { t.Errorf("failed to close db: %v", err) } }) - + return db } @@ -164,7 +164,7 @@ go test -cover ./... | grep -E 'coverage: [0-7][0-9]\.[0-9]%' && exit 1 ```go func BenchmarkValidateEmail(b *testing.B) { email := "user@example.com" - + b.ResetTimer() for i := 0; i < b.N; i++ { ValidateEmail(email) @@ -212,7 +212,7 @@ func TestUserService(t *testing.T) { "1": {ID: "1", Name: "Alice"}, }, } - + service := NewUserService(mock) // ... test logic } @@ -245,16 +245,16 @@ func TestWithPostgres(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") } - + // Setup test container ctx := context.Background() container, err := testcontainers.GenericContainer(ctx, ...) assertNoError(t, err) - + t.Cleanup(func() { container.Terminate(ctx) }) - + // ... test logic } ``` @@ -290,10 +290,10 @@ package user func TestUserHandler(t *testing.T) { req := httptest.NewRequest("GET", "/users/1", nil) rec := httptest.NewRecorder() - + handler := NewUserHandler(mockRepo) handler.ServeHTTP(rec, req) - + assertEqual(t, rec.Code, http.StatusOK) } ``` @@ -304,7 +304,7 @@ func TestUserHandler(t *testing.T) { func TestWithTimeout(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond) defer cancel() - + err := SlowOperation(ctx) if !errors.Is(err, context.DeadlineExceeded) { t.Errorf("expected timeout error, got %v", err) diff --git a/.kiro/skills/python-patterns/SKILL.md b/.kiro/skills/python-patterns/SKILL.md index 2b760912..1ebf2d07 100644 --- a/.kiro/skills/python-patterns/SKILL.md +++ b/.kiro/skills/python-patterns/SKILL.md @@ -30,7 +30,7 @@ class UserRepository: def find_by_id(self, id: str) -> dict | None: # implementation pass - + def save(self, entity: dict) -> dict: # implementation pass @@ -104,11 +104,11 @@ class FileProcessor: def __init__(self, filename: str): self.filename = filename self.file = None - + def __enter__(self): self.file = open(self.filename, 'r') return self.file - + def __exit__(self, exc_type, exc_val, exc_tb): if self.file: self.file.close() @@ -173,13 +173,13 @@ def slow_function(): def singleton(cls): """Decorator to make a class a singleton""" instances = {} - + @wraps(cls) def get_instance(*args, **kwargs): if cls not in instances: instances[cls] = cls(*args, **kwargs) return instances[cls] - + return get_instance @singleton @@ -216,7 +216,7 @@ class AsyncDatabase: async def __aenter__(self): await self.connect() return self - + async def __aexit__(self, exc_type, exc_val, exc_tb): await self.disconnect() @@ -238,7 +238,7 @@ class Repository(Generic[T]): """Generic repository pattern""" def __init__(self, entity_type: type[T]): self.entity_type = entity_type - + def find_by_id(self, id: str) -> T | None: # implementation pass @@ -280,17 +280,17 @@ class UserService: self.repository = repository self.logger = logger self.cache = cache - + def get_user(self, user_id: str) -> User | None: if self.cache: cached = self.cache.get(user_id) if cached: return cached - + user = self.repository.find_by_id(user_id) if user and self.cache: self.cache.set(user_id, user) - + return user ``` @@ -375,16 +375,16 @@ class User: def __init__(self, name: str): self._name = name self._email = None - + @property def name(self) -> str: """Read-only property""" return self._name - + @property def email(self) -> str | None: return self._email - + @email.setter def email(self, value: str) -> None: if '@' not in value: diff --git a/.kiro/skills/python-testing/SKILL.md b/.kiro/skills/python-testing/SKILL.md index 671352f2..639d0295 100644 --- a/.kiro/skills/python-testing/SKILL.md +++ b/.kiro/skills/python-testing/SKILL.md @@ -23,7 +23,7 @@ Use **pytest** as the testing framework for its powerful features and clean synt def test_user_creation(): """Test that a user can be created with valid data""" user = User(name="Alice", email="alice@example.com") - + assert user.name == "Alice" assert user.email == "alice@example.com" assert user.is_active is True @@ -52,12 +52,12 @@ def db_session(): engine = create_engine("sqlite:///:memory:") Session = sessionmaker(bind=engine) session = Session() - + # Setup Base.metadata.create_all(engine) - + yield session - + # Teardown session.close() @@ -65,7 +65,7 @@ def test_user_repository(db_session): """Test using the db_session fixture""" repo = UserRepository(db_session) user = repo.create(name="Alice", email="alice@example.com") - + assert user.id is not None ``` @@ -206,10 +206,10 @@ def test_user_service_with_mock(): """Test with mock repository""" mock_repo = Mock() mock_repo.find_by_id.return_value = User(id="1", name="Alice") - + service = UserService(mock_repo) user = service.get_user("1") - + assert user.name == "Alice" mock_repo.find_by_id.assert_called_once_with("1") @@ -218,7 +218,7 @@ def test_send_notification(mock_email_service): """Test with patched dependency""" service = NotificationService() service.send("user@example.com", "Hello") - + mock_email_service.send.assert_called_once() ``` @@ -229,10 +229,10 @@ def test_with_mocker(mocker): """Using pytest-mock plugin""" mock_repo = mocker.Mock() mock_repo.find_by_id.return_value = User(id="1", name="Alice") - + service = UserService(mock_repo) user = service.get_user("1") - + assert user.name == "Alice" ``` @@ -357,7 +357,7 @@ def test_with_context(): """pytest provides detailed assertion introspection""" result = calculate_total([1, 2, 3]) expected = 6 - + # pytest shows: assert 5 == 6 assert result == expected ``` @@ -378,7 +378,7 @@ import pytest def test_float_comparison(): result = 0.1 + 0.2 assert result == pytest.approx(0.3) - + # With tolerance assert result == pytest.approx(0.3, abs=1e-9) ``` @@ -402,7 +402,7 @@ def test_exception_details(): """Capture and inspect exception""" with pytest.raises(ValidationError) as exc_info: validate_user(name="", age=-1) - + assert "name" in exc_info.value.errors assert "age" in exc_info.value.errors ``` diff --git a/.kiro/skills/security-review/SKILL.md b/.kiro/skills/security-review/SKILL.md index 93284e13..4c6f1d24 100644 --- a/.kiro/skills/security-review/SKILL.md +++ b/.kiro/skills/security-review/SKILL.md @@ -24,13 +24,13 @@ This skill ensures all code follows security best practices and identifies poten ### 1. Secrets Management -#### ❌ NEVER Do This +#### FAIL: NEVER Do This ```typescript const apiKey = "sk-proj-xxxxx" // Hardcoded secret const dbPassword = "password123" // In source code ``` -#### ✅ ALWAYS Do This +#### PASS: ALWAYS Do This ```typescript const apiKey = process.env.OPENAI_API_KEY const dbUrl = process.env.DATABASE_URL @@ -110,14 +110,14 @@ function validateFileUpload(file: File) { ### 3. SQL Injection Prevention -#### ❌ NEVER Concatenate SQL +#### FAIL: NEVER Concatenate SQL ```typescript // DANGEROUS - SQL Injection vulnerability const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ ALWAYS Use Parameterized Queries +#### PASS: ALWAYS Use Parameterized Queries ```typescript // Safe - parameterized query const { data } = await supabase @@ -142,10 +142,10 @@ await db.query( #### JWT Token Handling ```typescript -// ❌ WRONG: localStorage (vulnerable to XSS) +// FAIL: WRONG: localStorage (vulnerable to XSS) localStorage.setItem('token', token) -// ✅ CORRECT: httpOnly cookies +// PASS: CORRECT: httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -302,18 +302,18 @@ app.use('/api/search', searchLimiter) #### Logging ```typescript -// ❌ WRONG: Logging sensitive data +// FAIL: WRONG: Logging sensitive data console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ CORRECT: Redact sensitive data +// PASS: CORRECT: Redact sensitive data console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### Error Messages ```typescript -// ❌ WRONG: Exposing internal details +// FAIL: WRONG: Exposing internal details catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -321,7 +321,7 @@ catch (error) { ) } -// ✅ CORRECT: Generic error messages +// PASS: CORRECT: Generic error messages catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/.kiro/skills/tdd-workflow/SKILL.md b/.kiro/skills/tdd-workflow/SKILL.md index 79224d36..ba1707cf 100644 --- a/.kiro/skills/tdd-workflow/SKILL.md +++ b/.kiro/skills/tdd-workflow/SKILL.md @@ -318,39 +318,39 @@ npm run test:coverage ## Common Testing Mistakes to Avoid -### ❌ WRONG: Testing Implementation Details +### FAIL: WRONG: Testing Implementation Details ```typescript // Don't test internal state expect(component.state.count).toBe(5) ``` -### ✅ CORRECT: Test User-Visible Behavior +### PASS: CORRECT: Test User-Visible Behavior ```typescript // Test what users see expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ WRONG: Brittle Selectors +### FAIL: WRONG: Brittle Selectors ```typescript // Breaks easily await page.click('.css-class-xyz') ``` -### ✅ CORRECT: Semantic Selectors +### PASS: CORRECT: Semantic Selectors ```typescript // Resilient to changes await page.click('button:has-text("Submit")') await page.click('[data-testid="submit-button"]') ``` -### ❌ WRONG: No Test Isolation +### FAIL: WRONG: No Test Isolation ```typescript // Tests depend on each other test('creates user', () => { /* ... */ }) test('updates same user', () => { /* depends on previous test */ }) ``` -### ✅ CORRECT: Independent Tests +### PASS: CORRECT: Independent Tests ```typescript // Each test sets up its own data test('creates user', () => { diff --git a/.opencode/MIGRATION.md b/.opencode/MIGRATION.md index f533a67d..60961dc5 100644 --- a/.opencode/MIGRATION.md +++ b/.opencode/MIGRATION.md @@ -353,13 +353,13 @@ If you need to switch back: | Feature | Claude Code | OpenCode | Status | |---------|-------------|----------|--------| -| Agents | ✅ 12 agents | ✅ 12 agents | **Full parity** | -| Commands | ✅ 23 commands | ✅ 23 commands | **Full parity** | -| Skills | ✅ 16 skills | ✅ 16 skills | **Full parity** | -| Hooks | ✅ 3 phases | ✅ 20+ events | **OpenCode has MORE** | -| Rules | ✅ 8 rules | ✅ 8 rules | **Full parity** | -| MCP Servers | ✅ Full | ✅ Full | **Full parity** | -| Custom Tools | ✅ Via hooks | ✅ Native support | **OpenCode is better** | +| Agents | PASS: 12 agents | PASS: 12 agents | **Full parity** | +| Commands | PASS: 23 commands | PASS: 23 commands | **Full parity** | +| Skills | PASS: 16 skills | PASS: 16 skills | **Full parity** | +| Hooks | PASS: 3 phases | PASS: 20+ events | **OpenCode has MORE** | +| Rules | PASS: 8 rules | PASS: 8 rules | **Full parity** | +| MCP Servers | PASS: Full | PASS: Full | **Full parity** | +| Custom Tools | PASS: Via hooks | PASS: Native support | **OpenCode is better** | ## Feedback diff --git a/.opencode/README.md b/.opencode/README.md index a93cfa98..170a8459 100644 --- a/.opencode/README.md +++ b/.opencode/README.md @@ -1,6 +1,6 @@ # OpenCode ECC Plugin -> ⚠️ This README is specific to OpenCode usage. +> WARNING: This README is specific to OpenCode usage. > If you installed ECC via npm (e.g. `npm install opencode-ecc`), refer to the root README instead. Everything Claude Code (ECC) plugin for OpenCode - agents, commands, hooks, and skills. @@ -11,10 +11,10 @@ Everything Claude Code (ECC) plugin for OpenCode - agents, commands, hooks, and There are two ways to use Everything Claude Code (ECC): -1. **npm package (recommended for most users)** +1. **npm package (recommended for most users)** Install via npm/bun/yarn and use the `ecc-install` CLI to set up rules and agents. -2. **Direct clone / plugin mode** +2. **Direct clone / plugin mode** Clone the repository and run OpenCode directly inside it. Choose the method that matches your workflow below. diff --git a/.opencode/commands/build-fix.md b/.opencode/commands/build-fix.md index ad22c4f4..984cf29c 100644 --- a/.opencode/commands/build-fix.md +++ b/.opencode/commands/build-fix.md @@ -19,20 +19,20 @@ Fix build and TypeScript errors with minimal changes: $ARGUMENTS ## Approach ### DO: -- ✅ Fix type errors with correct types -- ✅ Add missing imports -- ✅ Fix syntax errors -- ✅ Make minimal changes -- ✅ Preserve existing behavior -- ✅ Run `tsc --noEmit` after each change +- PASS: Fix type errors with correct types +- PASS: Add missing imports +- PASS: Fix syntax errors +- PASS: Make minimal changes +- PASS: Preserve existing behavior +- PASS: Run `tsc --noEmit` after each change ### DON'T: -- ❌ Refactor code -- ❌ Add new features -- ❌ Change architecture -- ❌ Use `any` type (unless absolutely necessary) -- ❌ Add `@ts-ignore` comments -- ❌ Change business logic +- FAIL: Refactor code +- FAIL: Add new features +- FAIL: Change architecture +- FAIL: Use `any` type (unless absolutely necessary) +- FAIL: Add `@ts-ignore` comments +- FAIL: Change business logic ## Common Error Fixes diff --git a/.opencode/commands/checkpoint.md b/.opencode/commands/checkpoint.md index d77814f2..5f1959c4 100644 --- a/.opencode/commands/checkpoint.md +++ b/.opencode/commands/checkpoint.md @@ -28,7 +28,7 @@ Create a snapshot of current progress including: - Coverage: XX% **Build** -- Status: ✅ Passing / ❌ Failing +- Status: PASS: Passing / FAIL: Failing - Errors: [if any] **Changes Since Last Checkpoint** diff --git a/.opencode/commands/e2e.md b/.opencode/commands/e2e.md index d902df67..afc67969 100644 --- a/.opencode/commands/e2e.md +++ b/.opencode/commands/e2e.md @@ -90,9 +90,9 @@ test.describe('Feature: [Name]', () => { ``` E2E Test Results ================ -✅ Passed: X -❌ Failed: Y -⏭️ Skipped: Z +PASS: Passed: X +FAIL: Failed: Y +SKIPPED: Skipped: Z Failed Tests: - test-name: Error message diff --git a/.opencode/commands/verify.md b/.opencode/commands/verify.md index 99d4680e..7dce731a 100644 --- a/.opencode/commands/verify.md +++ b/.opencode/commands/verify.md @@ -47,17 +47,17 @@ Execute comprehensive verification: ## Verification Report ### Summary -- Status: ✅ PASS / ❌ FAIL +- Status: PASS: PASS / FAIL: FAIL - Score: X/Y checks passed ### Details | Check | Status | Notes | |-------|--------|-------| -| TypeScript | ✅/❌ | [details] | -| Lint | ✅/❌ | [details] | -| Tests | ✅/❌ | [details] | -| Coverage | ✅/❌ | XX% (target: 80%) | -| Build | ✅/❌ | [details] | +| TypeScript | PASS:/FAIL: | [details] | +| Lint | PASS:/FAIL: | [details] | +| Tests | PASS:/FAIL: | [details] | +| Coverage | PASS:/FAIL: | XX% (target: 80%) | +| Build | PASS:/FAIL: | [details] | ### Action Items [If FAIL, list what needs to be fixed] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bf5db0a1..d8371288 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,7 @@ git add . && git commit -m "feat: add my-skill" && git push -u origin feat/my-co Skills are knowledge modules that Claude Code loads based on context. -> **📚 Comprehensive Guide:** For detailed guidance on creating effective skills, see [Skill Development Guide](docs/SKILL-DEVELOPMENT-GUIDE.md). It covers: +> ** Comprehensive Guide:** For detailed guidance on creating effective skills, see [Skill Development Guide](docs/SKILL-DEVELOPMENT-GUIDE.md). It covers: > - Skill architecture and categories > - Writing effective content with examples > - Best practices and common patterns diff --git a/README.md b/README.md index 5b85de74..a59efc0e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@
-**🌐 Language / 语言 / 語言 / Dil** +**Language / 语言 / 語言 / Dil** [**English**](README.md) | [Português (Brasil)](docs/pt-BR/README.md) | [简体中文](README.zh-CN.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja-JP/README.md) | [한국어](docs/ko-KR/README.md) | [Türkçe](docs/tr/README.md) @@ -151,7 +151,7 @@ See the full changelog in [Releases](https://github.com/affaan-m/everything-clau --- -## 🚀 Quick Start +## Quick Start Get up and running in under 2 minutes: @@ -167,7 +167,7 @@ Get up and running in under 2 minutes: ### Step 2: Install Rules (Required) -> ⚠️ **Important:** Claude Code plugins cannot distribute `rules` automatically. Install them manually: +> WARNING: **Important:** Claude Code plugins cannot distribute `rules` automatically. Install them manually: ```bash # Clone the repo first @@ -220,11 +220,11 @@ For manual install instructions see the README in the `rules/` folder. When copy /plugin list everything-claude-code@everything-claude-code ``` -✨ **That's it!** You now have access to 30 agents, 135 skills, and 60 commands. +**That's it!** You now have access to 30 agents, 135 skills, and 60 commands. ### Multi-model commands require additional setup -> ⚠️ `multi-*` commands are **not** covered by the base plugin/rules install above. +> WARNING: `multi-*` commands are **not** covered by the base plugin/rules install above. > > To use `/multi-plan`, `/multi-execute`, `/multi-backend`, `/multi-frontend`, and `/multi-workflow`, you must also install the `ccg-workflow` runtime. > @@ -238,7 +238,7 @@ For manual install instructions see the README in the `rules/` folder. When copy --- -## 🌐 Cross-Platform Support +## Cross-Platform Support This plugin now fully supports **Windows, macOS, and Linux**, alongside tight integration across major IDEs (Cursor, OpenCode, Antigravity) and CLI harnesses. All hooks and scripts have been rewritten in Node.js for maximum compatibility. @@ -285,7 +285,7 @@ export ECC_DISABLED_HOOKS="pre:bash:tmux-reminder,post:edit:typecheck" --- -## 📦 What's Inside +## What's Inside This repo is a **Claude Code plugin** - install it directly or copy components manually. @@ -487,7 +487,7 @@ everything-claude-code/ --- -## 🛠️ Ecosystem Tools +## Ecosystem Tools ### Skill Creator @@ -552,7 +552,7 @@ Use `/security-scan` in Claude Code to run it, or add to CI with the [GitHub Act [GitHub](https://github.com/affaan-m/agentshield) | [npm](https://www.npmjs.com/package/ecc-agentshield) -### 🧠 Continuous Learning v2 +### Continuous Learning v2 The instinct-based learning system automatically learns your patterns: @@ -567,7 +567,7 @@ See `skills/continuous-learning-v2/` for full documentation. --- -## 📋 Requirements +## Requirements ### Claude Code CLI Version @@ -582,7 +582,7 @@ claude --version ### Important: Hooks Auto-Loading Behavior -> ⚠️ **For Contributors:** Do NOT add a `"hooks"` field to `.claude-plugin/plugin.json`. This is enforced by a regression test. +> WARNING: **For Contributors:** Do NOT add a `"hooks"` field to `.claude-plugin/plugin.json`. This is enforced by a regression test. Claude Code v2.1+ **automatically loads** `hooks/hooks.json` from any installed plugin by convention. Explicitly declaring it in `plugin.json` causes a duplicate detection error: @@ -594,7 +594,7 @@ Duplicate hooks file detected: ./hooks/hooks.json resolves to already-loaded fil --- -## 📥 Installation +## Installation ### Option 1: Install as Plugin (Recommended) @@ -650,7 +650,7 @@ This gives you instant access to all commands, agents, skills, and hooks. --- -### 🔧 Option 2: Manual Installation +### Option 2: Manual Installation If you prefer manual control over what's installed: @@ -679,7 +679,7 @@ cp -r everything-claude-code/skills/search-first ~/.claude/skills/ # Optional: add niche/framework-specific skills only when needed # for s in django-patterns django-tdd laravel-patterns springboot-patterns; do -# cp -r everything-claude-code/skills/$s ~/.claude/skills/ +# cp -r everything-claude-code/skills/$s ~/.claude/skills/ # done ``` @@ -695,7 +695,7 @@ Copy desired MCP servers from `mcp-configs/mcp-servers.json` to your `~/.claude. --- -## 🎯 Key Concepts +## Key Concepts ### Agents @@ -758,7 +758,7 @@ See [`rules/README.md`](rules/README.md) for installation and structure details. --- -## 🗺️ Which Agent Should I Use? +## Which Agent Should I Use? Not sure where to start? Use this quick reference: @@ -804,7 +804,7 @@ Not sure where to start? Use this quick reference: --- -## ❓ FAQ +## FAQ
How do I check which agents/commands are installed? @@ -903,7 +903,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). The short version: --- -## 🧪 Running Tests +## Running Tests The plugin includes a comprehensive test suite: @@ -919,7 +919,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 Contributing +## Contributing **Contributions are welcome and encouraged.** @@ -1089,7 +1089,7 @@ ECC ships three sample role configs: --- -## 🔌 OpenCode Support +## OpenCode Support ECC provides **full OpenCode support** including plugins and hooks. @@ -1109,13 +1109,13 @@ The configuration is automatically detected from `.opencode/opencode.json`. | Feature | Claude Code | OpenCode | Status | |---------|-------------|----------|--------| -| Agents | ✅ 30 agents | ✅ 12 agents | **Claude Code leads** | -| Commands | ✅ 60 commands | ✅ 31 commands | **Claude Code leads** | -| Skills | ✅ 135 skills | ✅ 37 skills | **Claude Code leads** | -| Hooks | ✅ 8 event types | ✅ 11 events | **OpenCode has more!** | -| Rules | ✅ 29 rules | ✅ 13 instructions | **Claude Code leads** | -| MCP Servers | ✅ 14 servers | ✅ Full | **Full parity** | -| Custom Tools | ✅ Via hooks | ✅ 6 native tools | **OpenCode is better** | +| Agents | PASS: 30 agents | PASS: 12 agents | **Claude Code leads** | +| Commands | PASS: 60 commands | PASS: 31 commands | **Claude Code leads** | +| Skills | PASS: 135 skills | PASS: 37 skills | **Claude Code leads** | +| Hooks | PASS: 8 event types | PASS: 11 events | **OpenCode has more!** | +| Rules | PASS: 29 rules | PASS: 13 instructions | **Claude Code leads** | +| MCP Servers | PASS: 14 servers | PASS: Full | **Full parity** | +| Custom Tools | PASS: Via hooks | PASS: 6 native tools | **OpenCode is better** | ### Hook Support via Plugins @@ -1240,7 +1240,7 @@ ECC is the **first plugin to maximize every major AI coding tool**. Here's how e --- -## 📖 Background +## Background I've been using Claude Code since the experimental rollout. Won the Anthropic x Forum Ventures hackathon in Sep 2025 with [@DRodriguezFX](https://x.com/DRodriguezFX) — built [zenith.chat](https://zenith.chat) entirely using Claude Code. @@ -1314,7 +1314,7 @@ Agent Teams spawns multiple context windows. Each teammate consumes tokens indep --- -## ⚠️ Important Notes +## WARNING: Important Notes ### Token Optimization @@ -1346,7 +1346,7 @@ These configs work for my workflow. You should: --- -## 💜 Sponsors +## Sponsors This project is free and open source. Sponsors help keep it maintained and growing. @@ -1354,13 +1354,13 @@ This project is free and open source. Sponsors help keep it maintained and growi --- -## 🌟 Star History +## Star History [![Star History Chart](https://api.star-history.com/svg?repos=affaan-m/everything-claude-code&type=Date)](https://star-history.com/#affaan-m/everything-claude-code&Date) --- -## 🔗 Links +## Links - **Shorthand Guide (Start Here):** [The Shorthand Guide to Everything Claude Code](https://x.com/affaanmustafa/status/2012378465664745795) - **Longform Guide (Advanced):** [The Longform Guide to Everything Claude Code](https://x.com/affaanmustafa/status/2014040193557471352) @@ -1369,7 +1369,7 @@ This project is free and open source. Sponsors help keep it maintained and growi --- -## 📄 License +## License MIT - Use freely, modify as needed, contribute back if you can. diff --git a/README.zh-CN.md b/README.zh-CN.md index 433ae831..4ccf1cda 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -12,7 +12,7 @@
-**🌐 Language / 语言 / 語言** +**Language / 语言 / 語言** [**English**](README.md) | [简体中文](README.zh-CN.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja-JP/README.md) | [한국어](docs/ko-KR/README.md) @@ -60,7 +60,7 @@ --- -## 🚀 快速开始 +## 快速开始 在 2 分钟内快速上手: @@ -76,7 +76,7 @@ ### 第二步:安装规则(必需) -> ⚠️ **重要提示:** Claude Code 插件无法自动分发 `rules`,需要手动安装: +> WARNING: **重要提示:** Claude Code 插件无法自动分发 `rules`,需要手动安装: ```bash # 首先克隆仓库 @@ -106,11 +106,11 @@ cp -r everything-claude-code/rules/perl ~/.claude/rules/ /plugin list everything-claude-code@everything-claude-code ``` -✨ **完成!** 你现在可以使用 13 个代理、43 个技能和 31 个命令。 +**完成!** 你现在可以使用 13 个代理、43 个技能和 31 个命令。 ### multi-* 命令需要额外配置 -> ⚠️ 上面的基础插件 / rules 安装**不包含** `multi-*` 命令所需的运行时。 +> WARNING: 上面的基础插件 / rules 安装**不包含** `multi-*` 命令所需的运行时。 > > 如果要使用 `/multi-plan`、`/multi-execute`、`/multi-backend`、`/multi-frontend` 和 `/multi-workflow`,还需要额外安装 `ccg-workflow` 运行时。 > @@ -124,7 +124,7 @@ cp -r everything-claude-code/rules/perl ~/.claude/rules/ --- -## 🌐 跨平台支持 +## 跨平台支持 此插件现在完全支持 **Windows、macOS 和 Linux**。所有钩子和脚本都已用 Node.js 重写,以实现最大的兼容性。 @@ -159,7 +159,7 @@ node scripts/setup-package-manager.js --detect --- -## 📦 里面有什么 +## 里面有什么 这个仓库是一个 **Claude Code 插件** - 直接安装或手动复制组件。 @@ -276,7 +276,7 @@ everything-claude-code/ --- -## 🛠️ 生态系统工具 +## 生态系统工具 ### 技能创建器 @@ -311,7 +311,7 @@ everything-claude-code/ - **直觉集合** - 用于 continuous-learning-v2 - **模式提取** - 从你的提交历史中学习 -### 🧠 持续学习 v2 +### 持续学习 v2 基于直觉的学习系统自动学习你的模式: @@ -328,7 +328,7 @@ everything-claude-code/ --- -## 📥 安装 +## 安装 ### 选项 1:作为插件安装(推荐) @@ -387,7 +387,7 @@ everything-claude-code/ --- -### 🔧 选项 2:手动安装 +### 选项 2:手动安装 如果你希望对安装的内容进行手动控制: @@ -425,7 +425,7 @@ cp -r everything-claude-code/skills/* ~/.claude/skills/ --- -## 🎯 关键概念 +## 关键概念 ### 代理 @@ -485,7 +485,7 @@ model: opus --- -## 🧪 运行测试 +## 运行测试 插件包含一个全面的测试套件: @@ -501,7 +501,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 贡献 +## 贡献 **欢迎并鼓励贡献。** @@ -523,7 +523,7 @@ node tests/hooks/hooks.test.js --- -## 📖 背景 +## 背景 自实验性推出以来,我一直在使用 Claude Code。2025 年 9 月,与 [@DRodriguezFX](https://x.com/DRodriguezFX) 一起使用 Claude Code 构建 [zenith.chat](https://zenith.chat),赢得了 Anthropic x Forum Ventures 黑客马拉松。 @@ -531,7 +531,7 @@ node tests/hooks/hooks.test.js --- -## ⚠️ 重要说明 +## WARNING: 重要说明 ### 上下文窗口管理 @@ -554,13 +554,13 @@ node tests/hooks/hooks.test.js --- -## 🌟 Star 历史 +## Star 历史 [![Star History Chart](https://api.star-history.com/svg?repos=affaan-m/everything-claude-code&type=Date)](https://star-history.com/#affaan-m/everything-claude-code&Date) --- -## 🔗 链接 +## 链接 - **精简指南(从这里开始):** [The Shorthand Guide to Everything Claude Code](https://x.com/affaanmustafa/status/2012378465664745795) - **详细指南(高级):** [The Longform Guide to Everything Claude Code](https://x.com/affaanmustafa/status/2014040193557471352) @@ -570,7 +570,7 @@ node tests/hooks/hooks.test.js --- -## 📄 许可证 +## 许可证 MIT - 自由使用,根据需要修改,如果可以请回馈。 diff --git a/agents/performance-optimizer.md b/agents/performance-optimizer.md index 914c69a9..48623d42 100644 --- a/agents/performance-optimizer.md +++ b/agents/performance-optimizer.md @@ -228,7 +228,7 @@ const results = await batchFetch(['user1', 'user2', 'user3']); const fetchWithCache = async (url: string, ttl = 300000) => { const cached = cache.get(url); if (cached) return cached; - + const data = await fetch(url).then(r => r.json()); cache.set(url, data, ttl); return data; @@ -376,16 +376,16 @@ getTTFB(console.log); // Time to First Byte ## Bundle Analysis | Metric | Current | Target | Status | |--------|---------|--------|--------| -| Total Size (gzip) | XXX KB | < 200 KB | ⚠️ | -| Main Bundle | XXX KB | < 100 KB | ✅ | -| Vendor Bundle | XXX KB | < 150 KB | ⚠️ | +| Total Size (gzip) | XXX KB | < 200 KB | WARNING: | +| Main Bundle | XXX KB | < 100 KB | PASS: | +| Vendor Bundle | XXX KB | < 150 KB | WARNING: | ## Web Vitals | Metric | Current | Target | Status | |--------|---------|--------|--------| -| LCP | X.Xs | < 2.5s | ✅ | -| FID | XXms | < 100ms | ✅ | -| CLS | X.XX | < 0.1 | ⚠️ | +| LCP | X.Xs | < 2.5s | PASS: | +| FID | XXms | < 100ms | PASS: | +| CLS | X.XX | < 0.1 | WARNING: | ## Critical Issues diff --git a/commands/aside.md b/commands/aside.md index be0f6aba..9fa0881d 100644 --- a/commands/aside.md +++ b/commands/aside.md @@ -78,7 +78,7 @@ Flag it clearly before resuming: ``` ASIDE: [answer] -⚠️ Note: This answer suggests [issue] with the current approach. Want to address this before continuing, or proceed as planned? +WARNING: Note: This answer suggests [issue] with the current approach. Want to address this before continuing, or proceed as planned? ``` Wait for the user's decision before resuming. @@ -119,7 +119,7 @@ Note the change needed but do not make it during the aside: ``` ASIDE: [answer] -📝 Worth fixing: [what should be changed]. I'll flag this after the current task unless you want to address it now. + Worth fixing: [what should be changed]. I'll flag this after the current task unless you want to address it now. ``` **Question is ambiguous or too vague:** @@ -150,7 +150,7 @@ No — the shared cache object in src/cache/store.ts:34 is mutated without locki Under concurrent requests this is a race condition. It's low risk in a single-process Node.js server but would be a real problem with worker threads or clustering. -⚠️ Note: This could affect the feature we're building. Want to address this now or continue and fix it in a follow-up? +WARNING: Note: This could affect the feature we're building. Want to address this now or continue and fix it in a follow-up? ``` --- diff --git a/commands/code-review.md b/commands/code-review.md index 4e5ef012..6df0792f 100644 --- a/commands/code-review.md +++ b/commands/code-review.md @@ -9,7 +9,7 @@ Comprehensive security and quality review of uncommitted changes: **Security Issues (CRITICAL):** - Hardcoded credentials, API keys, tokens - SQL injection vulnerabilities -- XSS vulnerabilities +- XSS vulnerabilities - Missing input validation - Insecure dependencies - Path traversal risks diff --git a/commands/cpp-build.md b/commands/cpp-build.md index dfb23103..a5a35f92 100644 --- a/commands/cpp-build.md +++ b/commands/cpp-build.md @@ -129,7 +129,7 @@ All tests passed. | Files modified | 2 | | Remaining issues | 0 | -Build Status: ✅ SUCCESS +Build Status: PASS: SUCCESS ``` ## Common Errors Fixed diff --git a/commands/cpp-review.md b/commands/cpp-review.md index a510c1db..2809095d 100644 --- a/commands/cpp-review.md +++ b/commands/cpp-review.md @@ -108,16 +108,16 @@ void processUser(const User& user) { - HIGH: 1 - MEDIUM: 0 -Recommendation: ❌ Block merge until CRITICAL issue is fixed +Recommendation: FAIL: Block merge until CRITICAL issue is fixed ``` ## Approval Criteria | Status | Condition | |--------|-----------| -| ✅ Approve | No CRITICAL or HIGH issues | -| ⚠️ Warning | Only MEDIUM issues (merge with caution) | -| ❌ Block | CRITICAL or HIGH issues found | +| PASS: Approve | No CRITICAL or HIGH issues | +| WARNING: Warning | Only MEDIUM issues (merge with caution) | +| FAIL: Block | CRITICAL or HIGH issues found | ## Integration with Other Commands diff --git a/commands/e2e.md b/commands/e2e.md index 8caf086d..b83b1644 100644 --- a/commands/e2e.md +++ b/commands/e2e.md @@ -182,7 +182,7 @@ Artifacts generated: ╔══════════════════════════════════════════════════════════════╗ ║ E2E Test Results ║ ╠══════════════════════════════════════════════════════════════╣ -║ Status: ✅ ALL TESTS PASSED ║ +║ Status: PASS: ALL TESTS PASSED ║ ║ Total: 3 tests ║ ║ Passed: 3 (100%) ║ ║ Failed: 0 ║ @@ -191,15 +191,15 @@ Artifacts generated: ╚══════════════════════════════════════════════════════════════╝ Artifacts: -📸 Screenshots: 2 files -📹 Videos: 0 files (only on failure) -🔍 Traces: 0 files (only on failure) -📊 HTML Report: playwright-report/index.html + Screenshots: 2 files + Videos: 0 files (only on failure) + Traces: 0 files (only on failure) + HTML Report: playwright-report/index.html View report: npx playwright show-report ``` -✅ E2E test suite ready for CI/CD integration! +PASS: E2E test suite ready for CI/CD integration! ``` ## Test Artifacts @@ -235,7 +235,7 @@ open artifacts/search-results.png If a test fails intermittently: ``` -⚠️ FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts +WARNING: FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts Test passed 7/10 runs (70% pass rate) @@ -254,10 +254,10 @@ Quarantine recommendation: Mark as test.fixme() until fixed ## Browser Configuration Tests run on multiple browsers by default: -- ✅ Chromium (Desktop Chrome) -- ✅ Firefox (Desktop) -- ✅ WebKit (Desktop Safari) -- ✅ Mobile Chrome (optional) +- PASS: Chromium (Desktop Chrome) +- PASS: Firefox (Desktop) +- PASS: WebKit (Desktop Safari) +- PASS: Mobile Chrome (optional) Configure in `playwright.config.ts` to adjust browsers. @@ -285,7 +285,7 @@ Add to your CI pipeline: For PMX, prioritize these E2E tests: -**🔴 CRITICAL (Must Always Pass):** +**CRITICAL (Must Always Pass):** 1. User can connect wallet 2. User can browse markets 3. User can search markets (semantic search) @@ -294,7 +294,7 @@ For PMX, prioritize these E2E tests: 6. Market resolves correctly 7. User can withdraw funds -**🟡 IMPORTANT:** +**IMPORTANT:** 1. Market creation flow 2. User profile updates 3. Real-time price updates @@ -305,20 +305,20 @@ For PMX, prioritize these E2E tests: ## Best Practices **DO:** -- ✅ Use Page Object Model for maintainability -- ✅ Use data-testid attributes for selectors -- ✅ Wait for API responses, not arbitrary timeouts -- ✅ Test critical user journeys end-to-end -- ✅ Run tests before merging to main -- ✅ Review artifacts when tests fail +- PASS: Use Page Object Model for maintainability +- PASS: Use data-testid attributes for selectors +- PASS: Wait for API responses, not arbitrary timeouts +- PASS: Test critical user journeys end-to-end +- PASS: Run tests before merging to main +- PASS: Review artifacts when tests fail **DON'T:** -- ❌ Use brittle selectors (CSS classes can change) -- ❌ Test implementation details -- ❌ Run tests against production -- ❌ Ignore flaky tests -- ❌ Skip artifact review on failures -- ❌ Test every edge case with E2E (use unit tests) +- FAIL: Use brittle selectors (CSS classes can change) +- FAIL: Test implementation details +- FAIL: Run tests against production +- FAIL: Ignore flaky tests +- FAIL: Skip artifact review on failures +- FAIL: Test every edge case with E2E (use unit tests) ## Important Notes diff --git a/commands/go-build.md b/commands/go-build.md index bf32689e..63fc61b0 100644 --- a/commands/go-build.md +++ b/commands/go-build.md @@ -140,7 +140,7 @@ ok project/internal/handler 0.023s | Files modified | 2 | | Remaining issues | 0 | -Build Status: ✅ SUCCESS +Build Status: PASS: SUCCESS ``` ## Common Errors Fixed diff --git a/commands/go-review.md b/commands/go-review.md index 9aedaf1c..4dde854a 100644 --- a/commands/go-review.md +++ b/commands/go-review.md @@ -124,16 +124,16 @@ return fmt.Errorf("get user %s: %w", userID, err) - HIGH: 1 - MEDIUM: 0 -Recommendation: ❌ Block merge until CRITICAL issue is fixed +Recommendation: FAIL: Block merge until CRITICAL issue is fixed ``` ## Approval Criteria | Status | Condition | |--------|-----------| -| ✅ Approve | No CRITICAL or HIGH issues | -| ⚠️ Warning | Only MEDIUM issues (merge with caution) | -| ❌ Block | CRITICAL or HIGH issues found | +| PASS: Approve | No CRITICAL or HIGH issues | +| WARNING: Warning | Only MEDIUM issues (merge with caution) | +| FAIL: Block | CRITICAL or HIGH issues found | ## Integration with Other Commands diff --git a/commands/instinct-import.md b/commands/instinct-import.md index f56f7fb8..e1a5684f 100644 --- a/commands/instinct-import.md +++ b/commands/instinct-import.md @@ -44,7 +44,7 @@ Import instincts from local file paths or HTTP(S) URLs. ## Import Process ``` -📥 Importing instincts from: team-instincts.yaml + Importing instincts from: team-instincts.yaml ================================================ Found 12 instincts to import. @@ -60,12 +60,12 @@ These will be added: ## Duplicate Instincts (3) Already have similar instincts: - ⚠️ prefer-functional-style + WARNING: prefer-functional-style Local: 0.8 confidence, 12 observations Import: 0.7 confidence → Keep local (higher confidence) - ⚠️ test-first-workflow + WARNING: test-first-workflow Local: 0.75 confidence Import: 0.9 confidence → Update to import (higher confidence) @@ -102,7 +102,7 @@ project_name: "my-project" After import: ``` -✅ Import complete! +PASS: Import complete! Added: 8 instincts Updated: 1 instinct diff --git a/commands/kotlin-build.md b/commands/kotlin-build.md index 70709c8d..c69ce64f 100644 --- a/commands/kotlin-build.md +++ b/commands/kotlin-build.md @@ -131,7 +131,7 @@ $ ./gradlew test | Files modified | 2 | | Remaining issues | 0 | -Build Status: ✅ SUCCESS +Build Status: PASS: SUCCESS ```` ## Common Errors Fixed diff --git a/commands/kotlin-review.md b/commands/kotlin-review.md index b8798bb0..a97b3117 100644 --- a/commands/kotlin-review.md +++ b/commands/kotlin-review.md @@ -80,7 +80,7 @@ Agent: ## Static Analysis Results ✓ Build: Successful ✓ detekt: No issues -⚠ ktlint: 2 formatting warnings +WARNING: ktlint: 2 formatting warnings ## Issues Found @@ -116,16 +116,16 @@ launch { - HIGH: 1 - MEDIUM: 0 -Recommendation: ❌ Block merge until CRITICAL issue is fixed +Recommendation: FAIL: Block merge until CRITICAL issue is fixed ```` ## Approval Criteria | Status | Condition | |--------|-----------| -| ✅ Approve | No CRITICAL or HIGH issues | -| ⚠️ Warning | Only MEDIUM issues (merge with caution) | -| ❌ Block | CRITICAL or HIGH issues found | +| PASS: Approve | No CRITICAL or HIGH issues | +| WARNING: Warning | Only MEDIUM issues (merge with caution) | +| FAIL: Block | CRITICAL or HIGH issues found | ## Integration with Other Commands diff --git a/commands/learn-eval.md b/commands/learn-eval.md index b98fcf4f..c6788559 100644 --- a/commands/learn-eval.md +++ b/commands/learn-eval.md @@ -73,7 +73,7 @@ origin: auto-extracted | **Absorb into [X]** | Should be appended to an existing skill | Show target skill and additions → Step 6 | | **Drop** | Trivial, redundant, or too abstract | Explain reasoning and stop | - **Guideline dimensions** (informing the verdict, not scored): +**Guideline dimensions** (informing the verdict, not scored): - **Specificity & Actionability**: Contains code examples or commands that are immediately usable - **Scope Fit**: Name, trigger conditions, and content are aligned and focused on a single pattern diff --git a/commands/multi-plan.md b/commands/multi-plan.md index cd685053..4d7941a4 100644 --- a/commands/multi-plan.md +++ b/commands/multi-plan.md @@ -204,9 +204,9 @@ Synthesize both analyses, generate **Step-by-step Implementation Plan**: 3. Output prompt in **bold text** (MUST use actual saved file path): --- - **Plan generated and saved to `.claude/plan/actual-feature-name.md`** +**Plan generated and saved to `.claude/plan/actual-feature-name.md`** - **Please review the plan above. You can:** +**Please review the plan above. You can:** - **Modify plan**: Tell me what needs adjustment, I'll update the plan - **Execute plan**: Copy the following command to a new session @@ -215,7 +215,7 @@ Synthesize both analyses, generate **Step-by-step Implementation Plan**: ``` --- - **NOTE**: The `actual-feature-name.md` above MUST be replaced with the actual saved filename! +**NOTE**: The `actual-feature-name.md` above MUST be replaced with the actual saved filename! 4. **Immediately terminate current response** (Stop here. No more tool calls.) diff --git a/commands/python-review.md b/commands/python-review.md index 1d729781..eed620ea 100644 --- a/commands/python-review.md +++ b/commands/python-review.md @@ -89,7 +89,7 @@ Agent: ## Static Analysis Results ✓ ruff: No issues ✓ mypy: No errors -⚠️ black: 2 files need reformatting +WARNING: black: 2 files need reformatting ✓ bandit: No security issues ## Issues Found @@ -155,7 +155,7 @@ with open("config.json") as f: # Good - HIGH: 1 - MEDIUM: 2 -Recommendation: ❌ Block merge until CRITICAL issue is fixed +Recommendation: FAIL: Block merge until CRITICAL issue is fixed ## Formatting Required Run: `black app/routes/user.py app/services/auth.py` @@ -165,9 +165,9 @@ Run: `black app/routes/user.py app/services/auth.py` | Status | Condition | |--------|-----------| -| ✅ Approve | No CRITICAL or HIGH issues | -| ⚠️ Warning | Only MEDIUM issues (merge with caution) | -| ❌ Block | CRITICAL or HIGH issues found | +| PASS: Approve | No CRITICAL or HIGH issues | +| WARNING: Warning | Only MEDIUM issues (merge with caution) | +| FAIL: Block | CRITICAL or HIGH issues found | ## Integration with Other Commands diff --git a/commands/refactor-clean.md b/commands/refactor-clean.md index f2890dac..d336669f 100644 --- a/commands/refactor-clean.md +++ b/commands/refactor-clean.md @@ -69,7 +69,7 @@ Deleted: 12 unused functions Skipped: 2 items (tests failed) Saved: ~450 lines removed ────────────────────────────── -All tests passing ✅ +All tests passing PASS: ``` ## Rules diff --git a/commands/resume-session.md b/commands/resume-session.md index 40e581f0..c9bf3b72 100644 --- a/commands/resume-session.md +++ b/commands/resume-session.md @@ -65,9 +65,9 @@ WHAT WE'RE BUILDING: [2-3 sentence summary in your own words] CURRENT STATE: -✅ Working: [count] items confirmed -🔄 In Progress: [list files that are in progress] -🗒️ Not Started: [list planned but untouched] +PASS: Working: [count] items confirmed + In Progress: [list files that are in progress] + Not Started: [list planned but untouched] WHAT NOT TO RETRY: [list every failed approach with its reason — this is critical] @@ -99,10 +99,10 @@ If no next step is defined — ask the user where to start, and optionally sugge Load the most recently modified matching file for that date, regardless of whether it uses the legacy no-id format or the current short-id format. **Session file references files that no longer exist:** -Note this during the briefing — "⚠️ `path/to/file.ts` referenced in session but not found on disk." +Note this during the briefing — "WARNING: `path/to/file.ts` referenced in session but not found on disk." **Session file is from more than 7 days ago:** -Note the gap — "⚠️ This session is from N days ago (threshold: 7 days). Things may have changed." — then proceed normally. +Note the gap — "WARNING: This session is from N days ago (threshold: 7 days). Things may have changed." — then proceed normally. **User provides a file path directly (e.g., forwarded from a teammate):** Read it and follow the same briefing process — the format is the same regardless of source. @@ -126,13 +126,13 @@ Register and login endpoints are partially done. Route protection via middleware hasn't been started yet. CURRENT STATE: -✅ Working: 3 items (register endpoint, JWT generation, password hashing) -🔄 In Progress: app/api/auth/login/route.ts (token works, cookie not set yet) -🗒️ Not Started: middleware.ts, app/login/page.tsx +PASS: Working: 3 items (register endpoint, JWT generation, password hashing) + In Progress: app/api/auth/login/route.ts (token works, cookie not set yet) + Not Started: middleware.ts, app/login/page.tsx WHAT NOT TO RETRY: -❌ Next-Auth — conflicts with custom Prisma adapter, threw adapter error on every request -❌ localStorage for JWT — causes SSR hydration mismatch, incompatible with Next.js +FAIL: Next-Auth — conflicts with custom Prisma adapter, threw adapter error on every request +FAIL: localStorage for JWT — causes SSR hydration mismatch, incompatible with Next.js OPEN QUESTIONS / BLOCKERS: - Does cookies().set() work inside a Route Handler or only Server Actions? diff --git a/commands/save-session.md b/commands/save-session.md index 3ac78936..122598a9 100644 --- a/commands/save-session.md +++ b/commands/save-session.md @@ -130,10 +130,10 @@ If nothing is queued: "No specific untried approaches identified." | File | Status | Notes | | ----------------- | -------------- | -------------------------- | -| `path/to/file.ts` | ✅ Complete | [what it does] | -| `path/to/file.ts` | 🔄 In Progress | [what's done, what's left] | -| `path/to/file.ts` | ❌ Broken | [what's wrong] | -| `path/to/file.ts` | 🗒️ Not Started | [planned but not touched] | +| `path/to/file.ts` | PASS: Complete | [what it does] | +| `path/to/file.ts` | In Progress | [what's done, what's left] | +| `path/to/file.ts` | FAIL: Broken | [what's wrong] | +| `path/to/file.ts` | Not Started | [planned but not touched] | If no files were touched: "No files modified this session." @@ -235,11 +235,11 @@ refreshes without exposing the token to JavaScript. | File | Status | Notes | | -------------------------------- | -------------- | ----------------------------------------------- | -| `app/api/auth/register/route.ts` | ✅ Complete | Works, tested | -| `app/api/auth/login/route.ts` | 🔄 In Progress | Token generates but not setting cookie yet | -| `lib/auth.ts` | ✅ Complete | JWT helpers, all tested | -| `middleware.ts` | 🗒️ Not Started | Route protection, needs cookie read logic first | -| `app/login/page.tsx` | 🗒️ Not Started | UI not started | +| `app/api/auth/register/route.ts` | PASS: Complete | Works, tested | +| `app/api/auth/login/route.ts` | In Progress | Token generates but not setting cookie yet | +| `lib/auth.ts` | PASS: Complete | JWT helpers, all tested | +| `middleware.ts` | Not Started | Route protection, needs cookie read logic first | +| `app/login/page.tsx` | Not Started | UI not started | --- diff --git a/commands/tdd.md b/commands/tdd.md index f98cb58b..4f73be34 100644 --- a/commands/tdd.md +++ b/commands/tdd.md @@ -133,7 +133,7 @@ FAIL lib/liquidity.test.ts 1 test failed, 0 passed ``` -✅ Tests fail as expected. Ready to implement. +PASS: Tests fail as expected. Ready to implement. ## Step 4: Implement Minimal Code (GREEN) @@ -179,7 +179,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ All tests passing! +PASS: All tests passing! ## Step 6: Refactor (IMPROVE) @@ -236,7 +236,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ Refactoring complete, tests still passing! +PASS: Refactoring complete, tests still passing! ## Step 8: Check Coverage @@ -247,29 +247,29 @@ File | % Stmts | % Branch | % Funcs | % Lines ---------------|---------|----------|---------|-------- liquidity.ts | 100 | 100 | 100 | 100 -Coverage: 100% ✅ (Target: 80%) +Coverage: 100% PASS: (Target: 80%) ``` -✅ TDD session complete! +PASS: TDD session complete! ``` ## TDD Best Practices **DO:** -- ✅ Write the test FIRST, before any implementation -- ✅ Run tests and verify they FAIL before implementing -- ✅ Write minimal code to make tests pass -- ✅ Refactor only after tests are green -- ✅ Add edge cases and error scenarios -- ✅ Aim for 80%+ coverage (100% for critical code) +- PASS: Write the test FIRST, before any implementation +- PASS: Run tests and verify they FAIL before implementing +- PASS: Write minimal code to make tests pass +- PASS: Refactor only after tests are green +- PASS: Add edge cases and error scenarios +- PASS: Aim for 80%+ coverage (100% for critical code) **DON'T:** -- ❌ Write implementation before tests -- ❌ Skip running tests after each change -- ❌ Write too much code at once -- ❌ Ignore failing tests -- ❌ Test implementation details (test behavior) -- ❌ Mock everything (prefer integration tests) +- FAIL: Write implementation before tests +- FAIL: Skip running tests after each change +- FAIL: Write too much code at once +- FAIL: Ignore failing tests +- FAIL: Test implementation details (test behavior) +- FAIL: Mock everything (prefer integration tests) ## Test Types to Include diff --git a/commands/test-coverage.md b/commands/test-coverage.md index 2eb4118d..41338160 100644 --- a/commands/test-coverage.md +++ b/commands/test-coverage.md @@ -57,7 +57,7 @@ File Before After src/services/auth.ts 45% 88% src/utils/validation.ts 32% 82% ────────────────────────────── -Overall: 67% 84% ✅ +Overall: 67% 84% PASS: ``` ## Focus Areas diff --git a/docs/SKILL-DEVELOPMENT-GUIDE.md b/docs/SKILL-DEVELOPMENT-GUIDE.md index cbf5e3c8..5a7c7a06 100644 --- a/docs/SKILL-DEVELOPMENT-GUIDE.md +++ b/docs/SKILL-DEVELOPMENT-GUIDE.md @@ -122,7 +122,7 @@ Link to complementary skills. Good skills are **focused and actionable**: -| ✅ Good Focus | ❌ Too Broad | +| PASS: Good Focus | FAIL: Too Broad | |---------------|--------------| | `react-hook-patterns` | `react` | | `postgresql-indexing` | `databases` | @@ -186,11 +186,11 @@ Another pattern with code. Write content that Claude can **immediately use**: -- ✅ Copy-pasteable code examples -- ✅ Clear decision trees -- ✅ Checklists for verification -- ❌ Vague explanations without examples -- ❌ Long prose without actionable guidance +- PASS: Copy-pasteable code examples +- PASS: Clear decision trees +- PASS: Checklists for verification +- FAIL: Vague explanations without examples +- FAIL: Long prose without actionable guidance --- @@ -334,11 +334,11 @@ Good: async function fetchData(url: string) { try { const response = await fetch(url) - + if (!response.ok) { throw new Error(\`HTTP \${response.status}: \${response.statusText}\`) } - + return await response.json() } catch (error) { console.error('Fetch failed:', error) @@ -361,7 +361,7 @@ Show what NOT to do: ```markdown ## Anti-Patterns -### ❌ Direct State Mutation +### FAIL: Direct State Mutation \`\`\`typescript // NEVER do this @@ -369,7 +369,7 @@ user.name = 'New Name' items.push(newItem) \`\`\` -### ✅ Immutable Updates +### PASS: Immutable Updates \`\`\`typescript // ALWAYS do this @@ -583,7 +583,7 @@ description: Quick reference for [API/Library]. 2. **Test with Claude Code**: ``` You: "I need to [task that should trigger your skill]" - + Claude should reference your skill's patterns. ``` @@ -729,12 +729,12 @@ origin: ECC ### Borrowing Rules \`\`\`rust -// ✅ CORRECT: Borrow when you don't need ownership +// PASS: CORRECT: Borrow when you don't need ownership fn process_data(data: &str) -> usize { data.len() } -// ✅ CORRECT: Take ownership when you need to modify or consume +// PASS: CORRECT: Take ownership when you need to modify or consume fn consume_data(data: Vec) -> String { String::from_utf8(data).unwrap() } @@ -751,7 +751,7 @@ use thiserror::Error; pub enum AppError { #[error("IO error: {0}")] Io(#[from] std::io::Error), - + #[error("Parse error: {0}")] Parse(#[from] std::num::ParseIntError), } diff --git a/docs/business/metrics-and-sponsorship.md b/docs/business/metrics-and-sponsorship.md index 9d884e75..133e254c 100644 --- a/docs/business/metrics-and-sponsorship.md +++ b/docs/business/metrics-and-sponsorship.md @@ -66,9 +66,9 @@ Use these as starting points in negotiation: Use this on calls: -> ECC is now positioned as an agent harness performance system, not a config repo. -> We track adoption through npm distribution, GitHub App installs, and repository growth. -> Claude plugin installs are structurally undercounted publicly, so we use a blended metrics model. +> ECC is now positioned as an agent harness performance system, not a config repo. +> We track adoption through npm distribution, GitHub App installs, and repository growth. +> Claude plugin installs are structurally undercounted publicly, so we use a blended metrics model. > The project supports Claude Code, Cursor, OpenCode, and Codex app/CLI with production-grade hook reliability and a large passing test suite. For launch-ready social copy snippets, see [`social-launch-copy.md`](./social-launch-copy.md). diff --git a/docs/ja-JP/README.md b/docs/ja-JP/README.md index 850e7ba4..86a802f0 100644 --- a/docs/ja-JP/README.md +++ b/docs/ja-JP/README.md @@ -19,7 +19,7 @@
-**🌐 言語 / Language / 語言** +**言語 / Language / 語言** [**English**](README.md) | [简体中文](README.zh-CN.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja-JP/README.md) @@ -99,7 +99,7 @@ --- -## 🚀 クイックスタート +## クイックスタート 2分以内に起動できます: @@ -115,7 +115,7 @@ ### ステップ2:ルールをインストール(必須) -> ⚠️ **重要:** Claude Codeプラグインは`rules`を自動配布できません。手動でインストールしてください: +> WARNING: **重要:** Claude Codeプラグインは`rules`を自動配布できません。手動でインストールしてください: ```bash # まずリポジトリをクローン @@ -143,11 +143,11 @@ cp -r everything-claude-code/rules/golang/* ~/.claude/rules/ /plugin list everything-claude-code@everything-claude-code ``` -✨ **完了です!** これで13のエージェント、43のスキル、31のコマンドにアクセスできます。 +**完了です!** これで13のエージェント、43のスキル、31のコマンドにアクセスできます。 --- -## 🌐 クロスプラットフォーム対応 +## クロスプラットフォーム対応 このプラグインは **Windows、macOS、Linux** を完全にサポートしています。すべてのフックとスクリプトが Node.js で書き直され、最大の互換性を実現しています。 @@ -182,7 +182,7 @@ node scripts/setup-package-manager.js --detect --- -## 📦 含まれるもの +## 含まれるもの このリポジトリは**Claude Codeプラグイン**です - 直接インストールするか、コンポーネントを手動でコピーできます。 @@ -315,7 +315,7 @@ everything-claude-code/ --- -## 🛠️ エコシステムツール +## エコシステムツール ### スキル作成ツール @@ -374,7 +374,7 @@ Claude Codeで`/security-scan`を実行、または[GitHub Action](https://githu [GitHub](https://github.com/affaan-m/agentshield) | [npm](https://www.npmjs.com/package/ecc-agentshield) -### 🧠 継続的学習 v2 +### 継続的学習 v2 instinctベースの学習システムがパターンを自動学習: @@ -389,7 +389,7 @@ instinctベースの学習システムがパターンを自動学習: --- -## 📋 要件 +## 要件 ### Claude Code CLI バージョン @@ -404,7 +404,7 @@ claude --version ### 重要: フック自動読み込み動作 -> ⚠️ **貢献者向け:** `.claude-plugin/plugin.json`に`"hooks"`フィールドを追加しないでください。これは回帰テストで強制されます。 +> WARNING: **貢献者向け:** `.claude-plugin/plugin.json`に`"hooks"`フィールドを追加しないでください。これは回帰テストで強制されます。 Claude Code v2.1+は、インストール済みプラグインの`hooks/hooks.json`(規約)を自動読み込みします。`plugin.json`で明示的に宣言するとエラーが発生します: @@ -416,7 +416,7 @@ Duplicate hook file detected: ./hooks/hooks.json is already resolved to a loaded --- -## 📥 インストール +## インストール ### オプション1:プラグインとしてインストール(推奨) @@ -471,7 +471,7 @@ Duplicate hook file detected: ./hooks/hooks.json is already resolved to a loaded --- -### 🔧 オプション2:手動インストール +### オプション2:手動インストール インストール内容を手動で制御したい場合: @@ -507,7 +507,7 @@ cp -r everything-claude-code/skills/* ~/.claude/skills/ --- -## 🎯 主要概念 +## 主要概念 ### エージェント @@ -569,7 +569,7 @@ rules/ --- -## 🧪 テストを実行 +## テストを実行 プラグインには包括的なテストスイートが含まれています: @@ -585,7 +585,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 貢献 +## 貢献 **貢献は大歓迎で、奨励されています。** @@ -637,7 +637,7 @@ npm install ecc-universal --- -## 🔌 OpenCodeサポート +## OpenCodeサポート ECCは**フルOpenCodeサポート**をプラグインとフック含めて提供。 @@ -657,13 +657,13 @@ opencode | 機能 | Claude Code | OpenCode | ステータス | |---------|-------------|----------|--------| -| Agents | ✅ 14 エージェント | ✅ 12 エージェント | **Claude Code がリード** | -| Commands | ✅ 30 コマンド | ✅ 24 コマンド | **Claude Code がリード** | -| Skills | ✅ 28 スキル | ✅ 16 スキル | **Claude Code がリード** | -| Hooks | ✅ 3 フェーズ | ✅ 20+ イベント | **OpenCode が多い!** | -| Rules | ✅ 8 ルール | ✅ 8 ルール | **完全パリティ** | -| MCP Servers | ✅ 完全 | ✅ 完全 | **完全パリティ** | -| Custom Tools | ✅ フック経由 | ✅ ネイティブサポート | **OpenCode がより良い** | +| Agents | PASS: 14 エージェント | PASS: 12 エージェント | **Claude Code がリード** | +| Commands | PASS: 30 コマンド | PASS: 24 コマンド | **Claude Code がリード** | +| Skills | PASS: 28 スキル | PASS: 16 スキル | **Claude Code がリード** | +| Hooks | PASS: 3 フェーズ | PASS: 20+ イベント | **OpenCode が多い!** | +| Rules | PASS: 8 ルール | PASS: 8 ルール | **完全パリティ** | +| MCP Servers | PASS: 完全 | PASS: 完全 | **完全パリティ** | +| Custom Tools | PASS: フック経由 | PASS: ネイティブサポート | **OpenCode がより良い** | ### プラグイン経由のフックサポート @@ -737,7 +737,7 @@ npm install ecc-universal --- -## 📖 背景 +## 背景 実験的なリリース以来、Claude Codeを使用してきました。2025年9月、[@DRodriguezFX](https://x.com/DRodriguezFX)と一緒にClaude Codeで[zenith.chat](https://zenith.chat)を構築し、Anthropic x Forum Venturesハッカソンで優勝しました。 @@ -745,7 +745,7 @@ npm install ecc-universal --- -## ⚠️ 重要な注記 +## WARNING: 重要な注記 ### コンテキストウィンドウ管理 @@ -768,13 +768,13 @@ npm install ecc-universal --- -## 🌟 Star 履歴 +## Star 履歴 [![Star History Chart](https://api.star-history.com/svg?repos=affaan-m/everything-claude-code&type=Date)](https://star-history.com/#affaan-m/everything-claude-code&Date) --- -## 🔗 リンク +## リンク - **簡潔ガイド(まずはこれ):** [Everything Claude Code 簡潔ガイド](https://x.com/affaanmustafa/status/2012378465664745795) - **詳細ガイド(高度):** [Everything Claude Code 詳細ガイド](https://x.com/affaanmustafa/status/2014040193557471352) @@ -784,7 +784,7 @@ npm install ecc-universal --- -## 📄 ライセンス +## ライセンス MIT - 自由に使用、必要に応じて修正、可能であれば貢献してください。 diff --git a/docs/ja-JP/agents/build-error-resolver.md b/docs/ja-JP/agents/build-error-resolver.md index 7f7cb1ee..6362ac24 100644 --- a/docs/ja-JP/agents/build-error-resolver.md +++ b/docs/ja-JP/agents/build-error-resolver.md @@ -103,12 +103,12 @@ c) 影響度別に優先順位付け **パターン 1: 型推論の失敗** ```typescript -// ❌ エラー: Parameter 'x' implicitly has an 'any' type +// FAIL: エラー: Parameter 'x' implicitly has an 'any' type function add(x, y) { return x + y } -// ✅ 修正: 型アノテーションを追加 +// PASS: 修正: 型アノテーションを追加 function add(x: number, y: number): number { return x + y } @@ -116,25 +116,25 @@ function add(x: number, y: number): number { **パターン 2: Null/Undefinedエラー** ```typescript -// ❌ エラー: Object is possibly 'undefined' +// FAIL: エラー: Object is possibly 'undefined' const name = user.name.toUpperCase() -// ✅ 修正: オプショナルチェーン +// PASS: 修正: オプショナルチェーン const name = user?.name?.toUpperCase() -// ✅ または: Nullチェック +// PASS: または: Nullチェック const name = user && user.name ? user.name.toUpperCase() : '' ``` **パターン 3: プロパティの欠落** ```typescript -// ❌ エラー: Property 'age' does not exist on type 'User' +// FAIL: エラー: Property 'age' does not exist on type 'User' interface User { name: string } const user: User = { name: 'John', age: 30 } -// ✅ 修正: インターフェースにプロパティを追加 +// PASS: 修正: インターフェースにプロパティを追加 interface User { name: string age?: number // 常に存在しない場合はオプショナル @@ -143,10 +143,10 @@ interface User { **パターン 4: インポートエラー** ```typescript -// ❌ エラー: Cannot find module '@/lib/utils' +// FAIL: エラー: Cannot find module '@/lib/utils' import { formatDate } from '@/lib/utils' -// ✅ 修正1: tsconfigのパスが正しいか確認 +// PASS: 修正1: tsconfigのパスが正しいか確認 { "compilerOptions": { "paths": { @@ -155,38 +155,38 @@ import { formatDate } from '@/lib/utils' } } -// ✅ 修正2: 相対インポートを使用 +// PASS: 修正2: 相対インポートを使用 import { formatDate } from '../lib/utils' -// ✅ 修正3: 欠落しているパッケージをインストール +// PASS: 修正3: 欠落しているパッケージをインストール npm install @/lib/utils ``` **パターン 5: 型の不一致** ```typescript -// ❌ エラー: Type 'string' is not assignable to type 'number' +// FAIL: エラー: Type 'string' is not assignable to type 'number' const age: number = "30" -// ✅ 修正: 文字列を数値にパース +// PASS: 修正: 文字列を数値にパース const age: number = parseInt("30", 10) -// ✅ または: 型を変更 +// PASS: または: 型を変更 const age: string = "30" ``` **パターン 6: ジェネリック制約** ```typescript -// ❌ エラー: Type 'T' is not assignable to type 'string' +// FAIL: エラー: Type 'T' is not assignable to type 'string' function getLength(item: T): number { return item.length } -// ✅ 修正: 制約を追加 +// PASS: 修正: 制約を追加 function getLength(item: T): number { return item.length } -// ✅ または: より具体的な制約 +// PASS: または: より具体的な制約 function getLength(item: T): number { return item.length } @@ -194,14 +194,14 @@ function getLength(item: T): number { **パターン 7: React Hookエラー** ```typescript -// ❌ エラー: React Hook "useState" cannot be called in a function +// FAIL: エラー: React Hook "useState" cannot be called in a function function MyComponent() { if (condition) { const [state, setState] = useState(0) // エラー! } } -// ✅ 修正: フックをトップレベルに移動 +// PASS: 修正: フックをトップレベルに移動 function MyComponent() { const [state, setState] = useState(0) @@ -215,12 +215,12 @@ function MyComponent() { **パターン 8: Async/Awaitエラー** ```typescript -// ❌ エラー: 'await' expressions are only allowed within async functions +// FAIL: エラー: 'await' expressions are only allowed within async functions function fetchData() { const data = await fetch('/api/data') } -// ✅ 修正: asyncキーワードを追加 +// PASS: 修正: asyncキーワードを追加 async function fetchData() { const data = await fetch('/api/data') } @@ -228,14 +228,14 @@ async function fetchData() { **パターン 9: モジュールが見つからない** ```typescript -// ❌ エラー: Cannot find module 'react' or its corresponding type declarations +// FAIL: エラー: Cannot find module 'react' or its corresponding type declarations import React from 'react' -// ✅ 修正: 依存関係をインストール +// PASS: 修正: 依存関係をインストール npm install react npm install --save-dev @types/react -// ✅ 確認: package.jsonに依存関係があることを確認 +// PASS: 確認: package.jsonに依存関係があることを確認 { "dependencies": { "react": "^19.0.0" @@ -248,18 +248,18 @@ npm install --save-dev @types/react **パターン 10: Next.js固有のエラー** ```typescript -// ❌ エラー: Fast Refresh had to perform a full reload +// FAIL: エラー: Fast Refresh had to perform a full reload // 通常、コンポーネント以外のエクスポートが原因 -// ✅ 修正: エクスポートを分離 -// ❌ 間違い: file.tsx +// PASS: 修正: エクスポートを分離 +// FAIL: 間違い: file.tsx export const MyComponent = () =>
export const someConstant = 42 // フルリロードの原因 -// ✅ 正しい: component.tsx +// PASS: 正しい: component.tsx export const MyComponent = () =>
-// ✅ 正しい: constants.ts +// PASS: 正しい: constants.ts export const someConstant = 42 ``` @@ -267,7 +267,7 @@ export const someConstant = 42 ### Next.js 15 + React 19の互換性 ```typescript -// ❌ エラー: React 19の型変更 +// FAIL: エラー: React 19の型変更 import { FC } from 'react' interface Props { @@ -278,7 +278,7 @@ const Component: FC = ({ children }) => { return
{children}
} -// ✅ 修正: React 19ではFCは不要 +// PASS: 修正: React 19ではFCは不要 interface Props { children: React.ReactNode } @@ -290,12 +290,12 @@ const Component = ({ children }: Props) => { ### Supabaseクライアントの型 ```typescript -// ❌ エラー: Type 'any' not assignable +// FAIL: エラー: Type 'any' not assignable const { data } = await supabase .from('markets') .select('*') -// ✅ 修正: 型アノテーションを追加 +// PASS: 修正: 型アノテーションを追加 interface Market { id: string name: string @@ -310,10 +310,10 @@ const { data } = await supabase ### Redis Stackの型 ```typescript -// ❌ エラー: Property 'ft' does not exist on type 'RedisClientType' +// FAIL: エラー: Property 'ft' does not exist on type 'RedisClientType' const results = await client.ft.search('idx:markets', query) -// ✅ 修正: 適切なRedis Stackの型を使用 +// PASS: 修正: 適切なRedis Stackの型を使用 import { createClient } from 'redis' const client = createClient({ @@ -328,10 +328,10 @@ const results = await client.ft.search('idx:markets', query) ### Solana Web3.jsの型 ```typescript -// ❌ エラー: Argument of type 'string' not assignable to 'PublicKey' +// FAIL: エラー: Argument of type 'string' not assignable to 'PublicKey' const publicKey = wallet.address -// ✅ 修正: PublicKeyコンストラクタを使用 +// PASS: 修正: PublicKeyコンストラクタを使用 import { PublicKey } from '@solana/web3.js' const publicKey = new PublicKey(wallet.address) ``` @@ -341,34 +341,34 @@ const publicKey = new PublicKey(wallet.address) **重要: できる限り最小限の変更を行う** ### すべきこと: -✅ 欠落している型アノテーションを追加 -✅ 必要な箇所にnullチェックを追加 -✅ インポート/エクスポートを修正 -✅ 欠落している依存関係を追加 -✅ 型定義を更新 -✅ 設定ファイルを修正 +PASS: 欠落している型アノテーションを追加 +PASS: 必要な箇所にnullチェックを追加 +PASS: インポート/エクスポートを修正 +PASS: 欠落している依存関係を追加 +PASS: 型定義を更新 +PASS: 設定ファイルを修正 ### してはいけないこと: -❌ 関連のないコードをリファクタリング -❌ アーキテクチャを変更 -❌ 変数/関数の名前を変更(エラーの原因でない限り) -❌ 新機能を追加 -❌ ロジックフローを変更(エラー修正以外) -❌ パフォーマンスを最適化 -❌ コードスタイルを改善 +FAIL: 関連のないコードをリファクタリング +FAIL: アーキテクチャを変更 +FAIL: 変数/関数の名前を変更(エラーの原因でない限り) +FAIL: 新機能を追加 +FAIL: ロジックフローを変更(エラー修正以外) +FAIL: パフォーマンスを最適化 +FAIL: コードスタイルを改善 **最小差分の例:** ```typescript // ファイルは200行あり、45行目にエラーがある -// ❌ 間違い: ファイル全体をリファクタリング +// FAIL: 間違い: ファイル全体をリファクタリング // - 変数の名前変更 // - 関数の抽出 // - パターンの変更 // 結果: 50行変更 -// ✅ 正しい: エラーのみを修正 +// PASS: 正しい: エラーのみを修正 // - 45行目に型アノテーションを追加 // 結果: 1行変更 @@ -376,12 +376,12 @@ function processData(data) { // 45行目 - エラー: 'data' implicitly has 'any return data.map(item => item.value) } -// ✅ 最小限の修正: +// PASS: 最小限の修正: function processData(data: any[]) { // この行のみを変更 return data.map(item => item.value) } -// ✅ より良い最小限の修正(型が既知の場合): +// PASS: より良い最小限の修正(型が既知の場合): function processData(data: Array<{ value: number }>) { return data.map(item => item.value) } @@ -396,7 +396,7 @@ function processData(data: Array<{ value: number }>) { **ビルド対象:** Next.jsプロダクション / TypeScriptチェック / ESLint **初期エラー数:** X **修正済みエラー数:** Y -**ビルドステータス:** ✅ 成功 / ❌ 失敗 +**ビルドステータス:** PASS: 成功 / FAIL: 失敗 ## 修正済みエラー @@ -430,17 +430,17 @@ Parameter 'market' implicitly has an 'any' type. ## 検証手順 -1. ✅ TypeScriptチェック成功: `npx tsc --noEmit` -2. ✅ Next.jsビルド成功: `npm run build` -3. ✅ ESLintチェック成功: `npx eslint .` -4. ✅ 新しいエラーが導入されていない -5. ✅ 開発サーバー起動: `npm run dev` +1. PASS: TypeScriptチェック成功: `npx tsc --noEmit` +2. PASS: Next.jsビルド成功: `npm run build` +3. PASS: ESLintチェック成功: `npx eslint .` +4. PASS: 新しいエラーが導入されていない +5. PASS: 開発サーバー起動: `npm run dev` ## まとめ - 解決されたエラー総数: X - 変更行数総数: Y -- ビルドステータス: ✅ 成功 +- ビルドステータス: PASS: 成功 - 修正時間: Z 分 - ブロッキング問題: 0 件残存 @@ -470,19 +470,19 @@ Parameter 'market' implicitly has an 'any' type. ## ビルドエラーの優先度レベル -### 🔴 クリティカル(即座に修正) +### クリティカル(即座に修正) - ビルドが完全に壊れている - 開発サーバーが起動しない - プロダクションデプロイがブロックされている - 複数のファイルが失敗している -### 🟡 高(早急に修正) +### 高(早急に修正) - 単一ファイルの失敗 - 新しいコードの型エラー - インポートエラー - 重要でないビルド警告 -### 🟢 中(可能な時に修正) +### 中(可能な時に修正) - リンター警告 - 非推奨APIの使用 - 非厳格な型の問題 @@ -521,13 +521,13 @@ npm install ## 成功指標 ビルドエラー解決後: -- ✅ `npx tsc --noEmit` が終了コード0で終了 -- ✅ `npm run build` が正常に完了 -- ✅ 新しいエラーが導入されていない -- ✅ 最小限の行数変更(影響を受けたファイルの5%未満) -- ✅ ビルド時間が大幅に増加していない -- ✅ 開発サーバーがエラーなく動作 -- ✅ テストが依然として成功 +- PASS: `npx tsc --noEmit` が終了コード0で終了 +- PASS: `npm run build` が正常に完了 +- PASS: 新しいエラーが導入されていない +- PASS: 最小限の行数変更(影響を受けたファイルの5%未満) +- PASS: ビルド時間が大幅に増加していない +- PASS: 開発サーバーがエラーなく動作 +- PASS: テストが依然として成功 --- diff --git a/docs/ja-JP/agents/code-reviewer.md b/docs/ja-JP/agents/code-reviewer.md index a57fea12..b5c5c5d7 100644 --- a/docs/ja-JP/agents/code-reviewer.md +++ b/docs/ja-JP/agents/code-reviewer.md @@ -81,15 +81,15 @@ model: opus 問題: APIキーがソースコードに公開されている 修正: 環境変数に移動 -const apiKey = "sk-abc123"; // ❌ Bad +const apiKey = "sk-abc123"; // FAIL: Bad const apiKey = process.env.API_KEY; // ✓ Good ``` ## 承認基準 -- ✅ 承認: CRITICALまたはHIGH問題なし -- ⚠️ 警告: MEDIUM問題のみ(注意してマージ可能) -- ❌ ブロック: CRITICALまたはHIGH問題が見つかった +- PASS: 承認: CRITICALまたはHIGH問題なし +- WARNING: 警告: MEDIUM問題のみ(注意してマージ可能) +- FAIL: ブロック: CRITICALまたはHIGH問題が見つかった ## プロジェクト固有のガイドライン(例) diff --git a/docs/ja-JP/agents/database-reviewer.md b/docs/ja-JP/agents/database-reviewer.md index 6b8c653f..30d814b8 100644 --- a/docs/ja-JP/agents/database-reviewer.md +++ b/docs/ja-JP/agents/database-reviewer.md @@ -112,14 +112,14 @@ c) データ保護 **影響:** 大きなテーブルで100〜1000倍高速なクエリ ```sql --- ❌ 悪い: 外部キーにインデックスがない +-- FAIL: 悪い: 外部キーにインデックスがない CREATE TABLE orders ( id bigint PRIMARY KEY, customer_id bigint REFERENCES customers(id) -- インデックスが欠落! ); --- ✅ 良い: 外部キーにインデックス +-- PASS: 良い: 外部キーにインデックス CREATE TABLE orders ( id bigint PRIMARY KEY, customer_id bigint REFERENCES customers(id) @@ -137,11 +137,11 @@ CREATE INDEX orders_customer_id_idx ON orders (customer_id); | **Hash** | 等価のみ | `=`(B-treeより若干高速) | ```sql --- ❌ 悪い: JSONB包含のためのB-tree +-- FAIL: 悪い: JSONB包含のためのB-tree CREATE INDEX products_attrs_idx ON products (attributes); SELECT * FROM products WHERE attributes @> '{"color": "red"}'; --- ✅ 良い: JSONBのためのGIN +-- PASS: 良い: JSONBのためのGIN CREATE INDEX products_attrs_idx ON products USING gin (attributes); ``` @@ -150,11 +150,11 @@ CREATE INDEX products_attrs_idx ON products USING gin (attributes); **影響:** 複数列クエリで5〜10倍高速 ```sql --- ❌ 悪い: 個別のインデックス +-- FAIL: 悪い: 個別のインデックス CREATE INDEX orders_status_idx ON orders (status); CREATE INDEX orders_created_idx ON orders (created_at); --- ✅ 良い: 複合インデックス(等価列を最初に、次に範囲) +-- PASS: 良い: 複合インデックス(等価列を最初に、次に範囲) CREATE INDEX orders_status_created_idx ON orders (status, created_at); ``` @@ -170,11 +170,11 @@ CREATE INDEX orders_status_created_idx ON orders (status, created_at); **影響:** テーブルルックアップを回避することで2〜5倍高速なクエリ ```sql --- ❌ 悪い: テーブルからnameを取得する必要がある +-- FAIL: 悪い: テーブルからnameを取得する必要がある CREATE INDEX users_email_idx ON users (email); SELECT email, name FROM users WHERE email = 'user@example.com'; --- ✅ 良い: すべての列がインデックスに含まれる +-- PASS: 良い: すべての列がインデックスに含まれる CREATE INDEX users_email_idx ON users (email) INCLUDE (name, created_at); ``` @@ -183,10 +183,10 @@ CREATE INDEX users_email_idx ON users (email) INCLUDE (name, created_at); **影響:** 5〜20倍小さいインデックス、高速な書き込みとクエリ ```sql --- ❌ 悪い: 完全なインデックスには削除された行が含まれる +-- FAIL: 悪い: 完全なインデックスには削除された行が含まれる CREATE INDEX users_email_idx ON users (email); --- ✅ 良い: 部分インデックスは削除された行を除外 +-- PASS: 良い: 部分インデックスは削除された行を除外 CREATE INDEX users_active_email_idx ON users (email) WHERE deleted_at IS NULL; ``` @@ -202,7 +202,7 @@ CREATE INDEX users_active_email_idx ON users (email) WHERE deleted_at IS NULL; ### 1. データ型の選択 ```sql --- ❌ 悪い: 不適切な型選択 +-- FAIL: 悪い: 不適切な型選択 CREATE TABLE users ( id int, -- 21億でオーバーフロー email varchar(255), -- 人為的な制限 @@ -211,7 +211,7 @@ CREATE TABLE users ( balance float -- 精度の損失 ); --- ✅ 良い: 適切な型 +-- PASS: 良い: 適切な型 CREATE TABLE users ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, email text NOT NULL, @@ -224,18 +224,18 @@ CREATE TABLE users ( ### 2. 主キー戦略 ```sql --- ✅ 単一データベース: IDENTITY(デフォルト、推奨) +-- PASS: 単一データベース: IDENTITY(デフォルト、推奨) CREATE TABLE users ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY ); --- ✅ 分散システム: UUIDv7(時間順) +-- PASS: 分散システム: UUIDv7(時間順) CREATE EXTENSION IF NOT EXISTS pg_uuidv7; CREATE TABLE orders ( id uuid DEFAULT uuid_generate_v7() PRIMARY KEY ); --- ❌ 避ける: ランダムUUIDはインデックスの断片化を引き起こす +-- FAIL: 避ける: ランダムUUIDはインデックスの断片化を引き起こす CREATE TABLE events ( id uuid DEFAULT gen_random_uuid() PRIMARY KEY -- 断片化した挿入! ); @@ -246,7 +246,7 @@ CREATE TABLE events ( **使用する場合:** テーブル > 1億行、時系列データ、古いデータを削除する必要がある ```sql --- ✅ 良い: 月ごとにパーティション化 +-- PASS: 良い: 月ごとにパーティション化 CREATE TABLE events ( id bigint GENERATED ALWAYS AS IDENTITY, created_at timestamptz NOT NULL, @@ -266,11 +266,11 @@ DROP TABLE events_2023_01; -- 数時間かかるDELETEではなく即座に ### 4. 小文字の識別子を使用 ```sql --- ❌ 悪い: 引用符付きの混合ケースは至る所で引用符が必要 +-- FAIL: 悪い: 引用符付きの混合ケースは至る所で引用符が必要 CREATE TABLE "Users" ("userId" bigint, "firstName" text); SELECT "firstName" FROM "Users"; -- 引用符が必須! --- ✅ 良い: 小文字は引用符なしで機能 +-- PASS: 良い: 小文字は引用符なしで機能 CREATE TABLE users (user_id bigint, first_name text); SELECT first_name FROM users; ``` @@ -284,11 +284,11 @@ SELECT first_name FROM users; **影響:** 重要 - データベースで強制されるテナント分離 ```sql --- ❌ 悪い: アプリケーションのみのフィルタリング +-- FAIL: 悪い: アプリケーションのみのフィルタリング SELECT * FROM orders WHERE user_id = $current_user_id; -- バグはすべての注文が露出することを意味する! --- ✅ 良い: データベースで強制されるRLS +-- PASS: 良い: データベースで強制されるRLS ALTER TABLE orders ENABLE ROW LEVEL SECURITY; ALTER TABLE orders FORCE ROW LEVEL SECURITY; @@ -308,11 +308,11 @@ CREATE POLICY orders_user_policy ON orders **影響:** 5〜10倍高速なRLSクエリ ```sql --- ❌ 悪い: 関数が行ごとに呼び出される +-- FAIL: 悪い: 関数が行ごとに呼び出される CREATE POLICY orders_policy ON orders USING (auth.uid() = user_id); -- 100万行に対して100万回呼び出される! --- ✅ 良い: SELECTでラップ(キャッシュされ、一度だけ呼び出される) +-- PASS: 良い: SELECTでラップ(キャッシュされ、一度だけ呼び出される) CREATE POLICY orders_policy ON orders USING ((SELECT auth.uid()) = user_id); -- 100倍高速 @@ -323,10 +323,10 @@ CREATE INDEX orders_user_id_idx ON orders (user_id); ### 3. 最小権限アクセス ```sql --- ❌ 悪い: 過度に許可的 +-- FAIL: 悪い: 過度に許可的 GRANT ALL PRIVILEGES ON ALL TABLES TO app_user; --- ✅ 良い: 最小限の権限 +-- PASS: 良い: 最小限の権限 CREATE ROLE app_readonly NOLOGIN; GRANT USAGE ON SCHEMA public TO app_readonly; GRANT SELECT ON public.products, public.categories TO app_readonly; @@ -378,14 +378,14 @@ SELECT pg_reload_conf(); ### 1. トランザクションを短く保つ ```sql --- ❌ 悪い: 外部APIコール中にロックを保持 +-- FAIL: 悪い: 外部APIコール中にロックを保持 BEGIN; SELECT * FROM orders WHERE id = 1 FOR UPDATE; -- HTTPコールに5秒かかる... UPDATE orders SET status = 'paid' WHERE id = 1; COMMIT; --- ✅ 良い: 最小限のロック期間 +-- PASS: 良い: 最小限のロック期間 -- トランザクション外で最初にAPIコールを実行 BEGIN; UPDATE orders SET status = 'paid', payment_id = $1 @@ -397,12 +397,12 @@ COMMIT; -- ミリ秒でロックを保持 ### 2. デッドロックを防ぐ ```sql --- ❌ 悪い: 一貫性のないロック順序がデッドロックを引き起こす +-- FAIL: 悪い: 一貫性のないロック順序がデッドロックを引き起こす -- トランザクションA: 行1をロック、次に行2 -- トランザクションB: 行2をロック、次に行1 -- デッドロック! --- ✅ 良い: 一貫したロック順序 +-- PASS: 良い: 一貫したロック順序 BEGIN; SELECT * FROM accounts WHERE id IN (1, 2) ORDER BY id FOR UPDATE; -- これで両方の行がロックされ、任意の順序で更新可能 @@ -416,10 +416,10 @@ COMMIT; **影響:** ワーカーキューで10倍のスループット ```sql --- ❌ 悪い: ワーカーが互いを待つ +-- FAIL: 悪い: ワーカーが互いを待つ SELECT * FROM jobs WHERE status = 'pending' LIMIT 1 FOR UPDATE; --- ✅ 良い: ワーカーはロックされた行をスキップ +-- PASS: 良い: ワーカーはロックされた行をスキップ UPDATE jobs SET status = 'processing', worker_id = $1, started_at = now() WHERE id = ( @@ -441,36 +441,36 @@ RETURNING *; **影響:** バルク挿入が10〜50倍高速 ```sql --- ❌ 悪い: 個別の挿入 +-- FAIL: 悪い: 個別の挿入 INSERT INTO events (user_id, action) VALUES (1, 'click'); INSERT INTO events (user_id, action) VALUES (2, 'view'); -- 1000回のラウンドトリップ --- ✅ 良い: バッチ挿入 +-- PASS: 良い: バッチ挿入 INSERT INTO events (user_id, action) VALUES (1, 'click'), (2, 'view'), (3, 'click'); -- 1回のラウンドトリップ --- ✅ 最良: 大きなデータセットにはCOPY +-- PASS: 最良: 大きなデータセットにはCOPY COPY events (user_id, action) FROM '/path/to/data.csv' WITH (FORMAT csv); ``` ### 2. N+1クエリの排除 ```sql --- ❌ 悪い: N+1パターン +-- FAIL: 悪い: N+1パターン SELECT id FROM users WHERE active = true; -- 100件のIDを返す -- 次に100回のクエリ: SELECT * FROM orders WHERE user_id = 1; SELECT * FROM orders WHERE user_id = 2; -- ... 98回以上 --- ✅ 良い: ANYを使用した単一クエリ +-- PASS: 良い: ANYを使用した単一クエリ SELECT * FROM orders WHERE user_id = ANY(ARRAY[1, 2, 3, ...]); --- ✅ 良い: JOIN +-- PASS: 良い: JOIN SELECT u.id, u.name, o.* FROM users u LEFT JOIN orders o ON o.user_id = u.id @@ -482,11 +482,11 @@ WHERE u.active = true; **影響:** ページの深さに関係なく一貫したO(1)パフォーマンス ```sql --- ❌ 悪い: OFFSETは深さとともに遅くなる +-- FAIL: 悪い: OFFSETは深さとともに遅くなる SELECT * FROM products ORDER BY id LIMIT 20 OFFSET 199980; -- 200,000行をスキャン! --- ✅ 良い: カーソルベース(常に高速) +-- PASS: 良い: カーソルベース(常に高速) SELECT * FROM products WHERE id > 199980 ORDER BY id LIMIT 20; -- インデックスを使用、O(1) ``` @@ -494,11 +494,11 @@ SELECT * FROM products WHERE id > 199980 ORDER BY id LIMIT 20; ### 4. 挿入または更新のためのUPSERT ```sql --- ❌ 悪い: 競合状態 +-- FAIL: 悪い: 競合状態 SELECT * FROM settings WHERE user_id = 123 AND key = 'theme'; -- 両方のスレッドが何も見つけず、両方が挿入、一方が失敗 --- ✅ 良い: アトミックなUPSERT +-- PASS: 良い: アトミックなUPSERT INSERT INTO settings (user_id, key, value) VALUES (123, 'theme', 'dark') ON CONFLICT (user_id, key) @@ -605,27 +605,27 @@ ORDER BY rank DESC; ## フラグを立てるべきアンチパターン -### ❌ クエリアンチパターン +### FAIL: クエリアンチパターン - 本番コードでの`SELECT *` - WHERE/JOIN列にインデックスがない - 大きなテーブルでのOFFSETページネーション - N+1クエリパターン - パラメータ化されていないクエリ(SQLインジェクションリスク) -### ❌ スキーマアンチパターン +### FAIL: スキーマアンチパターン - IDに`int`(`bigint`を使用) - 理由なく`varchar(255)`(`text`を使用) - タイムゾーンなしの`timestamp`(`timestamptz`を使用) - 主キーとしてのランダムUUID(UUIDv7またはIDENTITYを使用) - 引用符を必要とする混合ケースの識別子 -### ❌ セキュリティアンチパターン +### FAIL: セキュリティアンチパターン - アプリケーションユーザーへの`GRANT ALL` - マルチテナントテーブルでRLSが欠落 - 行ごとに関数を呼び出すRLSポリシー(SELECTでラップされていない) - RLSポリシー列にインデックスがない -### ❌ 接続アンチパターン +### FAIL: 接続アンチパターン - 接続プーリングなし - アイドルタイムアウトなし - トランザクションモードプーリングでのプリペアドステートメント diff --git a/docs/ja-JP/agents/doc-updater.md b/docs/ja-JP/agents/doc-updater.md index bc42287e..c5487645 100644 --- a/docs/ja-JP/agents/doc-updater.md +++ b/docs/ja-JP/agents/doc-updater.md @@ -386,7 +386,7 @@ function extractJSDoc(pattern: string) { - [x] 古い参照なし ### 影響 -🟢 低 - ドキュメントのみ、コード変更なし + 低 - ドキュメントのみ、コード変更なし 完全なアーキテクチャ概要についてはdocs/CODEMAPS/INDEX.mdを参照してください。 ``` diff --git a/docs/ja-JP/agents/e2e-runner.md b/docs/ja-JP/agents/e2e-runner.md index b2b5d0f9..e6eb35f8 100644 --- a/docs/ja-JP/agents/e2e-runner.md +++ b/docs/ja-JP/agents/e2e-runner.md @@ -428,28 +428,28 @@ test('market search with complex query', async ({ page }) => { **1. 競合状態** ```typescript -// ❌ 不安定: 要素が準備完了であると仮定しない +// FAIL: 不安定: 要素が準備完了であると仮定しない await page.click('[data-testid="button"]') -// ✅ 安定: 要素が準備完了になるのを待つ +// PASS: 安定: 要素が準備完了になるのを待つ await page.locator('[data-testid="button"]').click() // 組み込みの自動待機 ``` **2. ネットワークタイミング** ```typescript -// ❌ 不安定: 任意のタイムアウト +// FAIL: 不安定: 任意のタイムアウト await page.waitForTimeout(5000) -// ✅ 安定: 特定の条件を待つ +// PASS: 安定: 特定の条件を待つ await page.waitForResponse(resp => resp.url().includes('/api/markets')) ``` **3. アニメーションタイミング** ```typescript -// ❌ 不安定: アニメーション中にクリック +// FAIL: 不安定: アニメーション中にクリック await page.click('[data-testid="menu-item"]') -// ✅ 安定: アニメーションが完了するのを待つ +// PASS: 安定: アニメーションが完了するのを待つ await page.locator('[data-testid="menu-item"]').waitFor({ state: 'visible' }) await page.waitForLoadState('networkidle') await page.click('[data-testid="menu-item"]') @@ -548,7 +548,7 @@ jobs: **日付:** YYYY-MM-DD HH:MM **期間:** Xm Ys -**ステータス:** ✅ 成功 / ❌ 失敗 +**ステータス:** PASS: 成功 / FAIL: 失敗 ## まとめ @@ -561,20 +561,20 @@ jobs: ## スイート別テスト結果 ### Markets - ブラウズと検索 -- ✅ user can browse markets (2.3s) -- ✅ semantic search returns relevant results (1.8s) -- ✅ search handles no results (1.2s) -- ❌ search with special characters (0.9s) +- PASS: user can browse markets (2.3s) +- PASS: semantic search returns relevant results (1.8s) +- PASS: search handles no results (1.2s) +- FAIL: search with special characters (0.9s) ### Wallet - 接続 -- ✅ user can connect MetaMask (3.1s) -- ⚠️ user can connect Phantom (2.8s) - 不安定 -- ✅ user can disconnect wallet (1.5s) +- PASS: user can connect MetaMask (3.1s) +- WARNING: user can connect Phantom (2.8s) - 不安定 +- PASS: user can disconnect wallet (1.5s) ### Trading - コアフロー -- ✅ user can place buy order (5.2s) -- ❌ user can place sell order (4.8s) -- ✅ insufficient balance shows error (1.9s) +- PASS: user can place buy order (5.2s) +- FAIL: user can place sell order (4.8s) +- PASS: insufficient balance shows error (1.9s) ## 失敗したテスト @@ -623,13 +623,13 @@ jobs: ## 成功指標 E2Eテスト実行後: -- ✅ すべての重要なジャーニーが成功(100%) -- ✅ 全体の成功率 > 95% -- ✅ 不安定率 < 5% -- ✅ デプロイをブロックする失敗したテストなし -- ✅ アーティファクトがアップロードされアクセス可能 -- ✅ テスト時間 < 10分 -- ✅ HTMLレポートが生成された +- PASS: すべての重要なジャーニーが成功(100%) +- PASS: 全体の成功率 > 95% +- PASS: 不安定率 < 5% +- PASS: デプロイをブロックする失敗したテストなし +- PASS: アーティファクトがアップロードされアクセス可能 +- PASS: テスト時間 < 10分 +- PASS: HTMLレポートが生成された --- diff --git a/docs/ja-JP/agents/refactor-cleaner.md b/docs/ja-JP/agents/refactor-cleaner.md index 72a6c232..e378ba94 100644 --- a/docs/ja-JP/agents/refactor-cleaner.md +++ b/docs/ja-JP/agents/refactor-cleaner.md @@ -146,22 +146,22 @@ e) テストがまだ合格することを確認 ### 1. 未使用のインポート ```typescript -// ❌ 未使用のインポートを削除 +// FAIL: 未使用のインポートを削除 import { useState, useEffect, useMemo } from 'react' // useStateのみ使用 -// ✅ 使用されているもののみを保持 +// PASS: 使用されているもののみを保持 import { useState } from 'react' ``` ### 2. デッドコードブランチ ```typescript -// ❌ 到達不可能なコードを削除 +// FAIL: 到達不可能なコードを削除 if (false) { // これは決して実行されない doSomething() } -// ❌ 未使用の関数を削除 +// FAIL: 未使用の関数を削除 export function unusedHelper() { // コードベースに参照なし } @@ -169,18 +169,18 @@ export function unusedHelper() { ### 3. 重複コンポーネント ```typescript -// ❌ 複数の類似コンポーネント +// FAIL: 複数の類似コンポーネント components/Button.tsx components/PrimaryButton.tsx components/NewButton.tsx -// ✅ 1つに統合 +// PASS: 1つに統合 components/Button.tsx (variantプロップ付き) ``` ### 4. 未使用の依存関係 ```json -// ❌ インストールされているがインポートされていないパッケージ +// FAIL: インストールされているがインポートされていないパッケージ { "dependencies": { "lodash": "^4.17.21", // どこでも使用されていない @@ -240,7 +240,7 @@ components/Button.tsx (variantプロップ付き) - 依存関係: -Xパッケージ ### リスクレベル -🟢 低 - 検証可能な未使用コードのみを削除 + 低 - 検証可能な未使用コードのみを削除 詳細はDELETION_LOG.mdを参照してください。 ``` @@ -294,12 +294,12 @@ components/Button.tsx (variantプロップ付き) ## 成功指標 クリーンアップセッション後: -- ✅ すべてのテストが合格 -- ✅ ビルドが成功 -- ✅ コンソールエラーなし -- ✅ DELETION_LOG.mdが更新された -- ✅ バンドルサイズが削減された -- ✅ 本番環境で回帰なし +- PASS: すべてのテストが合格 +- PASS: ビルドが成功 +- PASS: コンソールエラーなし +- PASS: DELETION_LOG.mdが更新された +- PASS: バンドルサイズが削減された +- PASS: 本番環境で回帰なし --- diff --git a/docs/ja-JP/agents/security-reviewer.md b/docs/ja-JP/agents/security-reviewer.md index 693d6c82..a9367460 100644 --- a/docs/ja-JP/agents/security-reviewer.md +++ b/docs/ja-JP/agents/security-reviewer.md @@ -184,12 +184,12 @@ APIセキュリティ: ### 1. ハードコードされたシークレット(重要) ```javascript -// ❌ 重要: ハードコードされたシークレット +// FAIL: 重要: ハードコードされたシークレット const apiKey = "sk-proj-xxxxx" const password = "admin123" const token = "ghp_xxxxxxxxxxxx" -// ✅ 正しい: 環境変数 +// PASS: 正しい: 環境変数 const apiKey = process.env.OPENAI_API_KEY if (!apiKey) { throw new Error('OPENAI_API_KEY not configured') @@ -199,11 +199,11 @@ if (!apiKey) { ### 2. SQLインジェクション(重要) ```javascript -// ❌ 重要: SQLインジェクションの脆弱性 +// FAIL: 重要: SQLインジェクションの脆弱性 const query = `SELECT * FROM users WHERE id = ${userId}` await db.query(query) -// ✅ 正しい: パラメータ化されたクエリ +// PASS: 正しい: パラメータ化されたクエリ const { data } = await supabase .from('users') .select('*') @@ -213,11 +213,11 @@ const { data } = await supabase ### 3. コマンドインジェクション(重要) ```javascript -// ❌ 重要: コマンドインジェクション +// FAIL: 重要: コマンドインジェクション const { exec } = require('child_process') exec(`ping ${userInput}`, callback) -// ✅ 正しい: シェルコマンドではなくライブラリを使用 +// PASS: 正しい: シェルコマンドではなくライブラリを使用 const dns = require('dns') dns.lookup(userInput, callback) ``` @@ -225,10 +225,10 @@ dns.lookup(userInput, callback) ### 4. クロスサイトスクリプティング(XSS)(高) ```javascript -// ❌ 高: XSS脆弱性 +// FAIL: 高: XSS脆弱性 element.innerHTML = userInput -// ✅ 正しい: textContentを使用またはサニタイズ +// PASS: 正しい: textContentを使用またはサニタイズ element.textContent = userInput // または import DOMPurify from 'dompurify' @@ -238,10 +238,10 @@ element.innerHTML = DOMPurify.sanitize(userInput) ### 5. サーバーサイドリクエストフォージェリ(SSRF)(高) ```javascript -// ❌ 高: SSRF脆弱性 +// FAIL: 高: SSRF脆弱性 const response = await fetch(userProvidedUrl) -// ✅ 正しい: URLを検証してホワイトリスト +// PASS: 正しい: URLを検証してホワイトリスト const allowedDomains = ['api.example.com', 'cdn.example.com'] const url = new URL(userProvidedUrl) if (!allowedDomains.includes(url.hostname)) { @@ -253,10 +253,10 @@ const response = await fetch(url.toString()) ### 6. 安全でない認証(重要) ```javascript -// ❌ 重要: 平文パスワード比較 +// FAIL: 重要: 平文パスワード比較 if (password === storedPassword) { /* ログイン */ } -// ✅ 正しい: ハッシュ化されたパスワード比較 +// PASS: 正しい: ハッシュ化されたパスワード比較 import bcrypt from 'bcrypt' const isValid = await bcrypt.compare(password, hashedPassword) ``` @@ -264,13 +264,13 @@ const isValid = await bcrypt.compare(password, hashedPassword) ### 7. 不十分な認可(重要) ```javascript -// ❌ 重要: 認可チェックなし +// FAIL: 重要: 認可チェックなし app.get('/api/user/:id', async (req, res) => { const user = await getUser(req.params.id) res.json(user) }) -// ✅ 正しい: ユーザーがリソースにアクセスできることを確認 +// PASS: 正しい: ユーザーがリソースにアクセスできることを確認 app.get('/api/user/:id', authenticateUser, async (req, res) => { if (req.user.id !== req.params.id && !req.user.isAdmin) { return res.status(403).json({ error: 'Forbidden' }) @@ -283,13 +283,13 @@ app.get('/api/user/:id', authenticateUser, async (req, res) => { ### 8. 金融操作の競合状態(重要) ```javascript -// ❌ 重要: 残高チェックの競合状態 +// FAIL: 重要: 残高チェックの競合状態 const balance = await getBalance(userId) if (balance >= amount) { await withdraw(userId, amount) // 別のリクエストが並行して出金できる! } -// ✅ 正しい: ロック付きアトミックトランザクション +// PASS: 正しい: ロック付きアトミックトランザクション await db.transaction(async (trx) => { const balance = await trx('balances') .where({ user_id: userId }) @@ -309,13 +309,13 @@ await db.transaction(async (trx) => { ### 9. 不十分なレート制限(高) ```javascript -// ❌ 高: レート制限なし +// FAIL: 高: レート制限なし app.post('/api/trade', async (req, res) => { await executeTrade(req.body) res.json({ success: true }) }) -// ✅ 正しい: レート制限 +// PASS: 正しい: レート制限 import rateLimit from 'express-rate-limit' const tradeLimiter = rateLimit({ @@ -333,10 +333,10 @@ app.post('/api/trade', tradeLimiter, async (req, res) => { ### 10. 機密データのロギング(中) ```javascript -// ❌ 中: 機密データのロギング +// FAIL: 中: 機密データのロギング console.log('User login:', { email, password, apiKey }) -// ✅ 正しい: ログをサニタイズ +// PASS: 正しい: ログをサニタイズ console.log('User login:', { email: email.replace(/(?<=.).(?=.*@)/g, '*'), passwordProvided: !!password @@ -358,7 +358,7 @@ console.log('User login:', { - **高い問題:** Y - **中程度の問題:** Z - **低い問題:** W -- **リスクレベル:** 🔴 高 / 🟡 中 / 🟢 低 +- **リスクレベル:** 高 / 中 / 低 ## 重要な問題(即座に修正) @@ -380,7 +380,7 @@ console.log('User login:', { **修復:** ```javascript -// ✅ 安全な実装 +// PASS: 安全な実装 ``` **参考資料:** @@ -433,7 +433,7 @@ PRをレビューする際、インラインコメントを投稿: ## セキュリティレビュー **レビューアー:** security-reviewer agent -**リスクレベル:** 🔴 高 / 🟡 中 / 🟢 低 +**リスクレベル:** 高 / 中 / 低 ### ブロッキング問題 - [ ] **重要**: [説明] @ `file:line` @@ -532,13 +532,13 @@ npm install --save-dev audit-ci ## 成功指標 セキュリティレビュー後: -- ✅ 重要な問題が見つからない -- ✅ すべての高い問題が対処されている -- ✅ セキュリティチェックリストが完了 -- ✅ コードにシークレットがない -- ✅ 依存関係が最新 -- ✅ テストにセキュリティシナリオが含まれている -- ✅ ドキュメントが更新されている +- PASS: 重要な問題が見つからない +- PASS: すべての高い問題が対処されている +- PASS: セキュリティチェックリストが完了 +- PASS: コードにシークレットがない +- PASS: 依存関係が最新 +- PASS: テストにセキュリティシナリオが含まれている +- PASS: ドキュメントが更新されている --- diff --git a/docs/ja-JP/agents/tdd-guide.md b/docs/ja-JP/agents/tdd-guide.md index 4e76e9b8..7726ce36 100644 --- a/docs/ja-JP/agents/tdd-guide.md +++ b/docs/ja-JP/agents/tdd-guide.md @@ -220,26 +220,26 @@ jest.mock('@/lib/openai', () => ({ ## テストの悪臭(アンチパターン) -### ❌ 実装の詳細をテスト +### FAIL: 実装の詳細をテスト ```typescript // 内部状態をテストしない expect(component.state.count).toBe(5) ``` -### ✅ ユーザーに見える動作をテスト +### PASS: ユーザーに見える動作をテスト ```typescript // ユーザーが見るものをテストする expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ テストが互いに依存 +### FAIL: テストが互いに依存 ```typescript // 前のテストに依存しない test('creates user', () => { /* ... */ }) test('updates same user', () => { /* 前のテストが必要 */ }) ``` -### ✅ 独立したテスト +### PASS: 独立したテスト ```typescript // 各テストでデータをセットアップ test('updates user', () => { diff --git a/docs/ja-JP/commands/e2e.md b/docs/ja-JP/commands/e2e.md index 1e57b8df..1b728fa1 100644 --- a/docs/ja-JP/commands/e2e.md +++ b/docs/ja-JP/commands/e2e.md @@ -183,7 +183,7 @@ Artifacts generated: ╔══════════════════════════════════════════════════════════════╗ ║ E2Eテスト結果 ║ ╠══════════════════════════════════════════════════════════════╣ -║ ステータス: ✅ 全テスト合格 ║ +║ ステータス: PASS: 全テスト合格 ║ ║ 合計: 3テスト ║ ║ 合格: 3 (100%) ║ ║ 失敗: 0 ║ @@ -192,15 +192,15 @@ Artifacts generated: ╚══════════════════════════════════════════════════════════════╝ アーティファクト: -📸 スクリーンショット: 2ファイル -📹 ビデオ: 0ファイル (失敗時のみ) -🔍 トレース: 0ファイル (失敗時のみ) -📊 HTMLレポート: playwright-report/index.html + スクリーンショット: 2ファイル + ビデオ: 0ファイル (失敗時のみ) + トレース: 0ファイル (失敗時のみ) + HTMLレポート: playwright-report/index.html レポート表示: npx playwright show-report ``` -✅ E2E テストスイートは CI/CD 統合の準備ができました! +PASS: E2E テストスイートは CI/CD 統合の準備ができました! ```` @@ -237,7 +237,7 @@ open artifacts/search-results.png テストが断続的に失敗する場合: ``` -⚠️ FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts +WARNING: FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts テストは10回中7回合格 (合格率70%) @@ -257,10 +257,10 @@ open artifacts/search-results.png デフォルトでは、テストは複数のブラウザで実行されます: -* ✅ Chromium(デスクトップ Chrome) -* ✅ Firefox(デスクトップ) -* ✅ WebKit(デスクトップ Safari) -* ✅ Mobile Chrome(オプション) +* PASS: Chromium(デスクトップ Chrome) +* PASS: Firefox(デスクトップ) +* PASS: WebKit(デスクトップ Safari) +* PASS: Mobile Chrome(オプション) `playwright.config.ts` で設定してブラウザを調整します。 @@ -288,7 +288,7 @@ CI パイプラインに追加: PMX の場合、以下の E2E テストを優先: -**🔴 重大(常に成功する必要):** +**重大(常に成功する必要):** 1. ユーザーがウォレットを接続できる 2. ユーザーが市場をブラウズできる @@ -298,7 +298,7 @@ PMX の場合、以下の E2E テストを優先: 6. 市場が正しく決済される 7. ユーザーが資金を引き出せる -**🟡 重要:** +**重要:** 1. 市場作成フロー 2. ユーザープロフィール更新 @@ -311,21 +311,21 @@ PMX の場合、以下の E2E テストを優先: **すべき事:** -* ✅ 保守性を高めるためページオブジェクトモデルを使用します -* ✅ セレクタとして data-testid 属性を使用します -* ✅ 任意のタイムアウトではなく API レスポンスを待機 -* ✅ 重要なユーザージャーニーのエンドツーエンドテスト -* ✅ main にマージする前にテストを実行 -* ✅ テスト失敗時にアーティファクトをレビュー +* PASS: 保守性を高めるためページオブジェクトモデルを使用します +* PASS: セレクタとして data-testid 属性を使用します +* PASS: 任意のタイムアウトではなく API レスポンスを待機 +* PASS: 重要なユーザージャーニーのエンドツーエンドテスト +* PASS: main にマージする前にテストを実行 +* PASS: テスト失敗時にアーティファクトをレビュー **すべきでない事:** -* ❌ 不安定なセレクタを使用します(CSS クラスは変わる可能性) -* ❌ 実装の詳細をテスト -* ❌ 本番環境に対してテストを実行 -* ❌ 不安定なテストを無視 -* ❌ 失敗時にアーティファクトレビューをスキップ -* ❌ E2E テストですべてのエッジケースをテスト(単体テストを使用します) +* FAIL: 不安定なセレクタを使用します(CSS クラスは変わる可能性) +* FAIL: 実装の詳細をテスト +* FAIL: 本番環境に対してテストを実行 +* FAIL: 不安定なテストを無視 +* FAIL: 失敗時にアーティファクトレビューをスキップ +* FAIL: E2E テストですべてのエッジケースをテスト(単体テストを使用します) ## 重要な注意事項 diff --git a/docs/ja-JP/commands/evolve.md b/docs/ja-JP/commands/evolve.md index 81081f5d..b71ce510 100644 --- a/docs/ja-JP/commands/evolve.md +++ b/docs/ja-JP/commands/evolve.md @@ -92,7 +92,7 @@ instinctsが分離の恩恵を受ける複雑な複数ステップのプロセ ## 出力フォーマット ``` -🧬 進化分析 + 進化分析 ================== 進化の準備ができた3つのクラスターを発見: diff --git a/docs/ja-JP/commands/go-build.md b/docs/ja-JP/commands/go-build.md index 650ac480..ae4134a7 100644 --- a/docs/ja-JP/commands/go-build.md +++ b/docs/ja-JP/commands/go-build.md @@ -140,7 +140,7 @@ ok project/internal/handler 0.023s | 変更されたファイル | 2 | | 残存問題 | 0 | -ビルドステータス: ✅ 成功 +ビルドステータス: PASS: 成功 ``` ## 修正される一般的なエラー diff --git a/docs/ja-JP/commands/go-review.md b/docs/ja-JP/commands/go-review.md index c843d563..333202a9 100644 --- a/docs/ja-JP/commands/go-review.md +++ b/docs/ja-JP/commands/go-review.md @@ -124,16 +124,16 @@ return fmt.Errorf("get user %s: %w", userID, err) - HIGH: 1 - MEDIUM: 0 -推奨: ❌ CRITICAL問題が修正されるまでマージをブロック +推奨: FAIL: CRITICAL問題が修正されるまでマージをブロック ``` ## 承認基準 | ステータス | 条件 | |--------|-----------| -| ✅ 承認 | CRITICALまたはHIGH問題なし | -| ⚠️ 警告 | MEDIUM問題のみ(注意してマージ) | -| ❌ ブロック | CRITICALまたはHIGH問題が発見された | +| PASS: 承認 | CRITICALまたはHIGH問題なし | +| WARNING: 警告 | MEDIUM問題のみ(注意してマージ) | +| FAIL: ブロック | CRITICALまたはHIGH問題が発見された | ## 他のコマンドとの統合 diff --git a/docs/ja-JP/commands/instinct-export.md b/docs/ja-JP/commands/instinct-export.md index 4a57fde8..6a940506 100644 --- a/docs/ja-JP/commands/instinct-export.md +++ b/docs/ja-JP/commands/instinct-export.md @@ -70,17 +70,17 @@ instincts: ## プライバシーに関する考慮事項 エクスポートに含まれる内容: -- ✅ トリガーパターン -- ✅ アクション -- ✅ 信頼度スコア -- ✅ ドメイン -- ✅ 観察回数 +- PASS: トリガーパターン +- PASS: アクション +- PASS: 信頼度スコア +- PASS: ドメイン +- PASS: 観察回数 エクスポートに含まれない内容: -- ❌ 実際のコードスニペット -- ❌ ファイルパス -- ❌ セッション記録 -- ❌ 個人識別情報 +- FAIL: 実際のコードスニペット +- FAIL: ファイルパス +- FAIL: セッション記録 +- FAIL: 個人識別情報 ## フラグ diff --git a/docs/ja-JP/commands/instinct-import.md b/docs/ja-JP/commands/instinct-import.md index 804ef50d..c42752a2 100644 --- a/docs/ja-JP/commands/instinct-import.md +++ b/docs/ja-JP/commands/instinct-import.md @@ -45,7 +45,7 @@ python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import < ## インポートプロセス ``` -📥 instinctsをインポート中: team-instincts.yaml + instinctsをインポート中: team-instincts.yaml ================================================ 12件のinstinctsが見つかりました。 @@ -61,19 +61,19 @@ python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import < ## 重複instincts (3) 類似のinstinctsが既に存在: - ⚠️ prefer-functional-style + WARNING: prefer-functional-style ローカル: 信頼度0.8, 12回の観測 インポート: 信頼度0.7 → ローカルを保持 (信頼度が高い) - ⚠️ test-first-workflow + WARNING: test-first-workflow ローカル: 信頼度0.75 インポート: 信頼度0.9 → インポートに更新 (信頼度が高い) ## 競合instincts (1) ローカルのinstinctsと矛盾: - ❌ use-classes-for-services + FAIL: use-classes-for-services 競合: avoid-classes → スキップ (手動解決が必要) @@ -130,7 +130,7 @@ Skill Creatorからインポートする場合: インポート後: ``` -✅ インポート完了! +PASS: インポート完了! 追加: 8件のinstincts 更新: 1件のinstinct diff --git a/docs/ja-JP/commands/instinct-status.md b/docs/ja-JP/commands/instinct-status.md index c9e27909..af87a1de 100644 --- a/docs/ja-JP/commands/instinct-status.md +++ b/docs/ja-JP/commands/instinct-status.md @@ -39,7 +39,7 @@ python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py status ## 出力形式 ``` -📊 instinctステータス + instinctステータス ================== ## コードスタイル (4 instincts) diff --git a/docs/ja-JP/commands/multi-plan.md b/docs/ja-JP/commands/multi-plan.md index 0f1c938b..dc8406bc 100644 --- a/docs/ja-JP/commands/multi-plan.md +++ b/docs/ja-JP/commands/multi-plan.md @@ -204,9 +204,9 @@ Claudeの統合計画での欠落リスクを減らすために、両方のモ 3. **太字テキスト**でプロンプトを出力(**保存された実際のファイルパスを使用する必要があります**): --- - **計画が生成され、`.claude/plan/actual-feature-name.md`に保存されました** +**計画が生成され、`.claude/plan/actual-feature-name.md`に保存されました** - **上記の計画をレビューしてください。以下のことができます:** +**上記の計画をレビューしてください。以下のことができます:** - **計画を変更**: 調整が必要なことを教えてください、計画を更新します - **計画を実行**: 以下のコマンドを新しいセッションにコピー @@ -215,7 +215,7 @@ Claudeの統合計画での欠落リスクを減らすために、両方のモ ``` --- - **注意**: 上記の`actual-feature-name.md`は実際に保存されたファイル名で置き換える必要があります! +**注意**: 上記の`actual-feature-name.md`は実際に保存されたファイル名で置き換える必要があります! 4. **現在のレスポンスを直ちに終了**(ここで停止。これ以上のツール呼び出しはありません。) diff --git a/docs/ja-JP/commands/python-review.md b/docs/ja-JP/commands/python-review.md index 1cc9b05b..0d5dd095 100644 --- a/docs/ja-JP/commands/python-review.md +++ b/docs/ja-JP/commands/python-review.md @@ -89,7 +89,7 @@ Agent: ## 静的解析結果 ✓ ruff: 問題なし ✓ mypy: エラーなし -⚠️ black: 2ファイルが再フォーマット必要 +WARNING: black: 2ファイルが再フォーマット必要 ✓ bandit: セキュリティ問題なし ## 発見された問題 @@ -155,7 +155,7 @@ with open("config.json") as f: # 良い - HIGH: 1 - MEDIUM: 2 -推奨: ❌ CRITICAL問題が修正されるまでマージをブロック +推奨: FAIL: CRITICAL問題が修正されるまでマージをブロック ## フォーマット必要 実行: `black app/routes/user.py app/services/auth.py` @@ -165,9 +165,9 @@ with open("config.json") as f: # 良い | ステータス | 条件 | |--------|-----------| -| ✅ 承認 | CRITICALまたはHIGH問題なし | -| ⚠️ 警告 | MEDIUM問題のみ(注意してマージ) | -| ❌ ブロック | CRITICALまたはHIGH問題が発見された | +| PASS: 承認 | CRITICALまたはHIGH問題なし | +| WARNING: 警告 | MEDIUM問題のみ(注意してマージ) | +| FAIL: ブロック | CRITICALまたはHIGH問題が発見された | ## 他のコマンドとの統合 diff --git a/docs/ja-JP/commands/tdd.md b/docs/ja-JP/commands/tdd.md index 73000ff1..96a61c30 100644 --- a/docs/ja-JP/commands/tdd.md +++ b/docs/ja-JP/commands/tdd.md @@ -133,7 +133,7 @@ FAIL lib/liquidity.test.ts 1 test failed, 0 passed ``` -✅ テストは期待通りに失敗しました。実装の準備ができました。 +PASS: テストは期待通りに失敗しました。実装の準備ができました。 ## ステップ4: 最小限のコードを実装(GREEN) @@ -179,7 +179,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ すべてのテストが合格しました! +PASS: すべてのテストが合格しました! ## ステップ6: リファクタリング(IMPROVE) @@ -236,7 +236,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ リファクタリング完了、テストはまだ合格しています! +PASS: リファクタリング完了、テストはまだ合格しています! ## ステップ8: カバレッジの確認 @@ -247,29 +247,29 @@ File | % Stmts | % Branch | % Funcs | % Lines ---------------|---------|----------|---------|-------- liquidity.ts | 100 | 100 | 100 | 100 -Coverage: 100% ✅ (Target: 80%) +Coverage: 100% PASS: (Target: 80%) ``` -✅ TDDセッション完了! +PASS: TDDセッション完了! ``` ## TDDベストプラクティス **すべきこと:** -- ✅ 実装の前にまずテストを書く -- ✅ テストを実行し、実装前に失敗することを確認 -- ✅ テストに合格するための最小限のコードを書く -- ✅ テストが緑色になってからのみリファクタリング -- ✅ エッジケースとエラーシナリオを追加 -- ✅ 80%以上のカバレッジを目指す(重要なコードは100%) +- PASS: 実装の前にまずテストを書く +- PASS: テストを実行し、実装前に失敗することを確認 +- PASS: テストに合格するための最小限のコードを書く +- PASS: テストが緑色になってからのみリファクタリング +- PASS: エッジケースとエラーシナリオを追加 +- PASS: 80%以上のカバレッジを目指す(重要なコードは100%) **してはいけないこと:** -- ❌ テストの前に実装を書く -- ❌ 各変更後のテスト実行をスキップ -- ❌ 一度に多くのコードを書く -- ❌ 失敗するテストを無視 -- ❌ 実装の詳細をテスト(動作をテスト) -- ❌ すべてをモック化(統合テストを優先) +- FAIL: テストの前に実装を書く +- FAIL: 各変更後のテスト実行をスキップ +- FAIL: 一度に多くのコードを書く +- FAIL: 失敗するテストを無視 +- FAIL: 実装の詳細をテスト(動作をテスト) +- FAIL: すべてをモック化(統合テストを優先) ## 含めるべきテストタイプ diff --git a/docs/ja-JP/skills/backend-patterns/SKILL.md b/docs/ja-JP/skills/backend-patterns/SKILL.md index 2d1a0d7b..887bdf8d 100644 --- a/docs/ja-JP/skills/backend-patterns/SKILL.md +++ b/docs/ja-JP/skills/backend-patterns/SKILL.md @@ -12,7 +12,7 @@ description: Backend architecture patterns, API design, database optimization, a ### RESTful API構造 ```typescript -// ✅ リソースベースのURL +// PASS: リソースベースのURL GET /api/markets # リソースのリスト GET /api/markets/:id # 単一リソースの取得 POST /api/markets # リソースの作成 @@ -20,7 +20,7 @@ PUT /api/markets/:id # リソースの置換 PATCH /api/markets/:id # リソースの更新 DELETE /api/markets/:id # リソースの削除 -// ✅ フィルタリング、ソート、ページネーション用のクエリパラメータ +// PASS: フィルタリング、ソート、ページネーション用のクエリパラメータ GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -120,7 +120,7 @@ export default withAuth(async (req, res) => { ### クエリ最適化 ```typescript -// ✅ 良い: 必要な列のみを選択 +// PASS: 良い: 必要な列のみを選択 const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -128,7 +128,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ 悪い: すべてを選択 +// FAIL: 悪い: すべてを選択 const { data } = await supabase .from('markets') .select('*') @@ -137,13 +137,13 @@ const { data } = await supabase ### N+1クエリ防止 ```typescript -// ❌ 悪い: N+1クエリ問題 +// FAIL: 悪い: N+1クエリ問題 const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // Nクエリ } -// ✅ 良い: バッチフェッチ +// PASS: 良い: バッチフェッチ const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1クエリ diff --git a/docs/ja-JP/skills/clickhouse-io/SKILL.md b/docs/ja-JP/skills/clickhouse-io/SKILL.md index c7f795ec..59f07139 100644 --- a/docs/ja-JP/skills/clickhouse-io/SKILL.md +++ b/docs/ja-JP/skills/clickhouse-io/SKILL.md @@ -86,7 +86,7 @@ ORDER BY hour DESC; ### 効率的なフィルタリング ```sql --- ✅ 良い: インデックス列を最初に使用 +-- PASS: 良い: インデックス列を最初に使用 SELECT * FROM markets_analytics WHERE date >= '2025-01-01' @@ -95,7 +95,7 @@ WHERE date >= '2025-01-01' ORDER BY date DESC LIMIT 100; --- ❌ 悪い: インデックスのない列を最初にフィルタリング +-- FAIL: 悪い: インデックスのない列を最初にフィルタリング SELECT * FROM markets_analytics WHERE volume > 1000 @@ -106,7 +106,7 @@ WHERE volume > 1000 ### 集計 ```sql --- ✅ 良い: ClickHouse固有の集計関数を使用 +-- PASS: 良い: ClickHouse固有の集計関数を使用 SELECT toStartOfDay(created_at) AS day, market_id, @@ -119,7 +119,7 @@ WHERE created_at >= today() - INTERVAL 7 DAY GROUP BY day, market_id ORDER BY day DESC, total_volume DESC; --- ✅ パーセンタイルにはquantileを使用(percentileより効率的) +-- PASS: パーセンタイルにはquantileを使用(percentileより効率的) SELECT quantile(0.50)(trade_size) AS median, quantile(0.95)(trade_size) AS p95, @@ -162,7 +162,7 @@ const clickhouse = new ClickHouse({ } }) -// ✅ バッチ挿入(効率的) +// PASS: バッチ挿入(効率的) async function bulkInsertTrades(trades: Trade[]) { const values = trades.map(trade => `( '${trade.id}', @@ -178,7 +178,7 @@ async function bulkInsertTrades(trades: Trade[]) { `).toPromise() } -// ❌ 個別挿入(低速) +// FAIL: 個別挿入(低速) async function insertTrade(trade: Trade) { // ループ内でこれをしないでください! await clickhouse.query(` diff --git a/docs/ja-JP/skills/coding-standards/SKILL.md b/docs/ja-JP/skills/coding-standards/SKILL.md index e0615121..e1e3b61d 100644 --- a/docs/ja-JP/skills/coding-standards/SKILL.md +++ b/docs/ja-JP/skills/coding-standards/SKILL.md @@ -42,12 +42,12 @@ description: TypeScript、JavaScript、React、Node.js開発のための汎用 ### 変数の命名 ```typescript -// ✅ GOOD: Descriptive names +// PASS: GOOD: Descriptive names const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ BAD: Unclear names +// FAIL: BAD: Unclear names const q = 'election' const flag = true const x = 1000 @@ -56,12 +56,12 @@ const x = 1000 ### 関数の命名 ```typescript -// ✅ GOOD: Verb-noun pattern +// PASS: GOOD: Verb-noun pattern async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ BAD: Unclear or noun-only +// FAIL: BAD: Unclear or noun-only async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -70,7 +70,7 @@ function email(e) { } ### 不変性パターン(重要) ```typescript -// ✅ ALWAYS use spread operator +// PASS: ALWAYS use spread operator const updatedUser = { ...user, name: 'New Name' @@ -78,7 +78,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ NEVER mutate directly +// FAIL: NEVER mutate directly user.name = 'New Name' // BAD items.push(newItem) // BAD ``` @@ -86,7 +86,7 @@ items.push(newItem) // BAD ### エラーハンドリング ```typescript -// ✅ GOOD: Comprehensive error handling +// PASS: GOOD: Comprehensive error handling async function fetchData(url: string) { try { const response = await fetch(url) @@ -102,7 +102,7 @@ async function fetchData(url: string) { } } -// ❌ BAD: No error handling +// FAIL: BAD: No error handling async function fetchData(url) { const response = await fetch(url) return response.json() @@ -112,14 +112,14 @@ async function fetchData(url) { ### Async/Awaitベストプラクティス ```typescript -// ✅ GOOD: Parallel execution when possible +// PASS: GOOD: Parallel execution when possible const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ BAD: Sequential when unnecessary +// FAIL: BAD: Sequential when unnecessary const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -128,7 +128,7 @@ const stats = await fetchStats() ### 型安全性 ```typescript -// ✅ GOOD: Proper types +// PASS: GOOD: Proper types interface Market { id: string name: string @@ -140,7 +140,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ BAD: Using 'any' +// FAIL: BAD: Using 'any' function getMarket(id: any): Promise { // Implementation } @@ -151,7 +151,7 @@ function getMarket(id: any): Promise { ### コンポーネント構造 ```typescript -// ✅ GOOD: Functional component with types +// PASS: GOOD: Functional component with types interface ButtonProps { children: React.ReactNode onClick: () => void @@ -176,7 +176,7 @@ export function Button({ ) } -// ❌ BAD: No types, unclear structure +// FAIL: BAD: No types, unclear structure export function Button(props) { return } @@ -185,7 +185,7 @@ export function Button(props) { ### カスタムフック ```typescript -// ✅ GOOD: Reusable custom hook +// PASS: GOOD: Reusable custom hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -207,25 +207,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### 状態管理 ```typescript -// ✅ GOOD: Proper state updates +// PASS: GOOD: Proper state updates const [count, setCount] = useState(0) // Functional update for state based on previous state setCount(prev => prev + 1) -// ❌ BAD: Direct state reference +// FAIL: BAD: Direct state reference setCount(count + 1) // Can be stale in async scenarios ``` ### 条件付きレンダリング ```typescript -// ✅ GOOD: Clear conditional rendering +// PASS: GOOD: Clear conditional rendering {isLoading && } {error && } {data && } -// ❌ BAD: Ternary hell +// FAIL: BAD: Ternary hell {isLoading ? : error ? : data ? : null} ``` @@ -248,7 +248,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### レスポンス形式 ```typescript -// ✅ GOOD: Consistent response structure +// PASS: GOOD: Consistent response structure interface ApiResponse { success: boolean data?: T @@ -279,7 +279,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ GOOD: Schema validation +// PASS: GOOD: Schema validation const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -342,14 +342,14 @@ types/market.types.ts # 型定義は .types サフィックス付き cam ### コメントを追加するタイミング ```typescript -// ✅ GOOD: Explain WHY, not WHAT +// PASS: GOOD: Explain WHY, not WHAT // Use exponential backoff to avoid overwhelming the API during outages const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Deliberately using mutation here for performance with large arrays items.push(newItem) -// ❌ BAD: Stating the obvious +// FAIL: BAD: Stating the obvious // Increment counter by 1 count++ @@ -389,12 +389,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ GOOD: Memoize expensive computations +// PASS: GOOD: Memoize expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ GOOD: Memoize callbacks +// PASS: GOOD: Memoize callbacks const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -405,7 +405,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ GOOD: Lazy load heavy components +// PASS: GOOD: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -420,13 +420,13 @@ export function Dashboard() { ### データベースクエリ ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -453,12 +453,12 @@ test('calculates similarity correctly', () => { ### テストの命名 ```typescript -// ✅ GOOD: Descriptive test names +// PASS: GOOD: Descriptive test names test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ BAD: Vague test names +// FAIL: BAD: Vague test names test('works', () => { }) test('test search', () => { }) ``` @@ -470,12 +470,12 @@ test('test search', () => { }) ### 1. 長い関数 ```typescript -// ❌ BAD: Function > 50 lines +// FAIL: BAD: Function > 50 lines function processMarketData() { // 100 lines of code } -// ✅ GOOD: Split into smaller functions +// PASS: GOOD: Split into smaller functions function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -486,7 +486,7 @@ function processMarketData() { ### 2. 深いネスト ```typescript -// ❌ BAD: 5+ levels of nesting +// FAIL: BAD: 5+ levels of nesting if (user) { if (user.isAdmin) { if (market) { @@ -499,7 +499,7 @@ if (user) { } } -// ✅ GOOD: Early returns +// PASS: GOOD: Early returns if (!user) return if (!user.isAdmin) return if (!market) return @@ -512,11 +512,11 @@ if (!hasPermission) return ### 3. マジックナンバー ```typescript -// ❌ BAD: Unexplained numbers +// FAIL: BAD: Unexplained numbers if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ GOOD: Named constants +// PASS: GOOD: Named constants const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/docs/ja-JP/skills/django-verification/SKILL.md b/docs/ja-JP/skills/django-verification/SKILL.md index a784befa..ea53864f 100644 --- a/docs/ja-JP/skills/django-verification/SKILL.md +++ b/docs/ja-JP/skills/django-verification/SKILL.md @@ -348,7 +348,7 @@ DJANGO 検証レポート ✓ ハードコードされたシークレットなし ✓ マイグレーションが含まれる -推奨: ⚠️ デプロイ前にpip-auditの脆弱性を修正してください +推奨: WARNING: デプロイ前にpip-auditの脆弱性を修正してください 次のステップ: 1. 脆弱な依存関係を更新 diff --git a/docs/ja-JP/skills/frontend-patterns/SKILL.md b/docs/ja-JP/skills/frontend-patterns/SKILL.md index 923eae05..e196d65a 100644 --- a/docs/ja-JP/skills/frontend-patterns/SKILL.md +++ b/docs/ja-JP/skills/frontend-patterns/SKILL.md @@ -12,7 +12,7 @@ React、Next.js、高性能ユーザーインターフェースのためのモ ### 継承よりコンポジション ```typescript -// ✅ GOOD: Component composition +// PASS: GOOD: Component composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -283,17 +283,17 @@ export function useMarkets() { ### メモ化 ```typescript -// ✅ useMemo for expensive computations +// PASS: useMemo for expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback for functions passed to children +// PASS: useCallback for functions passed to children const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo for pure components +// PASS: React.memo for pure components export const MarketCard = React.memo(({ market }) => { return (
@@ -309,7 +309,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Lazy load heavy components +// PASS: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -504,7 +504,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ List animations +// PASS: List animations export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -523,7 +523,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animations +// PASS: Modal animations export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/docs/ja-JP/skills/iterative-retrieval/SKILL.md b/docs/ja-JP/skills/iterative-retrieval/SKILL.md index 578c79e9..27931ff5 100644 --- a/docs/ja-JP/skills/iterative-retrieval/SKILL.md +++ b/docs/ja-JP/skills/iterative-retrieval/SKILL.md @@ -27,12 +27,12 @@ description: サブエージェントのコンテキスト問題を解決する ┌─────────────────────────────────────────────┐ │ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ DISPATCH │─────▶│ EVALUATE │ │ +│ │ DISPATCH │─────│ EVALUATE │ │ │ └──────────┘ └──────────┘ │ │ ▲ │ │ │ │ ▼ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ LOOP │◀─────│ REFINE │ │ +│ │ LOOP │─────│ REFINE │ │ │ └──────────┘ └──────────┘ │ │ │ │ 最大3サイクル、その後続行 │ diff --git a/docs/ja-JP/skills/java-coding-standards/SKILL.md b/docs/ja-JP/skills/java-coding-standards/SKILL.md index 50062113..80f98ceb 100644 --- a/docs/ja-JP/skills/java-coding-standards/SKILL.md +++ b/docs/ja-JP/skills/java-coding-standards/SKILL.md @@ -17,22 +17,22 @@ Spring Bootサービスにおける読みやすく保守可能なJava(17+)コー ## 命名 ```java -// ✅ クラス/レコード: PascalCase +// PASS: クラス/レコード: PascalCase public class MarketService {} public record Money(BigDecimal amount, Currency currency) {} -// ✅ メソッド/フィールド: camelCase +// PASS: メソッド/フィールド: camelCase private final MarketRepository marketRepository; public Market findBySlug(String slug) {} -// ✅ 定数: UPPER_SNAKE_CASE +// PASS: 定数: UPPER_SNAKE_CASE private static final int MAX_PAGE_SIZE = 100; ``` ## 不変性 ```java -// ✅ recordとfinalフィールドを優先 +// PASS: recordとfinalフィールドを優先 public record MarketDto(Long id, String name, MarketStatus status) {} public class Market { @@ -45,10 +45,10 @@ public class Market { ## Optionalの使用 ```java -// ✅ find*メソッドからOptionalを返す +// PASS: find*メソッドからOptionalを返す Optional market = marketRepository.findBySlug(slug); -// ✅ get()の代わりにmap/flatMapを使用 +// PASS: get()の代わりにmap/flatMapを使用 return market .map(MarketResponse::from) .orElseThrow(() -> new EntityNotFoundException("Market not found")); @@ -57,13 +57,13 @@ return market ## ストリームのベストプラクティス ```java -// ✅ 変換にストリームを使用し、パイプラインを短く保つ +// PASS: 変換にストリームを使用し、パイプラインを短く保つ List names = markets.stream() .map(Market::name) .filter(Objects::nonNull) .toList(); -// ❌ 複雑なネストされたストリームを避ける; 明確性のためにループを優先 +// FAIL: 複雑なネストされたストリームを避ける; 明確性のためにループを優先 ``` ## 例外 diff --git a/docs/ja-JP/skills/security-review/SKILL.md b/docs/ja-JP/skills/security-review/SKILL.md index b19da325..7d34514c 100644 --- a/docs/ja-JP/skills/security-review/SKILL.md +++ b/docs/ja-JP/skills/security-review/SKILL.md @@ -21,13 +21,13 @@ description: 認証の追加、ユーザー入力の処理、シークレット ### 1. シークレット管理 -#### ❌ 絶対にしないこと +#### FAIL: 絶対にしないこと ```typescript const apiKey = "sk-proj-xxxxx" // ハードコードされたシークレット const dbPassword = "password123" // ソースコード内 ``` -#### ✅ 常にすること +#### PASS: 常にすること ```typescript const apiKey = process.env.OPENAI_API_KEY const dbUrl = process.env.DATABASE_URL @@ -107,14 +107,14 @@ function validateFileUpload(file: File) { ### 3. SQLインジェクション防止 -#### ❌ 絶対にSQLを連結しない +#### FAIL: 絶対にSQLを連結しない ```typescript // 危険 - SQLインジェクションの脆弱性 const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ 常にパラメータ化されたクエリを使用 +#### PASS: 常にパラメータ化されたクエリを使用 ```typescript // 安全 - パラメータ化されたクエリ const { data } = await supabase @@ -139,10 +139,10 @@ await db.query( #### JWTトークン処理 ```typescript -// ❌ 誤り:localStorage(XSSに脆弱) +// FAIL: 誤り:localStorage(XSSに脆弱) localStorage.setItem('token', token) -// ✅ 正解:httpOnly Cookie +// PASS: 正解:httpOnly Cookie res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -299,18 +299,18 @@ app.use('/api/search', searchLimiter) #### ロギング ```typescript -// ❌ 誤り:機密データをログに記録 +// FAIL: 誤り:機密データをログに記録 console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ 正解:機密データを編集 +// PASS: 正解:機密データを編集 console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### エラーメッセージ ```typescript -// ❌ 誤り:内部詳細を露出 +// FAIL: 誤り:内部詳細を露出 catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -318,7 +318,7 @@ catch (error) { ) } -// ✅ 正解:一般的なエラーメッセージ +// PASS: 正解:一般的なエラーメッセージ catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/docs/ja-JP/skills/security-review/cloud-infrastructure-security.md b/docs/ja-JP/skills/security-review/cloud-infrastructure-security.md index 61dc84e1..9f7a2df8 100644 --- a/docs/ja-JP/skills/security-review/cloud-infrastructure-security.md +++ b/docs/ja-JP/skills/security-review/cloud-infrastructure-security.md @@ -24,7 +24,7 @@ #### 最小権限の原則 ```yaml -# ✅ 正解:最小限の権限 +# PASS: 正解:最小限の権限 iam_role: permissions: - s3:GetObject # 読み取りアクセスのみ @@ -32,7 +32,7 @@ iam_role: resources: - arn:aws:s3:::my-bucket/* # 特定のバケットのみ -# ❌ 誤り:過度に広範な権限 +# FAIL: 誤り:過度に広範な権限 iam_role: permissions: - s3:* # すべてのS3アクション @@ -65,14 +65,14 @@ aws iam enable-mfa-device \ #### クラウドシークレットマネージャー ```typescript -// ✅ 正解:クラウドシークレットマネージャーを使用 +// PASS: 正解:クラウドシークレットマネージャーを使用 import { SecretsManager } from '@aws-sdk/client-secrets-manager'; const client = new SecretsManager({ region: 'us-east-1' }); const secret = await client.getSecretValue({ SecretId: 'prod/api-key' }); const apiKey = JSON.parse(secret.SecretString).key; -// ❌ 誤り:ハードコードまたは環境変数のみ +// FAIL: 誤り:ハードコードまたは環境変数のみ const apiKey = process.env.API_KEY; // ローテーションされず、監査されない ``` @@ -99,7 +99,7 @@ aws secretsmanager rotate-secret \ #### VPCとファイアウォール設定 ```terraform -# ✅ 正解:制限されたセキュリティグループ +# PASS: 正解:制限されたセキュリティグループ resource "aws_security_group" "app" { name = "app-sg" @@ -118,7 +118,7 @@ resource "aws_security_group" "app" { } } -# ❌ 誤り:インターネットに公開 +# FAIL: 誤り:インターネットに公開 resource "aws_security_group" "bad" { ingress { from_port = 0 @@ -142,7 +142,7 @@ resource "aws_security_group" "bad" { #### CloudWatch/ロギング設定 ```typescript -// ✅ 正解:包括的なロギング +// PASS: 正解:包括的なロギング import { CloudWatchLogsClient, CreateLogStreamCommand } from '@aws-sdk/client-cloudwatch-logs'; const logSecurityEvent = async (event: SecurityEvent) => { @@ -177,7 +177,7 @@ const logSecurityEvent = async (event: SecurityEvent) => { #### 安全なパイプライン設定 ```yaml -# ✅ 正解:安全なGitHub Actionsワークフロー +# PASS: 正解:安全なGitHub Actionsワークフロー name: Deploy on: @@ -237,7 +237,7 @@ jobs: #### Cloudflareセキュリティ設定 ```typescript -// ✅ 正解:セキュリティヘッダー付きCloudflare Workers +// PASS: 正解:セキュリティヘッダー付きCloudflare Workers export default { async fetch(request: Request): Promise { const response = await fetch(request); @@ -281,7 +281,7 @@ export default { #### 自動バックアップ ```terraform -# ✅ 正解:自動RDSバックアップ +# PASS: 正解:自動RDSバックアップ resource "aws_db_instance" "main" { allocated_storage = 20 engine = "postgres" @@ -327,10 +327,10 @@ resource "aws_db_instance" "main" { ### S3バケットの露出 ```bash -# ❌ 誤り:公開バケット +# FAIL: 誤り:公開バケット aws s3api put-bucket-acl --bucket my-bucket --acl public-read -# ✅ 正解:特定のアクセス付きプライベートバケット +# PASS: 正解:特定のアクセス付きプライベートバケット aws s3api put-bucket-acl --bucket my-bucket --acl private aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ``` @@ -338,12 +338,12 @@ aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ### RDS公開アクセス ```terraform -# ❌ 誤り +# FAIL: 誤り resource "aws_db_instance" "bad" { publicly_accessible = true # 絶対にこれをしない! } -# ✅ 正解 +# PASS: 正解 resource "aws_db_instance" "good" { publicly_accessible = false vpc_security_group_ids = [aws_security_group.db.id] diff --git a/docs/ja-JP/skills/tdd-workflow/SKILL.md b/docs/ja-JP/skills/tdd-workflow/SKILL.md index 48a4a59c..45e8eac5 100644 --- a/docs/ja-JP/skills/tdd-workflow/SKILL.md +++ b/docs/ja-JP/skills/tdd-workflow/SKILL.md @@ -313,39 +313,39 @@ npm run test:coverage ## 避けるべき一般的なテストの誤り -### ❌ 誤り:実装の詳細をテスト +### FAIL: 誤り:実装の詳細をテスト ```typescript // 内部状態をテストしない expect(component.state.count).toBe(5) ``` -### ✅ 正解:ユーザーに見える動作をテスト +### PASS: 正解:ユーザーに見える動作をテスト ```typescript // ユーザーが見るものをテスト expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ 誤り:脆弱なセレクタ +### FAIL: 誤り:脆弱なセレクタ ```typescript // 簡単に壊れる await page.click('.css-class-xyz') ``` -### ✅ 正解:セマンティックセレクタ +### PASS: 正解:セマンティックセレクタ ```typescript // 変更に強い await page.click('button:has-text("Submit")') await page.click('[data-testid="submit-button"]') ``` -### ❌ 誤り:テストの分離なし +### FAIL: 誤り:テストの分離なし ```typescript // テストが互いに依存 test('creates user', () => { /* ... */ }) test('updates same user', () => { /* 前のテストに依存 */ }) ``` -### ✅ 正解:独立したテスト +### PASS: 正解:独立したテスト ```typescript // 各テストが独自のデータをセットアップ test('creates user', () => { diff --git a/docs/ko-KR/README.md b/docs/ko-KR/README.md index 6dc2d25d..b06781cd 100644 --- a/docs/ko-KR/README.md +++ b/docs/ko-KR/README.md @@ -22,7 +22,7 @@
-**🌐 Language / 语言 / 語言 / 언어** +**Language / 语言 / 語言 / 언어** [**English**](../../README.md) | [简体中文](../../README.zh-CN.md) | [繁體中文](../zh-TW/README.md) | [日本語](../ja-JP/README.md) | [한국어](README.md) @@ -104,7 +104,7 @@ --- -## 🚀 빠른 시작 +## 빠른 시작 2분 안에 설정 완료: @@ -120,7 +120,7 @@ ### 2단계: 룰 설치 (필수) -> ⚠️ **중요:** Claude Code 플러그인은 `rules`를 자동으로 배포할 수 없습니다. 수동으로 설치해야 합니다: +> WARNING: **중요:** Claude Code 플러그인은 `rules`를 자동으로 배포할 수 없습니다. 수동으로 설치해야 합니다: ```bash # 먼저 저장소 클론 @@ -150,11 +150,11 @@ cd everything-claude-code /plugin list everything-claude-code@everything-claude-code ``` -✨ **끝!** 이제 16개 에이전트, 65개 스킬, 40개 커맨드를 사용할 수 있습니다. +**끝!** 이제 16개 에이전트, 65개 스킬, 40개 커맨드를 사용할 수 있습니다. --- -## 🌐 크로스 플랫폼 지원 +## 크로스 플랫폼 지원 이 플러그인은 **Windows, macOS, Linux**를 완벽하게 지원하며, 주요 IDE(Cursor, OpenCode, Antigravity) 및 CLI 하네스와 긴밀하게 통합됩니다. 모든 훅과 스크립트는 최대 호환성을 위해 Node.js로 작성되었습니다. @@ -201,7 +201,7 @@ export ECC_DISABLED_HOOKS="pre:bash:tmux-reminder,post:edit:typecheck" --- -## 📦 구성 요소 +## 구성 요소 이 저장소는 **Claude Code 플러그인**입니다 - 직접 설치하거나 컴포넌트를 수동으로 복사할 수 있습니다. @@ -263,7 +263,7 @@ everything-claude-code/ --- -## 🛠️ 에코시스템 도구 +## 에코시스템 도구 ### Skill Creator @@ -314,7 +314,7 @@ Claude Code에서 `/security-scan`을 사용하거나, [GitHub Action](https://g [GitHub](https://github.com/affaan-m/agentshield) | [npm](https://www.npmjs.com/package/ecc-agentshield) -### 🧠 지속적 학습 v2 +### 지속적 학습 v2 직관(Instinct) 기반 학습 시스템이 여러분의 패턴을 자동으로 학습합니다: @@ -329,7 +329,7 @@ Claude Code에서 `/security-scan`을 사용하거나, [GitHub Action](https://g --- -## 📋 요구 사항 +## 요구 사항 ### Claude Code CLI 버전 @@ -344,13 +344,13 @@ claude --version ### 중요: 훅 자동 로딩 동작 -> ⚠️ **기여자 참고:** `.claude-plugin/plugin.json`에 `"hooks"` 필드를 추가하지 **마세요**. 회귀 테스트로 이를 강제합니다. +> WARNING: **기여자 참고:** `.claude-plugin/plugin.json`에 `"hooks"` 필드를 추가하지 **마세요**. 회귀 테스트로 이를 강제합니다. Claude Code v2.1+는 설치된 플러그인의 `hooks/hooks.json`을 **자동으로 로드**합니다. 명시적으로 선언하면 중복 감지 오류가 발생합니다. --- -## 📥 설치 +## 설치 ### 옵션 1: 플러그인으로 설치 (권장) @@ -397,7 +397,7 @@ Claude Code v2.1+는 설치된 플러그인의 `hooks/hooks.json`을 **자동으 --- -### 🔧 옵션 2: 수동 설치 +### 옵션 2: 수동 설치 설치할 항목을 직접 선택하고 싶다면: @@ -422,7 +422,7 @@ cp -r everything-claude-code/skills/search-first ~/.claude/skills/ --- -## 🎯 핵심 개념 +## 핵심 개념 ### 에이전트 @@ -483,7 +483,7 @@ rules/ --- -## 🗺️ 어떤 에이전트를 사용해야 할까? +## 어떤 에이전트를 사용해야 할까? 어디서 시작해야 할지 모르겠다면 이 참고표를 보세요: @@ -529,7 +529,7 @@ rules/ --- -## ❓ FAQ +## FAQ
설치된 에이전트/커맨드 확인은 어떻게 하나요? @@ -602,7 +602,7 @@ cp -r everything-claude-code/rules/common/* ~/.claude/rules/ --- -## 🧪 테스트 실행 +## 테스트 실행 ```bash # 모든 테스트 실행 @@ -616,7 +616,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 기여하기 +## 기여하기 **기여를 환영합니다.** @@ -687,7 +687,7 @@ Claude Code 사용 비용이 부담된다면 토큰 소비를 관리해야 합 --- -## ⚠️ 중요 참고 사항 +## WARNING: 중요 참고 사항 ### 커스터마이징 @@ -699,7 +699,7 @@ Claude Code 사용 비용이 부담된다면 토큰 소비를 관리해야 합 --- -## 💜 스폰서 +## 스폰서 이 프로젝트는 무료 오픈소스입니다. 스폰서의 지원으로 유지보수와 성장이 이루어집니다. @@ -707,13 +707,13 @@ Claude Code 사용 비용이 부담된다면 토큰 소비를 관리해야 합 --- -## 🌟 Star 히스토리 +## Star 히스토리 [![Star History Chart](https://api.star-history.com/svg?repos=affaan-m/everything-claude-code&type=Date)](https://star-history.com/#affaan-m/everything-claude-code&Date) --- -## 🔗 링크 +## 링크 - **요약 가이드 (여기서 시작):** [The Shorthand Guide to Everything Claude Code](https://x.com/affaanmustafa/status/2012378465664745795) - **상세 가이드 (고급):** [The Longform Guide to Everything Claude Code](https://x.com/affaanmustafa/status/2014040193557471352) @@ -722,7 +722,7 @@ Claude Code 사용 비용이 부담된다면 토큰 소비를 관리해야 합 --- -## 📄 라이선스 +## 라이선스 MIT - 자유롭게 사용하고, 필요에 따라 수정하고, 가능하다면 기여해 주세요. diff --git a/docs/ko-KR/commands/e2e.md b/docs/ko-KR/commands/e2e.md index 442fcfd7..e12588ed 100644 --- a/docs/ko-KR/commands/e2e.md +++ b/docs/ko-KR/commands/e2e.md @@ -182,7 +182,7 @@ Running 3 tests using 3 workers ╔══════════════════════════════════════════════════════════════╗ ║ E2E 테스트 결과 ║ ╠══════════════════════════════════════════════════════════════╣ -║ 상태: ✅ 모든 테스트 통과 ║ +║ 상태: PASS: 모든 테스트 통과 ║ ║ 전체: 3개 테스트 ║ ║ 통과: 3 (100%) ║ ║ 실패: 0 ║ @@ -191,15 +191,15 @@ Running 3 tests using 3 workers ╚══════════════════════════════════════════════════════════════╝ 아티팩트: -📸 스크린샷: 2개 파일 -📹 비디오: 0개 파일 (실패 시에만) -🔍 트레이스: 0개 파일 (실패 시에만) -📊 HTML 보고서: playwright-report/index.html + 스크린샷: 2개 파일 + 비디오: 0개 파일 (실패 시에만) + 트레이스: 0개 파일 (실패 시에만) + HTML 보고서: playwright-report/index.html 보고서 확인: npx playwright show-report ``` -✅ CI/CD 통합 준비가 완료된 E2E 테스트 모음! +PASS: CI/CD 통합 준비가 완료된 E2E 테스트 모음! ```` ## 테스트 아티팩트 @@ -235,7 +235,7 @@ open artifacts/search-results.png 테스트가 간헐적으로 실패하는 경우: ``` -⚠️ 불안정한 테스트 감지됨: tests/e2e/markets/trade.spec.ts +WARNING: 불안정한 테스트 감지됨: tests/e2e/markets/trade.spec.ts 테스트가 10회 중 7회 통과 (70% 통과율) diff --git a/docs/ko-KR/commands/go-build.md b/docs/ko-KR/commands/go-build.md index 64ea0e06..07a377b3 100644 --- a/docs/ko-KR/commands/go-build.md +++ b/docs/ko-KR/commands/go-build.md @@ -140,7 +140,7 @@ ok project/internal/handler 0.023s | 수정된 파일 | 2 | | 남은 이슈 | 0 | -Build 상태: ✅ 성공 +Build 상태: PASS: 성공 ```` ## 자주 발생하는 에러 diff --git a/docs/ko-KR/commands/go-review.md b/docs/ko-KR/commands/go-review.md index f12a3989..d70974e7 100644 --- a/docs/ko-KR/commands/go-review.md +++ b/docs/ko-KR/commands/go-review.md @@ -124,16 +124,16 @@ return fmt.Errorf("get user %s: %w", userID, err) - HIGH: 1 - MEDIUM: 0 -권장: ❌ CRITICAL 이슈가 수정될 때까지 merge 차단 +권장: FAIL: CRITICAL 이슈가 수정될 때까지 merge 차단 ```` ## 승인 기준 | 상태 | 조건 | |------|------| -| ✅ 승인 | CRITICAL 또는 HIGH 이슈 없음 | -| ⚠️ 경고 | MEDIUM 이슈만 있음 (주의하여 merge) | -| ❌ 차단 | CRITICAL 또는 HIGH 이슈 발견 | +| PASS: 승인 | CRITICAL 또는 HIGH 이슈 없음 | +| WARNING: 경고 | MEDIUM 이슈만 있음 (주의하여 merge) | +| FAIL: 차단 | CRITICAL 또는 HIGH 이슈 발견 | ## 다른 커맨드와의 연동 diff --git a/docs/ko-KR/commands/refactor-clean.md b/docs/ko-KR/commands/refactor-clean.md index 0ab81fe7..54d49cde 100644 --- a/docs/ko-KR/commands/refactor-clean.md +++ b/docs/ko-KR/commands/refactor-clean.md @@ -69,7 +69,7 @@ Dead Code Cleanup 건너뜀: 항목 2개 (테스트 실패) 절감: 약 450줄 제거 ────────────────────────────── -모든 테스트 통과 ✅ +모든 테스트 통과 PASS: ``` ## 규칙 diff --git a/docs/ko-KR/commands/tdd.md b/docs/ko-KR/commands/tdd.md index cf21ee23..5dc1ba80 100644 --- a/docs/ko-KR/commands/tdd.md +++ b/docs/ko-KR/commands/tdd.md @@ -133,7 +133,7 @@ FAIL lib/liquidity.test.ts 1 test failed, 0 passed ``` -✅ 예상대로 테스트 실패. 구현 준비 완료. +PASS: 예상대로 테스트 실패. 구현 준비 완료. ## 4단계: 최소한의 코드 구현 (GREEN) @@ -179,7 +179,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ 모든 테스트 통과! +PASS: 모든 테스트 통과! ## 6단계: 리팩토링 (IMPROVE) @@ -236,7 +236,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ 리팩토링 완료, 테스트 여전히 통과! +PASS: 리팩토링 완료, 테스트 여전히 통과! ## 8단계: 커버리지 확인 @@ -247,10 +247,10 @@ File | % Stmts | % Branch | % Funcs | % Lines ---------------|---------|----------|---------|-------- liquidity.ts | 100 | 100 | 100 | 100 -Coverage: 100% ✅ (목표: 80%) +Coverage: 100% PASS: (목표: 80%) ``` -✅ TDD 세션 완료! +PASS: TDD 세션 완료! ```` ## TDD 모범 사례 diff --git a/docs/ko-KR/commands/test-coverage.md b/docs/ko-KR/commands/test-coverage.md index 7eb8b8b3..65069d31 100644 --- a/docs/ko-KR/commands/test-coverage.md +++ b/docs/ko-KR/commands/test-coverage.md @@ -62,7 +62,7 @@ description: 테스트 커버리지를 분석하고, 80% 이상을 목표로 누 src/services/auth.ts 45% 88% src/utils/validation.ts 32% 82% ────────────────────────────── -전체: 67% 84% ✅ +전체: 67% 84% PASS: ``` ## 집중 영역 diff --git a/docs/ko-KR/skills/backend-patterns/SKILL.md b/docs/ko-KR/skills/backend-patterns/SKILL.md index b0f45a10..bb964234 100644 --- a/docs/ko-KR/skills/backend-patterns/SKILL.md +++ b/docs/ko-KR/skills/backend-patterns/SKILL.md @@ -23,7 +23,7 @@ origin: ECC ### RESTful API 구조 ```typescript -// ✅ Resource-based URLs +// PASS: Resource-based URLs GET /api/markets # List resources GET /api/markets/:id # Get single resource POST /api/markets # Create resource @@ -31,7 +31,7 @@ PUT /api/markets/:id # Replace resource PATCH /api/markets/:id # Update resource DELETE /api/markets/:id # Delete resource -// ✅ Query parameters for filtering, sorting, pagination +// PASS: Query parameters for filtering, sorting, pagination GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -132,7 +132,7 @@ export default withAuth(async (req, res) => { ### 쿼리 최적화 ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -140,7 +140,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -149,13 +149,13 @@ const { data } = await supabase ### N+1 쿼리 방지 ```typescript -// ❌ BAD: N+1 query problem +// FAIL: BAD: N+1 query problem const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N queries } -// ✅ GOOD: Batch fetch +// PASS: GOOD: Batch fetch const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 query diff --git a/docs/ko-KR/skills/clickhouse-io/SKILL.md b/docs/ko-KR/skills/clickhouse-io/SKILL.md index 02427247..06960402 100644 --- a/docs/ko-KR/skills/clickhouse-io/SKILL.md +++ b/docs/ko-KR/skills/clickhouse-io/SKILL.md @@ -96,7 +96,7 @@ ORDER BY hour DESC; ### 효율적인 필터링 ```sql --- ✅ 좋음: 인덱스된 컬럼을 먼저 사용 +-- PASS: 좋음: 인덱스된 컬럼을 먼저 사용 SELECT * FROM markets_analytics WHERE date >= '2025-01-01' @@ -105,7 +105,7 @@ WHERE date >= '2025-01-01' ORDER BY date DESC LIMIT 100; --- ❌ 나쁨: 비인덱스 컬럼을 먼저 필터링 +-- FAIL: 나쁨: 비인덱스 컬럼을 먼저 필터링 SELECT * FROM markets_analytics WHERE volume > 1000 @@ -116,7 +116,7 @@ WHERE volume > 1000 ### 집계 ```sql --- ✅ 좋음: ClickHouse 전용 집계 함수를 사용 +-- PASS: 좋음: ClickHouse 전용 집계 함수를 사용 SELECT toStartOfDay(created_at) AS day, market_id, @@ -129,7 +129,7 @@ WHERE created_at >= today() - INTERVAL 7 DAY GROUP BY day, market_id ORDER BY day DESC, total_volume DESC; --- ✅ 백분위수에는 quantile 사용 (percentile보다 효율적) +-- PASS: 백분위수에는 quantile 사용 (percentile보다 효율적) SELECT quantile(0.50)(trade_size) AS median, quantile(0.95)(trade_size) AS p95, @@ -172,7 +172,7 @@ const clickhouse = new ClickHouse({ } }) -// ✅ 배치 삽입 (효율적) +// PASS: 배치 삽입 (효율적) async function bulkInsertTrades(trades: Trade[]) { const rows = trades.map(trade => ({ id: trade.id, @@ -185,7 +185,7 @@ async function bulkInsertTrades(trades: Trade[]) { await clickhouse.insert('trades', rows) } -// ❌ 개별 삽입 (느림) +// FAIL: 개별 삽입 (느림) async function insertTrade(trade: Trade) { // 루프 안에서 이렇게 하지 마세요! await clickhouse.query(` diff --git a/docs/ko-KR/skills/coding-standards/SKILL.md b/docs/ko-KR/skills/coding-standards/SKILL.md index 1fbabe7d..7dbd27d2 100644 --- a/docs/ko-KR/skills/coding-standards/SKILL.md +++ b/docs/ko-KR/skills/coding-standards/SKILL.md @@ -48,12 +48,12 @@ origin: ECC ### 변수 네이밍 ```typescript -// ✅ GOOD: Descriptive names +// PASS: GOOD: Descriptive names const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ BAD: Unclear names +// FAIL: BAD: Unclear names const q = 'election' const flag = true const x = 1000 @@ -62,12 +62,12 @@ const x = 1000 ### 함수 네이밍 ```typescript -// ✅ GOOD: Verb-noun pattern +// PASS: GOOD: Verb-noun pattern async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ BAD: Unclear or noun-only +// FAIL: BAD: Unclear or noun-only async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -76,7 +76,7 @@ function email(e) { } ### 불변성 패턴 (필수) ```typescript -// ✅ ALWAYS use spread operator +// PASS: ALWAYS use spread operator const updatedUser = { ...user, name: 'New Name' @@ -84,7 +84,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ NEVER mutate directly +// FAIL: NEVER mutate directly user.name = 'New Name' // BAD items.push(newItem) // BAD ``` @@ -92,7 +92,7 @@ items.push(newItem) // BAD ### 에러 처리 ```typescript -// ✅ GOOD: Comprehensive error handling +// PASS: GOOD: Comprehensive error handling async function fetchData(url: string) { try { const response = await fetch(url) @@ -108,7 +108,7 @@ async function fetchData(url: string) { } } -// ❌ BAD: No error handling +// FAIL: BAD: No error handling async function fetchData(url) { const response = await fetch(url) return response.json() @@ -118,14 +118,14 @@ async function fetchData(url) { ### Async/Await 모범 사례 ```typescript -// ✅ GOOD: Parallel execution when possible +// PASS: GOOD: Parallel execution when possible const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ BAD: Sequential when unnecessary +// FAIL: BAD: Sequential when unnecessary const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -134,7 +134,7 @@ const stats = await fetchStats() ### 타입 안전성 ```typescript -// ✅ GOOD: Proper types +// PASS: GOOD: Proper types interface Market { id: string name: string @@ -146,7 +146,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ BAD: Using 'any' +// FAIL: BAD: Using 'any' function getMarket(id: any): Promise { // Implementation } @@ -157,7 +157,7 @@ function getMarket(id: any): Promise { ### 컴포넌트 구조 ```typescript -// ✅ GOOD: Functional component with types +// PASS: GOOD: Functional component with types interface ButtonProps { children: React.ReactNode onClick: () => void @@ -182,7 +182,7 @@ export function Button({ ) } -// ❌ BAD: No types, unclear structure +// FAIL: BAD: No types, unclear structure export function Button(props) { return } @@ -191,7 +191,7 @@ export function Button(props) { ### 커스텀 Hook ```typescript -// ✅ GOOD: Reusable custom hook +// PASS: GOOD: Reusable custom hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -213,25 +213,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### 상태 관리 ```typescript -// ✅ GOOD: Proper state updates +// PASS: GOOD: Proper state updates const [count, setCount] = useState(0) // Functional update for state based on previous state setCount(prev => prev + 1) -// ❌ BAD: Direct state reference +// FAIL: BAD: Direct state reference setCount(count + 1) // Can be stale in async scenarios ``` ### 조건부 렌더링 ```typescript -// ✅ GOOD: Clear conditional rendering +// PASS: GOOD: Clear conditional rendering {isLoading && } {error && } {data && } -// ❌ BAD: Ternary hell +// FAIL: BAD: Ternary hell {isLoading ? : error ? : data ? : null} ``` @@ -254,7 +254,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### 응답 형식 ```typescript -// ✅ GOOD: Consistent response structure +// PASS: GOOD: Consistent response structure interface ApiResponse { success: boolean data?: T @@ -285,7 +285,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ GOOD: Schema validation +// PASS: GOOD: Schema validation const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -348,14 +348,14 @@ types/market.types.ts # camelCase with .types suffix ### 주석을 작성해야 하는 경우 ```typescript -// ✅ GOOD: Explain WHY, not WHAT +// PASS: GOOD: Explain WHY, not WHAT // Use exponential backoff to avoid overwhelming the API during outages const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Deliberately using mutation here for performance with large arrays items.push(newItem) -// ❌ BAD: Stating the obvious +// FAIL: BAD: Stating the obvious // Increment counter by 1 count++ @@ -395,12 +395,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ GOOD: Memoize expensive computations +// PASS: GOOD: Memoize expensive computations const sortedMarkets = useMemo(() => { return [...markets].sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ GOOD: Memoize callbacks +// PASS: GOOD: Memoize callbacks const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -411,7 +411,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ GOOD: Lazy load heavy components +// PASS: GOOD: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -426,13 +426,13 @@ export function Dashboard() { ### 데이터베이스 쿼리 ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -459,12 +459,12 @@ test('calculates similarity correctly', () => { ### 테스트 네이밍 ```typescript -// ✅ GOOD: Descriptive test names +// PASS: GOOD: Descriptive test names test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ BAD: Vague test names +// FAIL: BAD: Vague test names test('works', () => { }) test('test search', () => { }) ``` @@ -475,12 +475,12 @@ test('test search', () => { }) ### 1. 긴 함수 ```typescript -// ❌ BAD: Function > 50 lines +// FAIL: BAD: Function > 50 lines function processMarketData() { // 100 lines of code } -// ✅ GOOD: Split into smaller functions +// PASS: GOOD: Split into smaller functions function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -490,7 +490,7 @@ function processMarketData() { ### 2. 깊은 중첩 ```typescript -// ❌ BAD: 5+ levels of nesting +// FAIL: BAD: 5+ levels of nesting if (user) { if (user.isAdmin) { if (market) { @@ -503,7 +503,7 @@ if (user) { } } -// ✅ GOOD: Early returns +// PASS: GOOD: Early returns if (!user) return if (!user.isAdmin) return if (!market) return @@ -515,11 +515,11 @@ if (!hasPermission) return ### 3. 매직 넘버 ```typescript -// ❌ BAD: Unexplained numbers +// FAIL: BAD: Unexplained numbers if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ GOOD: Named constants +// PASS: GOOD: Named constants const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/docs/ko-KR/skills/frontend-patterns/SKILL.md b/docs/ko-KR/skills/frontend-patterns/SKILL.md index f384bc80..728c4e76 100644 --- a/docs/ko-KR/skills/frontend-patterns/SKILL.md +++ b/docs/ko-KR/skills/frontend-patterns/SKILL.md @@ -23,7 +23,7 @@ React, Next.js 및 고성능 사용자 인터페이스를 위한 모던 프론 ### 상속보다 합성 ```typescript -// ✅ GOOD: Component composition +// PASS: GOOD: Component composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -304,17 +304,17 @@ export function useMarkets() { ### 메모이제이션 ```typescript -// ✅ useMemo for expensive computations +// PASS: useMemo for expensive computations const sortedMarkets = useMemo(() => { return [...markets].sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback for functions passed to children +// PASS: useCallback for functions passed to children const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo for pure components +// PASS: React.memo for pure components export const MarketCard = React.memo(({ market }) => { return (
@@ -330,7 +330,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Lazy load heavy components +// PASS: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -525,7 +525,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ List animations +// PASS: List animations export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -544,7 +544,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animations +// PASS: Modal animations export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/docs/ko-KR/skills/iterative-retrieval/SKILL.md b/docs/ko-KR/skills/iterative-retrieval/SKILL.md index 2ab52325..ffaf57bb 100644 --- a/docs/ko-KR/skills/iterative-retrieval/SKILL.md +++ b/docs/ko-KR/skills/iterative-retrieval/SKILL.md @@ -36,12 +36,12 @@ origin: ECC ┌─────────────────────────────────────────────┐ │ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ DISPATCH │─────▶│ EVALUATE │ │ +│ │ DISPATCH │─────│ EVALUATE │ │ │ └──────────┘ └──────────┘ │ │ ▲ │ │ │ │ ▼ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ LOOP │◀─────│ REFINE │ │ +│ │ LOOP │─────│ REFINE │ │ │ └──────────┘ └──────────┘ │ │ │ │ Max 3 cycles, then proceed │ diff --git a/docs/ko-KR/skills/security-review/SKILL.md b/docs/ko-KR/skills/security-review/SKILL.md index 8dba9dbf..7e335594 100644 --- a/docs/ko-KR/skills/security-review/SKILL.md +++ b/docs/ko-KR/skills/security-review/SKILL.md @@ -140,10 +140,10 @@ await db.query( #### JWT 토큰 처리 ```typescript -// ❌ WRONG: localStorage (vulnerable to XSS) +// FAIL: WRONG: localStorage (vulnerable to XSS) localStorage.setItem('token', token) -// ✅ CORRECT: httpOnly cookies +// PASS: CORRECT: httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -302,18 +302,18 @@ app.use('/api/search', searchLimiter) #### 로깅 ```typescript -// ❌ WRONG: Logging sensitive data +// FAIL: WRONG: Logging sensitive data console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ CORRECT: Redact sensitive data +// PASS: CORRECT: Redact sensitive data console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### 에러 메시지 ```typescript -// ❌ WRONG: Exposing internal details +// FAIL: WRONG: Exposing internal details catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -321,7 +321,7 @@ catch (error) { ) } -// ✅ CORRECT: Generic error messages +// PASS: CORRECT: Generic error messages catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/docs/ko-KR/skills/security-review/cloud-infrastructure-security.md b/docs/ko-KR/skills/security-review/cloud-infrastructure-security.md index 183aa82d..e53598b9 100644 --- a/docs/ko-KR/skills/security-review/cloud-infrastructure-security.md +++ b/docs/ko-KR/skills/security-review/cloud-infrastructure-security.md @@ -24,7 +24,7 @@ #### 최소 권한 원칙 ```yaml -# ✅ CORRECT: Minimal permissions +# PASS: CORRECT: Minimal permissions iam_role: permissions: - s3:GetObject # Only read access @@ -32,7 +32,7 @@ iam_role: resources: - arn:aws:s3:::my-bucket/* # Specific bucket only -# ❌ WRONG: Overly broad permissions +# FAIL: WRONG: Overly broad permissions iam_role: permissions: - s3:* # All S3 actions @@ -65,14 +65,14 @@ aws iam enable-mfa-device \ #### 클라우드 시크릿 매니저 ```typescript -// ✅ CORRECT: Use cloud secrets manager +// PASS: CORRECT: Use cloud secrets manager import { SecretsManager } from '@aws-sdk/client-secrets-manager'; const client = new SecretsManager({ region: 'us-east-1' }); const secret = await client.getSecretValue({ SecretId: 'prod/api-key' }); const apiKey = JSON.parse(secret.SecretString).key; -// ❌ WRONG: Hardcoded or in environment variables only +// FAIL: WRONG: Hardcoded or in environment variables only const apiKey = process.env.API_KEY; // Not rotated, not audited ``` @@ -99,7 +99,7 @@ aws secretsmanager rotate-secret \ #### VPC 및 방화벽 구성 ```terraform -# ✅ CORRECT: Restricted security group +# PASS: CORRECT: Restricted security group resource "aws_security_group" "app" { name = "app-sg" @@ -118,7 +118,7 @@ resource "aws_security_group" "app" { } } -# ❌ WRONG: Open to the internet +# FAIL: WRONG: Open to the internet resource "aws_security_group" "bad" { ingress { from_port = 0 @@ -142,7 +142,7 @@ resource "aws_security_group" "bad" { #### CloudWatch/로깅 구성 ```typescript -// ✅ CORRECT: Comprehensive logging +// PASS: CORRECT: Comprehensive logging import { CloudWatchLogsClient, CreateLogStreamCommand } from '@aws-sdk/client-cloudwatch-logs'; const logSecurityEvent = async (event: SecurityEvent) => { @@ -177,7 +177,7 @@ const logSecurityEvent = async (event: SecurityEvent) => { #### 보안 파이프라인 구성 ```yaml -# ✅ CORRECT: Secure GitHub Actions workflow +# PASS: CORRECT: Secure GitHub Actions workflow name: Deploy on: @@ -237,7 +237,7 @@ jobs: #### Cloudflare 보안 구성 ```typescript -// ✅ CORRECT: Cloudflare Workers with security headers +// PASS: CORRECT: Cloudflare Workers with security headers export default { async fetch(request: Request): Promise { const response = await fetch(request); @@ -281,7 +281,7 @@ export default { #### 자동 백업 ```terraform -# ✅ CORRECT: Automated RDS backups +# PASS: CORRECT: Automated RDS backups resource "aws_db_instance" "main" { allocated_storage = 20 engine = "postgres" @@ -327,10 +327,10 @@ resource "aws_db_instance" "main" { ### S3 버킷 노출 ```bash -# ❌ WRONG: Public bucket +# FAIL: WRONG: Public bucket aws s3api put-bucket-acl --bucket my-bucket --acl public-read -# ✅ CORRECT: Private bucket with specific access +# PASS: CORRECT: Private bucket with specific access aws s3api put-bucket-acl --bucket my-bucket --acl private aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ``` @@ -338,12 +338,12 @@ aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ### RDS 공개 접근 ```terraform -# ❌ WRONG +# FAIL: WRONG resource "aws_db_instance" "bad" { publicly_accessible = true # NEVER do this! } -# ✅ CORRECT +# PASS: CORRECT resource "aws_db_instance" "good" { publicly_accessible = false vpc_security_group_ids = [aws_security_group.db.id] diff --git a/docs/pt-BR/README.md b/docs/pt-BR/README.md index 56c20ce7..1ac8ca07 100644 --- a/docs/pt-BR/README.md +++ b/docs/pt-BR/README.md @@ -22,7 +22,7 @@
-**🌐 Idioma / Language / 语言** +**Idioma / Language / 语言** [**English**](../../README.md) | [简体中文](../../README.zh-CN.md) | [繁體中文](../zh-TW/README.md) | [日本語](../ja-JP/README.md) | [한국어](../ko-KR/README.md) | [Português (BR)](README.md) @@ -104,7 +104,7 @@ Este repositório contém apenas o código. Os guias explicam tudo. --- -## 🚀 Início Rápido +## Início Rápido Comece em menos de 2 minutos: @@ -120,7 +120,7 @@ Comece em menos de 2 minutos: ### Passo 2: Instalar as Regras (Obrigatório) -> ⚠️ **Importante:** Plugins do Claude Code não podem distribuir `rules` automaticamente. Instale-as manualmente: +> WARNING: **Importante:** Plugins do Claude Code não podem distribuir `rules` automaticamente. Instale-as manualmente: ```bash # Clone o repositório primeiro @@ -161,11 +161,11 @@ npx ecc-install typescript /plugin list everything-claude-code@everything-claude-code ``` -✨ **Pronto!** Você agora tem acesso a 28 agentes, 116 skills e 59 comandos. +**Pronto!** Você agora tem acesso a 28 agentes, 116 skills e 59 comandos. --- -## 🌐 Suporte Multiplataforma +## Suporte Multiplataforma Este plugin agora suporta totalmente **Windows, macOS e Linux**, com integração estreita em principais IDEs (Cursor, OpenCode, Antigravity) e harnesses CLI. Todos os hooks e scripts foram reescritos em Node.js para máxima compatibilidade. @@ -212,7 +212,7 @@ export ECC_DISABLED_HOOKS="pre:bash:tmux-reminder,post:edit:typecheck" --- -## 📦 O Que Está Incluído +## O Que Está Incluído ``` everything-claude-code/ @@ -230,7 +230,7 @@ everything-claude-code/ --- -## 🛠️ Ferramentas do Ecossistema +## Ferramentas do Ecossistema ### Criador de Skills @@ -269,7 +269,7 @@ npx ecc-agentshield scan --opus --stream npx ecc-agentshield init ``` -### 🧠 Aprendizado Contínuo v2 +### Aprendizado Contínuo v2 O sistema de aprendizado baseado em instincts aprende automaticamente seus padrões: @@ -282,7 +282,7 @@ O sistema de aprendizado baseado em instincts aprende automaticamente seus padr --- -## 📋 Requisitos +## Requisitos ### Versão do Claude Code CLI @@ -295,7 +295,7 @@ claude --version --- -## 📥 Instalação +## Instalação ### Opção 1: Instalar como Plugin (Recomendado) @@ -343,7 +343,7 @@ Ou adicione diretamente ao seu `~/.claude/settings.json`: --- -### 🔧 Opção 2: Instalação Manual +### Opção 2: Instalação Manual ```bash # Clonar o repositório @@ -365,7 +365,7 @@ cp -r everything-claude-code/.agents/skills/* ~/.claude/skills/ --- -## 🎯 Conceitos-Chave +## Conceitos-Chave ### Agentes @@ -395,7 +395,7 @@ Regras são diretrizes sempre seguidas, organizadas em `common/` (agnóstico à --- -## 🗺️ Qual Agente Devo Usar? +## Qual Agente Devo Usar? | Quero... | Use este comando | Agente usado | |----------|-----------------|--------------| @@ -437,7 +437,7 @@ Regras são diretrizes sempre seguidas, organizadas em `common/` (agnóstico à --- -## ❓ FAQ +## FAQ
Como verificar quais agentes/comandos estão instalados? @@ -476,7 +476,7 @@ Veja [CONTRIBUTING.md](CONTRIBUTING.md). Em resumo: --- -## 🧪 Executando Testes +## Executando Testes ```bash # Executar todos os testes @@ -490,7 +490,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 Contribuindo +## Contribuindo **Contribuições são bem-vindas e incentivadas.** @@ -504,6 +504,6 @@ Por favor contribua! Veja [CONTRIBUTING.md](CONTRIBUTING.md) para diretrizes. --- -## 📄 Licença +## Licença MIT — consulte o [arquivo LICENSE](../../LICENSE) para detalhes. diff --git a/docs/pt-BR/agents/security-reviewer.md b/docs/pt-BR/agents/security-reviewer.md index 1f97971f..b2bd8861 100644 --- a/docs/pt-BR/agents/security-reviewer.md +++ b/docs/pt-BR/agents/security-reviewer.md @@ -91,7 +91,7 @@ Se você encontrar uma vulnerabilidade CRÍTICA: **IMEDIATAMENTE:** Incidentes de produção, CVEs de dependências, relatórios de segurança do usuário, antes de grandes lançamentos. -## Métricas de sucesso +## Métricas de sucesso - Nenhum problema CRÍTICO encontrado - Todos os problemas de ALTA prioridade foram resolvidos diff --git a/docs/pt-BR/commands/code-review.md b/docs/pt-BR/commands/code-review.md index 52b9e90d..cd2785b7 100644 --- a/docs/pt-BR/commands/code-review.md +++ b/docs/pt-BR/commands/code-review.md @@ -9,7 +9,7 @@ Revisão completa de segurança e qualidade das mudanças não commitadas: **Problemas de Segurança (CRITICAL):** - Credenciais, chaves de API ou tokens hardcoded - Vulnerabilidades de SQL injection -- Vulnerabilidades de XSS +- Vulnerabilidades de XSS - Falta de validação de entrada - Dependências inseguras - Riscos de path traversal diff --git a/docs/pt-BR/commands/e2e.md b/docs/pt-BR/commands/e2e.md index 41b77f5d..c6cdd19d 100644 --- a/docs/pt-BR/commands/e2e.md +++ b/docs/pt-BR/commands/e2e.md @@ -182,7 +182,7 @@ Artifacts generated: ╔══════════════════════════════════════════════════════════════╗ ║ E2E Test Results ║ ╠══════════════════════════════════════════════════════════════╣ -║ Status: ✅ ALL TESTS PASSED ║ +║ Status: PASS: ALL TESTS PASSED ║ ║ Total: 3 tests ║ ║ Passed: 3 (100%) ║ ║ Failed: 0 ║ @@ -191,15 +191,15 @@ Artifacts generated: ╚══════════════════════════════════════════════════════════════╝ Artifacts: -📸 Screenshots: 2 files -📹 Videos: 0 files (only on failure) -🔍 Traces: 0 files (only on failure) -📊 HTML Report: playwright-report/index.html + Screenshots: 2 files + Videos: 0 files (only on failure) + Traces: 0 files (only on failure) + HTML Report: playwright-report/index.html View report: npx playwright show-report ``` -✅ E2E test suite ready for CI/CD integration! +PASS: E2E test suite ready for CI/CD integration! ``` ## Artefatos de Teste @@ -235,7 +235,7 @@ open artifacts/search-results.png Se um teste falhar de forma intermitente: ``` -⚠️ FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts +WARNING: FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts Test passed 7/10 runs (70% pass rate) @@ -254,10 +254,10 @@ Quarantine recommendation: Mark as test.fixme() until fixed ## Configuração de Navegador Os testes rodam em múltiplos navegadores por padrão: -- ✅ Chromium (Desktop Chrome) -- ✅ Firefox (Desktop) -- ✅ WebKit (Desktop Safari) -- ✅ Mobile Chrome (optional) +- PASS: Chromium (Desktop Chrome) +- PASS: Firefox (Desktop) +- PASS: WebKit (Desktop Safari) +- PASS: Mobile Chrome (optional) Configure em `playwright.config.ts` para ajustar navegadores. @@ -285,7 +285,7 @@ Adicione ao seu pipeline de CI: Para PMX, priorize estes testes E2E: -**🔴 CRITICAL (Must Always Pass):** +**CRITICAL (Must Always Pass):** 1. User can connect wallet 2. User can browse markets 3. User can search markets (semantic search) @@ -294,7 +294,7 @@ Para PMX, priorize estes testes E2E: 6. Market resolves correctly 7. User can withdraw funds -**🟡 IMPORTANT:** +**IMPORTANT:** 1. Market creation flow 2. User profile updates 3. Real-time price updates @@ -305,20 +305,20 @@ Para PMX, priorize estes testes E2E: ## Boas Práticas **DO:** -- ✅ Use Page Object Model para manutenção -- ✅ Use atributos data-testid para seletores -- ✅ Aguarde respostas de API, não timeouts arbitrários -- ✅ Teste jornadas críticas de usuário end-to-end -- ✅ Rode testes antes de mergear em main -- ✅ Revise artefatos quando testes falharem +- PASS: Use Page Object Model para manutenção +- PASS: Use atributos data-testid para seletores +- PASS: Aguarde respostas de API, não timeouts arbitrários +- PASS: Teste jornadas críticas de usuário end-to-end +- PASS: Rode testes antes de mergear em main +- PASS: Revise artefatos quando testes falharem **DON'T:** -- ❌ Use seletores frágeis (classes CSS podem mudar) -- ❌ Teste detalhes de implementação -- ❌ Rode testes contra produção -- ❌ Ignore testes flaky -- ❌ Pule revisão de artefatos em falhas -- ❌ Teste todo edge case com E2E (use testes unitários) +- FAIL: Use seletores frágeis (classes CSS podem mudar) +- FAIL: Teste detalhes de implementação +- FAIL: Rode testes contra produção +- FAIL: Ignore testes flaky +- FAIL: Pule revisão de artefatos em falhas +- FAIL: Teste todo edge case com E2E (use testes unitários) ## Notas Importantes diff --git a/docs/pt-BR/commands/go-build.md b/docs/pt-BR/commands/go-build.md index 2e620bf9..5af00b95 100644 --- a/docs/pt-BR/commands/go-build.md +++ b/docs/pt-BR/commands/go-build.md @@ -140,7 +140,7 @@ ok project/internal/handler 0.023s | Files modified | 2 | | Remaining issues | 0 | -Build Status: ✅ SUCCESS +Build Status: PASS: SUCCESS ``` ## Erros Comuns Corrigidos diff --git a/docs/pt-BR/commands/go-review.md b/docs/pt-BR/commands/go-review.md index 2e249c4b..eaf6ce4d 100644 --- a/docs/pt-BR/commands/go-review.md +++ b/docs/pt-BR/commands/go-review.md @@ -124,16 +124,16 @@ return fmt.Errorf("get user %s: %w", userID, err) - HIGH: 1 - MEDIUM: 0 -Recommendation: ❌ Block merge until CRITICAL issue is fixed +Recommendation: FAIL: Block merge until CRITICAL issue is fixed ``` ## Critérios de Aprovação | Status | Condição | |--------|----------| -| ✅ Aprovado | Sem problemas CRÍTICO ou ALTO | -| ⚠️ Aviso | Apenas problemas MÉDIOS (merge com cautela) | -| ❌ Bloqueado | Problemas CRÍTICO ou ALTO encontrados | +| PASS: Aprovado | Sem problemas CRÍTICO ou ALTO | +| WARNING: Aviso | Apenas problemas MÉDIOS (merge com cautela) | +| FAIL: Bloqueado | Problemas CRÍTICO ou ALTO encontrados | ## Integração com Outros Comandos - Use `/go-test` primeiro para garantir que os testes passam diff --git a/docs/pt-BR/commands/refactor-clean.md b/docs/pt-BR/commands/refactor-clean.md index cf8573d9..c38bbf1d 100644 --- a/docs/pt-BR/commands/refactor-clean.md +++ b/docs/pt-BR/commands/refactor-clean.md @@ -69,7 +69,7 @@ Deleted: 12 unused functions Skipped: 2 items (tests failed) Saved: ~450 lines removed ────────────────────────────── -All tests passing ✅ +All tests passing PASS: ``` ## Regras diff --git a/docs/pt-BR/commands/tdd.md b/docs/pt-BR/commands/tdd.md index 8bf2594e..1cd46778 100644 --- a/docs/pt-BR/commands/tdd.md +++ b/docs/pt-BR/commands/tdd.md @@ -133,7 +133,7 @@ FAIL lib/liquidity.test.ts 1 test failed, 0 passed ``` -✅ Os testes falharam conforme o esperado. Pronto para implementação. +PASS: Os testes falharam conforme o esperado. Pronto para implementação. ## Etapa 4: Implementar o código mínimo (VERDE) @@ -179,7 +179,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ Todos os testes passando +PASS: Todos os testes passando ## Etapa 6: Refatorar (MELHORAR) @@ -236,7 +236,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ Refatoração concluída, testes ainda passando! +PASS: Refatoração concluída, testes ainda passando! ## Etapa 8: Verificar a cobertura @@ -247,29 +247,29 @@ File | % Stmts | % Branch | % Funcs | % Lines ---------------|---------|----------|---------|-------- liquidity.ts | 100 | 100 | 100 | 100 -Coverage: 100% ✅ (Target: 80%) +Coverage: 100% PASS: (Target: 80%) ``` -✅ TDD sessão completa! +PASS: TDD sessão completa! ``` ## Boas Práticas de TDD **Fazer:** -- ✅ Escreva o teste PRIMEIRO, antes da implementação -- ✅ Rode testes e confirme que FALHAM antes de implementar -- ✅ Escreva código mínimo para fazer passar -- ✅ Refatore só depois que os testes estiverem verdes -- ✅ Adicione casos de borda e cenários de erro -- ✅ Mire 80%+ de cobertura (100% para código crítico) +- PASS: Escreva o teste PRIMEIRO, antes da implementação +- PASS: Rode testes e confirme que FALHAM antes de implementar +- PASS: Escreva código mínimo para fazer passar +- PASS: Refatore só depois que os testes estiverem verdes +- PASS: Adicione casos de borda e cenários de erro +- PASS: Mire 80%+ de cobertura (100% para código crítico) **Não fazer:** -- ❌ Escrever implementação antes de testes -- ❌ Pular execução de testes após cada mudança -- ❌ Escrever código demais de uma vez -- ❌ Ignorar testes falhando -- ❌ Testar detalhes de implementação (teste comportamento) -- ❌ Fazer mock de tudo (prefira testes de integração) +- FAIL: Escrever implementação antes de testes +- FAIL: Pular execução de testes após cada mudança +- FAIL: Escrever código demais de uma vez +- FAIL: Ignorar testes falhando +- FAIL: Testar detalhes de implementação (teste comportamento) +- FAIL: Fazer mock de tudo (prefira testes de integração) ## Tipos de Teste a Incluir diff --git a/docs/pt-BR/commands/test-coverage.md b/docs/pt-BR/commands/test-coverage.md index e1c67d6d..b52c1524 100644 --- a/docs/pt-BR/commands/test-coverage.md +++ b/docs/pt-BR/commands/test-coverage.md @@ -57,7 +57,7 @@ File Before After src/services/auth.ts 45% 88% src/utils/validation.ts 32% 82% ────────────────────────────── -Overall: 67% 84% ✅ +Overall: 67% 84% PASS: ``` ## Áreas de Foco diff --git a/docs/tr/README.md b/docs/tr/README.md index 1cc1ba95..f0d22d19 100644 --- a/docs/tr/README.md +++ b/docs/tr/README.md @@ -21,7 +21,7 @@
-**🌐 Dil / Language / 语言 / 語言** +**Dil / Language / 语言 / 語言** [**English**](../../README.md) | [简体中文](../../README.zh-CN.md) | [繁體中文](../zh-TW/README.md) | [日本語](../ja-JP/README.md) | [한국어](../ko-KR/README.md) | [**Türkçe**](README.md) @@ -105,7 +105,7 @@ Bu repository yalnızca ham kodu içerir. Rehberler her şeyi açıklıyor. --- -## 🚀 Hızlı Başlangıç +## Hızlı Başlangıç 2 dakikadan kısa sürede başlayın: @@ -121,7 +121,7 @@ Bu repository yalnızca ham kodu içerir. Rehberler her şeyi açıklıyor. ### Adım 2: Rule'ları Kurun (Gerekli) -> ⚠️ **Önemli:** Claude Code plugin'leri `rule`'ları otomatik olarak dağıtamaz. Manuel olarak kurmalısınız: +> WARNING: **Önemli:** Claude Code plugin'leri `rule`'ları otomatik olarak dağıtamaz. Manuel olarak kurmalısınız: ```bash # Önce repo'yu klonlayın @@ -164,11 +164,11 @@ Manuel kurulum talimatları için `rules/` klasöründeki README'ye bakın. /plugin list everything-claude-code@everything-claude-code ``` -✨ **Bu kadar!** Artık 28 agent, 116 skill ve 59 command'a erişiminiz var. +**Bu kadar!** Artık 28 agent, 116 skill ve 59 command'a erişiminiz var. --- -## 🌐 Çapraz Platform Desteği +## Çapraz Platform Desteği Bu plugin artık **Windows, macOS ve Linux**'u tam olarak destekliyor, ana IDE'ler (Cursor, OpenCode, Antigravity) ve CLI harness'lar arasında sıkı entegrasyon ile birlikte. Tüm hook'lar ve script'ler maksimum uyumluluk için Node.js ile yeniden yazıldı. @@ -215,7 +215,7 @@ export ECC_DISABLED_HOOKS="pre:bash:tmux-reminder,post:edit:typecheck" --- -## 📦 İçindekiler +## İçindekiler Bu repo bir **Claude Code plugin'i** - doğrudan kurun veya component'leri manuel olarak kopyalayın. @@ -293,7 +293,7 @@ everything-claude-code/ --- -## 🗺️ Hangi Agent'ı Kullanmalıyım? +## Hangi Agent'ı Kullanmalıyım? Nereden başlayacağınızdan emin değil misiniz? Bu hızlı referansı kullanın: @@ -337,7 +337,7 @@ Nereden başlayacağınızdan emin değil misiniz? Bu hızlı referansı kullan --- -## ❓ SSS +## SSS
Hangi agent/command'ların kurulu olduğunu nasıl kontrol ederim? @@ -410,7 +410,7 @@ Evet. ECC çapraz platformdur: --- -## 🧪 Testleri Çalıştırma +## Testleri Çalıştırma Plugin kapsamlı bir test suite içerir: @@ -426,7 +426,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 Katkıda Bulunma +## Katkıda Bulunma **Katkılar beklenir ve teşvik edilir.** @@ -448,7 +448,7 @@ Lütfen katkıda bulunun! Rehber için [CONTRIBUTING.md](../../CONTRIBUTING.md)' --- -## 📄 Lisans +## Lisans MIT - Özgürce kullanın, ihtiyaç duyduğunuz gibi değiştirin, yapabiliyorsanız geri katkıda bulunun. diff --git a/docs/tr/commands/e2e.md b/docs/tr/commands/e2e.md index 7716285e..3212e492 100644 --- a/docs/tr/commands/e2e.md +++ b/docs/tr/commands/e2e.md @@ -182,7 +182,7 @@ Oluşturulan artifact'lar: ╔══════════════════════════════════════════════════════════════╗ ║ E2E Test Sonuçları ║ ╠══════════════════════════════════════════════════════════════╣ -║ Durum: ✅ TÜM TESTLER GEÇTİ ║ +║ Durum: PASS: TÜM TESTLER GEÇTİ ║ ║ Toplam: 3 test ║ ║ Geçti: 3 (%100) ║ ║ Başarısız: 0 ║ @@ -191,15 +191,15 @@ Oluşturulan artifact'lar: ╚══════════════════════════════════════════════════════════════╝ Artifact'lar: -📸 Ekran Görüntüleri: 2 dosya -📹 Videolar: 0 dosya (sadece hatada) -🔍 İzlemeler: 0 dosya (sadece hatada) -📊 HTML Rapor: playwright-report/index.html + Ekran Görüntüleri: 2 dosya + Videolar: 0 dosya (sadece hatada) + İzlemeler: 0 dosya (sadece hatada) + HTML Rapor: playwright-report/index.html Raporu görüntüle: npx playwright show-report ``` -✅ E2E test paketi CI/CD entegrasyonuna hazır! +PASS: E2E test paketi CI/CD entegrasyonuna hazır! ``` ## Test Artifact'ları @@ -235,7 +235,7 @@ open artifacts/search-results.png Bir test aralıklı olarak başarısız olursa: ``` -⚠️ DENGESİZ TEST TESPİT EDİLDİ: tests/e2e/markets/trade.spec.ts +WARNING: DENGESİZ TEST TESPİT EDİLDİ: tests/e2e/markets/trade.spec.ts Test 10 çalıştırmadan 7'sinde geçti (%70 geçme oranı) @@ -254,10 +254,10 @@ Karantina önerisi: Düzeltilene kadar test.fixme() olarak işaretle ## Tarayıcı Yapılandırması Testler varsayılan olarak birden fazla tarayıcıda çalışır: -- ✅ Chromium (Desktop Chrome) -- ✅ Firefox (Desktop) -- ✅ WebKit (Desktop Safari) -- ✅ Mobile Chrome (opsiyonel) +- PASS: Chromium (Desktop Chrome) +- PASS: Firefox (Desktop) +- PASS: WebKit (Desktop Safari) +- PASS: Mobile Chrome (opsiyonel) Tarayıcıları ayarlamak için `playwright.config.ts`'yi yapılandırın. @@ -285,7 +285,7 @@ CI pipeline'ınıza ekleyin: PMX için bu E2E testlerine öncelik verin: -**🔴 KRİTİK (Her Zaman Geçmeli):** +**KRİTİK (Her Zaman Geçmeli):** 1. Kullanıcı cüzdan bağlayabilir 2. Kullanıcı piyasalara göz atabilir 3. Kullanıcı piyasa arayabilir (semantik arama) @@ -294,7 +294,7 @@ PMX için bu E2E testlerine öncelik verin: 6. Piyasa doğru çözülür 7. Kullanıcı fon çekebilir -**🟡 ÖNEMLİ:** +**ÖNEMLİ:** 1. Piyasa oluşturma akışı 2. Kullanıcı profil güncellemeleri 3. Gerçek zamanlı fiyat güncellemeleri @@ -305,20 +305,20 @@ PMX için bu E2E testlerine öncelik verin: ## En İyi Uygulamalar **YAPIN:** -- ✅ Sürdürülebilirlik için Page Object Model kullanın -- ✅ Selector'lar için data-testid nitelikleri kullanın -- ✅ Rastgele timeout'lar değil, API yanıtlarını bekleyin -- ✅ Kritik kullanıcı yolculuklarını uçtan uca test edin -- ✅ Main'e merge etmeden önce testleri çalıştırın -- ✅ Testler başarısız olduğunda artifact'ları inceleyin +- PASS: Sürdürülebilirlik için Page Object Model kullanın +- PASS: Selector'lar için data-testid nitelikleri kullanın +- PASS: Rastgele timeout'lar değil, API yanıtlarını bekleyin +- PASS: Kritik kullanıcı yolculuklarını uçtan uca test edin +- PASS: Main'e merge etmeden önce testleri çalıştırın +- PASS: Testler başarısız olduğunda artifact'ları inceleyin **YAPMAYIN:** -- ❌ Kırılgan selector'lar kullanmayın (CSS sınıfları değişebilir) -- ❌ Uygulama detaylarını test etmeyin -- ❌ Production'a karşı testler çalıştırmayın -- ❌ Dengesiz testleri görmezden gelmeyin -- ❌ Başarısızlıklarda artifact incelemesini atlamayın -- ❌ Her edge case'i E2E ile test etmeyin (unit testler kullanın) +- FAIL: Kırılgan selector'lar kullanmayın (CSS sınıfları değişebilir) +- FAIL: Uygulama detaylarını test etmeyin +- FAIL: Production'a karşı testler çalıştırmayın +- FAIL: Dengesiz testleri görmezden gelmeyin +- FAIL: Başarısızlıklarda artifact incelemesini atlamayın +- FAIL: Her edge case'i E2E ile test etmeyin (unit testler kullanın) ## Önemli Notlar diff --git a/docs/tr/commands/go-build.md b/docs/tr/commands/go-build.md index a991fece..28b205c0 100644 --- a/docs/tr/commands/go-build.md +++ b/docs/tr/commands/go-build.md @@ -140,7 +140,7 @@ ok project/internal/handler 0.023s | Değiştirilen dosyalar | 2 | | Kalan sorunlar | 0 | -Build Durumu: ✅ BAŞARILI +Build Durumu: PASS: BAŞARILI ``` ## Düzeltilen Yaygın Hatalar diff --git a/docs/tr/commands/go-review.md b/docs/tr/commands/go-review.md index 69bd6b68..f24a4276 100644 --- a/docs/tr/commands/go-review.md +++ b/docs/tr/commands/go-review.md @@ -124,16 +124,16 @@ return fmt.Errorf("get user %s: %w", userID, err) - YÜKSEK: 1 - ORTA: 0 -Öneri: ❌ KRİTİK sorun düzeltilene kadar merge'i engelle +Öneri: FAIL: KRİTİK sorun düzeltilene kadar merge'i engelle ``` ## Onay Kriterleri | Durum | Koşul | |--------|-----------| -| ✅ Onayla | KRİTİK veya YÜKSEK sorun yok | -| ⚠️ Uyarı | Sadece ORTA sorunlar (dikkatle merge et) | -| ❌ Engelle | KRİTİK veya YÜKSEK sorun bulundu | +| PASS: Onayla | KRİTİK veya YÜKSEK sorun yok | +| WARNING: Uyarı | Sadece ORTA sorunlar (dikkatle merge et) | +| FAIL: Engelle | KRİTİK veya YÜKSEK sorun bulundu | ## Diğer Komutlarla Entegrasyon diff --git a/docs/tr/commands/instinct-import.md b/docs/tr/commands/instinct-import.md index acefe3f3..b2491095 100644 --- a/docs/tr/commands/instinct-import.md +++ b/docs/tr/commands/instinct-import.md @@ -44,7 +44,7 @@ Yerel dosya yollarından veya HTTP(S) URL'lerinden içgüdüleri içe aktar. ## İçe Aktarma İşlemi ``` -📥 Importing instincts from: team-instincts.yaml + Importing instincts from: team-instincts.yaml ================================================ Found 12 instincts to import. @@ -60,12 +60,12 @@ These will be added: ## Duplicate Instincts (3) Already have similar instincts: - ⚠️ prefer-functional-style + WARNING: prefer-functional-style Local: 0.8 confidence, 12 observations Import: 0.7 confidence → Keep local (higher confidence) - ⚠️ test-first-workflow + WARNING: test-first-workflow Local: 0.75 confidence Import: 0.9 confidence → Update to import (higher confidence) @@ -102,7 +102,7 @@ project_name: "my-project" İçe aktarma sonrası: ``` -✅ Import complete! +PASS: Import complete! Added: 8 instincts Updated: 1 instinct diff --git a/docs/tr/commands/learn-eval.md b/docs/tr/commands/learn-eval.md index 14a3649e..e5220b64 100644 --- a/docs/tr/commands/learn-eval.md +++ b/docs/tr/commands/learn-eval.md @@ -73,7 +73,7 @@ origin: auto-extracted | **[X]'e Ekle** | Mevcut bir skill'e eklenmelidir | Hedef skill'i ve eklemeleri göster → Adım 6 | | **Düşür** | Önemsiz, gereksiz veya çok soyut | Gerekçeyi açıkla ve dur | - **Yönlendirici boyutlar** (karar verirken, puanlanmaz): +**Yönlendirici boyutlar** (karar verirken, puanlanmaz): - **Spesifiklik ve Uygulanabilirlik**: Hemen kullanılabilir kod örnekleri veya komutlar içerir - **Kapsam Uyumu**: Ad, tetikleyici koşullar ve içerik hizalanmış ve tek bir desene odaklanmış diff --git a/docs/tr/commands/multi-plan.md b/docs/tr/commands/multi-plan.md index 6394b823..ea27debb 100644 --- a/docs/tr/commands/multi-plan.md +++ b/docs/tr/commands/multi-plan.md @@ -204,9 +204,9 @@ Her iki analizi sentezle, **Adım Adım Implementation Planı** oluştur: 3. **Kalın metinle** prompt çıktıla (MUTLAKA gerçek kaydedilen dosya yolunu kullan): --- - **Plan oluşturuldu ve `.claude/plan/actual-feature-name.md` dosyasına kaydedildi** +**Plan oluşturuldu ve `.claude/plan/actual-feature-name.md` dosyasına kaydedildi** - **Lütfen yukarıdaki planı inceleyin. Şunları yapabilirsiniz:** +**Lütfen yukarıdaki planı inceleyin. Şunları yapabilirsiniz:** - **Planı değiştir**: Neyin ayarlanması gerektiğini söyleyin, planı güncelleyeceğim - **Planı çalıştır**: Aşağıdaki komutu yeni bir oturuma kopyalayın @@ -215,7 +215,7 @@ Her iki analizi sentezle, **Adım Adım Implementation Planı** oluştur: ``` --- - **NOT**: Yukarıdaki `actual-feature-name.md` gerçek kaydedilen dosya adıyla değiştirilmelidir! +**NOT**: Yukarıdaki `actual-feature-name.md` gerçek kaydedilen dosya adıyla değiştirilmelidir! 4. **Mevcut yanıtı hemen sonlandır** (Burada dur. Daha fazla tool çağrısı yok.) diff --git a/docs/tr/commands/refactor-clean.md b/docs/tr/commands/refactor-clean.md index 6b2fa19b..cdebb83f 100644 --- a/docs/tr/commands/refactor-clean.md +++ b/docs/tr/commands/refactor-clean.md @@ -69,7 +69,7 @@ Silindi: 12 kullanılmayan fonksiyon Atlandı: 2 öğe (testler başarısız) Kazanç: ~450 satır kaldırıldı ────────────────────────────── -Tüm testler geçiyor ✅ +Tüm testler geçiyor PASS: ``` ## Kurallar diff --git a/docs/tr/commands/tdd.md b/docs/tr/commands/tdd.md index 7e476435..caad51ad 100644 --- a/docs/tr/commands/tdd.md +++ b/docs/tr/commands/tdd.md @@ -133,7 +133,7 @@ FAIL lib/liquidity.test.ts 1 test failed, 0 passed ``` -✅ Testler beklendiği gibi başarısız. Uygulamaya hazır. +PASS: Testler beklendiği gibi başarısız. Uygulamaya hazır. ## Adım 4: Minimal Kod Uygula (GREEN) @@ -179,7 +179,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ Tüm testler geçiyor! +PASS: Tüm testler geçiyor! ## Adım 6: Refactor Et (IYILEŞTIR) @@ -236,7 +236,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ Refactoring tamamlandı, testler hala geçiyor! +PASS: Refactoring tamamlandı, testler hala geçiyor! ## Adım 8: Kapsama Oranını Kontrol Et @@ -247,29 +247,29 @@ File | % Stmts | % Branch | % Funcs | % Lines ---------------|---------|----------|---------|-------- liquidity.ts | 100 | 100 | 100 | 100 -Coverage: 100% ✅ (Hedef: 80%) +Coverage: 100% PASS: (Hedef: 80%) ``` -✅ TDD oturumu tamamlandı! +PASS: TDD oturumu tamamlandı! ``` ## TDD En İyi Uygulamaları **YAPIN:** -- ✅ Herhangi bir uygulamadan ÖNCE testi yazın -- ✅ Testleri çalıştırın ve uygulamadan önce başarısız olduklarını doğrulayın -- ✅ Testleri geçirmek için minimal kod yazın -- ✅ Testler yeşil olduktan sonra refactor edin -- ✅ Edge case'leri ve hata senaryolarını ekleyin -- ✅ %80+ kapsama hedefleyin (kritik kod için %100) +- PASS: Herhangi bir uygulamadan ÖNCE testi yazın +- PASS: Testleri çalıştırın ve uygulamadan önce başarısız olduklarını doğrulayın +- PASS: Testleri geçirmek için minimal kod yazın +- PASS: Testler yeşil olduktan sonra refactor edin +- PASS: Edge case'leri ve hata senaryolarını ekleyin +- PASS: %80+ kapsama hedefleyin (kritik kod için %100) **YAPMAYIN:** -- ❌ Testlerden önce uygulama yazmayın -- ❌ Her değişiklikten sonra testleri çalıştırmayı atlamayın -- ❌ Aynı anda çok fazla kod yazmayın -- ❌ Başarısız testleri görmezden gelmeyin -- ❌ Uygulama detaylarını test etmeyin (davranışı test edin) -- ❌ Her şeyi mock'lamayın (integration testleri tercih edin) +- FAIL: Testlerden önce uygulama yazmayın +- FAIL: Her değişiklikten sonra testleri çalıştırmayı atlamayın +- FAIL: Aynı anda çok fazla kod yazmayın +- FAIL: Başarısız testleri görmezden gelmeyin +- FAIL: Uygulama detaylarını test etmeyin (davranışı test edin) +- FAIL: Her şeyi mock'lamayın (integration testleri tercih edin) ## Dahil Edilecek Test Türleri diff --git a/docs/tr/commands/test-coverage.md b/docs/tr/commands/test-coverage.md index 21f348c5..d6395625 100644 --- a/docs/tr/commands/test-coverage.md +++ b/docs/tr/commands/test-coverage.md @@ -57,7 +57,7 @@ File Before After src/services/auth.ts 45% 88% src/utils/validation.ts 32% 82% ────────────────────────────── -Overall: 67% 84% ✅ +Overall: 67% 84% PASS: ``` ## Odak Alanları diff --git a/docs/tr/skills/backend-patterns/SKILL.md b/docs/tr/skills/backend-patterns/SKILL.md index 54c9c46d..ff3da87a 100644 --- a/docs/tr/skills/backend-patterns/SKILL.md +++ b/docs/tr/skills/backend-patterns/SKILL.md @@ -23,7 +23,7 @@ origin: ECC ### RESTful API Yapısı ```typescript -// ✅ Kaynak tabanlı URL'ler +// PASS: Kaynak tabanlı URL'ler GET /api/markets # Kaynakları listele GET /api/markets/:id # Tek kaynak getir POST /api/markets # Kaynak oluştur @@ -31,7 +31,7 @@ PUT /api/markets/:id # Kaynağı değiştir (tam) PATCH /api/markets/:id # Kaynağı güncelle (kısmi) DELETE /api/markets/:id # Kaynağı sil -// ✅ Filtreleme, sıralama, sayfalama için query parametreleri +// PASS: Filtreleme, sıralama, sayfalama için query parametreleri GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -131,7 +131,7 @@ export default withAuth(async (req, res) => { ### Sorgu Optimizasyonu ```typescript -// ✅ İYİ: Sadece gerekli sütunları seç +// PASS: İYİ: Sadece gerekli sütunları seç const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -139,7 +139,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ KÖTÜ: Her şeyi seç +// FAIL: KÖTÜ: Her şeyi seç const { data } = await supabase .from('markets') .select('*') @@ -148,13 +148,13 @@ const { data } = await supabase ### N+1 Sorgu Önleme ```typescript -// ❌ KÖTÜ: N+1 sorgu problemi +// FAIL: KÖTÜ: N+1 sorgu problemi const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N sorgu } -// ✅ İYİ: Toplu getirme +// PASS: İYİ: Toplu getirme const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 sorgu diff --git a/docs/tr/skills/coding-standards/SKILL.md b/docs/tr/skills/coding-standards/SKILL.md index 97cc0ac2..d47664db 100644 --- a/docs/tr/skills/coding-standards/SKILL.md +++ b/docs/tr/skills/coding-standards/SKILL.md @@ -48,12 +48,12 @@ Tüm projelerde uygulanabilir evrensel kodlama standartları. ### Değişken İsimlendirme ```typescript -// ✅ İYİ: Açıklayıcı isimler +// PASS: İYİ: Açıklayıcı isimler const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ KÖTÜ: Belirsiz isimler +// FAIL: KÖTÜ: Belirsiz isimler const q = 'election' const flag = true const x = 1000 @@ -62,12 +62,12 @@ const x = 1000 ### Fonksiyon İsimlendirme ```typescript -// ✅ İYİ: Fiil-isim kalıbı +// PASS: İYİ: Fiil-isim kalıbı async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ KÖTÜ: Belirsiz veya sadece isim +// FAIL: KÖTÜ: Belirsiz veya sadece isim async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -76,7 +76,7 @@ function email(e) { } ### Değişmezlik Kalıbı (KRİTİK) ```typescript -// ✅ HER ZAMAN spread operatörü kullanın +// PASS: HER ZAMAN spread operatörü kullanın const updatedUser = { ...user, name: 'New Name' @@ -84,7 +84,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ ASLA doğrudan mutasyon yapmayın +// FAIL: ASLA doğrudan mutasyon yapmayın user.name = 'New Name' // KÖTÜ items.push(newItem) // KÖTÜ ``` @@ -92,7 +92,7 @@ items.push(newItem) // KÖTÜ ### Hata Yönetimi ```typescript -// ✅ İYİ: Kapsamlı hata yönetimi +// PASS: İYİ: Kapsamlı hata yönetimi async function fetchData(url: string) { try { const response = await fetch(url) @@ -108,7 +108,7 @@ async function fetchData(url: string) { } } -// ❌ KÖTÜ: Hata yönetimi yok +// FAIL: KÖTÜ: Hata yönetimi yok async function fetchData(url) { const response = await fetch(url) return response.json() @@ -118,14 +118,14 @@ async function fetchData(url) { ### Async/Await En İyi Uygulamaları ```typescript -// ✅ İYİ: Mümkün olduğunda paralel yürütme +// PASS: İYİ: Mümkün olduğunda paralel yürütme const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ KÖTÜ: Gereksiz yere sıralı +// FAIL: KÖTÜ: Gereksiz yere sıralı const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -134,7 +134,7 @@ const stats = await fetchStats() ### Tür Güvenliği ```typescript -// ✅ İYİ: Doğru tipler +// PASS: İYİ: Doğru tipler interface Market { id: string name: string @@ -146,7 +146,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ KÖTÜ: 'any' kullanımı +// FAIL: KÖTÜ: 'any' kullanımı function getMarket(id: any): Promise { // Implementation } @@ -157,7 +157,7 @@ function getMarket(id: any): Promise { ### Bileşen Yapısı ```typescript -// ✅ İYİ: Tiplerle fonksiyonel bileşen +// PASS: İYİ: Tiplerle fonksiyonel bileşen interface ButtonProps { children: React.ReactNode onClick: () => void @@ -182,7 +182,7 @@ export function Button({ ) } -// ❌ KÖTÜ: Tip yok, belirsiz yapı +// FAIL: KÖTÜ: Tip yok, belirsiz yapı export function Button(props) { return } @@ -191,7 +191,7 @@ export function Button(props) { ### Özel Hook'lar ```typescript -// ✅ İYİ: Yeniden kullanılabilir özel hook +// PASS: İYİ: Yeniden kullanılabilir özel hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -213,25 +213,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### State Yönetimi ```typescript -// ✅ İYİ: Doğru state güncellemeleri +// PASS: İYİ: Doğru state güncellemeleri const [count, setCount] = useState(0) // Önceki state'e dayalı fonksiyonel güncelleme setCount(prev => prev + 1) -// ❌ KÖTÜ: Doğrudan state referansı +// FAIL: KÖTÜ: Doğrudan state referansı setCount(count + 1) // Async senaryolarda eski olabilir ``` ### Koşullu Render ```typescript -// ✅ İYİ: Açık koşullu render +// PASS: İYİ: Açık koşullu render {isLoading && } {error && } {data && } -// ❌ KÖTÜ: Ternary cehennemi +// FAIL: KÖTÜ: Ternary cehennemi {isLoading ? : error ? : data ? : null} ``` @@ -254,7 +254,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### Response Formatı ```typescript -// ✅ İYİ: Tutarlı response yapısı +// PASS: İYİ: Tutarlı response yapısı interface ApiResponse { success: boolean data?: T @@ -285,7 +285,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ İYİ: Schema doğrulama +// PASS: İYİ: Schema doğrulama const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -348,14 +348,14 @@ types/market.types.ts # .types soneki ile camelCase ### Ne Zaman Yorum Yapmalı ```typescript -// ✅ İYİ: NİÇİN'i açıklayın, NE'yi değil +// PASS: İYİ: NİÇİN'i açıklayın, NE'yi değil // Kesintiler sırasında API'yi aşırı yüklemekten kaçınmak için exponential backoff kullan const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Büyük dizilerle performans için burada kasıtlı olarak mutasyon kullanılıyor items.push(newItem) -// ❌ KÖTÜ: Açık olanı belirtmek +// FAIL: KÖTÜ: Açık olanı belirtmek // Sayacı 1 artır count++ @@ -395,12 +395,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ İYİ: Pahalı hesaplamaları memoize et +// PASS: İYİ: Pahalı hesaplamaları memoize et const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ İYİ: Callback'leri memoize et +// PASS: İYİ: Callback'leri memoize et const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -411,7 +411,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ İYİ: Ağır bileşenleri lazy yükle +// PASS: İYİ: Ağır bileşenleri lazy yükle const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -426,13 +426,13 @@ export function Dashboard() { ### Veritabanı Sorguları ```typescript -// ✅ İYİ: Sadece gerekli sütunları seç +// PASS: İYİ: Sadece gerekli sütunları seç const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ KÖTÜ: Her şeyi seç +// FAIL: KÖTÜ: Her şeyi seç const { data } = await supabase .from('markets') .select('*') @@ -459,12 +459,12 @@ test('benzerliği doğru hesaplar', () => { ### Test İsimlendirme ```typescript -// ✅ İYİ: Açıklayıcı test isimleri +// PASS: İYİ: Açıklayıcı test isimleri test('sorguya uygun market bulunamadığında boş dizi döndürür', () => { }) test('OpenAI API anahtarı eksikse hata fırlatır', () => { }) test('Redis kullanılamazsa substring aramaya geri döner', () => { }) -// ❌ KÖTÜ: Belirsiz test isimleri +// FAIL: KÖTÜ: Belirsiz test isimleri test('çalışır', () => { }) test('arama testi', () => { }) ``` @@ -475,12 +475,12 @@ Bu anti-kalıplara dikkat edin: ### 1. Uzun Fonksiyonlar ```typescript -// ❌ KÖTÜ: 50 satırdan uzun fonksiyon +// FAIL: KÖTÜ: 50 satırdan uzun fonksiyon function processMarketData() { // 100 satır kod } -// ✅ İYİ: Küçük fonksiyonlara böl +// PASS: İYİ: Küçük fonksiyonlara böl function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -490,7 +490,7 @@ function processMarketData() { ### 2. Derin İç İçe Geçme ```typescript -// ❌ KÖTÜ: 5+ seviye iç içe geçme +// FAIL: KÖTÜ: 5+ seviye iç içe geçme if (user) { if (user.isAdmin) { if (market) { @@ -503,7 +503,7 @@ if (user) { } } -// ✅ İYİ: Erken dönüşler +// PASS: İYİ: Erken dönüşler if (!user) return if (!user.isAdmin) return if (!market) return @@ -515,11 +515,11 @@ if (!hasPermission) return ### 3. Sihirli Sayılar ```typescript -// ❌ KÖTÜ: Açıklanmamış sayılar +// FAIL: KÖTÜ: Açıklanmamış sayılar if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ İYİ: İsimlendirilmiş sabitler +// PASS: İYİ: İsimlendirilmiş sabitler const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/docs/tr/skills/frontend-patterns/SKILL.md b/docs/tr/skills/frontend-patterns/SKILL.md index a69e5a6d..8a0ecc8f 100644 --- a/docs/tr/skills/frontend-patterns/SKILL.md +++ b/docs/tr/skills/frontend-patterns/SKILL.md @@ -23,7 +23,7 @@ React, Next.js ve performanslı kullanıcı arayüzleri için modern frontend ka ### Kalıtım Yerine Composition ```typescript -// ✅ İYİ: Bileşen composition +// PASS: İYİ: Bileşen composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -294,17 +294,17 @@ export function useMarkets() { ### Memoization ```typescript -// ✅ Pahalı hesaplamalar için useMemo +// PASS: Pahalı hesaplamalar için useMemo const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ Alt bileşenlere geçirilen fonksiyonlar için useCallback +// PASS: Alt bileşenlere geçirilen fonksiyonlar için useCallback const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ Pure bileşenler için React.memo +// PASS: Pure bileşenler için React.memo export const MarketCard = React.memo(({ market }) => { return (
@@ -320,7 +320,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Ağır bileşenleri lazy yükle +// PASS: Ağır bileşenleri lazy yükle const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -515,7 +515,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ Liste animasyonları +// PASS: Liste animasyonları export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -534,7 +534,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animasyonları +// PASS: Modal animasyonları export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/docs/tr/skills/security-review/SKILL.md b/docs/tr/skills/security-review/SKILL.md index 2e745116..a40f8670 100644 --- a/docs/tr/skills/security-review/SKILL.md +++ b/docs/tr/skills/security-review/SKILL.md @@ -22,13 +22,13 @@ Bu skill tüm kodun güvenlik en iyi uygulamalarını takip etmesini sağlar ve ### 1. Secret Yönetimi -#### ❌ ASLA Bunu Yapmayın +#### FAIL: ASLA Bunu Yapmayın ```typescript const apiKey = "sk-proj-xxxxx" // Hardcoded secret const dbPassword = "password123" // Kaynak kodda ``` -#### ✅ HER ZAMAN Bunu Yapın +#### PASS: HER ZAMAN Bunu Yapın ```typescript const apiKey = process.env.OPENAI_API_KEY const dbUrl = process.env.DATABASE_URL @@ -108,14 +108,14 @@ function validateFileUpload(file: File) { ### 3. SQL Injection Önleme -#### ❌ ASLA SQL Concatenation Yapmayın +#### FAIL: ASLA SQL Concatenation Yapmayın ```typescript // TEHLİKELİ - SQL Injection açığı const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ HER ZAMAN Parametreli Sorgular Kullanın +#### PASS: HER ZAMAN Parametreli Sorgular Kullanın ```typescript // Güvenli - parametreli sorgu const { data } = await supabase @@ -140,10 +140,10 @@ await db.query( #### JWT Token İşleme ```typescript -// ❌ YANLIŞ: localStorage (XSS'e karşı savunmasız) +// FAIL: YANLIŞ: localStorage (XSS'e karşı savunmasız) localStorage.setItem('token', token) -// ✅ DOĞRU: httpOnly cookies +// PASS: DOĞRU: httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -300,18 +300,18 @@ app.use('/api/search', searchLimiter) #### Loglama ```typescript -// ❌ YANLIŞ: Hassas veri loglama +// FAIL: YANLIŞ: Hassas veri loglama console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ DOĞRU: Hassas veriyi gizle +// PASS: DOĞRU: Hassas veriyi gizle console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### Hata Mesajları ```typescript -// ❌ YANLIŞ: İç detayları açığa çıkarma +// FAIL: YANLIŞ: İç detayları açığa çıkarma catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -319,7 +319,7 @@ catch (error) { ) } -// ✅ DOĞRU: Genel hata mesajları +// PASS: DOĞRU: Genel hata mesajları catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/docs/tr/skills/tdd-workflow/SKILL.md b/docs/tr/skills/tdd-workflow/SKILL.md index b01b1f1e..de481f0c 100644 --- a/docs/tr/skills/tdd-workflow/SKILL.md +++ b/docs/tr/skills/tdd-workflow/SKILL.md @@ -314,39 +314,39 @@ npm run test:coverage ## Kaçınılması Gereken Yaygın Test Hataları -### ❌ YANLIŞ: Implementasyon Detaylarını Test Etme +### FAIL: YANLIŞ: Implementasyon Detaylarını Test Etme ```typescript // İç state'i test etme expect(component.state.count).toBe(5) ``` -### ✅ DOĞRU: Kullanıcı Tarafından Görünen Davranışı Test Et +### PASS: DOĞRU: Kullanıcı Tarafından Görünen Davranışı Test Et ```typescript // Kullanıcıların gördüğünü test et expect(screen.getByText('Sayı: 5')).toBeInTheDocument() ``` -### ❌ YANLIŞ: Kırılgan Selector'lar +### FAIL: YANLIŞ: Kırılgan Selector'lar ```typescript // Kolayca bozulur await page.click('.css-class-xyz') ``` -### ✅ DOĞRU: Semantik Selector'lar +### PASS: DOĞRU: Semantik Selector'lar ```typescript // Değişikliklere karşı dayanıklı await page.click('button:has-text("Gönder")') await page.click('[data-testid="submit-button"]') ``` -### ❌ YANLIŞ: Test İzolasyonu Yok +### FAIL: YANLIŞ: Test İzolasyonu Yok ```typescript // Testler birbirine bağımlı test('kullanıcı oluşturur', () => { /* ... */ }) test('aynı kullanıcıyı günceller', () => { /* önceki teste bağımlı */ }) ``` -### ✅ DOĞRU: Bağımsız Testler +### PASS: DOĞRU: Bağımsız Testler ```typescript // Her test kendi verisini hazırlar test('kullanıcı oluşturur', () => { diff --git a/docs/zh-CN/CONTRIBUTING.md b/docs/zh-CN/CONTRIBUTING.md index 183232c1..6e83ebb3 100644 --- a/docs/zh-CN/CONTRIBUTING.md +++ b/docs/zh-CN/CONTRIBUTING.md @@ -158,9 +158,9 @@ model: sonnet ## 你的角色 -- 主要职责 -- 次要职责 -- 你不做的事情(界限) +- 主要职责 +- 次要职责 +- 你不做的事情(界限) ## 工作流程 @@ -322,17 +322,17 @@ description: 在 /help 中显示的简要描述 ## 用法 -`​`​` +``` /your-command [args] -`​`​` +``` ## 工作流程 -1. 第一步 -2. 第二步 -3. 最后一步 +1. 第一步 +2. 第二步 +3. 最后一步 ## 输出 diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index e9bf92cf..e363001e 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -23,7 +23,7 @@
-**🌐 语言 / 语言 / 語言** +**语言 / 语言 / 語言** [**English**](../../README.md) | [简体中文](../../README.zh-CN.md) | [繁體中文](../zh-TW/README.md) | [日本語](../ja-JP/README.md) | [한국어](../ko-KR/README.md) @@ -150,7 +150,7 @@ *** -## 🚀 快速开始 +## 快速开始 在 2 分钟内启动并运行: @@ -166,7 +166,7 @@ ### 步骤 2:安装规则(必需) -> ⚠️ **重要提示:** Claude Code 插件无法自动分发 `rules`。请手动安装它们: +> WARNING: **重要提示:** Claude Code 插件无法自动分发 `rules`。请手动安装它们: ```bash # Clone the repo first @@ -209,11 +209,11 @@ npx ecc-install typescript /plugin list everything-claude-code@everything-claude-code ``` -✨ **搞定!** 你现在可以使用 28 个智能体、116 项技能和 59 个命令了。 +**搞定!** 你现在可以使用 28 个智能体、116 项技能和 59 个命令了。 *** -## 🌐 跨平台支持 +## 跨平台支持 此插件现已完全支持 **Windows、macOS 和 Linux**,并与主流 IDE(Cursor、OpenCode、Antigravity)和 CLI 平台紧密集成。所有钩子和脚本都已用 Node.js 重写,以实现最大兼容性。 @@ -260,7 +260,7 @@ export ECC_DISABLED_HOOKS="pre:bash:tmux-reminder,post:edit:typecheck" *** -## 📦 包含内容 +## 包含内容 此仓库是一个 **Claude Code 插件** - 可以直接安装或手动复制组件。 @@ -461,7 +461,7 @@ everything-claude-code/ *** -## 🛠️ 生态系统工具 +## 生态系统工具 ### 技能创建器 @@ -527,11 +527,11 @@ npx ecc-agentshield init [GitHub](https://github.com/affaan-m/agentshield) | [npm](https://www.npmjs.com/package/ecc-agentshield) -### 🔬 Plankton — 编写时代码质量强制执行 +### Plankton — 编写时代码质量强制执行 Plankton(致谢:@alxfazio)是用于编写时代码质量强制执行的推荐伴侣。它通过 PostToolUse 钩子在每次文件编辑时运行格式化程序和 20 多个代码检查器,然后生成 Claude 子进程(根据违规复杂度路由到 Haiku/Sonnet/Opus)来修复主智能体遗漏的问题。采用三阶段架构:静默自动格式化(解决 40-50% 的问题),将剩余的违规收集为结构化 JSON,委托给子进程修复。包含配置保护钩子,防止智能体修改检查器配置以通过检查而非修复代码。支持 Python、TypeScript、Shell、YAML、JSON、TOML、Markdown 和 Dockerfile。与 AgentShield 结合使用,实现安全 + 质量覆盖。完整集成指南请参阅 `skills/plankton-code-quality/`。 -### 🧠 持续学习 v2 +### 持续学习 v2 基于本能的学习系统会自动学习您的模式: @@ -546,7 +546,7 @@ Plankton(致谢:@alxfazio)是用于编写时代码质量强制执行的推 *** -## 📋 要求 +## 要求 ### Claude Code CLI 版本 @@ -562,7 +562,7 @@ claude --version ### 重要提示:钩子自动加载行为 -> ⚠️ **对于贡献者:** 请勿向 `.claude-plugin/plugin.json` 添加 `"hooks"` 字段。这由回归测试强制执行。 +> WARNING: **对于贡献者:** 请勿向 `.claude-plugin/plugin.json` 添加 `"hooks"` 字段。这由回归测试强制执行。 Claude Code v2.1+ **会自动加载** 任何已安装插件中的 `hooks/hooks.json`(按约定)。在 `plugin.json` 中显式声明会导致重复检测错误: @@ -574,7 +574,7 @@ Claude Code v2.1+ **会自动加载** 任何已安装插件中的 `hooks/hooks.j *** -## 📥 安装 +## 安装 ### 选项 1:作为插件安装(推荐) @@ -630,7 +630,7 @@ Claude Code v2.1+ **会自动加载** 任何已安装插件中的 `hooks/hooks.j *** -### 🔧 选项 2:手动安装 +### 选项 2:手动安装 如果您希望对安装的内容进行手动控制: @@ -658,7 +658,7 @@ cp -r everything-claude-code/skills/search-first ~/.claude/skills/ # Optional: add niche/framework-specific skills only when needed # for s in django-patterns django-tdd laravel-patterns springboot-patterns; do -# cp -r everything-claude-code/skills/$s ~/.claude/skills/ +# cp -r everything-claude-code/skills/$s ~/.claude/skills/ # done ``` @@ -674,7 +674,7 @@ cp -r everything-claude-code/skills/search-first ~/.claude/skills/ *** -## 🎯 关键概念 +## 关键概念 ### 智能体 @@ -738,7 +738,7 @@ rules/ *** -## 🗺️ 我应该使用哪个代理? +## 我应该使用哪个代理? 不确定从哪里开始?使用这个快速参考: @@ -787,7 +787,7 @@ rules/ *** -## ❓ 常见问题 +## 常见问题
如何检查已安装的代理/命令? @@ -895,7 +895,7 @@ cp -r everything-claude-code/rules/common/* ~/.claude/rules/ *** -## 🧪 运行测试 +## 运行测试 该插件包含一个全面的测试套件: @@ -911,7 +911,7 @@ node tests/hooks/hooks.test.js *** -## 🤝 贡献 +## 贡献 **欢迎并鼓励贡献。** @@ -1074,7 +1074,7 @@ ECC 附带了三个示例角色配置: *** -## 🔌 OpenCode 支持 +## OpenCode 支持 ECC 提供 **完整的 OpenCode 支持**,包括插件和钩子。 @@ -1094,13 +1094,13 @@ opencode | 功能特性 | Claude Code | OpenCode | 状态 | |---------|-------------|----------|--------| -| 智能体 | ✅ 28 个 | ✅ 12 个 | **Claude Code 领先** | -| 命令 | ✅ 59 个 | ✅ 31 个 | **Claude Code 领先** | -| 技能 | ✅ 116 项 | ✅ 37 项 | **Claude Code 领先** | -| 钩子 | ✅ 8 种事件类型 | ✅ 11 种事件 | **OpenCode 更多!** | -| 规则 | ✅ 29 条 | ✅ 13 条指令 | **Claude Code 领先** | -| MCP 服务器 | ✅ 14 个 | ✅ 完整 | **完全对等** | -| 自定义工具 | ✅ 通过钩子 | ✅ 6 个原生工具 | **OpenCode 更优** | +| 智能体 | PASS: 28 个 | PASS: 12 个 | **Claude Code 领先** | +| 命令 | PASS: 59 个 | PASS: 31 个 | **Claude Code 领先** | +| 技能 | PASS: 116 项 | PASS: 37 项 | **Claude Code 领先** | +| 钩子 | PASS: 8 种事件类型 | PASS: 11 种事件 | **OpenCode 更多!** | +| 规则 | PASS: 29 条 | PASS: 13 条指令 | **Claude Code 领先** | +| MCP 服务器 | PASS: 14 个 | PASS: 完整 | **完全对等** | +| 自定义工具 | PASS: 通过钩子 | PASS: 6 个原生工具 | **OpenCode 更优** | ### 通过插件实现的钩子支持 @@ -1229,7 +1229,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 *** -## 📖 背景 +## 背景 我从实验性推出以来就一直在使用 Claude Code。在 2025 年 9 月,与 [@DRodriguezFX](https://x.com/DRodriguezFX) 一起使用 Claude Code 构建 [zenith.chat](https://zenith.chat),赢得了 Anthropic x Forum Ventures 黑客马拉松。 @@ -1311,7 +1311,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 *** -## ⚠️ 重要说明 +## WARNING: 重要说明 ### 令牌优化 @@ -1344,7 +1344,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 *** -## 💜 赞助商 +## 赞助商 这个项目是免费和开源的。赞助商帮助保持其维护和发展。 @@ -1352,13 +1352,13 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 *** -## 🌟 Star 历史 +## Star 历史 [![Star History Chart](https://api.star-history.com/svg?repos=affaan-m/everything-claude-code\&type=Date)](https://star-history.com/#affaan-m/everything-claude-code\&Date) *** -## 🔗 链接 +## 链接 * **速查指南(从这里开始):** [Claude Code 速查指南](https://x.com/affaanmustafa/status/2012378465664745795) * **详细指南(进阶):** [Claude Code 详细指南](https://x.com/affaanmustafa/status/2014040193557471352) @@ -1368,7 +1368,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 *** -## 📄 许可证 +## 许可证 MIT - 自由使用,根据需要修改,如果可以请回馈贡献。 diff --git a/docs/zh-CN/agents/planner.md b/docs/zh-CN/agents/planner.md index 36412e55..777dec25 100644 --- a/docs/zh-CN/agents/planner.md +++ b/docs/zh-CN/agents/planner.md @@ -129,33 +129,33 @@ model: opus ## 实施步骤 ### 阶段 1:数据库与后端 (2 个文件) -1. **创建订阅数据迁移** (文件:supabase/migrations/004_subscriptions.sql) +1. **创建订阅数据迁移** (文件:supabase/migrations/004_subscriptions.sql) - 操作:使用 RLS 策略 CREATE TABLE subscriptions - 原因:在服务器端存储计费状态,绝不信任客户端 - 依赖:无 - 风险:低 -2. **创建 Stripe webhook 处理器** (文件:src/app/api/webhooks/stripe/route.ts) +2. **创建 Stripe webhook 处理器** (文件:src/app/api/webhooks/stripe/route.ts) - 操作:处理 checkout.session.completed、customer.subscription.updated、customer.subscription.deleted 事件 - 原因:保持订阅状态与 Stripe 同步 - 依赖:步骤 1(需要 subscriptions 表) - 风险:高 — webhook 签名验证至关重要 ### 阶段 2:Checkout 流程 (2 个文件) -3. **创建 checkout API 路由** (文件:src/app/api/checkout/route.ts) +3. **创建 checkout API 路由** (文件:src/app/api/checkout/route.ts) - 操作:使用 price_id 和 success/cancel URL 创建 Stripe Checkout 会话 - 原因:服务器端会话创建可防止价格篡改 - 依赖:步骤 1 - 风险:中 — 必须验证用户已认证 -4. **构建定价页面** (文件:src/components/PricingTable.tsx) +4. **构建定价页面** (文件:src/components/PricingTable.tsx) - 操作:显示三个等级,包含功能对比和升级按钮 - 原因:面向用户的升级流程 - 依赖:步骤 3 - 风险:低 ### 阶段 3:功能权限控制 (1 个文件) -5. **添加基于等级的中间件** (文件:src/middleware.ts) +5. **添加基于等级的中间件** (文件:src/middleware.ts) - 操作:在受保护的路由上检查订阅等级,重定向免费用户 - 原因:在服务器端强制执行等级限制 - 依赖:步骤 1-2(需要订阅数据) diff --git a/docs/zh-CN/commands/aside.md b/docs/zh-CN/commands/aside.md index 8cd27f43..e9e594ce 100644 --- a/docs/zh-CN/commands/aside.md +++ b/docs/zh-CN/commands/aside.md @@ -81,7 +81,7 @@ What would you like to know? (ask your question and I'll answer without losing t ``` ASIDE: [answer] -⚠️ Note: This answer suggests [issue] with the current approach. Want to address this before continuing, or proceed as planned? +WARNING: Note: This answer suggests [issue] with the current approach. Want to address this before continuing, or proceed as planned? ``` 等待用户的决定后再恢复。 @@ -128,7 +128,7 @@ That's the short version. Want a deeper explanation after we finish [current tas ``` ASIDE: [answer] -📝 Worth fixing: [what should be changed]. I'll flag this after the current task unless you want to address it now. + Worth fixing: [what should be changed]. I'll flag this after the current task unless you want to address it now. ``` **问题含糊不清或过于笼统:** @@ -159,7 +159,7 @@ No — the shared cache object in src/cache/store.ts:34 is mutated without locki Under concurrent requests this is a race condition. It's low risk in a single-process Node.js server but would be a real problem with worker threads or clustering. -⚠️ Note: This could affect the feature we're building. Want to address this now or continue and fix it in a follow-up? +WARNING: Note: This could affect the feature we're building. Want to address this now or continue and fix it in a follow-up? ``` *** diff --git a/docs/zh-CN/commands/cpp-build.md b/docs/zh-CN/commands/cpp-build.md index 54054844..c919a727 100644 --- a/docs/zh-CN/commands/cpp-build.md +++ b/docs/zh-CN/commands/cpp-build.md @@ -128,7 +128,7 @@ All tests passed. | 已修改的文件 | 2 | | 剩余问题 | 0 | -构建状态:✅ 成功 +构建状态:PASS: 成功 ``` ## 常见错误修复 diff --git a/docs/zh-CN/commands/cpp-review.md b/docs/zh-CN/commands/cpp-review.md index 12c92a3e..9a817edb 100644 --- a/docs/zh-CN/commands/cpp-review.md +++ b/docs/zh-CN/commands/cpp-review.md @@ -115,16 +115,16 @@ void processUser(const User& user) { * 高:1 * 中:0 -建议:❌ 在严重问题修复前阻止合并 +建议:FAIL: 在严重问题修复前阻止合并 ``` ## 批准标准 | 状态 | 条件 | |--------|-----------| -| ✅ 批准 | 没有 CRITICAL 或 HIGH 级别的问题 | -| ⚠️ 警告 | 仅有 MEDIUM 级别的问题(谨慎合并) | -| ❌ 阻止 | 发现 CRITICAL 或 HIGH 级别的问题 | +| PASS: 批准 | 没有 CRITICAL 或 HIGH 级别的问题 | +| WARNING: 警告 | 仅有 MEDIUM 级别的问题(谨慎合并) | +| FAIL: 阻止 | 发现 CRITICAL 或 HIGH 级别的问题 | ## 与其他命令的集成 diff --git a/docs/zh-CN/commands/e2e.md b/docs/zh-CN/commands/e2e.md index a675d0fa..e6ce7f86 100644 --- a/docs/zh-CN/commands/e2e.md +++ b/docs/zh-CN/commands/e2e.md @@ -184,7 +184,7 @@ Artifacts generated: ╔══════════════════════════════════════════════════════════════╗ ║ E2E 测试结果 ║ ╠══════════════════════════════════════════════════════════════╣ -║ 状态: ✅ 所有测试通过 ║ +║ 状态: PASS: 所有测试通过 ║ ║ 总计: 3 项测试 ║ ║ 通过: 3 (100%) ║ ║ 失败: 0 ║ @@ -193,15 +193,15 @@ Artifacts generated: ╚══════════════════════════════════════════════════════════════╝ 产物: -📸 截图: 2 个文件 -📹 视频: 0 个文件(仅在失败时生成) -🔍 追踪文件: 0 个文件(仅在失败时生成) -📊 HTML 报告: playwright-report/index.html + 截图: 2 个文件 + 视频: 0 个文件(仅在失败时生成) + 追踪文件: 0 个文件(仅在失败时生成) + HTML 报告: playwright-report/index.html 查看报告: npx playwright show-report ``` -✅ E2E 测试套件已准备好进行 CI/CD 集成! +PASS: E2E 测试套件已准备好进行 CI/CD 集成! ```` ## 测试产物 @@ -238,7 +238,7 @@ open artifacts/search-results.png 如果测试间歇性失败: ``` -⚠️ FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts +WARNING: FLAKY TEST DETECTED: tests/e2e/markets/trade.spec.ts 测试通过了 7/10 次运行 (70% 通过率) @@ -258,10 +258,10 @@ open artifacts/search-results.png 默认情况下,测试在多个浏览器上运行: -* ✅ Chromium(桌面版 Chrome) -* ✅ Firefox(桌面版) -* ✅ WebKit(桌面版 Safari) -* ✅ 移动版 Chrome(可选) +* PASS: Chromium(桌面版 Chrome) +* PASS: Firefox(桌面版) +* PASS: WebKit(桌面版 Safari) +* PASS: 移动版 Chrome(可选) 在 `playwright.config.ts` 中配置以调整浏览器。 @@ -289,7 +289,7 @@ open artifacts/search-results.png 对于 PMX,请优先考虑以下 E2E 测试: -**🔴 关键(必须始终通过):** +**关键(必须始终通过):** 1. 用户可以连接钱包 2. 用户可以浏览市场 @@ -299,7 +299,7 @@ open artifacts/search-results.png 6. 市场正确结算 7. 用户可以提取资金 -**🟡 重要:** +**重要:** 1. 市场创建流程 2. 用户资料更新 @@ -312,21 +312,21 @@ open artifacts/search-results.png **应该:** -* ✅ 使用页面对象模型以提高可维护性 -* ✅ 使用 data-testid 属性作为选择器 -* ✅ 等待 API 响应,而不是使用任意超时 -* ✅ 测试关键用户旅程的端到端 -* ✅ 在合并到主分支前运行测试 -* ✅ 在测试失败时审查工件 +* PASS: 使用页面对象模型以提高可维护性 +* PASS: 使用 data-testid 属性作为选择器 +* PASS: 等待 API 响应,而不是使用任意超时 +* PASS: 测试关键用户旅程的端到端 +* PASS: 在合并到主分支前运行测试 +* PASS: 在测试失败时审查工件 **不应该:** -* ❌ 使用不稳定的选择器(CSS 类可能会改变) -* ❌ 测试实现细节 -* ❌ 针对生产环境运行测试 -* ❌ 忽略不稳定测试 -* ❌ 在失败时跳过工件审查 -* ❌ 使用 E2E 测试每个边缘情况(使用单元测试) +* FAIL: 使用不稳定的选择器(CSS 类可能会改变) +* FAIL: 测试实现细节 +* FAIL: 针对生产环境运行测试 +* FAIL: 忽略不稳定测试 +* FAIL: 在失败时跳过工件审查 +* FAIL: 使用 E2E 测试每个边缘情况(使用单元测试) ## 重要注意事项 diff --git a/docs/zh-CN/commands/go-build.md b/docs/zh-CN/commands/go-build.md index d59638f1..a1afabdc 100644 --- a/docs/zh-CN/commands/go-build.md +++ b/docs/zh-CN/commands/go-build.md @@ -139,7 +139,7 @@ ok project/internal/handler 0.023s | 已修改的文件 | 2 | | 剩余问题 | 0 | -构建状态:✅ 成功 +构建状态:PASS: 成功 ``` ## 常见错误修复 diff --git a/docs/zh-CN/commands/go-review.md b/docs/zh-CN/commands/go-review.md index bb2fdc9d..0cd11f75 100644 --- a/docs/zh-CN/commands/go-review.md +++ b/docs/zh-CN/commands/go-review.md @@ -131,16 +131,16 @@ return fmt.Errorf("get user %s: %w", userID, err) * 高:1 * 中:0 -建议:❌ 在严重问题修复前阻止合并 +建议:FAIL: 在严重问题修复前阻止合并 ``` ## 批准标准 | 状态 | 条件 | |--------|-----------| -| ✅ 批准 | 无 CRITICAL 或 HIGH 级别问题 | -| ⚠️ 警告 | 仅有 MEDIUM 级别问题 (谨慎合并) | -| ❌ 阻止 | 发现 CRITICAL 或 HIGH 级别问题 | +| PASS: 批准 | 无 CRITICAL 或 HIGH 级别问题 | +| WARNING: 警告 | 仅有 MEDIUM 级别问题 (谨慎合并) | +| FAIL: 阻止 | 发现 CRITICAL 或 HIGH 级别问题 | ## 与其他命令的集成 diff --git a/docs/zh-CN/commands/instinct-import.md b/docs/zh-CN/commands/instinct-import.md index 6956c2a8..7dd52c9d 100644 --- a/docs/zh-CN/commands/instinct-import.md +++ b/docs/zh-CN/commands/instinct-import.md @@ -44,7 +44,7 @@ python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import < ## 导入过程 ``` -📥 从 team-instincts.yaml 导入本能 + 从 team-instincts.yaml 导入本能 ================================================ 发现 12 个待导入的本能。 @@ -60,12 +60,12 @@ python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import < ## 重复本能 (3) 已存在类似本能: - ⚠️ prefer-functional-style + WARNING: prefer-functional-style 本地: 0.8 置信度, 12 次观察 导入: 0.7 置信度 → 保留本地 (置信度更高) - ⚠️ test-first-workflow + WARNING: test-first-workflow 本地: 0.75 置信度 导入: 0.9 置信度 → 更新为导入 (置信度更高) @@ -105,10 +105,10 @@ project_name: "my-project" 导入后: ``` -✅ 导入完成! +PASS: 导入完成! -新增:8 项本能 -更新:1 项本能 +新增:8 项本能 +更新:1 项本能 跳过:3 项本能(已存在同等或更高置信度的版本) 新本能已保存至:~/.claude/homunculus/instincts/inherited/ diff --git a/docs/zh-CN/commands/kotlin-build.md b/docs/zh-CN/commands/kotlin-build.md index 3c7807d4..4e3e1055 100644 --- a/docs/zh-CN/commands/kotlin-build.md +++ b/docs/zh-CN/commands/kotlin-build.md @@ -132,7 +132,7 @@ $ ./gradlew test | Files modified | 2 | | Remaining issues | 0 | -Build Status: ✅ SUCCESS +Build Status: PASS: SUCCESS ```` ## 常见的已修复错误 diff --git a/docs/zh-CN/commands/kotlin-review.md b/docs/zh-CN/commands/kotlin-review.md index fd1681cc..abf300ce 100644 --- a/docs/zh-CN/commands/kotlin-review.md +++ b/docs/zh-CN/commands/kotlin-review.md @@ -84,7 +84,7 @@ Agent: ## Static Analysis Results ✓ Build: Successful ✓ detekt: No issues -⚠ ktlint: 2 formatting warnings +WARNING: ktlint: 2 formatting warnings ## Issues Found @@ -120,16 +120,16 @@ launch { - HIGH: 1 - MEDIUM: 0 -Recommendation: ❌ Block merge until CRITICAL issue is fixed +Recommendation: FAIL: Block merge until CRITICAL issue is fixed ```` ## 批准标准 | 状态 | 条件 | |--------|-----------| -| ✅ 批准 | 无严重或高优先级问题 | -| ⚠️ 警告 | 仅存在中优先级问题(谨慎合并) | -| ❌ 阻止 | 发现严重或高优先级问题 | +| PASS: 批准 | 无严重或高优先级问题 | +| WARNING: 警告 | 仅存在中优先级问题(谨慎合并) | +| FAIL: 阻止 | 发现严重或高优先级问题 | ## 与其他命令的集成 diff --git a/docs/zh-CN/commands/learn-eval.md b/docs/zh-CN/commands/learn-eval.md index edbad0b7..71fc5802 100644 --- a/docs/zh-CN/commands/learn-eval.md +++ b/docs/zh-CN/commands/learn-eval.md @@ -74,7 +74,7 @@ origin: auto-extracted | **吸收到 \[X]** | 应追加到现有技能 | 显示目标技能和添加内容 → 步骤 6 | | **放弃** | 琐碎、冗余或过于抽象 | 解释原因并停止 | - **指导维度**(用于告知裁决,不进行评分): +**指导维度**(用于告知裁决,不进行评分): * **具体性和可操作性**:包含可立即使用的代码示例或命令 * **范围契合度**:名称、触发条件和内容保持一致,并专注于单一模式 diff --git a/docs/zh-CN/commands/multi-plan.md b/docs/zh-CN/commands/multi-plan.md index d915b43b..6b8ffa85 100644 --- a/docs/zh-CN/commands/multi-plan.md +++ b/docs/zh-CN/commands/multi-plan.md @@ -209,11 +209,11 @@ mcp__ace-tool__search_context({ 3. 以 **粗体文本** 输出提示(必须使用实际保存的文件路径): - *** +*** - **计划已生成并保存至 `.claude/plan/actual-feature-name.md`** +**计划已生成并保存至 `.claude/plan/actual-feature-name.md`** - **请审阅以上计划。您可以:** +**请审阅以上计划。您可以:** * **修改计划**:告诉我需要调整的内容,我会更新计划 * **执行计划**:复制以下命令到新会话 @@ -222,9 +222,9 @@ mcp__ace-tool__search_context({ /ccg:execute .claude/plan/actual-feature-name.md ``` - *** +*** - **注意**:上面的 `actual-feature-name.md` 必须替换为实际保存的文件名! +**注意**:上面的 `actual-feature-name.md` 必须替换为实际保存的文件名! 4. **立即终止当前响应**(在此停止。不再进行工具调用。) diff --git a/docs/zh-CN/commands/python-review.md b/docs/zh-CN/commands/python-review.md index ce9690e4..eb9f7656 100644 --- a/docs/zh-CN/commands/python-review.md +++ b/docs/zh-CN/commands/python-review.md @@ -93,7 +93,7 @@ Agent: ## Static Analysis Results ✓ ruff: No issues ✓ mypy: No errors -⚠️ black: 2 files need reformatting +WARNING: black: 2 files need reformatting ✓ bandit: No security issues ## Issues Found @@ -171,7 +171,7 @@ with open("config.json") as f: # Good * 高:1 * 中:2 -建议:❌ 在关键问题修复前阻止合并 +建议:FAIL: 在关键问题修复前阻止合并 ## 所需的格式化 @@ -182,9 +182,9 @@ with open("config.json") as f: # Good | 状态 | 条件 | |--------|-----------| -| ✅ 批准 | 无 CRITICAL 或 HIGH 级别问题 | -| ⚠️ 警告 | 仅存在 MEDIUM 级别问题(谨慎合并) | -| ❌ 阻止 | 发现 CRITICAL 或 HIGH 级别问题 | +| PASS: 批准 | 无 CRITICAL 或 HIGH 级别问题 | +| WARNING: 警告 | 仅存在 MEDIUM 级别问题(谨慎合并) | +| FAIL: 阻止 | 发现 CRITICAL 或 HIGH 级别问题 | ## 与其他命令的集成 diff --git a/docs/zh-CN/commands/refactor-clean.md b/docs/zh-CN/commands/refactor-clean.md index b1cd9eae..83346a06 100644 --- a/docs/zh-CN/commands/refactor-clean.md +++ b/docs/zh-CN/commands/refactor-clean.md @@ -72,7 +72,7 @@ 已跳过: 2 个项目(测试失败) 已节省: ~450 行代码被移除 ────────────────────────────── -所有测试通过 ✅ +所有测试通过 PASS: ``` ## 规则 diff --git a/docs/zh-CN/commands/resume-session.md b/docs/zh-CN/commands/resume-session.md index 338cbd9c..f959770e 100644 --- a/docs/zh-CN/commands/resume-session.md +++ b/docs/zh-CN/commands/resume-session.md @@ -64,9 +64,9 @@ description: 从 ~/.claude/sessions/ 加载最新的会话文件,并从上次 [用你自己的话总结 2-3 句话] 当前状态: -✅ 已完成:[数量] 项已确认 -🔄 进行中:[列出进行中的文件] -🗒️ 未开始:[列出计划但未开始的文件] +PASS: 已完成:[数量] 项已确认 + 进行中:[列出进行中的文件] + 未开始:[列出计划但未开始的文件] 不应重试的内容: [列出每个失败的方法及其原因——此部分至关重要] @@ -98,10 +98,10 @@ description: 从 ~/.claude/sessions/ 加载最新的会话文件,并从上次 加载该日期最近修改的匹配文件,无论其使用的是旧的无ID格式还是当前的短ID格式。 **会话文件引用了已不存在的文件:** -在简报中注明 — "⚠️ 会话中引用了 `path/to/file.ts`,但在磁盘上未找到。" +在简报中注明 — "WARNING: 会话中引用了 `path/to/file.ts`,但在磁盘上未找到。" **会话文件来自超过7天前:** -注明时间间隔 — "⚠️ 此会话来自 N 天前(阈值:7天)。情况可能已发生变化。" — 然后正常继续。 +注明时间间隔 — "WARNING: 此会话来自 N 天前(阈值:7天)。情况可能已发生变化。" — 然后正常继续。 **用户直接提供了文件路径(例如,从队友处转发而来):** 读取它并遵循相同的简报流程 — 无论来源如何,格式都是相同的。 @@ -124,13 +124,13 @@ SESSION LOADED: /Users/you/.claude/sessions/2024-01-15-abc123de-session.tmp 注册和登录端点已部分完成。通过中间件进行路由保护尚未开始。 当前状态: -✅ 已完成:3 项(注册端点、JWT 生成、密码哈希) -🔄 进行中:app/api/auth/login/route.ts(令牌有效,但 cookie 尚未设置) -🗒️ 未开始:middleware.ts、app/login/page.tsx +PASS: 已完成:3 项(注册端点、JWT 生成、密码哈希) + 进行中:app/api/auth/login/route.ts(令牌有效,但 cookie 尚未设置) + 未开始:middleware.ts、app/login/page.tsx 需避免的事项: -❌ Next-Auth — 与自定义 Prisma 适配器冲突,每次请求均抛出适配器错误 -❌ localStorage 存储 JWT — 导致 SSR 水合不匹配,与 Next.js 不兼容 +FAIL: Next-Auth — 与自定义 Prisma 适配器冲突,每次请求均抛出适配器错误 +FAIL: localStorage 存储 JWT — 导致 SSR 水合不匹配,与 Next.js 不兼容 待解决问题 / 阻碍: - cookies().set() 在路由处理器中是否有效,还是仅适用于服务器操作? diff --git a/docs/zh-CN/commands/save-session.md b/docs/zh-CN/commands/save-session.md index 8f56f654..3b06f334 100644 --- a/docs/zh-CN/commands/save-session.md +++ b/docs/zh-CN/commands/save-session.md @@ -122,10 +122,10 @@ mkdir -p ~/.claude/sessions | 文件 | 状态 | 备注 | | ----------------- | -------------- | ---------------------------- | -| `path/to/file.ts` | ✅ 完成 | [其作用] | -| `path/to/file.ts` | 🔄 进行中 | [已完成什么,剩余什么] | -| `path/to/file.ts` | ❌ 损坏 | [问题所在] | -| `path/to/file.ts` | 🗒️ 未开始 | [计划但尚未接触] | +| `path/to/file.ts` | PASS: 完成 | [其作用] | +| `path/to/file.ts` | 进行中 | [已完成什么,剩余什么] | +| `path/to/file.ts` | FAIL: 损坏 | [问题所在] | +| `path/to/file.ts` | 未开始 | [计划但尚未接触] | 如果未修改任何文件:"本次会话未修改任何文件。" @@ -213,11 +213,11 @@ mkdir -p ~/.claude/sessions | 文件 | 状态 | 备注 | | -------------------------------- | -------------- | ----------------------------------------------- | -| `app/api/auth/register/route.ts` | ✅ 已完成 | 工作正常,已测试 | -| `app/api/auth/login/route.ts` | 🔄 进行中 | 令牌已生成但尚未设置 cookie | -| `lib/auth.ts` | ✅ 已完成 | JWT 辅助函数,全部已测试 | -| `middleware.ts` | 🗒️ 未开始 | 路由保护,需要先实现 cookie 读取逻辑 | -| `app/login/page.tsx` | 🗒️ 未开始 | UI 尚未开始 | +| `app/api/auth/register/route.ts` | PASS: 已完成 | 工作正常,已测试 | +| `app/api/auth/login/route.ts` | 进行中 | 令牌已生成但尚未设置 cookie | +| `lib/auth.ts` | PASS: 已完成 | JWT 辅助函数,全部已测试 | +| `middleware.ts` | 未开始 | 路由保护,需要先实现 cookie 读取逻辑 | +| `app/login/page.tsx` | 未开始 | UI 尚未开始 | --- diff --git a/docs/zh-CN/commands/tdd.md b/docs/zh-CN/commands/tdd.md index 35fee8ab..fb86731b 100644 --- a/docs/zh-CN/commands/tdd.md +++ b/docs/zh-CN/commands/tdd.md @@ -134,7 +134,7 @@ FAIL lib/liquidity.test.ts 1 test failed, 0 passed ``` -✅ 测试按预期失败。准备实施。 +PASS: 测试按预期失败。准备实施。 ## 步骤 4:实现最小化代码(绿) @@ -180,7 +180,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ 所有测试通过! +PASS: 所有测试通过! ## 步骤 6:重构(改进) @@ -237,7 +237,7 @@ PASS lib/liquidity.test.ts 3 tests passed ``` -✅ 重构完成,测试仍然通过! +PASS: 重构完成,测试仍然通过! ## 步骤 8:检查覆盖率 @@ -248,29 +248,29 @@ File | % Stmts | % Branch | % Funcs | % Lines ---------------|---------|----------|---------|-------- liquidity.ts | 100 | 100 | 100 | 100 -Coverage: 100% ✅ (Target: 80%) +Coverage: 100% PASS: (Target: 80%) ``` -✅ TDD 会话完成! +PASS: TDD 会话完成! ``` ## TDD 最佳实践 **应做:** -- ✅ 先写测试,再写实现 -- ✅ 运行测试并确认失败,再实现功能 -- ✅ 编写最少代码使测试通过 -- ✅ 仅在测试通过后进行重构 -- ✅ 添加边界情况和错误场景 -- ✅ 目标覆盖率 80% 以上(关键代码 100%) +- PASS: 先写测试,再写实现 +- PASS: 运行测试并确认失败,再实现功能 +- PASS: 编写最少代码使测试通过 +- PASS: 仅在测试通过后进行重构 +- PASS: 添加边界情况和错误场景 +- PASS: 目标覆盖率 80% 以上(关键代码 100%) **不应做:** -- ❌ 先写实现再写测试 -- ❌ 每次更改后跳过运行测试 -- ❌ 一次性编写过多代码 -- ❌ 忽略失败的测试 -- ❌ 测试实现细节(应测试行为) -- ❌ 过度模拟(优先使用集成测试) +- FAIL: 先写实现再写测试 +- FAIL: 每次更改后跳过运行测试 +- FAIL: 一次性编写过多代码 +- FAIL: 忽略失败的测试 +- FAIL: 测试实现细节(应测试行为) +- FAIL: 过度模拟(优先使用集成测试) ## 应包含的测试类型 diff --git a/docs/zh-CN/commands/test-coverage.md b/docs/zh-CN/commands/test-coverage.md index fe875b07..c148c112 100644 --- a/docs/zh-CN/commands/test-coverage.md +++ b/docs/zh-CN/commands/test-coverage.md @@ -57,7 +57,7 @@ src/services/auth.ts 45% 88% src/utils/validation.ts 32% 82% ────────────────────────────── -总计: 67% 84% ✅ +总计: 67% 84% PASS: ``` ## 重点关注领域 diff --git a/docs/zh-CN/skills/ai-regression-testing/SKILL.md b/docs/zh-CN/skills/ai-regression-testing/SKILL.md index 85dd4e2f..ef2926b2 100644 --- a/docs/zh-CN/skills/ai-regression-testing/SKILL.md +++ b/docs/zh-CN/skills/ai-regression-testing/SKILL.md @@ -39,7 +39,7 @@ AI 编写修复 → AI 审查修复 → AI 表示“看起来正确” → 漏 → 修复了生产路径,忘记了沙箱路径 → AI 审核时再次遗漏(第 4 次出现) -修复 4:测试在首次运行时立即捕获了问题 ✅ +修复 4:测试在首次运行时立即捕获了问题 PASS: ``` 模式:**沙盒/生产环境路径不一致**是 AI 引入的 #1 回归问题。 @@ -249,14 +249,14 @@ User: "バグチェックして" (or "/bug-check") **频率**:最常见(在 4 个回归问题中观察到 3 个) ```typescript -// ❌ AI adds field to production path only +// FAIL: AI adds field to production path only if (isSandboxMode()) { return { data: { id, email, name } }; // Missing new field } // Production path return { data: { id, email, name, notification_settings } }; -// ✅ Both paths must return the same shape +// PASS: Both paths must return the same shape if (isSandboxMode()) { return { data: { id, email, name, notification_settings: null } }; } @@ -282,7 +282,7 @@ it("sandbox and production return same fields", async () => { **频率**:在使用 Supabase/Prisma 添加新列时常见 ```typescript -// ❌ New column added to response but not to SELECT +// FAIL: New column added to response but not to SELECT const { data } = await supabase .from("users") .select("id, email, name") // notification_settings not here @@ -291,7 +291,7 @@ const { data } = await supabase return { data: { ...data, notification_settings: data.notification_settings } }; // → notification_settings is always undefined -// ✅ Use SELECT * or explicitly include new columns +// PASS: Use SELECT * or explicitly include new columns const { data } = await supabase .from("users") .select("*") @@ -303,13 +303,13 @@ const { data } = await supabase **频率**:中等——当向现有组件添加错误处理时 ```typescript -// ❌ Error state set but old data not cleared +// FAIL: Error state set but old data not cleared catch (err) { setError("Failed to load"); // reservations still shows data from previous tab! } -// ✅ Clear related state on error +// PASS: Clear related state on error catch (err) { setReservations([]); // Clear stale data setError("Failed to load"); @@ -319,14 +319,14 @@ catch (err) { ### 模式 4:乐观更新未正确回滚 ```typescript -// ❌ No rollback on failure +// FAIL: No rollback on failure const handleRemove = async (id: string) => { setItems(prev => prev.filter(i => i.id !== id)); await fetch(`/api/items/${id}`, { method: "DELETE" }); // If API fails, item is gone from UI but still in DB }; -// ✅ Capture previous state and rollback on failure +// PASS: Capture previous state and rollback on failure const handleRemove = async (id: string) => { const prevItems = [...items]; setItems(prev => prev.filter(i => i.id !== id)); @@ -362,11 +362,11 @@ const handleRemove = async (id: string) => { | AI 回归模式 | 测试策略 | 优先级 | |---|---|---| -| 沙盒/生产环境不匹配 | 断言沙盒模式下响应结构相同 | 🔴 高 | -| SELECT 子句遗漏 | 断言响应中包含所有必需字段 | 🔴 高 | -| 错误状态泄漏 | 断言出错时状态已清理 | 🟡 中 | -| 缺少回滚 | 断言 API 失败时状态已恢复 | 🟡 中 | -| 类型转换掩盖 null | 断言字段不为 undefined | 🟡 中 | +| 沙盒/生产环境不匹配 | 断言沙盒模式下响应结构相同 | 高 | +| SELECT 子句遗漏 | 断言响应中包含所有必需字段 | 高 | +| 错误状态泄漏 | 断言出错时状态已清理 | 中 | +| 缺少回滚 | 断言 API 失败时状态已恢复 | 中 | +| 类型转换掩盖 null | 断言字段不为 undefined | 中 | ## 要 / 不要 diff --git a/docs/zh-CN/skills/android-clean-architecture/SKILL.md b/docs/zh-CN/skills/android-clean-architecture/SKILL.md index d5a1ed9b..8f0adf65 100644 --- a/docs/zh-CN/skills/android-clean-architecture/SKILL.md +++ b/docs/zh-CN/skills/android-clean-architecture/SKILL.md @@ -37,10 +37,10 @@ project/ ### 依赖规则 ``` -app → presentation, domain, data, core -presentation → domain, design-system, core -data → domain, core -domain → core (或无依赖) +app → presentation, domain, data, core +presentation → domain, design-system, core +data → domain, core +domain → core (或无依赖) core → (无依赖) ``` diff --git a/docs/zh-CN/skills/backend-patterns/SKILL.md b/docs/zh-CN/skills/backend-patterns/SKILL.md index 98e69d44..30658ed1 100644 --- a/docs/zh-CN/skills/backend-patterns/SKILL.md +++ b/docs/zh-CN/skills/backend-patterns/SKILL.md @@ -23,7 +23,7 @@ origin: ECC ### RESTful API 结构 ```typescript -// ✅ Resource-based URLs +// PASS: Resource-based URLs GET /api/markets # List resources GET /api/markets/:id # Get single resource POST /api/markets # Create resource @@ -31,7 +31,7 @@ PUT /api/markets/:id # Replace resource PATCH /api/markets/:id # Update resource DELETE /api/markets/:id # Delete resource -// ✅ Query parameters for filtering, sorting, pagination +// PASS: Query parameters for filtering, sorting, pagination GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -131,7 +131,7 @@ export default withAuth(async (req, res) => { ### 查询优化 ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -139,7 +139,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -148,13 +148,13 @@ const { data } = await supabase ### N+1 查询预防 ```typescript -// ❌ BAD: N+1 query problem +// FAIL: BAD: N+1 query problem const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N queries } -// ✅ GOOD: Batch fetch +// PASS: GOOD: Batch fetch const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 query diff --git a/docs/zh-CN/skills/carrier-relationship-management/SKILL.md b/docs/zh-CN/skills/carrier-relationship-management/SKILL.md index bf5cf3e9..55ded18d 100644 --- a/docs/zh-CN/skills/carrier-relationship-management/SKILL.md +++ b/docs/zh-CN/skills/carrier-relationship-management/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🤝" + emoji: "" --- # 承运商关系管理 diff --git a/docs/zh-CN/skills/clickhouse-io/SKILL.md b/docs/zh-CN/skills/clickhouse-io/SKILL.md index 2a459859..fd929aab 100644 --- a/docs/zh-CN/skills/clickhouse-io/SKILL.md +++ b/docs/zh-CN/skills/clickhouse-io/SKILL.md @@ -97,7 +97,7 @@ ORDER BY hour DESC; ### 高效过滤 ```sql --- ✅ GOOD: Use indexed columns first +-- PASS: GOOD: Use indexed columns first SELECT * FROM markets_analytics WHERE date >= '2025-01-01' @@ -106,7 +106,7 @@ WHERE date >= '2025-01-01' ORDER BY date DESC LIMIT 100; --- ❌ BAD: Filter on non-indexed columns first +-- FAIL: BAD: Filter on non-indexed columns first SELECT * FROM markets_analytics WHERE volume > 1000 @@ -117,7 +117,7 @@ WHERE volume > 1000 ### 聚合 ```sql --- ✅ GOOD: Use ClickHouse-specific aggregation functions +-- PASS: GOOD: Use ClickHouse-specific aggregation functions SELECT toStartOfDay(created_at) AS day, market_id, @@ -130,7 +130,7 @@ WHERE created_at >= today() - INTERVAL 7 DAY GROUP BY day, market_id ORDER BY day DESC, total_volume DESC; --- ✅ Use quantile for percentiles (more efficient than percentile) +-- PASS: Use quantile for percentiles (more efficient than percentile) SELECT quantile(0.50)(trade_size) AS median, quantile(0.95)(trade_size) AS p95, @@ -173,7 +173,7 @@ const clickhouse = new ClickHouse({ } }) -// ✅ Batch insert (efficient) +// PASS: Batch insert (efficient) async function bulkInsertTrades(trades: Trade[]) { const values = trades.map(trade => `( '${trade.id}', @@ -189,7 +189,7 @@ async function bulkInsertTrades(trades: Trade[]) { `).toPromise() } -// ❌ Individual inserts (slow) +// FAIL: Individual inserts (slow) async function insertTrade(trade: Trade) { // Don't do this in a loop! await clickhouse.query(` diff --git a/docs/zh-CN/skills/coding-standards/SKILL.md b/docs/zh-CN/skills/coding-standards/SKILL.md index f12ba5a8..4fc45089 100644 --- a/docs/zh-CN/skills/coding-standards/SKILL.md +++ b/docs/zh-CN/skills/coding-standards/SKILL.md @@ -52,12 +52,12 @@ origin: ECC ### 变量命名 ```typescript -// ✅ GOOD: Descriptive names +// PASS: GOOD: Descriptive names const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ BAD: Unclear names +// FAIL: BAD: Unclear names const q = 'election' const flag = true const x = 1000 @@ -66,12 +66,12 @@ const x = 1000 ### 函数命名 ```typescript -// ✅ GOOD: Verb-noun pattern +// PASS: GOOD: Verb-noun pattern async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ BAD: Unclear or noun-only +// FAIL: BAD: Unclear or noun-only async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -80,7 +80,7 @@ function email(e) { } ### 不可变性模式 (关键) ```typescript -// ✅ ALWAYS use spread operator +// PASS: ALWAYS use spread operator const updatedUser = { ...user, name: 'New Name' @@ -88,7 +88,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ NEVER mutate directly +// FAIL: NEVER mutate directly user.name = 'New Name' // BAD items.push(newItem) // BAD ``` @@ -96,7 +96,7 @@ items.push(newItem) // BAD ### 错误处理 ```typescript -// ✅ GOOD: Comprehensive error handling +// PASS: GOOD: Comprehensive error handling async function fetchData(url: string) { try { const response = await fetch(url) @@ -112,7 +112,7 @@ async function fetchData(url: string) { } } -// ❌ BAD: No error handling +// FAIL: BAD: No error handling async function fetchData(url) { const response = await fetch(url) return response.json() @@ -122,14 +122,14 @@ async function fetchData(url) { ### Async/Await 最佳实践 ```typescript -// ✅ GOOD: Parallel execution when possible +// PASS: GOOD: Parallel execution when possible const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ BAD: Sequential when unnecessary +// FAIL: BAD: Sequential when unnecessary const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -138,7 +138,7 @@ const stats = await fetchStats() ### 类型安全 ```typescript -// ✅ GOOD: Proper types +// PASS: GOOD: Proper types interface Market { id: string name: string @@ -150,7 +150,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ BAD: Using 'any' +// FAIL: BAD: Using 'any' function getMarket(id: any): Promise { // Implementation } @@ -161,7 +161,7 @@ function getMarket(id: any): Promise { ### 组件结构 ```typescript -// ✅ GOOD: Functional component with types +// PASS: GOOD: Functional component with types interface ButtonProps { children: React.ReactNode onClick: () => void @@ -186,7 +186,7 @@ export function Button({ ) } -// ❌ BAD: No types, unclear structure +// FAIL: BAD: No types, unclear structure export function Button(props) { return } @@ -195,7 +195,7 @@ export function Button(props) { ### 自定义 Hooks ```typescript -// ✅ GOOD: Reusable custom hook +// PASS: GOOD: Reusable custom hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -217,25 +217,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### 状态管理 ```typescript -// ✅ GOOD: Proper state updates +// PASS: GOOD: Proper state updates const [count, setCount] = useState(0) // Functional update for state based on previous state setCount(prev => prev + 1) -// ❌ BAD: Direct state reference +// FAIL: BAD: Direct state reference setCount(count + 1) // Can be stale in async scenarios ``` ### 条件渲染 ```typescript -// ✅ GOOD: Clear conditional rendering +// PASS: GOOD: Clear conditional rendering {isLoading && } {error && } {data && } -// ❌ BAD: Ternary hell +// FAIL: BAD: Ternary hell {isLoading ? : error ? : data ? : null} ``` @@ -258,7 +258,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### 响应格式 ```typescript -// ✅ GOOD: Consistent response structure +// PASS: GOOD: Consistent response structure interface ApiResponse { success: boolean data?: T @@ -289,7 +289,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ GOOD: Schema validation +// PASS: GOOD: Schema validation const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -352,14 +352,14 @@ types/market.types.ts # 使用 .types 后缀的驼峰命名法 ### 何时添加注释 ```typescript -// ✅ GOOD: Explain WHY, not WHAT +// PASS: GOOD: Explain WHY, not WHAT // Use exponential backoff to avoid overwhelming the API during outages const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Deliberately using mutation here for performance with large arrays items.push(newItem) -// ❌ BAD: Stating the obvious +// FAIL: BAD: Stating the obvious // Increment counter by 1 count++ @@ -399,12 +399,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ GOOD: Memoize expensive computations +// PASS: GOOD: Memoize expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ GOOD: Memoize callbacks +// PASS: GOOD: Memoize callbacks const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -415,7 +415,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ GOOD: Lazy load heavy components +// PASS: GOOD: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -430,13 +430,13 @@ export function Dashboard() { ### 数据库查询 ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -463,12 +463,12 @@ test('calculates similarity correctly', () => { ### 测试命名 ```typescript -// ✅ GOOD: Descriptive test names +// PASS: GOOD: Descriptive test names test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ BAD: Vague test names +// FAIL: BAD: Vague test names test('works', () => { }) test('test search', () => { }) ``` @@ -480,12 +480,12 @@ test('test search', () => { }) ### 1. 长函数 ```typescript -// ❌ BAD: Function > 50 lines +// FAIL: BAD: Function > 50 lines function processMarketData() { // 100 lines of code } -// ✅ GOOD: Split into smaller functions +// PASS: GOOD: Split into smaller functions function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -496,7 +496,7 @@ function processMarketData() { ### 2. 深层嵌套 ```typescript -// ❌ BAD: 5+ levels of nesting +// FAIL: BAD: 5+ levels of nesting if (user) { if (user.isAdmin) { if (market) { @@ -509,7 +509,7 @@ if (user) { } } -// ✅ GOOD: Early returns +// PASS: GOOD: Early returns if (!user) return if (!user.isAdmin) return if (!market) return @@ -522,11 +522,11 @@ if (!hasPermission) return ### 3. 魔法数字 ```typescript -// ❌ BAD: Unexplained numbers +// FAIL: BAD: Unexplained numbers if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ GOOD: Named constants +// PASS: GOOD: Named constants const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/docs/zh-CN/skills/context-budget/SKILL.md b/docs/zh-CN/skills/context-budget/SKILL.md index 1d782dbd..767794ac 100644 --- a/docs/zh-CN/skills/context-budget/SKILL.md +++ b/docs/zh-CN/skills/context-budget/SKILL.md @@ -94,7 +94,7 @@ origin: ECC │ CLAUDE.md │ N │ ~X,XXX │ └─────────────────┴────────┴───────────┘ -⚠ 发现的问题 (N): +WARNING: 发现的问题 (N): [按可节省词元数排序] 前 3 项优化建议: diff --git a/docs/zh-CN/skills/continuous-agent-loop/SKILL.md b/docs/zh-CN/skills/continuous-agent-loop/SKILL.md index 091e21c2..58903075 100644 --- a/docs/zh-CN/skills/continuous-agent-loop/SKILL.md +++ b/docs/zh-CN/skills/continuous-agent-loop/SKILL.md @@ -14,7 +14,7 @@ origin: ECC Start | +-- 需要严格的 CI/PR 控制? -- yes --> continuous-pr - | + | +-- 需要 RFC 分解? -- yes --> rfc-dag | +-- 需要探索性并行生成? -- yes --> infinite diff --git a/docs/zh-CN/skills/customs-trade-compliance/SKILL.md b/docs/zh-CN/skills/customs-trade-compliance/SKILL.md index f787a758..d9b70eb2 100644 --- a/docs/zh-CN/skills/customs-trade-compliance/SKILL.md +++ b/docs/zh-CN/skills/customs-trade-compliance/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🌐" + emoji: "" --- # 海关与贸易合规 diff --git a/docs/zh-CN/skills/django-verification/SKILL.md b/docs/zh-CN/skills/django-verification/SKILL.md index 9ea737f4..1329cf7c 100644 --- a/docs/zh-CN/skills/django-verification/SKILL.md +++ b/docs/zh-CN/skills/django-verification/SKILL.md @@ -363,7 +363,7 @@ DJANGO 验证报告 ✓ 无硬编码密钥 ✓ 包含迁移文件 -建议:⚠️ 部署前修复 pip-audit 发现的漏洞 +建议:WARNING: 部署前修复 pip-audit 发现的漏洞 后续步骤: 1. 更新存在漏洞的依赖项 diff --git a/docs/zh-CN/skills/energy-procurement/SKILL.md b/docs/zh-CN/skills/energy-procurement/SKILL.md index 80188609..04437179 100644 --- a/docs/zh-CN/skills/energy-procurement/SKILL.md +++ b/docs/zh-CN/skills/energy-procurement/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "⚡" + emoji: "" --- # 能源采购 diff --git a/docs/zh-CN/skills/frontend-patterns/SKILL.md b/docs/zh-CN/skills/frontend-patterns/SKILL.md index b4d89993..2ba29cdb 100644 --- a/docs/zh-CN/skills/frontend-patterns/SKILL.md +++ b/docs/zh-CN/skills/frontend-patterns/SKILL.md @@ -23,7 +23,7 @@ origin: ECC ### 组合优于继承 ```typescript -// ✅ GOOD: Component composition +// PASS: GOOD: Component composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -294,17 +294,17 @@ export function useMarkets() { ### 记忆化 ```typescript -// ✅ useMemo for expensive computations +// PASS: useMemo for expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback for functions passed to children +// PASS: useCallback for functions passed to children const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo for pure components +// PASS: React.memo for pure components export const MarketCard = React.memo(({ market }) => { return (
@@ -320,7 +320,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Lazy load heavy components +// PASS: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -515,7 +515,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ List animations +// PASS: List animations export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -534,7 +534,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animations +// PASS: Modal animations export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/docs/zh-CN/skills/inventory-demand-planning/SKILL.md b/docs/zh-CN/skills/inventory-demand-planning/SKILL.md index cad9b074..a81445da 100644 --- a/docs/zh-CN/skills/inventory-demand-planning/SKILL.md +++ b/docs/zh-CN/skills/inventory-demand-planning/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "📊" + emoji: "" --- # 库存需求规划 diff --git a/docs/zh-CN/skills/iterative-retrieval/SKILL.md b/docs/zh-CN/skills/iterative-retrieval/SKILL.md index b5c1656c..08d032fe 100644 --- a/docs/zh-CN/skills/iterative-retrieval/SKILL.md +++ b/docs/zh-CN/skills/iterative-retrieval/SKILL.md @@ -38,12 +38,12 @@ origin: ECC ┌─────────────────────────────────────────────┐ │ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ 调度 │─────▶│ 评估 │ │ +│ │ 调度 │─────│ 评估 │ │ │ └──────────┘ └──────────┘ │ │ ▲ │ │ │ │ ▼ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ 循环 │◀─────│ 优化 │ │ +│ │ 循环 │─────│ 优化 │ │ │ └──────────┘ └──────────┘ │ │ │ │ 最多3次循环,然后继续 │ diff --git a/docs/zh-CN/skills/java-coding-standards/SKILL.md b/docs/zh-CN/skills/java-coding-standards/SKILL.md index 66e5baab..8f233893 100644 --- a/docs/zh-CN/skills/java-coding-standards/SKILL.md +++ b/docs/zh-CN/skills/java-coding-standards/SKILL.md @@ -26,22 +26,22 @@ origin: ECC ## 命名 ```java -// ✅ Classes/Records: PascalCase +// PASS: Classes/Records: PascalCase public class MarketService {} public record Money(BigDecimal amount, Currency currency) {} -// ✅ Methods/fields: camelCase +// PASS: Methods/fields: camelCase private final MarketRepository marketRepository; public Market findBySlug(String slug) {} -// ✅ Constants: UPPER_SNAKE_CASE +// PASS: Constants: UPPER_SNAKE_CASE private static final int MAX_PAGE_SIZE = 100; ``` ## 不可变性 ```java -// ✅ Favor records and final fields +// PASS: Favor records and final fields public record MarketDto(Long id, String name, MarketStatus status) {} public class Market { @@ -54,10 +54,10 @@ public class Market { ## Optional 使用 ```java -// ✅ Return Optional from find* methods +// PASS: Return Optional from find* methods Optional market = marketRepository.findBySlug(slug); -// ✅ Map/flatMap instead of get() +// PASS: Map/flatMap instead of get() return market .map(MarketResponse::from) .orElseThrow(() -> new EntityNotFoundException("Market not found")); @@ -66,13 +66,13 @@ return market ## Streams 最佳实践 ```java -// ✅ Use streams for transformations, keep pipelines short +// PASS: Use streams for transformations, keep pipelines short List names = markets.stream() .map(Market::name) .filter(Objects::nonNull) .toList(); -// ❌ Avoid complex nested streams; prefer loops for clarity +// FAIL: Avoid complex nested streams; prefer loops for clarity ``` ## 异常 diff --git a/docs/zh-CN/skills/logistics-exception-management/SKILL.md b/docs/zh-CN/skills/logistics-exception-management/SKILL.md index 2b528564..5c797b9f 100644 --- a/docs/zh-CN/skills/logistics-exception-management/SKILL.md +++ b/docs/zh-CN/skills/logistics-exception-management/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "📦" + emoji: "" --- # 物流异常管理 diff --git a/docs/zh-CN/skills/production-scheduling/SKILL.md b/docs/zh-CN/skills/production-scheduling/SKILL.md index fbdd6508..4ec6f800 100644 --- a/docs/zh-CN/skills/production-scheduling/SKILL.md +++ b/docs/zh-CN/skills/production-scheduling/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🏭" + emoji: "" --- # 生产排程 diff --git a/docs/zh-CN/skills/quality-nonconformance/SKILL.md b/docs/zh-CN/skills/quality-nonconformance/SKILL.md index 2e4cb54c..0afcde19 100644 --- a/docs/zh-CN/skills/quality-nonconformance/SKILL.md +++ b/docs/zh-CN/skills/quality-nonconformance/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🔍" + emoji: "" --- # 质量与不合格品管理 diff --git a/docs/zh-CN/skills/returns-reverse-logistics/SKILL.md b/docs/zh-CN/skills/returns-reverse-logistics/SKILL.md index cb501af8..5853ee48 100644 --- a/docs/zh-CN/skills/returns-reverse-logistics/SKILL.md +++ b/docs/zh-CN/skills/returns-reverse-logistics/SKILL.md @@ -7,7 +7,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🔄" + emoji: "" --- # 退货与逆向物流 diff --git a/docs/zh-CN/skills/rules-distill/SKILL.md b/docs/zh-CN/skills/rules-distill/SKILL.md index c6c8af89..af85158b 100644 --- a/docs/zh-CN/skills/rules-distill/SKILL.md +++ b/docs/zh-CN/skills/rules-distill/SKILL.md @@ -75,21 +75,21 @@ bash ~/.claude/skills/rules-distill/scripts/scan-rules.sh **仅当**满足以下**所有**条件时,才包含一个候选原则: -1. **出现在 2+ 项技能中**:仅出现在一项技能中的原则应保留在该技能中 -2. **可操作的行为改变**:可以写成“做 X”或“不要做 Y”的形式——而不是“X 很重要” -3. **明确的违规风险**:如果忽略此原则,会出什么问题(1 句话) -4. **尚未存在于规则中**:检查全部规则文本——包括以不同措辞表达的概念 +1. **出现在 2+ 项技能中**:仅出现在一项技能中的原则应保留在该技能中 +2. **可操作的行为改变**:可以写成“做 X”或“不要做 Y”的形式——而不是“X 很重要” +3. **明确的违规风险**:如果忽略此原则,会出什么问题(1 句话) +4. **尚未存在于规则中**:检查全部规则文本——包括以不同措辞表达的概念 ## 匹配与裁决 对于每个候选原则,对照全部规则文本进行比较并给出裁决: -- **追加**:添加到现有规则文件的现有章节 -- **修订**:现有规则内容不准确或不充分——提出修正建议 -- **新章节**:在现有规则文件中添加新章节 -- **新文件**:创建新的规则文件 -- **已涵盖**:现有规则已充分涵盖(即使措辞不同) -- **过于具体**:应保留在技能层面 +- **追加**:添加到现有规则文件的现有章节 +- **修订**:现有规则内容不准确或不充分——提出修正建议 +- **新章节**:在现有规则文件中添加新章节 +- **新文件**:创建新的规则文件 +- **已涵盖**:现有规则已充分涵盖(即使措辞不同) +- **过于具体**:应保留在技能层面 ## 输出格式(每个候选原则) @@ -112,9 +112,9 @@ bash ~/.claude/skills/rules-distill/scripts/scan-rules.sh ## 排除 -- 规则中已存在的显而易见的原则 -- 语言/框架特定知识(属于语言特定规则或技能) -- 代码示例和命令(属于技能) +- 规则中已存在的显而易见的原则 +- 语言/框架特定知识(属于语言特定规则或技能) +- 代码示例和命令(属于技能) ```` #### 裁决参考 diff --git a/docs/zh-CN/skills/security-review/SKILL.md b/docs/zh-CN/skills/security-review/SKILL.md index 3df9f45b..bb4e8169 100644 --- a/docs/zh-CN/skills/security-review/SKILL.md +++ b/docs/zh-CN/skills/security-review/SKILL.md @@ -22,14 +22,14 @@ origin: ECC ### 1. 密钥管理 -#### ❌ 绝对不要这样做 +#### FAIL: 绝对不要这样做 ```typescript const apiKey = "sk-proj-xxxxx" // Hardcoded secret const dbPassword = "password123" // In source code ``` -#### ✅ 始终这样做 +#### PASS: 始终这样做 ```typescript const apiKey = process.env.OPENAI_API_KEY @@ -114,7 +114,7 @@ function validateFileUpload(file: File) { ### 3. SQL 注入防护 -#### ❌ 绝对不要拼接 SQL +#### FAIL: 绝对不要拼接 SQL ```typescript // DANGEROUS - SQL Injection vulnerability @@ -122,7 +122,7 @@ const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ 始终使用参数化查询 +#### PASS: 始终使用参数化查询 ```typescript // Safe - parameterized query @@ -150,10 +150,10 @@ await db.query( #### JWT 令牌处理 ```typescript -// ❌ WRONG: localStorage (vulnerable to XSS) +// FAIL: WRONG: localStorage (vulnerable to XSS) localStorage.setItem('token', token) -// ✅ CORRECT: httpOnly cookies +// PASS: CORRECT: httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -323,11 +323,11 @@ app.use('/api/search', searchLimiter) #### 日志记录 ```typescript -// ❌ WRONG: Logging sensitive data +// FAIL: WRONG: Logging sensitive data console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ CORRECT: Redact sensitive data +// PASS: CORRECT: Redact sensitive data console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` @@ -335,7 +335,7 @@ console.log('Payment:', { last4: card.last4, userId }) #### 错误消息 ```typescript -// ❌ WRONG: Exposing internal details +// FAIL: WRONG: Exposing internal details catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -343,7 +343,7 @@ catch (error) { ) } -// ✅ CORRECT: Generic error messages +// PASS: CORRECT: Generic error messages catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/docs/zh-CN/skills/security-review/cloud-infrastructure-security.md b/docs/zh-CN/skills/security-review/cloud-infrastructure-security.md index e1ee991a..11151b32 100644 --- a/docs/zh-CN/skills/security-review/cloud-infrastructure-security.md +++ b/docs/zh-CN/skills/security-review/cloud-infrastructure-security.md @@ -24,7 +24,7 @@ #### 最小权限原则 ```yaml -# ✅ CORRECT: Minimal permissions +# PASS: CORRECT: Minimal permissions iam_role: permissions: - s3:GetObject # Only read access @@ -32,7 +32,7 @@ iam_role: resources: - arn:aws:s3:::my-bucket/* # Specific bucket only -# ❌ WRONG: Overly broad permissions +# FAIL: WRONG: Overly broad permissions iam_role: permissions: - s3:* # All S3 actions @@ -65,14 +65,14 @@ aws iam enable-mfa-device \ #### 云密钥管理器 ```typescript -// ✅ CORRECT: Use cloud secrets manager +// PASS: CORRECT: Use cloud secrets manager import { SecretsManager } from '@aws-sdk/client-secrets-manager'; const client = new SecretsManager({ region: 'us-east-1' }); const secret = await client.getSecretValue({ SecretId: 'prod/api-key' }); const apiKey = JSON.parse(secret.SecretString).key; -// ❌ WRONG: Hardcoded or in environment variables only +// FAIL: WRONG: Hardcoded or in environment variables only const apiKey = process.env.API_KEY; // Not rotated, not audited ``` @@ -99,17 +99,17 @@ aws secretsmanager rotate-secret \ #### VPC 和防火墙配置 ```terraform -# ✅ CORRECT: Restricted security group +# PASS: CORRECT: Restricted security group resource "aws_security_group" "app" { name = "app-sg" - + ingress { from_port = 443 to_port = 443 protocol = "tcp" cidr_blocks = ["10.0.0.0/16"] # Internal VPC only } - + egress { from_port = 443 to_port = 443 @@ -118,7 +118,7 @@ resource "aws_security_group" "app" { } } -# ❌ WRONG: Open to the internet +# FAIL: WRONG: Open to the internet resource "aws_security_group" "bad" { ingress { from_port = 0 @@ -142,7 +142,7 @@ resource "aws_security_group" "bad" { #### CloudWatch/日志记录配置 ```typescript -// ✅ CORRECT: Comprehensive logging +// PASS: CORRECT: Comprehensive logging import { CloudWatchLogsClient, CreateLogStreamCommand } from '@aws-sdk/client-cloudwatch-logs'; const logSecurityEvent = async (event: SecurityEvent) => { @@ -177,7 +177,7 @@ const logSecurityEvent = async (event: SecurityEvent) => { #### 安全流水线配置 ```yaml -# ✅ CORRECT: Secure GitHub Actions workflow +# PASS: CORRECT: Secure GitHub Actions workflow name: Deploy on: @@ -189,18 +189,18 @@ jobs: runs-on: ubuntu-latest permissions: contents: read # Minimal permissions - + steps: - uses: actions/checkout@v4 - + # Scan for secrets - name: Secret scanning uses: trufflesecurity/trufflehog@main - + # Dependency audit - name: Audit dependencies run: npm audit --audit-level=high - + # Use OIDC, not long-lived tokens - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 @@ -237,18 +237,18 @@ jobs: #### Cloudflare 安全配置 ```typescript -// ✅ CORRECT: Cloudflare Workers with security headers +// PASS: CORRECT: Cloudflare Workers with security headers export default { async fetch(request: Request): Promise { const response = await fetch(request); - + // Add security headers const headers = new Headers(response.headers); headers.set('X-Frame-Options', 'DENY'); headers.set('X-Content-Type-Options', 'nosniff'); headers.set('Referrer-Policy', 'strict-origin-when-cross-origin'); headers.set('Permissions-Policy', 'geolocation=(), microphone=()'); - + return new Response(response.body, { status: response.status, headers @@ -281,17 +281,17 @@ export default { #### 自动化备份 ```terraform -# ✅ CORRECT: Automated RDS backups +# PASS: CORRECT: Automated RDS backups resource "aws_db_instance" "main" { allocated_storage = 20 engine = "postgres" - + backup_retention_period = 30 # 30 days retention backup_window = "03:00-04:00" maintenance_window = "mon:04:00-mon:05:00" - + enabled_cloudwatch_logs_exports = ["postgresql"] - + deletion_protection = true # Prevent accidental deletion } ``` @@ -327,10 +327,10 @@ resource "aws_db_instance" "main" { ### S3 存储桶暴露 ```bash -# ❌ WRONG: Public bucket +# FAIL: WRONG: Public bucket aws s3api put-bucket-acl --bucket my-bucket --acl public-read -# ✅ CORRECT: Private bucket with specific access +# PASS: CORRECT: Private bucket with specific access aws s3api put-bucket-acl --bucket my-bucket --acl private aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ``` @@ -338,12 +338,12 @@ aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ### RDS 公开访问 ```terraform -# ❌ WRONG +# FAIL: WRONG resource "aws_db_instance" "bad" { publicly_accessible = true # NEVER do this! } -# ✅ CORRECT +# PASS: CORRECT resource "aws_db_instance" "good" { publicly_accessible = false vpc_security_group_ids = [aws_security_group.db.id] diff --git a/docs/zh-CN/skills/tdd-workflow/SKILL.md b/docs/zh-CN/skills/tdd-workflow/SKILL.md index 5e01504a..c4226a1c 100644 --- a/docs/zh-CN/skills/tdd-workflow/SKILL.md +++ b/docs/zh-CN/skills/tdd-workflow/SKILL.md @@ -335,28 +335,28 @@ npm run test:coverage ## 应避免的常见测试错误 -### ❌ 错误:测试实现细节 +### FAIL: 错误:测试实现细节 ```typescript // Don't test internal state expect(component.state.count).toBe(5) ``` -### ✅ 正确:测试用户可见的行为 +### PASS: 正确:测试用户可见的行为 ```typescript // Test what users see expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ 错误:脆弱的定位器 +### FAIL: 错误:脆弱的定位器 ```typescript // Breaks easily await page.click('.css-class-xyz') ``` -### ✅ 正确:语义化定位器 +### PASS: 正确:语义化定位器 ```typescript // Resilient to changes @@ -364,7 +364,7 @@ await page.click('button:has-text("Submit")') await page.click('[data-testid="submit-button"]') ``` -### ❌ 错误:没有测试隔离 +### FAIL: 错误:没有测试隔离 ```typescript // Tests depend on each other @@ -372,7 +372,7 @@ test('creates user', () => { /* ... */ }) test('updates same user', () => { /* depends on previous test */ }) ``` -### ✅ 正确:独立的测试 +### PASS: 正确:独立的测试 ```typescript // Each test sets up its own data diff --git a/docs/zh-CN/skills/team-builder/SKILL.md b/docs/zh-CN/skills/team-builder/SKILL.md index b3678ce5..f54a3d16 100644 --- a/docs/zh-CN/skills/team-builder/SKILL.md +++ b/docs/zh-CN/skills/team-builder/SKILL.md @@ -94,7 +94,7 @@ agents/ 确认选择: ``` -选定:安全工程师 + SEO专家 +选定:安全工程师 + SEO专家 他们应该专注于什么任务?(描述任务) ``` diff --git a/docs/zh-CN/skills/videodb/reference/rtstream-reference.md b/docs/zh-CN/skills/videodb/reference/rtstream-reference.md index fffb88ce..63152f3e 100644 --- a/docs/zh-CN/skills/videodb/reference/rtstream-reference.md +++ b/docs/zh-CN/skills/videodb/reference/rtstream-reference.md @@ -275,7 +275,7 @@ Return only valid JSON.""", # Audio: every 50 words {"type": "word", "value": 50} -# Audio: every 30 seconds +# Audio: every 30 seconds {"type": "time", "value": 30} # Visual: 5 frames every 2 seconds diff --git a/docs/zh-CN/skills/visa-doc-translate/README.md b/docs/zh-CN/skills/visa-doc-translate/README.md index e7aa5071..a4515c96 100644 --- a/docs/zh-CN/skills/visa-doc-translate/README.md +++ b/docs/zh-CN/skills/visa-doc-translate/README.md @@ -4,11 +4,11 @@ ## 功能 -* 🔄 **自动 OCR**:尝试多种 OCR 方法(macOS Vision、EasyOCR、Tesseract) -* 📄 **双语 PDF**:原始图像 + 专业英文翻译 -* 🌍 **多语言支持**:支持中文及其他语言 -* 📋 **专业格式**:适合官方签证申请 -* 🚀 **完全自动化**:无需人工干预 +* **自动 OCR**:尝试多种 OCR 方法(macOS Vision、EasyOCR、Tesseract) +* **双语 PDF**:原始图像 + 专业英文翻译 +* **多语言支持**:支持中文及其他语言 +* **专业格式**:适合官方签证申请 +* **完全自动化**:无需人工干预 ## 支持的文件类型 @@ -80,11 +80,11 @@ pip install pytesseract ## 完美适用于 -* 🇦🇺 澳大利亚签证申请 -* 🇺🇸 美国签证申请 -* 🇨🇦 加拿大签证申请 -* 🇬🇧 英国签证申请 -* 🇪🇺 欧盟签证申请 +* 澳大利亚签证申请 +* 美国签证申请 +* 加拿大签证申请 +* 英国签证申请 +* 欧盟签证申请 ## 许可证 diff --git a/docs/zh-CN/the-openclaw-guide.md b/docs/zh-CN/the-openclaw-guide.md index f5cb2dee..8b2d026e 100644 --- a/docs/zh-CN/the-openclaw-guide.md +++ b/docs/zh-CN/the-openclaw-guide.md @@ -8,7 +8,7 @@ 我使用 OpenClaw 一周。以下是我的发现。 -> 📸 **\[图片:带有多个连接频道的 OpenClaw 仪表板,每个集成点都标注了攻击面标签。]** +> **\[图片:带有多个连接频道的 OpenClaw 仪表板,每个集成点都标注了攻击面标签。]** > *仪表板看起来很令人印象深刻。每个连接也是一扇未上锁的门。* *** @@ -29,7 +29,7 @@ 没有人检查过。 -> 📸 **\[图片:终端截图显示一个 ClawdHub 技能文件,其中包含一个高亮显示的隐藏指令——顶部是可见的任务定义,下方显示被注入的系统指令。已涂改但显示了模式。]** +> **\[图片:终端截图显示一个 ClawdHub 技能文件,其中包含一个高亮显示的隐藏指令——顶部是可见的任务定义,下方显示被注入的系统指令。已涂改但显示了模式。]** > *我在一个“完全正常”的 ClawdHub 技能中发现的隐藏指令,深入代码 12 行。我发现了它,因为我阅读了源代码。* OpenClaw 有很多攻击面。很多频道。很多集成点。很多社区贡献的技能没有审查流程。大约四天后,我意识到,对它最热情的人恰恰是最没有能力评估风险的人。 @@ -56,7 +56,7 @@ OpenClaw 的宣传点:一个开源编排层,让 AI 智能体在你的整个 然后我开始探测其安全模型。便利性开始让人觉得不值得了。 -> 📸 **\[图表:OpenClaw 的多频道架构——一个中央“ClawdBot”节点连接到 Telegram、Discord、X、WhatsApp、电子邮件、浏览器和文件系统的图标。每条连接线都用红色标记为“攻击向量”。]** +> **\[图表:OpenClaw 的多频道架构——一个中央“ClawdBot”节点连接到 Telegram、Discord、X、WhatsApp、电子邮件、浏览器和文件系统的图标。每条连接线都用红色标记为“攻击向量”。]** > *你启用的每个集成都是你留下的另一扇未上锁的门。* *** @@ -77,7 +77,7 @@ OpenClaw 的宣传点:一个开源编排层,让 AI 智能体在你的整个 **步骤 4 —— 权限提升。** 在许多 OpenClaw 设置中,智能体以广泛的文件系统访问权限运行。触发 shell 执行的提示注入意味着游戏结束。那就是对设备的 root 访问权限。 -> 📸 **\[信息图:4 步攻击链,以垂直流程图形式呈现。步骤 1(通过 Telegram 进入)-> 步骤 2(提示注入载荷)-> 步骤 3(在 X、电子邮件、iMessage 之间横向移动)-> 步骤 4(通过 shell 执行获得 root 权限)。背景颜色随着严重性升级从蓝色渐变为红色。]** +> **\[信息图:4 步攻击链,以垂直流程图形式呈现。步骤 1(通过 Telegram 进入)-> 步骤 2(提示注入载荷)-> 步骤 3(在 X、电子邮件、iMessage 之间横向移动)-> 步骤 4(通过 shell 执行获得 root 权限)。背景颜色随着严重性升级从蓝色渐变为红色。]** > *完整的攻击链——从一个看似可信的 Telegram 链接到你设备上的 root 权限。* 这个链条中的每一步都使用了已知的、经过验证的技术。提示注入是 LLM 安全中一个未解决的问题——Anthropic、OpenAI 和其他所有实验室都会告诉你这一点。而 OpenClaw 的架构**最大化**了攻击面,这是设计使然,因为其价值主张就是连接尽可能多的频道。 @@ -98,7 +98,7 @@ Discord 和 WhatsApp 频道中也存在相同的访问点。如果你的 ClawdBo 每个都是一个独立的攻击面。每个都是真实的 OpenClaw 用户正在运行的真实集成。每个都具有相同的基本漏洞:智能体以受信任的权限处理不受信任的输入。 -> 📸 **\[图表:中心辐射图,显示中央的 ClawdBot 连接到 Discord、WhatsApp、X、Telegram、电子邮件。每个辐条显示特定的攻击向量:“频道中的恶意链接”、“消息中的提示注入”、“精心设计的私信”等。箭头显示频道之间横向移动的可能性。]** +> **\[图表:中心辐射图,显示中央的 ClawdBot 连接到 Discord、WhatsApp、X、Telegram、电子邮件。每个辐条显示特定的攻击向量:“频道中的恶意链接”、“消息中的提示注入”、“精心设计的私信”等。箭头显示频道之间横向移动的可能性。]** > *每个频道不仅仅是一个集成——它是一个注入点。每个注入点都可以转向其他每个频道。* *** @@ -148,7 +148,7 @@ Discord 和 WhatsApp 频道中也存在相同的访问点。如果你的 ClawdBo 这就是悖论所在:**能够安全评估 OpenClaw 风险的人不需要它的编排层。需要编排层的人无法安全评估其风险。** -> 📸 **\[维恩图:两个不重叠的圆圈——“可以安全使用 OpenClaw”(不需要 GUI 的技术用户)和“需要 OpenClaw 的 GUI”(无法评估风险的非技术用户)。空白的交集处标注为“悖论”。]** +> **\[维恩图:两个不重叠的圆圈——“可以安全使用 OpenClaw”(不需要 GUI 的技术用户)和“需要 OpenClaw 的 GUI”(无法评估风险的非技术用户)。空白的交集处标注为“悖论”。]** > *OpenClaw 悖论——能够安全使用它的人不需要它。* *** @@ -178,7 +178,7 @@ Karpathy 的反应是:**“这是一场灾难,我也绝对不建议人们在 如果构建代理基础设施的平台连自己的数据库都保护不好,我们怎么能对在这些平台上运行的未经审查的社区贡献有信心呢? -> 📸 **\[数据可视化:显示 Moltbook 泄露数据的统计卡——“149 万条记录暴露”、“3.2 万+ API 密钥”、“3.5 万封电子邮件”、“包含 Karpathy 的机器人 API 密钥”——下方有来源标识。]** +> **\[数据可视化:显示 Moltbook 泄露数据的统计卡——“149 万条记录暴露”、“3.2 万+ API 密钥”、“3.5 万封电子邮件”、“包含 Karpathy 的机器人 API 密钥”——下方有来源标识。]** > *Moltbook 泄露事件的数据。* ### ClawdHub 市场问题 @@ -204,7 +204,7 @@ Karpathy 的反应是:**“这是一场灾难,我也绝对不建议人们在 这是代理时代的 `curl mystery-url.com | bash`。只不过,你不是在运行一个未知的 shell 脚本,而是向一个能够访问你的账户、文件和通信渠道的代理注入未知的提示工程。 -> 📸 **\[时间线图表:“1 月 27 日——上传 230+ 个恶意技能” -> “1 月 30 日——披露 CVE-2026-25253” -> “1 月 31 日——发现 Moltbook 泄露” -> “2026 年 2 月——确认 800+ 个恶意技能”。一周内发生三起重大安全事件。]** +> **\[时间线图表:“1 月 27 日——上传 230+ 个恶意技能” -> “1 月 30 日——披露 CVE-2026-25253” -> “1 月 31 日——发现 Moltbook 泄露” -> “2026 年 2 月——确认 800+ 个恶意技能”。一周内发生三起重大安全事件。]** > *一周内发生三起重大安全事件。这就是代理生态系统中的风险节奏。* ### CVE-2026-25253:一键完全入侵 @@ -234,7 +234,7 @@ Gary Marcus 称之为 **“基本上是一种武器化的气溶胶”**——意 这些不是匿名的 Reddit 帖子或假设场景。这些是带有 CVSS 评分的 CVE、被多家安全公司记录的协调恶意软件活动、被独立研究人员确认的百万记录数据库泄露事件,以及来自世界上最大的网络安全组织的事件报告。担忧的证据基础并不薄弱。它是压倒性的。 -> 📸 **\[引用卡片:分割设计——左侧:CrowdStrike 引用“将提示注入转变为全面入侵的推动者。”右侧:Palo Alto Networks 引用“致命三要素……其架构中内置了过度的代理权。”中间是 CVSS 8.8 徽章。]** +> **\[引用卡片:分割设计——左侧:CrowdStrike 引用“将提示注入转变为全面入侵的推动者。”右侧:Palo Alto Networks 引用“致命三要素……其架构中内置了过度的代理权。”中间是 CVSS 8.8 徽章。]** > *世界上最大的两家网络安全公司,独立得出了相同的结论。* ### 有组织的越狱生态系统 @@ -255,7 +255,7 @@ Gary Marcus 称之为 **“基本上是一种武器化的气溶胶”**——意 防御是集中式的(少数实验室致力于安全研究)。进攻是分布式的(一个全球社区全天候迭代)。更多的渠道意味着更多的注入点,意味着攻击有更多的机会成功。模型只需要失败一次。攻击者可以在每个连接的渠道上获得无限次尝试。 -> 📸 **\[DIAGRAM: "The Adversarial Pipeline" — left-to-right flow: "Abliterated Model (HuggingFace)" -> "Jailbreak Development" -> "Technique Refinement" -> "Production Model Exploit" -> "Delivery via OpenClaw Channel". Each stage labeled with its tooling.]** +> **\[DIAGRAM: "The Adversarial Pipeline" — left-to-right flow: "Abliterated Model (HuggingFace)" -> "Jailbreak Development" -> "Technique Refinement" -> "Production Model Exploit" -> "Delivery via OpenClaw Channel". Each stage labeled with its tooling.]** > *攻击流程:从被破解的模型到生产环境利用,再到通过您代理的连接通道进行交付。* *** @@ -292,7 +292,7 @@ OWASP 引入了一个称为 **最小自主权** 的原则:只授予代理执 | **爆炸半径** | 代理可以访问的一切 | 沙盒化到项目目录 | | **安全态势** | 隐式(您不知道您暴露了什么) | 显式(您选择了每一个权限) | -> 📸 **\[COMPARISON TABLE AS INFOGRAPHIC: The MiniClaw vs OpenClaw table above rendered as a shareable dark-background graphic with green checkmarks for MiniClaw and red indicators for OpenClaw risks.]** +> **\[COMPARISON TABLE AS INFOGRAPHIC: The MiniClaw vs OpenClaw table above rendered as a shareable dark-background graphic with green checkmarks for MiniClaw and red indicators for OpenClaw risks.]** > *MiniClaw 理念:90% 的生产力,5% 的攻击面。* 我的实际设置: @@ -330,12 +330,12 @@ OpenClaw 提供的所有功能都可以用技能和工具来复制——我在 [ **多个接入点是一个漏洞,而不是一个功能。** -> 📸 **\[SPLIT IMAGE: Left — "Locked Door" showing a single SSH terminal with key-based auth. Right — "Open House" showing the multi-channel OpenClaw dashboard with 7+ connected services. Visual contrast between minimal and maximal attack surfaces.]** +> **\[SPLIT IMAGE: Left — "Locked Door" showing a single SSH terminal with key-based auth. Right — "Open House" showing the multi-channel OpenClaw dashboard with 7+ connected services. Visual contrast between minimal and maximal attack surfaces.]** > *左图:一个接入点,一把锁。右图:七扇门,每扇都没锁。* 有时无聊反而更好。 -> 📸 **\[SCREENSHOT: Author's actual terminal — tmux session with Claude Code running on Mac Mini over SSH. Clean, minimal, no dashboard. Annotations: "SSH only", "No exposed ports", "Scoped permissions".]** +> **\[SCREENSHOT: Author's actual terminal — tmux session with Claude Code running on Mac Mini over SSH. Clean, minimal, no dashboard. Annotations: "SSH only", "No exposed ports", "Scoped permissions".]** > *我的实际设置。没有多渠道仪表盘。只有一个终端、SSH 和 Claude Code。* ### 便利的代价 @@ -378,7 +378,7 @@ OpenClaw 可以演变成这样。基础已经存在。社区积极参与。团 我想诚实地谈谈这里的反方论点,因为它并非微不足道。对于确实需要 AI 自动化的非技术用户来说,我描述的替代方案——无头服务器、SSH、tmux——是无法企及的。告诉一位营销经理“直接 SSH 到 Mac Mini”不是一个解决方案。这是一种推诿。对于非技术用户的正确答案不是“不要使用递归代理”。而是“在沙盒化、托管、专业管理的环境中使用它们,那里有专人负责处理安全问题。”您支付订阅费。作为回报,您获得安心。这种模式正在到来。在它到来之前,自托管多通道代理的风险计算严重倾向于“不值得”。 -> 📸 **\[DIAGRAM: "The Winning Architecture" — a layered stack showing: Hosted Infrastructure (bottom) -> Sandboxed Containers (middle) -> Audited Skills + Minimal Permissions (upper) -> Clean Dashboard (top). Each layer labeled with its security property. Contrast with OpenClaw's flat architecture where everything runs on the user's machine.]** +> **\[DIAGRAM: "The Winning Architecture" — a layered stack showing: Hosted Infrastructure (bottom) -> Sandboxed Containers (middle) -> Audited Skills + Minimal Permissions (upper) -> Clean Dashboard (top). Each layer labeled with its security property. Contrast with OpenClaw's flat architecture where everything runs on the user's machine.]** > *获胜的递归代理架构的样子。* *** @@ -411,7 +411,7 @@ OpenClaw 可以演变成这样。基础已经存在。社区积极参与。团 路线图很清晰:托管基础设施让用户无需管理服务器,沙盒化执行以控制损害范围,经过审计的技能市场让供应链攻击在到达用户前就被发现,以及透明的日志记录让每个人都能看到他们的智能体在做什么。这些都可以用已知技术解决。问题在于是否有人将其优先级置于增长速度之上。 -> 📸 **\[检查清单图示:将 5 点“如果你正在运行 OpenClaw”列表渲染为带有复选框的可视化检查清单,专为分享设计。]** +> **\[检查清单图示:将 5 点“如果你正在运行 OpenClaw”列表渲染为带有复选框的可视化检查清单,专为分享设计。]** > *当前 OpenClaw 用户的最低安全清单。* *** diff --git a/docs/zh-TW/README.md b/docs/zh-TW/README.md index d976bd11..5185e9c6 100644 --- a/docs/zh-TW/README.md +++ b/docs/zh-TW/README.md @@ -11,7 +11,7 @@
-**🌐 Language / 语言 / 語言** +**Language / 语言 / 語言** [**English**](../../README.md) | [简体中文](../../README.zh-CN.md) | [繁體中文](README.md) | [日本語](../../docs/ja-JP/README.md) | [한국어](../ko-KR/README.md) @@ -59,7 +59,7 @@ --- -## 🚀 快速開始 +## 快速開始 在 2 分鐘內快速上手: @@ -75,7 +75,7 @@ ### 第二步:安裝規則(必需) -> ⚠️ **重要提示:** Claude Code 外掛程式無法自動分發 `rules`,需要手動安裝: +> WARNING: **重要提示:** Claude Code 外掛程式無法自動分發 `rules`,需要手動安裝: ```bash # 首先複製儲存庫 @@ -98,11 +98,11 @@ cp -r everything-claude-code/rules/* ~/.claude/rules/ /plugin list everything-claude-code@everything-claude-code ``` -✨ **完成!** 您現在使用 15+ 代理程式、30+ 技能和 20+ 指令。 +**完成!** 您現在使用 15+ 代理程式、30+ 技能和 20+ 指令。 --- -## 🌐 跨平台支援 +## 跨平台支援 此外掛程式現已完整支援 **Windows、macOS 和 Linux**。所有鉤子和腳本已使用 Node.js 重寫以獲得最佳相容性。 @@ -137,7 +137,7 @@ node scripts/setup-package-manager.js --detect --- -## 📦 內容概覽 +## 內容概覽 本儲存庫是一個 **Claude Code 外掛程式** - 可直接安裝或手動複製元件。 @@ -237,7 +237,7 @@ everything-claude-code/ --- -## 🛠️ 生態系統工具 +## 生態系統工具 ### ecc.tools - 技能建立器 @@ -259,7 +259,7 @@ everything-claude-code/ --- -## 📥 安裝 +## 安裝 ### 選項 1:以外掛程式安裝(建議) @@ -295,7 +295,7 @@ everything-claude-code/ --- -### 🔧 選項 2:手動安裝 +### 選項 2:手動安裝 如果您偏好手動控制安裝內容: @@ -328,7 +328,7 @@ cp -r everything-claude-code/skills/* ~/.claude/skills/ --- -## 🎯 核心概念 +## 核心概念 ### 代理程式(Agents) @@ -386,7 +386,7 @@ You are a senior code reviewer... --- -## 🧪 執行測試 +## 執行測試 外掛程式包含完整的測試套件: @@ -402,7 +402,7 @@ node tests/hooks/hooks.test.js --- -## 🤝 貢獻 +## 貢獻 **歡迎並鼓勵貢獻。** @@ -424,7 +424,7 @@ node tests/hooks/hooks.test.js --- -## 📖 背景 +## 背景 我從實驗性推出就開始使用 Claude Code。2025 年 9 月與 [@DRodriguezFX](https://x.com/DRodriguezFX) 一起使用 Claude Code 打造 [zenith.chat](https://zenith.chat),贏得了 Anthropic x Forum Ventures 黑客松。 @@ -432,7 +432,7 @@ node tests/hooks/hooks.test.js --- -## ⚠️ 重要注意事項 +## WARNING: 重要注意事項 ### 上下文視窗管理 @@ -455,13 +455,13 @@ node tests/hooks/hooks.test.js --- -## 🌟 Star 歷史 +## Star 歷史 [![Star History Chart](https://api.star-history.com/svg?repos=affaan-m/everything-claude-code&type=Date)](https://star-history.com/#affaan-m/everything-claude-code&Date) --- -## 🔗 連結 +## 連結 - **簡明指南(從這裡開始):** [Everything Claude Code 簡明指南](https://x.com/affaanmustafa/status/2012378465664745795) - **完整指南(進階):** [Everything Claude Code 完整指南](https://x.com/affaanmustafa/status/2014040193557471352) @@ -471,7 +471,7 @@ node tests/hooks/hooks.test.js --- -## 📄 授權 +## 授權 MIT - 自由使用、依需求修改、如可能請回饋貢獻。 diff --git a/docs/zh-TW/agents/build-error-resolver.md b/docs/zh-TW/agents/build-error-resolver.md index 54d24a64..41247901 100644 --- a/docs/zh-TW/agents/build-error-resolver.md +++ b/docs/zh-TW/agents/build-error-resolver.md @@ -101,12 +101,12 @@ c) 依影響排序優先順序 **模式 1:型別推論失敗** ```typescript -// ❌ 錯誤:Parameter 'x' implicitly has an 'any' type +// FAIL: 錯誤:Parameter 'x' implicitly has an 'any' type function add(x, y) { return x + y } -// ✅ 修復:新增型別註解 +// PASS: 修復:新增型別註解 function add(x: number, y: number): number { return x + y } @@ -114,25 +114,25 @@ function add(x: number, y: number): number { **模式 2:Null/Undefined 錯誤** ```typescript -// ❌ 錯誤:Object is possibly 'undefined' +// FAIL: 錯誤:Object is possibly 'undefined' const name = user.name.toUpperCase() -// ✅ 修復:可選串聯 +// PASS: 修復:可選串聯 const name = user?.name?.toUpperCase() -// ✅ 或:Null 檢查 +// PASS: 或:Null 檢查 const name = user && user.name ? user.name.toUpperCase() : '' ``` **模式 3:缺少屬性** ```typescript -// ❌ 錯誤:Property 'age' does not exist on type 'User' +// FAIL: 錯誤:Property 'age' does not exist on type 'User' interface User { name: string } const user: User = { name: 'John', age: 30 } -// ✅ 修復:新增屬性到介面 +// PASS: 修復:新增屬性到介面 interface User { name: string age?: number // 如果不是總是存在則為可選 @@ -141,10 +141,10 @@ interface User { **模式 4:Import 錯誤** ```typescript -// ❌ 錯誤:Cannot find module '@/lib/utils' +// FAIL: 錯誤:Cannot find module '@/lib/utils' import { formatDate } from '@/lib/utils' -// ✅ 修復 1:檢查 tsconfig paths 是否正確 +// PASS: 修復 1:檢查 tsconfig paths 是否正確 { "compilerOptions": { "paths": { @@ -153,22 +153,22 @@ import { formatDate } from '@/lib/utils' } } -// ✅ 修復 2:使用相對 import +// PASS: 修復 2:使用相對 import import { formatDate } from '../lib/utils' -// ✅ 修復 3:安裝缺少的套件 +// PASS: 修復 3:安裝缺少的套件 npm install @/lib/utils ``` **模式 5:型別不符** ```typescript -// ❌ 錯誤:Type 'string' is not assignable to type 'number' +// FAIL: 錯誤:Type 'string' is not assignable to type 'number' const age: number = "30" -// ✅ 修復:解析字串為數字 +// PASS: 修復:解析字串為數字 const age: number = parseInt("30", 10) -// ✅ 或:變更型別 +// PASS: 或:變更型別 const age: string = "30" ``` @@ -177,34 +177,34 @@ const age: string = "30" **關鍵:做最小可能的變更** ### 應該做: -✅ 在缺少處新增型別註解 -✅ 在需要處新增 null 檢查 -✅ 修復 imports/exports -✅ 新增缺少的相依性 -✅ 更新型別定義 -✅ 修復設定檔 +PASS: 在缺少處新增型別註解 +PASS: 在需要處新增 null 檢查 +PASS: 修復 imports/exports +PASS: 新增缺少的相依性 +PASS: 更新型別定義 +PASS: 修復設定檔 ### 不應該做: -❌ 重構不相關的程式碼 -❌ 變更架構 -❌ 重新命名變數/函式(除非是錯誤原因) -❌ 新增功能 -❌ 變更邏輯流程(除非是修復錯誤) -❌ 優化效能 -❌ 改善程式碼風格 +FAIL: 重構不相關的程式碼 +FAIL: 變更架構 +FAIL: 重新命名變數/函式(除非是錯誤原因) +FAIL: 新增功能 +FAIL: 變更邏輯流程(除非是修復錯誤) +FAIL: 優化效能 +FAIL: 改善程式碼風格 **最小差異範例:** ```typescript // 檔案有 200 行,第 45 行有錯誤 -// ❌ 錯誤:重構整個檔案 +// FAIL: 錯誤:重構整個檔案 // - 重新命名變數 // - 抽取函式 // - 變更模式 // 結果:50 行變更 -// ✅ 正確:只修復錯誤 +// PASS: 正確:只修復錯誤 // - 在第 45 行新增型別註解 // 結果:1 行變更 @@ -212,12 +212,12 @@ function processData(data) { // 第 45 行 - 錯誤:'data' implicitly has 'any return data.map(item => item.value) } -// ✅ 最小修復: +// PASS: 最小修復: function processData(data: any[]) { // 只變更這行 return data.map(item => item.value) } -// ✅ 更好的最小修復(如果知道型別): +// PASS: 更好的最小修復(如果知道型別): function processData(data: Array<{ value: number }>) { return data.map(item => item.value) } @@ -232,7 +232,7 @@ function processData(data: Array<{ value: number }>) { **建置目標:** Next.js 生產 / TypeScript 檢查 / ESLint **初始錯誤:** X **已修復錯誤:** Y -**建置狀態:** ✅ 通過 / ❌ 失敗 +**建置狀態:** PASS: 通過 / FAIL: 失敗 ## 已修復的錯誤 @@ -260,11 +260,11 @@ Parameter 'market' implicitly has an 'any' type. ## 驗證步驟 -1. ✅ TypeScript 檢查通過:`npx tsc --noEmit` -2. ✅ Next.js 建置成功:`npm run build` -3. ✅ ESLint 檢查通過:`npx eslint .` -4. ✅ 沒有引入新錯誤 -5. ✅ 開發伺服器執行:`npm run dev` +1. PASS: TypeScript 檢查通過:`npx tsc --noEmit` +2. PASS: Next.js 建置成功:`npm run build` +3. PASS: ESLint 檢查通過:`npx eslint .` +4. PASS: 沒有引入新錯誤 +5. PASS: 開發伺服器執行:`npm run dev` ``` ## 何時使用此 Agent @@ -287,13 +287,13 @@ Parameter 'market' implicitly has an 'any' type. ## 成功指標 建置錯誤解決後: -- ✅ `npx tsc --noEmit` 以代碼 0 結束 -- ✅ `npm run build` 成功完成 -- ✅ 沒有引入新錯誤 -- ✅ 變更行數最小(< 受影響檔案的 5%) -- ✅ 建置時間沒有顯著增加 -- ✅ 開發伺服器無錯誤執行 -- ✅ 測試仍然通過 +- PASS: `npx tsc --noEmit` 以代碼 0 結束 +- PASS: `npm run build` 成功完成 +- PASS: 沒有引入新錯誤 +- PASS: 變更行數最小(< 受影響檔案的 5%) +- PASS: 建置時間沒有顯著增加 +- PASS: 開發伺服器無錯誤執行 +- PASS: 測試仍然通過 --- diff --git a/docs/zh-TW/agents/code-reviewer.md b/docs/zh-TW/agents/code-reviewer.md index 4eaed1b5..2a732d0d 100644 --- a/docs/zh-TW/agents/code-reviewer.md +++ b/docs/zh-TW/agents/code-reviewer.md @@ -81,15 +81,15 @@ model: opus 問題:API 金鑰暴露在原始碼中 修復:移至環境變數 -const apiKey = "sk-abc123"; // ❌ 錯誤 +const apiKey = "sk-abc123"; // FAIL: 錯誤 const apiKey = process.env.API_KEY; // ✓ 正確 ``` ## 批准標準 -- ✅ 批准:無關鍵或高優先問題 -- ⚠️ 警告:僅有中優先問題(可謹慎合併) -- ❌ 阻擋:發現關鍵或高優先問題 +- PASS: 批准:無關鍵或高優先問題 +- WARNING: 警告:僅有中優先問題(可謹慎合併) +- FAIL: 阻擋:發現關鍵或高優先問題 ## 專案特定指南(範例) diff --git a/docs/zh-TW/agents/database-reviewer.md b/docs/zh-TW/agents/database-reviewer.md index 968aa47b..1e8c2ad7 100644 --- a/docs/zh-TW/agents/database-reviewer.md +++ b/docs/zh-TW/agents/database-reviewer.md @@ -109,14 +109,14 @@ c) 資料保護 **影響:** 大表上查詢快 100-1000 倍 ```sql --- ❌ 錯誤:外鍵沒有索引 +-- FAIL: 錯誤:外鍵沒有索引 CREATE TABLE orders ( id bigint PRIMARY KEY, customer_id bigint REFERENCES customers(id) -- 缺少索引! ); --- ✅ 正確:外鍵有索引 +-- PASS: 正確:外鍵有索引 CREATE TABLE orders ( id bigint PRIMARY KEY, customer_id bigint REFERENCES customers(id) @@ -134,11 +134,11 @@ CREATE INDEX orders_customer_id_idx ON orders (customer_id); | **Hash** | 僅等於 | `=`(比 B-tree 略快)| ```sql --- ❌ 錯誤:JSONB 包含用 B-tree +-- FAIL: 錯誤:JSONB 包含用 B-tree CREATE INDEX products_attrs_idx ON products (attributes); SELECT * FROM products WHERE attributes @> '{"color": "red"}'; --- ✅ 正確:JSONB 用 GIN +-- PASS: 正確:JSONB 用 GIN CREATE INDEX products_attrs_idx ON products USING gin (attributes); ``` @@ -147,11 +147,11 @@ CREATE INDEX products_attrs_idx ON products USING gin (attributes); **影響:** 多欄位查詢快 5-10 倍 ```sql --- ❌ 錯誤:分開的索引 +-- FAIL: 錯誤:分開的索引 CREATE INDEX orders_status_idx ON orders (status); CREATE INDEX orders_created_idx ON orders (created_at); --- ✅ 正確:複合索引(等於欄位在前,然後範圍) +-- PASS: 正確:複合索引(等於欄位在前,然後範圍) CREATE INDEX orders_status_created_idx ON orders (status, created_at); ``` @@ -167,11 +167,11 @@ CREATE INDEX orders_status_created_idx ON orders (status, created_at); **影響:** 透過避免表查找,查詢快 2-5 倍 ```sql --- ❌ 錯誤:必須從表獲取 name +-- FAIL: 錯誤:必須從表獲取 name CREATE INDEX users_email_idx ON users (email); SELECT email, name FROM users WHERE email = 'user@example.com'; --- ✅ 正確:所有欄位在索引中 +-- PASS: 正確:所有欄位在索引中 CREATE INDEX users_email_idx ON users (email) INCLUDE (name, created_at); ``` @@ -180,10 +180,10 @@ CREATE INDEX users_email_idx ON users (email) INCLUDE (name, created_at); **影響:** 索引小 5-20 倍,寫入和查詢更快 ```sql --- ❌ 錯誤:完整索引包含已刪除的列 +-- FAIL: 錯誤:完整索引包含已刪除的列 CREATE INDEX users_email_idx ON users (email); --- ✅ 正確:部分索引排除已刪除的列 +-- PASS: 正確:部分索引排除已刪除的列 CREATE INDEX users_active_email_idx ON users (email) WHERE deleted_at IS NULL; ``` @@ -196,11 +196,11 @@ CREATE INDEX users_active_email_idx ON users (email) WHERE deleted_at IS NULL; **影響:** 關鍵 - 資料庫強制的租戶隔離 ```sql --- ❌ 錯誤:僅應用程式篩選 +-- FAIL: 錯誤:僅應用程式篩選 SELECT * FROM orders WHERE user_id = $current_user_id; -- Bug 意味著所有訂單暴露! --- ✅ 正確:資料庫強制的 RLS +-- PASS: 正確:資料庫強制的 RLS ALTER TABLE orders ENABLE ROW LEVEL SECURITY; ALTER TABLE orders FORCE ROW LEVEL SECURITY; @@ -220,11 +220,11 @@ CREATE POLICY orders_user_policy ON orders **影響:** RLS 查詢快 5-10 倍 ```sql --- ❌ 錯誤:每列呼叫一次函式 +-- FAIL: 錯誤:每列呼叫一次函式 CREATE POLICY orders_policy ON orders USING (auth.uid() = user_id); -- 1M 列呼叫 1M 次! --- ✅ 正確:包在 SELECT 中(快取,只呼叫一次) +-- PASS: 正確:包在 SELECT 中(快取,只呼叫一次) CREATE POLICY orders_policy ON orders USING ((SELECT auth.uid()) = user_id); -- 快 100 倍 @@ -235,10 +235,10 @@ CREATE INDEX orders_user_id_idx ON orders (user_id); ### 3. 最小權限存取 ```sql --- ❌ 錯誤:過度寬鬆 +-- FAIL: 錯誤:過度寬鬆 GRANT ALL PRIVILEGES ON ALL TABLES TO app_user; --- ✅ 正確:最小權限 +-- PASS: 正確:最小權限 CREATE ROLE app_readonly NOLOGIN; GRANT USAGE ON SCHEMA public TO app_readonly; GRANT SELECT ON public.products, public.categories TO app_readonly; @@ -260,36 +260,36 @@ REVOKE ALL ON SCHEMA public FROM public; **影響:** 批量插入快 10-50 倍 ```sql --- ❌ 錯誤:個別插入 +-- FAIL: 錯誤:個別插入 INSERT INTO events (user_id, action) VALUES (1, 'click'); INSERT INTO events (user_id, action) VALUES (2, 'view'); -- 1000 次往返 --- ✅ 正確:批次插入 +-- PASS: 正確:批次插入 INSERT INTO events (user_id, action) VALUES (1, 'click'), (2, 'view'), (3, 'click'); -- 1 次往返 --- ✅ 最佳:大資料集用 COPY +-- PASS: 最佳:大資料集用 COPY COPY events (user_id, action) FROM '/path/to/data.csv' WITH (FORMAT csv); ``` ### 2. 消除 N+1 查詢 ```sql --- ❌ 錯誤:N+1 模式 +-- FAIL: 錯誤:N+1 模式 SELECT id FROM users WHERE active = true; -- 回傳 100 個 IDs -- 然後 100 個查詢: SELECT * FROM orders WHERE user_id = 1; SELECT * FROM orders WHERE user_id = 2; -- ... 還有 98 個 --- ✅ 正確:用 ANY 的單一查詢 +-- PASS: 正確:用 ANY 的單一查詢 SELECT * FROM orders WHERE user_id = ANY(ARRAY[1, 2, 3, ...]); --- ✅ 正確:JOIN +-- PASS: 正確:JOIN SELECT u.id, u.name, o.* FROM users u LEFT JOIN orders o ON o.user_id = u.id @@ -301,11 +301,11 @@ WHERE u.active = true; **影響:** 無論頁面深度,一致的 O(1) 效能 ```sql --- ❌ 錯誤:OFFSET 隨深度變慢 +-- FAIL: 錯誤:OFFSET 隨深度變慢 SELECT * FROM products ORDER BY id LIMIT 20 OFFSET 199980; -- 掃描 200,000 列! --- ✅ 正確:游標式(總是快) +-- PASS: 正確:游標式(總是快) SELECT * FROM products WHERE id > 199980 ORDER BY id LIMIT 20; -- 使用索引,O(1) ``` @@ -313,11 +313,11 @@ SELECT * FROM products WHERE id > 199980 ORDER BY id LIMIT 20; ### 4. UPSERT 用於插入或更新 ```sql --- ❌ 錯誤:競態條件 +-- FAIL: 錯誤:競態條件 SELECT * FROM settings WHERE user_id = 123 AND key = 'theme'; -- 兩個執行緒都找不到,都插入,一個失敗 --- ✅ 正確:原子 UPSERT +-- PASS: 正確:原子 UPSERT INSERT INTO settings (user_id, key, value) VALUES (123, 'theme', 'dark') ON CONFLICT (user_id, key) @@ -329,27 +329,27 @@ RETURNING *; ## 要標記的反模式 -### ❌ 查詢反模式 +### FAIL: 查詢反模式 - 生產程式碼中用 `SELECT *` - WHERE/JOIN 欄位缺少索引 - 大表上用 OFFSET 分頁 - N+1 查詢模式 - 非參數化查詢(SQL 注入風險) -### ❌ 結構描述反模式 +### FAIL: 結構描述反模式 - IDs 用 `int`(應用 `bigint`) - 無理由用 `varchar(255)`(應用 `text`) - `timestamp` 沒有時區(應用 `timestamptz`) - 隨機 UUIDs 作為主鍵(應用 UUIDv7 或 IDENTITY) - 需要引號的混合大小寫識別符 -### ❌ 安全性反模式 +### FAIL: 安全性反模式 - `GRANT ALL` 給應用程式使用者 - 多租戶表缺少 RLS - RLS 政策每列呼叫函式(沒有包在 SELECT 中) - RLS 政策欄位沒有索引 -### ❌ 連線反模式 +### FAIL: 連線反模式 - 沒有連線池 - 沒有閒置逾時 - Transaction 模式連線池使用 Prepared statements diff --git a/docs/zh-TW/agents/e2e-runner.md b/docs/zh-TW/agents/e2e-runner.md index 37cf510c..a88b0c1e 100644 --- a/docs/zh-TW/agents/e2e-runner.md +++ b/docs/zh-TW/agents/e2e-runner.md @@ -220,28 +220,28 @@ test('market search with complex query', async ({ page }) => { **1. 競態條件** ```typescript -// ❌ 不穩定:不要假設元素已準備好 +// FAIL: 不穩定:不要假設元素已準備好 await page.click('[data-testid="button"]') -// ✅ 穩定:等待元素準備好 +// PASS: 穩定:等待元素準備好 await page.locator('[data-testid="button"]').click() // 內建自動等待 ``` **2. 網路時序** ```typescript -// ❌ 不穩定:任意逾時 +// FAIL: 不穩定:任意逾時 await page.waitForTimeout(5000) -// ✅ 穩定:等待特定條件 +// PASS: 穩定:等待特定條件 await page.waitForResponse(resp => resp.url().includes('/api/markets')) ``` **3. 動畫時序** ```typescript -// ❌ 不穩定:在動畫期間點擊 +// FAIL: 不穩定:在動畫期間點擊 await page.click('[data-testid="menu-item"]') -// ✅ 穩定:等待動畫完成 +// PASS: 穩定:等待動畫完成 await page.locator('[data-testid="menu-item"]').waitFor({ state: 'visible' }) await page.waitForLoadState('networkidle') await page.click('[data-testid="menu-item"]') @@ -290,13 +290,13 @@ use: { ## 成功指標 E2E 測試執行後: -- ✅ 所有關鍵旅程通過(100%) -- ✅ 總體通過率 > 95% -- ✅ 不穩定率 < 5% -- ✅ 沒有失敗測試阻擋部署 -- ✅ 產出物已上傳且可存取 -- ✅ 測試時間 < 10 分鐘 -- ✅ HTML 報告已產生 +- PASS: 所有關鍵旅程通過(100%) +- PASS: 總體通過率 > 95% +- PASS: 不穩定率 < 5% +- PASS: 沒有失敗測試阻擋部署 +- PASS: 產出物已上傳且可存取 +- PASS: 測試時間 < 10 分鐘 +- PASS: HTML 報告已產生 --- diff --git a/docs/zh-TW/agents/refactor-cleaner.md b/docs/zh-TW/agents/refactor-cleaner.md index dd6af5e7..b5f3a915 100644 --- a/docs/zh-TW/agents/refactor-cleaner.md +++ b/docs/zh-TW/agents/refactor-cleaner.md @@ -146,22 +146,22 @@ e) 驗證測試仍通過 ### 1. 未使用的 Imports ```typescript -// ❌ 移除未使用的 imports +// FAIL: 移除未使用的 imports import { useState, useEffect, useMemo } from 'react' // 只有 useState 被使用 -// ✅ 只保留使用的 +// PASS: 只保留使用的 import { useState } from 'react' ``` ### 2. 無用程式碼分支 ```typescript -// ❌ 移除不可達的程式碼 +// FAIL: 移除不可達的程式碼 if (false) { // 這永遠不會執行 doSomething() } -// ❌ 移除未使用的函式 +// FAIL: 移除未使用的函式 export function unusedHelper() { // 程式碼庫中沒有參考 } @@ -169,18 +169,18 @@ export function unusedHelper() { ### 3. 重複元件 ```typescript -// ❌ 多個類似元件 +// FAIL: 多個類似元件 components/Button.tsx components/PrimaryButton.tsx components/NewButton.tsx -// ✅ 整合為一個 +// PASS: 整合為一個 components/Button.tsx(帶 variant prop) ``` ### 4. 未使用的相依性 ```json -// ❌ 已安裝但未 import 的套件 +// FAIL: 已安裝但未 import 的套件 { "dependencies": { "lodash": "^4.17.21", // 沒有在任何地方使用 @@ -261,12 +261,12 @@ components/Button.tsx(帶 variant prop) ## 成功指標 清理工作階段後: -- ✅ 所有測試通過 -- ✅ 建置成功 -- ✅ 沒有 console 錯誤 -- ✅ DELETION_LOG.md 已更新 -- ✅ Bundle 大小減少 -- ✅ 生產環境沒有回歸 +- PASS: 所有測試通過 +- PASS: 建置成功 +- PASS: 沒有 console 錯誤 +- PASS: DELETION_LOG.md 已更新 +- PASS: Bundle 大小減少 +- PASS: 生產環境沒有回歸 --- diff --git a/docs/zh-TW/agents/security-reviewer.md b/docs/zh-TW/agents/security-reviewer.md index 478ca8ff..4acd77f6 100644 --- a/docs/zh-TW/agents/security-reviewer.md +++ b/docs/zh-TW/agents/security-reviewer.md @@ -128,12 +128,12 @@ b) 審查高風險區域 ### 1. 寫死密鑰(關鍵) ```javascript -// ❌ 關鍵:寫死的密鑰 +// FAIL: 關鍵:寫死的密鑰 const apiKey = "sk-proj-xxxxx" const password = "admin123" const token = "ghp_xxxxxxxxxxxx" -// ✅ 正確:環境變數 +// PASS: 正確:環境變數 const apiKey = process.env.OPENAI_API_KEY if (!apiKey) { throw new Error('OPENAI_API_KEY not configured') @@ -143,11 +143,11 @@ if (!apiKey) { ### 2. SQL 注入(關鍵) ```javascript -// ❌ 關鍵:SQL 注入弱點 +// FAIL: 關鍵:SQL 注入弱點 const query = `SELECT * FROM users WHERE id = ${userId}` await db.query(query) -// ✅ 正確:參數化查詢 +// PASS: 正確:參數化查詢 const { data } = await supabase .from('users') .select('*') @@ -157,11 +157,11 @@ const { data } = await supabase ### 3. 命令注入(關鍵) ```javascript -// ❌ 關鍵:命令注入 +// FAIL: 關鍵:命令注入 const { exec } = require('child_process') exec(`ping ${userInput}`, callback) -// ✅ 正確:使用函式庫,而非 shell 命令 +// PASS: 正確:使用函式庫,而非 shell 命令 const dns = require('dns') dns.lookup(userInput, callback) ``` @@ -169,10 +169,10 @@ dns.lookup(userInput, callback) ### 4. 跨站腳本 XSS(高) ```javascript -// ❌ 高:XSS 弱點 +// FAIL: 高:XSS 弱點 element.innerHTML = userInput -// ✅ 正確:使用 textContent 或清理 +// PASS: 正確:使用 textContent 或清理 element.textContent = userInput // 或 import DOMPurify from 'dompurify' @@ -182,10 +182,10 @@ element.innerHTML = DOMPurify.sanitize(userInput) ### 5. 伺服器端請求偽造 SSRF(高) ```javascript -// ❌ 高:SSRF 弱點 +// FAIL: 高:SSRF 弱點 const response = await fetch(userProvidedUrl) -// ✅ 正確:驗證和白名單 URL +// PASS: 正確:驗證和白名單 URL const allowedDomains = ['api.example.com', 'cdn.example.com'] const url = new URL(userProvidedUrl) if (!allowedDomains.includes(url.hostname)) { @@ -197,10 +197,10 @@ const response = await fetch(url.toString()) ### 6. 不安全的驗證(關鍵) ```javascript -// ❌ 關鍵:明文密碼比對 +// FAIL: 關鍵:明文密碼比對 if (password === storedPassword) { /* login */ } -// ✅ 正確:雜湊密碼比對 +// PASS: 正確:雜湊密碼比對 import bcrypt from 'bcrypt' const isValid = await bcrypt.compare(password, hashedPassword) ``` @@ -208,13 +208,13 @@ const isValid = await bcrypt.compare(password, hashedPassword) ### 7. 授權不足(關鍵) ```javascript -// ❌ 關鍵:沒有授權檢查 +// FAIL: 關鍵:沒有授權檢查 app.get('/api/user/:id', async (req, res) => { const user = await getUser(req.params.id) res.json(user) }) -// ✅ 正確:驗證使用者可以存取資源 +// PASS: 正確:驗證使用者可以存取資源 app.get('/api/user/:id', authenticateUser, async (req, res) => { if (req.user.id !== req.params.id && !req.user.isAdmin) { return res.status(403).json({ error: 'Forbidden' }) @@ -227,13 +227,13 @@ app.get('/api/user/:id', authenticateUser, async (req, res) => { ### 8. 財務操作中的競態條件(關鍵) ```javascript -// ❌ 關鍵:餘額檢查中的競態條件 +// FAIL: 關鍵:餘額檢查中的競態條件 const balance = await getBalance(userId) if (balance >= amount) { await withdraw(userId, amount) // 另一個請求可能同時提款! } -// ✅ 正確:帶鎖定的原子交易 +// PASS: 正確:帶鎖定的原子交易 await db.transaction(async (trx) => { const balance = await trx('balances') .where({ user_id: userId }) @@ -253,13 +253,13 @@ await db.transaction(async (trx) => { ### 9. 速率限制不足(高) ```javascript -// ❌ 高:沒有速率限制 +// FAIL: 高:沒有速率限制 app.post('/api/trade', async (req, res) => { await executeTrade(req.body) res.json({ success: true }) }) -// ✅ 正確:速率限制 +// PASS: 正確:速率限制 import rateLimit from 'express-rate-limit' const tradeLimiter = rateLimit({ @@ -277,10 +277,10 @@ app.post('/api/trade', tradeLimiter, async (req, res) => { ### 10. 記錄敏感資料(中) ```javascript -// ❌ 中:記錄敏感資料 +// FAIL: 中:記錄敏感資料 console.log('User login:', { email, password, apiKey }) -// ✅ 正確:清理日誌 +// PASS: 正確:清理日誌 console.log('User login:', { email: email.replace(/(?<=.).(?=.*@)/g, '*'), passwordProvided: !!password @@ -302,7 +302,7 @@ console.log('User login:', { - **高優先問題:** Y - **中優先問題:** Z - **低優先問題:** W -- **風險等級:** 🔴 高 / 🟡 中 / 🟢 低 +- **風險等級:** 高 / 中 / 低 ## 關鍵問題(立即修復) @@ -324,7 +324,7 @@ console.log('User login:', { **修復:** ```javascript -// ✅ 安全的實作 +// PASS: 安全的實作 ``` **參考:** @@ -365,13 +365,13 @@ console.log('User login:', { ## 成功指標 安全性審查後: -- ✅ 未發現關鍵問題 -- ✅ 所有高優先問題已處理 -- ✅ 安全性檢查清單完成 -- ✅ 程式碼中無密鑰 -- ✅ 相依性已更新 -- ✅ 測試包含安全性情境 -- ✅ 文件已更新 +- PASS: 未發現關鍵問題 +- PASS: 所有高優先問題已處理 +- PASS: 安全性檢查清單完成 +- PASS: 程式碼中無密鑰 +- PASS: 相依性已更新 +- PASS: 測試包含安全性情境 +- PASS: 文件已更新 --- diff --git a/docs/zh-TW/agents/tdd-guide.md b/docs/zh-TW/agents/tdd-guide.md index f4190aff..256c2e3f 100644 --- a/docs/zh-TW/agents/tdd-guide.md +++ b/docs/zh-TW/agents/tdd-guide.md @@ -220,26 +220,26 @@ jest.mock('@/lib/openai', () => ({ ## 測試異味(反模式) -### ❌ 測試實作細節 +### FAIL: 測試實作細節 ```typescript // 不要測試內部狀態 expect(component.state.count).toBe(5) ``` -### ✅ 測試使用者可見的行為 +### PASS: 測試使用者可見的行為 ```typescript // 測試使用者看到的 expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ 測試相互依賴 +### FAIL: 測試相互依賴 ```typescript // 不要依賴前一個測試 test('creates user', () => { /* ... */ }) test('updates same user', () => { /* 需要前一個測試 */ }) ``` -### ✅ 獨立測試 +### PASS: 獨立測試 ```typescript // 在每個測試中設定資料 test('updates user', () => { diff --git a/docs/zh-TW/commands/e2e.md b/docs/zh-TW/commands/e2e.md index 9784f232..315e727a 100644 --- a/docs/zh-TW/commands/e2e.md +++ b/docs/zh-TW/commands/e2e.md @@ -65,20 +65,20 @@ open artifacts/search-results.png ## 最佳實務 **應該做:** -- ✅ 使用 Page Object Model 以利維護 -- ✅ 使用 data-testid 屬性作為選擇器 -- ✅ 等待 API 回應,不要用任意逾時 -- ✅ 測試關鍵使用者旅程端對端 -- ✅ 合併到主分支前執行測試 -- ✅ 測試失敗時審查產出物 +- PASS: 使用 Page Object Model 以利維護 +- PASS: 使用 data-testid 屬性作為選擇器 +- PASS: 等待 API 回應,不要用任意逾時 +- PASS: 測試關鍵使用者旅程端對端 +- PASS: 合併到主分支前執行測試 +- PASS: 測試失敗時審查產出物 **不應該做:** -- ❌ 使用脆弱的選擇器(CSS class 可能改變) -- ❌ 測試實作細節 -- ❌ 對生產環境執行測試 -- ❌ 忽略不穩定的測試 -- ❌ 失敗時跳過產出物審查 -- ❌ 用 E2E 測試每個邊界情況(使用單元測試) +- FAIL: 使用脆弱的選擇器(CSS class 可能改變) +- FAIL: 測試實作細節 +- FAIL: 對生產環境執行測試 +- FAIL: 忽略不穩定的測試 +- FAIL: 失敗時跳過產出物審查 +- FAIL: 用 E2E 測試每個邊界情況(使用單元測試) ## 快速指令 diff --git a/docs/zh-TW/commands/go-review.md b/docs/zh-TW/commands/go-review.md index d7ba7cba..c06c307b 100644 --- a/docs/zh-TW/commands/go-review.md +++ b/docs/zh-TW/commands/go-review.md @@ -70,9 +70,9 @@ govulncheck ./... | 狀態 | 條件 | |------|------| -| ✅ 批准 | 沒有關鍵或高優先問題 | -| ⚠️ 警告 | 只有中優先問題(謹慎合併)| -| ❌ 阻擋 | 發現關鍵或高優先問題 | +| PASS: 批准 | 沒有關鍵或高優先問題 | +| WARNING: 警告 | 只有中優先問題(謹慎合併)| +| FAIL: 阻擋 | 發現關鍵或高優先問題 | ## 與其他指令的整合 diff --git a/docs/zh-TW/commands/tdd.md b/docs/zh-TW/commands/tdd.md index ea062fca..e10f2e33 100644 --- a/docs/zh-TW/commands/tdd.md +++ b/docs/zh-TW/commands/tdd.md @@ -49,20 +49,20 @@ REPEAT: 下一個功能/情境 ## TDD 最佳實務 **應該做:** -- ✅ 在任何實作前先撰寫測試 -- ✅ 在實作前執行測試並驗證它們失敗 -- ✅ 撰寫最小程式碼使測試通過 -- ✅ 只在測試通過後才重構 -- ✅ 新增邊界情況和錯誤情境 -- ✅ 目標 80% 以上覆蓋率(關鍵程式碼 100%) +- PASS: 在任何實作前先撰寫測試 +- PASS: 在實作前執行測試並驗證它們失敗 +- PASS: 撰寫最小程式碼使測試通過 +- PASS: 只在測試通過後才重構 +- PASS: 新增邊界情況和錯誤情境 +- PASS: 目標 80% 以上覆蓋率(關鍵程式碼 100%) **不應該做:** -- ❌ 在測試之前撰寫實作 -- ❌ 跳過每次變更後執行測試 -- ❌ 一次撰寫太多程式碼 -- ❌ 忽略失敗的測試 -- ❌ 測試實作細節(測試行為) -- ❌ Mock 所有東西(優先使用整合測試) +- FAIL: 在測試之前撰寫實作 +- FAIL: 跳過每次變更後執行測試 +- FAIL: 一次撰寫太多程式碼 +- FAIL: 忽略失敗的測試 +- FAIL: 測試實作細節(測試行為) +- FAIL: Mock 所有東西(優先使用整合測試) ## 覆蓋率要求 diff --git a/docs/zh-TW/skills/backend-patterns/SKILL.md b/docs/zh-TW/skills/backend-patterns/SKILL.md index 43631a34..9e435258 100644 --- a/docs/zh-TW/skills/backend-patterns/SKILL.md +++ b/docs/zh-TW/skills/backend-patterns/SKILL.md @@ -12,7 +12,7 @@ description: Backend architecture patterns, API design, database optimization, a ### RESTful API 結構 ```typescript -// ✅ 基於資源的 URL +// PASS: 基於資源的 URL GET /api/markets # 列出資源 GET /api/markets/:id # 取得單一資源 POST /api/markets # 建立資源 @@ -20,7 +20,7 @@ PUT /api/markets/:id # 替換資源 PATCH /api/markets/:id # 更新資源 DELETE /api/markets/:id # 刪除資源 -// ✅ 用於過濾、排序、分頁的查詢參數 +// PASS: 用於過濾、排序、分頁的查詢參數 GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -120,7 +120,7 @@ export default withAuth(async (req, res) => { ### 查詢優化 ```typescript -// ✅ 良好:只選擇需要的欄位 +// PASS: 良好:只選擇需要的欄位 const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -128,7 +128,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ 不良:選擇所有欄位 +// FAIL: 不良:選擇所有欄位 const { data } = await supabase .from('markets') .select('*') @@ -137,13 +137,13 @@ const { data } = await supabase ### N+1 查詢問題預防 ```typescript -// ❌ 不良:N+1 查詢問題 +// FAIL: 不良:N+1 查詢問題 const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N 次查詢 } -// ✅ 良好:批次取得 +// PASS: 良好:批次取得 const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 次查詢 diff --git a/docs/zh-TW/skills/clickhouse-io/SKILL.md b/docs/zh-TW/skills/clickhouse-io/SKILL.md index 619cdbfd..aaa95d4f 100644 --- a/docs/zh-TW/skills/clickhouse-io/SKILL.md +++ b/docs/zh-TW/skills/clickhouse-io/SKILL.md @@ -86,7 +86,7 @@ ORDER BY hour DESC; ### 高效過濾 ```sql --- ✅ 良好:先使用索引欄位 +-- PASS: 良好:先使用索引欄位 SELECT * FROM markets_analytics WHERE date >= '2025-01-01' @@ -95,7 +95,7 @@ WHERE date >= '2025-01-01' ORDER BY date DESC LIMIT 100; --- ❌ 不良:先過濾非索引欄位 +-- FAIL: 不良:先過濾非索引欄位 SELECT * FROM markets_analytics WHERE volume > 1000 @@ -106,7 +106,7 @@ WHERE volume > 1000 ### 聚合 ```sql --- ✅ 良好:使用 ClickHouse 特定聚合函式 +-- PASS: 良好:使用 ClickHouse 特定聚合函式 SELECT toStartOfDay(created_at) AS day, market_id, @@ -119,7 +119,7 @@ WHERE created_at >= today() - INTERVAL 7 DAY GROUP BY day, market_id ORDER BY day DESC, total_volume DESC; --- ✅ 使用 quantile 計算百分位數(比 percentile 更高效) +-- PASS: 使用 quantile 計算百分位數(比 percentile 更高效) SELECT quantile(0.50)(trade_size) AS median, quantile(0.95)(trade_size) AS p95, @@ -162,7 +162,7 @@ const clickhouse = new ClickHouse({ } }) -// ✅ 批量插入(高效) +// PASS: 批量插入(高效) async function bulkInsertTrades(trades: Trade[]) { const values = trades.map(trade => `( '${trade.id}', @@ -178,7 +178,7 @@ async function bulkInsertTrades(trades: Trade[]) { `).toPromise() } -// ❌ 個別插入(慢) +// FAIL: 個別插入(慢) async function insertTrade(trade: Trade) { // 不要在迴圈中這樣做! await clickhouse.query(` diff --git a/docs/zh-TW/skills/coding-standards/SKILL.md b/docs/zh-TW/skills/coding-standards/SKILL.md index 97a58f29..6606fe8b 100644 --- a/docs/zh-TW/skills/coding-standards/SKILL.md +++ b/docs/zh-TW/skills/coding-standards/SKILL.md @@ -38,12 +38,12 @@ description: Universal coding standards, best practices, and patterns for TypeSc ### 變數命名 ```typescript -// ✅ 良好:描述性名稱 +// PASS: 良好:描述性名稱 const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ 不良:不清楚的名稱 +// FAIL: 不良:不清楚的名稱 const q = 'election' const flag = true const x = 1000 @@ -52,12 +52,12 @@ const x = 1000 ### 函式命名 ```typescript -// ✅ 良好:動詞-名詞模式 +// PASS: 良好:動詞-名詞模式 async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ 不良:不清楚或只有名詞 +// FAIL: 不良:不清楚或只有名詞 async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -66,7 +66,7 @@ function email(e) { } ### 不可變性模式(關鍵) ```typescript -// ✅ 總是使用展開運算符 +// PASS: 總是使用展開運算符 const updatedUser = { ...user, name: 'New Name' @@ -74,7 +74,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ 永遠不要直接修改 +// FAIL: 永遠不要直接修改 user.name = 'New Name' // 不良 items.push(newItem) // 不良 ``` @@ -82,7 +82,7 @@ items.push(newItem) // 不良 ### 錯誤處理 ```typescript -// ✅ 良好:完整的錯誤處理 +// PASS: 良好:完整的錯誤處理 async function fetchData(url: string) { try { const response = await fetch(url) @@ -98,7 +98,7 @@ async function fetchData(url: string) { } } -// ❌ 不良:無錯誤處理 +// FAIL: 不良:無錯誤處理 async function fetchData(url) { const response = await fetch(url) return response.json() @@ -108,14 +108,14 @@ async function fetchData(url) { ### Async/Await 最佳實務 ```typescript -// ✅ 良好:可能時並行執行 +// PASS: 良好:可能時並行執行 const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ 不良:不必要的順序執行 +// FAIL: 不良:不必要的順序執行 const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -124,7 +124,7 @@ const stats = await fetchStats() ### 型別安全 ```typescript -// ✅ 良好:正確的型別 +// PASS: 良好:正確的型別 interface Market { id: string name: string @@ -136,7 +136,7 @@ function getMarket(id: string): Promise { // 實作 } -// ❌ 不良:使用 'any' +// FAIL: 不良:使用 'any' function getMarket(id: any): Promise { // 實作 } @@ -147,7 +147,7 @@ function getMarket(id: any): Promise { ### 元件結構 ```typescript -// ✅ 良好:具有型別的函式元件 +// PASS: 良好:具有型別的函式元件 interface ButtonProps { children: React.ReactNode onClick: () => void @@ -172,7 +172,7 @@ export function Button({ ) } -// ❌ 不良:無型別、結構不清楚 +// FAIL: 不良:無型別、結構不清楚 export function Button(props) { return } @@ -181,7 +181,7 @@ export function Button(props) { ### 自訂 Hooks ```typescript -// ✅ 良好:可重用的自訂 hook +// PASS: 良好:可重用的自訂 hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -203,25 +203,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### 狀態管理 ```typescript -// ✅ 良好:正確的狀態更新 +// PASS: 良好:正確的狀態更新 const [count, setCount] = useState(0) // 基於先前狀態的函式更新 setCount(prev => prev + 1) -// ❌ 不良:直接引用狀態 +// FAIL: 不良:直接引用狀態 setCount(count + 1) // 在非同步情境中可能過時 ``` ### 條件渲染 ```typescript -// ✅ 良好:清晰的條件渲染 +// PASS: 良好:清晰的條件渲染 {isLoading && } {error && } {data && } -// ❌ 不良:三元地獄 +// FAIL: 不良:三元地獄 {isLoading ? : error ? : data ? : null} ``` @@ -244,7 +244,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### 回應格式 ```typescript -// ✅ 良好:一致的回應結構 +// PASS: 良好:一致的回應結構 interface ApiResponse { success: boolean data?: T @@ -275,7 +275,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ 良好:Schema 驗證 +// PASS: 良好:Schema 驗證 const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -338,14 +338,14 @@ types/market.types.ts # 型別用 camelCase 加 .types 後綴 ### 何時註解 ```typescript -// ✅ 良好:解釋「為什麼」而非「什麼」 +// PASS: 良好:解釋「為什麼」而非「什麼」 // 使用指數退避以避免在服務中斷時壓垮 API const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // 為了處理大陣列的效能,此處刻意使用突變 items.push(newItem) -// ❌ 不良:陳述顯而易見的事實 +// FAIL: 不良:陳述顯而易見的事實 // 將計數器加 1 count++ @@ -385,12 +385,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ 良好:記憶化昂貴的計算 +// PASS: 良好:記憶化昂貴的計算 const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ 良好:記憶化回呼函式 +// PASS: 良好:記憶化回呼函式 const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -401,7 +401,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ 良好:延遲載入重型元件 +// PASS: 良好:延遲載入重型元件 const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -416,13 +416,13 @@ export function Dashboard() { ### 資料庫查詢 ```typescript -// ✅ 良好:只選擇需要的欄位 +// PASS: 良好:只選擇需要的欄位 const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ 不良:選擇所有欄位 +// FAIL: 不良:選擇所有欄位 const { data } = await supabase .from('markets') .select('*') @@ -449,12 +449,12 @@ test('calculates similarity correctly', () => { ### 測試命名 ```typescript -// ✅ 良好:描述性測試名稱 +// PASS: 良好:描述性測試名稱 test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ 不良:模糊的測試名稱 +// FAIL: 不良:模糊的測試名稱 test('works', () => { }) test('test search', () => { }) ``` @@ -465,12 +465,12 @@ test('test search', () => { }) ### 1. 過長函式 ```typescript -// ❌ 不良:函式超過 50 行 +// FAIL: 不良:函式超過 50 行 function processMarketData() { // 100 行程式碼 } -// ✅ 良好:拆分為較小的函式 +// PASS: 良好:拆分為較小的函式 function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -480,7 +480,7 @@ function processMarketData() { ### 2. 過深巢狀 ```typescript -// ❌ 不良:5 層以上巢狀 +// FAIL: 不良:5 層以上巢狀 if (user) { if (user.isAdmin) { if (market) { @@ -493,7 +493,7 @@ if (user) { } } -// ✅ 良好:提前返回 +// PASS: 良好:提前返回 if (!user) return if (!user.isAdmin) return if (!market) return @@ -505,11 +505,11 @@ if (!hasPermission) return ### 3. 魔術數字 ```typescript -// ❌ 不良:無解釋的數字 +// FAIL: 不良:無解釋的數字 if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ 良好:命名常數 +// PASS: 良好:命名常數 const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/docs/zh-TW/skills/frontend-patterns/SKILL.md b/docs/zh-TW/skills/frontend-patterns/SKILL.md index 2443aca6..252854a3 100644 --- a/docs/zh-TW/skills/frontend-patterns/SKILL.md +++ b/docs/zh-TW/skills/frontend-patterns/SKILL.md @@ -12,7 +12,7 @@ description: Frontend development patterns for React, Next.js, state management, ### 組合優於繼承 ```typescript -// ✅ 良好:元件組合 +// PASS: 良好:元件組合 interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -283,17 +283,17 @@ export function useMarkets() { ### 記憶化 ```typescript -// ✅ useMemo 用於昂貴計算 +// PASS: useMemo 用於昂貴計算 const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback 用於傳遞給子元件的函式 +// PASS: useCallback 用於傳遞給子元件的函式 const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo 用於純元件 +// PASS: React.memo 用於純元件 export const MarketCard = React.memo(({ market }) => { return (
@@ -309,7 +309,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ 延遲載入重型元件 +// PASS: 延遲載入重型元件 const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -504,7 +504,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ 列表動畫 +// PASS: 列表動畫 export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -523,7 +523,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal 動畫 +// PASS: Modal 動畫 export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/docs/zh-TW/skills/iterative-retrieval/SKILL.md b/docs/zh-TW/skills/iterative-retrieval/SKILL.md index 473b7774..a1449cbe 100644 --- a/docs/zh-TW/skills/iterative-retrieval/SKILL.md +++ b/docs/zh-TW/skills/iterative-retrieval/SKILL.md @@ -27,12 +27,12 @@ description: Pattern for progressively refining context retrieval to solve the s ┌─────────────────────────────────────────────┐ │ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ DISPATCH │─────▶│ EVALUATE │ │ +│ │ DISPATCH │─────│ EVALUATE │ │ │ └──────────┘ └──────────┘ │ │ ▲ │ │ │ │ ▼ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ LOOP │◀─────│ REFINE │ │ +│ │ LOOP │─────│ REFINE │ │ │ └──────────┘ └──────────┘ │ │ │ │ 最多 3 個循環,然後繼續 │ diff --git a/docs/zh-TW/skills/security-review/SKILL.md b/docs/zh-TW/skills/security-review/SKILL.md index b1d0c1fa..f1259a56 100644 --- a/docs/zh-TW/skills/security-review/SKILL.md +++ b/docs/zh-TW/skills/security-review/SKILL.md @@ -21,13 +21,13 @@ description: Use this skill when adding authentication, handling user input, wor ### 1. 密鑰管理 -#### ❌ 絕不這樣做 +#### FAIL: 絕不這樣做 ```typescript const apiKey = "sk-proj-xxxxx" // 寫死的密鑰 const dbPassword = "password123" // 在原始碼中 ``` -#### ✅ 總是這樣做 +#### PASS: 總是這樣做 ```typescript const apiKey = process.env.OPENAI_API_KEY const dbUrl = process.env.DATABASE_URL @@ -107,14 +107,14 @@ function validateFileUpload(file: File) { ### 3. SQL 注入預防 -#### ❌ 絕不串接 SQL +#### FAIL: 絕不串接 SQL ```typescript // 危險 - SQL 注入漏洞 const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ 總是使用參數化查詢 +#### PASS: 總是使用參數化查詢 ```typescript // 安全 - 參數化查詢 const { data } = await supabase @@ -139,10 +139,10 @@ await db.query( #### JWT Token 處理 ```typescript -// ❌ 錯誤:localStorage(易受 XSS 攻擊) +// FAIL: 錯誤:localStorage(易受 XSS 攻擊) localStorage.setItem('token', token) -// ✅ 正確:httpOnly cookies +// PASS: 正確:httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -299,18 +299,18 @@ app.use('/api/search', searchLimiter) #### 日誌記錄 ```typescript -// ❌ 錯誤:記錄敏感資料 +// FAIL: 錯誤:記錄敏感資料 console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ 正確:遮蔽敏感資料 +// PASS: 正確:遮蔽敏感資料 console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### 錯誤訊息 ```typescript -// ❌ 錯誤:暴露內部細節 +// FAIL: 錯誤:暴露內部細節 catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -318,7 +318,7 @@ catch (error) { ) } -// ✅ 正確:通用錯誤訊息 +// PASS: 正確:通用錯誤訊息 catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/docs/zh-TW/skills/security-review/cloud-infrastructure-security.md b/docs/zh-TW/skills/security-review/cloud-infrastructure-security.md index 25e658aa..4d377165 100644 --- a/docs/zh-TW/skills/security-review/cloud-infrastructure-security.md +++ b/docs/zh-TW/skills/security-review/cloud-infrastructure-security.md @@ -24,7 +24,7 @@ #### 最小權限原則 ```yaml -# ✅ 正確:最小權限 +# PASS: 正確:最小權限 iam_role: permissions: - s3:GetObject # 只有讀取存取 @@ -32,7 +32,7 @@ iam_role: resources: - arn:aws:s3:::my-bucket/* # 只有特定 bucket -# ❌ 錯誤:過於廣泛的權限 +# FAIL: 錯誤:過於廣泛的權限 iam_role: permissions: - s3:* # 所有 S3 動作 @@ -65,14 +65,14 @@ aws iam enable-mfa-device \ #### 雲端密鑰管理器 ```typescript -// ✅ 正確:使用雲端密鑰管理器 +// PASS: 正確:使用雲端密鑰管理器 import { SecretsManager } from '@aws-sdk/client-secrets-manager'; const client = new SecretsManager({ region: 'us-east-1' }); const secret = await client.getSecretValue({ SecretId: 'prod/api-key' }); const apiKey = JSON.parse(secret.SecretString).key; -// ❌ 錯誤:寫死或只在環境變數 +// FAIL: 錯誤:寫死或只在環境變數 const apiKey = process.env.API_KEY; // 未輪換、未稽核 ``` @@ -99,7 +99,7 @@ aws secretsmanager rotate-secret \ #### VPC 和防火牆設定 ```terraform -# ✅ 正確:限制的安全群組 +# PASS: 正確:限制的安全群組 resource "aws_security_group" "app" { name = "app-sg" @@ -118,7 +118,7 @@ resource "aws_security_group" "app" { } } -# ❌ 錯誤:對網際網路開放 +# FAIL: 錯誤:對網際網路開放 resource "aws_security_group" "bad" { ingress { from_port = 0 @@ -142,7 +142,7 @@ resource "aws_security_group" "bad" { #### CloudWatch/日誌設定 ```typescript -// ✅ 正確:全面日誌記錄 +// PASS: 正確:全面日誌記錄 import { CloudWatchLogsClient, CreateLogStreamCommand } from '@aws-sdk/client-cloudwatch-logs'; const logSecurityEvent = async (event: SecurityEvent) => { @@ -177,7 +177,7 @@ const logSecurityEvent = async (event: SecurityEvent) => { #### 安全管線設定 ```yaml -# ✅ 正確:安全的 GitHub Actions 工作流程 +# PASS: 正確:安全的 GitHub Actions 工作流程 name: Deploy on: @@ -237,7 +237,7 @@ jobs: #### Cloudflare 安全設定 ```typescript -// ✅ 正確:帶安全標頭的 Cloudflare Workers +// PASS: 正確:帶安全標頭的 Cloudflare Workers export default { async fetch(request: Request): Promise { const response = await fetch(request); @@ -281,7 +281,7 @@ export default { #### 自動備份 ```terraform -# ✅ 正確:自動 RDS 備份 +# PASS: 正確:自動 RDS 備份 resource "aws_db_instance" "main" { allocated_storage = 20 engine = "postgres" @@ -327,10 +327,10 @@ resource "aws_db_instance" "main" { ### S3 Bucket 暴露 ```bash -# ❌ 錯誤:公開 bucket +# FAIL: 錯誤:公開 bucket aws s3api put-bucket-acl --bucket my-bucket --acl public-read -# ✅ 正確:私有 bucket 並有特定存取 +# PASS: 正確:私有 bucket 並有特定存取 aws s3api put-bucket-acl --bucket my-bucket --acl private aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ``` @@ -338,12 +338,12 @@ aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ### RDS 公開存取 ```terraform -# ❌ 錯誤 +# FAIL: 錯誤 resource "aws_db_instance" "bad" { publicly_accessible = true # 絕不這樣做! } -# ✅ 正確 +# PASS: 正確 resource "aws_db_instance" "good" { publicly_accessible = false vpc_security_group_ids = [aws_security_group.db.id] diff --git a/docs/zh-TW/skills/tdd-workflow/SKILL.md b/docs/zh-TW/skills/tdd-workflow/SKILL.md index 2ee4cd8a..918a1aa7 100644 --- a/docs/zh-TW/skills/tdd-workflow/SKILL.md +++ b/docs/zh-TW/skills/tdd-workflow/SKILL.md @@ -313,39 +313,39 @@ npm run test:coverage ## 常見測試錯誤避免 -### ❌ 錯誤:測試實作細節 +### FAIL: 錯誤:測試實作細節 ```typescript // 不要測試內部狀態 expect(component.state.count).toBe(5) ``` -### ✅ 正確:測試使用者可見行為 +### PASS: 正確:測試使用者可見行為 ```typescript // 測試使用者看到的內容 expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ 錯誤:脆弱的選擇器 +### FAIL: 錯誤:脆弱的選擇器 ```typescript // 容易壞掉 await page.click('.css-class-xyz') ``` -### ✅ 正確:語意選擇器 +### PASS: 正確:語意選擇器 ```typescript // 對變更有彈性 await page.click('button:has-text("Submit")') await page.click('[data-testid="submit-button"]') ``` -### ❌ 錯誤:無測試隔離 +### FAIL: 錯誤:無測試隔離 ```typescript // 測試互相依賴 test('creates user', () => { /* ... */ }) test('updates same user', () => { /* 依賴前一個測試 */ }) ``` -### ✅ 正確:獨立測試 +### PASS: 正確:獨立測試 ```typescript // 每個測試設置自己的資料 test('creates user', () => { diff --git a/package.json b/package.json index c3704007..2356377a 100644 --- a/package.json +++ b/package.json @@ -108,7 +108,7 @@ "orchestrate:status": "node scripts/orchestration-status.js", "orchestrate:worker": "bash scripts/orchestrate-codex-worker.sh", "orchestrate:tmux": "node scripts/orchestrate-worktrees.js", - "test": "node scripts/ci/validate-agents.js && node scripts/ci/validate-commands.js && node scripts/ci/validate-rules.js && node scripts/ci/validate-skills.js && node scripts/ci/validate-hooks.js && node scripts/ci/validate-install-manifests.js && node scripts/ci/validate-no-personal-paths.js && node scripts/ci/catalog.js --text && node tests/run-all.js", + "test": "node scripts/ci/check-unicode-safety.js && node scripts/ci/validate-agents.js && node scripts/ci/validate-commands.js && node scripts/ci/validate-rules.js && node scripts/ci/validate-skills.js && node scripts/ci/validate-hooks.js && node scripts/ci/validate-install-manifests.js && node scripts/ci/validate-no-personal-paths.js && node scripts/ci/catalog.js --text && node tests/run-all.js", "coverage": "c8 --all --include=\"scripts/**/*.js\" --check-coverage --lines 80 --functions 80 --branches 80 --statements 80 --reporter=text --reporter=lcov node tests/run-all.js" }, "dependencies": { diff --git a/scripts/ci/catalog.js b/scripts/ci/catalog.js index ed0ff74c..8ef3dc92 100644 --- a/scripts/ci/catalog.js +++ b/scripts/ci/catalog.js @@ -76,9 +76,9 @@ function parseReadmeExpectations(readmeContent) { ); const tablePatterns = [ - { category: 'agents', regex: /\|\s*(?:\*\*)?Agents(?:\*\*)?\s*\|\s*✅\s*(\d+)\s+agents\s*\|/i, source: 'README.md comparison table' }, - { category: 'commands', regex: /\|\s*(?:\*\*)?Commands(?:\*\*)?\s*\|\s*✅\s*(\d+)\s+commands\s*\|/i, source: 'README.md comparison table' }, - { category: 'skills', regex: /\|\s*(?:\*\*)?Skills(?:\*\*)?\s*\|\s*✅\s*(\d+)\s+skills\s*\|/i, source: 'README.md comparison table' } + { category: 'agents', regex: /\|\s*(?:\*\*)?Agents(?:\*\*)?\s*\|\s*(?:(?:PASS:|\u2705)\s*)?(\d+)\s+agents\s*\|/i, source: 'README.md comparison table' }, + { category: 'commands', regex: /\|\s*(?:\*\*)?Commands(?:\*\*)?\s*\|\s*(?:(?:PASS:|\u2705)\s*)?(\d+)\s+commands\s*\|/i, source: 'README.md comparison table' }, + { category: 'skills', regex: /\|\s*(?:\*\*)?Skills(?:\*\*)?\s*\|\s*(?:(?:PASS:|\u2705)\s*)?(\d+)\s+skills\s*\|/i, source: 'README.md comparison table' } ]; for (const pattern of tablePatterns) { diff --git a/scripts/ci/check-unicode-safety.js b/scripts/ci/check-unicode-safety.js new file mode 100644 index 00000000..4c35980d --- /dev/null +++ b/scripts/ci/check-unicode-safety.js @@ -0,0 +1,204 @@ +#!/usr/bin/env node + +const fs = require('fs'); +const path = require('path'); + +const repoRoot = process.env.ECC_UNICODE_SCAN_ROOT + ? path.resolve(process.env.ECC_UNICODE_SCAN_ROOT) + : path.resolve(__dirname, '..', '..'); + +const writeMode = process.argv.includes('--write'); + +const ignoredDirs = new Set([ + '.git', + 'node_modules', + '.dmux', + '.next', + 'coverage', +]); + +const textExtensions = new Set([ + '.md', + '.mdx', + '.txt', + '.js', + '.cjs', + '.mjs', + '.ts', + '.tsx', + '.jsx', + '.json', + '.toml', + '.yml', + '.yaml', + '.sh', + '.bash', + '.zsh', + '.ps1', + '.py', + '.rs', +]); + +const writableExtensions = new Set([ + '.md', + '.mdx', + '.txt', +]); + +const writeModeSkip = new Set([ + path.normalize('scripts/ci/check-unicode-safety.js'), + path.normalize('tests/scripts/check-unicode-safety.test.js'), +]); + +const dangerousInvisibleRe = + /[\u200B-\u200D\u2060\uFEFF\u202A-\u202E\u2066-\u2069\uFE00-\uFE0F\u{E0100}-\u{E01EF}]/gu; +const emojiRe = /[\p{Extended_Pictographic}\p{Regional_Indicator}]/gu; +const allowedSymbolCodePoints = new Set([ + 0x00A9, + 0x00AE, + 0x2122, +]); + +const targetedReplacements = [ + [new RegExp(`${String.fromCodePoint(0x26A0)}(?:\\uFE0F)?`, 'gu'), 'WARNING:'], + [new RegExp(`${String.fromCodePoint(0x23ED)}(?:\\uFE0F)?`, 'gu'), 'SKIPPED:'], + [new RegExp(String.fromCodePoint(0x2705), 'gu'), 'PASS:'], + [new RegExp(String.fromCodePoint(0x274C), 'gu'), 'FAIL:'], + [new RegExp(String.fromCodePoint(0x2728), 'gu'), ''], +]; + +function shouldSkip(entryPath) { + return entryPath.split(path.sep).some(part => ignoredDirs.has(part)); +} + +function isTextFile(filePath) { + return textExtensions.has(path.extname(filePath).toLowerCase()); +} + +function canAutoWrite(relativePath) { + return writableExtensions.has(path.extname(relativePath).toLowerCase()); +} + +function listFiles(dirPath) { + const results = []; + for (const entry of fs.readdirSync(dirPath, { withFileTypes: true })) { + const entryPath = path.join(dirPath, entry.name); + if (shouldSkip(entryPath)) continue; + if (entry.isDirectory()) { + results.push(...listFiles(entryPath)); + continue; + } + if (entry.isFile() && isTextFile(entryPath)) { + results.push(entryPath); + } + } + return results; +} + +function lineAndColumn(text, index) { + const line = text.slice(0, index).split('\n').length; + const lastNewline = text.lastIndexOf('\n', index - 1); + const column = index - lastNewline; + return { line, column }; +} + +function isAllowedEmojiLikeSymbol(char) { + return allowedSymbolCodePoints.has(char.codePointAt(0)); +} + +function sanitizeText(text) { + let next = text; + next = next.replace(dangerousInvisibleRe, ''); + + for (const [pattern, replacement] of targetedReplacements) { + next = next.replace(pattern, replacement); + } + + next = next.replace(emojiRe, match => (isAllowedEmojiLikeSymbol(match) ? match : '')); + next = next.replace(/^ +(?=\*\*)/gm, ''); + next = next.replace(/^(\*\*)\s+/gm, '$1'); + next = next.replace(/^(#+)\s{2,}/gm, '$1 '); + next = next.replace(/^>\s{2,}/gm, '> '); + next = next.replace(/^-\s{2,}/gm, '- '); + next = next.replace(/^(\d+\.)\s{2,}/gm, '$1 '); + next = next.replace(/[ \t]+$/gm, ''); + + return next; +} + +function collectMatches(text, regex, kind) { + const matches = []; + for (const match of text.matchAll(regex)) { + const char = match[0]; + if (kind === 'emoji' && isAllowedEmojiLikeSymbol(char)) { + continue; + } + const index = match.index ?? 0; + const { line, column } = lineAndColumn(text, index); + matches.push({ + kind, + char, + codePoint: `U+${char.codePointAt(0).toString(16).toUpperCase()}`, + line, + column, + }); + } + return matches; +} + +const changedFiles = []; +const violations = []; + +for (const filePath of listFiles(repoRoot)) { + const relativePath = path.relative(repoRoot, filePath); + let text; + try { + text = fs.readFileSync(filePath, 'utf8'); + } catch { + continue; + } + + if ( + writeMode && + !writeModeSkip.has(path.normalize(relativePath)) && + canAutoWrite(relativePath) + ) { + const sanitized = sanitizeText(text); + if (sanitized !== text) { + fs.writeFileSync(filePath, sanitized, 'utf8'); + changedFiles.push(relativePath); + text = sanitized; + } + } + + const fileViolations = [ + ...collectMatches(text, dangerousInvisibleRe, 'dangerous-invisible'), + ...collectMatches(text, emojiRe, 'emoji'), + ]; + + for (const violation of fileViolations) { + violations.push({ + file: relativePath, + ...violation, + }); + } +} + +if (changedFiles.length > 0) { + console.log(`Sanitized ${changedFiles.length} files:`); + for (const file of changedFiles) { + console.log(`- ${file}`); + } +} + +if (violations.length > 0) { + console.error('Unicode safety violations detected:'); + for (const violation of violations) { + console.error( + `${violation.file}:${violation.line}:${violation.column} ${violation.kind} ${violation.codePoint}` + ); + } + process.exit(1); +} + +console.log('Unicode safety check passed.'); diff --git a/scripts/hooks/pre-bash-commit-quality.js b/scripts/hooks/pre-bash-commit-quality.js index 10e2d589..a601317d 100644 --- a/scripts/hooks/pre-bash-commit-quality.js +++ b/scripts/hooks/pre-bash-commit-quality.js @@ -306,10 +306,10 @@ function evaluate(rawInput) { for (const file of filesToCheck) { const fileIssues = findFileIssues(file); if (fileIssues.length > 0) { - console.error(`\n📁 ${file}`); + console.error(`\n[FILE] ${file}`); for (const issue of fileIssues) { - const icon = issue.severity === 'error' ? '❌' : issue.severity === 'warning' ? '⚠️' : 'ℹ️'; - console.error(` ${icon} Line ${issue.line}: ${issue.message}`); + const label = issue.severity === 'error' ? 'ERROR' : issue.severity === 'warning' ? 'WARNING' : 'INFO'; + console.error(` ${label} Line ${issue.line}: ${issue.message}`); totalIssues++; if (issue.severity === 'error') errorCount++; if (issue.severity === 'warning') warningCount++; @@ -321,11 +321,11 @@ function evaluate(rawInput) { // Validate commit message if provided const messageValidation = validateCommitMessage(command); if (messageValidation && messageValidation.issues.length > 0) { - console.error('\n📝 Commit Message Issues:'); + console.error('\nCommit Message Issues:'); for (const issue of messageValidation.issues) { - console.error(` ⚠️ ${issue.message}`); + console.error(` WARNING ${issue.message}`); if (issue.suggestion) { - console.error(` 💡 ${issue.suggestion}`); + console.error(` TIP ${issue.suggestion}`); } totalIssues++; warningCount++; @@ -336,21 +336,21 @@ function evaluate(rawInput) { const lintResults = runLinter(filesToCheck); if (lintResults.eslint && !lintResults.eslint.success) { - console.error('\n🔍 ESLint Issues:'); + console.error('\nESLint Issues:'); console.error(lintResults.eslint.output); totalIssues++; errorCount++; } if (lintResults.pylint && !lintResults.pylint.success) { - console.error('\n🔍 Pylint Issues:'); + console.error('\nPylint Issues:'); console.error(lintResults.pylint.output); totalIssues++; errorCount++; } if (lintResults.golint && !lintResults.golint.success) { - console.error('\n🔍 golint Issues:'); + console.error('\ngolint Issues:'); console.error(lintResults.golint.output); totalIssues++; errorCount++; @@ -358,17 +358,17 @@ function evaluate(rawInput) { // Summary if (totalIssues > 0) { - console.error(`\n📊 Summary: ${totalIssues} issue(s) found (${errorCount} error(s), ${warningCount} warning(s), ${infoCount} info)`); + console.error(`\nSummary: ${totalIssues} issue(s) found (${errorCount} error(s), ${warningCount} warning(s), ${infoCount} info)`); if (errorCount > 0) { - console.error('\n[Hook] ❌ Commit blocked due to critical issues. Fix them before committing.'); + console.error('\n[Hook] ERROR: Commit blocked due to critical issues. Fix them before committing.'); return { output: rawInput, exitCode: 2 }; } else { - console.error('\n[Hook] ⚠️ Warnings found. Consider fixing them, but commit is allowed.'); + console.error('\n[Hook] WARNING: Warnings found. Consider fixing them, but commit is allowed.'); console.error('[Hook] To bypass these checks, use: git commit --no-verify'); } } else { - console.error('\n[Hook] ✅ All checks passed!'); + console.error('\n[Hook] PASS: All checks passed!'); } } catch (error) { diff --git a/scripts/skill-create-output.js b/scripts/skill-create-output.js index 2d0aed7e..66c900f0 100644 --- a/scripts/skill-create-output.js +++ b/scripts/skill-create-output.js @@ -64,7 +64,7 @@ function sleep(ms) { } async function animateProgress(label, steps, callback) { - process.stdout.write(`\n${chalk.cyan('⏳')} ${label}...\n`); + process.stdout.write(`\n${chalk.cyan('[RUN]')} ${label}...\n`); for (let i = 0; i < steps.length; i++) { const step = steps[i]; @@ -72,7 +72,7 @@ async function animateProgress(label, steps, callback) { await sleep(step.duration || 500); process.stdout.clearLine?.(0) || process.stdout.write('\r'); process.stdout.cursorTo?.(0) || process.stdout.write('\r'); - process.stdout.write(` ${chalk.green('✓')} ${step.name}\n`); + process.stdout.write(` ${chalk.green('[DONE]')} ${step.name}\n`); if (callback) callback(step, i); } } @@ -90,7 +90,7 @@ class SkillCreateOutput { console.log('\n'); console.log(chalk.bold(chalk.magenta('╔════════════════════════════════════════════════════════════════╗'))); - console.log(chalk.bold(chalk.magenta('║')) + chalk.bold(' 🔮 ECC Skill Creator ') + chalk.bold(chalk.magenta('║'))); + console.log(chalk.bold(chalk.magenta('║')) + chalk.bold(' ECC Skill Creator ') + chalk.bold(chalk.magenta('║'))); console.log(chalk.bold(chalk.magenta('║')) + ` ${subtitle}${' '.repeat(Math.max(0, 59 - stripAnsi(subtitle).length))}` + chalk.bold(chalk.magenta('║'))); console.log(chalk.bold(chalk.magenta('╚════════════════════════════════════════════════════════════════╝'))); console.log(''); @@ -111,7 +111,7 @@ class SkillCreateOutput { analysisResults(data) { console.log('\n'); - console.log(box('📊 Analysis Results', ` + console.log(box('Analysis Results', ` ${chalk.bold('Commits Analyzed:')} ${chalk.yellow(data.commits)} ${chalk.bold('Time Range:')} ${chalk.gray(data.timeRange)} ${chalk.bold('Contributors:')} ${chalk.cyan(data.contributors)} @@ -121,7 +121,7 @@ ${chalk.bold('Files Tracked:')} ${chalk.green(data.files)} patterns(patterns) { console.log('\n'); - console.log(chalk.bold(chalk.cyan('🔍 Key Patterns Discovered:'))); + console.log(chalk.bold(chalk.cyan('Key Patterns Discovered:'))); console.log(chalk.gray('─'.repeat(50))); patterns.forEach((pattern, i) => { @@ -137,26 +137,26 @@ ${chalk.bold('Files Tracked:')} ${chalk.green(data.files)} instincts(instincts) { console.log('\n'); - console.log(box('🧠 Instincts Generated', instincts.map((inst, i) => + console.log(box('Instincts Generated', instincts.map((inst, i) => `${chalk.yellow(`${i + 1}.`)} ${chalk.bold(inst.name)} ${chalk.gray(`(${Math.round(inst.confidence * 100)}%)`)}` ).join('\n'))); } output(skillPath, instinctsPath) { console.log('\n'); - console.log(chalk.bold(chalk.green('✨ Generation Complete!'))); + console.log(chalk.bold(chalk.green('Generation Complete!'))); console.log(chalk.gray('─'.repeat(50))); console.log(` - ${chalk.green('📄')} ${chalk.bold('Skill File:')} + ${chalk.green('-')} ${chalk.bold('Skill File:')} ${chalk.cyan(skillPath)} - ${chalk.green('🧠')} ${chalk.bold('Instincts File:')} + ${chalk.green('-')} ${chalk.bold('Instincts File:')} ${chalk.cyan(instinctsPath)} `); } nextSteps() { - console.log(box('📋 Next Steps', ` + console.log(box('Next Steps', ` ${chalk.yellow('1.')} Review the generated SKILL.md ${chalk.yellow('2.')} Import instincts: ${chalk.cyan('/instinct-import ')} ${chalk.yellow('3.')} View learned patterns: ${chalk.cyan('/instinct-status')} diff --git a/skills/ai-regression-testing/SKILL.md b/skills/ai-regression-testing/SKILL.md index 6dcea168..29f2b220 100644 --- a/skills/ai-regression-testing/SKILL.md +++ b/skills/ai-regression-testing/SKILL.md @@ -39,7 +39,7 @@ Fix 3: Changed to SELECT * → Fixed production path, forgot sandbox path → AI reviewed and missed it AGAIN (4th occurrence) -Fix 4: Test caught it instantly on first run ✅ +Fix 4: Test caught it instantly on first run PASS: ``` The pattern: **sandbox/production path inconsistency** is the #1 AI-introduced regression. @@ -249,14 +249,14 @@ User: "バグチェックして" (or "/bug-check") **Frequency**: Most common (observed in 3 out of 4 regressions) ```typescript -// ❌ AI adds field to production path only +// FAIL: AI adds field to production path only if (isSandboxMode()) { return { data: { id, email, name } }; // Missing new field } // Production path return { data: { id, email, name, notification_settings } }; -// ✅ Both paths must return the same shape +// PASS: Both paths must return the same shape if (isSandboxMode()) { return { data: { id, email, name, notification_settings: null } }; } @@ -282,7 +282,7 @@ it("sandbox and production return same fields", async () => { **Frequency**: Common with Supabase/Prisma when adding new columns ```typescript -// ❌ New column added to response but not to SELECT +// FAIL: New column added to response but not to SELECT const { data } = await supabase .from("users") .select("id, email, name") // notification_settings not here @@ -291,7 +291,7 @@ const { data } = await supabase return { data: { ...data, notification_settings: data.notification_settings } }; // → notification_settings is always undefined -// ✅ Use SELECT * or explicitly include new columns +// PASS: Use SELECT * or explicitly include new columns const { data } = await supabase .from("users") .select("*") @@ -303,13 +303,13 @@ const { data } = await supabase **Frequency**: Moderate — when adding error handling to existing components ```typescript -// ❌ Error state set but old data not cleared +// FAIL: Error state set but old data not cleared catch (err) { setError("Failed to load"); // reservations still shows data from previous tab! } -// ✅ Clear related state on error +// PASS: Clear related state on error catch (err) { setReservations([]); // Clear stale data setError("Failed to load"); @@ -319,14 +319,14 @@ catch (err) { ### Pattern 4: Optimistic Update Without Proper Rollback ```typescript -// ❌ No rollback on failure +// FAIL: No rollback on failure const handleRemove = async (id: string) => { setItems(prev => prev.filter(i => i.id !== id)); await fetch(`/api/items/${id}`, { method: "DELETE" }); // If API fails, item is gone from UI but still in DB }; -// ✅ Capture previous state and rollback on failure +// PASS: Capture previous state and rollback on failure const handleRemove = async (id: string) => { const prevItems = [...items]; setItems(prev => prev.filter(i => i.id !== id)); @@ -362,11 +362,11 @@ No bug in /api/user/notifications → Don't write test (yet) | AI Regression Pattern | Test Strategy | Priority | |---|---|---| -| Sandbox/production mismatch | Assert same response shape in sandbox mode | 🔴 High | -| SELECT clause omission | Assert all required fields in response | 🔴 High | -| Error state leakage | Assert state cleanup on error | 🟡 Medium | -| Missing rollback | Assert state restored on API failure | 🟡 Medium | -| Type cast masking null | Assert field is not undefined | 🟡 Medium | +| Sandbox/production mismatch | Assert same response shape in sandbox mode | High | +| SELECT clause omission | Assert all required fields in response | High | +| Error state leakage | Assert state cleanup on error | Medium | +| Missing rollback | Assert state restored on API failure | Medium | +| Type cast masking null | Assert field is not undefined | Medium | ## DO / DON'T diff --git a/skills/backend-patterns/SKILL.md b/skills/backend-patterns/SKILL.md index 42c0cbee..30898b4d 100644 --- a/skills/backend-patterns/SKILL.md +++ b/skills/backend-patterns/SKILL.md @@ -23,7 +23,7 @@ Backend architecture patterns and best practices for scalable server-side applic ### RESTful API Structure ```typescript -// ✅ Resource-based URLs +// PASS: Resource-based URLs GET /api/markets # List resources GET /api/markets/:id # Get single resource POST /api/markets # Create resource @@ -31,7 +31,7 @@ PUT /api/markets/:id # Replace resource PATCH /api/markets/:id # Update resource DELETE /api/markets/:id # Delete resource -// ✅ Query parameters for filtering, sorting, pagination +// PASS: Query parameters for filtering, sorting, pagination GET /api/markets?status=active&sort=volume&limit=20&offset=0 ``` @@ -131,7 +131,7 @@ export default withAuth(async (req, res) => { ### Query Optimization ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status, volume') @@ -139,7 +139,7 @@ const { data } = await supabase .order('volume', { ascending: false }) .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -148,13 +148,13 @@ const { data } = await supabase ### N+1 Query Prevention ```typescript -// ❌ BAD: N+1 query problem +// FAIL: BAD: N+1 query problem const markets = await getMarkets() for (const market of markets) { market.creator = await getUser(market.creator_id) // N queries } -// ✅ GOOD: Batch fetch +// PASS: GOOD: Batch fetch const markets = await getMarkets() const creatorIds = markets.map(m => m.creator_id) const creators = await getUsers(creatorIds) // 1 query diff --git a/skills/benchmark/SKILL.md b/skills/benchmark/SKILL.md index 8ae15331..cdf81e9a 100644 --- a/skills/benchmark/SKILL.md +++ b/skills/benchmark/SKILL.md @@ -77,9 +77,9 @@ Output: ``` | Metric | Before | After | Delta | Verdict | |--------|--------|-------|-------|---------| -| LCP | 1.2s | 1.4s | +200ms | ⚠ WARN | +| LCP | 1.2s | 1.4s | +200ms | WARNING: WARN | | Bundle | 180KB | 175KB | -5KB | ✓ BETTER | -| Build | 12s | 14s | +2s | ⚠ WARN | +| Build | 12s | 14s | +2s | WARNING: WARN | ``` ## Output diff --git a/skills/carrier-relationship-management/SKILL.md b/skills/carrier-relationship-management/SKILL.md index 39210110..09b546e1 100644 --- a/skills/carrier-relationship-management/SKILL.md +++ b/skills/carrier-relationship-management/SKILL.md @@ -14,7 +14,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🤝" + emoji: "" --- # Carrier Relationship Management diff --git a/skills/ck/commands/resume.mjs b/skills/ck/commands/resume.mjs index ccb5e313..605f1049 100644 --- a/skills/ck/commands/resume.mjs +++ b/skills/ck/commands/resume.mjs @@ -28,7 +28,7 @@ if (projectPath && projectPath !== cwd) { if (existsSync(projectPath)) { console.log(`→ cd ${projectPath}`); } else { - console.log(`⚠ Path not found: ${projectPath}`); + console.log(`WARNING Path not found: ${projectPath}`); } } diff --git a/skills/ck/hooks/session-start.mjs b/skills/ck/hooks/session-start.mjs index c3ecee66..e109149a 100644 --- a/skills/ck/hooks/session-start.mjs +++ b/skills/ck/hooks/session-start.mjs @@ -130,7 +130,7 @@ function main() { // Check if previous session ID exists in sessions array const alreadySaved = context.sessions?.some(s => s.id === prevSession.sessionId); if (!alreadySaved) { - summaryLines.push(`⚠ Last session wasn't saved — run /ck:save to capture it`); + summaryLines.push(`WARNING Last session wasn't saved — run /ck:save to capture it`); } } @@ -142,7 +142,7 @@ function main() { const claudeMdGoal = extractClaudeMdGoal(cwd); if (claudeMdGoal && context.goal && claudeMdGoal.toLowerCase().trim() !== context.goal.toLowerCase().trim()) { - summaryLines.push(`⚠ Goal mismatch — ck: "${context.goal.slice(0, 40)}" · CLAUDE.md: "${claudeMdGoal.slice(0, 40)}"`); + summaryLines.push(`WARNING Goal mismatch — ck: "${context.goal.slice(0, 40)}" · CLAUDE.md: "${claudeMdGoal.slice(0, 40)}"`); summaryLines.push(` Run /ck:save with updated goal to sync`); } @@ -165,7 +165,7 @@ function main() { '```', ``, `After the block, add one line: "Ready — what are we working on?"`, - `If you see ⚠ warnings above, mention them briefly after the block.`, + `If you see WARNING lines above, mention them briefly after the block.`, ].join('\n')); return parts; diff --git a/skills/clickhouse-io/SKILL.md b/skills/clickhouse-io/SKILL.md index 2b4ed364..9ea67481 100644 --- a/skills/clickhouse-io/SKILL.md +++ b/skills/clickhouse-io/SKILL.md @@ -96,7 +96,7 @@ ORDER BY hour DESC; ### Efficient Filtering ```sql --- ✅ GOOD: Use indexed columns first +-- PASS: GOOD: Use indexed columns first SELECT * FROM markets_analytics WHERE date >= '2025-01-01' @@ -105,7 +105,7 @@ WHERE date >= '2025-01-01' ORDER BY date DESC LIMIT 100; --- ❌ BAD: Filter on non-indexed columns first +-- FAIL: BAD: Filter on non-indexed columns first SELECT * FROM markets_analytics WHERE volume > 1000 @@ -116,7 +116,7 @@ WHERE volume > 1000 ### Aggregations ```sql --- ✅ GOOD: Use ClickHouse-specific aggregation functions +-- PASS: GOOD: Use ClickHouse-specific aggregation functions SELECT toStartOfDay(created_at) AS day, market_id, @@ -129,7 +129,7 @@ WHERE created_at >= today() - INTERVAL 7 DAY GROUP BY day, market_id ORDER BY day DESC, total_volume DESC; --- ✅ Use quantile for percentiles (more efficient than percentile) +-- PASS: Use quantile for percentiles (more efficient than percentile) SELECT quantile(0.50)(trade_size) AS median, quantile(0.95)(trade_size) AS p95, @@ -172,7 +172,7 @@ const clickhouse = new ClickHouse({ } }) -// ✅ Batch insert (efficient) +// PASS: Batch insert (efficient) async function bulkInsertTrades(trades: Trade[]) { const values = trades.map(trade => `( '${trade.id}', @@ -188,7 +188,7 @@ async function bulkInsertTrades(trades: Trade[]) { `).toPromise() } -// ❌ Individual inserts (slow) +// FAIL: Individual inserts (slow) async function insertTrade(trade: Trade) { // Don't do this in a loop! await clickhouse.query(` diff --git a/skills/coding-standards/SKILL.md b/skills/coding-standards/SKILL.md index 70d36239..200b55c0 100644 --- a/skills/coding-standards/SKILL.md +++ b/skills/coding-standards/SKILL.md @@ -48,12 +48,12 @@ Universal coding standards applicable across all projects. ### Variable Naming ```typescript -// ✅ GOOD: Descriptive names +// PASS: GOOD: Descriptive names const marketSearchQuery = 'election' const isUserAuthenticated = true const totalRevenue = 1000 -// ❌ BAD: Unclear names +// FAIL: BAD: Unclear names const q = 'election' const flag = true const x = 1000 @@ -62,12 +62,12 @@ const x = 1000 ### Function Naming ```typescript -// ✅ GOOD: Verb-noun pattern +// PASS: GOOD: Verb-noun pattern async function fetchMarketData(marketId: string) { } function calculateSimilarity(a: number[], b: number[]) { } function isValidEmail(email: string): boolean { } -// ❌ BAD: Unclear or noun-only +// FAIL: BAD: Unclear or noun-only async function market(id: string) { } function similarity(a, b) { } function email(e) { } @@ -76,7 +76,7 @@ function email(e) { } ### Immutability Pattern (CRITICAL) ```typescript -// ✅ ALWAYS use spread operator +// PASS: ALWAYS use spread operator const updatedUser = { ...user, name: 'New Name' @@ -84,7 +84,7 @@ const updatedUser = { const updatedArray = [...items, newItem] -// ❌ NEVER mutate directly +// FAIL: NEVER mutate directly user.name = 'New Name' // BAD items.push(newItem) // BAD ``` @@ -92,7 +92,7 @@ items.push(newItem) // BAD ### Error Handling ```typescript -// ✅ GOOD: Comprehensive error handling +// PASS: GOOD: Comprehensive error handling async function fetchData(url: string) { try { const response = await fetch(url) @@ -108,7 +108,7 @@ async function fetchData(url: string) { } } -// ❌ BAD: No error handling +// FAIL: BAD: No error handling async function fetchData(url) { const response = await fetch(url) return response.json() @@ -118,14 +118,14 @@ async function fetchData(url) { ### Async/Await Best Practices ```typescript -// ✅ GOOD: Parallel execution when possible +// PASS: GOOD: Parallel execution when possible const [users, markets, stats] = await Promise.all([ fetchUsers(), fetchMarkets(), fetchStats() ]) -// ❌ BAD: Sequential when unnecessary +// FAIL: BAD: Sequential when unnecessary const users = await fetchUsers() const markets = await fetchMarkets() const stats = await fetchStats() @@ -134,7 +134,7 @@ const stats = await fetchStats() ### Type Safety ```typescript -// ✅ GOOD: Proper types +// PASS: GOOD: Proper types interface Market { id: string name: string @@ -146,7 +146,7 @@ function getMarket(id: string): Promise { // Implementation } -// ❌ BAD: Using 'any' +// FAIL: BAD: Using 'any' function getMarket(id: any): Promise { // Implementation } @@ -157,7 +157,7 @@ function getMarket(id: any): Promise { ### Component Structure ```typescript -// ✅ GOOD: Functional component with types +// PASS: GOOD: Functional component with types interface ButtonProps { children: React.ReactNode onClick: () => void @@ -182,7 +182,7 @@ export function Button({ ) } -// ❌ BAD: No types, unclear structure +// FAIL: BAD: No types, unclear structure export function Button(props) { return } @@ -191,7 +191,7 @@ export function Button(props) { ### Custom Hooks ```typescript -// ✅ GOOD: Reusable custom hook +// PASS: GOOD: Reusable custom hook export function useDebounce(value: T, delay: number): T { const [debouncedValue, setDebouncedValue] = useState(value) @@ -213,25 +213,25 @@ const debouncedQuery = useDebounce(searchQuery, 500) ### State Management ```typescript -// ✅ GOOD: Proper state updates +// PASS: GOOD: Proper state updates const [count, setCount] = useState(0) // Functional update for state based on previous state setCount(prev => prev + 1) -// ❌ BAD: Direct state reference +// FAIL: BAD: Direct state reference setCount(count + 1) // Can be stale in async scenarios ``` ### Conditional Rendering ```typescript -// ✅ GOOD: Clear conditional rendering +// PASS: GOOD: Clear conditional rendering {isLoading && } {error && } {data && } -// ❌ BAD: Ternary hell +// FAIL: BAD: Ternary hell {isLoading ? : error ? : data ? : null} ``` @@ -254,7 +254,7 @@ GET /api/markets?status=active&limit=10&offset=0 ### Response Format ```typescript -// ✅ GOOD: Consistent response structure +// PASS: GOOD: Consistent response structure interface ApiResponse { success: boolean data?: T @@ -285,7 +285,7 @@ return NextResponse.json({ ```typescript import { z } from 'zod' -// ✅ GOOD: Schema validation +// PASS: GOOD: Schema validation const CreateMarketSchema = z.object({ name: z.string().min(1).max(200), description: z.string().min(1).max(2000), @@ -348,14 +348,14 @@ types/market.types.ts # camelCase with .types suffix ### When to Comment ```typescript -// ✅ GOOD: Explain WHY, not WHAT +// PASS: GOOD: Explain WHY, not WHAT // Use exponential backoff to avoid overwhelming the API during outages const delay = Math.min(1000 * Math.pow(2, retryCount), 30000) // Deliberately using mutation here for performance with large arrays items.push(newItem) -// ❌ BAD: Stating the obvious +// FAIL: BAD: Stating the obvious // Increment counter by 1 count++ @@ -395,12 +395,12 @@ export async function searchMarkets( ```typescript import { useMemo, useCallback } from 'react' -// ✅ GOOD: Memoize expensive computations +// PASS: GOOD: Memoize expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ GOOD: Memoize callbacks +// PASS: GOOD: Memoize callbacks const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) @@ -411,7 +411,7 @@ const handleSearch = useCallback((query: string) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ GOOD: Lazy load heavy components +// PASS: GOOD: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) export function Dashboard() { @@ -426,13 +426,13 @@ export function Dashboard() { ### Database Queries ```typescript -// ✅ GOOD: Select only needed columns +// PASS: GOOD: Select only needed columns const { data } = await supabase .from('markets') .select('id, name, status') .limit(10) -// ❌ BAD: Select everything +// FAIL: BAD: Select everything const { data } = await supabase .from('markets') .select('*') @@ -459,12 +459,12 @@ test('calculates similarity correctly', () => { ### Test Naming ```typescript -// ✅ GOOD: Descriptive test names +// PASS: GOOD: Descriptive test names test('returns empty array when no markets match query', () => { }) test('throws error when OpenAI API key is missing', () => { }) test('falls back to substring search when Redis unavailable', () => { }) -// ❌ BAD: Vague test names +// FAIL: BAD: Vague test names test('works', () => { }) test('test search', () => { }) ``` @@ -475,12 +475,12 @@ Watch for these anti-patterns: ### 1. Long Functions ```typescript -// ❌ BAD: Function > 50 lines +// FAIL: BAD: Function > 50 lines function processMarketData() { // 100 lines of code } -// ✅ GOOD: Split into smaller functions +// PASS: GOOD: Split into smaller functions function processMarketData() { const validated = validateData() const transformed = transformData(validated) @@ -490,7 +490,7 @@ function processMarketData() { ### 2. Deep Nesting ```typescript -// ❌ BAD: 5+ levels of nesting +// FAIL: BAD: 5+ levels of nesting if (user) { if (user.isAdmin) { if (market) { @@ -503,7 +503,7 @@ if (user) { } } -// ✅ GOOD: Early returns +// PASS: GOOD: Early returns if (!user) return if (!user.isAdmin) return if (!market) return @@ -515,11 +515,11 @@ if (!hasPermission) return ### 3. Magic Numbers ```typescript -// ❌ BAD: Unexplained numbers +// FAIL: BAD: Unexplained numbers if (retryCount > 3) { } setTimeout(callback, 500) -// ✅ GOOD: Named constants +// PASS: GOOD: Named constants const MAX_RETRIES = 3 const DEBOUNCE_DELAY_MS = 500 diff --git a/skills/context-budget/SKILL.md b/skills/context-budget/SKILL.md index f33a96eb..d0b4c648 100644 --- a/skills/context-budget/SKILL.md +++ b/skills/context-budget/SKILL.md @@ -89,7 +89,7 @@ Component Breakdown: │ CLAUDE.md │ N │ ~X,XXX │ └─────────────────┴────────┴───────────┘ -⚠ Issues Found (N): +WARNING: Issues Found (N): [ranked by token savings] Top 3 Optimizations: diff --git a/skills/continuous-agent-loop/SKILL.md b/skills/continuous-agent-loop/SKILL.md index 3e7bd932..56124a4e 100644 --- a/skills/continuous-agent-loop/SKILL.md +++ b/skills/continuous-agent-loop/SKILL.md @@ -14,7 +14,7 @@ This is the v1.8+ canonical loop skill name. It supersedes `autonomous-loops` wh Start | +-- Need strict CI/PR control? -- yes --> continuous-pr - | + | +-- Need RFC decomposition? -- yes --> rfc-dag | +-- Need exploratory parallel generation? -- yes --> infinite diff --git a/skills/customs-trade-compliance/SKILL.md b/skills/customs-trade-compliance/SKILL.md index 59fde684..702b2563 100644 --- a/skills/customs-trade-compliance/SKILL.md +++ b/skills/customs-trade-compliance/SKILL.md @@ -15,7 +15,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🌐" + emoji: "" --- # Customs & Trade Compliance diff --git a/skills/django-verification/SKILL.md b/skills/django-verification/SKILL.md index b8ccbd56..36c81029 100644 --- a/skills/django-verification/SKILL.md +++ b/skills/django-verification/SKILL.md @@ -357,7 +357,7 @@ Phase 12: Diff Review ✓ No hardcoded secrets ✓ Migrations included -RECOMMENDATION: ⚠️ Fix pip-audit vulnerabilities before deploying +RECOMMENDATION: WARNING: Fix pip-audit vulnerabilities before deploying NEXT STEPS: 1. Update vulnerable dependencies diff --git a/skills/energy-procurement/SKILL.md b/skills/energy-procurement/SKILL.md index d5531213..0145815d 100644 --- a/skills/energy-procurement/SKILL.md +++ b/skills/energy-procurement/SKILL.md @@ -15,7 +15,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "⚡" + emoji: "" --- # Energy Procurement diff --git a/skills/frontend-patterns/SKILL.md b/skills/frontend-patterns/SKILL.md index 7ce38802..ef0de63f 100644 --- a/skills/frontend-patterns/SKILL.md +++ b/skills/frontend-patterns/SKILL.md @@ -23,7 +23,7 @@ Modern frontend patterns for React, Next.js, and performant user interfaces. ### Composition Over Inheritance ```typescript -// ✅ GOOD: Component composition +// PASS: GOOD: Component composition interface CardProps { children: React.ReactNode variant?: 'default' | 'outlined' @@ -294,17 +294,17 @@ export function useMarkets() { ### Memoization ```typescript -// ✅ useMemo for expensive computations +// PASS: useMemo for expensive computations const sortedMarkets = useMemo(() => { return markets.sort((a, b) => b.volume - a.volume) }, [markets]) -// ✅ useCallback for functions passed to children +// PASS: useCallback for functions passed to children const handleSearch = useCallback((query: string) => { setSearchQuery(query) }, []) -// ✅ React.memo for pure components +// PASS: React.memo for pure components export const MarketCard = React.memo(({ market }) => { return (
@@ -320,7 +320,7 @@ export const MarketCard = React.memo(({ market }) => { ```typescript import { lazy, Suspense } from 'react' -// ✅ Lazy load heavy components +// PASS: Lazy load heavy components const HeavyChart = lazy(() => import('./HeavyChart')) const ThreeJsBackground = lazy(() => import('./ThreeJsBackground')) @@ -515,7 +515,7 @@ export class ErrorBoundary extends React.Component< ```typescript import { motion, AnimatePresence } from 'framer-motion' -// ✅ List animations +// PASS: List animations export function AnimatedMarketList({ markets }: { markets: Market[] }) { return ( @@ -534,7 +534,7 @@ export function AnimatedMarketList({ markets }: { markets: Market[] }) { ) } -// ✅ Modal animations +// PASS: Modal animations export function Modal({ isOpen, onClose, children }: ModalProps) { return ( diff --git a/skills/git-workflow/SKILL.md b/skills/git-workflow/SKILL.md index 8d1e2523..fb49caaa 100644 --- a/skills/git-workflow/SKILL.md +++ b/skills/git-workflow/SKILL.md @@ -138,8 +138,7 @@ Create `.gitmessage` in repo root: ``` # (): -# -# Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert +# # Types: feat, fix, docs, style, refactor, test, chore, perf, ci, revert # Scope: api, ui, db, auth, etc. # Subject: imperative mood, no period, max 50 chars # diff --git a/skills/inventory-demand-planning/SKILL.md b/skills/inventory-demand-planning/SKILL.md index fcc33ec3..4c33d856 100644 --- a/skills/inventory-demand-planning/SKILL.md +++ b/skills/inventory-demand-planning/SKILL.md @@ -15,7 +15,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "📊" + emoji: "" --- # Inventory Demand Planning diff --git a/skills/iterative-retrieval/SKILL.md b/skills/iterative-retrieval/SKILL.md index 0a24a6dd..34714772 100644 --- a/skills/iterative-retrieval/SKILL.md +++ b/skills/iterative-retrieval/SKILL.md @@ -36,12 +36,12 @@ A 4-phase loop that progressively refines context: ┌─────────────────────────────────────────────┐ │ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ DISPATCH │─────▶│ EVALUATE │ │ +│ │ DISPATCH │─────│ EVALUATE │ │ │ └──────────┘ └──────────┘ │ │ ▲ │ │ │ │ ▼ │ │ ┌──────────┐ ┌──────────┐ │ -│ │ LOOP │◀─────│ REFINE │ │ +│ │ LOOP │─────│ REFINE │ │ │ └──────────┘ └──────────┘ │ │ │ │ Max 3 cycles, then proceed │ diff --git a/skills/java-coding-standards/SKILL.md b/skills/java-coding-standards/SKILL.md index af990255..a66be23e 100644 --- a/skills/java-coding-standards/SKILL.md +++ b/skills/java-coding-standards/SKILL.md @@ -26,22 +26,22 @@ Standards for readable, maintainable Java (17+) code in Spring Boot services. ## Naming ```java -// ✅ Classes/Records: PascalCase +// PASS: Classes/Records: PascalCase public class MarketService {} public record Money(BigDecimal amount, Currency currency) {} -// ✅ Methods/fields: camelCase +// PASS: Methods/fields: camelCase private final MarketRepository marketRepository; public Market findBySlug(String slug) {} -// ✅ Constants: UPPER_SNAKE_CASE +// PASS: Constants: UPPER_SNAKE_CASE private static final int MAX_PAGE_SIZE = 100; ``` ## Immutability ```java -// ✅ Favor records and final fields +// PASS: Favor records and final fields public record MarketDto(Long id, String name, MarketStatus status) {} public class Market { @@ -54,10 +54,10 @@ public class Market { ## Optional Usage ```java -// ✅ Return Optional from find* methods +// PASS: Return Optional from find* methods Optional market = marketRepository.findBySlug(slug); -// ✅ Map/flatMap instead of get() +// PASS: Map/flatMap instead of get() return market .map(MarketResponse::from) .orElseThrow(() -> new EntityNotFoundException("Market not found")); @@ -66,13 +66,13 @@ return market ## Streams Best Practices ```java -// ✅ Use streams for transformations, keep pipelines short +// PASS: Use streams for transformations, keep pipelines short List names = markets.stream() .map(Market::name) .filter(Objects::nonNull) .toList(); -// ❌ Avoid complex nested streams; prefer loops for clarity +// FAIL: Avoid complex nested streams; prefer loops for clarity ``` ## Exceptions diff --git a/skills/logistics-exception-management/SKILL.md b/skills/logistics-exception-management/SKILL.md index a1e29ec7..861288b1 100644 --- a/skills/logistics-exception-management/SKILL.md +++ b/skills/logistics-exception-management/SKILL.md @@ -14,7 +14,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "📦" + emoji: "" --- # Logistics Exception Management diff --git a/skills/production-scheduling/SKILL.md b/skills/production-scheduling/SKILL.md index dbfcf240..c075625b 100644 --- a/skills/production-scheduling/SKILL.md +++ b/skills/production-scheduling/SKILL.md @@ -15,7 +15,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🏭" + emoji: "" --- # Production Scheduling diff --git a/skills/quality-nonconformance/SKILL.md b/skills/quality-nonconformance/SKILL.md index 77f3d805..f3a8f9c7 100644 --- a/skills/quality-nonconformance/SKILL.md +++ b/skills/quality-nonconformance/SKILL.md @@ -15,7 +15,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🔍" + emoji: "" --- # Quality & Non-Conformance Management diff --git a/skills/returns-reverse-logistics/SKILL.md b/skills/returns-reverse-logistics/SKILL.md index e6bccb16..0ed24d76 100644 --- a/skills/returns-reverse-logistics/SKILL.md +++ b/skills/returns-reverse-logistics/SKILL.md @@ -15,7 +15,7 @@ origin: ECC metadata: author: evos clawdbot: - emoji: "🔄" + emoji: "" --- # Returns & Reverse Logistics diff --git a/skills/security-review/SKILL.md b/skills/security-review/SKILL.md index 35403243..af848b95 100644 --- a/skills/security-review/SKILL.md +++ b/skills/security-review/SKILL.md @@ -22,13 +22,13 @@ This skill ensures all code follows security best practices and identifies poten ### 1. Secrets Management -#### ❌ NEVER Do This +#### FAIL: NEVER Do This ```typescript const apiKey = "sk-proj-xxxxx" // Hardcoded secret const dbPassword = "password123" // In source code ``` -#### ✅ ALWAYS Do This +#### PASS: ALWAYS Do This ```typescript const apiKey = process.env.OPENAI_API_KEY const dbUrl = process.env.DATABASE_URL @@ -108,14 +108,14 @@ function validateFileUpload(file: File) { ### 3. SQL Injection Prevention -#### ❌ NEVER Concatenate SQL +#### FAIL: NEVER Concatenate SQL ```typescript // DANGEROUS - SQL Injection vulnerability const query = `SELECT * FROM users WHERE email = '${userEmail}'` await db.query(query) ``` -#### ✅ ALWAYS Use Parameterized Queries +#### PASS: ALWAYS Use Parameterized Queries ```typescript // Safe - parameterized query const { data } = await supabase @@ -140,10 +140,10 @@ await db.query( #### JWT Token Handling ```typescript -// ❌ WRONG: localStorage (vulnerable to XSS) +// FAIL: WRONG: localStorage (vulnerable to XSS) localStorage.setItem('token', token) -// ✅ CORRECT: httpOnly cookies +// PASS: CORRECT: httpOnly cookies res.setHeader('Set-Cookie', `token=${token}; HttpOnly; Secure; SameSite=Strict; Max-Age=3600`) ``` @@ -300,18 +300,18 @@ app.use('/api/search', searchLimiter) #### Logging ```typescript -// ❌ WRONG: Logging sensitive data +// FAIL: WRONG: Logging sensitive data console.log('User login:', { email, password }) console.log('Payment:', { cardNumber, cvv }) -// ✅ CORRECT: Redact sensitive data +// PASS: CORRECT: Redact sensitive data console.log('User login:', { email, userId }) console.log('Payment:', { last4: card.last4, userId }) ``` #### Error Messages ```typescript -// ❌ WRONG: Exposing internal details +// FAIL: WRONG: Exposing internal details catch (error) { return NextResponse.json( { error: error.message, stack: error.stack }, @@ -319,7 +319,7 @@ catch (error) { ) } -// ✅ CORRECT: Generic error messages +// PASS: CORRECT: Generic error messages catch (error) { console.error('Internal error:', error) return NextResponse.json( diff --git a/skills/security-review/cloud-infrastructure-security.md b/skills/security-review/cloud-infrastructure-security.md index 24e9ec20..12634421 100644 --- a/skills/security-review/cloud-infrastructure-security.md +++ b/skills/security-review/cloud-infrastructure-security.md @@ -24,7 +24,7 @@ This skill ensures cloud infrastructure, CI/CD pipelines, and deployment configu #### Principle of Least Privilege ```yaml -# ✅ CORRECT: Minimal permissions +# PASS: CORRECT: Minimal permissions iam_role: permissions: - s3:GetObject # Only read access @@ -32,7 +32,7 @@ iam_role: resources: - arn:aws:s3:::my-bucket/* # Specific bucket only -# ❌ WRONG: Overly broad permissions +# FAIL: WRONG: Overly broad permissions iam_role: permissions: - s3:* # All S3 actions @@ -65,14 +65,14 @@ aws iam enable-mfa-device \ #### Cloud Secrets Managers ```typescript -// ✅ CORRECT: Use cloud secrets manager +// PASS: CORRECT: Use cloud secrets manager import { SecretsManager } from '@aws-sdk/client-secrets-manager'; const client = new SecretsManager({ region: 'us-east-1' }); const secret = await client.getSecretValue({ SecretId: 'prod/api-key' }); const apiKey = JSON.parse(secret.SecretString).key; -// ❌ WRONG: Hardcoded or in environment variables only +// FAIL: WRONG: Hardcoded or in environment variables only const apiKey = process.env.API_KEY; // Not rotated, not audited ``` @@ -99,17 +99,17 @@ aws secretsmanager rotate-secret \ #### VPC and Firewall Configuration ```terraform -# ✅ CORRECT: Restricted security group +# PASS: CORRECT: Restricted security group resource "aws_security_group" "app" { name = "app-sg" - + ingress { from_port = 443 to_port = 443 protocol = "tcp" cidr_blocks = ["10.0.0.0/16"] # Internal VPC only } - + egress { from_port = 443 to_port = 443 @@ -118,7 +118,7 @@ resource "aws_security_group" "app" { } } -# ❌ WRONG: Open to the internet +# FAIL: WRONG: Open to the internet resource "aws_security_group" "bad" { ingress { from_port = 0 @@ -142,7 +142,7 @@ resource "aws_security_group" "bad" { #### CloudWatch/Logging Configuration ```typescript -// ✅ CORRECT: Comprehensive logging +// PASS: CORRECT: Comprehensive logging import { CloudWatchLogsClient, CreateLogStreamCommand } from '@aws-sdk/client-cloudwatch-logs'; const logSecurityEvent = async (event: SecurityEvent) => { @@ -177,7 +177,7 @@ const logSecurityEvent = async (event: SecurityEvent) => { #### Secure Pipeline Configuration ```yaml -# ✅ CORRECT: Secure GitHub Actions workflow +# PASS: CORRECT: Secure GitHub Actions workflow name: Deploy on: @@ -189,18 +189,18 @@ jobs: runs-on: ubuntu-latest permissions: contents: read # Minimal permissions - + steps: - uses: actions/checkout@v4 - + # Scan for secrets - name: Secret scanning uses: trufflesecurity/trufflehog@main - + # Dependency audit - name: Audit dependencies run: npm audit --audit-level=high - + # Use OIDC, not long-lived tokens - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 @@ -237,18 +237,18 @@ jobs: #### Cloudflare Security Configuration ```typescript -// ✅ CORRECT: Cloudflare Workers with security headers +// PASS: CORRECT: Cloudflare Workers with security headers export default { async fetch(request: Request): Promise { const response = await fetch(request); - + // Add security headers const headers = new Headers(response.headers); headers.set('X-Frame-Options', 'DENY'); headers.set('X-Content-Type-Options', 'nosniff'); headers.set('Referrer-Policy', 'strict-origin-when-cross-origin'); headers.set('Permissions-Policy', 'geolocation=(), microphone=()'); - + return new Response(response.body, { status: response.status, headers @@ -281,17 +281,17 @@ export default { #### Automated Backups ```terraform -# ✅ CORRECT: Automated RDS backups +# PASS: CORRECT: Automated RDS backups resource "aws_db_instance" "main" { allocated_storage = 20 engine = "postgres" - + backup_retention_period = 30 # 30 days retention backup_window = "03:00-04:00" maintenance_window = "mon:04:00-mon:05:00" - + enabled_cloudwatch_logs_exports = ["postgresql"] - + deletion_protection = true # Prevent accidental deletion } ``` @@ -327,10 +327,10 @@ Before ANY production cloud deployment: ### S3 Bucket Exposure ```bash -# ❌ WRONG: Public bucket +# FAIL: WRONG: Public bucket aws s3api put-bucket-acl --bucket my-bucket --acl public-read -# ✅ CORRECT: Private bucket with specific access +# PASS: CORRECT: Private bucket with specific access aws s3api put-bucket-acl --bucket my-bucket --acl private aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ``` @@ -338,12 +338,12 @@ aws s3api put-bucket-policy --bucket my-bucket --policy file://policy.json ### RDS Public Access ```terraform -# ❌ WRONG +# FAIL: WRONG resource "aws_db_instance" "bad" { publicly_accessible = true # NEVER do this! } -# ✅ CORRECT +# PASS: CORRECT resource "aws_db_instance" "good" { publicly_accessible = false vpc_security_group_ids = [aws_security_group.db.id] diff --git a/skills/tdd-workflow/SKILL.md b/skills/tdd-workflow/SKILL.md index c8e5d06f..76aaaa1a 100644 --- a/skills/tdd-workflow/SKILL.md +++ b/skills/tdd-workflow/SKILL.md @@ -367,39 +367,39 @@ npm run test:coverage ## Common Testing Mistakes to Avoid -### ❌ WRONG: Testing Implementation Details +### FAIL: WRONG: Testing Implementation Details ```typescript // Don't test internal state expect(component.state.count).toBe(5) ``` -### ✅ CORRECT: Test User-Visible Behavior +### PASS: CORRECT: Test User-Visible Behavior ```typescript // Test what users see expect(screen.getByText('Count: 5')).toBeInTheDocument() ``` -### ❌ WRONG: Brittle Selectors +### FAIL: WRONG: Brittle Selectors ```typescript // Breaks easily await page.click('.css-class-xyz') ``` -### ✅ CORRECT: Semantic Selectors +### PASS: CORRECT: Semantic Selectors ```typescript // Resilient to changes await page.click('button:has-text("Submit")') await page.click('[data-testid="submit-button"]') ``` -### ❌ WRONG: No Test Isolation +### FAIL: WRONG: No Test Isolation ```typescript // Tests depend on each other test('creates user', () => { /* ... */ }) test('updates same user', () => { /* depends on previous test */ }) ``` -### ✅ CORRECT: Independent Tests +### PASS: CORRECT: Independent Tests ```typescript // Each test sets up its own data test('creates user', () => { diff --git a/skills/videodb/reference/rtstream-reference.md b/skills/videodb/reference/rtstream-reference.md index b86c472a..f0d89fdd 100644 --- a/skills/videodb/reference/rtstream-reference.md +++ b/skills/videodb/reference/rtstream-reference.md @@ -273,7 +273,7 @@ Examples: # Audio: every 50 words {"type": "word", "value": 50} -# Audio: every 30 seconds +# Audio: every 30 seconds {"type": "time", "value": 30} # Visual: 5 frames every 2 seconds diff --git a/skills/visa-doc-translate/README.md b/skills/visa-doc-translate/README.md index 4faa35e8..8e06bd24 100644 --- a/skills/visa-doc-translate/README.md +++ b/skills/visa-doc-translate/README.md @@ -4,11 +4,11 @@ Automatically translate visa application documents from images to professional E ## Features -- 🔄 **Automatic OCR**: Tries multiple OCR methods (macOS Vision, EasyOCR, Tesseract) -- 📄 **Bilingual PDF**: Original image + professional English translation -- 🌍 **Multi-language**: Supports Chinese, and other languages -- 📋 **Professional Format**: Suitable for official visa applications -- 🚀 **Fully Automated**: No manual intervention required +- **Automatic OCR**: Tries multiple OCR methods (macOS Vision, EasyOCR, Tesseract) +- **Bilingual PDF**: Original image + professional English translation +- **Multi-language**: Supports Chinese, and other languages +- **Professional Format**: Suitable for official visa applications +- **Fully Automated**: No manual intervention required ## Supported Documents @@ -75,11 +75,11 @@ pip install pytesseract ## Perfect For -- 🇦🇺 Australia visa applications -- 🇺🇸 USA visa applications -- 🇨🇦 Canada visa applications -- 🇬🇧 UK visa applications -- 🇪🇺 EU visa applications +- Australia visa applications +- USA visa applications +- Canada visa applications +- UK visa applications +- EU visa applications ## License diff --git a/tests/ci/validators.test.js b/tests/ci/validators.test.js index aa7ad610..b4dcefc6 100644 --- a/tests/ci/validators.test.js +++ b/tests/ci/validators.test.js @@ -195,7 +195,7 @@ function writeCatalogFixture(testDir, options = {}) { fs.writeFileSync(path.join(testDir, 'commands', 'plan.md'), '---\ndescription: Plan\n---\n# Plan'); fs.writeFileSync(path.join(testDir, 'skills', 'demo-skill', 'SKILL.md'), '---\nname: demo-skill\ndescription: Demo skill\norigin: ECC\n---\n# Demo Skill'); - fs.writeFileSync(readmePath, `Access to ${readmeCounts.agents} agents, ${readmeCounts.skills} skills, and ${readmeCounts.commands} commands.\n| Feature | Claude Code | Cursor IDE | Codex CLI | OpenCode |\n|---------|------------|------------|-----------|----------|\n| Agents | ✅ ${readmeCounts.agents} agents | Shared | Shared | 1 |\n| Commands | ✅ ${readmeCounts.commands} commands | Shared | Shared | 1 |\n| Skills | ✅ ${readmeCounts.skills} skills | Shared | Shared | 1 |\n`); + fs.writeFileSync(readmePath, `Access to ${readmeCounts.agents} agents, ${readmeCounts.skills} skills, and ${readmeCounts.commands} commands.\n| Feature | Claude Code | Cursor IDE | Codex CLI | OpenCode |\n|---------|------------|------------|-----------|----------|\n| Agents | PASS: ${readmeCounts.agents} agents | Shared | Shared | 1 |\n| Commands | PASS: ${readmeCounts.commands} commands | Shared | Shared | 1 |\n| Skills | PASS: ${readmeCounts.skills} skills | Shared | Shared | 1 |\n`); fs.writeFileSync(agentsPath, `This is a **production-ready AI coding plugin** providing ${summaryCounts.agents} specialized agents, ${summaryCounts.skills} skills, ${summaryCounts.commands} commands, and automated hook workflows for software development.\n\n\`\`\`\n${structureLines.join('\n')}\n\`\`\`\n`); return { readmePath, agentsPath }; diff --git a/tests/lib/session-aliases.test.js b/tests/lib/session-aliases.test.js index 66cf63d2..8e4b7226 100644 --- a/tests/lib/session-aliases.test.js +++ b/tests/lib/session-aliases.test.js @@ -48,6 +48,7 @@ function resetAliases() { } function runTests() { + const rocketEmoji = String.fromCodePoint(0x1F680); console.log('\n=== Testing session-aliases.js ===\n'); let passed = 0; @@ -1441,7 +1442,7 @@ function runTests() { 'CJK characters should be rejected'); // Emoji - const emojiResult = aliases.resolveAlias('rocket-🚀'); + const emojiResult = aliases.resolveAlias(`rocket-${rocketEmoji}`); assert.strictEqual(emojiResult, null, 'Emoji should be rejected by the ASCII-only regex'); diff --git a/tests/lib/utils.test.js b/tests/lib/utils.test.js index e4690360..2f7a0300 100644 --- a/tests/lib/utils.test.js +++ b/tests/lib/utils.test.js @@ -27,6 +27,8 @@ function test(name, fn) { // Test suite function runTests() { + const rocketParty = String.fromCodePoint(0x1F680, 0x1F389); + const partyEmoji = String.fromCodePoint(0x1F389); console.log('\n=== Testing utils.js ===\n'); let passed = 0; @@ -166,7 +168,7 @@ function runTests() { if (test('sanitizeSessionId returns stable hashes for non-ASCII values', () => { const chinese = utils.sanitizeSessionId('我的项目'); const cyrillic = utils.sanitizeSessionId('проект'); - const emoji = utils.sanitizeSessionId('🚀🎉'); + const emoji = utils.sanitizeSessionId(rocketParty); assert.ok(/^[a-f0-9]{8}$/.test(chinese), `Expected 8-char hash, got: ${chinese}`); assert.ok(/^[a-f0-9]{8}$/.test(cyrillic), `Expected 8-char hash, got: ${cyrillic}`); assert.ok(/^[a-f0-9]{8}$/.test(emoji), `Expected 8-char hash, got: ${emoji}`); @@ -707,7 +709,7 @@ function runTests() { if (test('writeFile handles unicode content', () => { const testFile = path.join(utils.getTempDir(), `utils-test-${Date.now()}.txt`); try { - const unicode = '日本語テスト 🚀 émojis'; + const unicode = `日本語テスト ${String.fromCodePoint(0x1F680)} émojis`; utils.writeFile(testFile, unicode); const content = utils.readFile(testFile); assert.strictEqual(content, unicode); @@ -1877,8 +1879,8 @@ function runTests() { const tmpDir = fs.mkdtempSync(path.join(utils.getTempDir(), 'r108-grep-unicode-')); const testFile = path.join(tmpDir, 'test.txt'); try { - fs.writeFileSync(testFile, '🎉 celebration\nnormal line\n🎉 party\n日本語テスト'); - const emojiResults = utils.grepFile(testFile, /🎉/); + fs.writeFileSync(testFile, `${partyEmoji} celebration\nnormal line\n${partyEmoji} party\n日本語テスト`); + const emojiResults = utils.grepFile(testFile, new RegExp(partyEmoji, 'u')); assert.strictEqual(emojiResults.length, 2, 'Should find emoji on 2 lines (lines 1 and 3)'); assert.strictEqual(emojiResults[0].lineNumber, 1); diff --git a/tests/run-all.js b/tests/run-all.js index 697575e0..46a3eb19 100644 --- a/tests/run-all.js +++ b/tests/run-all.js @@ -67,7 +67,7 @@ for (const testFile of testFiles) { const displayPath = testFile.split(path.sep).join('/'); if (!fs.existsSync(testPath)) { - console.log(`⚠ Skipping ${displayPath} (file not found)`); + console.log(`WARNING Skipping ${displayPath} (file not found)`); continue; } diff --git a/tests/scripts/check-unicode-safety.test.js b/tests/scripts/check-unicode-safety.test.js new file mode 100644 index 00000000..d52b7c15 --- /dev/null +++ b/tests/scripts/check-unicode-safety.test.js @@ -0,0 +1,114 @@ +const assert = require('assert'); +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const { spawnSync } = require('child_process'); + +const scriptPath = path.join(__dirname, '..', '..', 'scripts', 'ci', 'check-unicode-safety.js'); + +function test(name, fn) { + try { + fn(); + console.log(`PASS: ${name}`); + return true; + } catch (error) { + console.log(`FAIL: ${name}`); + console.log(` ${error.message}`); + return false; + } +} + +function runCheck(root, args = []) { + return spawnSync('node', [scriptPath, ...args], { + env: { + ...process.env, + ECC_UNICODE_SCAN_ROOT: root, + }, + encoding: 'utf8', + }); +} + +function makeTempRoot(prefix) { + return fs.mkdtempSync(path.join(os.tmpdir(), prefix)); +} + +const warningEmoji = String.fromCodePoint(0x26A0, 0xFE0F); +const toolsEmoji = String.fromCodePoint(0x1F6E0, 0xFE0F); +const zeroWidthSpace = String.fromCodePoint(0x200B); +const rocketEmoji = String.fromCodePoint(0x1F680); + +let passed = 0; +let failed = 0; + +if ( + test('fails on invisible unicode and emoji before cleanup', () => { + const root = makeTempRoot('ecc-unicode-check-'); + fs.mkdirSync(path.join(root, 'docs'), { recursive: true }); + fs.mkdirSync(path.join(root, 'scripts'), { recursive: true }); + fs.writeFileSync(path.join(root, 'docs', 'guide.md'), `> ${warningEmoji} Important launch note\n`); + fs.writeFileSync(path.join(root, 'scripts', 'sample.js'), `const x = "a${zeroWidthSpace}";\n`); + + const result = runCheck(root); + assert.notStrictEqual(result.status, 0, result.stdout + result.stderr); + assert.match(result.stderr, /dangerous-invisible U\+200B/); + assert.match(result.stderr, /emoji U\+26A0/); + }) +) + passed++; +else failed++; + +if ( + test('write mode removes emoji and invisible unicode', () => { + const root = makeTempRoot('ecc-unicode-fix-'); + fs.mkdirSync(path.join(root, 'docs'), { recursive: true }); + fs.writeFileSync(path.join(root, 'docs', 'guide.md'), `> ${warningEmoji} Important launch note\n`); + fs.writeFileSync(path.join(root, 'README.md'), `## ${toolsEmoji} Tools\n`); + fs.writeFileSync(path.join(root, 'note.txt'), `one${zeroWidthSpace}two\n`); + + const writeResult = runCheck(root, ['--write']); + assert.strictEqual(writeResult.status, 0, writeResult.stdout + writeResult.stderr); + + assert.strictEqual(fs.readFileSync(path.join(root, 'docs', 'guide.md'), 'utf8'), '> WARNING: Important launch note\n'); + assert.strictEqual(fs.readFileSync(path.join(root, 'README.md'), 'utf8'), '## Tools\n'); + assert.strictEqual(fs.readFileSync(path.join(root, 'note.txt'), 'utf8'), 'onetwo\n'); + + const cleanResult = runCheck(root); + assert.strictEqual(cleanResult.status, 0, cleanResult.stdout + cleanResult.stderr); + }) +) + passed++; +else failed++; + +if ( + test('write mode does not rewrite executable files', () => { + const root = makeTempRoot('ecc-unicode-code-'); + fs.mkdirSync(path.join(root, 'scripts'), { recursive: true }); + const scriptFile = path.join(root, 'scripts', 'sample.js'); + const original = `const label = "Launch ${rocketEmoji}";\n`; + fs.writeFileSync(scriptFile, original); + + const result = runCheck(root, ['--write']); + assert.notStrictEqual(result.status, 0, result.stdout + result.stderr); + assert.match(result.stderr, /scripts\/sample\.js:1:23 emoji U\+1F680/); + assert.strictEqual(fs.readFileSync(scriptFile, 'utf8'), original); + }) +) + passed++; +else failed++; + +if ( + test('plain symbols like copyright remain allowed', () => { + const root = makeTempRoot('ecc-unicode-symbols-'); + fs.mkdirSync(path.join(root, 'docs'), { recursive: true }); + fs.writeFileSync(path.join(root, 'docs', 'legal.md'), 'Copyright © ECC\nTrademark ® ECC\n'); + + const result = runCheck(root); + assert.strictEqual(result.status, 0, result.stdout + result.stderr); + }) +) + passed++; +else failed++; + +console.log(`\nPassed: ${passed}`); +console.log(`Failed: ${failed}`); +process.exit(failed > 0 ? 1 : 0);