axiom-coding-agent-setup 1.0.0 → 1.0.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.
package/bin/cli.js CHANGED
@@ -3,8 +3,8 @@
3
3
  /**
4
4
  * AXIOM Coding Agent Setup CLI
5
5
  *
6
- * Downloads AGENTS.md and .axiom/ folder files from the GitHub repository
7
- * into the current project directory.
6
+ * Downloads AGENTS.md and .agents/ folder (core docs, templates, skills)
7
+ * from the GitHub repository into the current project directory.
8
8
  */
9
9
 
10
10
  const https = require('https');
@@ -16,10 +16,20 @@ const REPO_NAME = 'axiom-coding-agent-setup';
16
16
  const BRANCH = 'main';
17
17
 
18
18
  const FILES_TO_DOWNLOAD = [
19
+ // Main instructions
19
20
  'AGENTS.md',
20
- '.axiom/engineering.md',
21
- '.axiom/stack.md',
22
- '.axiom/workflow.md'
21
+ // Core agent documents
22
+ '.agents/engineering.md',
23
+ '.agents/stack.md',
24
+ '.agents/workflow.md',
25
+ // Templates (project-type conventions)
26
+ '.agents/templates/ai-engineering-python.md',
27
+ '.agents/templates/fullstack-ai-nextjs.md',
28
+ // Skills (domain-specific guides)
29
+ '.agents/skills/mcp-builder/SKILL.md',
30
+ '.agents/skills/n8n-patterns/SKILL.md',
31
+ '.agents/skills/ai-integration/SKILL.md',
32
+ '.agents/skills/deployment-patterns/SKILL.md'
23
33
  ];
24
34
 
25
35
  const GITHUB_RAW_URL = `https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${BRANCH}`;
@@ -112,10 +122,12 @@ async function main() {
112
122
 
113
123
  if (successCount > 0) {
114
124
  log('Your project now has AXIOM coding agent instructions:', 'bold');
115
- log(' - AGENTS.md → Main agent instructions', 'cyan');
116
- log(' - .axiom/engineering.md → Engineering principles', 'cyan');
117
- log(' - .axiom/stack.md → Tech stack knowledge', 'cyan');
118
- log(' - .axiom/workflow.md → Workflow guidelines\n', 'cyan');
125
+ log(' - AGENTS.md → Main agent instructions', 'cyan');
126
+ log(' - .agents/engineering.md → Engineering principles', 'cyan');
127
+ log(' - .agents/stack.md → Tech stack knowledge', 'cyan');
128
+ log(' - .agents/workflow.md → Workflow guidelines', 'cyan');
129
+ log(' - .agents/templates/ → Project-type conventions', 'cyan');
130
+ log(' - .agents/skills/ → Domain-specific skills\n', 'cyan');
119
131
  }
120
132
 
121
133
  process.exit(failCount > 0 ? 1 : 0);
@@ -0,0 +1,318 @@
1
+ # npx CLI Package Setup Reference
2
+
3
+ Quick reference for creating and publishing an npx CLI package that downloads files from a GitHub repository.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This pattern creates a CLI tool that can be run via `npx your-package-name` to download specific files from a GitHub repo into the current project directory.
10
+
11
+ **Use case**: Distributing coding agent instructions, project templates, config files, etc.
12
+
13
+ ---
14
+
15
+ ## Step-by-Step Setup
16
+
17
+ ### 1. Create Project Structure
18
+
19
+ ```
20
+ your-project/
21
+ ├── package.json # npm package configuration
22
+ ├── bin/
23
+ │ └── cli.js # CLI entry point (Node.js script)
24
+ └── README.md # Documentation
25
+ ```
26
+
27
+ ### 2. Configure package.json
28
+
29
+ ```json
30
+ {
31
+ "name": "your-package-name",
32
+ "version": "1.0.0",
33
+ "description": "Description of what this CLI does",
34
+ "main": "bin/cli.js",
35
+ "bin": {
36
+ "your-package-name": "bin/cli.js",
37
+ "short-alias": "bin/cli.js"
38
+ },
39
+ "scripts": {
40
+ "test": "echo \"Error: no test specified\" && exit 1"
41
+ },
42
+ "keywords": ["cli", "setup", "scaffold"],
43
+ "author": "your-github-username",
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/username/repo-name.git"
48
+ },
49
+ "engines": {
50
+ "node": ">=14.0.0"
51
+ }
52
+ }
53
+ ```
54
+
55
+ **Key fields:**
56
+ - `name`: Must be unique on npm (check availability first)
57
+ - `bin`: Maps command names to the CLI script
58
+ - `repository`: Links to your GitHub repo
59
+
60
+ ### 3. Create the CLI Script (bin/cli.js)
61
+
62
+ Template for downloading files from GitHub raw content:
63
+
64
+ ```javascript
65
+ #!/usr/bin/env node
66
+
67
+ const https = require('https');
68
+ const fs = require('fs');
69
+ const path = require('path');
70
+
71
+ const REPO_OWNER = 'your-github-username';
72
+ const REPO_NAME = 'your-repo-name';
73
+ const BRANCH = 'main';
74
+
75
+ const FILES_TO_DOWNLOAD = [
76
+ 'file1.md',
77
+ 'folder/file2.md',
78
+ 'folder/file3.md'
79
+ ];
80
+
81
+ const GITHUB_RAW_URL = `https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${BRANCH}`;
82
+
83
+ function downloadFile(filePath) {
84
+ return new Promise((resolve, reject) => {
85
+ const url = `${GITHUB_RAW_URL}/${filePath}`;
86
+ const localPath = path.join(process.cwd(), filePath);
87
+ const dir = path.dirname(localPath);
88
+
89
+ // Create directory if it doesn't exist
90
+ if (!fs.existsSync(dir)) {
91
+ fs.mkdirSync(dir, { recursive: true });
92
+ }
93
+
94
+ const file = fs.createWriteStream(localPath);
95
+
96
+ https.get(url, (response) => {
97
+ if (response.statusCode === 200) {
98
+ response.pipe(file);
99
+ file.on('finish', () => {
100
+ file.close();
101
+ resolve(filePath);
102
+ });
103
+ } else {
104
+ file.close();
105
+ if (fs.existsSync(localPath)) fs.unlinkSync(localPath);
106
+ reject(new Error(`Failed to download ${filePath}: ${response.statusCode}`));
107
+ }
108
+ }).on('error', (err) => {
109
+ if (fs.existsSync(localPath)) fs.unlinkSync(localPath);
110
+ reject(err);
111
+ });
112
+ });
113
+ }
114
+
115
+ async function main() {
116
+ console.log('Starting download...\n');
117
+
118
+ for (const file of FILES_TO_DOWNLOAD) {
119
+ try {
120
+ process.stdout.write(`Downloading ${file}... `);
121
+ await downloadFile(file);
122
+ console.log('✓');
123
+ } catch (error) {
124
+ console.log(`✗ (${error.message})`);
125
+ }
126
+ }
127
+
128
+ console.log('\nDone!');
129
+ }
130
+
131
+ main().catch(console.error);
132
+ ```
133
+
134
+ ### 4. Test Locally
135
+
136
+ Before publishing, test the CLI locally:
137
+
138
+ ```bash
139
+ node bin/cli.js
140
+ ```
141
+
142
+ Or link it locally:
143
+
144
+ ```bash
145
+ npm link
146
+ your-package-name # Test the command
147
+ npm unlink # Remove local link when done
148
+ ```
149
+
150
+ ### 5. Publish to npm
151
+
152
+ #### First-time setup:
153
+
154
+ 1. **Create npm account**: https://www.npmjs.com/signup
155
+
156
+ 2. **Login from terminal**:
157
+ ```bash
158
+ npm login
159
+ ```
160
+
161
+ 3. **Publish**:
162
+ ```bash
163
+ npm publish
164
+ ```
165
+
166
+ #### Check if published successfully:
167
+
168
+ ```bash
169
+ npm view your-package-name
170
+ ```
171
+
172
+ Or visit: `https://www.npmjs.com/package/your-package-name`
173
+
174
+ ---
175
+
176
+ ## Usage After Publishing
177
+
178
+ Anyone can now use your CLI (no installation required):
179
+
180
+ ```bash
181
+ npx your-package-name
182
+ ```
183
+
184
+ Or install globally:
185
+
186
+ ```bash
187
+ npm install -g your-package-name
188
+ your-package-name # Run directly
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Updating Your Package
194
+
195
+ ### Updating Content Files (the downloaded files)
196
+
197
+ Since files are downloaded directly from GitHub:
198
+
199
+ 1. Edit files locally
200
+ 2. Commit and push:
201
+ ```bash
202
+ git add .
203
+ git commit -m "Update instructions"
204
+ git push origin main
205
+ ```
206
+ 3. Done! Changes are live immediately (no npm publish needed)
207
+
208
+ ### Updating the CLI Script Itself
209
+
210
+ If you modify `bin/cli.js` or `package.json`:
211
+
212
+ 1. Update version in `package.json`:
213
+ ```json
214
+ "version": "1.0.1" // Increment version
215
+ ```
216
+
217
+ 2. Commit and push to GitHub:
218
+ ```bash
219
+ git add .
220
+ git commit -m "Fix download logic"
221
+ git push origin main
222
+ ```
223
+
224
+ 3. Republish to npm:
225
+ ```bash
226
+ npm publish
227
+ ```
228
+
229
+ ---
230
+
231
+ ## Version Management
232
+
233
+ npm follows semantic versioning:
234
+
235
+ | Version change | When to use |
236
+ |----------------|-------------|
237
+ | `1.0.0` → `1.0.1` | Bug fixes (patch) |
238
+ | `1.0.0` → `1.1.0` | New features (minor) |
239
+ | `1.0.0` → `2.0.0` | Breaking changes (major) |
240
+
241
+ Update manually in `package.json` before republishing.
242
+
243
+ ---
244
+
245
+ ## Troubleshooting
246
+
247
+ ### 403 Forbidden when publishing
248
+ - Package name might already exist on npm
249
+ - Try a more unique name (e.g., `@username/package-name` for scoped packages)
250
+
251
+ ### 404 when downloading files
252
+ - Check GitHub repo is public
253
+ - Verify `REPO_OWNER` and `REPO_NAME` match your GitHub URL
254
+ - Ensure files exist on the `main` branch
255
+
256
+ ### Command not found after publishing
257
+ - Wait a few minutes for npm registry to propagate
258
+ - Try `npx your-package-name@latest`
259
+
260
+ ### Local changes not reflected
261
+ - Clear npx cache: `npx clear-npx-cache`
262
+ - Or specify version: `npx your-package-name@1.0.1`
263
+
264
+ ---
265
+
266
+ ## Scoped Packages (Optional)
267
+
268
+ If the package name is taken, use your username as a scope:
269
+
270
+ ```json
271
+ {
272
+ "name": "@username/package-name"
273
+ }
274
+ ```
275
+
276
+ Publish with:
277
+ ```bash
278
+ npm publish --access public
279
+ ```
280
+
281
+ Use with:
282
+ ```bash
283
+ npx @username/package-name
284
+ ```
285
+
286
+ ---
287
+
288
+ ## Quick Checklist
289
+
290
+ - [ ] Create `package.json` with `bin` entry
291
+ - [ ] Create `bin/cli.js` with shebang (`#!/usr/bin/env node`)
292
+ - [ ] Set correct `REPO_OWNER`, `REPO_NAME`, and `FILES_TO_DOWNLOAD`
293
+ - [ ] Test locally with `node bin/cli.js`
294
+ - [ ] Create npm account
295
+ - [ ] Run `npm login`
296
+ - [ ] Run `npm publish`
297
+ - [ ] Test with `npx your-package-name`
298
+
299
+ ---
300
+
301
+ ## Example Commands Reference
302
+
303
+ ```bash
304
+ # Setup
305
+ npm login # Login to npm
306
+ npm publish # Publish package
307
+ npm version patch # Bump version (1.0.0 → 1.0.1)
308
+
309
+ # Maintenance
310
+ npm view your-package-name # Check package info
311
+ npm unpublish your-package-name@version # Remove specific version
312
+ npm deprecate your-package-name@version # Deprecate version
313
+
314
+ # Usage
315
+ npx your-package-name # Run via npx
316
+ npx your-package-name@latest # Force latest version
317
+ npx clear-npx-cache # Clear npx cache
318
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axiom-coding-agent-setup",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "CLI tool to download AXIOM coding agent setup files into your project",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
@@ -26,4 +26,4 @@
26
26
  "engines": {
27
27
  "node": ">=14.0.0"
28
28
  }
29
- }
29
+ }
File without changes
File without changes
File without changes