Downstream Skill Inventory Analysis

A full compact-history `$analyze-sessions` report on whether downstream repositories need a skill-copy cleanup workflow, an inventory/version-drift workflow, or a combined approach.

Skill: analyze-sessionsGenerated: 2026-05-31Artifact: alignment/analyze-sessions-downstream-skill-inventory.html

Executive Summary

Verdict: build or extend an inventory-first workflow, not a standalone cleanup-first skill.

The repo already has the primitives for cleanup and refresh: managed skill markers, per-repo drift detection, `scripts/pack.sh doctor`, `scripts/pack.sh refresh`, global init/update, pins, and update modes. The missing surface is a cross-repository inventory that lists every downstream repo's installed skill copies against canonical source versions and hashes, then proposes safe remediation.

The cleanup behavior should exist, but only as an explicit apply mode after the inventory report. Default behavior should be read-only and should distinguish `ok`, `stale`, `unknown`, `pinned`, `missing-source`, non-managed local roots, and active-session reload requirements.

For one repository, this is mostly already covered by `$sync` plus `scripts/pack.sh doctor`. For many downstream repos, the right owner is the fleet/control-repo layer, either as a new project-fleet skill such as `skill-install-inventory` or a focused project-fleet lane. The report should use the existing `doctor` and `refresh` mechanics rather than inventing a second cleanup implementation.

Scope And Method

11,833compact user-history messages parsed
3,598unique Claude/Codex sessions
684Codex rollout metadata files used for CWD enrichment
2025-12-13 to 2026-05-31UTC history date range

Sources read:

No hidden system/developer prompts, tool output text, or base instruction payloads were counted as user prompt patterns. The counts below come from visible user compact histories.

Overview Stats

SourceUser messagesSessionsNotes
Claude9,9022,982Largest source; includes older workflow and skill-library history.
Codex1,931616Enriched with 684 rollout metadata records where session IDs matched.
Total11,8333,598Full compact user-history scope, not a sample.
Top projectMessagesRelevance to this question
`/home/georgeqle/projects/tools/dev/agentic-skills`447Primary skill-library and pack-management evidence source.
`/home/georgeqle/projects/tools/dev/claude-skills`347Older skill-library history; includes symlink/copy and context-pollution discussion.
`/home/georgeqle/projects`407Cross-project and install-management prompts.
`/home/georgeqle/projects/web/dev/gblock-party-redux`not top-15 totalContains explicit symlink vs copy context-usage question.

Categorized Patterns

PatternCountSessionsSource splitInterpretation
Skill/pack plus copy/version/downstream/inventory/cleanup concepts116101Combined derived categoryDirectly supports a durable skill-install drift/inventory surface.
Pack install, refresh, reload, missing-skill, skill visibility625730 Codex / 32 ClaudeUsers repeatedly need help understanding how installs become visible and when refresh/reload is needed.
Managed copies, symlinks, real-file installs, context pollution21196 Codex / 15 ClaudeDirectly supports preserving optionality between track-latest copies and pinned/frozen versions.
Canonical version, source drift, stale installs, pinned/latest444015 Codex / 29 ClaudeVersion drift is a recurring concern, but usually as a report/check before action.
Downstream or project-local repo scope212013 Codex / 8 ClaudeThe cross-repo dimension is real but narrower than the generic install/visibility pattern.
Inventory/audit/list/status/doctor language941682117 Codex / 824 ClaudeBroad and noisy category; supports preference for report-first workflows but is not all skill-install related.
Cleanup/prune/remove/repair language13012516 Codex / 114 ClaudeBroad and noisy; direct skill-install cleanup evidence is much smaller than inventory/visibility evidence.
`sync` skill usage or sync-freshness requests484437 Codex / 11 ClaudePer-repo status and freshness checks already have an owner surface.

Representative Examples

DateSourceProjectExamplePattern
2026-05-31Codex`agentic-skills``$analyze-sessions should we have a skill which cleans up all copies ... Or have an inventory skill which can list the current versions and the current canonical version?`Current direct request.
2026-05-30Codex`agentic-skills``canonically, are we using symlinks or copies of skills in the downstream repos?`Copy/symlink policy.
2026-05-30Codex`agentic-skills``downstream repos should commit .agents/project.json, not generated .claude/skills or .codex/skills; those are recreated by $pack / scripts/pack.sh refresh?`Generated roots and safe refresh boundary.
2026-05-29Claude`agentic-skills``... transitioning away from symlinks toward copies ... update a certain skill and then the downstream skill can't detect that it is not the canonical skill ... optionality there`Version drift and pin/latest tradeoff.
2026-05-29Claude`gblock-party-redux``is it better to do symlinks or copy? From a context usage perspective, which is better to avoid context pollution?`Copy model and context cost.
2026-04-13Codex`agentic-skills``what's the skill to install packs and will that skill clean up the stubs per project once it's been invoked?`Install cleanup expectation.

Repository Evidence

ArtifactObserved factDecision relevance
`docs/packs.md`Managed installs are copies stamped with `.agentic-skills-managed`; marker records `source_version` and `source_sha`; `doctor` reports drift; `refresh` re-copies installs; pins are frozen symlinks.The repo already has the per-repo model needed for inventory and safe refresh.
`scripts/skill-links.sh``skill_install_status` reports `ok`, `stale`, `unknown`, `missing-source`, `pinned`, or `not-managed`. Its own comment says local edits inside installed copies are intentionally out of scope.A new inventory workflow should reuse this engine and add local-edit detection only if needed.
`scripts/pack.sh doctor`Read-only drift report for current project-local managed installs; exits non-zero when stale and prints `Fix: scripts/pack.sh refresh`.Cleanup should call existing refresh after report approval, not reimplement deletion logic.
Mirrored `sync` skills`$sync` and `/sync` already run `scripts/pack.sh doctor`, fold stale installs into the status report, and explicitly must not mutate during plain sync.Per-repo inventory exists; cross-repo fleet inventory is the missing layer.
`scripts/skill-drift-hook.sh`Opt-in session-start hook warns by default or auto-refreshes when preferences/project update mode enable it.Automatic cleanup already exists as an opt-in trigger, so a new cleanup-first skill would duplicate policy.
`packs/project-fleet`Project-fleet is the existing pack for central control repositories that coordinate many downstream repositories with status dashboards, guarded batches, and blocker ledgers.Fleet-level skill install inventory belongs here or should be implemented as a project-fleet lane.

Current Repo Doctor Smoke

I ran `scripts/pack.sh doctor` in this repository as a non-mutating smoke. It reported the current project update mode as `warn (default)` and found tracked local skill roots with mixed statuses:

This is strong practical evidence for inventory-first UX: even in the master repo, the actionable answer is not "delete all copies." It is "show status, classify the reason, then choose refresh, pin, ignore, or repair source paths."

Recommendation

Recommended Shape

Create or extend a fleet-level, report-first workflow tentatively named `skill-install-inventory` or `skill-drift-inventory`. It should live in the project-fleet/gitops boundary:

The durable gap is fleet inventory. The cleanup primitive already exists as `scripts/pack.sh refresh` for project-local pack installs and init/update for global installs.

Default Behavior

Apply Mode

Add cleanup only as an explicit apply mode after a report:

Ranked Recommendations

RankPatternFrequencyRecommendation typeSuggested surface
1Need to know which skill copies are stale across repos116 relevant messages / 101 sessionsSkill or project-fleet lane`skill-install-inventory` report-first workflow.
2Per-repo install drift and sync status48 sync-related sessions plus current contractsExisting skill extensionKeep `$sync`/`/sync` as per-repo owner; ensure output is easy to read.
3Cleanup/refresh after inventoryDirect cleanup prompts are sparse; refresh commands already existExplicit apply modeUse `scripts/pack.sh refresh`, `init` update, and existing update modes.
4Pin/latest optionalityExplicit May 29 tradeoff prompt plus docsStanding policy in workflowNever auto-overwrite pinned installs; show frozen versions clearly.
5Local edits to installed copiesRepo engine says out of scopeOptional detectorAdd target-copy hash comparison only if downstream repos may hand-edit managed roots.

Highest-Impact Automations

  1. Fleet inventory report over downstream repos: avoids manual `doctor` runs and status copy/paste across many projects.
  2. Action plan grouping: `refresh now`, `pinned`, `missing-source`, `unknown marker`, and `manual review` buckets.
  3. Safe apply mode that delegates to `scripts/pack.sh refresh` with dry-run/report output first.
  4. Integration with `$sync` so single-repo and fleet reports use one vocabulary.
  5. Optional local-edit detector for managed roots, because the current drift engine intentionally does not detect edits to the copied install itself.

Portability Addendum (2026-06-07)

Follow-up finding: downstream inventory scripts are not ready to recommend for broad manual use until they are either macOS-stock-Bash compatible or explicitly documented as requiring Bash 4+ or Node.

The inventory-first recommendation still stands, but portability is now a precondition. The scriptability investigation observed Bash 3.2 failures on this macOS host in scripts that use Bash 4-only constructs such as associative arrays or mapfile. That matters because downstream/manual inventory workflows are most valuable when they can run from ordinary developer machines without hidden shell-version assumptions.

Script surfaceObserved portability issueImplication for downstream inventory
packs/project-fleet/{claude,codex}/skill-inventory/scripts/skill-inventory.shFailed under Bash 3.2 due to Bash 4-only constructs.Do not recommend as a stock macOS manual script until rewritten or explicitly gated.
scripts/skill-deps.shFailed under Bash 3.2 due to Bash 4-only constructs.Dependency inventory needs a Bash 3.2-compatible path or a declared Bash 4+ requirement.
scripts/skill-versions.shFailed under Bash 3.2 due to Bash 4-only constructs.Version inventory cannot be treated as portable until the shell requirement is explicit.
scripts/skill-next-step-routing.shFailed under Bash 3.2 due to Bash 4-only constructs.Routing inventory should not become a downstream/manual prerequisite without portability remediation.

scripts/pack.sh remains the best script-first precedent, but fleet inventory should not blindly inherit runnable-script assumptions from adjacent helper scripts. Similarly, the compile-central-alignment follow-up points to a deterministic algorithm that should be extracted carefully, while the scripts/init-agentic-skills.sh documentation/path mismatch shows that a script recommendation is only useful when the documented path exists.

Amended Recommendation

Evidence Matrix

ClaimEvidenceInferenceConfidenceAssumption statusDecision impact
Inventory should be primary. Current request asks cleanup vs inventory. Full compact histories show 116 skill-install/version/copy relevant messages across 101 sessions; current repo `doctor` produces mixed statuses rather than a single cleanup answer. The user need is to understand state and safe action. Cleanup is downstream of classification. High Evidence-backed for workflow shape; actual downstream stale count not yet scanned. Design default as read-only inventory.
Standalone automatic cleanup would be risky. Docs define pinned installs as frozen; the May 29 prompt explicitly wants optionality for people who prefer a version. `scripts/skill-drift-hook.sh` already supports opt-in auto-refresh. Blind cleanup would erase a valid "pinned/frozen" choice or duplicate existing update-mode behavior. High Evidence-backed. Cleanup must be explicit apply mode, not default.
Per-repo status already has an owner. `sync` skills run `scripts/pack.sh doctor`, report stale/unknown/pinned installs, and do not mutate. `scripts/pack.sh doctor` is read-only. A new single-repo skill would be mostly duplicate; improvements should extend `$sync` or `doctor` output. High Evidence-backed. Do not create redundant per-repo cleanup skill.
Fleet inventory is the missing layer. Project-fleet exists for control repos managing many downstream repos. `doctor` scans only the current project. The user asks about downstream repos not this master repo. The cross-repo traversal, aggregation, and action-plan reporting do not currently appear as a dedicated skill surface. Medium-high Evidence-backed for gap; needs actual downstream root list to validate exact implementation scope. Put the new workflow in project-fleet or a project-fleet-adjacent pack.
The existing drift engine is good enough for canonical moved, but not complete inventory. `scripts/skill-links.sh` says `skill_install_status` detects canonical moved, not local edits to the install itself. Inventory should surface this caveat and optionally add target-copy hashing when needed. High Evidence-backed. Scope a local-edit check as optional or Phase 2.

Assumptions And Confidence

ConclusionConfidenceWhat could change it
Inventory-first is the right default.HighIf downstream repos are all disposable generated repos where no one pins or edits skill roots, cleanup-first could be acceptable for that narrow fleet.
Use existing `doctor`/`refresh` primitives.HighIf those scripts cannot run from downstream repos due launcher resolution issues, the inventory skill must repair launcher resolution first.
New cross-repo surface belongs with project-fleet.Medium-highIf the desired scope is only "current repo before each sync", then extending `$sync` is enough and no new fleet skill is needed.
Actual downstream stale volume is unknown.MediumA real scan over the intended repo roots could show most repos already current, shifting this from a skill to a recurring check.

Alternatives Considered

AlternativeProsConsVerdict
Standalone cleanup skillSimple mental model for "make my repos current."Risky default; duplicates `refresh`; may override pins; hides diagnosis.Reject as primary. Keep as explicit apply mode.
Only document existing commandsNo new skill maintenance.Does not solve multi-repo inventory or action grouping.Insufficient for downstream fleet use.
Extend `$sync` onlyStrong per-repo owner; already checks drift.Sync is scoped to one repo; scanning many downstream repos would bloat a daily primitive.Good for per-repo polish, not fleet inventory.
Project-fleet lane or new skillMatches control-repo/downstream model; can aggregate, batch, and guard mutations.Needs repo-root discovery and clear apply safety.Recommended.

Review Gates

Evidence Coverage Gate

Is the evidence sufficient to choose an inventory-first workflow shape?

Candidate Verdict Gate

Which candidate should move forward?

Scope Gate

What should the initial implementation be allowed to mutate?

Proposed File Changes Gate

What artifact should be produced after this report is approved?

Compile Answers

Use feedback-only YAML for concerns or clarification before final approval. Use final answers when every required gate has a selected option.