From coding-guidelines
Minimizes reliance on full component mount tests by extracting testable logic and mocking child components when rendering is necessary. Use when writing tests for frontend components. Do not use to prohibit all rendering tests — snapshot or integration tests for critical UI flows are still acceptable with justification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/coding-guidelines:avoid-component-rendering-testsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Treat component rendering tests (using `mount`, `render`, `shallowMount`) as **Integration Tests**. They are costly and flaky. Avoid them by extracting business logic into pure functions or hooks. If you must test rendering, **mock** child components to isolation.
Treat component rendering tests (using mount, render, shallowMount) as Integration Tests. They are costly and flaky. Avoid them by extracting business logic into pure functions or hooks. If you must test rendering, mock child components to isolation.
// Flaky: Depends on the child 'UserCard' implementation
test('displays user name', () => {
const wrapper = mount(UserList, { props: { users: [{ name: 'Alice' }] } })
// If UserCard changes from h2 to div, this breaks
expect(wrapper.find('h2').text()).toBe('Alice')
})
// Unit Test the Logic (Composable) - No DOM needed
test('useUserList', () => {
const { users } = useUserList()
users.value = [{ name: 'Alice' }]
expect(users.value[0].name).toBe('Alice')
})
// Testing the Parent-Child contract
test('passes user to UserCard', () => {
// Child is mocked, so we don't care how it renders
const wrapper = mount(UserList, {
global: { stubs: { UserCard: true } }
})
const userCard = wrapper.findComponent({ name: 'UserCard' })
expect(userCard.props('user').name).toBe('Alice')
})
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mew-ton/coding-guidelines --plugin coding-guidelines