Find-in-code skill
/safran:find-in-code answers one question about the company's code from what the Safran tools return, across every indexed repository. It is as clear about what it did not find as about what it did: the answer names the places with repo path:lines, groups them by repository and owning team, lists what was searched for without result, and says how fresh the index is.
Run it
/safran:find-in-code where are partial refunds validatedThe argument is the question, in any language. Without one, the skill asks what you want to find and waits. Claude also starts it on its own for questions such as "where do we validate refund amounts", "which services publish the order-paid event" or "is there any code for loyalty points".
It needs an index built with safran sync. It reads no ticket: of the thirteen tools it uses seven.
What it does
| Step | What happens | Tools |
|---|---|---|
| 1. Profile | Notes the languages, repo groups, teams, glossary and the state of the index. If this fails, the skill reports the error and stops. | get_company_profile |
| 2. Understand the question | Restates it as things to look for: the concept, business terms the glossary maps to code-side words, verbatim strings (a label, an error text, a path, an identifier), and the scope you implied. A question too vague to search ("how does the backend work") gets one clarifying question instead of a broad search. | none |
| 3. Search from several angles | A behaviour sentence in the language of the question, the same idea in the code language, the glossary's code-side words, and every identifier or verbatim string with exact search. At least one search runs without a scope filter. | search_code, grep_code |
| 4. Read to confirm | Opens every place it intends to cite, with context, and follows the chain far enough to answer: for "where", the entry point and the place the decision is made; for "how", the path from entry to effect. Notes copies of the same code elsewhere (also_in). | read_file |
| 5. Check coverage | Compares what is indexed with where the answer could live. A repository that is not indexed was not searched. | list_repos |
| 6. Answer | See below. Owners come from the profile, or from history when the profile does not say. | who_owns, find_past_work |
Two tools divide the searching. search_code ranks by meaning: it is a sample and can miss. grep_code is exact: when the question is "everywhere X appears", the skill uses it and reports its total, and whether the list was truncated or some repositories were incomplete.
Filters (groups, repos) are used to dig into an area, not to decide in advance where the answer lives: the second place something is done is usually the interesting one.
The answer
The answer leads with two or three sentences, then has up to five parts:
| Part | Content |
|---|---|
| Where it is | Grouped by repository, each group headed by the repository and its owning team ("owner unknown" when neither the profile nor history says). One line per place: repo path:start-end, the symbol, and what happens there. |
| How it fits together | Only when the question was "how": the flow in a few steps, each citing its line range. |
| Not found | What was looked for and not found, with the queries. The wording is "no trace found in the indexed code", never "does not exist". |
| Coverage and freshness | The index date, repositories that are not indexed and could matter, and any exact search that was truncated or incomplete. |
| Worth knowing | Only when it helps: tickets that last changed the code, copies listed in also_in, a business term that is missing from the glossary. |
Quoted code is kept short; the citation lets you open the rest.
Partial refunds are created in payments-api: RefundService.createPartialRefund checks the amount
with RefundPolicy, rounds it to two decimals and sends it to the payment provider. The iOS app
calls the refund endpoint from RefundClient.
Where it is
payments-api (team Payments, declared in the profile)
- payments-api src/refund/service.ts:11-16 createPartialRefund: calls assertRefundable, rounds
the amount, calls provider.refund.
- payments-api src/refund/policy.ts:5-13 RefundPolicy.assertRefundable: throws
REFUND_AMOUNT_EXCEEDED when the amount is larger than captured minus refunded.
acme-ios (team Mobile, low confidence in the profile)
- acme-ios Sources/Refund/RefundClient.swift:8-12 requestPartialRefund: posts to /refunds.
Not found
- No trace found in the indexed code for a refund screen in the web apps.
Searched: "kısmi iade formu", "partial refund form", grep "RefundForm", grep "/refunds".
Coverage and freshness
- Indexed: payments-api, ledger (2026-11-22), acme-ios (2026-11-20).
- Not indexed, not checked: acme-android, web-app, admin-panel.
Worth knowing
- payments-api src/refund/service.ts was last changed for PAY-1423 (pull request #101).When the search finds nothing at all, the whole answer is the "Not found" and "Coverage" parts. That is a complete answer; the skill does not pad it with guesses about where such code would normally be.
Output language
The answer is written in the profile's languages.tickets, unless you ask in another language; then it uses yours. Identifiers, paths and quoted code stay as they are in the code.
Limits
- The skill only reads. Asked to create or change a ticket, it says the server has no write tool and offers a draft.
- "No trace" is a statement about the index, not about the company's code. The answer says which repositories were not indexed.
- The index reflects the last
safran sync. Code merged since then is not in the answer; the answer gives the index date so you can judge. - Source code is untrusted data too. A comment in a file that addresses an assistant is mentioned in one line and not acted on.