codingwithagent 1.0.0

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 (33) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/bin/init.js +257 -0
  4. package/package.json +56 -0
  5. package/templates/accessibility/.cursorrules +342 -0
  6. package/templates/accessibility/README.md +47 -0
  7. package/templates/antigravity/accessibility/.agent/rules/accessibility.md +501 -0
  8. package/templates/antigravity/accessibility/.agent/rules/aria-patterns.md +568 -0
  9. package/templates/antigravity/accessibility/.agent/rules/wcag-standard.md +225 -0
  10. package/templates/antigravity/accessibility/README.md +42 -0
  11. package/templates/antigravity/minimal/.agent/rules/accessibility.md +53 -0
  12. package/templates/antigravity/minimal/.agent/rules/code-quality.md +86 -0
  13. package/templates/antigravity/minimal/.agent/rules/react-components.md +164 -0
  14. package/templates/antigravity/minimal/README.md +34 -0
  15. package/templates/antigravity/standard/.agent/rules/accessibility.md +98 -0
  16. package/templates/antigravity/standard/.agent/rules/code-quality.md +166 -0
  17. package/templates/antigravity/standard/.agent/rules/pull-request-review.md +192 -0
  18. package/templates/antigravity/standard/.agent/rules/react-components.md +204 -0
  19. package/templates/antigravity/standard/.agent/rules/testing.md +197 -0
  20. package/templates/antigravity/standard/README.md +39 -0
  21. package/templates/antigravity/strict/.agent/README.md +46 -0
  22. package/templates/antigravity/strict/.agent/rules/accessibility.md +199 -0
  23. package/templates/antigravity/strict/.agent/rules/code-quality.md +268 -0
  24. package/templates/antigravity/strict/.agent/rules/pull-request-review.md +114 -0
  25. package/templates/antigravity/strict/.agent/rules/react-components.md +423 -0
  26. package/templates/antigravity/strict/.agent/rules/security.md +483 -0
  27. package/templates/antigravity/strict/.agent/rules/testing.md +280 -0
  28. package/templates/minimal/.cursorrules +48 -0
  29. package/templates/minimal/README.md +40 -0
  30. package/templates/standard/.cursorrules +184 -0
  31. package/templates/standard/README.md +43 -0
  32. package/templates/strict/.cursorrules +227 -0
  33. package/templates/strict/README.md +47 -0
@@ -0,0 +1,227 @@
1
+ # Agentic Code Standards - Strict Profile
2
+
3
+ # Version: 1.0.0
4
+
5
+ # Profile: Maximum code quality - all rules enforced
6
+
7
+ ## Core Principles
8
+
9
+ - Zero tolerance for accessibility violations
10
+ - Strict type safety with TypeScript
11
+ - 100% test coverage for critical paths
12
+ - Security-first development
13
+ - Performance-optimized by default
14
+
15
+ ## Accessibility - WCAG 2.1 Level AA (Strict Enforcement)
16
+
17
+ ### Mandatory Requirements
18
+
19
+ - ALL interactive elements keyboard accessible (no exceptions)
20
+ - ALL images have meaningful alt text (or alt="" if decorative)
21
+ - ALL form fields have associated labels
22
+ - ALL color contrasts meet 4.5:1 ratio (7:1 for AAA when possible)
23
+ - ALL custom components have proper ARIA attributes
24
+ - ALL pages tested with screen readers before PR approval
25
+
26
+ ### Testing Requirements
27
+
28
+ - Automated accessibility tests required (axe-core, jest-axe)
29
+ - Manual keyboard navigation testing mandatory
30
+ - Screen reader testing required for new features
31
+ - Color contrast analyzer must pass all checks
32
+
33
+ ### Prohibited
34
+
35
+ - NEVER use `tabIndex > 0`
36
+ - NEVER use color alone to convey information
37
+ - NEVER use `role="presentation"` on interactive elements
38
+ - NEVER skip heading levels (h1 → h3)
39
+ - NEVER use `aria-label` when semantic HTML suffices
40
+
41
+ ## React & Components (Strict)
42
+
43
+ ### Component Requirements
44
+
45
+ - TypeScript REQUIRED for all components
46
+ - PropTypes AND TypeScript interfaces required
47
+ - All props must be typed (no `any` type)
48
+ - All components under 150 lines (no exceptions)
49
+ - JSDoc comments for all exported components
50
+ - Performance budget: <100ms render time
51
+
52
+ ### Hooks - Strict Rules
53
+
54
+ - `useEffect` dependencies MUST be complete (exhaustive-deps enforced)
55
+ - Custom hooks MUST start with "use" prefix
56
+ - No hooks in loops, conditions, or nested functions
57
+ - Cleanup functions REQUIRED for all subscriptions
58
+ - `useCallback` required for all callback props
59
+ - `useMemo` required for objects/arrays passed as props
60
+
61
+ ### JSX - Zero Tolerance
62
+
63
+ - NO anonymous functions in JSX (all must be declared)
64
+ - NO inline styles (styled-components or CSS modules only)
65
+ - NO array index as key (data-based keys only)
66
+ - NO non-boolean conditional rendering
67
+ - NO nested ternaries (extract to variables or functions)
68
+
69
+ ## Code Quality (Maximum Enforcement)
70
+
71
+ ### TypeScript
72
+
73
+ - Strict mode enabled in tsconfig.json
74
+ - NO `any` type (use `unknown` if needed)
75
+ - NO `@ts-ignore` without PR approval
76
+ - NO implicit returns
77
+ - ALL functions have explicit return types
78
+
79
+ ### Code Metrics
80
+
81
+ - Maximum function length: 40 lines
82
+ - Maximum file length: 300 lines
83
+ - Maximum cyclomatic complexity: 10
84
+ - Maximum function parameters: 4
85
+ - Minimum test coverage: 90%
86
+
87
+ ### Naming (Strict)
88
+
89
+ - Variables: `camelCase`, descriptive (min 3 chars, max 30 chars)
90
+ - Functions: `camelCase`, verb-based (`getUserData`, not `data`)
91
+ - Components: `PascalCase`, noun-based (`UserProfile`, not `Profile`)
92
+ - Constants: `UPPER_SNAKE_CASE`
93
+ - Boolean variables: `is`, `has`, `should` prefix (`isLoading`, `hasError`)
94
+ - Event handlers: `handle` prefix (`handleClick`, not `onClick`)
95
+
96
+ ### Prohibited Patterns (Zero Tolerance)
97
+
98
+ - NO `console.log`, `console.warn`, `console.error` (use logging utility)
99
+ - NO `debugger` statements
100
+ - NO `var` declarations
101
+ - NO `==` or `!=` (use `===` and `!==`)
102
+ - NO `eval()` or `Function()` constructor
103
+ - NO `with` statements
104
+ - NO `for...in` loops (use `Object.keys()`, `Object.entries()`)
105
+ - NO mutations of props or state
106
+ - NO `window` or `document` access (use approved utilities)
107
+ - NO `Date()` constructor (use moment or date-fns)
108
+
109
+ ## Testing (Strict Requirements)
110
+
111
+ ### Coverage Requirements
112
+
113
+ - Overall coverage: 90% minimum
114
+ - Statement coverage: 90%
115
+ - Branch coverage: 85%
116
+ - Function coverage: 90%
117
+ - Line coverage: 90%
118
+
119
+ ### Testing Standards
120
+
121
+ - ALL new features MUST have tests before PR approval
122
+ - ALL bug fixes MUST have regression tests
123
+ - ALL components MUST have unit tests
124
+ - ALL custom hooks MUST be tested with React Testing Library
125
+ - ALL user interactions MUST be tested
126
+ - ALL error states MUST be tested
127
+ - ALL accessibility features MUST be tested
128
+
129
+ ### Test Quality
130
+
131
+ - NO snapshot tests (explicit assertions only)
132
+ - NO `test.skip` or `test.only` in committed code
133
+ - NO flaky tests (must pass 100% of the time)
134
+ - Test names MUST be descriptive: "should disable submit button when form is invalid"
135
+ - Mock all external dependencies
136
+ - All mocks MUST be cleaned up with `afterEach`
137
+
138
+ ## Security (Maximum)
139
+
140
+ ### Mandatory Security Practices
141
+
142
+ - ALL user inputs MUST be validated
143
+ - ALL data MUST be sanitized before rendering
144
+ - ALL API responses MUST be validated with schemas
145
+ - ALL environment variables MUST be documented
146
+ - ALL dependencies MUST pass security audit
147
+ - ALL third-party scripts MUST be reviewed
148
+
149
+ ### Prohibited Security Risks
150
+
151
+ - NO `dangerouslySetInnerHTML` without sanitization
152
+ - NO `eval()` or dynamic code execution
153
+ - NO inline event handlers in HTML
154
+ - NO unvalidated redirects
155
+ - NO sensitive data in localStorage (use secure alternatives)
156
+ - NO API keys in code (environment variables only)
157
+
158
+ ### Data Protection
159
+
160
+ - PII data MUST be masked in logs
161
+ - Credit cards MUST show only last 4 digits
162
+ - Passwords MUST never be logged or stored in plain text
163
+ - Session tokens MUST use httpOnly cookies
164
+
165
+ ## Performance (Strict Optimization)
166
+
167
+ ### Performance Budgets
168
+
169
+ - Initial bundle size: <200KB gzipped
170
+ - Time to Interactive: <3s on 3G
171
+ - Lighthouse performance score: >90
172
+ - Largest Contentful Paint: <2.5s
173
+ - First Input Delay: <100ms
174
+
175
+ ### Optimization Requirements
176
+
177
+ - Code splitting REQUIRED for routes
178
+ - Lazy loading REQUIRED for images and heavy components
179
+ - Tree shaking REQUIRED (no unused exports)
180
+ - Bundle analysis REQUIRED before each release
181
+ - Image optimization REQUIRED (WebP, proper sizing, lazy loading)
182
+ - List virtualization REQUIRED for >50 items
183
+
184
+ ## Pull Request (Strict Process)
185
+
186
+ ### Pre-PR Requirements
187
+
188
+ - ALL tests pass (no exceptions)
189
+ - NO linting errors or warnings
190
+ - Coverage increased or maintained at 90%+
191
+ - Bundle size within budget
192
+ - Performance tests pass
193
+ - Security scan passes
194
+ - Accessibility audit passes
195
+ - Self-review completed with checklist
196
+
197
+ ### PR Content
198
+
199
+ - Detailed description with screenshots/videos
200
+ - Before/after comparisons for UI changes
201
+ - Testing instructions included
202
+ - Performance impact documented
203
+ - Security considerations noted
204
+ - Breaking changes clearly marked
205
+
206
+ ### Review Requirements
207
+
208
+ - Minimum 2 approvals required
209
+ - Architecture review for >500 lines changed
210
+ - Security review for auth/payment changes
211
+ - Accessibility review for UI changes
212
+ - Performance review for optimization PRs
213
+
214
+ ## Documentation
215
+
216
+ ### Required Documentation
217
+
218
+ - JSDoc for all exported functions and components
219
+ - README updates for new features
220
+ - CHANGELOG entry for all changes
221
+ - Migration guide for breaking changes
222
+ - Architecture decision records for major changes
223
+
224
+ ---
225
+
226
+ This is the strictest profile. Only use if your team is committed to maximum quality.
227
+ Full documentation: https://github.com/netshdev/codingwithagent
@@ -0,0 +1,47 @@
1
+ # Strict Profile
2
+
3
+ Maximum code quality enforcement. All rules strictly applied.
4
+
5
+ ## What's Included
6
+
7
+ - WCAG 2.1 AAA accessibility (when possible)
8
+ - TypeScript mandatory (no `any` type)
9
+ - 90% test coverage minimum
10
+ - Zero security vulnerabilities
11
+ - Maximum component size: 150 lines
12
+
13
+ ## Best For
14
+
15
+ - Enterprise applications
16
+ - High-security projects
17
+ - Mission-critical systems
18
+ - Teams committed to excellence
19
+
20
+ ## Coverage
21
+
22
+ - 100% accessibility compliance
23
+ - Strict TypeScript enforcement
24
+ - Mandatory code reviews (2+ approvals)
25
+ - Security-first development
26
+ - Performance budgets enforced
27
+
28
+ ## Quick Start
29
+
30
+ ```bash
31
+ npx codingwithagent init
32
+ # Select: 3. Strict
33
+ ```
34
+
35
+ ### What you get
36
+
37
+ A `.cursorrules` file with strict enforcement of:
38
+
39
+ - Zero tolerance for violations
40
+ - Automated PR rejection for issues
41
+ - Lighthouse accessibility: 100
42
+ - Performance score: >90
43
+ - Security vulnerabilities: 0
44
+
45
+ ## Warning
46
+
47
+ Only use if your team is committed to maximum quality standards.