meow-swarm 0.2.0 → 0.3.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 (51) hide show
  1. package/.context/ANTI_PATTERNS.md +56 -0
  2. package/.context/ARCHITECTURE.md +29 -0
  3. package/.context/ECOSYSTEM.md +12 -0
  4. package/.context/MISSION.md +13 -0
  5. package/.context/QA_REVIEW.md +200 -0
  6. package/.husky/pre-commit +2 -0
  7. package/.husky/pre-push +2 -0
  8. package/CHANGELOG.md +25 -0
  9. package/CONTRIBUTING.md +55 -0
  10. package/PUBLISH.md +268 -0
  11. package/REPORTS/QUANTUM_AUDIT.md +40 -0
  12. package/REPORTS/SELF_REVIEW.md +50 -0
  13. package/SECURITY.md +16 -0
  14. package/bun.lock +613 -0
  15. package/bunfig.toml +11 -0
  16. package/dist/bin/meow-eval.js +625 -0
  17. package/dist/bin/meow-mcp.js +25963 -0
  18. package/dist/bin/meow-skills.js +297 -0
  19. package/dist/bin/meow.js +28813 -0
  20. package/docs/ARCHITECTURAL_GAP_ANALYSIS.md +400 -0
  21. package/docs/GAP_ANALYSIS.md +257 -0
  22. package/docs/TOKEN_OPTIMIZATION_STRATEGY.md +93 -0
  23. package/docs/TUI_SPEC.md +211 -0
  24. package/docs/assets/image.png +0 -0
  25. package/docs/assets/repo_map.md +181 -0
  26. package/docs/gap-analysis-vs-kitchen-factory/QUALITY_FIRST_ARCHITECTURE.md +368 -0
  27. package/docs/processed/END_TO_END_TESTING.md +76 -0
  28. package/docs/processed/ENVIRONMENT_AWARENESS.md +45 -0
  29. package/docs/processed/LAYERED_AGENCY_UPGRADE.md +70 -0
  30. package/docs/processed/PRODUCTION_READINESS.md +165 -0
  31. package/evals/missions.jsonl +5 -0
  32. package/memory/MEMORY.md +5 -0
  33. package/memory/karpathy-guidelines.md +59 -0
  34. package/meow-agent-0.1.0.tgz +0 -0
  35. package/meow.db +0 -0
  36. package/package.json +7 -4
  37. package/skills/computer-use/SKILL.md +222 -0
  38. package/skills/computer-use/scripts/computer_tool.py +746 -0
  39. package/skills/find-skills/SKILL.md +170 -0
  40. package/skills/game-vision/SKILL.md +109 -0
  41. package/skills/game-vision/game_vision.py +246 -0
  42. package/skills/karpathy_guidelines/SKILL.md +70 -0
  43. package/skills/mano-p/SKILL.md +118 -0
  44. package/skills/meow/SKILL.md +388 -0
  45. package/skills/meow/meow.py +539 -0
  46. package/skills/play-game/SKILL.md +290 -0
  47. package/skills/play-game/game_agent.py +469 -0
  48. package/skills/setup/SKILL.md +47 -0
  49. package/skills/token-max/SKILL.md +299 -0
  50. package/skills/token-max/token_max.py +685 -0
  51. package/dist/index.js +0 -6317
@@ -0,0 +1,56 @@
1
+ # MEOW Anti-Patterns & Lessons Learned
2
+
3
+ This document tracks recurring mistakes or "hallucination triggers" to prevent them from happening again.
4
+
5
+ ## Current Hallucination Triggers
6
+ - **Sync I/O**: Do not use `fs.readFileSync` in the kernel. It blocks the heartbeat. Use `fs/promises`.
7
+ - **Placeholder Skills**: Some skills are just frontmatter without content. Always check the `body` before assuming a skill is functional.
8
+ - **SQLite Wavefunction Collapse**: Avoid zero-length vectors in embeddings. They cause SQLite-vec to error out. Use the `0.0001` noise floor.
9
+
10
+ ## Git Mistakes
11
+ - **Useless Commits**: Avoid committing after every tool call. Wait until the mission is verified.
12
+ - **Refactor Bloat**: Do not "clean up" `node_modules` or unrelated config files during a feature task.
13
+
14
+ ## Meow Execution Failures (Dogfooding Findings)
15
+
16
+ ### 1. Tool Call Parsing Loops (CRITICAL)
17
+ - **Symptom**: Meow outputs "Using tool: browse..." as TEXT but never actually calls the tool, causing infinite Grover search loops
18
+ - **Root Cause**: LLM (Ollama) is verbose and describes tool usage rather than executing `TOOL:` commands
19
+ - **Impact**: Meow hangs indefinitely when browse/search is attempted
20
+ - **Workaround**: Exclude browse/search from commands, use only local file operations (read, write, ls, grep, run)
21
+ - **Fix Needed**: Improve tool call regex parsing in `src/agent/agent.ts` to handle verbose LLM output
22
+
23
+ ### 2. Subprocess Shadow Audit Mismatch (CRITICAL)
24
+ - **Symptom**: Meow delegates to Claude Code, Claude Code claims success, but Meow's shadow audit rejects the changes
25
+ - **Root Cause**: Meow's subprocess runs a diff check on its own files (package.json, etc.) rather than the delegated task files
26
+ - **Impact**: PDF generation and other delegated tasks fail silently despite Claude Code completing
27
+ - **Workaround**: Verify subprocess outputs manually
28
+ - **Fix Needed**: Meow's summoner should verify the actual task output, not its own repo state
29
+
30
+ ### 3. browse/search Timeout (HIGH)
31
+ - **Symptom**: `browse` and `search` tools hang indefinitely because target sites are blocked/unreachable
32
+ - **Root Cause**: No AbortController/timeout on fetch calls, and network restrictions in the environment
33
+ - **Impact**: Meow freezes when attempting web access
34
+ - **Workaround**: Add 10s timeout to fetch calls (done), avoid browse/search in commands
35
+ - **Fix Needed**: Continue avoiding browse/search in agentic loops
36
+
37
+ ### 4. write Tool Path Corruption (HIGH)
38
+ - **Symptom**: `write` tool receives corrupted paths like "150 scratch/Bifrost-task/answer.md"
39
+ - **Root Cause**: Tool arguments parsing splits on ` | ` but LLM output contains " | " as prose
40
+ - **Impact**: File writes fail with ENOENT
41
+ - **Workaround**: Ensure commands don't contain " | " except as tool argument delimiter
42
+ - **Fix Needed**: More robust tool argument parsing
43
+
44
+ ### 5. Respawn Not Wired to Heartbeat (MEDIUM)
45
+ - **Symptom**: Watchdog mechanism exists but agent never calls `kernel.pulse()`, so frozen agents aren't detected
46
+ - **Root Cause**: Agent's chat loop doesn't include heartbeat calls to kernel
47
+ - **Impact**: Frozen agents run forever without recovery
48
+ - **Workaround**: None - requires code fix
49
+ - **Fix Needed**: Add `kernel.pulse(process.pid)` periodically in agent chat loop
50
+
51
+ ## Future Prevention
52
+ - [ ] Add a pre-commit hook that runs `bun run check`.
53
+ - [ ] Implement a "Semantic Cross-Check" for mission fulfillment.
54
+ - [ ] Fix tool call parsing to handle verbose LLM output
55
+ - [ ] Wire heartbeat into agent chat loop
56
+ - [ ] Fix shadow audit to check task output, not meow repo
@@ -0,0 +1,29 @@
1
+ # MEOW Architecture Map
2
+
3
+ This document serves as the ground truth for the project's technical structure.
4
+
5
+ ## Directory Layout
6
+
7
+ - `src/index.ts`: The entry point and main kernel loop.
8
+ - `src/agent/`: Core orchestration logic.
9
+ - `skills.ts`: Discovers and manages `.md` based skill files.
10
+ - `kernel.ts`: The "brain" that manages task state and tool execution.
11
+ - `src/extensions/`: Tool definitions and MCP integrations.
12
+ - `skills/`: Markdown-based "Expert Knowledge" modules.
13
+ - `karpathy_guidelines/`: Core coding standards.
14
+ - `memory/`: Persistent storage for agent findings and long-term context.
15
+ - `REPORTS/`: Audits, reviews, and post-mortems.
16
+
17
+ ## Key Abstractions
18
+
19
+ ### 1. The Kernel
20
+ The central loop that receives a user request, selects the appropriate skills/tools, and executes the "Quantum turn."
21
+
22
+ ### 2. Skills
23
+ Static Markdown files with frontmatter. They provide **Passive Context**. The agent reads them to understand "how" to perform specific tasks (e.g., how to code like Karpathy).
24
+
25
+ ### 3. Extensions
26
+ Code modules that provide **Active Capabilities**. They register tools (read, write, run) that the agent can use to interact with the system.
27
+
28
+ ## Data Flow
29
+ User Input → Kernel → Skill Discovery → Tool Selection → Execution → Verification → Result.
@@ -0,0 +1,12 @@
1
+ # MEOW Ecosystem Research Log
2
+
3
+ This document tracks mature agentic patterns, Claude skills, and MCP tools found during research.
4
+
5
+ ## 🏗️ Agentic Patterns
6
+ - [Pattern Name] - [Description/Link]
7
+
8
+ ## 🛠️ Mature Tools & Skills
9
+ - [Skill Name] - [Ecosystem Reference]
10
+
11
+ ## 📜 Research Notes
12
+ - [Date] - [Topic] - [Findings]
@@ -0,0 +1,13 @@
1
+ # MEOW Mission Statement
2
+
3
+ ## What is MEOW?
4
+ MEOW is a **Sovereign AI Coding Agent** designed to run locally in your terminal. It acts as a meta-orchestrator, capable of managing multiple "skills" (expert knowledge) and "extensions" (tools) to solve complex software engineering tasks autonomously.
5
+
6
+ ## Core Values
7
+ 1. **Surgical Precision**: We touch only what is necessary. We do not "cleanup" adjacent code unless explicitly asked.
8
+ 2. **Ground Truth Verification**: We do not "guess" if code works. we verify via `typecheck`, `lint`, and (where available) `tests`.
9
+ 3. **Quantum-Inspired Orchestration**: We use advanced logic (like amplitude amplification) to prioritize the best reasoning paths, but we ground this in classical software engineering rigor.
10
+ 4. **Local-First & Sovereign**: MEOW is designed to empower the user's local environment without excessive reliance on opaque cloud abstractions.
11
+
12
+ ## The Goal
13
+ To provide a friction-less, non-hallucinating coding partner that produces high-quality, production-ready commits.
@@ -0,0 +1,200 @@
1
+ # MEOW QA Review & Process Guidelines
2
+
3
+ ## Section 1: QA Review of MEOW Outputs
4
+
5
+ ### ✅ PASSED Reviews
6
+
7
+ #### Task-1: Project Setup
8
+ | File | Lines | Status | Notes |
9
+ |------|-------|--------|-------|
10
+ | `PLAN.md` | 37 | ✅ PASS | Covers architecture, tech stack, priority actions |
11
+ | `RESEARCH.md` | 48 | ✅ PASS | Comprehensive API research for 5 services |
12
+
13
+ #### Task-2: Patent Analysis
14
+ | File | Lines | Status | Notes |
15
+ |------|-------|--------|-------|
16
+ | `TOP_PATENTS.md` | 119 | ✅ PASS | 10 patents identified with entry points |
17
+ | `ANALYSIS.md` | 100 | ✅ PASS | Methodology and strategic recommendations |
18
+ | `PATENTS_REPORT.md` | 374 | ✅ PASS | Full combined report, well-structured |
19
+
20
+ ### ❌ FAILED Reviews
21
+
22
+ #### PATENTS_REPORT.pdf
23
+ - **File**: `scratch/task-2/PATENTS_REPORT.pdf`
24
+ - **Size**: 47KB (actual content: placeholder page from converter)
25
+ - **Status**: ❌ **FAIL - INVALID OUTPUT**
26
+ - **Problem**: Tool ran but captured converter's placeholder page, NOT the actual report content
27
+ - **Visual Proof**: PDF shows markdowntopdf.com welcome page, no patent data
28
+
29
+ ---
30
+
31
+ ## Section 2: Root Cause Analysis - Why MEOW Failed
32
+
33
+ ### Failure Chain
34
+
35
+ 1. **Task Assigned**: "Create PDF for task-2"
36
+ 2. **MEOW Called Tool**: PDF generation tool
37
+ 3. **Tool Returned**: Success signal
38
+ 4. **MEOW Verified**: File exists (47KB)
39
+ 5. **MEOW Reported**: "PDF created successfully"
40
+ 6. **Reality**: File contains wrong content (placeholder page)
41
+
42
+ ### Why MEOW Didn't Catch This
43
+
44
+ 1. **No Visual Verification**: MEOW checked file existence, not content validity
45
+ 2. **Trust Without Verification**: Tool reported success → assumed success
46
+ 3. **No Screenshot Requirement**: Didn't capture visual proof of output
47
+ 4. **Output Quality Not Part of Tool Contract**: Tool said "done" but didn't validate content
48
+
49
+ ### Systemic Issue
50
+
51
+ MEOW's verification is **binary** (exists vs not exists), not **qualitative** (correct vs incorrect content).
52
+
53
+ ---
54
+
55
+ ## Section 3: Process Guidelines - Visual Verification Required
56
+
57
+ ### New Rule for All Output Generation Tasks
58
+
59
+ **ANY task that produces a visual output (PDF, HTML, image, etc.) MUST include:**
60
+
61
+ ```
62
+ 1. Generate the output file
63
+ 2. Capture screenshot of the output
64
+ 3. Describe what screenshot shows
65
+ 4. If screenshot shows placeholder/error/wrong content → REJECT and retry
66
+ ```
67
+
68
+ ### Visual Verification Checklist
69
+
70
+ For PDF outputs:
71
+ - [ ] Screenshot shows first page of actual document content
72
+ - [ ] Screenshot shows correct title/heading
73
+ - [ ] Screenshot shows actual data (not placeholder text)
74
+ - [ ] File size is reasonable (>1KB for text content)
75
+
76
+ For file outputs:
77
+ - [ ] First 5 lines match expected content
78
+ - [ ] Last 5 lines match expected content
79
+ - [ ] No truncation or corruption markers
80
+
81
+ For browser-based outputs:
82
+ - [ ] Screenshot captures actual rendered content
83
+ - [ ] No "loading" or "placeholder" states
84
+ - [ ] Correct data visible in screenshot
85
+
86
+ ---
87
+
88
+ ## Section 4: MEOW QA Protocol (New SOP)
89
+
90
+ ### Before Marking Task Complete
91
+
92
+ For any output generation:
93
+
94
+ ```
95
+ 1. GENERATE output (file/pdf/etc)
96
+ 2. VERIFY using method below based on output type:
97
+
98
+ PDF/Image → Take screenshot, describe visual content
99
+ File → Read first/last 10 lines, compare to expected
100
+ Browser → Take snapshot/screenshot
101
+ API Response → Log status code and first 200 chars
102
+ ```
103
+
104
+ ### Verification by Output Type
105
+
106
+ | Output Type | Verification Method | Acceptance Criteria |
107
+ |-------------|---------------------|---------------------|
108
+ | PDF | Screenshot of page 1 | Shows actual title, not placeholder |
109
+ | Markdown | Read lines 1-10, -10 to end | Matches expected content |
110
+ | Image | Screenshot | Shows rendered content, not blank |
111
+ | Webpage | Snapshot | Contains expected elements |
112
+ | API Call | Log response | 2xx status, valid JSON |
113
+
114
+ ### MEOW Must Report
115
+
116
+ For each output generation, MEOW must say:
117
+ ```
118
+ VERIFIED: [output type] - [visual confirmation description]
119
+ Example: VERIFIED: PDF - "Shows 'Top 10 Drug Patents' title and table with patent data"
120
+ ```
121
+
122
+ ### If Verification Fails
123
+
124
+ MEOW must:
125
+ 1. Log what was expected vs what was found
126
+ 2. Attempt re-generation
127
+ 3. Report failure if 2 attempts fail
128
+
129
+ ---
130
+
131
+ ## Section 5: Updated SOP for Mission Tasks
132
+
133
+ ### Modified Mission Flow
134
+
135
+ ```
136
+ 1. LOAD .context files (SOP, MISSION, ARCHITECTURE, HONESTY)
137
+ 2. READ mission file
138
+ 3. EXECUTE research/actions
139
+ 4. GENERATE outputs
140
+ 5. VERIFY outputs with VISUAL CHECK (screenshot required)
141
+ 6. If FAIL → retry with corrected approach
142
+ 7. If PASS → report with verification evidence
143
+ ```
144
+
145
+ ### No Trust Policy
146
+
147
+ - **NEVER** assume tool succeeded because it returned
148
+ - **ALWAYS** verify output matches expectation
149
+ - **REQUIRE** visual evidence (screenshot) for visual outputs
150
+ - **DOCUMENT** what was verified in completion report
151
+
152
+ ---
153
+
154
+ ## Section 6: Summary of Issues Found
155
+
156
+ ### Code Quality Issues (Fixed)
157
+
158
+ 1. `database.ts`: Removed unused `platform` import
159
+ 2. `quantum_memory.ts`: Early return for single candidate bypasses quantum search
160
+ 3. `index.ts`: No null check on response (potential "null" string output)
161
+
162
+ ### Output Quality Issues
163
+
164
+ 1. **PATENTS_REPORT.pdf**: Invalid content (placeholder page)
165
+ - Root cause: Tool used but content not verified
166
+ - Fix needed: Add screenshot verification step
167
+
168
+ ### Process Gaps
169
+
170
+ 1. No visual verification requirement in output generation
171
+ 2. MEOW reports "success" based on tool return, not content check
172
+ 3. No explicit QA step before declaring mission complete
173
+
174
+ ---
175
+
176
+ ## Section 7: Recommendations
177
+
178
+ ### Immediate (Applied Now)
179
+
180
+ 1. **Visual Verification Required**: Add to SOP - screenshot required for PDF/image outputs
181
+ 2. **Output Type Check**: Different verification methods for different output types
182
+ 3. **Fail Reporting**: When output doesn't match expectation, report what was wrong
183
+
184
+ ### Short Term (MEOW Updates)
185
+
186
+ 1. Add verification method to each tool description
187
+ 2. Require screenshot/snapshot before marking output generation complete
188
+ 3. Implement output quality scoring (0-10) based on content match
189
+
190
+ ### Long Term (System Design)
191
+
192
+ 1. Build "Output Validator" as part of MEOW kernel
193
+ 2. Schema-based output verification (e.g., PDF must contain title, table with X rows)
194
+ 3. Visual diff capability for comparing expected vs actual output
195
+
196
+ ---
197
+
198
+ *QA Review completed: 2026-04-30*
199
+ *Issues Found: 3 (1 critical output failure, 2 code quality, 1 process gap)*
200
+ *Fixes Applied: 2 (code fixes)*
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bash
2
+ bun run check
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bash
2
+ bun run check
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to MEOW will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
+
7
+ ## [0.1.0] — 2024-05-16
8
+
9
+ ### Added
10
+ - Initial release
11
+ - `meow -p` headless mode for background task execution
12
+ - MEOW-3-RULE: meow -p (3 retries) → claude -p fixes MEOW (never the task)
13
+ - 4-panel blessed TUI (`meow --tui`)
14
+ - Interactive REPL mode
15
+ - Multi-tier quality gates (NO_MOCKS, TYPE_CHECK, LINT_CLEAN, etc.)
16
+ - MissionReviewer: 7-criterion scoring
17
+ - Convergence logic (stagnation, token budget, diminishing returns)
18
+ - MeowKernel: heartbeat watchdog and respawn
19
+ - SQLite + sqlite-vec for persistent task memory
20
+ - Quantum memory for semantic recall (Grover-based)
21
+ - MCP client integration (40+ external services)
22
+ - L1-L4 orchestration architecture
23
+ - SWARM, SEQUENTIAL, PARALLEL, AUDIT_ONLY execution modes
24
+ - HumanSignoffManager for low-confidence decision escalation
25
+ - CLAUDE.md and .meow/skills/meow-setup/SKILL.md for Claude Code integration
@@ -0,0 +1,55 @@
1
+ # Contributing to MEOW
2
+
3
+ Welcome! MEOW is an open-source autonomous coding harness and contributions are welcome.
4
+
5
+ ## Getting Started
6
+
7
+ ```bash
8
+ git clone https://github.com/stancsz/meow.git
9
+ cd meow
10
+ npm install
11
+ npx tsx src/index.ts "your task here"
12
+ ```
13
+
14
+ ## Dev Workflow
15
+
16
+ ```bash
17
+ npm run dev # REPL mode
18
+ npm run tui # TUI mode
19
+ npm run typecheck # tsc --noEmit
20
+ npm run lint # ESLint
21
+ npm run test # Vitest
22
+ ```
23
+
24
+ ## Submitting Changes
25
+
26
+ 1. Fork the repo
27
+ 2. Create a branch: `git checkout -b fix/my-fix`
28
+ 3. Make your changes + add tests
29
+ 4. Run `npm run check` to verify typecheck + lint pass
30
+ 5. Open a PR
31
+
32
+ ## MEOW-3-RULE for contributors
33
+
34
+ If you fix MEOW (not a task), after your fix:
35
+ 1. Re-run the original task with `meow -p`
36
+ 2. If it succeeds → open a PR to stancsz/meow
37
+
38
+ ## Code Structure
39
+
40
+ ```
41
+ src/
42
+ agent/ # LLM chat, summoner, mission_reviewer, quantum_memory
43
+ orchestrator/ # Orchestrator, TaskQueue, convergence checks
44
+ kernel/ # MeowKernel, database
45
+ cli/ # REPL, TUI
46
+ extensions/ # Tool definitions
47
+ types/ # Tool schema
48
+ ```
49
+
50
+ ## Style
51
+
52
+ - TypeScript strict mode
53
+ - ESM modules
54
+ - No `TODO`/`FIXME` in committed code (quality gate: NO_MOCKS)
55
+ - Think-Plan-Verify in commit messages
package/PUBLISH.md ADDED
@@ -0,0 +1,268 @@
1
+ # Publishing MEOW to npm
2
+
3
+ This guide covers everything needed to publish MEOW as a public npm package.
4
+
5
+ ---
6
+
7
+ ## Prerequisite: npm Account
8
+
9
+ 1. Create an account at [npmjs.com](https://www.npmjs.com)
10
+ 2. Enable 2FA (required for publishing)
11
+ 3. Claim the `meow` or `meow-agent` package name
12
+
13
+ > ⚠️ The name `meow` is already taken on npm. Options:
14
+ > - `meow-agent` (used in README install instructions)
15
+ > - `@meow/core` (scoped package)
16
+ > - `@stancsz/meow` (scoped with your GitHub username)
17
+ >
18
+ > Check availability: `npm view meow-agent` vs `npm view meow`
19
+
20
+ ---
21
+
22
+ ## Step 1: Prepare the Package
23
+
24
+ ### 1a. Install dependencies
25
+
26
+ ```bash
27
+ cd meow
28
+ npm install
29
+ ```
30
+
31
+ ### 1b. Run all checks
32
+
33
+ ```bash
34
+ npm run check # tsc --noEmit + ESLint
35
+ npm run test # vitest run
36
+ ```
37
+
38
+ ### 1c. Verify the bin works
39
+
40
+ ```bash
41
+ npx tsx src/index.ts --version
42
+ # or
43
+ node src/index.js --version
44
+ ```
45
+
46
+ ### 1d. Build a compiled JavaScript version (optional but recommended)
47
+
48
+ ```bash
49
+ # Install tsup for fast compilation
50
+ npm install --save-dev tsup
51
+
52
+ # Add to package.json scripts:
53
+ # "build": "tsup src/index.ts --out-dir dist"
54
+
55
+ npx tsup src/index.ts --out-dir dist --format esm --no-external-local
56
+ ```
57
+
58
+ This produces `dist/index.js` which is faster to load than `tsx`.
59
+
60
+ Update `bin` in `package.json`:
61
+ ```json
62
+ {
63
+ "bin": {
64
+ "meow": "./dist/index.js"
65
+ },
66
+ "exports": {
67
+ ".": {
68
+ "import": "./dist/index.js",
69
+ "types": "./src/index.ts"
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Step 2: Version Management
78
+
79
+ MEOW uses **semantic versioning** (semver):
80
+
81
+ | Increment | When to use | Example |
82
+ |-----------|-------------|---------|
83
+ | `PATCH` | Bug fixes, no breaking changes | 0.1.0 → 0.1.1 |
84
+ | `MINOR` | New features, backward compatible | 0.1.0 → 0.2.0 |
85
+ | `MAJOR` | Breaking changes | 0.1.0 → 1.0.0 |
86
+
87
+ ```bash
88
+ # Bump version
89
+ npm version patch # 0.1.0 → 0.1.1
90
+ npm version minor # 0.1.0 → 0.2.0
91
+ npm version major # 0.1.0 → 1.0.0
92
+
93
+ # This creates a git commit + tag automatically
94
+ ```
95
+
96
+ Also update `CHANGELOG.md` before publishing with the new version.
97
+
98
+ ---
99
+
100
+ ## Step 3: Add .npmignore
101
+
102
+ Create `.npmignore` to exclude files from the package:
103
+
104
+ ```
105
+ node_modules/
106
+ src/
107
+ *.ts
108
+ *.map
109
+ .tsup.config.ts
110
+ vitest.config.ts
111
+ .git/
112
+ .github/
113
+ .context/
114
+ memory/
115
+ scratch/
116
+ *.bak
117
+ *.ts.bak
118
+ *.ts.v2
119
+ ```
120
+
121
+ This ensures only compiled JS + necessary files land in the npm package.
122
+
123
+ ---
124
+
125
+ ## Step 4: Login to npm
126
+
127
+ ```bash
128
+ npm login
129
+ # Enter username, password, and 2FA code
130
+ ```
131
+
132
+ Verify you're logged in:
133
+ ```bash
134
+ npm whoami
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Step 5: Publish
140
+
141
+ ### For a scoped package (`@stancsz/meow`)
142
+
143
+ ```bash
144
+ # Requires `access: public` for scoped packages
145
+ npm publish --access public
146
+ ```
147
+
148
+ ### For an unscoped package (`meow-agent`)
149
+
150
+ ```bash
151
+ npm publish
152
+ ```
153
+
154
+ ### Dry run (test without actually publishing)
155
+
156
+ ```bash
157
+ npm publish --dry-run
158
+ ```
159
+
160
+ ### Verify what will be published
161
+
162
+ ```bash
163
+ npm pack --dry-run
164
+ ```
165
+
166
+ This shows the exact `.tgz` that will be uploaded.
167
+
168
+ ---
169
+
170
+ ## Step 6: After Publishing
171
+
172
+ ### Verify the package is live
173
+
174
+ ```bash
175
+ npm view meow-agent
176
+ # or
177
+ npm view @stancsz/meow
178
+ ```
179
+
180
+ ### Tag the commit
181
+
182
+ ```bash
183
+ git tag v0.1.0
184
+ git push origin v0.1.0
185
+ ```
186
+
187
+ ### Update GitHub release
188
+
189
+ Create a GitHub release at:
190
+ https://github.com/stancsz/meow/releases/new
191
+
192
+ Copy the changelog entry for this version.
193
+
194
+ ---
195
+
196
+ ## CI/CD: Automated Publishing via GitHub Actions
197
+
198
+ Add `.github/workflows/publish.yml`:
199
+
200
+ ```yaml
201
+ name: Publish to npm
202
+
203
+ on:
204
+ push:
205
+ tags:
206
+ - 'v*.*.*'
207
+
208
+ jobs:
209
+ publish:
210
+ runs-on: ubuntu-latest
211
+ steps:
212
+ - uses: actions/checkout@v4
213
+
214
+ - uses: actions/setup-node@v4
215
+ with:
216
+ node-version: '20'
217
+ registry-url: 'https://registry.npmjs.org'
218
+
219
+ - run: npm install
220
+
221
+ - run: npm test
222
+
223
+ - run: npm run build
224
+
225
+ - run: npm publish
226
+ env:
227
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
228
+ ```
229
+
230
+ ### Get NPM_TOKEN
231
+
232
+ 1. Go to [npmjs.com](https://www.npmjs.com) → Account → Access Tokens
233
+ 2. Create an **Automation** token (can publish any package without 2FA)
234
+ 3. Add to GitHub repo: Settings → Secrets → `NPM_TOKEN`
235
+
236
+ Now every `git tag v*.*.*` pushed to GitHub will:
237
+ 1. Run tests
238
+ 2. Build the package
239
+ 3. Publish to npm automatically
240
+
241
+ ---
242
+
243
+ ## Package Name Options (Decision)
244
+
245
+ | Name | Status | Recommended? |
246
+ |------|--------|-------------|
247
+ | `meow` | ❌ Taken | No |
248
+ | `meow-agent` | ✅ Available | **Yes** — clear, matches README install command |
249
+ | `@stancsz/meow` | ✅ Available | Good if you want scoped + personal brand |
250
+ | `@meow/core` | ✅ Available | Good for ecosystem (`@meow/cli`, `@meow/sdk`) |
251
+
252
+ Recommend: **`meow-agent`** — available, clear, works with `npm install -g meow-agent`.
253
+
254
+ ---
255
+
256
+ ## npm Organization (optional)
257
+
258
+ If you want an organization (e.g., `@meow-ai`):
259
+ - Free at npmjs.com
260
+ - Allows multiple packages: `@meow-ai/cli`, `@meow-ai/core`, `@meow-ai/sdk`
261
+
262
+ Set package name in `package.json` accordingly:
263
+ ```json
264
+ {
265
+ "name": "@meow-ai/cli",
266
+ "version": "0.1.0"
267
+ }
268
+ ```