:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(review_hog): replace the skills section with a Deep skills panel (#114856)
Julian Beze2a4d2c56644
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 984686dc782e..63c598f95ace 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -14529,21 +14529,21 @@ snapshots:scenes-code-review--narrow--light:hash: v1.k794b7964.7e0bbeeffb4b8d8372dbdfe90686b2becc1991df2b78af2a0a2b6a0b3a41aadf.7Z4Aht9zbaWjsS8W-Yd9wCOuUjU5-A9Xb6Xpg__bgMsscenes-code-review--narrow-settings--dark:- hash: v1.k794b7964.ba0c6e6160731eb30a5cf3c2e9881d895bc8674bc92be363c0e0c56522de5412.p-Ja1csUKoKyRzXWuypC3sTYjDfrX5fnzoPn4GJ8JuI+ hash: v1.k794b7964.ea1ab4cb3b3f2eca6d22db2f5b58fc024cb19c5c96f8ae354aa68bf2003c5520.d3e5PopQypbF4oe7Gv_EqYPh98oGYO7tz44dblKGoGYscenes-code-review--narrow-settings--light:- hash: v1.k794b7964.b134ab5646a4f88af2a8933eacf56f7fbe81a3878c88f096a2de26c97798a15e.Ctq0UoV4dTw4T_7Xk6kAnusLi6l98J33E1ay11PynN4+ hash: v1.k794b7964.7c763ae64e60bb61482e3b53df6d21227df686bea08a5de80272d0ac3de7312a.xrwQQUb_yhA6F7_vOESqzzw0ZTbOXxFOB36cRLFVBwYscenes-code-review--saved-inbox-opt-ins--dark:- hash: v1.k794b7964.3a64a0be7055a214fb3173dd006ecb263372f2e429b6b314f1b6455866c5d9e6.p3xOCDvydAdcTIi3sJ-5w5Ndf92WiNe_mcWrgXuDXGA+ hash: v1.k794b7964.0e1463d77ed24eadd4f5d00b50c9d9e77997e167418983dfcb8c1e40b7782ded.U9p-YAGiFB8YYOdhgcMoJIVtozh9CnG-HMqz0pKElScscenes-code-review--saved-inbox-opt-ins--light:- hash: v1.k794b7964.368abff5eb46814f2cc3c3d10e4c59d6a0bf480b3f1ecb6a45b5e694a88978ba.OhmRQsmGVa20oHmk_m8065vfDMLvUv8P9AYum8QeHJs+ hash: v1.k794b7964.df02b2abaab38458bf332492c6110bca0376c9d3b03625f4c46e59965d66e70c.nE8ZWovrxPZuTj4MbJo9Sr6n64NF1oMOBrn_n51XIlwscenes-code-review--settings--dark:- hash: v1.k794b7964.3935ec90bad4ccbb9ed89ff00a75126f93b79912fdebef442b4755cd5c75fc65.umFZDadahhYUQAU3tEthgDUjkpOWm_NgTFSLtvoCrTg+ hash: v1.k794b7964.9249a99f7968ef84d09b9100a6cd03d0589d31762110d1b38353ed7fb75825d0.yG6MkHb1oyKDaQxRJRVmxiGBefroaBhkgDwr1PdDrcIscenes-code-review--settings--light:- hash: v1.k794b7964.435c87b03cc4a492717fff6940d766b133fad1068fa9b2b669ac3d9944c2be3b.f6hDtHznFMXN7NxsMo95AG0i_BXV9E65NU6UMKCYzDw+ hash: v1.k794b7964.da6367d1ac33f7005399a0cc4505a731c7e8833c700ddd2207b58cf33001bcf6.kvOy4se9NHqG7MqyT1OUp6RmutLM7P-EzHkBR_mnhqsscenes-code-review--settings-for-member--dark:- hash: v1.k794b7964.a62e1453b1802e39a906f37be04cd6e412dca3f3221e8ff57b4de729a645fe94.Ytn8_u9jOQTFGyaw-XroxgfThGZmk3mteWQ6JNftPVo+ hash: v1.k794b7964.da417e515dd9263a7b096680e231bd3c09e5616ada85f426793365e028f7daf5.wQfduw1MRkVcr-ow0On3If-ckzaY0cY1wxYCBIF23zgscenes-code-review--settings-for-member--light:- hash: v1.k794b7964.4f5b919eb4bed674c6eaa36100f683ccde5c43e5573ece05dd1e9dd60eb3d6b1.u2R46wlONU2DmOf5auxw8EyznBfCGA4YDzlPWs2gzBk+ hash: v1.k794b7964.eab7f9bd03c0fb668da6298385837cd261eadb153483b1504cf1e3b30209232d.VGYff3AUfiUGek3T1ecLUzVHsF3RqXwqNjxZjliy6REscenes-dashboards-customize-breakdown-colors--customize-breakdown-colors--dark:hash: v1.k794b7964.cf89a12669d5221b2441fbfb4439b8b1b38191943438a2c1a220444148329954.B4ew6uW3gZCbPU_3vTOggsOyHojRlyvuXxh5FZnlO-0scenes-dashboards-customize-breakdown-colors--customize-breakdown-colors--light:diff --git a/products/review_hog/frontend/CodeReviewScene.stories.tsx b/products/review_hog/frontend/CodeReviewScene.stories.tsxindex 111a77d06acb..183249ba1164 100644--- a/products/review_hog/frontend/CodeReviewScene.stories.tsx+++ b/products/review_hog/frontend/CodeReviewScene.stories.tsx@@ -24,6 +24,7 @@ import type {PatchedReviewProjectSettingsApi,PatchedReviewUserSettingsApi,ReviewInstallationClaimScopeEnumApi,+ ReviewPerspectiveConfigApi,ReviewPerspectiveStatsApi,ReviewProjectSettingsApi,ReviewRecentReviewApi,@@ -33,6 +34,7 @@ import type {ReviewRepositoryPersonRequestApi,ReviewRepositoryWriteApi,ReviewUserSettingsApi,+ ReviewValidatorConfigApi,UserBasicApi,} from 'products/review_hog/frontend/generated/api.schemas'@@ -132,6 +134,31 @@ const perspectiveStats: ReviewPerspectiveStatsApi = {],}+const perspectives: ReviewPerspectiveConfigApi[] = [+ {+ skill_name: 'review-hog-perspective-logic-correctness',+ enabled: true,+ description: 'Wrong results, broken edge cases, missed branches.',+ body: '',+ },+ {+ skill_name: 'review-hog-perspective-performance-reliability',+ enabled: true,+ description: 'Slow queries, retries, timeouts, unbounded work.',+ body: '',+ },+ {+ skill_name: 'review-hog-perspective-contracts-security',+ enabled: false,+ description: 'Tenant leaks, injection, secrets, auth gaps.',+ body: '',+ },+]++function singleSkill(skill_name: string, description: string, active: boolean): ReviewValidatorConfigApi {+ return { skill_name, description, active, body: '' }+}+const ADA: UserBasicType = {id: 301,uuid: '0b3f6a52-6a0e-4b8e-9d2f-4a1c7e9e0301',@@ -425,10 +452,33 @@ const meta: Meta<typeof CodeReviewScene> = {},'/api/projects/:team_id/review_hog/reviews/': { results: recentReviews, has_more: false },'/api/projects/:team_id/review_hog/reviews/perspective_stats/': perspectiveStats,- '/api/projects/:team_id/review_hog/perspectives/': [],- '/api/projects/:team_id/review_hog/blind_spots/': [],- '/api/projects/:team_id/review_hog/validators/': [],- '/api/projects/:team_id/review_hog/resolution/': [],+ '/api/projects/:team_id/review_hog/perspectives/': perspectives,+ '/api/projects/:team_id/review_hog/blind_spots/': [+ singleSkill(+ 'review-hog-blind-spots-general',+ 'One more pass over each chunk for what every perspective missed.',+ true+ ),+ ],+ '/api/projects/:team_id/review_hog/validators/': [+ singleSkill(+ 'review-hog-validation-default',+ 'Drops speculative, noisy and low-value findings before they reach the PR.',+ true+ ),+ ],+ '/api/projects/:team_id/review_hog/resolution/': [+ singleSkill(+ 'review-hog-resolution-default',+ 'Fixes what is worth it and safe, and replies to every thread.',+ true+ ),+ singleSkill(+ 'review-hog-resolution-small-fixes',+ 'Fixes only small, local changes and leaves bigger ones as replies.',+ false+ ),+ ],},post: {'/api/projects/:team_id/review_hog/repositories/': async ({ request }) => {@@ -558,6 +608,7 @@ export const Settings: Story = {await expect(canvas.getByText('Reviewed in the Billing project')).toBeVisible()await expect(canvas.getByText('You can edit: project admin')).toBeVisible()await expect(canvas.getByText('Deep review settings')).toBeVisible()+ await expect(canvas.getByText('Review skills')).toBeVisible()await expect(canvas.queryByText('Review a pull request')).not.toBeInTheDocument()await expect(canvas.getByLabelText('Resolve comments on my pull requests')).toBeVisible()},diff --git a/products/review_hog/frontend/CodeReviewScene.tsx b/products/review_hog/frontend/CodeReviewScene.tsxindex 53a026558392..95ec8f812cc8 100644--- a/products/review_hog/frontend/CodeReviewScene.tsx+++ b/products/review_hog/frontend/CodeReviewScene.tsx@@ -1,24 +1,12 @@import { useActions, useValues } from 'kea'-import {- IconChevronDown,- IconDirectedGraph,- IconExternal,- IconGithub,- IconPlus,- IconPullRequest,- IconSearch,- IconShield,- IconStack,- IconWrench,-} from '@posthog/icons'+import { IconChevronDown, IconDirectedGraph, IconExternal, IconGithub, IconPullRequest } from '@posthog/icons'import {LemonBanner,LemonButton,LemonInput,LemonSegmentedButton,LemonSkeleton,- LemonSwitch,LemonTabs,LemonTag,Link,@@ -35,7 +23,6 @@ import { LemonDrawer } from 'lib/lemon-ui/LemonDrawer'import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { SceneExport } from 'scenes/sceneTypes'-import { urls } from 'scenes/urls'import { SceneContent } from '~/layout/scenes/components/SceneContent'import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'@@ -56,25 +43,12 @@ import { AdoptSkillModal } from './AdoptSkillModal'import { PipelineDetailModal } from './PipelineDetailModal'import { InstallationClaims } from './repositories/InstallationClaims'import { RepositoriesPanes } from './repositories/RepositoriesPanes'-import {- CodeReviewTab,- REVIEWS_PAGE_SIZE,- ReviewDrawerTab,- ReviewSkillKind,- reviewHogSettingsLogic,-} from './reviewHogSettingsLogic'+import { CodeReviewTab, REVIEWS_PAGE_SIZE, ReviewDrawerTab, reviewHogSettingsLogic } from './reviewHogSettingsLogic'import { SectionHeader } from './SectionHeader'import { FullReviewSettingsSection } from './settings/FullReviewSettingsSection'import { InboxSection } from './settings/InboxSection'--/** "review-hog-perspective-logic-correctness" → "Logic correctness" */-function prettifySkillName(skillName: string): string {- const cleaned = skillName- .replace(/^review-hog-(perspective|blind-spots|validation|resolution)-/, '')- .replace(/[-_]/g, ' ')- .trim()- return cleaned ? cleaned.charAt(0).toUpperCase() + cleaned.slice(1) : skillName-}+import { ReviewSkillsPanel } from './settings/ReviewSkillsPanel'+import { prettifySkillName } from './skillNames'// Step numbering and names match the detailed-view modal (PipelineDetailModal) — keep them in sync.const PIPELINE_PHASES: { name: string; hint: string; steps: { number: string; title: string; caption: string }[] }[] = [@@ -1118,115 +1092,6 @@ function ReviewDetailDrawer(): JSX.Element {)}-interface SkillCardData {- skill_name: string- description: string- body: string- on: boolean-}--function SkillCard({- skill,- onLabel,- offLabel,- onToggle,-}: {- skill: SkillCardData- onLabel: string- offLabel: string- onToggle: (checked: boolean) => void-}): JSX.Element {- const { savingSkillNames } = useValues(reviewHogSettingsLogic)- const { viewSkill } = useActions(reviewHogSettingsLogic)- const title = prettifySkillName(skill.skill_name)-- return (- <LemonCard hoverEffect={false} className="p-4">- <div className="flex items-start justify-between gap-4">- <div className="flex min-w-0 flex-col gap-1.5">- <div className="flex items-center gap-2">- <span className="text-sm font-semibold">{title}</span>- <LemonTag type={skill.on ? 'warning' : 'muted'} size="small">- {skill.on ? onLabel : offLabel}- </LemonTag>- </div>- <p className="m-0 max-w-130 text-xs text-secondary">{skill.description}</p>- <div className="flex items-center gap-2 text-xs">- <Link onClick={() => viewSkill({ title, body: skill.body, skillName: skill.skill_name })}>- View skill- </Link>- <span className="text-tertiary">·</span>- <Link- to={urls.skill(skill.skill_name)}- target="_blank"- className="inline-flex items-center gap-0.5"- >- Edit skill <IconExternal className="size-3" />- </Link>- </div>- </div>- <LemonSwitch- aria-label={title}- checked={skill.on}- onChange={onToggle}- disabledReason={savingSkillNames.includes(skill.skill_name) ? 'Saving…' : undefined}- />- </div>- </LemonCard>- )-}--function SkillListSkeleton(): JSX.Element {- return (- <div className="flex flex-col gap-2.5">- <LemonSkeleton className="h-24 w-full" />- <LemonSkeleton className="h-24 w-full" />- </div>- )-}--function CreateYourOwnButton({ kind, label }: { kind: ReviewSkillKind; label: string }): JSX.Element {- const { creatingSkillKind } = useValues(reviewHogSettingsLogic)- const { startSkillAuthorTask } = useActions(reviewHogSettingsLogic)- return (- <LemonButton- type="secondary"- icon={<IconPlus />}- onClick={() => startSkillAuthorTask(kind)}- loading={creatingSkillKind === kind}- disabledReason={- creatingSkillKind && creatingSkillKind !== kind ? 'Another authoring task is starting…' : undefined- }- >- {label}- </LemonButton>- )-}--function UseExistingSkillButton({ kind }: { kind: ReviewSkillKind }): JSX.Element {- const { openAdoptSkillModal } = useActions(reviewHogSettingsLogic)- return (- <LemonButton- type="secondary"- icon={<IconSearch />}- onClick={() => openAdoptSkillModal(kind)}- data-attr={`review-hog-adopt-skill-${kind}`}- >- Use an existing skill- </LemonButton>- )-}--/** The two ways to add a review skill, side by side under each kind's cards. */-function AddSkillRow({ kind, createLabel }: { kind: ReviewSkillKind; createLabel: string }): JSX.Element {- return (- <div className="flex flex-wrap items-center gap-2">- <CreateYourOwnButton kind={kind} label={createLabel} />- <UseExistingSkillButton kind={kind} />- </div>- )-}-function EffectivenessRows({items,maxRaised,@@ -1270,10 +1135,10 @@ function EffectivenessRows({/*** Aggregate effectiveness across the in-scope recent reviews for one reviewer kind: per skill, a* bar of findings it raised split into validator-kept (green) vs dismissed (muted). Rendered once- * in the Perspectives section and once in the Blind-spot section, above each one's skill cards;- * both cards share one scale so bar lengths stay comparable. Hidden until there is data for the- * kind. On the Everyone scope this can list skills beyond the user's own cards below — the- * stats describe the project, while the toggles stay per-user.+ * for perspectives and once for blind spots, under the review skills panel; both cards share one+ * scale so bar lengths stay comparable. Hidden until there is data for the kind. On the Everyone+ * scope this can list skills beyond the user's own rows above — the stats describe the project,+ * while the toggles stay per-user.*/function EffectivenessCard({ kind }: { kind: 'perspectives' | 'blind_spots' }): JSX.Element | null {const { perspectiveStats } = useValues(reviewHogSettingsLogic)@@ -1391,133 +1256,6 @@ function ValidatorEffectivenessCard(): JSX.Element | null {)}-function PerspectivesSection(): JSX.Element {- const { perspectives } = useValues(reviewHogSettingsLogic)- const { togglePerspective } = useActions(reviewHogSettingsLogic)-- return (- <section className="flex flex-col gap-4">- <SectionHeader- icon={<IconStack />}- title="Perspectives"- pill={- <LemonTag type="muted" size="small">- Enable as many as you like · at least one stays on- </LemonTag>- }- >- Each perspective is a skill — an editable instruction set the reviewer follows. Toggles here apply only- to reviews of your pull requests; editing a skill changes it for the whole team.- </SectionHeader>- <EffectivenessCard kind="perspectives" />- {perspectives === null ? (- <SkillListSkeleton />- ) : (- <div className="flex flex-col gap-2.5">- {perspectives.map((p) => (- <SkillCard- key={p.skill_name}- skill={{ ...p, on: p.enabled }}- onLabel="Enabled"- offLabel="Disabled"- onToggle={(checked) => togglePerspective(p.skill_name, checked)}- />- ))}- </div>- )}- <AddSkillRow kind="perspective" createLabel="Create your own perspective" />- </section>- )-}--function SingleActiveSection({- icon,- title,- intro,- kind,- kindLabel,- createLabel,- skills,- onSelect,- preamble,-}: {- icon: JSX.Element- title: string- intro: string- kind: ReviewSkillKind- kindLabel: string- createLabel: string- skills: SkillCardData[] | null- onSelect: (skillName: string) => void- preamble?: JSX.Element-}): JSX.Element {- const { blockSingleActiveDeactivation } = useActions(reviewHogSettingsLogic)-- return (- <section className="flex flex-col gap-4">- <SectionHeader- icon={icon}- title={title}- pill={- <LemonTag type="warning" size="small">- One active at a time- </LemonTag>- }- >- {intro}- </SectionHeader>- {preamble}- {skills === null ? (- <SkillListSkeleton />- ) : (- <div className="flex flex-col gap-2.5">- {skills.map((skill) => (- <SkillCard- key={skill.skill_name}- skill={skill}- onLabel="Active"- offLabel="Off"- onToggle={(checked) =>- checked ? onSelect(skill.skill_name) : blockSingleActiveDeactivation(kindLabel)- }- />- ))}- </div>- )}- <AddSkillRow kind={kind} createLabel={createLabel} />- </section>- )-}--function SkillDrawer(): JSX.Element {- const { viewedSkill, skillDrawerOpen } = useValues(reviewHogSettingsLogic)- const { closeSkillDrawer } = useActions(reviewHogSettingsLogic)-- return (- <LemonDrawer- isOpen={skillDrawerOpen}- onClose={closeSkillDrawer}- title={viewedSkill?.title ?? ''}- description="Skill · read-only"- width={440}- footer={- <LemonButton- type="secondary"- to={viewedSkill ? urls.skill(viewedSkill.skillName) : urls.skills()}- targetBlank- icon={<IconExternal />}- >- Open in Skills editor- </LemonButton>- }- >- <pre className="m-0 whitespace-pre-wrap font-mono text-xs leading-relaxed text-secondary">- {viewedSkill?.body}- </pre>- </LemonDrawer>- )-}-export const scene: SceneExport = {component: CodeReviewScene,logic: reviewHogSettingsLogic,@@ -1535,9 +1273,6 @@ function ActivityTab(): JSX.Element {const REVIEW_SKILLS_ANCHOR = 'review-hog-skills'function SettingsTab(): JSX.Element {- const { blindSpots, validators, resolutionSkills } = useValues(reviewHogSettingsLogic)- const { selectBlindSpots, selectValidator, selectResolutionSkill } = useActions(reviewHogSettingsLogic)-return (<><section className="flex flex-col gap-3">@@ -1559,48 +1294,12 @@ function SettingsTab(): JSX.Element {<InboxSection /><section className="flex flex-col gap-8 border-t border-primary pt-8"><PipelineSection />- <div id={REVIEW_SKILLS_ANCHOR} className="flex flex-col gap-1.5 border-t border-primary pt-8">- <h3 className="m-0 text-lg font-bold">Review skills</h3>- <p className="m-0 max-w-160 text-sm text-secondary">- Everything below is a regular skill, stored in your PostHog skills store like anything else- you've added. Review skills read your changed code, a blind-spot sweep catches what they missed,- and validation criteria decide what reaches the pull request. Toggling one here applies only to- your pull request reviews; editing a skill changes it for the whole team.- </p>+ <div id={REVIEW_SKILLS_ANCHOR} className="flex flex-col gap-4 border-t border-primary pt-8">+ <ReviewSkillsPanel />+ <EffectivenessCard kind="perspectives" />+ <EffectivenessCard kind="blind_spots" />+ <ValidatorEffectivenessCard /></div>- <PerspectivesSection />- <SingleActiveSection- icon={<IconSearch />}- title="Blind-spot check"- intro="After the enabled perspectives finish, PostHog Review runs one more sweep over each chunk. It sees what they found and hunts for real issues they all missed. Add as many sweeps as you like, but only one runs."- kind="blind_spots"- kindLabel="blind-spot check"- preamble={<EffectivenessCard kind="blind_spots" />}- createLabel="Create your own blind-spot check"- skills={blindSpots?.map((s) => ({ ...s, on: s.active })) ?? null}- onSelect={selectBlindSpots}- />- <SingleActiveSection- icon={<IconShield />}- title="Validation criteria"- intro="Every candidate finding is checked against your quality bar before publishing, so noisy, speculative, or low-value issues never reach the pull request. Keep several bars on hand, but only one is applied."- kind="validator"- kindLabel="validator"- createLabel="Create your own validation criteria"- preamble={<ValidatorEffectivenessCard />}- skills={validators?.map((s) => ({ ...s, on: s.active })) ?? null}- onSelect={selectValidator}- />- <SingleActiveSection- icon={<IconWrench />}- title="Resolution criteria"- intro="After a review is published, PostHog Review works through the pull request's unresolved comment threads: asks that are worth it and safe get implemented on the branch, and every thread gets a reply. These criteria set that bar and how fixes work: default, big gaps only, or small fixes only. Keep several on hand, but only one is applied."- kind="resolution"- kindLabel="resolution criteria"- createLabel="Create your own resolution criteria"- skills={resolutionSkills?.map((s) => ({ ...s, on: s.active })) ?? null}- onSelect={selectResolutionSkill}- /></section></>)@@ -1649,7 +1348,6 @@ export function CodeReviewScene(): JSX.Element {{activeTab === 'activity' ? <ActivityTab /> : <SettingsTab />}{/* Overlays stay mounted on both tabs, so a `?review=` deep link opens on either. */}- <SkillDrawer /><AdoptSkillModal /><ReviewDetailDrawer /></div>diff --git a/products/review_hog/frontend/reviewHogSettingsLogic.ts b/products/review_hog/frontend/reviewHogSettingsLogic.tsindex 88f615dba12a..442177a99657 100644--- a/products/review_hog/frontend/reviewHogSettingsLogic.ts+++ b/products/review_hog/frontend/reviewHogSettingsLogic.ts@@ -102,14 +102,6 @@ export interface PerspectiveScore {count: number}-/** The skill a "View skill" click opens in the read-only drawer. */-export interface ViewedSkill {- title: string- body: string- /** The `review-hog-*` skill name, for the drawer's link to the skill's editor page. */- skillName: string-}-// Mirrors the backend naming contract (skill_loader.py): the name prefix is a review skill's whole// identity, so an adopted copy must be created under its kind's prefix to be discovered by runs.export const REVIEW_SKILL_PREFIX_BY_KIND: Record<ReviewSkillKind, string> = {@@ -279,14 +271,12 @@ export interface reviewHogSettingsLogicValues {settings: ReviewUserSettingsApi | nullsettingsLoading: booleanshowReviewAuthor: (review: ReviewRecentReviewApi) => boolean- skillDrawerOpen: booleantriggerPrUrl: stringtriggerUrlHasFullReview: booleantriggerUrlResolving: booleantriggeringReview: booleanvalidators: ReviewValidatorConfigApi[] | nullvalidatorsLoading: boolean- viewedSkill: ViewedSkill | nullviewerGithubLogin: string | nullviewerGithubLoginLoading: boolean}@@ -314,9 +304,6 @@ export interface reviewHogSettingsLogicActions {closeReviewDrawer: () => {value: true}- closeSkillDrawer: () => {- value: true- }followProjectDefault: (key: ProjectDefaultKey) => {key: ProjectDefaultKey}@@ -587,9 +574,6 @@ export interface reviewHogSettingsLogicActions {settings: ReviewUserSettingsApipayload?: PatchedReviewUserSettingsApi}- viewSkill: (skill: ViewedSkill) => {- skill: ViewedSkill- }}// Generated by kea-typegen. Update if you're an agent, ignore if you're human.@@ -658,8 +642,6 @@ export const reviewHogSettingsLogic = kea<reviewHogSettingsLogicType>([// The active card's switch can't be turned off — exactly one stays active per kind.blockSingleActiveDeactivation: (kindLabel: string) => ({ kindLabel }),setSkillSaving: (skillName: string, saving: boolean) => ({ skillName, saving }),- viewSkill: (skill: ViewedSkill) => ({ skill }),- closeSkillDrawer: true,openReviewDetail: (review: ReviewRecentReviewApi) => ({ review }),// Opens the drawer for a review with no list row in hand — the `?review=` deep-link path// (PR status comments bake these links into GitHub). The drawer renders from the loaded@@ -863,20 +845,6 @@ export const reviewHogSettingsLogic = kea<reviewHogSettingsLogicType>([saving ? [...state, skillName] : state.filter((name) => name !== skillName),},],- viewedSkill: [- // Kept through close so the drawer doesn't blank mid-animation; `skillDrawerOpen` gates visibility.- null as ViewedSkill | null,- {- viewSkill: (_, { skill }) => skill,- },- ],- skillDrawerOpen: [- false,- {- viewSkill: () => true,- closeSkillDrawer: () => false,- },- ],// The clicked list row: the drawer header renders from it instantly while the detail loads.// Null on a deep-linked open (no row in hand) — the drawer then renders from the detail alone.openedReview: [diff --git a/products/review_hog/frontend/settings/ReviewSkillsPanel.tsx b/products/review_hog/frontend/settings/ReviewSkillsPanel.tsxnew file mode 100644index 000000000000..0beb1cd1874b--- /dev/null+++ b/products/review_hog/frontend/settings/ReviewSkillsPanel.tsx@@ -0,0 +1,148 @@+import { useActions, useValues } from 'kea'++import { IconPlus, IconSearch } from '@posthog/icons'+import { LemonButton, LemonMenu, LemonSelect, LemonSkeleton, LemonTag } from '@posthog/lemon-ui'++import {+ REVIEW_SKILL_KIND_LABELS,+ ReviewSkillKind,+ reviewHogSettingsLogic,+} from 'products/review_hog/frontend/reviewHogSettingsLogic'+import { prettifySkillName } from 'products/review_hog/frontend/skillNames'++import { SingleActiveSkillGroup } from './SingleActiveSkillGroup'+import { SkillGroupHeader } from './SkillGroupHeader'+import { SkillRow } from './SkillRow'++const SKILL_KINDS: ReviewSkillKind[] = ['perspective', 'blind_spots', 'validator', 'resolution']++function capitalize(text: string): string {+ return text.charAt(0).toUpperCase() + text.slice(1)+}++/** The viewer's review skills for the Deep reviews they start, always open. */+export function ReviewSkillsPanel(): JSX.Element {+ const { perspectives, blindSpots, validators, resolutionSkills, savingSkillNames, creatingSkillKind } =+ useValues(reviewHogSettingsLogic)+ const {+ togglePerspective,+ selectBlindSpots,+ selectValidator,+ selectResolutionSkill,+ startSkillAuthorTask,+ openAdoptSkillModal,+ } = useActions(reviewHogSettingsLogic)++ const enabledCount = perspectives?.filter((perspective) => perspective.enabled).length ?? 0++ return (+ <section className="@container flex flex-col overflow-hidden rounded border border-primary bg-surface-primary">+ <header className="flex flex-wrap items-start justify-between gap-x-4 gap-y-1 px-4 py-3">+ <div className="flex max-w-160 min-w-0 flex-col gap-1">+ <div className="flex flex-wrap items-center gap-2">+ <h3 className="m-0 text-base font-semibold">Review skills</h3>+ <LemonTag type="highlight" size="small">+ Deep reviews only+ </LemonTag>+ </div>+ <p className="m-0 text-xs text-secondary">+ Skills tell a Deep review what to look for and what to publish. Standard uses its own fixed set+ and reads none of these. Switch a skill on or off for the Deep reviews you start.+ </p>+ </div>+ </header>+ <div className="hidden grid-cols-[minmax(0,1fr)_minmax(0,16rem)] gap-3 border-t border-primary px-4 py-1.5 text-xxs font-semibold uppercase tracking-wide text-secondary @min-[48rem]:grid">+ <span>Skill</span>+ <span>Mine</span>+ </div>++ <SkillGroupHeader+ title="Perspectives"+ rule="the angles a Deep review reads the code from · several can run · at least one stays on"+ />+ {perspectives === null ? (+ <div className="px-4 py-2">+ <LemonSkeleton className="h-12 w-full" />+ </div>+ ) : (+ perspectives.map((perspective) => (+ <SkillRow+ key={perspective.skill_name}+ skillName={perspective.skill_name}+ description={perspective.description}+ mine={+ <LemonSelect<'on' | 'off'>+ size="small"+ aria-label={`Mine: ${prettifySkillName(perspective.skill_name)}`}+ value={perspective.enabled ? 'on' : 'off'}+ options={[+ { value: 'on', label: 'On' },+ { value: 'off', label: 'Off' },+ ]}+ onChange={(value) => togglePerspective(perspective.skill_name, value === 'on')}+ disabledReason={+ savingSkillNames.includes(perspective.skill_name)+ ? 'Saving…'+ : perspective.enabled && enabledCount <= 1+ ? 'Keep at least one perspective on'+ : undefined+ }+ data-attr="review-hog-perspective-mine"+ />+ }+ />+ ))+ )}++ <SingleActiveSkillGroup+ title="Blind-spot check"+ skills={blindSpots}+ onSelect={selectBlindSpots}+ dataAttr="review-hog-blind-spots-mine"+ />+ <SingleActiveSkillGroup+ title="Validation criteria"+ skills={validators}+ onSelect={selectValidator}+ dataAttr="review-hog-validator-mine"+ />+ <SingleActiveSkillGroup+ title="Resolution criteria"+ note="Used only when Resolve is on for you"+ skills={resolutionSkills}+ onSelect={selectResolutionSkill}+ dataAttr="review-hog-resolution-mine"+ />++ <footer className="flex flex-wrap items-center gap-2 border-t border-primary px-4 py-3">+ <LemonMenu+ items={SKILL_KINDS.map((kind) => ({+ label: capitalize(REVIEW_SKILL_KIND_LABELS[kind]),+ onClick: () => startSkillAuthorTask(kind),+ }))}+ >+ <LemonButton+ type="secondary"+ size="small"+ icon={<IconPlus />}+ loading={creatingSkillKind !== null}+ data-attr="review-hog-new-skill"+ >+ New skill+ </LemonButton>+ </LemonMenu>+ <LemonMenu+ items={SKILL_KINDS.map((kind) => ({+ label: capitalize(REVIEW_SKILL_KIND_LABELS[kind]),+ onClick: () => openAdoptSkillModal(kind),+ 'data-attr': `review-hog-adopt-skill-${kind}`,+ }))}+ >+ <LemonButton type="secondary" size="small" icon={<IconSearch />} data-attr="review-hog-adopt-skill">+ Use an existing skill+ </LemonButton>+ </LemonMenu>+ </footer>+ </section>+ )+}diff --git a/products/review_hog/frontend/settings/SingleActiveSkillGroup.tsx b/products/review_hog/frontend/settings/SingleActiveSkillGroup.tsxnew file mode 100644index 000000000000..2cf4dca9b2ed--- /dev/null+++ b/products/review_hog/frontend/settings/SingleActiveSkillGroup.tsx@@ -0,0 +1,73 @@+import { useValues } from 'kea'++import { LemonSelect, LemonSkeleton } from '@posthog/lemon-ui'++import { reviewHogSettingsLogic } from 'products/review_hog/frontend/reviewHogSettingsLogic'+import { prettifySkillName } from 'products/review_hog/frontend/skillNames'++import { SkillGroupHeader } from './SkillGroupHeader'+import { SkillRow } from './SkillRow'++interface SingleActiveSkill {+ skill_name: string+ description: string+ active: boolean+}++/** A kind of skill where one runs: the active skill's row, with a select to switch to another. */+export function SingleActiveSkillGroup({+ title,+ note,+ skills,+ onSelect,+ dataAttr,+}: {+ title: string+ note?: string+ skills: SingleActiveSkill[] | null+ onSelect: (skillName: string) => void+ dataAttr: string+}): JSX.Element {+ const { savingSkillNames } = useValues(reviewHogSettingsLogic)+ const active = skills?.find((skill) => skill.active) ?? null+ const saving = !!skills?.some((skill) => savingSkillNames.includes(skill.skill_name))++ const select = skills?.length ? (+ <LemonSelect+ size="small"+ aria-label={`Mine: ${title}`}+ value={active?.skill_name ?? null}+ placeholder="Pick a skill"+ options={skills.map((skill) => ({+ value: skill.skill_name,+ label: prettifySkillName(skill.skill_name),+ }))}+ onChange={(skillName) => skillName && skillName !== active?.skill_name && onSelect(skillName)}+ disabledReason={saving ? 'Saving…' : undefined}+ className="max-w-full"+ data-attr={dataAttr}+ />+ ) : null++ return (+ <>+ <SkillGroupHeader title={title} rule="one runs" note={note} />+ {skills === null ? (+ <div className="px-4 py-2">+ <LemonSkeleton className="h-12 w-full" />+ </div>+ ) : select === null ? (+ <span className="px-4 py-2 text-xs text-secondary">No skill of this kind yet.</span>+ ) : active === null ? (+ // An archived skill leaves the rest inactive and the review falls back to the built-in skill,+ // so the select must stay reachable.+ <div className="flex flex-wrap items-center justify-between gap-2 px-4 py-2">+ <span className="text-xs text-secondary">None selected, so the built-in default runs.</span>+ {select}+ </div>+ ) : (+ <SkillRow skillName={active.skill_name} description={active.description} mine={select} />+ )}+ </>+ )+}diff --git a/products/review_hog/frontend/settings/SkillGroupHeader.tsx b/products/review_hog/frontend/settings/SkillGroupHeader.tsxnew file mode 100644index 000000000000..8d7ec9d038b2--- /dev/null+++ b/products/review_hog/frontend/settings/SkillGroupHeader.tsx@@ -0,0 +1,10 @@+/** The heading of one kind of review skill inside the review skills panel. */+export function SkillGroupHeader({ title, rule, note }: { title: string; rule: string; note?: string }): JSX.Element {+ return (+ <div className="flex flex-wrap items-baseline gap-x-2 gap-y-0.5 border-t border-primary px-4 pt-3 pb-1">+ <h4 className="m-0 text-sm font-semibold">{title}</h4>+ <span className="text-xs text-secondary">{rule}</span>+ {note && <span className="text-xs text-secondary">· {note}</span>}+ </div>+ )+}diff --git a/products/review_hog/frontend/settings/SkillRow.tsx b/products/review_hog/frontend/settings/SkillRow.tsxnew file mode 100644index 000000000000..80ec1dd57ef3--- /dev/null+++ b/products/review_hog/frontend/settings/SkillRow.tsx@@ -0,0 +1,40 @@+import { IconExternal } from '@posthog/icons'+import { Link } from '@posthog/lemon-ui'++import { urls } from 'scenes/urls'++import { prettifySkillName } from 'products/review_hog/frontend/skillNames'++/** One review skill: its name, what it does, and the viewer's control for it. */+export function SkillRow({+ skillName,+ description,+ mine,+}: {+ skillName: string+ description: string+ mine: JSX.Element+}): JSX.Element {+ return (+ <div className="grid grid-cols-1 items-center gap-2 px-4 py-2 @min-[48rem]:grid-cols-[minmax(0,1fr)_minmax(0,16rem)] @min-[48rem]:gap-3">+ <div className="flex min-w-0 flex-col gap-0.5">+ <span className="text-sm font-semibold">{prettifySkillName(skillName)}</span>+ <span className="text-xs text-secondary">{description}</span>+ <div className="flex flex-wrap items-center gap-x-3 gap-y-1">+ <Link+ to={urls.skill(skillName)}+ target="_blank"+ className="inline-flex items-center gap-0.5 text-xs"+ data-attr="review-hog-edit-skill-text"+ >+ Edit text for the project <IconExternal className="size-3" />+ </Link>+ </div>+ </div>+ <div className="flex min-w-0 flex-wrap items-center gap-1">+ <span className="text-xs text-secondary @min-[48rem]:hidden">Mine:</span>+ {mine}+ </div>+ </div>+ )+}diff --git a/products/review_hog/frontend/skillNames.ts b/products/review_hog/frontend/skillNames.tsnew file mode 100644index 000000000000..43ade508df12--- /dev/null+++ b/products/review_hog/frontend/skillNames.ts@@ -0,0 +1,8 @@+/** "review-hog-perspective-logic-correctness" → "Logic correctness" */+export function prettifySkillName(skillName: string): string {+ const cleaned = skillName+ .replace(/^review-hog-(perspective|blind-spots|validation|resolution)-/, '')+ .replace(/[-_]/g, ' ')+ .trim()+ return cleaned ? cleaned.charAt(0).toUpperCase() + cleaned.slice(1) : skillName+}