Skip to content

Add common-sense-beta plugin with Claude 2028 rules - #236

Draft
nsheaps wants to merge 12 commits into
mainfrom
claude/common-sense-beta-plugin-1TK2f
Draft

nsheaps wants to merge 12 commits into
mainfrom
claude/common-sense-beta-plugin-1TK2f

Conversation

@nsheaps

@nsheaps nsheaps commented Mar 11, 2026

Copy link
Copy Markdown
Owner

What

Introduces the common-sense-beta plugin, a new Claude Code plugin that bundles ten behavioral rules inspired by the Claude 2028 platform. On session start, the plugin automatically symlinks its rules into the project's .claude/rules/ directory so they are loaded as context without manual configuration.

The plugin includes:

  • 10 markdown rule files covering best practices (read-the-whole-thing, say-i-dont-know, no-policy-after-midnight, source-your-claims, listen-to-the-quiet-signals, fact-check-before-shipping, rupture-and-repair, kindness-compounds, presence-over-performance, nobody-gets-left-behind)
  • A SessionStart hook that creates symlinks and optionally syncs rules to user scope or other repositories
  • Configurable behavior via plugins.settings.yaml (user-level sync, cross-repo sync, settings file target)
  • Plugin metadata and release configuration

Why

These rules codify a philosophy of careful, honest, and thoughtful AI assistance. By bundling them as a plugin with automatic symlink injection, they become part of the context Claude Code loads on every session without requiring manual setup or documentation reading. This makes best practices frictionless and discoverable.

How

  • Plugin structure: Standard Claude Code plugin layout with .claude-plugin/plugin.json, configuration file, and hooks
  • SessionStart hook (sync-rules.sh):
    • Creates symlink from .claude/rules/common-sense-beta to the plugin's rules directory
    • Cleans up stale symlinks from previous plugin installations
    • Optionally syncs to user-level rules directory (alsoSyncToUser)
    • Optionally adds plugin to sibling repositories by org or wildcard (alsoAddToRepos)
    • Respects configuration for which settings file to write to (syncSettingsTarget)
  • Configuration: Three optional settings with sensible defaults (all disabled by default to avoid side effects)
  • Rules: Each rule is a standalone markdown file with clear guidance and rationale

Validation steps

  • Plugin loads without errors on SessionStart
  • Symlink is created at .claude/rules/common-sense-beta pointing to plugin rules directory
  • Rules are automatically loaded as context in Claude Code
  • Configuration options work as documented (alsoSyncToUser, alsoAddToRepos, syncSettingsTarget)
  • Stale symlinks from previous installations are cleaned up
  • Plugin can be disabled via enabled: false in settings

Additional Context

This is a beta plugin establishing a pattern for bundling behavioral rules. The rules themselves are inspired by the Claude 2028 platform's principles and can be refined based on feedback.

https://claude.ai/code/session_016khFDuVrykHRpjHpZChXUF

@github-actions

github-actions Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Plugin Version Status

Versions are auto-bumped in PRs. Manual bumps to higher versions are preserved.

Plugin Base Current Action
claude2028 0.0.0 0.1.0 Already bumped

@nsheaps nsheaps added the request-review Force an AI code review on a draft PR (open non-draft PRs review automatically) label Mar 11, 2026
@henry-nsheaps henry-nsheaps Bot removed the request-review Force an AI code review on a draft PR (open non-draft PRs review automatically) label Mar 11, 2026
henry-nsheaps[bot]

This comment was marked as outdated.

nsheaps pushed a commit that referenced this pull request Mar 11, 2026
Addresses review feedback on PR #236:
- Extract common sync-rules logic into shared/lib/sync-rules.sh
- Both common-sense and common-sense-beta now use thin wrappers
- Parameterize all hardcoded plugin name strings via PLUGIN_NAME variable
- Add SETTINGS_FILE global comment explaining safe_write_settings coupling
- Remove dead link to claude2028.org in README
- Bump common-sense to 1.3.3 for the refactor
- Document sync-rules.sh in shared-libs.md

https://claude.ai/code/session_016khFDuVrykHRpjHpZChXUF

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert these changes, not only are they not for the repository, but they are for a specific plug-in

@nsheaps nsheaps added the request-review Force an AI code review on a draft PR (open non-draft PRs review automatically) label Mar 15, 2026
@henry-nsheaps henry-nsheaps Bot removed the request-review Force an AI code review on a draft PR (open non-draft PRs review automatically) label Mar 15, 2026
henry-nsheaps[bot]
henry-nsheaps Bot previously approved these changes Mar 15, 2026

@henry-nsheaps henry-nsheaps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

### 👍 Great improvement — DRY extraction is clean and this is ready to merge ![](https://img.shields.io/badge/92%25-%20?style=for-the-badge&label=QUALITY&labelColor=%23444&color=%2360A060) ![](https://img.shields.io/badge/92%25-%20?style=for-the-badge&label=SECURITY&labelColor=%23444&color=%2360A060) ![](https://img.shields.io/badge/90%25-%20?style=for-the-badge&label=SIMPLICITY&labelColor=%23444&color=%2360A060) ![](https://img.shields.io/badge/90%25-%20?style=for-the-badge&label=CONFIDENCE&labelColor=%23444&color=%2360A060) ✅ DRY violation from previous review fully addressed — `shared/lib/sync-rules.sh` extracted, both plugins now thin wrappers ✅ All hardcoded strings now parameterized via `${PLUGIN_NAME}` ✅ `SETTINGS_FILE` global coupling documented with explanatory comment ✅ Plugin structure follows all repo conventions (plugin.json, hooks, settings, shared libs, .release-it.js) ✅ Settings keys use camelCase per `settings-key-naming.md` ✅ Risky features (`alsoAddToRepos`, `alsoSyncToUser`) disabled by default ✅ 10 well-written, distinct rule files ✅ `shared-libs.md` changes reverted per owner feedback ⚠️ Minor: unused variable `sync_target` in `shared/lib/sync-rules.sh:63` ([thread](https://github.com//pull/236#discussion_r2937220519)) _🖱️ Click to expand for full details_ ### Code Quality (92%) The major DRY violation flagged in the previous review has been fully resolved. The sync-rules logic now lives in `shared/lib/sync-rules.sh` with a clean API: callers set `PLUGIN_NAME`, `LINK_NAME`, and `PLUGIN_RULES_DIR`, source the lib, and call `sync_rules_run()`. Both `common-sense` and `common-sense-beta` use identical thin wrappers (18 lines each) that differ only in the plugin identity variables. The shared lib includes: - Double-source guard (`_SYNC_RULES_LOADED`) - Clear header documenting required variables and libraries - All strings derived from `PLUGIN_NAME` (patterns, log prefixes, jq keys) - Intentional global `SETTINGS_FILE` documented with comment One minor issue: `local sync_target="$1"` on line 63 of the shared lib is unused — it duplicates `repo_dir` and is never referenced. Non-blocking but should be cleaned up. Score deduction: -8% for the unused variable (minor cleanup needed). ### Security (92%) - All risky features default to disabled (`alsoSyncToUser: false`, `alsoAddToRepos: ''`) - `set -euo pipefail` in wrapper scripts - File paths properly quoted throughout - Symlink creation checks for existing real directories before clobbering - `syncSettingsTarget` has implicit safe default via else branch (falls back to `local`) - No input validation on `syncSettingsTarget` (values other than "local"/"shared" silently use "local") — safe but could be more explicit Score deduction: -8% for missing input validation on config values (safe failure mode, but could be tighter). ### Simplicity (90%) The thin wrapper pattern is clean and easy to follow. Each plugin's hook script is now 18 lines of boilerplate (set vars, source libs, call entry point). The shared lib is 157 lines but well-structured with clear section headers. Score deduction: -10% for the unused variable and the fact that the shared lib carries some complexity from cross-repo sync features that most users won't need — though this is acceptable given the opt-in design. ### Plugin Structure & Conventions - ✅ `plugin.json` has all required fields per `plugin-development.md` - ✅ External hooks file per `plugin-hooks-organization.md` - ✅ Settings keys use camelCase per `settings-key-naming.md` - ✅ Shared libs properly symlinked from `shared/lib/` - ✅ `.release-it.js` follows existing pattern - ✅ `README.md` well-structured with configuration docs ### Rules Content The 10 rule files are thoughtful, well-written, and cover distinct topics without overlap. Each is self-contained with clear bullet-point guidance and a memorable closing quote. ### Changes Since Previous Review | Issue | Status | |-------|--------| | DRY violation (sync-rules.sh copy) | ✅ Fixed — extracted to `shared/lib/sync-rules.sh` | | Hardcoded strings | ✅ Fixed — all use `${PLUGIN_NAME}` | | SETTINGS_FILE global | ✅ Fixed — comment explains intent | | `shared-libs.md` changes | ✅ Reverted per owner request | | `claude2028.org` link | Kept by author (deliberate choice) | **Recommended follow-ups** (non-blocking): - Remove the unused `sync_target` variable in `shared/lib/sync-rules.sh:63` - Consider adding input validation for `syncSettingsTarget` (warn if value isn't "local" or "shared") - Update `shared-libs.md` documentation to include `sync-rules.sh` as a shared library (in a separate PR scoped to repo-level docs) [^1]: Workflow Run: https://github.com/nsheaps/ai-mktpl/actions/runs/23117342247/attempts/1 [^2]: PR: [#236](https://github.com//pull/236)]]>

Comment thread shared/lib/sync-rules.sh
Comment on lines +62 to +64
local repo_dir="$1"
local sync_target="$1"
local target_file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: sync_target is assigned but never used — appears to be a leftover from the refactor. Only repo_dir is referenced in the function body.

Suggested change
local repo_dir="$1"
local sync_target="$1"
local target_file
local repo_dir="$1"
local target_file

claude and others added 8 commits March 25, 2026 00:19
New plugin that captures the 10 planks from claude2028.org as automatically
injected rules via SessionStart symlink. Rules cover reading fully before
responding, admitting uncertainty, applying cooling periods, sourcing claims,
listening to quiet signals, fact-checking before shipping, rupture and repair,
kindness compounding, presence over performance, and leaving nobody behind.

https://claude.ai/code/session_016khFDuVrykHRpjHpZChXUF
Addresses review feedback on PR #236:
- Extract common sync-rules logic into shared/lib/sync-rules.sh
- Both common-sense and common-sense-beta now use thin wrappers
- Parameterize all hardcoded plugin name strings via PLUGIN_NAME variable
- Add SETTINGS_FILE global comment explaining safe_write_settings coupling
- Remove dead link to claude2028.org in README
- Bump common-sense to 1.3.3 for the refactor
- Document sync-rules.sh in shared-libs.md

https://claude.ai/code/session_016khFDuVrykHRpjHpZChXUF
- Revert common-sense plugin.json back to 1.3.2 (version bumps are
  automatic on merge, manual changes fail check-version-files CI)
- Restore claude2028.org link in common-sense-beta README

https://claude.ai/code/session_016khFDuVrykHRpjHpZChXUF
Rename all references: directory, plugin.json name/description/homepage,
settings file and YAML key, hooks description, sync-rules.sh identity,
and README.

https://claude.ai/code/session_016khFDuVrykHRpjHpZChXUF
@nsheaps
nsheaps force-pushed the claude/common-sense-beta-plugin-1TK2f branch from be7f702 to 1bd173d Compare March 25, 2026 00:21
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