Add settings plugin: per-plugin TOML config over schema defaults#40
Open
gering wants to merge 2 commits into
Open
Add settings plugin: per-plugin TOML config over schema defaults#40gering wants to merge 2 commits into
gering wants to merge 2 commits into
Conversation
Phase 1 (config surface only — consumer wiring is a follow-up): - New `settings` plugin (v0.1.0) with `scripts/settings.py` (Python 3.11+ stdlib, tomllib) and the `/settings` skill. Subcommands: list, show [--overrides], get, set, unset, validate, defaults. `show` and `get` both return the effective (resolved) config by default; `show --overrides` shows only what the user changed. - Ownership model: each plugin ships `schema/settings.schema.json` (a JSON-Schema subset carrying types, enums, required, defaults, and the config filename). The settings plugin owns discovery, resolve, validate, and IO. - Schemas for work-system, knowledge-system, pr-flow. Defaults reflect *current* behavior (e.g. worktrees_dir = .claude/worktrees), with the neutral migration target gated behind [compat] toggles / mode.knowledge_mode — stored now, acted on later. - `[related_projects]` sibling-project address book (string or table entries); missing path is a warning, not an error. - `set`/`unset` write only overrides; defaults stay in the schema. TOML comment preservation is deferred (documented). - Tests in scripts/test_settings.py (run by check-structure.py): defaults, resolve merge, validation (type/enum/unknown/related-projects), TOML round-trip, coercion, CLI set/get/unset cycle. - README documents the schema format and the consumer contract; CHANGELOG, top-level README, CLAUDE.md plugin list, and marketplace.json updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ToUjTdtMa9oXUwjfgERkXL
Address swarm review findings on the settings CLI (all in settings.py): - TOML string values now escape control chars (\n, \t, … via short forms + \uXXXX), so a value with a newline no longer writes a file tomllib refuses to reparse (#1). - dump_toml quotes table-name and key segments that aren't bare-key-safe, so a related_projects entry like `web api` / `a.b` survives a rewrite (#7). - config_filename rejects any x-config-file that isn't a plain basename (absolute, `..`, `~`, nested), so a malformed schema can't write/unlink outside the project root (#3). - `set` classifies the target against the schema: setting a section (#5) or descending past a scalar leaf (#8) is now a clear error, not a crash or silent mis-nest. - `set` gates the write on schema validity — a coerced array with wrong element types (#4) or a mistyped dynamic related_projects field (#6) is refused instead of silently writing an invalid config. Tests: serializer round-trip (control chars + non-bare keys), config-filename sandbox, and the four set-path guards. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ToUjTdtMa9oXUwjfgERkXL
gering
force-pushed
the
task/plugin-settings-system
branch
from
July 18, 2026 11:04
7f2658a to
4dc7fad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tasks/,.claude/worktrees/,task/, …).schema/settings.schema.json(types, enums, defaults, config filename); the settings plugin owns the infrastructure (discover → resolve → validate → read/write).Changes
plugins/settings/—scripts/settings.py(Python 3.11+ stdlib,tomllib) +/settingsskill. Subcommands:list,show [--overrides],get,set,unset,validate,defaults.show/getreturn the resolved config by default.plugins/{work-system,knowledge-system,pr-flow}/schema/settings.schema.json.[related_projects]sibling-project address book (string or{path,role,tags}table form); a missing path warns, never errors.scripts/test_settings.py(run bycheck-structure.pyin CI): defaults, resolve merge, validation (type/enum/unknown/related-projects), TOML round-trip, coercion, CLI set/get/unset cycle.Readiness
check-structure.py) — 0 errors (2 pre-existing warnings in unrelated files)settings validateclean against all three real schemasmainTest plan
python3 scripts/check-structure.pyis greenpython3 plugins/settings/scripts/settings.py show work-systemshows the resolved configsettings set work-system.paths.tasks_dir todoswrites only the override;unsetprunes itsettings set knowledge-system.mode.knowledge_mode bogusis rejected (enum)🤖 Generated with Claude Code