ma-agents 1.2.0 → 1.4.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.
package/DEVELOPMENT.md ADDED
@@ -0,0 +1,173 @@
1
+ # Development Guide
2
+
3
+ Guidelines for contributing to ma-agents — for both AI agents and human developers.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/mayafit/AI_Agents.git
9
+ cd AI_Agents
10
+ npm install
11
+ node bin/cli.js help
12
+ ```
13
+
14
+ ## Project Architecture
15
+
16
+ ```
17
+ ma-agents/
18
+ ├── bin/cli.js CLI entry point (wizard, commands, flag parsing)
19
+ ├── lib/
20
+ │ ├── agents.js Agent configurations (paths, versions, resource maps)
21
+ │ └── installer.js Core logic (install, uninstall, manifest, status)
22
+ ├── skills/ Bundled skills (one directory per skill)
23
+ ├── index.js Programmatic API exports
24
+ ├── SKILLS_STRUCTURE.md Skill authoring reference
25
+ ├── DEVELOPMENT.md This file
26
+ └── package.json
27
+ ```
28
+
29
+ ## Versioning (Semver)
30
+
31
+ This project tracks three independent version numbers. All follow [Semantic Versioning](https://semver.org/).
32
+
33
+ ### Package Version (`package.json`)
34
+
35
+ The npm package version. Bump on every publish.
36
+
37
+ | Change | Bump | Example |
38
+ |--------|------|---------|
39
+ | Bug fix, typo in CLI | PATCH | 1.4.0 → 1.4.1 |
40
+ | New command, new feature | MINOR | 1.4.0 → 1.5.0 |
41
+ | Breaking API change | MAJOR | 1.4.0 → 2.0.0 |
42
+
43
+ ### Skill Version (`skills/<name>/skill.json`)
44
+
45
+ Each skill has its own version. Bump when skill content changes.
46
+
47
+ | Change | Bump | Example |
48
+ |--------|------|---------|
49
+ | Typo fix, minor wording | PATCH | 1.0.0 → 1.0.1 |
50
+ | New instructions, new resources added | MINOR | 1.0.0 → 1.1.0 |
51
+ | Breaking changes to skill behavior or structure | MAJOR | 1.0.0 → 2.0.0 |
52
+
53
+ When you bump a skill version, the installer will detect the change and offer users an upgrade.
54
+
55
+ ### Agent Version (`lib/agents.js`)
56
+
57
+ Each agent configuration has a version. Bump when the agent config changes.
58
+
59
+ | Change | Bump | Example |
60
+ |--------|------|---------|
61
+ | Description update, path correction | PATCH | 1.0.0 → 1.0.1 |
62
+ | New field added (e.g., resourceMap) | MINOR | 1.0.0 → 1.1.0 |
63
+ | Path structure change that breaks existing installs | MAJOR | 1.0.0 → 2.0.0 |
64
+
65
+ ## Adding a New Skill
66
+
67
+ 1. Create the directory: `mkdir -p skills/my-skill`
68
+ 2. Create `skill.json` with `name`, `description`, `version` (start at `1.0.0`)
69
+ 3. Create `SKILL.md` — pure Markdown, no YAML frontmatter
70
+ 4. (Optional) Add `scripts/`, `references/`, `examples/`, `hooks/`, `assets/`
71
+ 5. (Optional) Create agent-specific templates: `claude-code.md`, `cline.md`, `generic.md`
72
+ 6. Verify: `node bin/cli.js list` — your skill should appear
73
+ 7. Test install: `node bin/cli.js install my-skill claude-code`
74
+ 8. Check the installed output in `.claude/skills/my-skill/SKILL.md`
75
+
76
+ See [SKILLS_STRUCTURE.md](SKILLS_STRUCTURE.md) for full documentation.
77
+
78
+ ## Adding a New Agent
79
+
80
+ 1. Edit `lib/agents.js`
81
+ 2. Add a new entry to the `agents` array with all required fields:
82
+ - `id` — unique kebab-case identifier
83
+ - `name` — display name
84
+ - `version` — start at `1.0.0`
85
+ - `description` — brief description
86
+ - `getProjectPath()` — returns project-level skills path
87
+ - `getGlobalPath()` — returns global path (handle win32, darwin, linux)
88
+ - `fileExtension` — usually `.md`
89
+ - `template` — template ID (`generic`, `claude-code`, `cline`, or new)
90
+ - `resourceMap` — (optional) rename directories for this agent
91
+ 3. Test: `node bin/cli.js agents` — your agent should appear
92
+ 4. Test install: `node bin/cli.js install code-review my-agent`
93
+
94
+ ## Manifest System
95
+
96
+ The installer writes `.ma-agents.json` into each agent's install directory to track what's installed. This enables upgrade detection, version comparison, and clean uninstalls.
97
+
98
+ ```json
99
+ {
100
+ "manifestVersion": "1.0.0",
101
+ "agent": "claude-code",
102
+ "scope": "project",
103
+ "skills": {
104
+ "code-review": {
105
+ "version": "1.0.0",
106
+ "installedAt": "2026-02-17T12:34:56Z",
107
+ "updatedAt": "2026-02-17T12:34:56Z",
108
+ "installerVersion": "1.4.0",
109
+ "agentVersion": "1.0.0"
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ Do not edit manifests manually. Use `npx ma-agents status` to view and `npx ma-agents uninstall` to remove.
116
+
117
+ ## Pre-Publish Checklist
118
+
119
+ Before running `npm publish`:
120
+
121
+ - [ ] Package version bumped in `package.json`
122
+ - [ ] Skill versions bumped for any changed skills
123
+ - [ ] Agent versions bumped for any changed agent configs
124
+ - [ ] `node bin/cli.js list` — all skills appear
125
+ - [ ] `node bin/cli.js agents` — all agents appear
126
+ - [ ] Test fresh install: `node bin/cli.js install code-review claude-code --force`
127
+ - [ ] Test upgrade detection: run install again without `--force`
128
+ - [ ] Test uninstall: `node bin/cli.js uninstall code-review claude-code`
129
+ - [ ] Test status: `node bin/cli.js status`
130
+ - [ ] `node bin/cli.js help` — help text is up to date
131
+ - [ ] Commit with conventional commit message
132
+
133
+ ## Commit Conventions
134
+
135
+ Use [Conventional Commits](https://www.conventionalcommits.org/):
136
+
137
+ ```
138
+ feat: add new skill for API testing
139
+ fix: correct Cline resource mapping for docs/
140
+ chore: bump code-review skill to v1.0.1
141
+ docs: update SKILLS_STRUCTURE.md with hooks directory
142
+ refactor: extract manifest logic into separate module
143
+ ```
144
+
145
+ **Scopes** (optional): `cli`, `installer`, `agents`, `skills`, `docs`
146
+
147
+ ```
148
+ feat(cli): add status command
149
+ fix(installer): handle missing manifest gracefully
150
+ feat(skills): add vercel-react-best-practices skill
151
+ ```
152
+
153
+ ## Testing Locally
154
+
155
+ ```bash
156
+ # Run CLI directly
157
+ node bin/cli.js
158
+
159
+ # Test specific commands
160
+ node bin/cli.js list
161
+ node bin/cli.js agents
162
+ node bin/cli.js status
163
+ node bin/cli.js help
164
+
165
+ # Test install flow
166
+ node bin/cli.js install code-review claude-code --force
167
+ node bin/cli.js status
168
+ node bin/cli.js uninstall code-review claude-code
169
+ node bin/cli.js status
170
+
171
+ # Quick smoke test (programmatic)
172
+ node -e "const m = require('.'); console.log('Skills:', m.listSkills().length, 'Agents:', m.listAgents().length)"
173
+ ```