Imports into Duccio (the second brain) the project knowledge contained in Jira and Confluence (pages of the spaces, epics and tickets of the user for the projects linked to the hubs), creating or updating note, decision and meeting notes with the link to the page or the issue, without copying them. Use when the user asks to import, index or process Jira or Confluence, for all the projects or for some of them.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Import Atlassian?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrycaos-import-atlassian)
---
name: import-atlassian
description: Imports into Duccio (the second brain) the project knowledge contained in Jira and Confluence (pages of the spaces, epics and tickets of the user for the projects linked to the hubs), creating or updating note, decision and meeting notes with the link to the page or the issue, without copying them. Use when the user asks to import, index or process Jira or Confluence, for all the projects or for some of them.
---
# import-atlassian
Work from the repo root. Apply the "Writing rules" and "Git protocol" sections of `AGENTS.md`. Folder names and headings below are the English ones; in a vault of another language use the matching names from the table in "Vault language". Jira and Confluence are read-only: no comments, edits, transitions or new pages.
These operations of the agent's Atlassian tool are needed: Jira issue search with JQL, reading an issue with its comments, Confluence search with CQL, listing the spaces by key, listing the pages of a space, reading a page. If they are not available, say so and stop. The instance is in `config/atlassian.yaml`: `cloud` is the URL of the Atlassian Cloud site (below `<cloud>`); `datacenter_jira` and `datacenter_confluence` are the hosts of the company's Data Center, if any, which is out of scope. If `cloud` is still `https://example.atlassian.net`, ask the user for the URL of their site and write it in the file before continuing. Links to the Data Center that you find in the contents are not followed or imported either, and their keys are not keys that emerged from the contents (step 2): report them only in the summary (step 8).
Large tool outputs (inventory, lists of issues or pages) often do not fit in the context and the tool saves them to a file. Read them from that file with `.venv/bin/python` and extract only the fields you need, in compact lines. Always use `.venv/bin/python`, never `python3`: outside the repo, with asdf, `python3` may have no version.
Pages and issues are not copied into the vault: only the extracted knowledge goes in, and nothing is archived in `raw/`. `sources:` gets the URL of the item in canonical form:
- Confluence page: `<cloud>/wiki/spaces/<SPACE>/pages/<id>`, built from the space key and the page id, because the page list of step 3 does not return the web link. The title slug at the end is optional (Confluence redirects without it too): links with the slug already in the vault remain valid;
- Jira issue: `<cloud>/browse/<KEY-N>`.
A page is always recognized by its id, with or without slug, which can also be derived from the short links `/wiki/x/<tiny>` and from `viewpage.action?pageId=<id>`; an issue is recognized by its key. If the tool returns a link in another form, build the canonical one.
## 0. Input and scope
- `DATE` "updated since" (`YYYY-MM-DD`), optional: if the user does not give it, everything counts. Do not ask for it.
- A subset of hubs (names of the hub files, e.g. `Portale B2B`), optional. The scope of the run is that subset or, if missing, all the hubs that after step 2 have keys in `jira` or `confluence_spaces`. The order of the scope is the one given by the user, otherwise the one in which the command of step 2 lists the hubs.
- Extra keys, optional: Jira projects or Confluence spaces that the user wants to consider even if the inventory of step 2 does not find them (the inventory only sees where the user appears). They enter the inventory of step 2.
No state is saved between runs: a repeated run skips what is already in the vault ("Already imported"). Do steps 1–2 once, steps 3–6 for each hub in the scope, steps 7–8 at the end of the run.
## Items already in the vault
This command serves routing and "Already imported". Pass the items separated by spaces: issue keys (`PB-12`), project keys (`PB`), page ids (`123456789`) or their URLs, including short ones. To each item you can append `@` and the last-updated date as the tool returns it (`PB-12@2026-01-30T10:12:31.114+0100`), or `@YYYY-MM-DD` if the tool gives only the day (convert localized dates: `May 11, 2026` → `2026-05-11`).
```bash
ITEMS="<item>@<updated> …" .venv/bin/python - <<'EOF'
import base64, os, re, subprocess, sys
from datetime import datetime
from pathlib import Path
sys.path.insert(0, "scripts")
import sbconfig
import yaml
# configuration: vault language (folder names)
try:
code = sbconfig.language()
if code is None:
sys.exit("vault language not configured: run scripts/setup.sh")
vocab = sbconfig.vocabulary(code)
folders = vocab.folders
except sbconfig.ConfigError as exc:
sys.exit(str(exc))
ISSUE = re.compile(r"/browse/([A-Z][A-Z0-9_]*-\d+)")
PROJECT = re.compile(r"/browse/([A-Z][A-Z0-9_]*)(?![\w-])")
PAGE = re.compile(r"/wiki/spaces/[^/]+/pages/(\d+)|[?&]pageId=(\d+)|/wiki/x/([\w-]+)")
prefixes = "|".join(re.escape(fmt.split("{", 1)[0]) for fmt in vocab.names.values()) # e.g. "Epic map |Tickets of "
SUMMARY = re.compile(rf"^\d{{4}}-\d{{2}}-\d{{2}} (?:{prefixes}).+ \(([A-Z][A-Z0-9_]*)\)$")
def tiny(t): # short link: page id little-endian in base64, with - and _ in place of / and +
s = t.replace("-", "/").replace("_", "+")
return str(int.from_bytes(base64.b64decode(s + "A" * (-len(s) % 4)), "little"))
def ids(text):
found = set(ISSUE.findall(text)) | set(PROJECT.findall(text))
return found | {page or query or tiny(short) for page, query, short in PAGE.findall(text)}
def hub(path):
p = path.parts
return p[4] if len(p) > 5 and p[3] == folders["projects"] else f"client {p[2]}" if p[1] == folders["clients"] else "-"
rows = {}
for path in sorted(Path("vault").rglob("*.md")):
if {"raw", "Templates", ".obsidian", ".trash"} & set(path.parts):
continue
text = path.read_text(encoding="utf-8")
if not text.startswith("---\n"):
continue
end = text.find("\n---", 3)
summary = SUMMARY.match(path.stem)
if summary: # summary note: counts for routing, not for "Already imported"
rows.setdefault(summary[1], []).append(("summary", path))
for key in sorted(set(ISSUE.findall(text[end:]))):
rows.setdefault(key, []).append(("table", path))
continue
for source in (yaml.safe_load(text[4:end]) or {}).get("sources") or []:
for item in ids(str(source)):
rows.setdefault(item, []).append(("source", path))
ignore = {l.strip().upper() for l in Path("config/atlassian-ignore.txt").read_text(encoding="utf-8").splitlines()
if l.strip() and not l.strip().startswith("#")}
for token in os.environ["ITEMS"].split():
item, _, updated = token.partition("@")
item = min(ids(item) or {item}) if "/" in item else item.upper()
if item in ignore:
print(f"{item}\tignored")
for kind, path in rows.get(item, []):
last = subprocess.run(["git", "log", "-1", "--format=%cI", "--", str(path)], capture_output=True, text=True).stdout.strip()
line = f"{item}\t{kind}\t{hub(path)}\t{path}\t{last or 'uncommitted'}"
if updated and last and kind == "source":
commit = datetime.fromisoformat(last)
if len(updated) == 10: # day only: even the same day as the commit counts as changed
changed = datetime.fromisoformat(updated).date() >= commit.date()
else:
changed = datetime.fromisoformat(updated).astimezone() > commit
line += "\tchanged" if changed else "\tunchanged"
print(line)
EOF
```
Each line is `item type hub note last commit of the note [outcome]`. Items without lines are not in the vault.
- type `ignored`: the item is in `config/atlassian-ignore.txt` (the line has only these two fields);
- type `source`: the URL of the item is in the `sources:` of the note;
- type `table`: the issue appears in the table of a summary note (steps 4 and 5);
- type `summary`: for a project key, one of its summary notes;
- hub: the hub that contains the note, or `client <C>` for client-level notes;
- last commit: `git log -1 --format=%cI` of the note, or `uncommitted`;
- outcome, only for `source` with the updated date: `changed` if the item was updated after the last commit of the note (with the day only, even the same day), otherwise `unchanged`.
## Routing
Each key in `jira` and each space in `confluence_spaces` belongs to the hub that lists it. Projects and spaces that are in no hub are not imported. A key shared by several hubs (e.g. SHARED in Portale B2B and App Mobile) is processed only once in the run, with the first hub of the scope that contains it, and each item goes to a single hub.
For each item, in this order:
1. **routing already done**, which is enough on its own: if the command of "Items already in the vault" gives `source` or `table` lines, the item goes to the hub of that note (or stays with the client-level note);
2. if the key belongs to a single hub, it goes to that hub;
3. if it is shared:
- a ticket follows the hub of its epic (a sub-task, that of the parent ticket). If the epic is in another project (e.g. SHARED-25, child of PB-221), the routing of that epic applies, with these same rules. If the epic is not readable with the user's permissions (e.g. PB-91), the ticket is routed with its other signals;
- components and labels;
- the signals of the "7. Route" step of `import-gmail` (`.agents/skills/import-gmail/SKILL.md`): keys, project names and aliases, repos and spaces are enough on their own; domains and people are weak signals;
- a Confluence page without signals of its own follows the nearest ancestor page that has them, going up the chain of `parentId`s of the list of step 3, folders included (step 3, point 1), even among the pages discarded by triage or modified before `DATE`, just as a ticket follows its epic.
**Generic aliases.** An alias that is a generic technical word (e.g. `IAM`, `Checkout`, `Backend` of a hub) is a signal only in the title of the page or the issue, not in the body or description, where it appears by chance (e.g. `iam.acme.com`, `backend-staging`).
If the signals point to different hubs:
- the exact name or an alias of a hub prevails over a partial match with the name of a repo: an epic "Checkout" goes to App Mobile for the alias, not to Portale B2B for the repo `checkout-lib`;
- in a Confluence page the signals in the title prevail over those in the body; if the conflict remains, the main topic of the page decides.
**Client spaces.** A space shared by several hubs of the same client may document the client as a whole (e.g. ACMEDOC, in Portale B2B and App Mobile of Acme). Its pages are routed with the rules above, with one difference: a page with no project signal at all, neither its own nor from its ancestors (processes, onboarding, team guides), becomes by default a client-level note in `Clients/<C>/Notes/`, without asking, and goes in the summary (step 8). A page with a signal of another hub of the same client follows that hub, even if it does not list the space; only conflicts go to step 7. The frontmatter does not change: it is a normal client-level note.
If no signal is enough (except for the pages of client spaces), or the conflict remains doubtful, the item is **uncertain**: write nothing and keep it for step 7. An item routed to a hub outside the scope is skipped.
## Already imported
Recognition is by URL in `sources:`, never by file name: they are the `source` lines of the command of "Items already in the vault". For each item that has any:
- if the note was created or modified in this run (even `uncommitted`), skip the item;
- if the outcome is `changed`, read the item again and update the note: pages and issues are living documents, unlike emails;
- if it is `unchanged`, skip the item.
The summary notes of steps 4 and 5 do not follow this rule: they are rewritten at every run. In any case a note is modified, gets a Log line and counts in N (step 6) only if its knowledge content really changes. If only the updated date of the item changed (an irrelevant comment, a rank change), touch nothing.
**Items covered by other sources.** An item that is in no `sources:`, but whose knowledge is already in a note derived from another source (e.g. a Gmail thread about the same ticket), does not produce a new note. You can add its URL to the `sources:` of that note with a tracking line (key and dates, e.g. `Tracked on Jira in PB-1550, opened and closed on 18/11/2025.`) even if the knowledge is the same: it is the only edit allowed without new knowledge. Log line and count in N remain only for changes of knowledge.
## Writing
Write the notes without asking for confirmation, following the steps "6. Extract the notes" and "7. Update hubs and client note" of the `process` skill (`.agents/skills/process/SKILL.md`), with these differences:
- add the canonical URL of the item to `sources:` (without removing the sources already there); the hub's Log line ends with `(from [Jira](<url>))` or `(from [Confluence](<url>))` instead of `(from [[raw/archive/…]])`. With several sources list up to three links, `(from [Confluence](<url1>) and [Confluence](<url2>))` or `(from [Confluence](<url1>), [Confluence](<url2>) and [Confluence](<url3>))`; beyond that, the first two and the number of the other sources, of any type: `(from [Confluence](<url1>), [Jira](<url2>) and N other sources)`;
- `date`:
- for a `meeting` the date of the meeting and for a `decision` the date of the decision, if the page or ticket reports it;
- for a `note` derived from a ticket, the date of the outcome, if known (e.g. the comment that closes a spike or an analysis);
- otherwise the creation date of the page (`createdAt` of the list of step 3) or of the ticket;
- **homogeneous pages**: a series of pages of the same type (e.g. the functional specifications of the pages of a portal, periodic reviews) can be merged into a single note, with all the pages in `sources:` and as `date` the creation of the first of the series. A new page of the series updates that note instead of creating another one;
- keys: unlike `process`, do not add to `jira` or `confluence_spaces` of the hubs the keys that emerged from the content (e.g. links to issues of a restricted Jira project); they must be proposed to the user (step 2, "Keys that emerged from the contents");
- **sources may be old**:
- update the hub's `## Status` only with information more recent than what it already reports;
- if you import a decision older (by `date`) than an existing one on the same topic, mark the imported one as `superseded` (with `superseded_by`), not the existing one;
- people: link in `people:` those who already have a note. Create a new person only if the item shows a role in the project (contact person, team member), not for occasional assignees or commenters, and never if they match `config/people-ignore.txt` (email or normalized name). Other names stay plain text;
- the rule on uncommitted changes of `AGENTS.md` applies;
- sensitive data: credentials, tokens, personal data of end clients and HR content do not go in the notes (replace with the redaction marker, `[REDACTED]`; in a vault of another language, the `redacted` value from the table in "Vault language"). There is no archiving choice: nothing is archived;
- attachments and links to other tools are cited in the text, without downloading them;
- an item may produce several notes, or none if on reading it contains no useful knowledge.
## 1. Pull and uncommitted files
Pull according to the Git protocol.
Then look for uncommitted files in the folders of the hubs in the scope (hub, notes, summary notes) and in `People/` and `Technologies/`, for example left by an interrupted run. In `HUBS` put the hubs given by the user, separated by `|`; without a subset leave it empty, and the command checks the hubs that already have keys:
```bash
HUBS="" .venv/bin/python - <<'EOF'
import glob, os, subprocess, sys
sys.path.insert(0, "scripts")
import sbconfig
import yaml
from pathlib import Path
# configuration: vault language (folder names)
try:
code = sbconfig.language()
if code is None:
sys.exit("vault language not configured: run scripts/setup.sh")
folders = sbconfig.vocabulary(code).folders
except sbconfig.ConfigError as exc:
sys.exit(str(exc))
def meta(path):
text = Path(path).read_text(encoding="utf-8")
if not text.startswith("---\n"):
return {}
return yaml.safe_load(text[4:text.find("\n---", 3)]) or {}
wanted = [h.strip() for h in os.environ["HUBS"].split("|") if h.strip()]
hubs = {}
for path in sorted(glob.glob(f"vault/{folders['clients']}/*/{folders['projects']}/*/*.md")):
m = meta(path)
if m.get("type") == "project" and (Path(path).stem in wanted if wanted else m.get("jira") or m.get("confluence_spaces")):
hubs[Path(path).stem] = str(Path(path).parent) + "/"
for h in wanted:
if h not in hubs:
print(f"HUB NOT FOUND {h}")
print("SCOPE " + " | ".join(hubs))
owners = {d: h for h, d in hubs.items()} | {f"vault/{folders['people']}/": folders["people"], f"vault/{folders['tech']}/": folders["tech"]}
out = subprocess.run(["git", "status", "--porcelain", "-z", "--untracked-files=all", "--", *owners],
capture_output=True, text=True, check=True).stdout
fields = iter(out.split("\0"))
for entry in fields:
if not entry:
continue
status, path = entry[:2], entry[3:]
origin = next(fields, "") if status[0] in "RC" else "" # with -z the origin of a rename is the next field
owner = next(h for d, h in owners.items() if path.startswith(d))
print(f"{owner}\t{status}\t{path}" + (f"\t(from {origin})" if origin else ""))
EOF
```
The `SCOPE` line lists the hubs checked; the others are `hub (or People, Technologies) git status path [(from <rename origin>)]`. If there are any, report them once and ask the user whether to:
- **commit them** before proceeding, one commit per project as in step 6; the files of `People/` and `Technologies/` go in the commit of the first project, or, if there are only those, in `import-atlassian: <first hub in the scope> (0 notes)`;
- **discard them**: `git restore --source=HEAD --staged --worktree -- "<path>"` for the files already in git (for a rename, both the path and the origin), `rm -- "<path>"` for the new ones (`??`);
- **skip them**: the hubs involved leave the scope, and the listed notes of `People/` and `Technologies/` are not touched in this run.
Without a subset, the hubs that receive their first keys in step 2 enter the scope after this check: before processing them, run the command again with those hubs in `HUBS`.
## 2. Keys
Keys of the hubs, clients and `config/atlassian-ignore.txt`:
```bash
.venv/bin/python - <<'EOF'
import glob, re, sys
sys.path.insert(0, "scripts")
import sbconfig
import yaml
from pathlib import Path
# configuration: vault language (folder names)
try:
code = sbconfig.language()
if code is None:
sys.exit("vault language not configured: run scripts/setup.sh")
folders = sbconfig.vocabulary(code).folders
except sbconfig.ConfigError as exc:
sys.exit(str(exc))
host = re.escape((yaml.safe_load(Path("config/atlassian.yaml").read_text(encoding="utf-8")) or {}).get("datacenter_confluence") or "")
DC = re.compile(rf"{host}/(?:wiki/)?(?:spaces|display)/([\w~-]+)|{host}/\S*?[?&]spaceKey=([\w~-]+)") if host else None
def read(path):
text = Path(path).read_text(encoding="utf-8")
if not text.startswith("---\n"):
return {}, text
end = text.find("\n---", 3)
return yaml.safe_load(text[4:end]) or {}, text[end:]
active, keys, dc = {}, {}, set()
for path in sorted(glob.glob(f"vault/{folders['clients']}/*/{folders['projects']}/*/*.md")):
m, body = read(path)
if m.get("type") != "project":
continue
hub, client = Path(path).stem, Path(path).parts[2]
if m.get("status") == "active":
active.setdefault(client, []).append(hub)
for field in ("jira", "confluence_spaces"):
for k in m.get(field) or []:
keys.setdefault((field, str(k)), []).append(hub)
dc |= {(a or b, hub) for a, b in DC.findall(body)} if DC else set()
repos = [r.rsplit("/", 1)[-1] for r in m.get("repos") or []]
print(f"HUB {hub} | client {client} | {m.get('status')} | aliases {m.get('aliases') or []} | jira {m.get('jira') or []} "
f"| confluence {m.get('confluence_spaces') or []} | repos {repos} | people {[p.strip('[]') for p in m.get('people') or []]}")
for (field, k), hubs in sorted(keys.items()):
where = [h + (" (Data Center)" if field == "confluence_spaces" and (k, h) in dc else "") for h in hubs]
print(f"KEY {field} {k} -> {', '.join(where)}")
for path in sorted(glob.glob(f"vault/{folders['clients']}/*/*.md")):
m, _ = read(path)
if m.get("type") == "client":
c = Path(path).stem
print(f"CLIENT {c} | domains {m.get('domains') or []} | active projects {active.get(c, [])}")
lines = Path("config/atlassian-ignore.txt").read_text(encoding="utf-8").splitlines()
entries = [l.strip() for l in lines if l.strip() and not l.strip().startswith("#")]
print("IGNORE keys", [e for e in entries if not e.isdigit() and "-" not in e])
print("IGNORE issues", [e for e in entries if "-" in e])
print("IGNORE pages", [e for e in entries if e.isdigit()])
EOF
```
The `HUB` lines give keys, aliases, repos and people of each hub (they are also needed for routing); the `KEY` lines the hubs that have each key, with `(Data Center)` when the hub's notes link that space on the `datacenter_confluence` host of `config/atlassian.yaml`; the `CLIENT` lines domains and active projects; the `IGNORE` lines the entries of `config/atlassian-ignore.txt`.
**Hub spaces on the cloud.** Check with the list of spaces by key that the spaces of the `KEY confluence_spaces` lines exist on the cloud. A space that is not there is not an error: note it for the summary, as a Data Center space if the line marks it `(Data Center)`, otherwise as a space not found (key to verify), and skip it in step 3.
Inventory with the Atlassian tool:
- Jira projects: JQL `assignee = currentUser() OR reporter = currentUser()`, asking only for the project field, 100 results per page, and following the result pages to the end with the command below;
- Confluence spaces: those of the hubs and those where the user appears, CQL `(contributor = currentUser() OR watcher = currentUser() OR mention = currentUser()) AND type = page`; keep the distinct keys, with the number of pages, and exclude personal spaces (keys starting with `~`);
- the extra keys given by the user (step 0).
The tool saves each page of Jira results to a file. Pass to the command the paths of all the files saved so far, in order:
```bash
.venv/bin/python - "<file>" … <<'EOF'
import json, sys
from collections import Counter
def results(path):
data = json.loads(open(path, encoding="utf-8").read())
if isinstance(data, list): # text blocks of the tool: [{"type": "text", "text": "<json>"}]
return [json.loads(b["text"]) for b in data if str(b.get("text", "")).lstrip().startswith("{")]
return [data]
project = {}
for path in sys.argv[1:]:
for res in results(path):
issues = res.get("issues") or []
if isinstance(issues, dict): # {"nodes": [...], "pageInfo": {"hasNextPage", "endCursor"}}
info, nodes = issues.get("pageInfo") or {}, issues.get("nodes") or []
else: # [...] with "nextPageToken" and "isLast"
info, nodes = {}, issues
for n in nodes:
project[n["key"]] = ((n.get("fields") or {}).get("project") or {}).get("key") or n["key"].rsplit("-", 1)[0]
cursor = info.get("endCursor") or res.get("nextPageToken")
last = not cursor or info.get("hasNextPage") is False or res.get("isLast") is True
print(f"FILE {path}\t{len(nodes)} issues\t" + ("last page" if last else f"cursor {cursor}"))
for key, n in sorted(Counter(project.values()).items(), key=lambda kv: (-kv[1], kv[0])):
print(f"PROJECT {key}\t{n}")
print(f"TOTAL {len(project)} distinct issues")
EOF
```
Each `FILE` line gives the issues of that page and, if there are more, the cursor (`endCursor` or `nextPageToken`): ask for the next page passing that cursor as the page token and run the command again with all the files, until the last `FILE` line says `last page`. The `PROJECT` lines give the distinct keys with the number of issues, counted once even if an issue appears in several files. A page that the tool shows directly instead of saving it you count yourself.
The keys of the inventory that are in no hub (`jira` for projects, `confluence_spaces` for spaces) nor among the `IGNORE keys` entries are **new**. If there are any, immediately ask a single question, with the name of the project or space and a proposal for each:
- one or more existing hubs (e.g. SHARED → Portale B2B and App Mobile, OPS → Supporto Acme);
- a new client or project, with name, location and keys, as in the "3. Route" step of `process`. The client is the direct contractual counterpart of your company, not the end client (rule of `AGENTS.md`): e.g. the space COMUNE (Comune di Esempio, the end client) goes to the project Perizia portale comunale of the client Integratore Y;
- "ignore".
In the same question propose the `aliases` needed to route the keys shared by several hubs, new or already registered, only for the hubs in the scope (all of them, if the user did not give a subset). They are needed when the names and aliases of the hubs are not enough to recognize the epics of the project: e.g. for SHARED, shared by Portale B2B and App Mobile, `Checkout` for App Mobile and `Keycloak` and `IAM` for Portale B2B. Propose only those that are missing: if only aliases are missing, the question contains only those. An alias may coincide with the name of an existing note (e.g. `Keycloak`, which is also in `Technologies/`): propose it pointing out the side effect in Obsidian, where the autocomplete of `[[Keycloak` also suggests the hub and, if chosen, writes `[[Portale B2B|Keycloak]]` instead of the link to the technology. Add it only if the user confirms. A generic alias (e.g. `IAM`, `Backend`) is allowed, but in routing it counts only in titles ("Routing", generic aliases).
**Keys that emerged from the contents.** A key that appears in the contents read (e.g. links to issues of a restricted Jira project, which the inventory does not see; not the links to the Data Center, which go only in the summary) and is in no hub nor among the `IGNORE keys` entries is new even if the tool cannot read it, and is never added silently. If it emerges in this step (homepage and page titles), it goes in the question above; if it emerges during the import, in that of step 7. In the proposal say whether the tool sees it.
Before proposing a new client or project, and again before creating it after the answer, check the homepage of the space and the titles of its pages (for a Jira project, the titles of the epics). If they contradict the proposal or the user's answer (e.g. a different client), create nothing: ask for confirmation again reporting the evidence.
After confirmation:
- add the keys to `jira` or `confluence_spaces` of the hubs, a link in `## Sources` (`- Jira: [<KEY>](<cloud>/browse/<KEY>)`, `- Confluence: [<SPACE>](<cloud>/wiki/spaces/<SPACE>)`) and a Log line, e.g. `- <today> — added the Jira key `SHARED` to the frontmatter (import-atlassian)`;
- add the confirmed aliases to the `aliases` of the hubs, with a Log line;
- create the new clients and projects from the templates, linking the project under `## Projects` of the client note. The `## Status` of the new project is derived from the homepage of the space; if it is empty, from the page titles (or the epics), without importing them if the hub is outside the scope. If the end client is different from the client, the `## Status` names it;
- add the ignored keys at the end of `config/atlassian-ignore.txt`, with a comment (e.g. `# added with import-atlassian on <today> upon user confirmation`).
Apply the rule on uncommitted changes to hubs and client notes. The confirmed keys are imported in the same run; those of a hub outside the scope are only registered. If the step changed anything: `.venv/bin/python scripts/lint.py`, then commit `import-atlassian: keys (<summary>)` with only hubs, client notes and `config/atlassian-ignore.txt` in the staging area, and push according to the Git protocol. If there are no new keys or aliases to propose, no question and no commit.
## 3. Confluence
For each space of the hub not yet processed in this run and found on the cloud in step 2 (Data Center spaces and those not found are already noted for the summary):
1. **List** the pages with the operation that lists the pages of a space (it needs the space id, which the list of spaces of step 2 gives), with the body in markdown and, if the operation allows it, only those with `status: current`, following the cursor to the end. In a single call it gives for each page id, title, status, `parentId` and `parentType`, creation date (`createdAt`), last modification date (`version.createdAt`) and body, but not the web link: the canonical URL is built from space key and id (at the top of the skill). The CQL search and the reading of a single page may not return the creation date, which `date` needs ("Writing"). Read the saved file with `.venv/bin/python` extracting id, title, status, `parentId`, `parentType`, dates and body length, and keep the pages modified from `DATE` onwards. Skip the ids in `IGNORE pages`, counting them as ignored. If you could not ask only for current pages, discard those with `status: archived`, counting them as archived (a category of their own in the summary).
- **Omitted bodies.** When it returns many pages, the list may replace the body with a placeholder of ~150 characters (e.g. `Body omitted… ADF conversion budget`). It is not an empty page: recognize the placeholder and read those pages one by one with the page read operation, or list again with a lower `limit`.
- **Folders.** A page may be in a Confluence folder: it has `parentType: folder` and a `parentId` that is not in the list. For the chain of ancestors (triage and routing) use the operation for the descendants of a page starting from the homepage of the space (its id is in the list of spaces of step 2), which also returns the folders with title and `parentId`, or treat the title of the folder as the signal of the ancestor.
2. **Count** the pages kept at point 1: the count is done on that list, not with a CQL with limit 1, whose `totalCount` is unreliable. Above ~200 propose that the user give a date or split the run: first a run with a recent date, then one without a date, in which "Already imported" skips what has already been done.
3. **Triage** on title and position (the chain of `parentId`s, folders included): keep architecture, requirements, processes, decisions, meeting minutes, troubleshooting indexes; discard templates and archive or obsolete pages, counting the discards by category.
4. **Route** the pages kept ("Routing": in a shared space a page without signals of its own follows the nearest ancestor that has them, and the title prevails over the body; in a client space a page without project signals goes to client level) and apply "Already imported": a single command of "Items already in the vault" with all the ids, each with its last modification date.
5. **Read and write.** Read each remaining page, from the body saved at point 1 or with the page read operation, and write a summary note for it ("Writing"): `note`, or `decision` or `meeting` if the page is a decision or minutes; a series of homogeneous pages can be merged into a single note. Long pages are summarized, not copied; empty pages are recognized on reading and discarded (the placeholder of omitted bodies, point 1, is not an empty page).
A page that exceeds the conversion limit of the tool and cannot be read in either of the two ways does not stop the run: cite it as unread, with title and link, in the relevant note (that of its topic or series; if there is none, in `## Sources` of the hub), without putting it in `sources:`, and note it for the summary. If in a later run it is still unreadable and the note already cites it, touch nothing.
## 4. Epic map
For each Jira key of the hub not yet processed in this run (if the tool does not find the project, note it for the summary and move on):
1. **List** all the epics, open and closed, regardless of `DATE`: JQL `project = <KEY> AND issuetype = Epic ORDER BY created ASC`, with key, title, status with its category, creation, update, resolution and status change dates (`statuscategorychangedate`), components and labels. Ask only for these fields (`summary`, `status`, `created`, `updated`, `resolutiondate`, `statuscategorychangedate`, `components`, `labels`): without an explicit list the tool also returns heavy fields such as `description`, `assignee` and `reporter` with their avatars. If the tool does not allow choosing the fields, always read the results from the saved file with `.venv/bin/python`, extracting only those you need: never receive them whole in the context. Skip the keys in `IGNORE issues`.
2. **Route** each epic among the hubs that have the key ("Routing"), with a single command of "Items already in the vault" for all the epics, each with its update date.
3. **Summary note.** Each hub in the scope that has the key and to which at least one epic goes receives the `note` `YYYY-MM-DD <name>.md` in `Clients/<C>/Projects/<Hub>/Notes/`, where `<name>` is `names.epic_map_note` of the vocabulary with `{hub}` (the file name of the hub) and `{key}` filled in (English: `Epic map {hub} ({key})`, e.g. `2026-11-09 Epic map Portale B2B (PB).md`). The command of "Items already in the vault" recognizes the summary notes by the fixed prefix of the `names` entries, so do not change the name format. The content of the note is written in the vault language:
- the date in the name and in `date` is that of the first import and then stays stable. In later runs the existing note is the `summary` line of that hub in the command of "Items already in the vault" with only the project key (`ITEMS="<KEY>"`): rewrite it keeping name and date;
- `sources: ["<cloud>/browse/<KEY>"]`;
- at the top of the body the line `> Note generated by import-atlassian and rewritten at every run: manual edits are lost.`;
- the note template's Summary heading (`headings.summary`): number of epics by status; its Details heading (`headings.details`): the table `| Key | Title | Status | Period | Link |` of the epics routed to that hub, in creation order. The period goes from creation to resolution (`2026-01-12 → 2026-03-30`, or `2026-01-12 → ongoing`). For a completed item (status category "done") without a resolution date, the end is the status change date (`statuscategorychangedate`), otherwise `n/a`; the link is the canonical URL of the epic, which the command of "Items already in the vault" reads as the memory of routing. In titles replace `|` with `-`;
- zero items: a hub to which no epic goes does not receive the note (an existing one is not touched). If the project has no epics, the map is not created, and stories without an epic are not mapped: those of the user are in the note of step 5.
4. **Dedicated notes.** Among the epics updated from `DATE` onwards (all, if the date is missing), read the description: those that contain a decision or an analysis produce a dedicated note, with "Already imported" and "Writing".
## 5. User's tickets
For the same key:
1. **List** all the issues assigned to the user or of which they are the reporter, regardless of `DATE`: JQL `project = <KEY> AND issuetype != Epic AND (assignee = currentUser() OR reporter = currentUser()) ORDER BY created ASC` (the epics are already in the map of step 4), with key, title, type, status with its category, creation, update, resolution and status change dates (`statuscategorychangedate`), parent epic or ticket (`parent`), components and labels. Ask only for these fields, as in step 4 (here also `issuetype` and `parent`), with the same rule on the saved file. Skip the keys in `IGNORE issues`.
2. **Route** each ticket ("Routing": it usually follows its epic), with a single command of "Items already in the vault" for all the tickets, each with its update date.
3. **Summary note.** Each hub in the scope that has the key and to which at least one ticket goes receives the `note` `YYYY-MM-DD <name>.md`, where `<name>` is `names.tickets_note` with `{user}` (the user's name, `git config user.name`), `{hub}` and `{key}` filled in (English: `Tickets of {user} on {hub} ({key})`, e.g. `Tickets of Mario Rossi on Portale B2B (PB)`), with the rules of name, date, `sources:`, top line and zero items of step 4. the Summary heading: number of tickets by status; the Details heading: the table `| Key | Title | Type | Status | Dates | Epic | Link |` of the tickets routed to that hub, in creation order, where the dates go from creation to resolution with the period rules of step 4, the Epic column has the key of the epic or parent ticket and the link is the canonical URL of the ticket. If the epic is not readable with the user's permissions, in the Epic column write only its key and route the ticket with its other signals ("Routing").
4. **Dedicated notes.** `DATE` limits only the tickets to read in full (description and comments): among those updated from `DATE` onwards (all, if the date is missing), only those that from type or title look like design, spike, analysis or incident. From these derive dedicated notes, with "Already imported" and "Writing".
## 6. Commit and push
As soon as steps 3–5 of the hub are finished run `.venv/bin/python scripts/lint.py` and fix your notes. Then make one commit for each project touched (the hub and those that share its keys):
- stage only the files of that project that you touched: notes, summary notes, hub, client note; people and technologies go in the commit of the first project that touches them;
- `git commit -m "import-atlassian: <Project> (<N> notes)"`, where N counts the decision, meeting and note notes created or updated, including the summary ones;
- a project without changes has no commit;
- the client-level notes of the client spaces ("Routing") have a separate commit, `import-atlassian: <Client> (<N> notes)`, with those notes and the client note in the staging area.
Then push according to the Git protocol and move on to the next hub.
## 7. End-of-run question
Only for the uncertain items and for the keys that emerged from the contents during the import (step 2): a single question, with title, link and proposed hub (or "ignore") for each item, and for each key the proposal of step 2, saying whether the tool sees it. Then:
- for the confirmed items do what you would have done in steps 3–5 with the hub clear: lines in the summary notes of their hub and, if applicable, dedicated notes. Commit and push as in step 6;
- register the confirmed keys as in step 2 ("After confirmation"): they are imported at the next run;
- add the ignored items and keys at the end of `config/atlassian-ignore.txt` (key `KEY-N`, page id or key of the project or space), with a comment;
- if you registered keys or added ignored entries: lint, commit `import-atlassian: keys (<summary>)` with only hubs, client notes and `config/atlassian-ignore.txt` in the staging area, and push.
If there are no uncertain items or emerged keys, no question.
## 8. Summary per project
- pages counted; pages, epics and tickets examined, discarded by category (archived pages in a category of their own), already imported or ignored;
- notes created and updated, with links, and separately the client-level notes written from the pages without project signals of the client spaces;
- keys added to the hub, including those that emerged from the contents (to be imported at the next run);
- items skipped (uncertain, routed to a hub outside the scope, notes with uncommitted changes, pages not read because too large for the tool), hubs skipped in step 1, Data Center spaces, spaces and projects not found;
- Data Center links found in the contents, not imported;
- push status.