Skip to content

Marketplace alignment, living-config loop, 2 agents + 3 daily skills#5

Merged
poshan0126 merged 9 commits into
mainfrom
feat/official-marketplace-alignment
Jun 12, 2026
Merged

Marketplace alignment, living-config loop, 2 agents + 3 daily skills#5
poshan0126 merged 9 commits into
mainfrom
feat/official-marketplace-alignment

Conversation

@poshan0126

Copy link
Copy Markdown
Owner

Summary

Ten commits taking dotclaude from "good reference kit" to the most rigorously engineered minimal Claude Code kit, aligned with Anthropic's official marketplace standard end to end.

Marketplace & architecture

  • Per-plugin dirs are now plugin.json + relative symlinks into the top-level source dirs — single source of truth, no sync script, no copy drift. Claude Code dereferences marketplace-internal symlinks at install.
  • Agents restructured to agents/<name>/<name>.md with directory symlinks after discovering the component scanner silently skips symlinked .md files (proven by minimal experiment; cache was fine, inventory wasn't).
  • $schema, category, keywords, owner email on all 20 entries; semver in every plugin.json (validator requires it under --strict).
  • CLAUDE.md split: real repo instructions at root; the shipped user template is now CLAUDE.template.md.

Fixes

  • Hook timeout units corrected (schema reads seconds; 5000 was an 83-minute timeout).
  • notify.sh and auto-test.sh wired; broken inline Notification one-liner replaced; SessionStart scoped to startup|resume|clear.
  • context-recovery.sh removed (Claude Code re-injects CLAUDE.md/rules after compaction natively).
  • Non-standard alwaysApply rule frontmatter dropped (no paths: = always loaded, per official spec).
  • Three agent descriptions had unquoted : in YAML — frontmatter failed to parse, agent would load with empty metadata. Quoted.

New capabilities

  • /setupdotclaude rebuilt: deep scan (reads real source/test files, monorepos, existing AI configs) → interview → evidence-based install plan; installs nothing without evidence and consent. Gap-analysis mode on existing setups. 282→145 lines.
  • Living-config loop: setup writes a manifest fingerprint; session-start.sh emits a one-line drift nudge only when the stack changes.
  • 2 new reviewer agents: silent-failure-hunter (swallowed errors, failures masked as success) and pr-test-analyzer (assertion-free tests, mock theater, tests that can't fail).
  • 3 new daily skills: /catchup (+ handoff notes), /claude-md (capture learnings / audit staleness), /fix-issue (gh issue → tested fix → PR with Fixes #N).
  • /refactor --diff (pre-commit simplify pass), /ship branch cleanup, six-specialist /pr-review with confidence buckets and deconfliction; all 7 agent descriptions rewritten as delegation triggers.
  • safety-hooks plugin: the four PreToolUse guards installable with one command.

CI & tests

  • ci.yml: hook fixtures (Linux+macOS), claude plugin validate --strict for marketplace + each plugin dir, a 1200-token always-loaded budget gate (currently ~950), and a reviewer-contract drift guard.
  • Hook test suite grown 46 → 68 fixtures (all 8 hooks covered).

Test plan

  • bash hooks/tests/run-all.sh — 68/68 on macOS (CI repeats on Linux)
  • claude plugin validate . --strict + all 20 plugin dirs
  • PyYAML parse of all 19 frontmatter blocks
  • Fresh-HOME e2e: 20/20 plugins install; every agent plugin registers exactly Agents (1), every skill plugin Skills (1), safety-hooks its PreToolUse group; setupdotclaude cache contains every path the skill references
  • Real headless sessions via --plugin-dir: /setupdotclaude runs its scan and interviews before installing; node_modules/ Write blocked live with the hook's exact deny reason

Blur-red and others added 9 commits June 5, 2026 07:33
…tion

Two macOS (BSD grep) gaps in scan-secrets.sh let real secrets through:

1. \x27 is not interpreted as a single-quote by BSD grep, so the char
   classes ["\x27] degraded to a literal set {" \ x 2 7}. Single-quoted
   credentials (password = 'value') slipped past, and double-quoted values
   containing 2/7 were truncated below the length threshold. Replaced with
   the portable '\'' form yielding the class ["'].

2. sk-[a-zA-Z0-9]{20,} broke at the first hyphen, so modern Anthropic keys
   (sk-ant-api03-...) were never matched. Allowed hyphens in the class.

Adds 10 scan-secrets fixtures (hook previously had no test coverage).
Full suite: 46 passed, 0 failed.
- marketplace.json: adopt anthropics/skills pattern (source "./" +
  strict:false component arrays), add $schema, category, keywords,
  owner email; delete plugins/ mirrors and scripts/sync-plugins.sh
- New safety-hooks plugin (hooks/hooks.json) packaging the four
  PreToolUse guards for one-command install
- Split CLAUDE.md: real repo instructions at root, shipped template
  moved to CLAUDE.template.md; setupdotclaude copies from plugin root
- settings.json: fix hook timeouts (seconds, not ms), wire notify.sh
  and auto-test.sh, scope SessionStart matcher
- Remove context-recovery.sh (Claude Code re-injects CLAUDE.md/rules
  after compaction natively)
- Rules: drop non-standard alwaysApply frontmatter (no paths: =
  always loaded per official .claude/rules spec)
- Tests: +19 fixtures covering warn-large-files, format-on-save,
  session-start, auto-test, notify (65 total, all passing)
- CI: ci.yml replaces hook-tests.yml, adds claude plugin validate
  --strict job; docs updated (README tree, CONTRIBUTING, rules/hooks
  READMEs, format-on-save auto-detection)

Verified: claude plugin validate . --strict passes; end-to-end
marketplace add + install of safety-hooks/code-reviewer/explain in
isolated HOME succeeds.
The skill previously copied the entire kit into .claude/ and trimmed a
few files afterward. Now it works additively:

- Phase 1 deep scan goes beyond manifests: reads real source and test
  files (naming, error handling, assertion style), detects monorepos,
  existing AI configs (.cursorrules, AGENTS.md, copilot-instructions)
  to migrate, git workflow, and domain language from docs
- Phase 2 structured interview (batched AskUserQuestion, multiSelect):
  confirm detection, monorepo focus, setup size (Minimal / Standard /
  Full / pick), justified-only skill and hook choices with plain
  cost/impact warnings (e.g. auto-test runs on every edit)
- Phase 3 install-plan manifest: every component needs evidence (hard
  mapping table) and approval; settings.json is generated to wire only
  installed hooks and only real project commands
- Phase 4 applies exactly the plan: per-file copy in fresh mode, gap
  analysis (add missing / propose removing unjustified) on existing
  .claude/; never clobbers user edits without showing the diff
- Phase 5 verify: CLAUDE.md line budget, always-loaded token estimate,
  mechanical checks, installed/skipped/customized summary

282 -> 145 lines. README, skills/README, and marketplace description
updated to match. claude plugin validate --strict passes.
…e "./"

claude plugin details exposed that source "./" made default component
discovery load ALL skills/agents (even agents/README.md) into every
plugin (~604 always-on tokens each). Restore plugins/<name>/ dirs, but
as relative symlinks into the top-level dirs — Claude Code dereferences
marketplace-internal symlinks at install, so single source of truth is
kept with no sync script.

- plugins/<name>/: generated plugin.json ($schema, semver 2.0.0,
  metadata matching marketplace entry) + component symlinks
- hooks/hooks.json moved into plugins/safety-hooks/hooks/ with script
  symlinks; setupdotclaude regains template/ (all symlinks, incl.
  template/CLAUDE.md -> CLAUDE.template.md)
- marketplace entries back to source "./plugins/<name>", strict mode,
  no component arrays; versions live only in plugin.json
- CI also strict-validates each plugin dir; docs updated (CLAUDE.md,
  CONTRIBUTING, README, hooks/README, setupdotclaude SKILL paths)
Drift loop (keeps the setup tuned across daily iteration):
- session-start.sh gains a manifest fingerprint: DOTCLAUDE_FINGERPRINT=1
  prints {setup_date, manifest_hash} (package.json scripts via jq -S,
  other manifests wholesale, POSIX cksum)
- /setupdotclaude Phase 5 writes .claude/.dotclaude.json at the end of
  setup; session-start then emits a one-line "config drift" nudge only
  when the manifests change — zero tokens otherwise
- skill closes with an explicit re-run cadence; re-runs are gap
  analyses, not reinstalls
- 3 new fixtures (fingerprint mode, drift detected, no-drift silent)
  with data/ meta files; 68 tests total

Token efficiency (enforced, not aspirational):
- new CI token-budget job: fails PRs pushing always-loaded content
  (CLAUDE.template.md + rules without paths:) past ~1200 est. tokens
  (currently ~950)
- trimmed the two heaviest skill descriptions (context-budget 302->190,
  setupdotclaude 204->140 chars) — descriptions load in every session's
  skill listing
- README "Keep it tuned" section; hooks/README + CONTRIBUTING updated
…tions

Agents:
- All 5 descriptions rewritten as delegation triggers ("Use after/when
  ...") — the description is the surface the main agent delegates on
- New silent-failure-hunter: swallowed errors, failures masked as
  success, fallback values hiding breakage, floating promises, retries
  that never surface (archetype from official pr-review-toolkit)
- New pr-test-analyzer: test critique, not generation — assertion-free
  tests, mock theater, tests that cannot fail, weakened assertions
- frontend-designer: states plan before writing, smallest
  interpretation, mixed-CSS tiebreaker

pr-review: six-specialist dispatch table, concrete Agent() call syntax,
per-finding confidence scores with 90+/80-89 buckets, deconfliction
rules for overlapping fixes, allowed-tools for gh/git

Skills:
- New /catchup: rebuild context after /clear (handoff note + branch
  state); `handoff` mode writes .claude/HANDOFF.md at session end
- New /claude-md: capture session learnings into CLAUDE.md (confirmed,
  one line each) or `audit` for stale commands and bloat; enforces the
  25/50 budget
- New /fix-issue: gh issue thread -> reproduce -> fix + regression test
  -> acceptance criteria -> PR with Fixes #N
- /refactor --diff: pre-commit simplify pass scoped to the working diff
- /ship Step 5: prune local branches whose remotes are gone (-d only)
- test-writer: sharper auto-trigger criteria + allowed-tools

Distribution: 5 new plugins (1.0.0) with symlinked dirs; 10 changed
plugins bumped to 2.1.0; CI gains a reviewer-contract drift guard
(confidence threshold + required sections in all 6 reviewers); READMEs,
structure tree, and setupdotclaude evidence table updated. 20 plugins
total, all strict-validated; 68 hook tests pass; budget ~950/1200.
claude plugin details showed Agents (0) for every agent plugin: the
component scanner skips symlinked .md FILES (while following symlinked
skill DIRECTORIES; install cache dereferenced both correctly). Verified
with a minimal two-plugin experiment: real file -> Agents (1), file
symlink -> Agents (0), dir symlink containing a real file -> Agents (1).

Fix: agents/<name>/<name>.md (real files, still single source of truth)
and plugins/<name>/agents -> ../../agents/<name> directory symlinks.
Official docs confirm .claude/agents/ and plugin agents/ are scanned
recursively with identity from the name frontmatter field, so the
nested layout is safe for clone users and the template.

Updated: CI contract-guard paths, setupdotclaude mapping table + copy
example, agents/README, root README tree, CONTRIBUTING symlink rule
("always symlink directories, never .md files").
Unquoted ': ' inside YAML scalars broke frontmatter parsing for
security-reviewer, doc-reviewer, and silent-failure-hunter — at runtime
the agent would load with empty metadata (no description = never
delegated to). Hidden until now because the old file symlinks were
skipped by the component scanner entirely; the dir-symlink restructure
made per-plugin validation actually parse agent frontmatter.
- skills/README: test-writer trigger criteria match its frontmatter
- CONTRIBUTING: agents file-requirements row reflects dir-per-agent
  layout and delegation-trigger description requirement
- marketplace + plugin.json for ship (branch cleanup) and refactor
  (--diff mode) mention their new capabilities
@gitguardian

gitguardian Bot commented Jun 12, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
33922463 Triggered GitHub Personal Access Token 7e52a9c hooks/tests/fixtures/scan-secrets/07-block-github-token.json View secret
33922464 Triggered PostgreSQL Credentials 7e52a9c hooks/tests/fixtures/scan-secrets/09-block-conn-string-creds.json View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@poshan0126
poshan0126 merged commit e22d405 into main Jun 12, 2026
5 checks passed
poshan0126 added a commit that referenced this pull request Jun 12, 2026
GitGuardian flagged the scan-secrets test fixtures on PR #5. They are
the deliberate attack samples that prove the hook blocks secrets —
nothing real. Make that machine- and human-obvious:

- .gitguardian.yaml ignores hooks/tests/fixtures/**
- conn-string fixture now uses fake_user:fake_password_for_tests@localhost
  (the GitHub-token fixture already uses an alphabet token)
- CONTRIBUTING: fixture fakes must be unambiguous; never a real
  credential, even revoked
pull Bot pushed a commit to minhazul-ashim/dotclaude that referenced this pull request Jun 12, 2026
GitGuardian flagged the scan-secrets test fixtures on PR poshan0126#5. They are
the deliberate attack samples that prove the hook blocks secrets —
nothing real. Make that machine- and human-obvious:

- .gitguardian.yaml ignores hooks/tests/fixtures/**
- conn-string fixture now uses fake_user:fake_password_for_tests@localhost
  (the GitHub-token fixture already uses an alphabet token)
- CONTRIBUTING: fixture fakes must be unambiguous; never a real
  credential, even revoked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants