When reviewing Clean Architecture / DDD / Hexagonal Architecture projects, the “standard answers” are scattered across the architecture tests and documentation in various reference repositories, requiring re-reading for every review. This plugin pre-indexes eight pinned reference repositories into a local FTS5 database so you can retrieve a “standard answer set” with one click before review, keep a ledger after review, and use hit statistics to feed back into curation of the reference library.

What It Is

dsh-ca-ref is a Clean Architecture reference library plugin for DSH (DeepSeek Harness), maintained by Ansonfishing and released under the MIT license.

Installation and Activation

Prerequisites: DSH (with web) + pnpm; Node ≥ 24 (node:sqlite is built into Node 24).

cd ~/.dsh/profiles/web
pnpm add github:Ansonfishing/dsh-ca-ref

After installation, add "dsh-ca-ref" to the dsh.profile.bundles array in package.json, then restart dsh. A “CA Reference Library” tab will appear in the session area.

Core Features

  • Eight pinned reference repositories: Public reference repositories for languages such as Go / Java / C# / Python, pinned to fixed commits.
  • FTS5 full-text search: Full-text search over assertions, documentation, and structure in reference repositories; Chinese is matched by substring, English uses FTS5; citations include <repo>:<path> provenance.
  • Machine-readable rule list: Each rule includes an assertion template and source, allowing a “standard answer set” for a specified language to be retrieved in one go.
  • Review ledger: Records review entries (project, language, matched rules, evidence); hit statistics can feed back into curation.
  • Observation panel: A read-only tab with a 30-second auto-refresh, displaying the baseline (repository list + rule coverage table + full card content), search records, review ledger, and hit statistics.

Typical Usage

The plugin provides the following Agent tools:

  • ca_ref_search: Full-text search the reference library for assertions / documentation / structure
  • ca_ref_baseline: Retrieve the reference repository summary card and rule list for a specified language (including 8 red flags)
  • ca_ref_record: Record a review entry (project / language / matched rules / evidence)
  • ca_ref_status: Check reference library health (pinned SHA, validation results, index status, ledger count)

There is also a command channel /ca-ref status \| search \| baseline \| ledger \| stats \| reindex for the panel (supports the --json parameter).

Configuration and Maintenance

  • Corpus path: The corpus is located at ~/AI/ca-ref by default and can be redirected elsewhere using the environment variable CAREF_CORPUS.
  • Missing data: If the corpus for a repository is missing, related search / indexing is automatically skipped (this is missing data, not a code bug).
  • Drift check: A daily tick uses git rev-parse HEAD to perform a read-only check for pinned-version drift. If drift is detected, the baseline tab in the panel displays ⚠️, and no automatic re-clone occurs.

References