Token导航 LogoToken导航

Agent Skill · 前端设计

constructive-server-config(建设性的服务器配置)

constructive-server-config 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

constructive-server-config 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在前端设计类的 10,216 个 Skill 里排第 5,160。

总安装 728周安装 17GitHub Stars 公开资料未说明下载 140核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:constructive-server-config(建设性的服务器配置)
来源仓库:https://github.com/constructive-io/constructive-skills
仓库路径:skills/constructive-server-config
安装命令:
npx skills add https://github.com/constructive-io/constructive-skills --skill constructive-server-config
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/constructive-io/constructive-skills --skill constructive-server-config

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于启动和管理 Constructive GraphQL API 服务器及 GraphiQL 探索器。支持多目标 API 路由配置(基于 header 或域名),便于微服务拆分。适用于代码生成、CI 集成测试和本地开发环境搭建。需预先部署 PostgreSQL 数据库并配置好 Constructive 实例。

constructive-server-config 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/constructive-server-config

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/constructive-io/constructive-skills --skill co…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

constructive-server-config 怎么安装?

在终端执行 npx skills add https://github.com/constructive-io/constructive-skills --skill constructive…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

constructive-server-config 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

constructive-server-config 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

constructive-server-config 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

constructive-server-config 用的人多吗?

公开数据是累计安装 728 次,近一周安装 17 次,下载 140 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

constructive-server-config 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
constructive-server-config

建设性的服务器配置 · 本页

728—接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Constructive Server Configuration

How to run and configure the Constructive GraphQL API server, explorer, and codegen tools. The server exposes a multi-target GraphQL API with subdomain-based routing.

When to Apply

Use this skill when:

  • Starting the Constructive GraphQL server (cnc server)
  • Opening the GraphiQL explorer (cnc explorer)
  • Running code generation (cnc codegen)
  • Configuring API routing (header-based vs domain-based)
  • Running the server in CI for integration tests
  • Understanding the schema → PostGraphile → GraphQL pipeline

Prerequisites

  • PostgreSQL 17+ running with a deployed Constructive database (see pgpm skill — references/docker.md and references/env.md)
  • @constructive-io/cli installed (npm install -g @constructive-io/cli or available from the monorepo)
  • Database users bootstrapped via pgpm admin-users bootstrap --yes

The Constructive CLI (cnc)

The Constructive CLI (cnc or constructive) is the main entry point for running the platform.

Core Commands

CommandPurpose
cnc serverStart the GraphQL API server
cnc explorerStart the GraphiQL explorer UI
cnc codegenGenerate TypeScript types and SDK from the running API

Starting the Server

Quick Start

# Start with defaults
cnc server

# Start on a specific port with a specific database
PGDATABASE=constructive cnc server --port 5555

# Start with CORS wildcard (required for non-interactive / CI)
cnc server --origin '*'

# Start with explicit host, port, and origin
cnc server --host 0.0.0.0 --port 3000 --origin "*"

Important: The --origin option has no default. If omitted, the server will prompt interactively. Always pass --origin explicitly for non-interactive use (CI, Docker, scripts).

Server Options

OptionDescriptionDefault
--hostBind addresslocalhost
--portListen port5555
--originCORS allowed origin(interactive prompt)
--databaseDatabase name (or set PGDATABASE)(interactive prompt)
--simpleInflectionUse simple inflectiontrue
--oppositeBaseNamesUse opposite base namesfalse
--postgisEnable PostGIS extensiontrue
--servicesApiEnable Services API routingtrue
--cwdWorking directorycurrent directory

Environment Variables

The server reads its configuration from environment variables. Set these before starting:

Prerequisite: Ensure PG env vars are loaded (see pgpm skill, references/env.md) before starting the server.
# Required
export PGDATABASE=constructive

# API configuration
export API_IS_PUBLIC=true          # or false for admin mode
export API_EXPOSED_SCHEMAS=metaschema_public,services_public
export API_ANON_ROLE=anonymous     # Role for unauthenticated requests
export API_ROLE_NAME=authenticated # Role for authenticated requests
VariableDefaultDescription
PGHOSTlocalhostPostgreSQL host
PGPORT5432PostgreSQL port
PGUSERpostgresPostgreSQL user
PGPASSWORD(none)PostgreSQL password
PGDATABASE(prompt)Database name
API_IS_PUBLIC—true for public API, false for admin
API_EXPOSED_SCHEMAS—Comma-separated schemas to expose
API_ANON_ROLE—Role for unauthenticated requests
API_ROLE_NAME—Role for authenticated requests
API_ENABLE_SERVICES—Enable services schema (admin only)
API_META_SCHEMAS—Meta schemas for routing
NODE_ENVdevelopmentEnvironment (affects CORS warnings)

Endpoints

The server uses subdomain-based routing via the Host header. For local development, *.localhost resolves to 127.0.0.1 automatically.

TargetEndpointDescription
Publichttp://api.localhost:<port>/graphqlPublic API (databases, tables, fields, schemas)
Authhttp://auth.localhost:<port>/graphqlAuthentication (sign-up, sign-in, tokens)
Objectshttp://objects.localhost:<port>/graphqlObject store (blobs, trees, commits)
Adminhttp://admin.localhost:<port>/graphqlAdmin operations

Health check: GET /healthz

API Routing Modes

Public Mode (API_IS_PUBLIC=true)

Uses domain-based routing. Each site/app gets its own subdomain:

https://myapp.example.com/graphql → routes to myapp's schemas
  • Used for external-facing APIs
  • API_ANON_ROLE=anonymous — unauthenticated users get minimal access
  • API_ROLE_NAME=authenticated — authenticated users get full access per RLS

Admin Mode (API_IS_PUBLIC=false)

Uses header-based routing. The client sends headers to select the target:

X-Api-Name: my_api
X-Database-Id: <uuid>
X-Meta-Schema: metaschema_public
  • Used for the Constructive admin UI
  • API_ANON_ROLE=administrator — admin users get full schema access
  • API_ENABLE_SERVICES=true — exposes the services schema for site/API management

Services API mode

When --servicesApi is true (default), the server enables the Constructive services routing layer, which routes requests based on the Host header subdomain to the correct schema/role combination. When false, it falls back to exposing raw PostgreSQL schemas.

GraphiQL Explorer

cnc explorer

Opens an interactive GraphiQL interface in the browser for testing queries against the running server. Useful for:

  • Exploring the generated schema
  • Testing queries and mutations
  • Debugging authentication and RLS policies

Code Generation

Using cnc codegen

cnc codegen

Generates TypeScript types and SDK code from the running GraphQL server. This is a convenience wrapper around @constructive-io/graphql-codegen.

Using graphql-codegen directly

For more control, use the codegen package directly:

npx @constructive-io/graphql-codegen --react-query --orm -e http://localhost:5555/graphql -o ./generated

See the constructive-graphql-codegen skill for full codegen documentation.

The Schema → GraphQL Pipeline

Understanding how database schemas become a GraphQL API:

PostgreSQL schemas (app_public, etc.)
        ↓
    PostGraphile v5 introspection
        ↓
    GraphQL schema (auto-generated)
        ↓
    cnc server (serves the API)
        ↓
    graphql-codegen (generates typed client)
        ↓
    React Query hooks / ORM / CLI

Key Concepts

  1. Schemas are the source of truth — tables, functions, views, and RLS policies in PostgreSQL define the API surface
  2. PostGraphile introspects automatically — no manual schema writing needed
  3. Smart naming — PostGraphile converts snake_case SQL to camelCase GraphQL automatically
  4. RLS is the auth layer — Row-Level Security policies in Postgres control what each user can access via GraphQL

Exposed Schemas

The API_EXPOSED_SCHEMAS variable controls which PostgreSQL schemas are exposed via GraphQL:

SchemaPurpose
metaschema_publicDatabase metadata (tables, fields, constraints, etc.)
services_publicService management (sites, APIs, domains, etc.)
constructive_auth_publicAuthentication (login, register, tokens)
app_public (custom)Application-specific tables and functions

Meta Schemas

API_META_SCHEMAS lists schemas used for schema validation and X-Meta-Schema routing:

API_META_SCHEMAS=metaschema_public,services_public,metaschema_modules_public,constructive_auth_public

Common Workflows

Start local dev server

Ensure PG env vars are loaded (see pgpm skill, references/env.md).
export PGDATABASE=constructive
cnc server --port 5555 --origin "*"

Verify the server is running

curl -s http://api.localhost:5555/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ __typename }"}' | jq

Expected response:

{
  "data": {
    "__typename": "Query"
  }
}

Explore the API

# In another terminal
cnc explorer

Generate SDK from running server

npx @constructive-io/graphql-codegen \
  --react-query --orm \
  -e http://localhost:5555/graphql \
  -o ./src/generated

Use with the generated CLI

cd sdk/constructive-cli

# Create context pointing to local server
npx tsx cli/index.ts context create local \
  --publicEndpoint http://api.localhost:5555/graphql \
  --authEndpoint http://auth.localhost:5555/graphql \
  --objectsEndpoint http://objects.localhost:5555/graphql \
  --adminEndpoint http://admin.localhost:5555/graphql

npx tsx cli/index.ts context use local

Run admin and public servers together

# Terminal 1 — Admin server
API_IS_PUBLIC=false API_ENABLE_SERVICES=true \
  cnc server --port 3002 --origin "*"

# Terminal 2 — Public server
API_IS_PUBLIC=true \
  cnc server --port 3000 --origin "*"

CI / GitHub Actions

See github-workflows-pgpm for full CI patterns.
- name: Start cnc server
  run: |
    PGDATABASE=constructive cnc server --port 5555 --origin '*' &
    # Wait for server readiness
    for i in $(seq 1 30); do
      if curl -sf http://api.localhost:5555/graphql \
        -H 'Content-Type: application/json' \
        -d '{"query":"{ __typename }"}' > /dev/null 2>&1; then
        echo "Server is ready!"
        break
      fi
      if [ "$i" -eq 30 ]; then
        echo "Server failed to start after 30 seconds"
        exit 1
      fi
      sleep 1
    done

Server Architecture

The cnc server command:

  1. Reads PGDATABASE or prompts for database selection
  2. Collects configuration options (inflection, PostGIS, CORS, etc.)
  3. Calls GraphQLServer() from @constructive-io/graphql-server
  4. Starts an Express server with middleware for:

- Subdomain-based API routing (@constructive-io/url-domains) - JWT authentication - PostGraphile GraphQL engine - CORS handling (per-API or fallback) - Health check endpoint at /healthz

  1. Listens for PostgreSQL schema:update notifications to auto-flush caches

Source code:

  • constructive/packages/cli/src/commands/server.ts — CLI command handler
  • constructive/graphql/server/src/server.ts — GraphQLServer class and factory

Troubleshooting

IssueCauseFix
Server hangs on startMissing --origin flagAdd --origin "*" for non-interactive mode
Port already in useAnother instance running`lsof -ti:5555 \xargs kill -9`
No schemas exposedAPI_EXPOSED_SCHEMAS not setSet the env var with comma-separated schema names
Auth errorsWrong role configurationCheck API_ANON_ROLE and API_ROLE_NAME
Can't connect to DBPG env vars not loadedSee pgpm skill (references/env.md) for loading database connection variables
Endpoints return 404Database not deployedDeploy with pgpm deploy --createdb --workspace --all --yes
GraphiQL shows empty schemaServer not running or wrong portVerify server is up and explorer points to correct URL
Subdomain routing not workingDNS issue*.localhost should resolve automatically; if not, add to /etc/hosts
CORS errors in browserWrong originPass --origin 'http://localhost:3000' or --origin '*'

References

  • Related skill: pgpm (references/docker.md) for PostgreSQL container management
  • Related skill: pgpm (references/env.md) for environment variable setup
  • Related skill: constructive-graphql-codegen for generating CLI from schema
  • Related skill: constructive-deployment for Docker Compose and production deployment

平台分布

Codex

35.32%
按下载量换算49

Claude

28.99%
按下载量换算41

Cursor

20.87%
按下载量换算29

Gemini CLI

10.1%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills