| name | register-artifact |
| description | Appends a completed workflow entry to the repo-level artifact registry at .github/artifacts/REGISTRY.md. Use exactly once per workflow when the PR transitions to Ready phase. |
| argument-hint | ticket key, PR number, PR URL, type, risk level, and summary |
Register Artifact
Appends a completed workflow entry to the repo-level artifact registry at .github/artifacts/REGISTRY.md. Called when a PR transitions to Ready phase (at the submit phase, by the pr-author agent).
Schema reference: Registry format and field definitions are in .github/artifacts/SCHEMA.md.
When to Use
- Exactly once per workflow: when the PR is finalized and transitions to
Ready
- NOT called at any earlier phase
- If the registry already contains an entry for this PR number, skip (idempotency)
Procedure
Step 1: Check if the registry file exists
test -f .github/artifacts/REGISTRY.md && echo "exists" || echo "missing"
If missing, initialize it with the header:
python3 -c 'open(".github/artifacts/REGISTRY.md","w").write("# Artifact Registry\n\n| Timestamp | Type | Ticket | PR | Branch | URL | Actor | Risk | Summary |\n|-----------|------|--------|----|--------|-----|-------|------|---------|\n")'
Step 2: Check for duplicate
grep -F "#<PR_NUMBER>" .github/artifacts/REGISTRY.md 2>/dev/null && echo "duplicate" || echo "ok"
If a row for this PR number already exists, do not append (idempotency — safe to re-run).
Step 3: Collect field values
Gather the values needed for the registry row:
TIMESTAMP — current UTC time: python3 -c 'import datetime; print(datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ"))'
TYPE — branch prefix extracted from branch name (e.g., feat/kan-12 → feat)
TICKET — JIRA ticket key (e.g., KAN-12)
PR — PR number with # prefix (e.g., #22)
BRANCH — git branch name: git branch --show-current
URL — PR URL from PR_URL captured at PR creation
ACTOR — pr-author
RISK — risk level from the Review Summary block (LOW, MEDIUM, HIGH, or CRITICAL); use LOW if review was skipped
SUMMARY — one sentence describing what was done (from PR title or Review Summary)
Step 4: Append the row
python3 -c '
ts = "<TIMESTAMP>"
row = "| " + " | ".join([ts, "<TYPE>", "<TICKET>", "#<PR>", "<BRANCH>", "<URL>", "pr-author", "<RISK>", "<SUMMARY>"]) + " |\n"
open(".github/artifacts/REGISTRY.md","a").write(row)
'
Step 5: Commit the registry update
Include the registry file in the final PR commit alongside the state file archive:
git add .github/artifacts/REGISTRY.md
Important
- Only append — never edit or delete existing rows
- The
REGISTRY.md file is NOT generated by the assembler — it is agent-managed and persists across assembler re-runs; if accidentally deleted, recover from git history
- The
SCHEMA.md file IS generated by the assembler — do not edit it manually
- Pipe characters (
|) in the Summary field must be escaped as \| to avoid breaking the Markdown table