@ggdna/dna-plan 3.5.0 → 4.1.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
@@ -22,10 +22,17 @@ repo and the seven layers of product design.
22
22
  in `pm/<lang>/<yyyy>-Q<n>/reports`, with points to tick once they are communicated
23
23
  - `dna/doc/en/guides/jira-export-guide.md` — how the next tickets of one person,
24
24
  one sprint's worth, are exported as a CSV file for Jira
25
+ - `dna/doc/en/guides/jira-sync-guide.md` and `dna/scripts/jira-sync.js` —
26
+ how the user stories are synced with Jira Data Center in both
27
+ directions: only stories go to Jira, tickets stay in the repo. The
28
+ dependency-free Node script lands in `scripts/jira-sync.js` of the
29
+ project; the project's settings are in `jira.jsonc`, the token in
30
+ `JIRA_TOKEN`
25
31
  - Skills: `/gg-plan-intro` lists the planning skills and names the next
26
32
  step, `/gg-plan-requirements` runs the requirements engineering,
27
- `/gg-plan-schedule` the time plan, `/gg-plan-report` the reports and
28
- `/gg-plan-jira-export` the Jira export
33
+ `/gg-plan-schedule` the time plan, `/gg-plan-report` the reports,
34
+ `/gg-plan-jira-export` the Jira export and `/gg-plan-jira-sync` the
35
+ story sync with Jira
29
36
 
30
37
  A PM repo keeps every file in each of its languages, set by the variable
31
38
  `dnaLanguages` of `dna_translate` (default `en`, e.g. `en,de,fa`). The
package/dna/CLAUDE.md CHANGED
@@ -26,5 +26,9 @@ planning rules are in `doc/en/guides/pm-repo-guide.md`. When you plan in one:
26
26
  the user asks what to tell someone, offer `/gg-plan-report`; when they
27
27
  want tickets in Jira or plan the next sprint of a person, offer
28
28
  `/gg-plan-jira-export`
29
+ - A repo with `jira.jsonc` syncs its user stories with Jira: only stories
30
+ go to Jira, tickets stay in the repo. When the user wants stories in
31
+ Jira or the changes from Jira, offer `/gg-plan-jira-sync`, and never
32
+ export tickets there
29
33
 
30
34
  `/gg-plan-intro` lists the planning skills and says which one comes next.
@@ -15,7 +15,7 @@
15
15
  "ecosystem": null,
16
16
  "resolvedVersion": null,
17
17
  "via": null,
18
- "hash": "0x96c47a383669f782"
18
+ "hash": "0x8c66ede1e4347d25"
19
19
  }
20
20
  ],
21
21
  "claude": {
@@ -29,15 +29,19 @@
29
29
  "instances": [
30
30
  {
31
31
  "path": ".claude/CLAUDE_dna_plan.md",
32
- "hash": "0x7399506c3050e1b4"
32
+ "hash": "0x419cfccd4dbc398d"
33
33
  },
34
34
  {
35
35
  "path": ".claude/skills/gg-plan-intro/SKILL.md",
36
- "hash": "0x2da6ccdbdfa3c774"
36
+ "hash": "0x40c870bb48be2ccc"
37
37
  },
38
38
  {
39
39
  "path": ".claude/skills/gg-plan-jira-export/SKILL.md",
40
- "hash": "0x65196b21a75ba279"
40
+ "hash": "0xd1b5dd0c3c25e838"
41
+ },
42
+ {
43
+ "path": ".claude/skills/gg-plan-jira-sync/SKILL.md",
44
+ "hash": "0x68e5b6959efafea7"
41
45
  },
42
46
  {
43
47
  "path": ".claude/skills/gg-plan-report/SKILL.md",
@@ -53,11 +57,15 @@
53
57
  },
54
58
  {
55
59
  "path": "doc/de/guides/jira-export-guide.md",
56
- "hash": "0x8aad4796ee95aefc"
60
+ "hash": "0x1ba2a4358eeb29bc"
61
+ },
62
+ {
63
+ "path": "doc/de/guides/jira-sync-guide.md",
64
+ "hash": "0xbd71d31ec2a859f2"
57
65
  },
58
66
  {
59
67
  "path": "doc/de/guides/pm-repo-guide.md",
60
- "hash": "0xc8cea8510f77c619"
68
+ "hash": "0x77e569640671c489"
61
69
  },
62
70
  {
63
71
  "path": "doc/de/guides/report-guide.md",
@@ -73,11 +81,15 @@
73
81
  },
74
82
  {
75
83
  "path": "doc/en/guides/jira-export-guide.md",
76
- "hash": "0xf193cb083b9ea9db"
84
+ "hash": "0x671c903c637cd780"
85
+ },
86
+ {
87
+ "path": "doc/en/guides/jira-sync-guide.md",
88
+ "hash": "0x8ae2b82e956b0302"
77
89
  },
78
90
  {
79
91
  "path": "doc/en/guides/pm-repo-guide.md",
80
- "hash": "0x49f8b8ea873a8383"
92
+ "hash": "0xd44b4ffc9598874d"
81
93
  },
82
94
  {
83
95
  "path": "doc/en/guides/report-guide.md",
@@ -93,11 +105,15 @@
93
105
  },
94
106
  {
95
107
  "path": "doc/fa/guides/jira-export-guide.md",
96
- "hash": "0x091f03b8be44ae2e"
108
+ "hash": "0xad9b378af3cbe853"
109
+ },
110
+ {
111
+ "path": "doc/fa/guides/jira-sync-guide.md",
112
+ "hash": "0xa1848515a324842b"
97
113
  },
98
114
  {
99
115
  "path": "doc/fa/guides/pm-repo-guide.md",
100
- "hash": "0x14ba1c4f72447f9b"
116
+ "hash": "0xb7c0049092101305"
101
117
  },
102
118
  {
103
119
  "path": "doc/fa/guides/report-guide.md",
@@ -110,6 +126,10 @@
110
126
  {
111
127
  "path": "doc/fa/guides/schedule-guide.md",
112
128
  "hash": "0xf3f2d9ee28a92072"
129
+ },
130
+ {
131
+ "path": "scripts/jira-sync.js",
132
+ "hash": "0x4eb945f90d48f359"
113
133
  }
114
134
  ]
115
135
  }
@@ -19,6 +19,9 @@ Reihenfolge des Plans.
19
19
  ist der Vorname in Kleinbuchstaben und Kebab-Case, `<quarter>` der
20
20
  aktuelle Quartalsordner `<yyyy>-Q<n>`
21
21
  - Er enthält nur Tickets, die noch nicht in Jira sind, siehe unten
22
+ - Ein Repo, das seine Stories mit Jira abgleicht, es hat `jira.jsonc`,
23
+ exportiert keine Tickets: Nur Stories gehen nach Jira, siehe den
24
+ [Leitfaden Jira-Sync](jira-sync-guide.md)
22
25
  - Er weist Tickets nur zum Zeitpunkt des Exports zu: Wer an einem Ticket
23
26
  arbeitet, wird nie in die Ticket-Datei geschrieben
24
27
  - Er braucht das Team: Fehlt `team/people.md` im aktuellen Quartal, lege
@@ -0,0 +1,195 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) dnaCopyrightHolder
4
+
5
+ Use of this source code is governed by terms that can be
6
+ found in the LICENSE file in the root of this package.
7
+ -->
8
+
9
+ # Leitfaden Jira-Sync
10
+
11
+ Wie die User Stories eines PM-Repos mit Jira im Gleichschritt bleiben, in
12
+ beide Richtungen. Das Repo bleibt die Quelle der Wahrheit; in Jira lesen
13
+ die Stakeholder die Stories, und dort werden die Sprints geplant.
14
+
15
+ ## @what Wissen, was nach Jira geht <a id="know-what-goes-to-jira"></a>
16
+
17
+ - Nur User Stories gehen nach Jira: die Dateien in
18
+ `pm/<lang>/<quarter>/stories` des aktuellen Quartals, ohne
19
+ `000-index.md`. Tickets bleiben im Repo; eine Story verlinkt ihre Tickets
20
+ - Jede Story ist ein Vorgang in Jira. Der Vorgang trägt das Label des
21
+ Repos, daran erkennt der Sync, welche Vorgänge zu ihm gehören
22
+ - Der Text, der nach Jira geht, kommt aus einer Sprachfassung, festgelegt
23
+ in `jira.jsonc`; die anderen Fassungen folgen per Übersetzung
24
+ - Den Sync startet der Product Owner oder die Projektleitung, nie ein
25
+ Entwickler. Sie sehen jede neue Story, bevor sie Jira erreicht, und
26
+ entscheiden, welche Änderungen aus Jira ins Repo kommen
27
+ - In Jira angelegte Stories kommen auch ins Repo: Der Sync listet sie
28
+ auf, und sie bekommen eine Datei in jeder Sprache
29
+
30
+ ## @setup Ihn einrichten <a id="set-it-up"></a>
31
+
32
+ - Lege in Jira einen Personal Access Token an: Profil → Personal Access
33
+ Tokens → Create token. Setze ihn als Umgebungsvariable `JIRA_TOKEN` der
34
+ Person, die den Sync startet; schreibe ihn nie ins Repo. Der Sync
35
+ arbeitet mit Jira Data Center und Server
36
+ - Trage den Jira-Namen jeder Person in `team/people.md` ein, als Feld
37
+ `Jira`, siehe den [Leitfaden PM-Repo](pm-repo-guide.md#know-the-team).
38
+ Darüber macht der Sync aus dem Lead einer Story den Bearbeiter des
39
+ Vorgangs und umgekehrt
40
+ - Lege `jira.jsonc` im Wurzelordner des Repos an:
41
+
42
+ ```jsonc
43
+ {
44
+ "baseUrl": "https://jira.example.com",
45
+ "project": "ABC",
46
+ "issueType": "Story",
47
+ "label": "sample_pm",
48
+ "language": "de",
49
+ "sprint": 42,
50
+ "repoUrl": "https://dev.azure.com/org/project/_git/sample_pm",
51
+ "repoBranch": "main",
52
+ "fields": {
53
+ "acceptanceCriteria": "customfield_14800",
54
+ "sprint": "customfield_13800",
55
+ "estimate": null,
56
+ },
57
+ "sections": {
58
+ "status": "Status",
59
+ "acceptanceCriteria": "Akzeptanzkriterien",
60
+ "description": ["Story", "Noch nicht", "Tickets", "Zahlt ein auf", "Fragen"],
61
+ },
62
+ "statusFields": {
63
+ "jira": "Jira",
64
+ "status": "Status",
65
+ "sprint": "Sprint",
66
+ "lead": "Lead",
67
+ "estimate": "Schätzung",
68
+ },
69
+ "statuses": {
70
+ "Entwurf": "Eingegangen",
71
+ "in Arbeit": "In Progress",
72
+ "done": ["In Progress", "Done"],
73
+ },
74
+ "footer": "Quelle: {link} im Projektmanagement-Repo.",
75
+ }
76
+ ```
77
+
78
+ - `baseUrl`, `project`, `issueType` — der Jira-Server, der
79
+ Projektschlüssel und der Vorgangstyp einer Story
80
+ - `label` — kennzeichnet die Vorgänge dieses Repos; meist der Name des
81
+ Repos
82
+ - `language` — die Sprachfassung, deren Text nach Jira geht; Standard ist
83
+ der erste Ordner in `pm`
84
+ - `sprint` — die ID des Sprints, in den eine neue Story kommt; `null` für
85
+ keinen. Danach werden die Sprints in Jira geplant
86
+ - `repoUrl`, `repoBranch` — wohin die Links in Jira führen: Azure DevOps
87
+ oder GitHub
88
+ - `fields` — die IDs der eigenen Felder für die Akzeptanzkriterien, den
89
+ Sprint und die Schätzung; `null` lässt eines weg. Ohne Feld für die
90
+ Akzeptanzkriterien kommen sie in die Beschreibung
91
+ - `sections` — die Abschnittsnamen einer Story in der Sprache von
92
+ `language`: die Status-Tabelle, die Akzeptanzkriterien und die
93
+ Abschnitte, aus denen die Beschreibung besteht, in dieser Reihenfolge
94
+ - `statusFields` — die Feldnamen der Status-Tabelle
95
+ - `statuses` — der Jira-Status zu jedem Status einer Story. Wo Jira keinen
96
+ direkten Übergang anbietet, gib den Weg an, z. B. `["In Progress",
97
+ "Done"]`
98
+ - `footer` — die letzte Zeile der Beschreibung; `{link}` ist der Link auf
99
+ die Story-Datei
100
+ - Lies die IDs aus Jira, über eine Jira-Verbindung wie den
101
+ Atlassian-MCP-Server oder die REST-API: `/rest/api/2/field` listet die
102
+ Felder, `/rest/api/2/issue/createmeta/<project>/issuetypes` die Felder
103
+ einer Story, das Board listet seine Sprints mit ihren IDs
104
+
105
+ ## @issue Wissen, was aus einer Story in Jira wird <a id="know-what-a-story-becomes-in-jira"></a>
106
+
107
+ | Story | Jira |
108
+ | --- | --- |
109
+ | Titel, samt Prefix | Zusammenfassung |
110
+ | Die Abschnitte aus `sections.description` | Beschreibung, in Wiki-Markup, eine Überschrift je Abschnitt |
111
+ | Akzeptanzkriterien | Ein eigenes Feld; Checkboxen werden `☐` und `☑` |
112
+ | Lead | Bearbeiter, über die Jira-Namen aus `team/people.md` |
113
+ | Status | Jira-Status, entlang des Wegs aus `statuses` |
114
+ | Schätzung | Das Feld `fields.estimate`, wenn gesetzt |
115
+ | Die Datei | Ein Remote Link auf die Datei, und die Fußzeile |
116
+ | Was übertragen wurde | Eine unsichtbare Issue Property `pmRepo` mit dem Pfad und den Hashes beider Seiten |
117
+
118
+ - Links der Story führen auf die Dateien des Repos
119
+ - Die Status-Tabelle, die DoR und jeder Abschnitt, der nicht in
120
+ `sections.description` steht, bleiben im Repo
121
+ - Jira behält, was dort geplant wird: den Sprint, nach dem ersten Push
122
+
123
+ ## @states Die Zustände lesen <a id="read-the-states"></a>
124
+
125
+ `node scripts/jira-sync.js status` listet jede Story auf und ändert
126
+ nichts:
127
+
128
+ - `new in repo` — die Story hat noch keine Jira-Nummer
129
+ - `changed in repo` — die Datei hat sich seit dem letzten Sync geändert
130
+ - `changed in Jira` — der Vorgang hat sich seit dem letzten Sync geändert
131
+ - `conflict` — beide haben sich geändert
132
+ - `not linked yet` — die Story nennt eine Jira-Nummer, aber der Sync hat
133
+ diesen Vorgang noch nie geschrieben
134
+ - `new in Jira` — ein Vorgang mit dem Label des Repos, zu dem es keine
135
+ Story-Datei gibt
136
+ - `missing in Jira` — die Story nennt einen Vorgang, den es nicht gibt
137
+ - `in sync` — nichts zu tun
138
+
139
+ ## @run Einen Sync durchführen <a id="run-a-sync"></a>
140
+
141
+ `/gg-plan-jira-sync` führt diese Schritte aus:
142
+
143
+ 1. `node scripts/jira-sync.js status` — sehen, wo jede Story steht
144
+ 2. `node scripts/jira-sync.js pull` — sehen, was sich in Jira geändert
145
+ hat: die geänderten Felder, dazu die Beschreibung und die
146
+ Akzeptanzkriterien als Markdown-Entwürfe. `pull --write` übernimmt den
147
+ Sprint und den Lead in jede Sprachfassung
148
+ 3. Jede andere Änderung aus Jira in die Story einarbeiten, in jeder
149
+ Sprachfassung; für jede Story, die neu in Jira ist, eine Story-Datei
150
+ schreiben, benannt `<key>-<title>.md` in Kleinbuchstaben, mit dem
151
+ Schlüssel im Feld `Jira`
152
+ 4. `node scripts/jira-sync.js push` — sehen, was nach Jira ginge. Der
153
+ Product Owner oder die Projektleitung gibt es frei, Story für Story
154
+ 5. `node scripts/jira-sync.js push <files> --resolved <file> --write` —
155
+ die freigegebenen Stories senden; `--resolved` nennt jede Story, deren
156
+ Änderungen aus Jira in Schritt 3 eingearbeitet wurden
157
+ 6. Die geänderten Story-Dateien committen wie jede andere Änderung des
158
+ Repos
159
+
160
+ - Der Token erscheint nie in der Ausgabe, im Repo oder im Commit
161
+ - Eine Story, die sich in Jira geändert hat, wird ohne `--resolved` nicht
162
+ gesendet; so geht keine Änderung aus Jira verloren
163
+
164
+ ## @numbers Einer neuen Story ihre Jira-Nummer geben <a id="give-a-new-story-its-jira-number"></a>
165
+
166
+ - Eine neue Story hat eine vorläufige Nummer, z. B. `004`
167
+ - Der erste Push legt den Vorgang an und ersetzt die Nummer durch den
168
+ Jira-Schlüssel: im Dateinamen jeder Sprachfassung, `<key>-<title>.md` in
169
+ Kleinbuchstaben, in der Titelzeile, im Feld `Jira` als Link auf den
170
+ Vorgang und in jedem Link und jeder Index-Zeile, die auf die Story zeigt
171
+ - Stories und Tickets werden getrennt gezählt: Der Jira-Schlüssel ersetzt
172
+ nur die Nummer einer Story
173
+
174
+ ## @conflicts Einen Konflikt auflösen <a id="resolve-a-conflict"></a>
175
+
176
+ - Ein Konflikt heißt: Die Story und der Vorgang haben sich beide seit dem
177
+ letzten Sync geändert. Der Sync entscheidet nichts: Er zeigt beides
178
+ - Lies die Änderungen aus `pull`, vergleiche sie mit der Datei und frage
179
+ den Product Owner oder die Projektleitung Punkt für Punkt, welche Seite
180
+ gilt
181
+ - Schreibe das Ergebnis in jede Sprachfassung und sende die Story dann mit
182
+ `--resolved`; danach hält Jira die zusammengeführte Story
183
+ - Ein in Jira von Hand geänderter Status ist ebenfalls ein Konflikt: Der
184
+ Status einer Story kommt aus dem Repo
185
+
186
+ ## @limits Die Grenzen kennen <a id="know-the-limits"></a>
187
+
188
+ - Jira Cloud wird nicht unterstützt: Es braucht eine E-Mail-Adresse und
189
+ einen API-Token statt eines Personal Access Tokens
190
+ - In Jira getippter Text kommt oft als HTML an; `pull` macht daraus einen
191
+ Markdown-Entwurf, der gelesen werden muss, bevor er in die Story geht
192
+ - Der Sync legt keine Sprints und keine Epics an; er setzt nur den Sprint
193
+ einer neuen Story
194
+ - Eine Story eines älteren Quartals wird nicht abgeglichen: Nur das
195
+ aktuelle Quartal zählt
@@ -59,6 +59,9 @@ root
59
59
  | | | | |-anna.md
60
60
  | | | |-requirements
61
61
  | | | | |-results.md
62
+ | | | |-stories
63
+ | | | | |-000-index.md
64
+ | | | | |-abc-7-anna-sees-the-results.md
62
65
  | | | |-team
63
66
  | | | | |-people.md
64
67
  | | | | |-roles.md
@@ -69,6 +72,7 @@ root
69
72
  | |-de
70
73
  | | |-2026-Q3
71
74
  | | | |-...
75
+ |-jira.jsonc
72
76
  |-README.md
73
77
  |-README.de.md
74
78
  ```
@@ -87,6 +91,8 @@ root
87
91
  [Ein Quartal beginnen](#start-a-quarter)
88
92
  - `doc/<lang>/guides` und `doc/<lang>/templates` kommen aus den
89
93
  DNA-Schichten; bearbeite sie nie
94
+ - `jira.jsonc` — die Einstellungen des Jira-Syncs, nur in einem Repo,
95
+ das seine Stories abgleicht
90
96
  - `README.md` nennt das Projekt und verlinkt das aktuelle Quartal, seine
91
97
  aktiven Ziele und seine Anforderungen
92
98
  - `architecture` — das Zielbild des Systems: `architecture.md` plus
@@ -113,6 +119,9 @@ root
113
119
  sind, siehe [Den Menschen berichten](#report-to-the-people)
114
120
  - `requirements` — was das Produkt tun oder sein muss; eine Datei pro
115
121
  Bereich, siehe unten
122
+ - `stories` — eine Datei pro User Story, `000-index.md` listet sie
123
+ auf; nur Stories gehen nach Jira, siehe
124
+ [Die Stories mit Jira abgleichen](#sync-the-stories-with-jira)
116
125
  - `team` — wer am Projekt arbeitet und in welchen Rollen, siehe
117
126
  [Das Team kennen](#know-the-team)
118
127
  - `tickets` — eine Plan-Datei pro Ticket
@@ -406,6 +415,22 @@ root
406
415
  anhand der Schätzungen und schreibt die Datei
407
416
  - Die Person wird nur zum Zeitpunkt des Exports zugewiesen, nie in der
408
417
  Ticket-Datei
418
+ - Ein Repo, das seine Stories mit Jira abgleicht, es hat `jira.jsonc`,
419
+ exportiert keine Tickets: Nur Stories gehen nach Jira
420
+
421
+ ## @jira-sync Die Stories mit Jira abgleichen <a id="sync-the-stories-with-jira"></a>
422
+
423
+ - Nur User Stories gehen nach Jira; Tickets bleiben im Repo, und eine
424
+ Story verlinkt ihre Tickets
425
+ - Der [Leitfaden Jira-Sync](jira-sync-guide.md) sagt, wie,
426
+ `/gg-plan-jira-sync` führt ihn aus: Er zeigt, was auf jeder Seite neu
427
+ ist oder sich geändert hat, arbeitet die Änderungen aus Jira in die
428
+ Stories ein, lässt den Product Owner freigeben, was nach Jira geht, und
429
+ überträgt es mit `scripts/jira-sync.js`
430
+ - Den Sync startet der Product Owner oder die Projektleitung, nie ein
431
+ Entwickler
432
+ - Eine neue Story bekommt den Schlüssel, den Jira ihr gibt, in ihren
433
+ Dateinamen, ihre Titelzeile und jeden Link auf sie
409
434
 
410
435
  ## @layers Die Design-Schichten nutzen <a id="use-the-design-layers"></a>
411
436
 
@@ -18,6 +18,9 @@ file that Jira imports: one sprint's worth, in the order of the plan.
18
18
  the first name in lower case kebab case, `<quarter>` the current
19
19
  quarter folder `<yyyy>-Q<n>`
20
20
  - It holds only tickets that are not in Jira yet, see below
21
+ - A repo that syncs its stories with Jira, it has `jira.jsonc`, exports
22
+ no tickets: only stories go to Jira, see the
23
+ [Jira sync guide](jira-sync-guide.md)
21
24
  - It assigns tickets at export time only: who works on a ticket is never
22
25
  written into the ticket file
23
26
  - It needs the team: without `team/people.md` in the current quarter,
@@ -0,0 +1,189 @@
1
+ <!--
2
+ @license
3
+ Copyright (c) dnaCopyrightHolder
4
+
5
+ Use of this source code is governed by terms that can be
6
+ found in the LICENSE file in the root of this package.
7
+ -->
8
+
9
+ # Jira sync guide
10
+
11
+ How the user stories of a PM repo are kept in step with Jira, in both
12
+ directions. The repo stays the source of truth; Jira is where the
13
+ stakeholders read the stories and where the sprints are planned.
14
+
15
+ ## @what Know what goes to Jira
16
+
17
+ - Only user stories go to Jira: the files in
18
+ `pm/<lang>/<quarter>/stories` of the current quarter, without
19
+ `000-index.md`. Tickets stay in the repo; a story links its tickets
20
+ - Each story is one issue in Jira. The issue carries the label of the
21
+ repo, which tells the sync which issues belong to it
22
+ - The text that goes to Jira comes from one language copy, set in
23
+ `jira.jsonc`; the other copies follow by translation
24
+ - The Product Owner or the project lead runs the sync, never a developer.
25
+ They see every new story before it reaches Jira and decide what Jira
26
+ changes go into the repo
27
+ - Stories made in Jira come into the repo too: the sync lists them, and
28
+ they get a file in every language
29
+
30
+ ## @setup Set it up
31
+
32
+ - Create a personal access token in Jira: profile → Personal Access
33
+ Tokens → Create token. Set it as the environment variable `JIRA_TOKEN`
34
+ of the person who runs the sync; never write it into the repo. The sync
35
+ works with Jira Data Center and Server
36
+ - Write the Jira name of each person into `team/people.md`, as the field
37
+ `Jira`, see the [PM repo guide](pm-repo-guide.md#know-the-team). The sync
38
+ turns the lead of a story into the assignee of the issue and back by it
39
+ - Create `jira.jsonc` at the root of the repo:
40
+
41
+ ```jsonc
42
+ {
43
+ "baseUrl": "https://jira.example.com",
44
+ "project": "ABC",
45
+ "issueType": "Story",
46
+ "label": "sample_pm",
47
+ "language": "de",
48
+ "sprint": 42,
49
+ "repoUrl": "https://dev.azure.com/org/project/_git/sample_pm",
50
+ "repoBranch": "main",
51
+ "fields": {
52
+ "acceptanceCriteria": "customfield_14800",
53
+ "sprint": "customfield_13800",
54
+ "estimate": null,
55
+ },
56
+ "sections": {
57
+ "status": "Status",
58
+ "acceptanceCriteria": "Akzeptanzkriterien",
59
+ "description": ["Story", "Noch nicht", "Tickets", "Zahlt ein auf", "Fragen"],
60
+ },
61
+ "statusFields": {
62
+ "jira": "Jira",
63
+ "status": "Status",
64
+ "sprint": "Sprint",
65
+ "lead": "Lead",
66
+ "estimate": "Schätzung",
67
+ },
68
+ "statuses": {
69
+ "Entwurf": "Eingegangen",
70
+ "in Arbeit": "In Progress",
71
+ "done": ["In Progress", "Done"],
72
+ },
73
+ "footer": "Quelle: {link} im Projektmanagement-Repo.",
74
+ }
75
+ ```
76
+
77
+ - `baseUrl`, `project`, `issueType` — the Jira server, the project key and
78
+ the issue type of a story
79
+ - `label` — marks the issues of this repo; usually the name of the repo
80
+ - `language` — the language copy whose text goes to Jira; default the
81
+ first folder in `pm`
82
+ - `sprint` — the ID of the sprint a new story goes into; `null` for none.
83
+ After that, the sprints are planned in Jira
84
+ - `repoUrl`, `repoBranch` — where the links in Jira lead: Azure DevOps or
85
+ GitHub
86
+ - `fields` — the IDs of the custom fields for the acceptance criteria,
87
+ the sprint and the estimate; `null` leaves one out. Without a field for
88
+ the acceptance criteria they go into the description
89
+ - `sections` — the section names of a story in the language of
90
+ `language`: the status table, the acceptance criteria, and the sections
91
+ that make up the description, in this order
92
+ - `statusFields` — the field names of the status table
93
+ - `statuses` — the Jira status for each status of a story. Where Jira
94
+ offers no direct transition, give the path, e.g. `["In Progress",
95
+ "Done"]`
96
+ - `footer` — the last line of the description; `{link}` is the link to
97
+ the story file
98
+ - Read the IDs from Jira, through a Jira connection such as the Atlassian
99
+ MCP server or the REST API: `/rest/api/2/field` lists the fields,
100
+ `/rest/api/2/issue/createmeta/<project>/issuetypes` the fields of a
101
+ story, the board lists its sprints with their IDs
102
+
103
+ ## @issue Know what a story becomes in Jira
104
+
105
+ | Story | Jira |
106
+ | --- | --- |
107
+ | Title, prefix included | Summary |
108
+ | The sections of `sections.description` | Description, in wiki markup, one heading per section |
109
+ | Acceptance criteria | Their own field; checkboxes become `☐` and `☑` |
110
+ | Lead | Assignee, by the Jira names of `team/people.md` |
111
+ | Status | Jira status, along the path of `statuses` |
112
+ | Estimate | The field `fields.estimate`, if set |
113
+ | The file | A remote link to the file, and the footer |
114
+ | What was synced | An invisible issue property `pmRepo` with the path and hashes of both sides |
115
+
116
+ - Links of the story lead to the files of the repo
117
+ - The status table, the DoR and every section not named in
118
+ `sections.description` stay in the repo
119
+ - Jira keeps what is planned there: the sprint, after the first push
120
+
121
+ ## @states Read the states
122
+
123
+ `node scripts/jira-sync.js status` lists every story and changes nothing:
124
+
125
+ - `new in repo` — the story has no Jira number yet
126
+ - `changed in repo` — the file changed since the last sync
127
+ - `changed in Jira` — the issue changed since the last sync
128
+ - `conflict` — both changed
129
+ - `not linked yet` — the story names a Jira number, but the sync has
130
+ never written that issue
131
+ - `new in Jira` — an issue with the label of the repo that has no story
132
+ file
133
+ - `missing in Jira` — the story names an issue that does not exist
134
+ - `in sync` — nothing to do
135
+
136
+ ## @run Run a sync
137
+
138
+ `/gg-plan-jira-sync` runs these steps:
139
+
140
+ 1. `node scripts/jira-sync.js status` — see where each story stands
141
+ 2. `node scripts/jira-sync.js pull` — see what changed in Jira: the
142
+ changed fields, and the description and the acceptance criteria as
143
+ Markdown drafts. `pull --write` takes over the sprint and the lead
144
+ into every language copy
145
+ 3. Work every other change from Jira into the story, in every language
146
+ copy; write a story file for each story that is new in Jira, named
147
+ `<key>-<title>.md` in lower case, with the key in the field `Jira`
148
+ 4. `node scripts/jira-sync.js push` — see what would go to Jira. The
149
+ Product Owner or the project lead approves it, story by story
150
+ 5. `node scripts/jira-sync.js push <files> --resolved <file> --write` —
151
+ send the approved stories; `--resolved` names each story whose Jira
152
+ changes were worked in in step 3
153
+ 6. Commit the changed story files like every other change of the repo
154
+
155
+ - The token never appears in the output, the repo or the commit
156
+ - A story that changed in Jira is not pushed without `--resolved`, so no
157
+ change made in Jira is lost
158
+
159
+ ## @numbers Give a new story its Jira number
160
+
161
+ - A new story has a preliminary number, e.g. `004`
162
+ - The first push creates the issue and replaces the number with the Jira
163
+ key: in the file name of every language copy, `<key>-<title>.md` in
164
+ lower case, in the title line, in the field `Jira` as a link to the
165
+ issue, and in every link and index row that points to the story
166
+ - Stories and tickets are numbered apart: the Jira key replaces only the
167
+ number of a story
168
+
169
+ ## @conflicts Resolve a conflict
170
+
171
+ - A conflict means the story and the issue both changed since the last
172
+ sync. The sync decides nothing: it shows both
173
+ - Read the changes of `pull`, compare them with the file and ask the
174
+ Product Owner or the project lead which wins, point by point
175
+ - Write the result into every language copy, then push the story with
176
+ `--resolved`; Jira then holds the merged story
177
+ - A status changed by hand in Jira is a conflict too: the status of a
178
+ story comes from the repo
179
+
180
+ ## @limits Know the limits
181
+
182
+ - Jira Cloud is not supported: it needs an e-mail address and an API
183
+ token instead of a personal access token
184
+ - Text typed in Jira often arrives as HTML; `pull` turns it into a
185
+ Markdown draft that needs a read before it goes into the story
186
+ - The sync creates no sprints and no epics; it sets the sprint of a new
187
+ story only
188
+ - A story of an older quarter is not synced: only the current quarter
189
+ counts
@@ -58,6 +58,9 @@ root
58
58
  | | | | |-anna.md
59
59
  | | | |-requirements
60
60
  | | | | |-results.md
61
+ | | | |-stories
62
+ | | | | |-000-index.md
63
+ | | | | |-abc-7-anna-sees-the-results.md
61
64
  | | | |-team
62
65
  | | | | |-people.md
63
66
  | | | | |-roles.md
@@ -68,6 +71,7 @@ root
68
71
  | |-de
69
72
  | | |-2026-Q3
70
73
  | | | |-...
74
+ |-jira.jsonc
71
75
  |-README.md
72
76
  |-README.de.md
73
77
  ```
@@ -86,6 +90,8 @@ root
86
90
  see [Start a quarter](#start-a-quarter)
87
91
  - `doc/<lang>/guides` and `doc/<lang>/templates` come from the DNA layers;
88
92
  never edit them
93
+ - `jira.jsonc` — the settings of the Jira sync, only in a repo that
94
+ syncs its stories
89
95
  - `README.md` names the project and links to the current quarter, its
90
96
  active goals and its requirements
91
97
  - `architecture` — the target picture of the system: `architecture.md`
@@ -109,6 +115,9 @@ root
109
115
  [Report to the people](#report-to-the-people)
110
116
  - `requirements` — what the product must do or be; one file per area,
111
117
  see below
118
+ - `stories` — one file per user story, `000-index.md` lists them;
119
+ only stories go to Jira, see
120
+ [Sync the stories with Jira](#sync-the-stories-with-jira)
112
121
  - `team` — who works on the project and in which roles, see
113
122
  [Know the team](#know-the-team)
114
123
  - `tickets` — one plan file per ticket
@@ -384,6 +393,21 @@ root
384
393
  key to the person by their areas, fills one sprint by the estimates and
385
394
  writes the file
386
395
  - The person is assigned at export time only, never in the ticket file
396
+ - A repo that syncs its stories with Jira, it has `jira.jsonc`,
397
+ exports no tickets: only stories go to Jira
398
+
399
+ ## @jira-sync Sync the stories with Jira
400
+
401
+ - Only user stories go to Jira; tickets stay in the repo, and a story
402
+ links its tickets
403
+ - The [Jira sync guide](jira-sync-guide.md) says how,
404
+ `/gg-plan-jira-sync` runs it: it shows what is new or changed on each
405
+ side, works the Jira changes into the stories, lets the Product Owner
406
+ approve what goes to Jira and pushes it with `scripts/jira-sync.js`
407
+ - The Product Owner or the project lead runs the sync, never a
408
+ developer
409
+ - A new story gets the key Jira gives it in its file name, its title
410
+ line and every link to it
387
411
 
388
412
  ## @layers Use the design layers
389
413
 
@@ -19,6 +19,9 @@ CSV خروجی گرفته می‌شود تا Jira آن را وارد کند: ب
19
19
  نام کوچک با حروف کوچک و به شکل kebab case است، `<quarter>` پوشهٔ فصل
20
20
  جاری `<yyyy>-Q<n>`
21
21
  - فقط تیکت‌هایی را در بر دارد که هنوز در Jira نیستند، پایین‌تر را ببین
22
+ - ریپویی که استوری‌هایش را با Jira همگام می‌کند، یعنی `jira.jsonc` دارد،
23
+ تیکتی صادر نمی‌کند: فقط استوری‌ها به Jira می‌روند،
24
+ [راهنمای همگام‌سازی Jira](jira-sync-guide.md) را ببین
22
25
  - تیکت‌ها را فقط هنگام خروجی گرفتن واگذار می‌کند: این‌که چه کسی روی یک تیکت
23
26
  کار می‌کند هرگز در فایل تیکت نوشته نمی‌شود
24
27
  - به تیم نیاز دارد: اگر `team/people.md` در فصل جاری نیست، ابتدا آن را با