Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Server Config

ASecurity

How to use @owlmeans/server-config — sservice() to declare a backend service route in the config, readConfigValue() to read a value out of a mounted file, and the BasicServerConfig shape that adds secrets. Auto-invoked when building a server config, declaring a backend service, or feeding a mounted secret into config.

3 stars
0 votes
0 copies
0 views
Added 9/22/2026
developmenttypescriptapifrontendbackend

Works with

cliapi

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add owlmeans/common --skill server-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Server Config?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Server Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/owlmeans-server-config-common/badge)](https://www.skillsdirectory.com/skills/owlmeans-server-config-common)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: server-config
description: How to use @owlmeans/server-config — sservice() to declare a backend service route in the config, readConfigValue() to read a value out of a mounted file, and the BasicServerConfig shape that adds secrets. Auto-invoked when building a server config, declaring a backend service, or feeding a mounted secret into config.
user-invocable: false
---
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->

# @owlmeans/server-config

**Layer:** Server
**Install:** `"@owlmeans/server-config": "^0.1.18-rc.29"` in `dependencies`

The server-side half of `@owlmeans/config`. Small on purpose: it declares backend services and it
reads file-backed values. Everything else about config lives in `@owlmeans/config`, and the context
that applies these is `@owlmeans/server-context`.

## Key Exports

| Export | Description |
|--------|-------------|
| `sservice(service, cfg?)` | Declare a backend service route into `cfg.services` and return the config |
| `readConfigValue(value, def?)` | A value starting with `/` or `file://` becomes the trimmed contents of that path; `undefined` falls back to `def`, and any other string is returned as is |
| `BasicServerConfig` | `CommonConfig` plus `secrets: Record<string, string>` |

## Declaring services

`sservice` takes a `ServiceRoute` without `type` — `service` (the alias other routes name), `host`
/ `port` for how the world reaches it, `internalHost` / `internalPort` for how the cluster does,
`base`, and `opened` (bind on all interfaces rather than loopback). It writes the entry under
`service.service` and defaults `type` to `AppType.Backend` — a default only, because the entry
already stored under that alias is spread over it: an alias first declared by `service()` from
`@owlmeans/config` as `AppType.Frontend` keeps that type through a later `sservice` call. Declare a
frontend service with `service()`.

```typescript
import { sservice } from '@owlmeans/server-config'

let cfg = sservice({ service: MY_SERVICE, internalHost: 'my-api', internalPort: 8080, opened: true })
cfg = sservice({ service: AGENT, internalHost: 'agent', internalPort: 8081 }, cfg)
```

**One call per service, and it carries the whole address.** The write merges over whatever the key
already held, but `host` and `port` are then set last and unconditionally from the incoming argument
alone — `host: service.host ?? service.internalHost`, `port: service.port ?? service.internalPort`.
So a second `sservice` for the same alias that names no address at all overwrites the stored `host`
and `port` with `undefined`, and the service becomes unaddressable. Amend an existing entry by
assigning the field instead:

```typescript
cfg.services[MY_SERVICE].opened = true
```

That last-write rule is also the mirroring rule: whenever `host` / `port` are unset, the internal
ones become them. An entry declared with `internalHost` / `internalPort` only therefore carries the
cluster address in `host` / `port` as well — which is what a client sees wherever the config is
advertised (`@owlmeans/api-config-server`), so an internal address is not a private one.

The service the process **is** — `cfg.services[cfg.service]` — is the one the API server binds:
`internalPort ?? port` is the port, and `opened` decides between `0.0.0.0` and `127.0.0.1`. A peer
service is declared the same way and is never bound, only addressed.

`@owlmeans/server-app` re-exports `sservice`, so an app on it needs no direct dependency here.

## File-backed values

`readConfigValue` is how a mounted secret becomes a config value: a string starting with `/` or
`file://` is handed to `readFileSync` and its contents trimmed, `undefined` falls back to `def`, and
every other string is returned unchanged. That makes a config literal and a mounted path
interchangeable at the same key, which is what lets a deployment inject a credential without a code
path of its own.

**Mount the secret at an absolute path.** A `file://` prefix passes the same test but is handed to
`readFileSync` as a literal string, and that does not resolve a URL: the read fails with `ENOENT`
on the URL text itself rather than returning the file. `/` is the form that works, and the only one
anything in the framework produces.

```typescript
import { readConfigValue } from '@owlmeans/server-config'

const secret = readConfigValue(process.env.MY_SECRET, 'dev-secret')
```

Reading is synchronous and unguarded — a missing file throws where it is called. A whole config tree
is converted at once by the `fileConfigReader` middleware from `@owlmeans/server-context`, so an app
rarely calls this itself; reach for it when a value is produced outside the config tree.

`secrets` on `BasicServerConfig` is the conventional home for those values — a flat map, so every
entry can be either a literal or a path and the reader treats them alike.

## Depends On

- `@owlmeans/config`, `@owlmeans/server-route`

Attribution

owlmeansowlmeans
View sourceMore from owlmeans →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →