mdma-cli 4.2.0 → 4.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/README.md CHANGED
@@ -21,6 +21,26 @@ npx mdma-cli add # default: GitHub workflow, merge auto
21
21
  npx mdma-cli add jira # JIRA integration, milestone, anonymity
22
22
  ```
23
23
 
24
+ ### Configuration JIRA
25
+
26
+ **Variables globales** (`.zshrc` ou `.bashrc`) :
27
+
28
+ ```bash
29
+ export ARTE_ATLASSIAN_ROOT_URL="https://mycompany.atlassian.net" # ou URL on-premise
30
+ export ARTE_ATLASSIAN_USER_EMAIL="user@email.com"
31
+ export ARTE_ATLASSIAN_API_TOKEN="your-api-token"
32
+ ```
33
+
34
+ **Variable projet** (dans `CLAUDE.md` ou `.env`) :
35
+
36
+ ```bash
37
+ export ARTE_ATLASSIAN_PROJECT_NAME="PROJ" # clé du projet JIRA
38
+ ```
39
+
40
+ Créer un token : [Atlassian API tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
41
+
42
+ **Fallback MCP** : si l'API échoue, le workflow propose d'utiliser `@anthropic/atlassian-mcp-server`.
43
+
24
44
  ## Custom mix
25
45
 
26
46
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdma-cli",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "Rules opinionated pour agents de code",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -7,6 +7,70 @@
7
7
  > - Ne jamais faire d'exception, quelle que soit la taille ou nature du changement
8
8
  > - En cas de doute → STOP → demander à l'utilisateur
9
9
 
10
+ ## Configuration JIRA
11
+
12
+ ### Variables globales (`.zshrc` ou `.bashrc`)
13
+
14
+ ```bash
15
+ # IMPORTANT: URL racine SANS /jira/ à la fin, et SANS espace avant le =
16
+ export ARTE_ATLASSIAN_ROOT_URL="https://mycompany.atlassian.net"
17
+ export ARTE_ATLASSIAN_USER_EMAIL="user@email.com"
18
+ export ARTE_ATLASSIAN_API_TOKEN="your-api-token"
19
+ ```
20
+
21
+ ### Variable projet (`CLAUDE.md` du projet)
22
+
23
+ ```markdown
24
+ ## JIRA
25
+ - **Projet** : `PROJ` (clé JIRA)
26
+ ```
27
+
28
+ Ou via variable d'environnement projet :
29
+ ```bash
30
+ export ARTE_ATLASSIAN_PROJECT_NAME="PROJ"
31
+ ```
32
+
33
+ ### Utilisation API
34
+
35
+ **IMPORTANT** : Pour éviter les erreurs de caractères invisibles dans le terminal, toujours passer par un script temporaire :
36
+
37
+ ```bash
38
+ # Récupérer un ticket
39
+ cat << 'SCRIPT' > /tmp/jira_req.sh
40
+ #!/bin/bash
41
+ curl -s -u "$ARTE_ATLASSIAN_USER_EMAIL:$ARTE_ATLASSIAN_API_TOKEN" \
42
+ "$ARTE_ATLASSIAN_ROOT_URL/rest/api/3/issue/PROJ-123"
43
+ SCRIPT
44
+ chmod +x /tmp/jira_req.sh && /tmp/jira_req.sh
45
+
46
+ # Recherche JQL (endpoint actuel, l'ancien /search est obsolète)
47
+ cat << 'SCRIPT' > /tmp/jira_req.sh
48
+ #!/bin/bash
49
+ curl -s -G -u "$ARTE_ATLASSIAN_USER_EMAIL:$ARTE_ATLASSIAN_API_TOKEN" \
50
+ --data-urlencode 'jql=project=PROJ AND fixVersion="1.0.0"' \
51
+ --data-urlencode 'fields=key,summary,status' \
52
+ "$ARTE_ATLASSIAN_ROOT_URL/rest/api/3/search/jql"
53
+ SCRIPT
54
+ chmod +x /tmp/jira_req.sh && /tmp/jira_req.sh
55
+ ```
56
+
57
+ ### Troubleshooting
58
+
59
+ | Erreur | Cause | Solution |
60
+ |--------|-------|----------|
61
+ | `not found` au source | Espace avant `=` | `export VAR="value"` sans espace |
62
+ | `API a été supprimée` | Ancien endpoint | Utiliser `/rest/api/3/search/jql` |
63
+ | `401 Unauthorized` | Token invalide | Régénérer sur id.atlassian.com |
64
+ | `blank argument` | Caractères invisibles | Utiliser un script temporaire (voir exemples ci-dessus) |
65
+
66
+ ### Fallback
67
+
68
+ Si l'API REST échoue (erreurs réseau, permissions), utiliser le MCP Atlassian :
69
+
70
+ ```bash
71
+ claude mcp add atlassian -- npx -y @anthropic/atlassian-mcp-server
72
+ ```
73
+
10
74
  ## Étapes obligatoires
11
75
 
12
76
  ### 0. Setup Git
@@ -15,7 +79,7 @@
15
79
  - Ne jamais rationaliser ("c'est juste un petit fix")
16
80
 
17
81
  ### 1. Plan
18
- - Cherche dans .zshrc pour le token JIRA afin de l'utiliser en REST API avec CURL. Attention le token peut contenir des caractères spéciaux, en tenir compte dans le CURL.
82
+ - Utilise les variables `$ARTE_ATLASSIAN_*` pour les appels API JIRA (voir Configuration ci-dessus)
19
83
  - Cherche le contenu du ticket JIRA à traiter avec l'id donné dans le prompt
20
84
  - Passe le statut du ticket JIRA à "In progress"
21
85
  - Attribue le ticket à l'utilisateur