Skip to content

Instructions, skills, MCP servers, secrets and templates that every project in a workspace shares #624

Open

Description

@fctl-sh

An organization with 30 projects in one workspace sets each one up on its own, and again for every change. It pastes its engineering rules into each project's Settings → Agents. It commits its Claude skills and its docs search's .mcp.json to every repository, or bakes them into an image. It sets its registry token as a secret 30 times, and rotates it 30 times. People type "Fix the Sentry issue at …" from nothing each time. Projects drift apart, and nobody can see what the others use. A workspace's admins should set these up once, for every project or chosen ones, with each project's own settings on top.

How it works now

  • Per project. ProjectSettings (crates/fctl-proto/src/session.rs) holds instructions ("Text appended to Claude's system prompt for every session"), pull_request_instructions (absent: fctl's defaults; ADR 0060), env, setup_script, image, model and effort. Maintainers set them in the project's Settings (web/src/lib/project-page.ts) or with fctl projects set. Workspace (crates/fctl-proto/src/api.rs) holds no agent settings.
  • Secrets. project_secrets (migration 0001_init.sql) keeps each value sealed with AES-256-GCM, with the project and name as associated data (crates/fctl-control/src/crypto.rs, crates/fctl-control/src/api/projects.rs). Only names are read back. decrypted_secrets puts them in SessionSpec.secrets (crates/fctl-control/src/spec.rs). fctl-agent passes Claude and the setup script the caches' variables, the clouds', the project's, then its secrets, the later one winning a name (crates/fctl-agent/src/supervisor.rs).
  • The system prompt. prompt::system_prompt (crates/fctl-agent/src/prompt.rs, passed as --append-system-prompt in claude.rs) has fctl's lines ("Project secrets are available as environment variables"), then "Pull requests and issues", then "The project's instructions". ~/.claude/CLAUDE.md imports ~/AGENTS.md (claude::write_instructions). fctl's keys go over the image's ~/.claude/settings.json (claude::merge_user_settings), so an image's plugins, hooks and ~/.claude/skills stay (docs/sandbox-images.md#what-fctl-writes-into-a-sandbox).
  • The repository's own setup. Claude runs with --setting-sources user,project,local (user alone when the repository's settings could switch billing), so the repository's CLAUDE.md, skills and .mcp.json load. fctl passes no MCP configuration of its own. To share skills and servers, teams commit them to every repository or build an image.
  • Review agents get none of the project's secrets, setup script, instructions or connectors (review_spec in spec.rs); they get only its review instructions (fctl_domain::reviews::instructions). They run with --setting-sources user --strict-mcp-config (supervisor.rs), which keeps only servers passed with --mcp-config.
  • Other MCP servers come from a person's claude.ai connectors. Those need a full Claude login and are off for new projects (claude_ai_connectors); Choose which claude.ai connectors sessions get #18 asks to choose which ones a session gets. Claude Code's system/init names each server with its status, and crates/fake-claude/src/main.rs copies it.
  • No templates. The nearest thing is a schedule that runs when asked (docs/automation.md#start-agents-from-other-tools). It belongs to one project and has no blanks: a tool's text arrives as context, marked as information. ROADMAP.md lists "Session templates and a shared library of project instructions" as open.
  • Webhooks are the only thing a workspace shares. They go to every project, including ones created later, or to chosen ones (Webhook.projects, crates/fctl-proto/src/hooks.rs), and show on a project's Settings → Webhooks as "Acme's, which send Web's events too". The parts below follow that model.

What should happen

Each part names its projects as a workspace webhook does: none means every project, including ones created later. The workspace's admins manage each part, and changes go in the audit log as workspace.* entries. A project's owners and maintainers see what reaches their project: names, never secret values. Each part can land on its own.

  • Instructions. Three texts on the workspace: instructions, pull_request_instructions and review_instructions.
    • API: GET and PATCH /api/v1/workspaces/{workspace}/agents.
    • CLI: fctl workspaces set -w acme --instructions-file rules.md, plus --pr-instructions-file and --review-instructions-file.
    • fctl-agent writes "## The workspace's instructions" before the project's section, then "The project's instructions follow; where they differ, they come first."
    • Rules for pull requests come from the project, else the workspace, else fctl's defaults.
  • Skills. A skill is a folder with a SKILL.md, uploaded or taken from a repository the workspace reaches (acme/agent-skills, skills/sentry-triage).
    • The control plane keeps it in workspace_skills and sends it in an optional SessionSpec.skills.
    • fctl-agent writes it to ~/.claude/skills/<name>/, never over a folder it didn't write, and logs any name that clashes with the image's or the repository's skills.
  • MCP servers over HTTP. Each has a name, an https:// address, and one way to sign in: none; a header holding one of the workspace's secrets (Authorization: Bearer ${DOCS_TOKEN}); or an identity token for its audience, which needs no secret (docs/identity-tokens.md).
    • For identity tokens, Claude Code's headersHelper runs a command for an HTTP server's headers as it connects, so fctl-agent mints a token each time. Some versions were reported not to send them: check the default image's Claude Code.
    • Storage, API and CLI: workspace_mcp_servers, …/workspaces/{workspace}/mcp-servers, and fctl workspaces mcp add docs https://docs-mcp.acme.dev/mcp --identity-token https://docs-mcp.acme.dev -w acme.
    • fctl-agent passes the servers with --mcp-config.
    • A server on the company's network may be out of the control plane's reach while runners reach it, so each server shows the status the newest session's system/init reported.
  • Secrets. workspace_secrets are sealed as a project's are, with the workspace and name as associated data, and named by the same rules (validate::env_name).
    • API: GET …/workspaces/{workspace}/secrets; PUT and DELETE …/secrets/{name} with {"value", "projects"}.
    • CLI: fctl workspaces secrets set REGISTRY_TOKEN -w acme --projects web,api, reading the value from a prompt or stdin.
    • spec.rs lays the project's secrets over the workspace's. Agents read: "The workspace's and the project's secrets are environment variables".
  • Templates, for a project or the workspace. session_templates (tpl_…) holds a name, a title, a task with blanks ({{issue}}, each with a hint and whether it's required), model, effort, GitHub access and projects.
    • API: GET /api/v1/projects/{project}/templates lists the project's own and the workspace's. Maintainers add one with POST there; admins with POST …/workspaces/{workspace}/templates.
    • Starting: CreateSessionRequest gains optional template and fields. The control plane fills the blanks, caps GitHub access at what the project allows (as for schedules), and records the template on the session. The filled task is the person's own words, not context.
    • CLI: fctl templates -p web and fctl run -p web --template "Fix a Sentry issue" --field issue=… --json.
    • Service accounts' bots start templates through the API, and so would Start and steer agents from Slack, with agents that read only what they should there #620.
  • A project's Settings and a session's details show what came from the workspace.
  • Docs, docs/llms.txt, an ADR for the order below, and fctl-site's privacy policy.

The project's own comes after the workspace's, and wins where they differ:

Part Agents get The project's own Review agents get
Instructions "The workspace's instructions", before "The project's instructions" come after, and win where they differ the workspace's review instructions, before the project's
Rules for pull requests and issues the workspace's, where the project keeps fctl's defaults its text, or none, replaces both nothing
Skills ~/.claude/skills/<name>/ the repository's .claude/skills still load only skills marked for them
MCP servers a file passed with --mcp-config the repository's .mcp.json still loads only servers marked for them
Secrets environment variables, set before the project's a variable or secret with the same name wins nothing
Templates the task box and fctl run --template listed first —

What agents are told changes in two places: the workspace's instructions section, and the secrets line. Claude Code itself tells agents which skills and MCP servers they have.

Design and UX

Shared setup is trusted only when every screen says where a setting comes from, which projects it reaches and what wins. Ada changes Acme's rules once, and Grace, who maintains web, sees exactly what her agents are told.

Where it lives. Admins already see nine workspace tabs (web/src/routes/workspace.tsx). PageTabs spaces them densely only so the last one stays out from under the fade (web/src/components/page-tabs.tsx). So rather than a tenth tab, the workspace's Settings becomes a list of pages, as a project's is (SettingsNav): You, General and Access, then a "For every project" group with Instructions, Skills, MCP servers, Secrets and Templates. Members see You and Templates.

The intro, until something is set:

  • Headline: "One setup for all 30 of Acme's projects".
  • Lead: "What you add here reaches the agents in every project in Acme, or the ones you choose, before each project's own settings: 26 of them keep fctl's rules for pull requests, and 4 have instructions of their own."
  • Points:
    • projects keep their own settings, which win;
    • sessions take a change when they next start or resume;
    • a secret reaches every runner that runs its projects' sessions, members' own runners too;
    • review agents get only what you mark for them.
  • Preview: "What an agent in web is told". fctl's lines fold into a grey line, then come "Acme's instructions" and "Web's instructions", then chips "2 skills", "docs" and "REGISTRY_TOKEN". A Select picks the project.
  • Action: each page has one primary action, such as "Write Acme's instructions". Members read "Acme's admins set these up: Ada is its primary admin."

The pages.

  • Instructions. Three Textareas, with placeholders that are good values ("Use pnpm, never npm. Run make check before you commit."). A Projects pill: "Every project", or a checklist with a filter past eight entries ("4 of 30 chosen"). An aria-live sentence in the CLI's words: "Agents in all 30 projects get these 6 lines before their project's instructions; the 26 that keep fctl's rules get Acme's instead; review agents get none of them." Saving toasts "Saved: sessions take it when they next start or resume".
  • Skills. Rows read "sentry-triage · from acme/agent-skills · every project · updated 2 days ago by Ada". "Upload a folder" and "From a repository" sit side by side. A clash shows in amber: "api's repository has its own sentry-triage: check which one its agents use."
  • MCP servers. "How it signs in" recommends "An identity token": "No secret to keep: the server checks each token against Acme's issuer." The review switch says "Only for servers that read: a pull request anyone wrote can steer a review agent." Rows show the last status: "Connected in web#212 · 2h ago", amber "Failed in api#88 · 401 Unauthorized", or "Not used yet".
  • Secrets. As a project's Secrets page, with projects to choose. The warning sits where the risk is: "Every session of the projects it's for gets it, and anything an agent runs can read it." The safer way sits beside it: "Reaching AWS, Google Cloud, Azure or Vault? Identity tokens need no secret." Rows read "REGISTRY_TOKEN · web, api and 3 more · set by Ada 3 days ago · infra sets its own".

Starting from a template.

  • Under the task box on the Agent Floor and on a project's page: "Start from a template", with up to four chips (the project's first) and "All 12", which opens a search.
  • Picking one fills the box. Each blank becomes an inline field labelled by its hint ("Sentry issue URL").
  • Start says what's missing: "Fill in the Sentry issue URL to start".
  • The model, effort and GitHub chips take the template's values within the project's limits, and say where one is capped: "In docs, agents comment at most: this session pushes nothing".
  • "From Acme's template Fix a Sentry issue" shows under the box. "Save as template" sits beside Schedule.
  • The template editor highlights {{blanks}} as they're typed, previews the task box, and offers ideas to start from, as Schedules does: "Fix a Sentry issue", "Upgrade a dependency".

Elsewhere. A project's Settings → Agents shows "Acme's instructions, which agents get before Web's", folded to two lines. Its Secrets page lists "Acme's, which Web's sessions get too". People who can't change them read "Acme's admins change them in its settings". A session's details say "From the template Fix a Sentry issue" and "Acme's setup: instructions, 2 skills, docs".

States.

  • Loading: skeletons, never "No skills yet" before the list loads.
  • Errors: the server's sentence, under the field it's about ("GH_TOKEN is managed by fctl and cannot be set").
  • Partial setups, in amber: "Acme no longer reaches acme/agent-skills: sessions start without sentry-triage. Connect it on the GitHub tab." Or: "web#214 ran on build-7, whose fctl is older: it started without Acme's skills."
  • Long lists: checklists filter past eight entries, and template chips stop at four.
$ fctl workspaces secrets set REGISTRY_TOKEN -w acme --projects web,api
Value for REGISTRY_TOKEN (hidden):
Set REGISTRY_TOKEN for web and api in Acme: their sessions get it when they next start or resume.
$ fctl run -p web --template "Fix a Sentry issue" -d
error: "Fix a Sentry issue" needs issue (the Sentry issue's URL): add --field issue=…
  • Follow hyperstructure/design's docs: docs/principles.md; docs/web-app/explaining.md for pages that set something up (a headline that names the outcome, a lead built from this place's facts, a preview of the result, one primary action, and who can act); docs/web-app/kit.md for controls.
  • Design every state before building it: the first visit, loading, errors and refusals, waiting, partial setups and long lists.
  • Say what happens, plainly, and never leave someone at a disabled control without saying who can act.
  • Prototype the main screens with realistic data (cargo xtask demo's world) and review them before building the rest.
  • Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.
  • Give the CLI the same care: readable output, --json, and errors that say what to do next.
  • Add or update the pages of hyperstructure/design's docs for each new component, with the reasons behind its choices.

Compatibility

  • Hosts and agents one version behind the control plane. Secrets arrive merged in SessionSpec.secrets, and templates never reach a runner, so neither needs anything new from them. Instructions, skills and MCP servers come in new optional protocol fields (crates/fctl-proto/src/runner.rs, then cargo xtask gen). An older agent ignores them until its host updates itself (ADR 0053), and its log says so.
  • API. CreateSessionRequest gains optional template and fields, and Session gains an optional template. New routes go in fctl_domain::limits::allows, which service accounts go through too, with client methods and CLI commands with --json.
  • Migrations and release. New D1 migrations for the workspace's instructions, workspace_secrets, workspace_skills, workspace_mcp_servers, session_templates and sessions.template_id. It needs an fctl release.
  • Docs. architecture.md, api.md, cli.md, agents.md, organizations.md, security.md (what fctl keeps, and MCP servers as a way out of a sandbox), sandbox-images.md#what-fctl-writes-into-a-sandbox and llms.txt.
  • Privacy policy. fctl-site's legal/privacy.md lists a project's settings and secrets. It needs the workspace's instructions, skills, MCP servers and their credentials, secrets and templates, and that runners receive them.

Decisions for a person

  • Order: which part comes first? Secrets and templates change no agent; the other three need an fctl-agent release.
  • Opting out: can a project's maintainers turn off a workspace part for their project, or are some parts rules that every project takes? Workspace admins set limits that every project and session keeps #622 caps what projects may set; this issue gives them what to start from.
  • Repository rules: do the workspace's instructions give way to a repository's own CLAUDE.md and AGENTS.md, as fctl's rules for pull requests do, or come first?
  • Skill sources: uploads, a folder in a repository (changed by pull request), or Claude Code plugins from a marketplace repository, which bundle skills, hooks and MCP servers and which fctl-agent keeps when an image ships them?
  • MCP credentials: does a server's credential enter the sandbox, where anything the agent runs can read it, or stay on the runner behind a proxy, as the Claude token can (ADR 0079)?
  • Connectors: do workspace MCP servers and Choose which claude.ai connectors sessions get #18's connectors policy share one page?
  • Template management: who manages a project's templates, editors (as for schedules) or maintainers?
  • Template access: is a template that asks for more GitHub access than a project allows capped there, or hidden?

Refs #18

Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS

Activity

  1. added
    enhancement
    control-plane
    web
    cli
    agents
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsclicontrol-planeenhancementweb

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions