mdma-cli 4.1.0 → 4.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.
- package/bin/init.js +31 -1
- package/package.json +1 -1
- package/templates/git-default.md +1 -1
- package/templates/git-jira.md +2 -2
package/bin/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { copyFileSync, mkdirSync, rmSync, readdirSync, existsSync } from 'fs';
|
|
3
|
+
import { copyFileSync, mkdirSync, rmSync, readdirSync, existsSync, readFileSync, appendFileSync } from 'fs';
|
|
4
4
|
import { join, dirname } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
|
|
@@ -61,6 +61,26 @@ function listOptions() {
|
|
|
61
61
|
console.log('\nUsage: npx mdma-cli add [preset] or npx mdma-cli add --workflow=X --git=Y\n');
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
function updateGitExclude() {
|
|
65
|
+
const excludePath = join(process.cwd(), '.git', 'info', 'exclude');
|
|
66
|
+
|
|
67
|
+
if (!existsSync(excludePath)) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const content = readFileSync(excludePath, 'utf-8');
|
|
72
|
+
const linesToAdd = ['# Claude Code', 'CLAUDE.md', '.claude/'];
|
|
73
|
+
const missingLines = linesToAdd.filter(line => !content.includes(line));
|
|
74
|
+
|
|
75
|
+
if (missingLines.length === 0) {
|
|
76
|
+
return 'already';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const addition = '\n' + linesToAdd.join('\n') + '\n';
|
|
80
|
+
appendFileSync(excludePath, addition);
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
|
|
64
84
|
function parseArgs(args) {
|
|
65
85
|
const result = { preset: null, workflow: null, git: null };
|
|
66
86
|
|
|
@@ -149,6 +169,16 @@ function add(args) {
|
|
|
149
169
|
console.log(` [ok] .mcp.json (project root)`);
|
|
150
170
|
}
|
|
151
171
|
|
|
172
|
+
// Update .git/info/exclude
|
|
173
|
+
const excludeResult = updateGitExclude();
|
|
174
|
+
if (excludeResult === true) {
|
|
175
|
+
console.log(` [ok] .git/info/exclude (updated)`);
|
|
176
|
+
} else if (excludeResult === 'already') {
|
|
177
|
+
console.log(` [skip] .git/info/exclude (already configured)`);
|
|
178
|
+
} else {
|
|
179
|
+
console.log(` [skip] .git/info/exclude (not a git repo)`);
|
|
180
|
+
}
|
|
181
|
+
|
|
152
182
|
console.log(`\n5 file(s) installed to .claude/rules/mdma/`);
|
|
153
183
|
console.log(`1 file(s) installed to project root (.mcp.json)\n`);
|
|
154
184
|
}
|
package/package.json
CHANGED
package/templates/git-default.md
CHANGED
|
@@ -34,7 +34,7 @@ Si tu envisages de transgresser une règle → **STOP** → demande à l'utilisa
|
|
|
34
34
|
|
|
35
35
|
### Après validation
|
|
36
36
|
1. `git add <fichiers>` (pas -A)
|
|
37
|
-
2. `git commit -m "
|
|
37
|
+
2. `git commit -m "XXX: description"`. Remplacer XXX par le prefix de conventionnal commits qui correspond le mieux au sujet traité (voir ### Commits)
|
|
38
38
|
3. `git push -u origin <branche>`
|
|
39
39
|
4. `gh pr create --fill`
|
|
40
40
|
5. Attendre validation utilisateur
|
package/templates/git-jira.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
2. **JAMAIS commit sans branche** `feature/` ou `fix/`
|
|
10
10
|
3. **JAMAIS merge sans PR**
|
|
11
11
|
4. **JAMAIS `git add -A`** : commiter uniquement les fichiers modifiés intentionnellement
|
|
12
|
-
5. **JAMAIS
|
|
12
|
+
5. **JAMAIS te citer** : ni dans les descriptions, titres, messages de commit ou co-auteur (pas de "Co-Authored-By"). Tout le travail est attribué à l'utilisateur uniquement
|
|
13
13
|
|
|
14
14
|
Si tu envisages de transgresser une règle → **STOP** → demande à l'utilisateur.
|
|
15
15
|
|
|
@@ -34,7 +34,7 @@ Si tu envisages de transgresser une règle → **STOP** → demande à l'utilisa
|
|
|
34
34
|
|
|
35
35
|
### Après validation
|
|
36
36
|
1. `git add <fichiers>` (pas -A)
|
|
37
|
-
2. `git commit -m "
|
|
37
|
+
2. `git commit -m "XXX: description"`. Remplacer XXX par le prefix de conventionnal commits qui correspond le mieux au sujet traité (voir ### Commits)
|
|
38
38
|
3. `git push -u origin <branche>`
|
|
39
39
|
4. `gh pr create --fill` en assignant le milestone correspondant à la version du ticket. Si ce milestone n'existe pas, le créer.
|
|
40
40
|
5. Attendre validation utilisateur
|