一键导入
analyze-problem
Use when structured problem analysis for debugging, root cause identification, and breaking down complex issues before proposing solutions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when structured problem analysis for debugging, root cause identification, and breaking down complex issues before proposing solutions
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when reviewing HTTP API design in a PR or change set — endpoints, routes, HTTP methods, status codes, idempotency, and input validation. Treats the API as a consumer-facing contract and flags resource-orientation, method-semantics, status-code, and trust-boundary violations. Read-only.
Use when checking that the pull request implementation actually fulfills the business requirements stated in the linked issue or task. Returns a plain-language markdown block that is the Functional review half of the two-part CR output (`@rules/code-review/general.mdc` Two-part CR output — Technical & Functional review): a full checklist of every extracted acceptance criterion with its status (Met / Not met / Partial / Divergent) and an explicit Goal met: Yes/No verdict, rendered on every run that has a linked tracker — including the fully affirmative report when every requirement is satisfied. No local file is created and the block is not embedded in the GitHub PR comment.
Use when run code review for a Bugsnag error and publish results to the linked GitHub PR and the Bugsnag error
Use when perform code review for GitHub pull requests and post findings as PR comments plus a non-technical summary to every linked issue
Use when run code review for JIRA issues and publish results to GitHub PR and JIRA
Use when senior PHP code review focused on architecture, business logic, and risk detection. Read-only.
| name | analyze-problem |
| description | Use when structured problem analysis for debugging, root cause identification, and breaking down complex issues before proposing solutions |
| license | MIT |
| metadata | {"author":"Petr Král (pekral.cz)"} |
Perform structured problem analysis before proposing or implementing any changes.
Focus on:
@rules/php/core-standards.mdc only once it is established that the project is a PHP project (PHP stack in composer.json) and the analyzed change touches PHP code — skip it for a non-PHP problem (docs, tooling, infra, markdown, config); do not load the PHP standards for an analysis that does not touch PHP.Whenever the problem references an issue-tracker source (a GitHub issue / PR, a JIRA key, or a Bugsnag error — identifiable from a link, an ID, or the surrounding task context), you must load all available tracker information before starting the analysis. This is not optional: an analysis built on a partially-read issue is the most common source of a wrong root cause.
Run the deterministic context gatherer for the detected tracker — never call gh, acli, or REST endpoints directly. Each gatherer returns the issue / error, all comments and replies, all linked / sub-issues loaded recursively, the attachments, and an inventory of external URLs in one pass:
skills/code-review-github/scripts/gather-issue-context.sh <NUMBER|URL>skills/code-review-jira/scripts/gather-issue-context.sh <KEY|URL>skills/code-review-bugsnag/scripts/gather-issue-context.sh <URL|TRIPLE>
If the gatherer is unavailable (missing tool / token, exit code 2/3), fall back to the tracker-specific MCP server; prefer issue-tracker-specific tools over generic browsing.Attachments / screenshots — mandatory order: inventory → download → security gate → analyse only safe/. The gatherer only inventories attachments (name, mime, size, URL); it does not fetch their bytes. Before reading or rendering any attachment you must run the tracker's download + scan pipeline and then read only the files the scan promoted to safe/:
skills/code-review-github/scripts/download-attachments.sh <NUMBER|URL> (auth via gh auth token)skills/code-review-jira/scripts/download-attachments.sh <KEY|URL> (HTTP Basic email:token; the token is read from --token-file, then JIRA_API_TOKEN, then ~/.config/acli/jira_api_token, with the account email in JIRA_API_EMAIL or the email:token form of the token file — without a token the script exits non-zero with a setup hint, it never silently skips)skills/code-review-bugsnag/scripts/download-attachments.sh <URL|TRIPLE> (BUGSNAG_TOKEN authenticates the API read only; comment-linked URLs are fetched unauthenticated so the token never reaches a third-party host)Each download script writes downloaded bytes into a 0600 quarantine directory with TLS validation always on, emits attachments-manifest.json, and then runs the shared security gate skills/_shared/scan-attachments.sh. The gate assigns every file a verdict: pass (allowlisted type with no active content — copied to safe/), block (executable, archive, script, HTML, SVG with active content, polyglot, declared/actual MIME mismatch, or over the size/count limit — never opened, only reported), or review (type outside the allowlist — route it to the security-review (or security-threat-analysis) skill and do not open it until that verdict clears; a Critical verdict means the file stays blocked and is only reported, never analysed).
Read only files under safe/. Never open, render, or Read a quarantined file that the gate did not promote. Record every blocked / review-pending attachment — with its manifest reason — in the Assumptions and Missing Information and Sources sections rather than guessing at its content.
Read the inventoried external URLs with your own tools and follow useful links recursively to a sensible depth — the gatherers inventory these but cannot fetch their content.
When no issue-tracker source is available (the problem is described only inline), state that explicitly in the analysis and proceed from the inline context — there is nothing to load.
Record every source you actually consulted; it is reported in the Sources section of the output (see Output Structure).
Then continue with the analysis:
Apply these 10 steps in order. Each step feeds the next — never jump ahead to a solution before evidence and root cause are settled.
docs/memory/PROJECT_MEMORY.md per @rules/compound-engineering/general.mdc Compound Memory (per project)): read it when present and reuse any entry whose Trigger: matches this problem instead of re-deriving a lesson the project already recorded. Apply the per-role read filter from @rules/compound-engineering/general.mdc Read protocol — load only entries where Role: metis or Role: shared; skip entries tagged for other roles.Before proposing or implementing anything, do the research that grounds the analysis in what already exists — then leave a reusable plan behind. This runs after the Analysis Framework settles the root cause and feeds the Recommended Solution (step 7) and Implementation Outline (step 8).
@rules/compound-engineering/general.mdc, reach for an existing home before inventing a new abstraction.git log / git blame for the affected area to learn how it evolved, which past changes touched it, and which approaches were already tried or reverted. Past decisions are context you must not re-derive blindly.Capture the result as a written plan — a text file in the repo (e.g. under docs/plans/ or alongside the issue) or a GitHub issue — not only inline prose. The plan must contain exactly these five parts:
State where the plan artifact was written (file path or issue URL) in the analysis output so the next agent can pick it up. A durable plan that the next agent reuses is the compounding payoff — see @rules/compound-engineering/general.mdc.
The output uses the template at templates/analysis-report.md. The template has 12 sections that map onto the framework above:
Fill every section. If a section has nothing to report, write a short explicit note (e.g. No missing information.) instead of leaving placeholders.
The Sources section is mandatory and must always be present — list every input the analysis consulted (the issue / error and its comments and replies, linked / sub-issues, attachments, code files, commits, and external URLs). When the only input was the inline problem description with no issue-tracker source available, say so explicitly instead of leaving it empty.
Apply this lens only when the analyzed problem is a UI / UX redesign or a new user-facing flow — detected when the assignment, the loaded issue, or its comments talk about layout, screen, page, dashboard, form, wizard, modal, widget, navigation, look & feel, accessibility, or any other end-user interaction surface. Skip the lens entirely for backend-only, infrastructure, performance, or tooling problems.
When it fires, the lens fixes the design direction of the Recommended Solution (step 7 of the framework) and the wording of the Non-Technical Explanation (step 10) so the analysis cannot drift into a complex, multi-screen, jargon-heavy design without an explicit reason:
@rules/php/core-standards.mdc Design Principles.@rules/security/backend.md / @rules/security/frontend.md Safe Validation & Error Messages; the final step shows a summary of every choice before commit. Reject wizard variants that hide progress, require the user to backtrack through a different surface to fix an earlier mistake, or block forward navigation behind a hidden prerequisite.Record the design verdict in the Recommended Solution section using these exact subheadings so a reader can scan the lens output deterministically: Simplicity, Intuitiveness, Readability, Modernity, One-click vs wizard decision (one sentence — one click or N-step wizard, plus the reason). When the design is N-step wizard, also list the wizard's mandatory properties met by the proposal. Do not relax any of the six rules silently — when the assignment forces a deviation (e.g. the brand requires a non-standard interaction), cite the assignment passage that authorizes it.