feat(house-style): conventions per workspace + profile (Phase A) - #253
Open
an1va wants to merge 1 commit into
Open
feat(house-style): conventions per workspace + profile (Phase A)#253an1va wants to merge 1 commit into
an1va wants to merge 1 commit into
Conversation
…agents over MCP A workspace and a profile can each point at a "House Style" collection — the docs/ skills that describe how they like artifacts built. When an agent connects over MCP, those conventions are resolved (workspace ⊕ profile, profile wins), exposed as readable resources (dock://house-style/<short_id>, lazy-loaded), and summarized in a one-line instructions pointer (progressive disclosure). Nothing hardcoded; every team defines their own. Phase A of the House Style plan (visual theme is Phase B). - core: OrgSettings.houseStyle + HouseStyle/ThemeTokens types; house-style.ts with resolveHouseStyle / parseHouseStyle / houseStyleInstructions (pure, unit-tested). - data model: workspace via OrgSettings JSON (no schema change); profile via a Better Auth additionalField `houseStyle` (JSON string), alongside profession/about. New MetaStore.getUserHouseStyle + setUserProfile houseStyle across sqlite/pg/d1 (defensive read — returns null on an old/minimal user table). - api: PATCH /v1/workspace/settings + POST /v1/me/profile accept houseStyle (deep merge / null clears); mcp.ts buildServer registers a resource per convention doc (audience:assistant, priority) and appends the pointer. - web: Settings → House Style picker on both the workspace and account sections. Tests: core 262, api 606 (incl. an MCP test that seeds a collection and asserts the resources + pointer), cli/web/db/storage green; typecheck + biome clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
A House Style for each workspace and profile: a pointer to a conventions collection (the docs/skills describing how they like artifacts built). When an agent connects over MCP, the conventions are resolved (workspace ⊕ profile, profile wins), exposed as readable MCP resources (
dock://house-style/<short_id>, lazy-loaded), and summarized in a one-line instructions pointer (progressive disclosure, like Skills). Open-source: every team defines their own.This is Phase A of the plan. Phase B (per-workspace visual theme tokens applied to rendered docs) is a follow-up PR.
Prior art it borrows from
Claude Projects (knowledge + project instructions), Claude Code memory layering (workspace→user precedence) and Skills' progressive disclosure (load summary, fetch full doc on demand → MCP resources + pointer), Cursor/Copilot multi-doc scoped rules.
Data model (no auth coupling beyond the existing profile pattern)
houseStyle = { collectionId?, theme? }on both:OrgSettings.houseStyle(JSON; no schema change).additionalField(JSON string), exactly likeprofession/about.Changes
OrgSettings.houseStyle+HouseStyle/ThemeTokens;house-style.ts(resolveHouseStyle/parseHouseStyle/houseStyleInstructions, pure + unit-tested).getUserHouseStyle+setUserProfile(houseStyle)across sqlite/pg/d1 (read is defensive — null on an old/minimal user table).PATCH /v1/workspace/settings+POST /v1/me/profileaccepthouseStyle(deep-merge; null clears);mcp.ts buildServerregisters a resource per convention doc (audience:["assistant"], priority) and appends the pointer.Tests
core 262, api 606 (incl. an MCP test that seeds a House Style collection and asserts
resources/list+resources/read+ the instructions pointer), cli/web/db/storage green; typecheck + biome + precommit lints clean.🤖 Generated with Claude Code