.cursor/docs/guides/verification.md
This document outlines the process that Cursor should follow when verifying changes to the Appsmith codebase.
When fixing a bug, follow these steps:
Reproduce the issue
Write test(s) for the bug
Implement the fix
Verify the fix
Quality checks
yarn run check-typesyarn run lint?.) or lodash/get for deep property accessobj.prop1.prop2.prop3)Performance verification
CI/CD verification
When implementing a new feature, follow these steps:
Understand requirements
Design test approach
Implement test cases
Implement the feature
Verify against acceptance criteria
Quality checks
Performance testing
CI/CD verification
For each code change, Cursor should:
Before considering a change complete, verify:
When working with React and Redux code, follow these guidelines:
// Unsafe
const value = state.entities.users[userId].profile.preferences;
// Safe - using optional chaining
const value = state.entities?.users?.[userId]?.profile?.preferences;
// Safe - using lodash/get with default value
const value = get(state, `entities.users.${userId}.profile.preferences`, defaultValue);
// Define selector
const getUserPreferences = (state, userId) =>
get(state, ['entities', 'users', userId, 'profile', 'preferences'], {});
// Use selector
const preferences = useSelector(state => getUserPreferences(state, userId));
<ErrorBoundary fallback={<FallbackComponent />}>
<ComponentWithComplexDataAccess />
</ErrorBoundary>
const isValidUserData = (userData) =>
userData &&
typeof userData === 'object' &&
userData.profile !== undefined;
// Use validation before accessing
if (isValidUserData(userData)) {
// Now safe to use userData.profile
}
Following these guidelines will help prevent common issues like: