@ainative/cody-cli 0.2.7 → 0.2.8

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 (40) hide show
  1. package/.ainative/AINATIVE.md +164 -0
  2. package/.ainative/CRITICAL_FILE_PLACEMENT_RULES.md +139 -0
  3. package/.ainative/README.md +163 -0
  4. package/.ainative/SDK_PUBLISHING_GUIDELINES.md +262 -0
  5. package/.ainative/git-rules.md +150 -0
  6. package/.ainative/settings.json +116 -0
  7. package/.ainative/skills/ci-cd-compliance/SKILL.md +33 -0
  8. package/.ainative/skills/code-quality/SKILL.md +35 -0
  9. package/.ainative/skills/file-placement/SKILL.md +59 -0
  10. package/.ainative/skills/git-workflow/SKILL.md +116 -0
  11. package/.ainative/skills/local-environment-check/SKILL.md +78 -0
  12. package/.ainative/skills/mandatory-tdd/SKILL.md +112 -0
  13. package/.ainative/skills/mcp-builder/SKILL.md +150 -0
  14. package/.claude/RAILWAY_DEPLOYMENT_GUIDE.md +118 -0
  15. package/.claude/hooks/README.md +68 -0
  16. package/.claude/hooks/commit-msg +26 -0
  17. package/.claude/hooks/install-hooks.sh +46 -0
  18. package/.claude/hooks/pre-commit +62 -0
  19. package/.claude/mcp.json.example +31 -0
  20. package/.claude/settings.json +24 -0
  21. package/.claude/skills/ci-cd-compliance/SKILL.md +33 -0
  22. package/.claude/skills/code-quality/SKILL.md +35 -0
  23. package/.claude/skills/file-placement/SKILL.md +59 -0
  24. package/.claude/skills/git-workflow/SKILL.md +116 -0
  25. package/.claude/skills/local-environment-check/SKILL.md +78 -0
  26. package/.claude/skills/mandatory-tdd/SKILL.md +112 -0
  27. package/.claude/skills/mcp-builder/SKILL.md +150 -0
  28. package/.cody/CODY.md +17 -0
  29. package/.cody/hooks/commit-msg +7 -0
  30. package/.cody/hooks/pre-commit +8 -0
  31. package/.cody/mcp.json +9 -0
  32. package/.cody/mcp.json.example +9 -0
  33. package/.cody/skills/ci-cd-compliance/SKILL.md +12 -0
  34. package/.cody/skills/code-quality/SKILL.md +10 -0
  35. package/.cody/skills/database-best-practices/SKILL.md +13 -0
  36. package/.cody/skills/delivery-checklist/SKILL.md +13 -0
  37. package/.cody/skills/file-placement/SKILL.md +11 -0
  38. package/.cody/skills/git-workflow/SKILL.md +9 -0
  39. package/.cody/skills/mandatory-tdd/SKILL.md +10 -0
  40. package/package.json +4 -1
@@ -0,0 +1,164 @@
1
+ # Project Context
2
+
3
+ <!-- Replace with your project name and description -->
4
+ **Project**: My Project
5
+ **Compatible With**: Gemini CLI, Claude Code, and other AI coding assistants
6
+
7
+ ---
8
+
9
+ ## Project Overview
10
+
11
+ <!-- Replace with your project description -->
12
+ <!-- Example: This is a Next.js web application for... -->
13
+
14
+ ---
15
+
16
+ ## Repository Paths
17
+
18
+ ### Primary Repository
19
+ <!-- Replace with your repository path -->
20
+ **Path**: `/path/to/your/project`
21
+ **Framework**: <!-- e.g., Next.js 16, FastAPI, etc. -->
22
+ **Status**: Active Development
23
+
24
+ ---
25
+
26
+ ## Tech Stack
27
+
28
+ <!-- Replace with your actual tech stack -->
29
+ - **Framework**: <!-- e.g., Next.js 16 (App Router, TypeScript) -->
30
+ - **Styling**: <!-- e.g., Tailwind CSS + shadcn/ui -->
31
+ - **State Management**: <!-- e.g., React Query -->
32
+ - **Deployment**: <!-- e.g., Railway, Vercel, AWS -->
33
+ - **Package Manager**: <!-- e.g., npm, bun, pnpm -->
34
+
35
+ ---
36
+
37
+ ## Architecture
38
+
39
+ <!-- Replace with your architecture description -->
40
+
41
+ ### Page/Module Structure
42
+ ```
43
+ <!-- Replace with your directory structure -->
44
+ app/
45
+ layout.tsx
46
+ page.tsx
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Services & APIs
52
+
53
+ ### Backend API
54
+ <!-- Replace with your API details -->
55
+ **Base URL**: `https://your-api.example.com`
56
+ **Auth**: <!-- e.g., JWT tokens, API keys -->
57
+
58
+ ---
59
+
60
+ ## Development Workflow
61
+
62
+ ### Local Development
63
+ ```bash
64
+ # Replace with your actual commands
65
+ npm run dev # Start dev server
66
+ npm run lint # Linting
67
+ npm run type-check # Type checking
68
+ npm run build # Build verification
69
+ npm test # Run tests
70
+ ```
71
+
72
+ ### Pre-Commit Checklist
73
+ 1. Lint - must pass
74
+ 2. Type-check - must pass
75
+ 3. Build - must succeed
76
+ 4. Tests - all tests pass
77
+
78
+ ---
79
+
80
+ ## Git Workflow
81
+
82
+ ### Branch Strategy
83
+ - `main` - production branch
84
+ - Feature branches: `feature/[name]`
85
+ - Bug fixes: `fix/[name]`
86
+
87
+ ### Commit Rules (ZERO TOLERANCE)
88
+ **NEVER include in commits, PRs, or GitHub activity:**
89
+ - AI tool attribution of any kind
90
+ - "Generated with", "Co-Authored-By" referencing AI tools
91
+
92
+ See `.ainative/git-rules.md` for complete rules.
93
+
94
+ ---
95
+
96
+ ## AI Agent Configuration
97
+
98
+ ### Claude Code
99
+ - Primary agent configuration: `.claude/CLAUDE.md`
100
+ - Custom rules: `.claude/rules/`
101
+
102
+ ### Gemini CLI (This File)
103
+ - Project context: `.ainative/AINATIVE.md` (this file)
104
+ - Settings: `.ainative/settings.json`
105
+ - Custom rules: `.ainative/rules/`
106
+
107
+ ---
108
+
109
+ ## MCP Servers (Model Context Protocol)
110
+
111
+ <!-- Replace with your MCP server configuration -->
112
+ See `.claude/mcp.json` for MCP configuration.
113
+
114
+ ---
115
+
116
+ ## Key Files Reference
117
+
118
+ ### Configuration
119
+ <!-- Replace with your key config files -->
120
+ - `package.json` - Dependencies
121
+ - `tsconfig.json` - TypeScript configuration
122
+
123
+ ### Documentation
124
+ - `.ainative/AINATIVE.md` - This file
125
+ - `.claude/CLAUDE.md` - Claude Code context
126
+
127
+ ---
128
+
129
+ ## Environment Variables
130
+
131
+ ### Required
132
+ ```bash
133
+ # Replace with your required env vars
134
+ # EXAMPLE:
135
+ # NEXT_PUBLIC_SITE_URL=https://www.example.com
136
+ # NEXT_PUBLIC_API_URL=https://api.example.com
137
+ ```
138
+
139
+ ### Optional
140
+ ```bash
141
+ # Replace with your optional env vars
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Testing
147
+
148
+ ### Testing Philosophy
149
+ - Test-driven development (TDD) preferred
150
+ - BDD-style tests (Given/When/Then)
151
+ - Minimum 80% coverage for new features
152
+
153
+ ---
154
+
155
+ ## Resources
156
+
157
+ ### Documentation
158
+ <!-- Replace with relevant documentation links -->
159
+
160
+ ---
161
+
162
+ <!-- Replace with your team/project info -->
163
+ **Team**: Your Team Name
164
+ **Repository**: your-repo-name
@@ -0,0 +1,139 @@
1
+ # CRITICAL FILE PLACEMENT RULES
2
+
3
+ ## ABSOLUTE PROHIBITIONS - ZERO TOLERANCE
4
+
5
+ ### **YOU MUST READ THIS BEFORE CREATING ANY FILE**
6
+
7
+ ---
8
+
9
+ ## RULE #1: NEVER CREATE .MD FILES IN ROOT DIRECTORIES
10
+
11
+ ### **COMPLETELY FORBIDDEN LOCATIONS:**
12
+
13
+ ```
14
+ <project-root>/*.md (except README.md)
15
+ <project-root>/src/backend/*.md
16
+ ```
17
+
18
+ ### **REQUIRED LOCATIONS:**
19
+
20
+ **ALL backend documentation MUST go in:**
21
+ ```
22
+ <project-root>/docs/{category}/filename.md
23
+ ```
24
+
25
+ **ALL frontend documentation MUST go in:**
26
+ ```
27
+ <project-root>/frontend/docs/{category}/filename.md
28
+ ```
29
+
30
+ ---
31
+
32
+ ## RULE #2: NEVER CREATE .SH SCRIPTS IN BACKEND
33
+
34
+ ### **COMPLETELY FORBIDDEN:**
35
+ ```
36
+ <project-root>/src/backend/*.sh (except start.sh)
37
+ ```
38
+
39
+ ### **REQUIRED LOCATION:**
40
+ ```
41
+ <project-root>/scripts/script_name.sh
42
+ ```
43
+
44
+ ---
45
+
46
+ ## RULE #3: ALWAYS USE CORRECT BASE URL FORMAT
47
+
48
+ ### **INCORRECT BASE URL PATTERNS:**
49
+
50
+ ```bash
51
+ # WRONG: Including /api/v1 in the base URL variable
52
+ BASE_URL="https://your-api.example.com/api/v1"
53
+ ```
54
+
55
+ ### **CORRECT BASE URL PATTERN:**
56
+
57
+ ```bash
58
+ # CORRECT: Base URL is domain only
59
+ BASE_URL="https://your-api.example.com"
60
+
61
+ # Then use with FULL API paths:
62
+ curl "$BASE_URL/api/v1/projects/" # Explicit and clear
63
+ curl "$BASE_URL/health" # Root-level endpoints also clear
64
+ ```
65
+
66
+ ### **WHY THIS MATTERS:**
67
+
68
+ 1. **Clarity**: Full paths are immediately visible in code
69
+ 2. **Consistency**: Same pattern across all documentation
70
+ 3. **Maintainability**: Easy to update if API version changes
71
+ 4. **Developer Experience**: No confusion about URL construction
72
+
73
+ ---
74
+
75
+ ## MANDATORY CATEGORIZATION GUIDE
76
+
77
+ ### Backend Documentation Categories
78
+
79
+ | Filename Pattern | Destination | Examples |
80
+ |-----------------|-------------|----------|
81
+ | `ISSUE_*.md`, `BUG_*.md` | `docs/issues/` | ISSUE_24_SUMMARY.md |
82
+ | `*_TEST*.md`, `QA_*.md` | `docs/testing/` | QA_TEST_REPORT.md |
83
+ | `AGENT_SWARM_*.md`, `WORKFLOW_*.md` | `docs/agent-swarm/` | AGENT_SWARM_WORKFLOW.md |
84
+ | `API_*.md`, `*_ENDPOINTS*.md` | `docs/api/` | API_DOCUMENTATION.md |
85
+ | `*_IMPLEMENTATION*.md`, `*_SUMMARY.md` | `docs/reports/` | FEATURE_IMPLEMENTATION_SUMMARY.md |
86
+ | `DEPLOYMENT_*.md`, `RAILWAY_*.md` | `docs/deployment/` | DEPLOYMENT_CHECKLIST.md |
87
+ | `*_QUICK_*.md`, `*_REFERENCE.md` | `docs/quick-reference/` | QUICK_START_GUIDE.md |
88
+ | `CODING_*.md`, `*_GUIDE.md` | `docs/development-guides/` | CODING_STANDARDS.md |
89
+ | `PRD_*.md`, `BACKLOG*.md`, `*_PLAN.md` | `docs/planning/` | PRD_NEW_FEATURE.md |
90
+
91
+ ---
92
+
93
+ ## ENFORCEMENT CHECKLIST
94
+
95
+ ### **BEFORE creating ANY .md or .sh file, you MUST:**
96
+
97
+ 1. **CHECK:** Am I creating this file in a root directory?
98
+ 2. **STOP:** If yes, determine the correct category
99
+ 3. **CREATE:** In the correct `docs/{category}/` or `scripts/` location
100
+ 4. **VERIFY:** File is NOT in any root directory
101
+
102
+ ---
103
+
104
+ ## YOUR RESPONSIBILITY
105
+
106
+ As an AI assistant, you MUST:
107
+
108
+ - **READ these rules** before creating ANY file
109
+ - **FOLLOW the categorization guide** for every .md file
110
+ - **CREATE files in correct locations** from the start
111
+ - **NEVER create files in root** directories
112
+ - **ASK if unsure** about categorization
113
+
114
+ ---
115
+
116
+ ## VERIFICATION COMMANDS
117
+
118
+ ### After creating documentation, verify:
119
+
120
+ ```bash
121
+ # Check project root (should only show README.md)
122
+ ls <project-root>/*.md
123
+
124
+ # Check backend (should show NO .md files)
125
+ ls <project-root>/src/backend/*.md
126
+
127
+ # Check backend scripts (should only show start.sh)
128
+ ls <project-root>/src/backend/*.sh
129
+ ```
130
+
131
+ ---
132
+
133
+ ## THIS IS NOT A SUGGESTION - IT IS A REQUIREMENT
134
+
135
+ **These rules are MANDATORY and NON-NEGOTIABLE.**
136
+
137
+ **Every violation causes real harm to the project and wastes human time.**
138
+
139
+ **Follow these rules 100% of the time, no exceptions.**
@@ -0,0 +1,163 @@
1
+ # .ainative Directory
2
+
3
+ **Purpose**: Project context and configuration for AI coding assistants
4
+ **Compatible With**: Gemini CLI, Claude Code, Cursor, Windsurf, and other AI tools
5
+
6
+ ---
7
+
8
+ ## Quick Start
9
+
10
+ ### For Gemini CLI Users
11
+
12
+ ```bash
13
+ # Navigate to project
14
+ cd /path/to/your/project
15
+
16
+ # Start Gemini CLI (automatically loads .ainative/settings.json)
17
+ gemini
18
+
19
+ # Verify context loaded
20
+ @memory What is this project?
21
+ ```
22
+
23
+ ### For Claude Code Users
24
+
25
+ ```bash
26
+ # Open project (automatically reads .claude/ and .ainative/)
27
+ claude /path/to/your/project
28
+ ```
29
+
30
+ ### For Other AI Tools
31
+
32
+ 1. Read `AINATIVE.md` for complete project context
33
+ 2. Review `settings.json` for configuration details
34
+ 3. Follow rules in `rules/` directory
35
+
36
+ ---
37
+
38
+ ## Directory Structure
39
+
40
+ ```
41
+ .ainative/
42
+ ├── README.md # This file (quick reference)
43
+ ├── AINATIVE.md # Complete project context
44
+ ├── settings.json # Gemini CLI-compatible settings
45
+ └── rules/
46
+ └── gemini-cli-alignment.md # Alignment with Gemini CLI conventions
47
+ ```
48
+
49
+ ---
50
+
51
+ ## File Descriptions
52
+
53
+ ### AINATIVE.md
54
+ **Primary project context file** containing:
55
+ - Project overview and tech stack
56
+ - Repository paths
57
+ - Architecture and patterns
58
+ - Development workflow
59
+ - Git rules (ZERO TOLERANCE for AI attribution)
60
+ - Environment variables
61
+ - Key file references
62
+
63
+ **When to read**: Always load first for project understanding
64
+
65
+ ### settings.json
66
+ **Gemini CLI configuration** following their schema:
67
+ - Project metadata
68
+ - Path configurations
69
+ - Context file references
70
+ - Model settings
71
+ - Tool permissions
72
+ - Security policies
73
+ - MCP server integrations
74
+ - Development settings
75
+
76
+ **When to read**: For tool configuration and security settings
77
+
78
+ ### rules/gemini-cli-alignment.md
79
+ **Compatibility guide** for Gemini CLI and other AI tools:
80
+ - Dual configuration approach (.ainative + .claude)
81
+ - Configuration hierarchy
82
+ - Tool integration patterns
83
+ - Path references
84
+ - AI coding rules (universal)
85
+ - Usage guidelines for different tools
86
+ - MCP server integration
87
+ - Best practices
88
+
89
+ **When to read**: When using Gemini CLI or ensuring cross-tool compatibility
90
+
91
+ ---
92
+
93
+ ## Important Rules
94
+
95
+ ### ZERO TOLERANCE: AI Attribution
96
+ **NEVER include in commits, PRs, or issues:**
97
+ - No "Claude", "Anthropic", "Gemini", "Google"
98
+ - No "Generated with [AI Tool]"
99
+ - No "Co-Authored-By: [AI Tool]"
100
+ - No AI tool attribution
101
+
102
+ ### Pre-Commit Checklist
103
+ 1. Lint - must pass
104
+ 2. Type-check - must pass
105
+ 3. Build - must succeed
106
+ 4. Tests - must pass
107
+
108
+ ---
109
+
110
+ ## Context Loading Order
111
+
112
+ 1. **Primary**: `.ainative/AINATIVE.md` (project fundamentals)
113
+ 2. **Supplementary**: `.claude/CLAUDE.md` (Claude-specific instructions)
114
+ 3. **Backlogs and Summaries**: as needed
115
+
116
+ ---
117
+
118
+ ## Common Tasks
119
+
120
+ ### Start Development
121
+ ```bash
122
+ npm run dev # Start dev server
123
+ ```
124
+
125
+ ### Verify Code Quality
126
+ ```bash
127
+ npm run lint # ESLint
128
+ npm run type-check # TypeScript
129
+ npm run build # Production build
130
+ npm test # Run tests
131
+ ```
132
+
133
+ ### Check Open Issues
134
+ ```bash
135
+ gh issue list --label "critical"
136
+ gh issue list --label "high-priority"
137
+ ```
138
+
139
+ ---
140
+
141
+ ## MCP Servers Available
142
+
143
+ Configure MCP servers in `settings.json` or `.claude/mcp.json`.
144
+ See `settings.json` for MCP configuration.
145
+
146
+ ---
147
+
148
+ ## Quick Reference
149
+
150
+ | What | Where |
151
+ |------|-------|
152
+ | Project context | `.ainative/AINATIVE.md` |
153
+ | Gemini CLI settings | `.ainative/settings.json` |
154
+ | Alignment rules | `.ainative/rules/gemini-cli-alignment.md` |
155
+ | Claude Code context | `.claude/CLAUDE.md` |
156
+
157
+ ---
158
+
159
+ ## Support
160
+
161
+ ### Documentation
162
+ - Gemini CLI: https://google-gemini.github.io/gemini-cli/
163
+ - Claude Code: https://docs.claude.com/en/docs/claude-code/
@@ -0,0 +1,262 @@
1
+ # SDK Publishing Guidelines
2
+
3
+ **Purpose:** Guidelines for publishing Python and TypeScript SDKs to package registries
4
+
5
+ ---
6
+
7
+ ## CRITICAL RULES BEFORE PUBLISHING
8
+
9
+ ### Pre-Publishing Checklist
10
+
11
+ **NEVER publish without completing ALL of these steps:**
12
+
13
+ - [ ] All tests passing
14
+ - [ ] Code coverage meets minimum requirements
15
+ - [ ] Version number bumped correctly in ALL files
16
+ - [ ] CHANGELOG.md updated with release notes
17
+ - [ ] README.md examples tested and working
18
+ - [ ] No secrets, API keys, or tokens in code
19
+ - [ ] Git repository clean (no uncommitted changes)
20
+ - [ ] Code pushed to GitHub with version tag
21
+ - [ ] Tested in fresh virtual environment
22
+ - [ ] Developer experience validated
23
+
24
+ **Publishing is PERMANENT on PyPI - you cannot delete packages!**
25
+
26
+ ---
27
+
28
+ ## Python SDK Publishing (PyPI)
29
+
30
+ ### Credentials
31
+ **Location:** `~/.pypirc` (local machine)
32
+
33
+ **Format:**
34
+ ```ini
35
+ [distutils]
36
+ index-servers =
37
+ pypi
38
+ testpypi
39
+
40
+ [pypi]
41
+ username = __token__
42
+ password = pypi-[production-token]
43
+
44
+ [testpypi]
45
+ repository = https://test.pypi.org/legacy/
46
+ username = __token__
47
+ password = pypi-[test-token]
48
+ ```
49
+
50
+ **Important:** Credentials are automatically loaded by `twine` from `~/.pypirc`
51
+
52
+ ### Publishing Workflow
53
+
54
+ #### Step 1: Pre-Flight Testing
55
+ ```bash
56
+ cd /path/to/your/python-sdk
57
+
58
+ # Create fresh virtual environment
59
+ python3 -m venv venv
60
+ source venv/bin/activate
61
+
62
+ # Install with dev dependencies
63
+ pip install -e ".[dev]"
64
+
65
+ # Run full test suite
66
+ pytest tests/ -v --cov=your_package --cov-report=term-missing
67
+ ```
68
+
69
+ #### Step 2: Version Verification
70
+ Ensure version is bumped in ALL these files:
71
+ - `setup.py` or `pyproject.toml`: version field
72
+ - `your_package/__init__.py`: `__version__`
73
+ - `CHANGELOG.md`: New entry
74
+
75
+ #### Step 3: Build Distribution Packages
76
+ ```bash
77
+ # Clean previous builds
78
+ rm -rf dist/ build/ *.egg-info
79
+
80
+ # Install build tools
81
+ pip install --upgrade build twine
82
+
83
+ # Build wheel and source distribution
84
+ python -m build
85
+
86
+ # Validate packages
87
+ twine check dist/*
88
+ ```
89
+
90
+ #### Step 4: Test on Test PyPI (RECOMMENDED)
91
+ ```bash
92
+ # Upload to Test PyPI (safe sandbox)
93
+ twine upload --repository testpypi dist/*
94
+
95
+ # Wait 1-2 minutes for indexing, then test installation
96
+ python3 -m venv /tmp/test_pypi_env
97
+ source /tmp/test_pypi_env/bin/activate
98
+ pip install --index-url https://test.pypi.org/simple/ \
99
+ --extra-index-url https://pypi.org/simple/ \
100
+ your-package==1.0.0
101
+ ```
102
+
103
+ #### Step 5: Production PyPI Upload
104
+ ```bash
105
+ # FINAL CHECK: Are you sure?
106
+ # - All tests passing?
107
+ # - Tested on Test PyPI?
108
+ # - Version correct in all files?
109
+ # - CHANGELOG updated?
110
+
111
+ # Upload to Production PyPI (PERMANENT - NO UNDO)
112
+ twine upload dist/*
113
+ ```
114
+
115
+ #### Step 6: Post-Publishing
116
+ ```bash
117
+ # Tag release in Git
118
+ git tag -a v1.0.0 -m "Release v1.0.0"
119
+ git push origin v1.0.0
120
+
121
+ # Create GitHub Release
122
+ gh release create v1.0.0 --title "v1.0.0" --notes "See CHANGELOG.md"
123
+ ```
124
+
125
+ ### Common Issues
126
+
127
+ **Issue:** `twine: command not found`
128
+ **Solution:** `pip install twine`
129
+
130
+ **Issue:** `HTTPError: 403 Forbidden`
131
+ **Solution:** Check credentials in `~/.pypirc` are correct
132
+
133
+ **Issue:** `File already exists`
134
+ **Solution:** Version already published - bump version number
135
+
136
+ **Issue:** Tests failing
137
+ **Solution:** DO NOT PUBLISH - fix tests first!
138
+
139
+ ---
140
+
141
+ ## TypeScript SDK Publishing (NPM)
142
+
143
+ ### Credentials
144
+
145
+ ```bash
146
+ # Method 1: Interactive login
147
+ npm login
148
+
149
+ # Method 2: Use auth token
150
+ npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
151
+
152
+ # Verify authentication
153
+ npm whoami
154
+ ```
155
+
156
+ ### Publishing Workflow
157
+
158
+ #### Step 1: Pre-Flight Testing
159
+ ```bash
160
+ cd /path/to/your/typescript-sdk
161
+
162
+ # Install dependencies
163
+ npm install
164
+
165
+ # Run tests
166
+ npm test
167
+
168
+ # Run linting
169
+ npm run lint
170
+ ```
171
+
172
+ #### Step 2: Build Distribution
173
+ ```bash
174
+ # Clean previous builds
175
+ npm run clean
176
+
177
+ # Build TypeScript
178
+ npm run build
179
+ ```
180
+
181
+ #### Step 3: Version Bump
182
+ ```bash
183
+ # Bump version (updates package.json automatically)
184
+ npm version patch # 1.0.0 -> 1.0.1
185
+ npm version minor # 1.0.0 -> 1.1.0
186
+ npm version major # 1.0.0 -> 2.0.0
187
+ ```
188
+
189
+ #### Step 4: Publish to NPM
190
+ ```bash
191
+ # Dry run first (shows what will be published)
192
+ npm publish --dry-run
193
+
194
+ # Publish to NPM (scoped package requires --access public)
195
+ npm publish --access public
196
+
197
+ # Verify published package
198
+ npm view your-package version
199
+ ```
200
+
201
+ #### Step 5: Post-Publishing
202
+ ```bash
203
+ # Tag and push to Git
204
+ git tag -a v1.0.1 -m "Release v1.0.1"
205
+ git push origin v1.0.1
206
+
207
+ # Test installation
208
+ npm install your-package@1.0.1
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Version Numbering Guidelines
214
+
215
+ Follow **Semantic Versioning (SemVer)**: `MAJOR.MINOR.PATCH`
216
+
217
+ - **MAJOR** (1.0.0 -> 2.0.0): Breaking API changes
218
+ - **MINOR** (1.0.0 -> 1.1.0): New features, backward compatible
219
+ - **PATCH** (1.0.0 -> 1.0.1): Bug fixes, backward compatible
220
+
221
+ ---
222
+
223
+ ## Rollback Strategy
224
+
225
+ ### PyPI (Python)
226
+ **Cannot delete packages from PyPI!**
227
+
228
+ Options:
229
+ 1. **Yank release:** Hides from default searches but keeps downloadable
230
+ - Via PyPI web interface: Manage -> Releases -> Yank
231
+ 2. **Publish hotfix:** Release next patch with fixes immediately
232
+ 3. **Add warning to README:** Document the issue
233
+
234
+ ### NPM (TypeScript)
235
+ **Can unpublish within 72 hours** (discouraged)
236
+
237
+ ```bash
238
+ # Unpublish specific version (within 72 hours)
239
+ npm unpublish your-package@1.0.1
240
+
241
+ # Deprecate version (preferred)
242
+ npm deprecate your-package@1.0.1 "Please upgrade to 1.0.2"
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Security Considerations
248
+
249
+ ### Before Publishing
250
+ - [ ] No hardcoded API keys or secrets
251
+ - [ ] No `.env` files in package
252
+ - [ ] Check `.gitignore` and `.npmignore`
253
+ - [ ] Scan for sensitive data: `git grep -i "api.key\|secret\|password\|token"`
254
+
255
+ ### After Publishing
256
+ - Monitor for security vulnerabilities
257
+ - Set up GitHub Dependabot alerts
258
+ - Regularly update dependencies
259
+
260
+ ---
261
+
262
+ **Remember:** Publishing is PERMANENT. Test thoroughly before publishing!