Skip to content
Back to skills

Agent Findings

ASecurity

Two lookups in `edit.tsx` read a removed skill's old config entry with `?.`, which is data that must exist:

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 9, 2026
ai-agentstypescriptgo

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add agents-inc/agents-inc --skill agent-findings --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Findings?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Findings
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/agents-inc-agent-findings-agents-inc/badge)](https://www.skillsdirectory.com/skills/agents-inc-agent-findings-agents-inc)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
type: anti-pattern
severity: low
affected_files:
  - src/cli/commands/edit.tsx
standards_docs:
  - CLAUDE.md
date: 2026-11-02
reporting_agent: cli-developer
category: typescript
domain: cli
root_cause: enforcement-gap
status: resolved
resolved_by: >-
  REPO-55's second round, commands lane, replaced both lookups with the asserting
  `installedEntryOf` already in edit.tsx. "Fix Applied" gives the class sweep and its limit.
---

## What Was Wrong

Two lookups in `edit.tsx` read a removed skill's old config entry with `?.`, which is data that
must exist:

- `applyPluginChanges` treated a removed skill as a plugin removal when
  `activeOldSkills.find((s) => s.id === id)?.origin !== EJECT_SOURCE`.
- `removeDeletedLocalSkills` skipped one when `oldSkill?.origin !== EJECT_SOURCE`.

A missing entry reads as `undefined`, which is not `EJECT_SOURCE`, so it would have been handled as
a plugin skill. It would have gone to the plugin removal and never to the local delete, and nothing
would have been said. CLAUDE.md bans `?.` on data that must exist. The file already had
`installedEntryOf`, which throws on a miss.

The miss cannot happen today. `applyApprovedChanges` runs `logChangeSummary` first, and its
`removedSkillLine` sends every removed id to `installedEntryOf` against the same entries.

## Fix Applied

Both lookups call `installedEntryOf`. Behaviour cannot change, because of the ordering above.

Class census, 2026-11-02, from `packages/cli`, for the inline shape:

```
grep -rnE '\.find\([^;]*\)\?\.' src/cli --include='*.ts' --include='*.tsx' | grep -v '\.test\.'
```

Two hits; the same grep at HEAD found three. Both remaining lookups are for data that may be absent,
and both fall back to a named default: `installedScope` in `edit.tsx` (`UNRECORDED_AGENT_SCOPE`)
and a plugin's scope in `uninstall.tsx` (`SCOPE_OF_AN_UNRECORDED_SKILL`). The two-statement shape
(`const x = list.find(…)`, then `x?.field`) has no one-line grep, so this census is a floor. One
was seen in passing, in `operations/skills/uninstall-plugin-skills.ts`, which falls back to its own
`SCOPE_OF_AN_UNRECORDED_SKILL`. It was not judged.

## Proposed Standard

None new: the CLAUDE.md rule covers it. No honest gate exists, because whether data must exist is
not visible in the syntax. A lint rule on `.find(…)?.` would flag the two named-default lookups
above as well.

Files in this skill

  • 2026-04-21-propagation-skipped-observability-gap.md10.1 KB
  • 2026-04-21-registerProjectPath-sweep-observability-gap.md6.4 KB
  • 2026-08-06-relevance-rule-leaves-custom-source-skills-on-no-agent-stack.md2.5 KB
  • 2026-08-19-a-discard-that-reports-at-migrate-time-is-silent-at-merge-time.md8.1 KB
  • 2026-08-19-five-class-fixes-were-scoped-to-the-file-the-defect-was-found-in.md14.2 KB
  • 2026-08-21-a-closed-union-refuses-a-marketplaces-own-slug-and-answers-with-somebody-elses-catalogue.md6.6 KB
  • 2026-08-21-a-null-coalesce-inside-an-assertion-erases-the-state-the-assertion-is-about.md5 KB
  • 2026-08-21-a-selector-keyed-on-a-bare-callee-reaches-one-of-the-five-shapes-a-test-title-is-written-in.md7.6 KB
  • 2026-08-21-a-spec-hand-rolled-a-reader-that-already-existed.md3.8 KB
  • 2026-08-21-an-eject-test-copies-from-a-fake-home-a-previous-test-already-deleted.md5.6 KB
  • 2026-08-21-hand-written-plugin-state-is-not-uninstallable-so-a-departure-cannot-be-asserted.md4 KB
  • 2026-08-21-the-bundle-gate-is-in-no-pre-merge-run-and-fires-at-the-deploy.md6 KB
  • 2026-08-21-the-task-id-ban-holds-at-its-two-enforceable-locations-and-nowhere-else.md10.1 KB
  • 2026-08-25-a-mocked-collaborator-can-make-loads-and-validates-assert-neither.md5.9 KB
  • 2026-08-26-a-matrix-cells-aria-label-overrides-the-word-that-is-its-whole-state.md6.8 KB
  • 2026-08-26-a-writer-branch-with-no-production-caller-is-pinned-by-a-spec-block.md6.3 KB
  • 2026-09-02-a-page-object-modelling-only-a-controls-resting-state-pushes-every-lifecycle-locator-into-the-specs.md6 KB
  • 2026-09-02-a-parsers-error-message-carries-the-input-that-broke-it.md8.1 KB
  • 2026-09-03-a-double-narrower-than-production-collapses-a-dimension-a-consumer-reads.md7 KB
  • 2026-09-25-a-mock-tool-call-no-spec-sends-was-never-checked-against-the-binary-and-the-binary-refuses-it.md2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.