# API Gov Governance Bootstrap

> Implements API governance from scratch: baseline Spectral rulesets, style guide docs, and first CI lint gate. Use when working with governance bootstrap, style guide authoring or when the user mentions governance bootstrap, style guide authoring.

- Skill: `opknock/api-gov-governance-bootstrap` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-gov-governance-bootstrap`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-gov-governance-bootstrap/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-gov-governance-bootstrap

---


Implements API governance from scratch: baseline Spectral rulesets, style guide docs, and first CI lint gate.

## Agentic Workflow: Read -> Reason -> Act (api-gov-governance-bootstrap)

You are **Api Gov Governance Bootstrap** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-gov-governance-bootstrap`
- Domain: Implements API governance from scratch: baseline Spectral rulesets, style guide docs, and first CI lint gate.
- **governance-bootstrap**: Stand up initial linting with recommended rules and a project ruleset — `npm install -g @stoplight/spectral-cli`
- **style-guide-authoring**: Write and publish the API style guide that rules enforce — `mkdir -p docs/api-guide`
- Check `knowledge` and `prerequisites: spectral, openapi`

### 2. Reason — think for `api-gov-governance-bootstrap`
- For `governance-bootstrap`: Stand up initial linting with recommended rules and a project ruleset — decide which checks to run
- For `style-guide-authoring`: Write and publish the API style guide that rules enforce — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-gov-governance-bootstrap` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Npx` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-gov-governance-bootstrap:099170d9`

# API Gov (Bootstrap)

Stands up governance for a team or org that has none: baseline linting, a style guide, and a first CI gate.

## When to Use
- No API standards exist yet
- Teams ship inconsistent APIs
- Starting governance incrementally

## Real Commands

```bash
# Install
npm install -g @stoplight/spectral-cli
npx @stoplight/spectral-cli lint --version

# Baseline lint
npx @stoplight/spectral-cli lint --extends spectral:oas openapi.yaml

# With project ruleset
npx @stoplight/spectral-cli lint --extends spectral:oas --ruleset .spectral.yaml openapi.yaml
```

## Style Guide

```bash
mkdir -p docs/api-guide
python -c "open('docs/api-guide/STYLE.md','w').write('# API Style Guide\n\n- Plural nouns for collections\n- RFC 9457 errors\n- Pagination via page/limit\n')"
```

## First CI Gate
Run the baseline lint in CI with `--fail-severity error`.

## Testing
Fix or annotate existing violations before enabling the gate org-wide.

## Best Practices
- Start with recommended rules; add custom ones later
- Publish the guide where developers already read docs

## Capabilities

### governance-bootstrap
Stand up initial linting with recommended rules and a project ruleset

**Parameters:**
- `extends` (string): Base ruleset to extend
- `spec` (string): Spec path

**Commands:**
- `npm install -g @stoplight/spectral-cli`
- `npx @stoplight/spectral-cli lint --extends spectral:oas openapi.yaml`
- `npx @stoplight/spectral-cli lint --extends spectral:oas --ruleset .spectral.yaml openapi.yaml`
- `npx @stoplight/spectral-cli lint --version`
- `npx @stoplight/spectral-cli lint --help`

**Examples:**
- npx @stoplight/spectral-cli lint --extends spectral:oas openapi.yaml
- npx @stoplight/spectral-cli lint --extends spectral:oas --ruleset .spectral.yaml openapi.yaml
- npm install -g @stoplight/spectral-cli && npx @stoplight/spectral-cli lint --version

### style-guide-authoring
Write and publish the API style guide that rules enforce

**Parameters:**
- `guideDir` (string): Docs directory for the style guide
- `rules` (string): Rules to document

**Commands:**
- `mkdir -p docs/api-guide`
- `node -e "const fs=require('fs');fs.writeFileSync('docs/api-guide/STYLE.md','# API Style Guide\n\n- Resources are plural nouns\n- Errors use RFC 9457\n')"`
- `node -e "console.log('naming: kebab-case paths') "`
- `python -c "open('docs/api-guide/ERRORS.md','w').write('# Error Codes\n')"`
- `git add docs/api-guide && git commit -m 'publish API style guide'`

**Examples:**
- node -e "const fs=require('fs');fs.writeFileSync('docs/api-guide/STYLE.md','# API Style Guide\n\n- Resources are plural nouns\n- Errors use RFC 9457\n')"
- python -c "open('docs/api-guide/ERRORS.md','w').write('# Error Codes\n')"
- git add docs/api-guide && git commit -m 'publish API style guide'

## References
- [Spectral CLI](https://docs.stoplight.io/docs/spectral/reference/cli)
- [OpenAPI Guidelines](https://opensource.zalando.com/restful-api-guidelines/)

