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,86 +1,86 @@
1
- ---
2
- trigger: always_on
3
- ---
4
-
5
- # Code Quality Essentials
6
-
7
- ## Naming Conventions
8
-
9
- - Variables & functions: `camelCase` (getUserData, isValid)
10
- - Components: `PascalCase` (UserProfile, Button)
11
- - Constants: `UPPER_SNAKE_CASE` (MAX_RETRIES, API_URL)
12
- - Be descriptive: `isUserAuthenticated` not `isAuth`
13
-
14
- ## JavaScript Basics
15
-
16
- - Use `const` by default, `let` only when reassigning
17
- - Never use `var`
18
- - Use arrow functions for callbacks
19
- - Remove `console.log` before committing
20
- - Use template literals: \`Hello ${name}\` not "Hello " + name
21
-
22
- ## Functions
23
-
24
- - Keep functions small (under 50 lines)
25
- - Functions should do one thing
26
- - Use descriptive names that explain what they do
27
- - Avoid deeply nested code (max 3 levels)
28
-
29
- ## Code Organization
30
-
31
- - One component per file
32
- - Group related files in folders
33
- - Import order: React, libraries, local files
34
- - Remove unused imports and code
35
-
36
- ## Common Patterns
37
-
38
- ### Good Practices
39
-
40
- ```javascript
41
- // Destructure props
42
- const Button = ({ onClick, label }) => (
43
- <button onClick={onClick}>{label}</button>
44
- );
45
-
46
- // Use early returns
47
- const getStatus = (user) => {
48
- if (!user) return "guest";
49
- if (user.isPremium) return "premium";
50
- return "standard";
51
- };
52
-
53
- // Named functions for handlers
54
- const handleClick = () => {
55
- console.log("clicked");
56
- };
57
- ```
58
-
59
- ### Avoid
60
-
61
- ```javascript
62
- // Don't access props directly
63
- const Button = (props) => (
64
- <button onClick={props.onClick}>{props.label}</button>
65
- );
66
-
67
- // Don't use anonymous functions in JSX
68
- <button onClick={() => handleClick()}>Click</button>;
69
-
70
- // Don't nest too deeply
71
- if (condition1) {
72
- if (condition2) {
73
- if (condition3) {
74
- // too deep!
75
- }
76
- }
77
- }
78
- ```
79
-
80
- ## Quick Checklist
81
-
82
- - [] Descriptive variable name?
83
- - [] Functions under 50 lines?
84
- - [] No console.log statements?
85
- - [] Imports organized?
86
- - [] Dead code removed?
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # Code Quality Essentials
6
+
7
+ ## Naming Conventions
8
+
9
+ - Variables & functions: `camelCase` (getUserData, isValid)
10
+ - Components: `PascalCase` (UserProfile, Button)
11
+ - Constants: `UPPER_SNAKE_CASE` (MAX_RETRIES, API_URL)
12
+ - Be descriptive: `isUserAuthenticated` not `isAuth`
13
+
14
+ ## JavaScript Basics
15
+
16
+ - Use `const` by default, `let` only when reassigning
17
+ - Never use `var`
18
+ - Use arrow functions for callbacks
19
+ - Remove `console.log` before committing
20
+ - Use template literals: \`Hello ${name}\` not "Hello " + name
21
+
22
+ ## Functions
23
+
24
+ - Keep functions small (under 50 lines)
25
+ - Functions should do one thing
26
+ - Use descriptive names that explain what they do
27
+ - Avoid deeply nested code (max 3 levels)
28
+
29
+ ## Code Organization
30
+
31
+ - One component per file
32
+ - Group related files in folders
33
+ - Import order: React, libraries, local files
34
+ - Remove unused imports and code
35
+
36
+ ## Common Patterns
37
+
38
+ ### Good Practices
39
+
40
+ ```javascript
41
+ // Destructure props
42
+ const Button = ({ onClick, label }) => (
43
+ <button onClick={onClick}>{label}</button>
44
+ );
45
+
46
+ // Use early returns
47
+ const getStatus = (user) => {
48
+ if (!user) return "guest";
49
+ if (user.isPremium) return "premium";
50
+ return "standard";
51
+ };
52
+
53
+ // Named functions for handlers
54
+ const handleClick = () => {
55
+ console.log("clicked");
56
+ };
57
+ ```
58
+
59
+ ### Avoid
60
+
61
+ ```javascript
62
+ // Don't access props directly
63
+ const Button = (props) => (
64
+ <button onClick={props.onClick}>{props.label}</button>
65
+ );
66
+
67
+ // Don't use anonymous functions in JSX
68
+ <button onClick={() => handleClick()}>Click</button>;
69
+
70
+ // Don't nest too deeply
71
+ if (condition1) {
72
+ if (condition2) {
73
+ if (condition3) {
74
+ // too deep!
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ## Quick Checklist
81
+
82
+ - [] Descriptive variable name?
83
+ - [] Functions under 50 lines?
84
+ - [] No console.log statements?
85
+ - [] Imports organized?
86
+ - [] Dead code removed?
@@ -1,164 +1,164 @@
1
- ---
2
- trigger: always_on
3
- ---
4
-
5
- # React Component Basics
6
-
7
- ## Component Structure
8
-
9
- - Use functional components with hooks (not class components)
10
- - Destructure props at function signature
11
- - Keep components under 200 lines
12
- - One component per file
13
-
14
- ## Props
15
-
16
- ````javascript
17
- // Good: Destructure props
18
- const UserCard = ({name, email, onEdit}) => (
19
- <div>
20
- <h2>{name}</h2>
21
- <p>{email}</p>
22
- <button onClick={onEdit}>Edit</button>
23
- </div>
24
- );
25
-
26
- // Bad: Using props object
27
- const UserCard = (props) => (
28
- <div>
29
- <h2>{props.name}</h2>
30
- <p>{props.email}</p>
31
- <button onClick={props.onEdit}>Edit</button>
32
- </div>
33
- );
34
-
35
- ## Hooks Basic
36
-
37
- ### useState
38
- Use for local UI state only (modals, toggles, input values)
39
- ```javascript
40
- const [isOpen, setIsOpen] = useState(false);
41
- const [count, setCount] = useState(0);
42
- ````
43
-
44
- ### useEffect
45
-
46
- Use for side effects (API calls, subscriptions, timers)
47
-
48
- ```javascript
49
- useEffect(() => {
50
- // Do something
51
- fetchData();
52
-
53
- // Cleanup (optional)
54
- return () => cleanup();
55
- }, [dependencies]); // Don't forget dependencies!
56
- ```
57
-
58
- ### useCallback
59
-
60
- Prevent function recreation on every render
61
-
62
- ```javascript
63
- const handleClick = useCallback(() => {
64
- doSomething();
65
- }, [dependencies]);
66
- ```
67
-
68
- ## JSX Best Practices
69
-
70
- - Use semantic HTML (button, nav, header, footer)
71
- - No anonymous functions in JSX: onClick={handleClick} not onClick={() => handleClick()}
72
- - Keys must be from data, not array index: key={item.id} not key={index}
73
- - Use fragments <></> instead of unnecessary divs
74
- - Conditional rendering: use boolean values only
75
-
76
- ## Common Patterns
77
-
78
- ### Event Handlers
79
-
80
- ```javascript
81
- // Good: Named function
82
- const handleSubmit = (e) => {
83
- e.preventDefault();
84
- submitForm();
85
- };
86
-
87
- <form onSubmit={handleSubmit}>
88
-
89
- // Bad: Anonymous function
90
- <form onSubmit={(e) => {
91
- e.preventDefault();
92
- submitForm();
93
- }}>
94
- ```
95
-
96
- ### Conditional Rendering
97
-
98
- ```javascript
99
- // Good: Boolean condition
100
- {
101
- isLoggedIn && <Dashboard />;
102
- }
103
-
104
- // Good: Ternary for two states
105
- {
106
- isLoading ? <Spinner /> : <Content />;
107
- }
108
-
109
- // Bad: Can accidentally render "0"
110
- {
111
- count && <Display />;
112
- }
113
- ```
114
-
115
- ### Lists
116
-
117
- ```javascript
118
- // Good: Key from data
119
- {
120
- users.map((user) => <UserCard key={user.id} {...user} />);
121
- }
122
-
123
- // Bad: Index as key
124
- {
125
- users.map((user, index) => <UserCard key={index} {...user} />);
126
- }
127
- ```
128
-
129
- ### Component Organization
130
-
131
- ```javascript
132
- const MyComponent = ({ prop1, prop2 }) => {
133
- // 1. Hooks
134
- const [state, setState] = useState();
135
-
136
- // 2. Event handlers
137
- const handleClick = () => {
138
- // handle click
139
- };
140
-
141
- // 3. Early returns
142
- if (!prop1) return null;
143
-
144
- // 4. Render
145
- return <div>{/* JSX here */}</div>;
146
- };
147
- ```
148
-
149
- ## Avoid
150
-
151
- - Class components (use functional components)
152
- - Direct DOM manipulation (use refs sparingly)
153
- - Inline styles (use CSS/styled-components)
154
- - Prop drilling beyond 3 levels (use context or Redux)
155
- - Components over 200 lines (break them down)
156
-
157
- ## Quick Checklist
158
-
159
- - [] Using functional components?
160
- - [] Props destructured?
161
- - [] Event handlers named?
162
- - [] Keys from data, not index?
163
- - [] Component under 200 lines?
164
- - [] useEffect has dependencies?
1
+ ---
2
+ trigger: always_on
3
+ ---
4
+
5
+ # React Component Basics
6
+
7
+ ## Component Structure
8
+
9
+ - Use functional components with hooks (not class components)
10
+ - Destructure props at function signature
11
+ - Keep components under 200 lines
12
+ - One component per file
13
+
14
+ ## Props
15
+
16
+ ````javascript
17
+ // Good: Destructure props
18
+ const UserCard = ({name, email, onEdit}) => (
19
+ <div>
20
+ <h2>{name}</h2>
21
+ <p>{email}</p>
22
+ <button onClick={onEdit}>Edit</button>
23
+ </div>
24
+ );
25
+
26
+ // Bad: Using props object
27
+ const UserCard = (props) => (
28
+ <div>
29
+ <h2>{props.name}</h2>
30
+ <p>{props.email}</p>
31
+ <button onClick={props.onEdit}>Edit</button>
32
+ </div>
33
+ );
34
+
35
+ ## Hooks Basic
36
+
37
+ ### useState
38
+ Use for local UI state only (modals, toggles, input values)
39
+ ```javascript
40
+ const [isOpen, setIsOpen] = useState(false);
41
+ const [count, setCount] = useState(0);
42
+ ````
43
+
44
+ ### useEffect
45
+
46
+ Use for side effects (API calls, subscriptions, timers)
47
+
48
+ ```javascript
49
+ useEffect(() => {
50
+ // Do something
51
+ fetchData();
52
+
53
+ // Cleanup (optional)
54
+ return () => cleanup();
55
+ }, [dependencies]); // Don't forget dependencies!
56
+ ```
57
+
58
+ ### useCallback
59
+
60
+ Prevent function recreation on every render
61
+
62
+ ```javascript
63
+ const handleClick = useCallback(() => {
64
+ doSomething();
65
+ }, [dependencies]);
66
+ ```
67
+
68
+ ## JSX Best Practices
69
+
70
+ - Use semantic HTML (button, nav, header, footer)
71
+ - No anonymous functions in JSX: onClick={handleClick} not onClick={() => handleClick()}
72
+ - Keys must be from data, not array index: key={item.id} not key={index}
73
+ - Use fragments <></> instead of unnecessary divs
74
+ - Conditional rendering: use boolean values only
75
+
76
+ ## Common Patterns
77
+
78
+ ### Event Handlers
79
+
80
+ ```javascript
81
+ // Good: Named function
82
+ const handleSubmit = (e) => {
83
+ e.preventDefault();
84
+ submitForm();
85
+ };
86
+
87
+ <form onSubmit={handleSubmit}>
88
+
89
+ // Bad: Anonymous function
90
+ <form onSubmit={(e) => {
91
+ e.preventDefault();
92
+ submitForm();
93
+ }}>
94
+ ```
95
+
96
+ ### Conditional Rendering
97
+
98
+ ```javascript
99
+ // Good: Boolean condition
100
+ {
101
+ isLoggedIn && <Dashboard />;
102
+ }
103
+
104
+ // Good: Ternary for two states
105
+ {
106
+ isLoading ? <Spinner /> : <Content />;
107
+ }
108
+
109
+ // Bad: Can accidentally render "0"
110
+ {
111
+ count && <Display />;
112
+ }
113
+ ```
114
+
115
+ ### Lists
116
+
117
+ ```javascript
118
+ // Good: Key from data
119
+ {
120
+ users.map((user) => <UserCard key={user.id} {...user} />);
121
+ }
122
+
123
+ // Bad: Index as key
124
+ {
125
+ users.map((user, index) => <UserCard key={index} {...user} />);
126
+ }
127
+ ```
128
+
129
+ ### Component Organization
130
+
131
+ ```javascript
132
+ const MyComponent = ({ prop1, prop2 }) => {
133
+ // 1. Hooks
134
+ const [state, setState] = useState();
135
+
136
+ // 2. Event handlers
137
+ const handleClick = () => {
138
+ // handle click
139
+ };
140
+
141
+ // 3. Early returns
142
+ if (!prop1) return null;
143
+
144
+ // 4. Render
145
+ return <div>{/* JSX here */}</div>;
146
+ };
147
+ ```
148
+
149
+ ## Avoid
150
+
151
+ - Class components (use functional components)
152
+ - Direct DOM manipulation (use refs sparingly)
153
+ - Inline styles (use CSS/styled-components)
154
+ - Prop drilling beyond 3 levels (use context or Redux)
155
+ - Components over 200 lines (break them down)
156
+
157
+ ## Quick Checklist
158
+
159
+ - [] Using functional components?
160
+ - [] Props destructured?
161
+ - [] Event handlers named?
162
+ - [] Keys from data, not index?
163
+ - [] Component under 200 lines?
164
+ - [] useEffect has dependencies?
@@ -1,34 +1,34 @@
1
- # Antigravity - Minimal Profile
2
-
3
- Essential rules for Antigravity AI agent in modular format.
4
-
5
- ## What's Included
6
-
7
- 3 focused rule files:
8
-
9
- - `accessibility.md` - Basic a11y requirements
10
- - `code-quality.md` - Essential patterns
11
- - `react-components.md` - Component basics
12
-
13
- ## Installation
14
-
15
- ```bash
16
- npx codingwithagent init
17
- # Select tool: 3. Antigravity
18
- # Select profile: 1. Minimal
19
- ```
20
-
21
- ## Files created
22
-
23
- ```
24
- .agent/rules/
25
- ├── accessibility.md
26
- ├── code-quality.md
27
- └── react-components.md
28
- ```
29
-
30
- ## Best for
31
-
32
- - Getting started with Antigravity
33
- - Small projects
34
- - Learning the basics
1
+ # Antigravity - Minimal Profile
2
+
3
+ Essential rules for Antigravity AI agent in modular format.
4
+
5
+ ## What's Included
6
+
7
+ 3 focused rule files:
8
+
9
+ - `accessibility.md` - Basic a11y requirements
10
+ - `code-quality.md` - Essential patterns
11
+ - `react-components.md` - Component basics
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ npx codingwithagent init
17
+ # Select tool: 3. Antigravity
18
+ # Select profile: 1. Minimal
19
+ ```
20
+
21
+ ## Files created
22
+
23
+ ```
24
+ .agent/rules/
25
+ ├── accessibility.md
26
+ ├── code-quality.md
27
+ └── react-components.md
28
+ ```
29
+
30
+ ## Best for
31
+
32
+ - Getting started with Antigravity
33
+ - Small projects
34
+ - Learning the basics