with one click
incident-analysis-gitlab-tools
// Use GitLab tools efficiently to understand the failing code path, repository predicates, integrations, and surrounding functional flow.
// Use GitLab tools efficiently to understand the failing code path, repository predicates, integrations, and surrounding functional flow.
| name | incident-analysis-gitlab-tools |
| description | Use GitLab tools efficiently to understand the failing code path, repository predicates, integrations, and surrounding functional flow. |
Use this skill when logs, stack traces, deterministic GitLab evidence, or runtime signals suggest that code context is needed to understand:
Treat gitLabGroup and gitLabBranch from the manifest/prompt as fixed.
Do not switch group or branch. Do not invent project names. Infer project names and file paths only from evidence and repository exploration.
A deployed component may be implemented by more than one GitLab project. Operational context can list several repositories for the same system/component, including:
When operational context provides codeSearchScopeIds, codeSearchRepoIds, codeSearchProjects, repository project, package roots or class hints for a matched system, treat that whole list as the code scope of the deployment component.
If codeSearchRepositoryRoles are present, use the primary repository first and then the shared-library, generated-client, integration-library or collaborator repositories in priority order.
If a grounded class, entity, DTO, mapper, client or repository is not found in the main service repository, do not conclude that the code is unavailable after one repository lookup. Make a focused GitLab attempt across the matching codeSearchScopes, remaining codeSearchProjects or matched repository projects first.
Use this especially when:
Keep the search bounded: search the listed component repositories with the grounded class/package/method hints, read only the best matching outline/chunk, then stop if no useful library code is found.
Use gitlab_list_available_repositories when the relevant repository is not grounded by logs, deterministic evidence, or existing code references, but the incident contains loose clues about another repository, component, module, package, endpoint, integration, system, bounded context, or process.
The tool reads the repository catalog from operational context for the fixed session group. It does not search code and it does not change the fixed branch or group.
Use the returned projectName as the input for later GitLab search, flow context, outline, chunk, and read tools. Treat gitLabPath, summary, and repository metadata as disambiguating context.
When the response contains codeSearchScopes, prefer the matching scope over a single repository. Pass all projectNames from that scope together to search/flow/class-reference tools. The scope repositories carry roles and priorities; start with primary, then follow supported shared libraries, generated clients or integration libraries only as needed.
Match incident clues against:
name, aliases, projectName, and gitLabPath,systems, runtimeComponents, boundedContexts, processes, and integrations,packagePrefixes, endpointPrefixes, and modulePaths,codeSearchScopes[].target, codeSearchScopes[].projectNames, repository roles, package prefixes and class hints.Prefer one catalog call at the beginning of a cross-repository investigation. Do not repeat the catalog lookup unless new evidence clearly points to another repository family.
Every GitLab tool call must include the optional reason argument.
Write reason in Polish as one short, practical sentence for a junior analyst.
Explain what the tool call is meant to verify or clarify.
Do not include hidden reasoning, long analysis, or step-by-step deliberation.
Good examples:
Sprawdzam fragment metody ze stacktrace, zeby potwierdzic predykat repozytorium.Szukam uzyc klasy encji, zeby ustalic gdzie zaczyna sie przeplyw biznesowy.Czytam serwis i repozytorium, zeby wyjasnic juniorowi ktory warunek odcina dane.The exception is AFFECTED_FUNCTION_GITLAB_RECOMMENDED: when that gap is listed and GitLab tools are enabled, make one focused GitLab attempt to improve affectedFunction, even if deterministic code evidence already explains the local failure.
Do not call GitLab tools when:
AFFECTED_FUNCTION_GITLAB_RECOMMENDED is not listed;AFFECTED_FUNCTION_GITLAB_RECOMMENDED is not listed;If the likely technical error is clear but affectedFunction would remain shallow, use GitLab tools to read enough surrounding code to explain the flow and handoff.
The goal is not to map the whole repository.
The goal is to understand the smallest useful cross-file and, when relevant, cross-repository flow that explains:
If AFFECTED_FUNCTION_GITLAB_RECOMMENDED is listed in the manifest and GitLab tools are enabled, make a focused GitLab exploration attempt before the final answer.
Use the attempt to write affectedFunction in non-code, technical/functional language.
The answer should explain:
Do not turn affectedFunction into a code walkthrough.
Mention classes, methods, files or repositories only as supporting evidence.
If the GitLab attempt finds no useful flow context, stop and state that limitation.
gitlab_list_available_repositories when projectName/GitLab path is unclear and evidence contains only loose repository, system, module, package, endpoint, integration, or bounded-context clues.codeSearchScopes or multiple codeSearchProjects for the matched system, use those projects as one component scope before treating a class as missing.gitlab_search_repository_candidates when project/file is unclear or you need broad cross-repository candidates after using available catalog clues.gitlab_find_class_references when an exception, stacktrace, entity, repository, DTO or mapper class is grounded and you need files that declare, import or directly use that class.gitlab_find_class_references returns no useful result for the main project, retry once across the other operational-context projects for that component.gitlab_find_flow_context when the local failure is known but the broader flow or collaborators are unclear; pass focused keywords grounded in logs, stacktrace, code evidence or current tool results.gitlab_read_repository_file_outline before full file reads when you need to understand a file role cheaply.gitlab_read_repository_file_chunk or gitlab_read_repository_file_chunks before full file reads.gitlab_read_repository_file only when:
If a listed tool is not available in the current session, use the available GitLab tools and state limitations only if they affect the diagnosis.
Use inputs inferred from evidence:
codeSearchScopes, codeSearchProjects, repository project, package roots and class hints,Search broadly enough to find the relevant project and direct collaborators, but do not read every candidate.
Prefer ranked candidates and role hints over blind full-file reads.
When the incident suggests a JPA, repository or data issue, do not jump straight into broad DB discovery.
Instead:
gitlab_list_available_repositories first when loose repository or component clues are available, then use gitlab_search_repository_candidates with all projectName values from the selected codeSearchScope or repository set.gitlab_find_class_references with:
@Entity, @Table, @Query, JpaRepository, JoinColumn, mappedBy, repository method names, business keys or exception names.If DB_CODE_GROUNDING_NEEDED is listed in the manifest, treat this as a required attempt before DB table/column discovery whenever GitLab tools are available.
If the attempt does not find an entity or repository, do not keep browsing indefinitely.
Move to DB discovery as fallback and make the limitation visible in the DB tool reason.
Use this sequence especially for:
EntityNotFoundException,JpaObjectRetrievalFailureException,Start from the most grounded location:
Read outward in this order:
When reading code, extract only what helps the diagnosis and final UX:
findBy...AndStatus...,@Query predicates when present,@Entity, @Table, @Column, @JoinColumn, @JoinTable, mappedBy, @Embeddable, @ElementCollection,When the incident involves "not found", empty result, entity lookup, data filtering, or repository failure, identify:
This information should guide DB/data diagnostics.
If the failing method is only a local step, explain the surrounding flow.
For example:
Do not describe the whole system. Describe the smallest broader flow that helps a new analyst understand the incident.
Stop reading code when:
Do not stop only because the local exception is clear. Stop when both the technical failure and the affected flow are clear enough.
Tool call count is less important than context quality.
It is acceptable to perform broader GitLab exploration when it materially improves affectedFunction, handoff, or next action.
Prefer:
over:
When describing code behavior, mention the supporting class, method, file, or tool result.
If code context remains incomplete, state that limitation instead of guessing.
[HINT] Download the complete skill directory including SKILL.md and all related files