Skip to content

feat(house-style): conventions per workspace + profile (Phase A) - #253

Open
an1va wants to merge 1 commit into
mainfrom
feat/house-style
Open

feat(house-style): conventions per workspace + profile (Phase A)#253
an1va wants to merge 1 commit into
mainfrom
feat/house-style

Conversation

@an1va

@an1va an1va commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

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:

  • WorkspaceOrgSettings.houseStyle (JSON; no schema change).
  • Profile → a Better Auth additionalField (JSON string), exactly like profession/about.

Changes

  • core: OrgSettings.houseStyle + HouseStyle/ThemeTokens; house-style.ts (resolveHouseStyle / parseHouseStyle / houseStyleInstructions, pure + unit-tested).
  • db: getUserHouseStyle + setUserProfile(houseStyle) across sqlite/pg/d1 (read is defensive — 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 the workspace and account sections.

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

…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>
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.

1 participant