codingwithagent 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +21 -21
  3. package/README.md +131 -37
  4. package/bin/init.js +257 -257
  5. package/package.json +56 -56
  6. package/templates/accessibility/.cursorrules +342 -342
  7. package/templates/accessibility/README.md +47 -47
  8. package/templates/antigravity/accessibility/.agent/rules/accessibility.md +501 -501
  9. package/templates/antigravity/accessibility/.agent/rules/aria-patterns.md +568 -568
  10. package/templates/antigravity/accessibility/.agent/rules/wcag-standard.md +225 -225
  11. package/templates/antigravity/accessibility/README.md +42 -42
  12. package/templates/antigravity/minimal/.agent/rules/accessibility.md +53 -53
  13. package/templates/antigravity/minimal/.agent/rules/code-quality.md +86 -86
  14. package/templates/antigravity/minimal/.agent/rules/react-components.md +164 -164
  15. package/templates/antigravity/minimal/README.md +34 -34
  16. package/templates/antigravity/standard/.agent/rules/accessibility.md +98 -98
  17. package/templates/antigravity/standard/.agent/rules/code-quality.md +166 -166
  18. package/templates/antigravity/standard/.agent/rules/pull-request-review.md +192 -192
  19. package/templates/antigravity/standard/.agent/rules/react-components.md +204 -204
  20. package/templates/antigravity/standard/.agent/rules/testing.md +197 -197
  21. package/templates/antigravity/standard/README.md +39 -39
  22. package/templates/antigravity/strict/.agent/README.md +46 -46
  23. package/templates/antigravity/strict/.agent/rules/accessibility.md +199 -199
  24. package/templates/antigravity/strict/.agent/rules/code-quality.md +268 -268
  25. package/templates/antigravity/strict/.agent/rules/pull-request-review.md +114 -114
  26. package/templates/antigravity/strict/.agent/rules/react-components.md +423 -423
  27. package/templates/antigravity/strict/.agent/rules/security.md +483 -483
  28. package/templates/antigravity/strict/.agent/rules/testing.md +280 -280
  29. package/templates/minimal/.cursorrules +48 -48
  30. package/templates/minimal/README.md +40 -40
  31. package/templates/standard/.cursorrules +184 -184
  32. package/templates/standard/README.md +43 -43
  33. package/templates/strict/.cursorrules +227 -227
  34. package/templates/strict/README.md +47 -47
@@ -1,40 +1,40 @@
1
- # Minimal Profile
2
-
3
- Essential coding standards for getting started with AI agents.
4
-
5
- ## What's Included
6
-
7
- - Basic accessibility requirements
8
- - Naming conventions
9
- - React component basics
10
- - Code quality essentials
11
-
12
- ## Best For
13
-
14
- - Small projects
15
- - Getting started
16
- - Rapid prototyping
17
- - Personal projects
18
-
19
- ## Coverage
20
-
21
- - Keyboard navigation
22
- - Alt text for images
23
- - Semantic HTML
24
- - Basic React patterns
25
-
26
- ## Quick Start
27
-
28
- ```bash
29
- npx codingwithagent init
30
- # Select: 1. Minimal
31
- ```
32
-
33
- ### What you get
34
-
35
- A `.cursorrules` file with the rules focusing on:
36
-
37
- - Clean, readable code
38
- - Basic accessibility compliance
39
- - Modern JavaScript patterns
40
- - Simple React best practices
1
+ # Minimal Profile
2
+
3
+ Essential coding standards for getting started with AI agents.
4
+
5
+ ## What's Included
6
+
7
+ - Basic accessibility requirements
8
+ - Naming conventions
9
+ - React component basics
10
+ - Code quality essentials
11
+
12
+ ## Best For
13
+
14
+ - Small projects
15
+ - Getting started
16
+ - Rapid prototyping
17
+ - Personal projects
18
+
19
+ ## Coverage
20
+
21
+ - Keyboard navigation
22
+ - Alt text for images
23
+ - Semantic HTML
24
+ - Basic React patterns
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ npx codingwithagent init
30
+ # Select: 1. Minimal
31
+ ```
32
+
33
+ ### What you get
34
+
35
+ A `.cursorrules` file with the rules focusing on:
36
+
37
+ - Clean, readable code
38
+ - Basic accessibility compliance
39
+ - Modern JavaScript patterns
40
+ - Simple React best practices
@@ -1,184 +1,184 @@
1
- # Agentic Code Standards - Standard Profile
2
-
3
- # Version: 1.0.0
4
-
5
- # Profile: Recommended baseline for production code ⭐
6
-
7
- ## Core Principles
8
-
9
- - Write accessible, maintainable, and secure code
10
- - Follow WCAG 2.1 Level AA standards
11
- - Use modern JavaScript/TypeScript patterns
12
- - Test thoroughly, document clearly
13
-
14
- ## Accessibility Standards
15
-
16
- ### Keyboard Navigation
17
-
18
- - All interactive elements must be keyboard accessible
19
- - Support Tab, Enter, Space, Escape keys
20
- - Visible focus indicators required
21
- - Never use `tabIndex > 0`
22
-
23
- ### Screen Readers
24
-
25
- - Use semantic HTML (header, nav, main, footer, button)
26
- - Provide meaningful alt text for images
27
- - Use ARIA labels only when semantic HTML isn't enough
28
- - Test with screen readers (NVDA, JAWS, VoiceOver)
29
-
30
- ### Visual Accessibility
31
-
32
- - Minimum contrast ratio: 4.5:1 for normal text, 3:1 for large text
33
- - Never use color alone to convey information
34
- - Support text resize up to 200%
35
- - Interactive elements minimum size: 24x24 pixels
36
-
37
- ### Forms
38
-
39
- - All form fields must have associated labels
40
- - Provide clear error messages
41
- - Indicate required fields
42
- - Support keyboard navigation throughout
43
-
44
- ## React & Components
45
-
46
- ### Component Structure
47
-
48
- - Use functional components with hooks (not class components)
49
- - Destructure props at function signature: `const Component = ({prop1, prop2}) => {}`
50
- - Keep components under 200 lines - refactor if longer
51
- - One component per file (except small helper components)
52
-
53
- ### Props & State
54
-
55
- - Define PropTypes for all components
56
- - Mark required props with `.isRequired`
57
- - Use TypeScript for type safety
58
- - Local state for UI only, Redux/context for shared data
59
- - Avoid prop drilling beyond 3 levels
60
-
61
- ### Hooks Best Practices
62
-
63
- - `useState`: UI-only state (modals, toggles)
64
- - `useEffect`: Side effects, subscriptions, API calls
65
- - Always specify dependencies array
66
- - Return cleanup functions for subscriptions
67
- - `useMemo`: Expensive calculations only
68
- - `useCallback`: Prevent unnecessary re-renders
69
- - `useRef`: DOM access, mutable values that don't trigger re-renders
70
-
71
- ### JSX Standards
72
-
73
- - No anonymous functions in render: `onClick={handleClick}` not `onClick={() => handleClick()}`
74
- - Use fragments `<></>` instead of unnecessary divs
75
- - Keys from data, not array index: `key={item.id}` not `key={index}`
76
- - Conditional rendering with boolean values only
77
- - Extract complex JSX to separate components
78
-
79
- ## Code Quality
80
-
81
- ### JavaScript/TypeScript
82
-
83
- - Use TypeScript for type safety
84
- - Prefer `const` over `let`, never use `var`
85
- - Use arrow functions for callbacks
86
- - Destructure objects and arrays
87
- - Use template literals for string interpolation
88
- - Async/await instead of promise chains
89
-
90
- ### Naming Conventions
91
-
92
- - Variables & functions: `camelCase` (getUserData)
93
- - Components: `PascalCase` (UserProfile)
94
- - Constants: `UPPER_SNAKE_CASE` (MAX_RETRIES)
95
- - Files: `kebab-case` (user-profile.jsx)
96
- - Be descriptive: `isUserAuthenticated` not `isAuth`
97
-
98
- ### Functions
99
-
100
- - Pure functions when possible (no side effects)
101
- - Maximum function length: 50 lines
102
- - Single responsibility principle
103
- - Return early to reduce nesting
104
- - Use meaningful parameter names
105
-
106
- ### Prohibited Patterns
107
-
108
- - No `console.log` in production code
109
- - No `window` object access (use approved utilities)
110
- - No `eslint-disable` without team approval
111
- - No direct DOM manipulation (use React refs if needed)
112
- - No inline styles (use CSS/styled-components)
113
-
114
- ## Testing Standards
115
-
116
- ### Coverage Requirements
117
-
118
- - Aim for 80%+ coverage on new code
119
- - All new features must have tests
120
- - Test user behavior, not implementation
121
- - Use descriptive test names
122
-
123
- ### Testing Best Practices
124
-
125
- - Shallow render preferred (use mount only for hooks)
126
- - Mock external dependencies (APIs, Redux, third-party libs)
127
- - Clean up mocks with `afterEach(() => jest.clearAllMocks())`
128
- - Avoid snapshots (explicit assertions preferred)
129
- - Test accessibility (keyboard nav, ARIA labels)
130
-
131
- ## Security
132
-
133
- ### Data Protection
134
-
135
- - Never commit secrets, API keys, or credentials
136
- - Use environment variables for configuration
137
- - Validate all user inputs
138
- - Sanitize data before rendering
139
- - Follow PII/PCI data handling guidelines
140
-
141
- ### Dependencies
142
-
143
- - Keep dependencies up to date
144
- - Review security advisories regularly
145
- - Audit third-party packages before use
146
- - Minimize dependency count
147
-
148
- ## Performance
149
-
150
- ### Optimization
151
-
152
- - Code splitting for large bundles
153
- - Lazy load routes and components
154
- - Memoize expensive calculations with `useMemo`
155
- - Prevent unnecessary re-renders with `React.memo` and `useCallback`
156
- - Optimize images (WebP, proper sizing)
157
-
158
- ### Best Practices
159
-
160
- - Avoid large component trees
161
- - Debounce expensive operations
162
- - Virtualize long lists
163
- - Monitor bundle size
164
-
165
- ## Pull Request Standards
166
-
167
- ### Before Submitting
168
-
169
- - All tests pass locally
170
- - No linting errors
171
- - Code coverage maintained or increased
172
- - CHANGELOG.md updated
173
- - Self-review completed
174
-
175
- ### PR Description
176
-
177
- - Clear title describing the change
178
- - Reference related issues
179
- - Include screenshots for UI changes
180
- - List testing steps
181
-
182
- ---
183
-
184
- Full documentation: https://github.com/netshdev/codingwithagent
1
+ # CodingWithAgent - Standard Profile
2
+
3
+ # Version: 1.0.0
4
+
5
+ # Profile: Recommended baseline for production code ⭐
6
+
7
+ ## Core Principles
8
+
9
+ - Write accessible, maintainable, and secure code
10
+ - Follow WCAG 2.1 Level AA standards
11
+ - Use modern JavaScript/TypeScript patterns
12
+ - Test thoroughly, document clearly
13
+
14
+ ## Accessibility Standards
15
+
16
+ ### Keyboard Navigation
17
+
18
+ - All interactive elements must be keyboard accessible
19
+ - Support Tab, Enter, Space, Escape keys
20
+ - Visible focus indicators required
21
+ - Never use `tabIndex > 0`
22
+
23
+ ### Screen Readers
24
+
25
+ - Use semantic HTML (header, nav, main, footer, button)
26
+ - Provide meaningful alt text for images
27
+ - Use ARIA labels only when semantic HTML isn't enough
28
+ - Test with screen readers (NVDA, JAWS, VoiceOver)
29
+
30
+ ### Visual Accessibility
31
+
32
+ - Minimum contrast ratio: 4.5:1 for normal text, 3:1 for large text
33
+ - Never use color alone to convey information
34
+ - Support text resize up to 200%
35
+ - Interactive elements minimum size: 24x24 pixels
36
+
37
+ ### Forms
38
+
39
+ - All form fields must have associated labels
40
+ - Provide clear error messages
41
+ - Indicate required fields
42
+ - Support keyboard navigation throughout
43
+
44
+ ## React & Components
45
+
46
+ ### Component Structure
47
+
48
+ - Use functional components with hooks (not class components)
49
+ - Destructure props at function signature: `const Component = ({prop1, prop2}) => {}`
50
+ - Keep components under 200 lines - refactor if longer
51
+ - One component per file (except small helper components)
52
+
53
+ ### Props & State
54
+
55
+ - Define PropTypes for all components
56
+ - Mark required props with `.isRequired`
57
+ - Use TypeScript for type safety
58
+ - Local state for UI only, Redux/context for shared data
59
+ - Avoid prop drilling beyond 3 levels
60
+
61
+ ### Hooks Best Practices
62
+
63
+ - `useState`: UI-only state (modals, toggles)
64
+ - `useEffect`: Side effects, subscriptions, API calls
65
+ - Always specify dependencies array
66
+ - Return cleanup functions for subscriptions
67
+ - `useMemo`: Expensive calculations only
68
+ - `useCallback`: Prevent unnecessary re-renders
69
+ - `useRef`: DOM access, mutable values that don't trigger re-renders
70
+
71
+ ### JSX Standards
72
+
73
+ - No anonymous functions in render: `onClick={handleClick}` not `onClick={() => handleClick()}`
74
+ - Use fragments `<></>` instead of unnecessary divs
75
+ - Keys from data, not array index: `key={item.id}` not `key={index}`
76
+ - Conditional rendering with boolean values only
77
+ - Extract complex JSX to separate components
78
+
79
+ ## Code Quality
80
+
81
+ ### JavaScript/TypeScript
82
+
83
+ - Use TypeScript for type safety
84
+ - Prefer `const` over `let`, never use `var`
85
+ - Use arrow functions for callbacks
86
+ - Destructure objects and arrays
87
+ - Use template literals for string interpolation
88
+ - Async/await instead of promise chains
89
+
90
+ ### Naming Conventions
91
+
92
+ - Variables & functions: `camelCase` (getUserData)
93
+ - Components: `PascalCase` (UserProfile)
94
+ - Constants: `UPPER_SNAKE_CASE` (MAX_RETRIES)
95
+ - Files: `kebab-case` (user-profile.jsx)
96
+ - Be descriptive: `isUserAuthenticated` not `isAuth`
97
+
98
+ ### Functions
99
+
100
+ - Pure functions when possible (no side effects)
101
+ - Maximum function length: 50 lines
102
+ - Single responsibility principle
103
+ - Return early to reduce nesting
104
+ - Use meaningful parameter names
105
+
106
+ ### Prohibited Patterns
107
+
108
+ - No `console.log` in production code
109
+ - No `window` object access (use approved utilities)
110
+ - No `eslint-disable` without team approval
111
+ - No direct DOM manipulation (use React refs if needed)
112
+ - No inline styles (use CSS/styled-components)
113
+
114
+ ## Testing Standards
115
+
116
+ ### Coverage Requirements
117
+
118
+ - Aim for 80%+ coverage on new code
119
+ - All new features must have tests
120
+ - Test user behavior, not implementation
121
+ - Use descriptive test names
122
+
123
+ ### Testing Best Practices
124
+
125
+ - Shallow render preferred (use mount only for hooks)
126
+ - Mock external dependencies (APIs, Redux, third-party libs)
127
+ - Clean up mocks with `afterEach(() => jest.clearAllMocks())`
128
+ - Avoid snapshots (explicit assertions preferred)
129
+ - Test accessibility (keyboard nav, ARIA labels)
130
+
131
+ ## Security
132
+
133
+ ### Data Protection
134
+
135
+ - Never commit secrets, API keys, or credentials
136
+ - Use environment variables for configuration
137
+ - Validate all user inputs
138
+ - Sanitize data before rendering
139
+ - Follow PII/PCI data handling guidelines
140
+
141
+ ### Dependencies
142
+
143
+ - Keep dependencies up to date
144
+ - Review security advisories regularly
145
+ - Audit third-party packages before use
146
+ - Minimize dependency count
147
+
148
+ ## Performance
149
+
150
+ ### Optimization
151
+
152
+ - Code splitting for large bundles
153
+ - Lazy load routes and components
154
+ - Memoize expensive calculations with `useMemo`
155
+ - Prevent unnecessary re-renders with `React.memo` and `useCallback`
156
+ - Optimize images (WebP, proper sizing)
157
+
158
+ ### Best Practices
159
+
160
+ - Avoid large component trees
161
+ - Debounce expensive operations
162
+ - Virtualize long lists
163
+ - Monitor bundle size
164
+
165
+ ## Pull Request Standards
166
+
167
+ ### Before Submitting
168
+
169
+ - All tests pass locally
170
+ - No linting errors
171
+ - Code coverage maintained or increased
172
+ - CHANGELOG.md updated
173
+ - Self-review completed
174
+
175
+ ### PR Description
176
+
177
+ - Clear title describing the change
178
+ - Reference related issues
179
+ - Include screenshots for UI changes
180
+ - List testing steps
181
+
182
+ ---
183
+
184
+ Full documentation: https://github.com/netshdev/codingwithagent
@@ -1,43 +1,43 @@
1
- # Standard Profile ⭐
2
-
3
- Recommended baseline for production applications. Most popular choice.
4
-
5
- ## What's Included
6
-
7
- - WCAG 2.1 Level AA accessibility
8
- - Comprehensive React patterns
9
- - Testing standards (80%+ coverage)
10
- - Security best practices
11
- - Performance guidelines
12
-
13
- ## Best For
14
-
15
- - Production applications
16
- - Team projects
17
- - Client work
18
- - Long-term maintenance
19
-
20
- ## Coverage
21
-
22
- - Full keyboard accessibility
23
- - Screen reader compatibility
24
- - Component best practices
25
- - Testing requirements
26
- - Pull request standards
27
-
28
- ## Quick Start
29
-
30
- ```bash
31
- npx codingwithagent init
32
- # Select: 2. Standard
33
- ```
34
-
35
- ### What you get
36
-
37
- A `.cursorrules` file with the rules focusing on:
38
-
39
- - Accessibility (WCAG 2.1 AA)
40
- - React & TypeScript
41
- - Testing & coverage
42
- - Security & PII
43
- - Code quality & performance
1
+ # Standard Profile ⭐
2
+
3
+ Recommended baseline for production applications. Most popular choice.
4
+
5
+ ## What's Included
6
+
7
+ - WCAG 2.1 Level AA accessibility
8
+ - Comprehensive React patterns
9
+ - Testing standards (80%+ coverage)
10
+ - Security best practices
11
+ - Performance guidelines
12
+
13
+ ## Best For
14
+
15
+ - Production applications
16
+ - Team projects
17
+ - Client work
18
+ - Long-term maintenance
19
+
20
+ ## Coverage
21
+
22
+ - Full keyboard accessibility
23
+ - Screen reader compatibility
24
+ - Component best practices
25
+ - Testing requirements
26
+ - Pull request standards
27
+
28
+ ## Quick Start
29
+
30
+ ```bash
31
+ npx codingwithagent init
32
+ # Select: 2. Standard
33
+ ```
34
+
35
+ ### What you get
36
+
37
+ A `.cursorrules` file with the rules focusing on:
38
+
39
+ - Accessibility (WCAG 2.1 AA)
40
+ - React & TypeScript
41
+ - Testing & coverage
42
+ - Security & PII
43
+ - Code quality & performance