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
package/bin/init.js CHANGED
@@ -1,257 +1,257 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Agentic Code Standards CLI
5
- * Interactive installer for AI coding agent standards
6
- */
7
-
8
- const fs = require('fs');
9
- const path = require('path');
10
- const readline = require('readline');
11
-
12
- const rl = readline.createInterface({
13
- input: process.stdin,
14
- output: process.stdout
15
- });
16
-
17
- // ANSI colors
18
- const colors = {
19
- reset: '\x1b[0m',
20
- bright: '\x1b[1m',
21
- cyan: '\x1b[36m',
22
- green: '\x1b[32m',
23
- yellow: '\x1b[33m',
24
- blue: '\x1b[34m',
25
- red: '\x1b[31m'
26
- };
27
-
28
- function log(message, color = 'reset') {
29
- console.log(`${colors[color]}${message}${colors.reset}`);
30
- }
31
-
32
- function header() {
33
- console.log('');
34
- log('🤖 Agentic Code Standards', 'cyan');
35
- log('━'.repeat(60), 'cyan');
36
- log('Production-ready standards for AI coding agents', 'bright');
37
- console.log('');
38
- }
39
-
40
- function detectAITool() {
41
- const cwd = process.cwd();
42
-
43
- if (fs.existsSync(path.join(cwd, '.cursorrules'))) return 'cursor';
44
- if (fs.existsSync(path.join(cwd, '.windsurfrules'))) return 'windsurf';
45
- if (fs.existsSync(path.join(cwd, '.agent'))) return 'antigravity';
46
- if (fs.existsSync(path.join(cwd, '.github', 'copilot-instructions.md'))) return 'copilot';
47
-
48
- return null;
49
- }
50
-
51
- function question(prompt) {
52
- return new Promise((resolve) => {
53
- rl.question(`${colors.bright}${prompt}${colors.reset} `, resolve);
54
- });
55
- }
56
-
57
- async function selectProfile() {
58
- console.log('');
59
- log('📋 Choose your profile:', 'blue');
60
- console.log('');
61
- log(' 1. Minimal Essential rules only (great for getting started)');
62
- log(' 2. Standard Recommended baseline ⭐ (most popular)');
63
- log(' 3. Strict All rules enforced (maximum code quality)');
64
- log(' 4. Accessibility WCAG 2.1+ focused (a11y priority)');
65
- console.log('');
66
-
67
- const answer = await question('Enter number (1-4) [default: 2]:');
68
- const choice = answer.trim() || '2';
69
-
70
- const profiles = {
71
- '1': 'minimal',
72
- '2': 'standard',
73
- '3': 'strict',
74
- '4': 'accessibility'
75
- };
76
-
77
- return profiles[choice] || 'standard';
78
- }
79
-
80
- async function selectTool() {
81
- const detected = detectAITool();
82
-
83
- if (detected) {
84
- console.log('');
85
- log(`✅ Detected: ${detected.charAt(0).toUpperCase() + detected.slice(1)}`, 'green');
86
- const answer = await question(`Continue with ${detected}? (Y/n):`);
87
- if (!answer.trim() || answer.toLowerCase() === 'y') {
88
- return detected;
89
- }
90
- }
91
-
92
- console.log('');
93
- log('🛠️ Select your AI coding tool:', 'blue');
94
- console.log('');
95
- log(' 1. Cursor (.cursorrules)');
96
- log(' 2. Windsurf (.windsurfrules)');
97
- log(' 3. Antigravity (.agent/rules/)');
98
- log(' 4. GitHub Copilot (.github/copilot-instructions.md)');
99
- log(' 5. Universal Works with most tools ⭐');
100
- console.log('');
101
-
102
- const answer = await question('Enter number (1-5) [default: 5]:');
103
- const choice = answer.trim() || '5';
104
-
105
- const tools = {
106
- '1': 'cursor',
107
- '2': 'windsurf',
108
- '3': 'antigravity',
109
- '4': 'copilot',
110
- '5': 'universal'
111
- };
112
-
113
- return tools[choice] || 'universal';
114
- }
115
-
116
- function copyTemplate(profile, tool) {
117
- const templatesDir = path.join(__dirname, '..', 'templates');
118
- const cwd = process.cwd();
119
-
120
- try {
121
- if (tool === 'antigravity') {
122
- // Copy Antigravity .agent/rules/ structure
123
- const sourceDir = path.join(templatesDir, 'antigravity', profile, '.agent', 'rules');
124
- const targetDir = path.join(cwd, '.agent', 'rules');
125
-
126
- if (!fs.existsSync(targetDir)) {
127
- fs.mkdirSync(targetDir, { recursive: true });
128
- }
129
-
130
- const files = fs.readdirSync(sourceDir);
131
- files.forEach(file => {
132
- fs.copyFileSync(
133
- path.join(sourceDir, file),
134
- path.join(targetDir, file)
135
- );
136
- });
137
-
138
- console.log('');
139
- log(`✨ Created .agent/rules/ with ${profile} profile`, 'green');
140
- log(` Files: ${files.join(', ')}`, 'cyan');
141
-
142
- } else if (tool === 'copilot') {
143
- const sourceFile = path.join(templatesDir, profile, '.cursorrules');
144
- const targetDir = path.join(cwd, '.github');
145
- const targetFile = path.join(targetDir, 'copilot-instructions.md');
146
-
147
- if (!fs.existsSync(targetDir)) {
148
- fs.mkdirSync(targetDir, { recursive: true });
149
- }
150
-
151
- fs.copyFileSync(sourceFile, targetFile);
152
-
153
- console.log('');
154
- log(`✨ Created .github/copilot-instructions.md with ${profile} profile`, 'green');
155
-
156
- } else {
157
- const sourceFile = path.join(templatesDir, profile, '.cursorrules');
158
- let targetFile;
159
-
160
- if (tool === 'windsurf') {
161
- targetFile = path.join(cwd, '.windsurfrules');
162
- } else {
163
- targetFile = path.join(cwd, '.cursorrules');
164
- }
165
-
166
- fs.copyFileSync(sourceFile, targetFile);
167
-
168
- console.log('');
169
- log(`✨ Created ${path.basename(targetFile)} with ${profile} profile`, 'green');
170
- }
171
-
172
- return true;
173
- } catch (error) {
174
- console.log('');
175
- log(`❌ Error: ${error.message}`, 'red');
176
- return false;
177
- }
178
- }
179
-
180
- function showNextSteps(tool, profile) {
181
- console.log('');
182
- log('🎉 Setup complete!', 'green');
183
- console.log('');
184
- log('Next steps:', 'bright');
185
- log(' 1. Review your rules file(s)');
186
- log(' 2. Customize for your project needs');
187
- log(' 3. Start coding with your AI agent!');
188
- console.log('');
189
-
190
- log('📚 Documentation:', 'blue');
191
- log(' https://github.com/netshdev/codingwithagent');
192
- console.log('');
193
-
194
- if (tool === 'antigravity') {
195
- log('💡 Tip: Antigravity auto-loads rules from .agent/rules/', 'yellow');
196
- } else if (tool === 'copilot') {
197
- log('💡 Tip: Copilot reads instructions from .github/copilot-instructions.md', 'yellow');
198
- } else {
199
- log('💡 Tip: Your AI agent will automatically use these rules', 'yellow');
200
- }
201
-
202
- console.log('');
203
- log('⭐ Star us on GitHub if this helped!', 'cyan');
204
- console.log('');
205
- }
206
-
207
- async function main() {
208
- try {
209
- header();
210
-
211
- const profile = await selectProfile();
212
- const tool = await selectTool();
213
-
214
- console.log('');
215
- log('⚙️ Installing...', 'cyan');
216
-
217
- const success = copyTemplate(profile, tool);
218
-
219
- if (success) {
220
- showNextSteps(tool, profile);
221
- }
222
-
223
- rl.close();
224
- process.exit(success ? 0 : 1);
225
-
226
- } catch (error) {
227
- console.log('');
228
- log(`❌ Error: ${error.message}`, 'red');
229
- log('Please report this issue on GitHub', 'yellow');
230
- rl.close();
231
- process.exit(1);
232
- }
233
- }
234
-
235
- // Handle command line args
236
- const args = process.argv.slice(2);
237
-
238
- if (args.length === 0 || args[0] === 'init') {
239
- main();
240
- } else if (args[0] === '--version' || args[0] === '-v') {
241
- const packageJson = require('../package.json');
242
- console.log(packageJson.version);
243
- process.exit(0);
244
- } else if (args[0] === '--help' || args[0] === '-h') {
245
- console.log('');
246
- log('Usage: npx codingwithagent [command]', 'cyan');
247
- console.log('');
248
- log('Commands:');
249
- log(' init Initialize standards (default)');
250
- log(' --version, -v Show version');
251
- log(' --help, -h Show this help');
252
- console.log('');
253
- process.exit(0);
254
- } else {
255
- log('Unknown command. Use --help for usage information.', 'red');
256
- process.exit(1);
257
- }
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * CodingWithAgent CLI
5
+ * Interactive installer for AI coding agent standards
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const readline = require('readline');
11
+
12
+ const rl = readline.createInterface({
13
+ input: process.stdin,
14
+ output: process.stdout
15
+ });
16
+
17
+ // ANSI colors
18
+ const colors = {
19
+ reset: '\x1b[0m',
20
+ bright: '\x1b[1m',
21
+ cyan: '\x1b[36m',
22
+ green: '\x1b[32m',
23
+ yellow: '\x1b[33m',
24
+ blue: '\x1b[34m',
25
+ red: '\x1b[31m'
26
+ };
27
+
28
+ function log(message, color = 'reset') {
29
+ console.log(`${colors[color]}${message}${colors.reset}`);
30
+ }
31
+
32
+ function header() {
33
+ console.log('');
34
+ log('🤖 CodingWithAgent', 'cyan');
35
+ log('━'.repeat(60), 'cyan');
36
+ log('Production-ready standards for AI coding agents', 'bright');
37
+ console.log('');
38
+ }
39
+
40
+ function detectAITool() {
41
+ const cwd = process.cwd();
42
+
43
+ if (fs.existsSync(path.join(cwd, '.cursorrules'))) return 'cursor';
44
+ if (fs.existsSync(path.join(cwd, '.windsurfrules'))) return 'windsurf';
45
+ if (fs.existsSync(path.join(cwd, '.agent'))) return 'antigravity';
46
+ if (fs.existsSync(path.join(cwd, '.github', 'copilot-instructions.md'))) return 'copilot';
47
+
48
+ return null;
49
+ }
50
+
51
+ function question(prompt) {
52
+ return new Promise((resolve) => {
53
+ rl.question(`${colors.bright}${prompt}${colors.reset} `, resolve);
54
+ });
55
+ }
56
+
57
+ async function selectProfile() {
58
+ console.log('');
59
+ log('📋 Choose your profile:', 'blue');
60
+ console.log('');
61
+ log(' 1. Minimal Essential rules only (great for getting started)');
62
+ log(' 2. Standard Recommended baseline ⭐ (most popular)');
63
+ log(' 3. Strict All rules enforced (maximum code quality)');
64
+ log(' 4. Accessibility WCAG 2.1+ focused (a11y priority)');
65
+ console.log('');
66
+
67
+ const answer = await question('Enter number (1-4) [default: 2]:');
68
+ const choice = answer.trim() || '2';
69
+
70
+ const profiles = {
71
+ '1': 'minimal',
72
+ '2': 'standard',
73
+ '3': 'strict',
74
+ '4': 'accessibility'
75
+ };
76
+
77
+ return profiles[choice] || 'standard';
78
+ }
79
+
80
+ async function selectTool() {
81
+ const detected = detectAITool();
82
+
83
+ if (detected) {
84
+ console.log('');
85
+ log(`✅ Detected: ${detected.charAt(0).toUpperCase() + detected.slice(1)}`, 'green');
86
+ const answer = await question(`Continue with ${detected}? (Y/n):`);
87
+ if (!answer.trim() || answer.toLowerCase() === 'y') {
88
+ return detected;
89
+ }
90
+ }
91
+
92
+ console.log('');
93
+ log('🛠️ Select your AI coding tool:', 'blue');
94
+ console.log('');
95
+ log(' 1. Cursor (.cursorrules)');
96
+ log(' 2. Windsurf (.windsurfrules)');
97
+ log(' 3. Antigravity (.agent/rules/)');
98
+ log(' 4. GitHub Copilot (.github/copilot-instructions.md)');
99
+ log(' 5. Universal Works with most tools ⭐');
100
+ console.log('');
101
+
102
+ const answer = await question('Enter number (1-5) [default: 5]:');
103
+ const choice = answer.trim() || '5';
104
+
105
+ const tools = {
106
+ '1': 'cursor',
107
+ '2': 'windsurf',
108
+ '3': 'antigravity',
109
+ '4': 'copilot',
110
+ '5': 'universal'
111
+ };
112
+
113
+ return tools[choice] || 'universal';
114
+ }
115
+
116
+ function copyTemplate(profile, tool) {
117
+ const templatesDir = path.join(__dirname, '..', 'templates');
118
+ const cwd = process.cwd();
119
+
120
+ try {
121
+ if (tool === 'antigravity') {
122
+ // Copy Antigravity .agent/rules/ structure
123
+ const sourceDir = path.join(templatesDir, 'antigravity', profile, '.agent', 'rules');
124
+ const targetDir = path.join(cwd, '.agent', 'rules');
125
+
126
+ if (!fs.existsSync(targetDir)) {
127
+ fs.mkdirSync(targetDir, { recursive: true });
128
+ }
129
+
130
+ const files = fs.readdirSync(sourceDir);
131
+ files.forEach(file => {
132
+ fs.copyFileSync(
133
+ path.join(sourceDir, file),
134
+ path.join(targetDir, file)
135
+ );
136
+ });
137
+
138
+ console.log('');
139
+ log(`✨ Created .agent/rules/ with ${profile} profile`, 'green');
140
+ log(` Files: ${files.join(', ')}`, 'cyan');
141
+
142
+ } else if (tool === 'copilot') {
143
+ const sourceFile = path.join(templatesDir, profile, '.cursorrules');
144
+ const targetDir = path.join(cwd, '.github');
145
+ const targetFile = path.join(targetDir, 'copilot-instructions.md');
146
+
147
+ if (!fs.existsSync(targetDir)) {
148
+ fs.mkdirSync(targetDir, { recursive: true });
149
+ }
150
+
151
+ fs.copyFileSync(sourceFile, targetFile);
152
+
153
+ console.log('');
154
+ log(`✨ Created .github/copilot-instructions.md with ${profile} profile`, 'green');
155
+
156
+ } else {
157
+ const sourceFile = path.join(templatesDir, profile, '.cursorrules');
158
+ let targetFile;
159
+
160
+ if (tool === 'windsurf') {
161
+ targetFile = path.join(cwd, '.windsurfrules');
162
+ } else {
163
+ targetFile = path.join(cwd, '.cursorrules');
164
+ }
165
+
166
+ fs.copyFileSync(sourceFile, targetFile);
167
+
168
+ console.log('');
169
+ log(`✨ Created ${path.basename(targetFile)} with ${profile} profile`, 'green');
170
+ }
171
+
172
+ return true;
173
+ } catch (error) {
174
+ console.log('');
175
+ log(`❌ Error: ${error.message}`, 'red');
176
+ return false;
177
+ }
178
+ }
179
+
180
+ function showNextSteps(tool, profile) {
181
+ console.log('');
182
+ log('🎉 Setup complete!', 'green');
183
+ console.log('');
184
+ log('Next steps:', 'bright');
185
+ log(' 1. Review your rules file(s)');
186
+ log(' 2. Customize for your project needs');
187
+ log(' 3. Start coding with your AI agent!');
188
+ console.log('');
189
+
190
+ log('📚 Documentation:', 'blue');
191
+ log(' https://github.com/netshdev/codingwithagent');
192
+ console.log('');
193
+
194
+ if (tool === 'antigravity') {
195
+ log('💡 Tip: Antigravity auto-loads rules from .agent/rules/', 'yellow');
196
+ } else if (tool === 'copilot') {
197
+ log('💡 Tip: Copilot reads instructions from .github/copilot-instructions.md', 'yellow');
198
+ } else {
199
+ log('💡 Tip: Your AI agent will automatically use these rules', 'yellow');
200
+ }
201
+
202
+ console.log('');
203
+ log('⭐ Star us on GitHub if this helped!', 'cyan');
204
+ console.log('');
205
+ }
206
+
207
+ async function main() {
208
+ try {
209
+ header();
210
+
211
+ const profile = await selectProfile();
212
+ const tool = await selectTool();
213
+
214
+ console.log('');
215
+ log('⚙️ Installing...', 'cyan');
216
+
217
+ const success = copyTemplate(profile, tool);
218
+
219
+ if (success) {
220
+ showNextSteps(tool, profile);
221
+ }
222
+
223
+ rl.close();
224
+ process.exit(success ? 0 : 1);
225
+
226
+ } catch (error) {
227
+ console.log('');
228
+ log(`❌ Error: ${error.message}`, 'red');
229
+ log('Please report this issue on GitHub', 'yellow');
230
+ rl.close();
231
+ process.exit(1);
232
+ }
233
+ }
234
+
235
+ // Handle command line args
236
+ const args = process.argv.slice(2);
237
+
238
+ if (args.length === 0 || args[0] === 'init') {
239
+ main();
240
+ } else if (args[0] === '--version' || args[0] === '-v') {
241
+ const packageJson = require('../package.json');
242
+ console.log(packageJson.version);
243
+ process.exit(0);
244
+ } else if (args[0] === '--help' || args[0] === '-h') {
245
+ console.log('');
246
+ log('Usage: npx codingwithagent [command]', 'cyan');
247
+ console.log('');
248
+ log('Commands:');
249
+ log(' init Initialize standards (default)');
250
+ log(' --version, -v Show version');
251
+ log(' --help, -h Show this help');
252
+ console.log('');
253
+ process.exit(0);
254
+ } else {
255
+ log('Unknown command. Use --help for usage information.', 'red');
256
+ process.exit(1);
257
+ }
package/package.json CHANGED
@@ -1,56 +1,56 @@
1
- {
2
- "name": "codingwithagent",
3
- "version": "1.0.0",
4
- "description": "Production-ready coding standards for AI coding agents. Works with Cursor, Windsurf, Antigravity, and GitHub Copilot.",
5
- "main": "bin/init.js",
6
- "bin": {
7
- "codingwithagent": "./bin/init.js"
8
- },
9
- "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1",
11
- "prepublishOnly": "node -e \"console.log('Publishing codingwithagent...')\"",
12
- "postinstall": "echo 'Run: npx codingwithagent init'"
13
- },
14
- "repository": {
15
- "type": "git",
16
- "url": "git+https://github.com/netshdev/codingwithagent.git"
17
- },
18
- "keywords": [
19
- "ai",
20
- "coding-standards",
21
- "cursor",
22
- "windsurf",
23
- "antigravity",
24
- "copilot",
25
- "accessibility",
26
- "wcag",
27
- "react",
28
- "typescript",
29
- "code-quality",
30
- "best-practices",
31
- "a11y",
32
- "linting",
33
- "development",
34
- "productivity",
35
- "cursorrules",
36
- "windsurfrules"
37
- ],
38
- "author": "Nitish Kafle <kaflenit@gmail.com>",
39
- "license": "MIT",
40
- "bugs": {
41
- "url": "https://github.com/netshdev/codingwithagent/issues"
42
- },
43
- "homepage": "https://github.com/netshdev/codingwithagent#readme",
44
- "engines": {
45
- "node": ">=14.0.0"
46
- },
47
- "files": [
48
- "bin/",
49
- "templates/",
50
- "README.md",
51
- "LICENSE",
52
- "CHANGELOG.md"
53
- ],
54
- "dependencies": {},
55
- "devDependencies": {}
56
- }
1
+ {
2
+ "name": "codingwithagent",
3
+ "version": "1.1.1",
4
+ "description": "Production-ready coding standards for AI coding agents. Works with Cursor, Windsurf, Antigravity, and GitHub Copilot.",
5
+ "main": "bin/init.js",
6
+ "bin": {
7
+ "codingwithagent": "./bin/init.js"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1",
11
+ "prepublishOnly": "node -e \"console.log('Publishing codingwithagent...')\"",
12
+ "postinstall": "echo 'Run: npx codingwithagent init'"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/netshdev/codingwithagent.git"
17
+ },
18
+ "keywords": [
19
+ "ai",
20
+ "coding-standards",
21
+ "cursor",
22
+ "windsurf",
23
+ "antigravity",
24
+ "copilot",
25
+ "accessibility",
26
+ "wcag",
27
+ "react",
28
+ "typescript",
29
+ "code-quality",
30
+ "best-practices",
31
+ "a11y",
32
+ "linting",
33
+ "development",
34
+ "productivity",
35
+ "cursorrules",
36
+ "windsurfrules"
37
+ ],
38
+ "author": "Nitish Kafle <kaflenit@gmail.com>",
39
+ "license": "MIT",
40
+ "bugs": {
41
+ "url": "https://github.com/netshdev/codingwithagent/issues"
42
+ },
43
+ "homepage": "https://github.com/netshdev/codingwithagent#readme",
44
+ "engines": {
45
+ "node": ">=14.0.0"
46
+ },
47
+ "files": [
48
+ "bin/",
49
+ "templates/",
50
+ "README.md",
51
+ "LICENSE",
52
+ "CHANGELOG.md"
53
+ ],
54
+ "dependencies": {},
55
+ "devDependencies": {}
56
+ }