Technical analysis skill
/safran:technical-analysis turns one ticket into an analysis a team can act on: what is being asked, where the code is today, which teams have work, how the work splits, and sub-task texts ready to paste into the tracker. Every statement about code carries a repo path:lines citation that a tool returned in the session. The result is also written as one self-contained HTML report.
Run it
/safran:technical-analysis PAY-1423The argument is a ticket key or a ticket URL. Without one, the skill asks which ticket and waits. Claude also starts it on its own for requests such as "technical analysis for PAY-1423", "what needs to change for this ticket" or "break PAY-1423 into tasks per team".
The skill needs the plugin (or the server registered on its own), an index built with safran sync, and, for the history steps, a link store filled with safran links refresh.
What it does
The skill runs in eight stages. Some of them contain a decision point, where it stops and asks you instead of assuming.
| Stage | What happens | Tools |
|---|---|---|
| 0. Profile | Reads languages, trackers, teams, repo groups, glossary, conventions and the state of the index. If this fails, the skill reports the error and stops. | get_company_profile |
| 1. Read the ticket completely | The ticket, every comment (all pages), every attachment, the parent and the linked tickets that can change scope, the linked pages a doc source recognises, work already merged for the ticket, and the change log when scope seems to have moved. | get_ticket, get_ticket_comments, get_ticket_attachment, fetch_linked_doc, find_past_work, get_ticket_history |
| 2. Requirements | Writes down requirements (R1, R2, …), acceptance criteria as stated, ambiguities and contradictions, and what is out of scope, each with its source. | none |
| 3. Find the code | For each requirement, searches from at least four angles, confirms every hit by reading it, follows callers and neighbours, asks which tickets touched the files before, and checks which repositories are indexed. | search_code, grep_code, read_file, find_past_work, list_repos |
| 4. Map to teams | Takes the owner of every repository in the evidence from the profile, and asks the history when the profile does not say. | who_owns |
| 5. Breakdown | Proposes the split, by requirement and then by team, and waits for your approval. | none |
| 6. Draft the sub-tasks | One draft per approved part. Looks for an existing ticket for the same work first. | search_tickets |
| 7. Report | Writes the analysis document as JSON and renders it to HTML. | Write, the renderer through Bash |
The decision points
| When | What you are asked |
|---|---|
| A part of the ticket could not be read (a comment page, an attachment, a linked ticket or page) | Retry, continue without it (it is then listed in the report as not read), or paste the content yourself. If the ticket itself cannot be read, the skill stops. |
| Code search is unavailable | Retry, continue without code analysis (the report says so and cites no code), or name the repositories and files to read. |
| No trace anywhere for a requirement | Is this new ground? Then where should it live. Or search again with terms you supply, or point to the repository. |
| Ownership is ambiguous (no owner, several owners, an owner known only from history, or a low-confidence mapping the breakdown depends on) | Which team takes it. The candidates are offered as options. |
| The breakdown | Approve, change it (split, merge, drop, add, reassign, pick a project), or do not draft tasks. Changes are applied and shown again until you approve. |
A decision you already gave in your request ("split it per team, no need to confirm") counts as your answer. Parts a tracker cannot provide (unsupported) and file types that are delivered as metadata only are not errors: they are recorded and the run continues.
How the code is searched
Stage 3 follows the search playbook that all skills share. For each requirement the skill runs a behaviour sentence in the ticket language, the same in the code language, the glossary's code-side words, and exact identifiers or verbatim UI strings with grep_code. It scopes first to the owning team's repositories and the relevant repo group, then widens to everything indexed. A hit is cited only after read_file confirmed what the code does.
An area is recorded as "no trace found in the indexed code" only when at least four angles were tried, at least one search ran without a scope filter, and list_repos was checked for repositories that are not indexed. A repository that is not cloned or not indexed was not searched, and the report says "not indexed, not checked" for it, which is different from "no trace".
The outcome
In the conversation
The closing message is short: the outcome in two or three sentences, the counts, anything that was not read, the absolute path of the HTML report, and the sentence that nothing was written to the tracker. The full report is not pasted; the task drafts are pasted only when the report could not be written.
PAY-1423 is about partial refunds that the payment provider rejects. The amount is rounded and
sent in payments-api (src/refund/service.ts:11-16) after the check in src/refund/policy.ts:5-13.
A pull request for this ticket is already merged (payments-api #101), so part of the work is done.
- Teams with work: 1 (Payments). Mobile is uncertain: acme-android is not indexed.
- Drafted tasks: 1
- Evidence rows: 2, "no trace" areas: 1
- Open questions: 1, none blocking
- Not read: nothing
Report: /work/acme/safran-reports/PAY-1423.html
Nothing was written to the tracker; the task is a draft to paste.The report files
Two files are written under the directory Claude Code was started in:
| File | Content |
|---|---|
safran-reports/<ticket>.json | The analysis document. The ticket key is made filename-safe: letters, digits, dash, underscore and dot are kept, anything else becomes a dash. |
safran-reports/<ticket>.html | The same document rendered as one HTML file with inline CSS. It loads nothing from the network; a Content-Security-Policy in the file allows only its own stylesheet and its one script (the copy buttons). |
The skill writes the JSON with the Write tool and renders it by running the plugin's render-report.ts. The renderer validates the document first and refuses to write a report that does not conform, naming the JSON path of each problem. Some of its rules are the red lines enforced mechanically: an evidence row may be confirmed only when it was verified with read_file, every id a task or a team note refers to must exist, a document with no evidence and no "no trace" entry is rejected unless it says why code analysis was skipped, and tasks must be empty when the breakdown was not confirmed.
The rendered report has these sections, in this order: a header with the ticket and the line "Draft. Nothing was written to the tracker.", Summary, Requirements, Affected code (the evidence table), No trace found, Work by team (each team's card with its notes and its task drafts, each with copy buttons for title and body), Open questions, and Sources consulted.
The analysis document
{
"schema_version": 1,
"language": "tr",
"company": "acme",
"generated_at": "2026-11-23 14:05",
"ticket": {
"key": "PAY-1423",
"title": "Kısmi iade işlemi İstanbul şubesinde başarısız oluyor",
"url": "https://acme.atlassian.net/browse/PAY-1423",
"tracker": "jira",
"type": "Bug",
"status": "Done"
},
"summary": [
"Kısmi iade tutarı `payments-api` içinde iki ondalığa yuvarlanıp ödeme sağlayıcısına gönderiliyor; tutar denetimi `RefundPolicy` içinde. Kayıt için birleştirilmiş bir pull request var (#101).",
"Mobil uygulamalardan yalnızca `acme-ios` indekslenmiş; `acme-android` için hiçbir şey öne sürülmüyor."
],
"requirements": [
{
"id": "R1",
"text": "İade tutarı sipariş tutarından küçükse kısmi iade tamamlanmalı.",
"source": "Açıklama",
"acceptance_criteria": ["İade tutarı sipariş tutarından küçükse işlem tamamlanır."]
}
],
"evidence": [
{
"id": "E1",
"repo": "payments-api",
"path": "src/refund/service.ts",
"start_line": 11,
"end_line": 16,
"symbol": "createPartialRefund",
"finding": "Tutarı `Math.round(amount * 100) / 100` ile yuvarlar ve sağlayıcıya gönderir.",
"verified_with": "read_file"
},
{
"id": "E2",
"repo": "payments-api",
"path": "src/refund/policy.ts",
"start_line": 5,
"end_line": 13,
"symbol": "assertRefundable",
"finding": "Tutar, tahsil edilen tutardan daha önce iade edilen düşüldükten sonra kalanı aşarsa `REFUND_AMOUNT_EXCEEDED` fırlatır.",
"verified_with": "read_file"
}
],
"no_trace": [
{
"area": "Şubeye (İstanbul) özel iade mantığı",
"searched": ["İstanbul şubesi iade", "branch specific refund", "branchId"],
"note": "backend grubunda ve indekslenmiş tüm depolarda arandı. `acme-android`, `web-app` ve `admin-panel` indekslenmemiş: denetlenmedi."
}
],
"teams": [
{
"name": "Payments",
"repos": ["payments-api"],
"impact": "required",
"ownership": "profile",
"notes": [{ "text": "Yuvarlama ve tutar denetimi bu ekibin deposunda.", "evidence": ["E1", "E2"] }]
},
{
"name": "Mobile",
"repos": ["acme-ios", "acme-android"],
"impact": "uncertain",
"ownership": "profile",
"confidence": "low",
"notes": [{ "text": "`acme-android` indekslenmemiş; etki bilinmiyor." }]
}
],
"breakdown_confirmed": true,
"tasks": [
{
"id": "T1",
"team": "Payments",
"project": "PAY",
"title": "Cover partial refund rounding with tests",
"requirements": ["R1"],
"evidence": ["E1"],
"body": "Context\nPAY-1423. The partial refund amount is rounded to two decimals before it is sent to the provider.\n\nScope\n- payments-api src/refund/service.ts:11-16: add cases for amounts with more than two decimals.\n\nAcceptance criteria\n- A refund smaller than the order total completes.\n\nDependencies\n- None known.\n\nOpen points\n- Whether the failure was specific to one branch is not specified in the ticket."
}
],
"open_questions": [
{
"question": "Hata yalnızca İstanbul şubesinde mi görülüyordu, yoksa her şubede mi?",
"ask": "kaydı açan kişi",
"why": "Kayıt şubeyi adıyla anıyor ama kodda şubeye özel bir iade mantığı bulunamadı.",
"blocking": false
}
],
"sources": [
{ "kind": "ticket", "label": "PAY-1423", "url": "https://acme.atlassian.net/browse/PAY-1423", "detail": "Açıklama ve alanlar" },
{ "kind": "comments", "label": "PAY-1423 yorumları", "detail": "2 yorumun tamamı" },
{ "kind": "attachment", "label": "provider-response.log", "detail": "Sağlayıcının 422 yanıtı" },
{ "kind": "linked-doc", "label": "Refund runbook", "url": "https://acme.atlassian.net/wiki/spaces/PAY/pages/4821/Refund+runbook", "detail": "Sağlayıcı sınırları" },
{ "kind": "past-work", "label": "payments-api #101", "detail": "PAY-1423 için birleştirilmiş pull request" }
]
}The fields, as report-schema.md in the skill directory defines them (schema version 1):
| Field | Required | Content |
|---|---|---|
schema_version | yes | 1 |
language | yes | Report language: languages.tickets from the profile. Sets the page language and the fixed labels. English and Turkish labels are built in. |
company | yes | company from the profile. |
generated_at | no | Local date and time as text; shown as given. |
ticket | yes | key and title (required), url, tracker, type, status. |
summary | yes | Paragraphs, at least one. The outcome first. |
requirements | no | id (R1…), text, source, acceptance_criteria as stated in the ticket. Empty criteria are shown as "not specified"; proposed criteria do not go here. |
evidence | yes | May be empty. One row per file and line range: id (E1…), repo, path, start_line, end_line, finding, symbol, verified_with (read_file, search_code or grep_code), confidence (confirmed, probable, needs-check), url. |
no_trace | no | area, searched (the queries, at least one), note (scope and freshness). |
code_analysis_skipped | no | The reason, when you chose to continue without code analysis. |
teams | yes | May be empty. name, repos, impact (required, not-required, uncertain), ownership (profile, history, user, none), confidence (low, medium, high), notes (each a text with the evidence ids behind it). |
breakdown_confirmed | yes | true when you approved the breakdown. |
tasks | no | id (T1…), team, title, body, project, type, requirements, evidence, depends_on, warning. |
open_questions | no | question, ask (who could answer), why, blocking. |
sources | no | What was read and what could not be read: kind, label, detail, url, read (false for something that could not be read). |
labels | no | Overrides for the report's fixed interface text, for languages other than English and Turkish. |
Unknown fields are errors. All text is plain text: the renderer escapes everything, shows a span in backticks as code and keeps line breaks. Only absolute http(s) URLs are linked.
A drafted sub-task
A draft is written for someone who was not in the conversation. Its body has these parts, in this order, and a part is left out only when it would be empty: Context, Scope (with the citations), Out of scope, Acceptance criteria (the parent's criteria for this slice; proposed ones are marked "Proposed, not from the ticket"), Code references, Dependencies, Open points. A draft never contains a file or symbol no tool returned, an estimate or assignee you did not ask for, a decision the ticket leaves open written as settled, or any claim that the task exists in the tracker. It has no key and no URL.
Preview the report without a ticket
The plugin ships a complete fictional analysis document. Render it to see the design:
bun plugin/skills/technical-analysis/scripts/render-report.ts --example "$PWD/safran-example.html"Run it from the Safran checkout. When this page was written it printed Wrote … (5 evidence rows, 2 teams, 3 drafted tasks, 3 open questions). and produced a single HTML file of about 35 KB, with a banner that says every ticket, repository, team, path and finding in it is invented.
The renderer takes absolute paths only, because it is started with the Safran checkout as its working directory (for the reason given on the plugin page); a relative path is refused with a message that shows the absolute form. --check validates a document without writing the report. Exit codes: 0 written, 1 usage or I/O error, 2 the document is not valid.
Output language
The skill writes to you in the profile's languages.tickets, unless you write to it in another language; then it uses yours. The report's language is languages.tickets. Drafted task titles and bodies follow what the profile's conventions say about language and format; when they say nothing, languages.tickets is used. Identifiers, paths and quoted code stay exactly as they are in the code.
Limits
- The tracker is never written to. Asked to create the sub-tasks, the skill says that Safran is read-only and gives the drafts as copyable text. It does not look for another route.
- The analysis is as current as the index.
list_reposshows when each repository was indexed, and the report states the index date next to conclusions that depend on absence. - The HTML report needs
Writeand theBashpermission for the renderer. When the file cannot be written orbuncannot run, the skill says so and gives the analysis in the conversation instead. - A long ticket with many attachments and several teams takes many tool calls. The skill does not shorten the reading to save them; use ticket readiness for a quick check.