From deepwork
Create and manage DeepSchemas for automatic file validation on write/edit and review rule generation using YAML requirements and JSON Schemas. Matches files via globs.
npx claudepluginhub unsupervisedcom/deepwork --plugin deepworkThis skill uses the workspace's default tool permissions.
DeepSchemas define rich schemas for files in your project. They provide:
Validates OpenAPI, JSON Schema, and GraphQL API specs with linting, structural analysis, completeness checks, breaking change detection, and consistency enforcement. Generates reports.
Documents DeepWork Reviews for configuring automated code reviews with .deepreview YAML files that match git branch changes and dispatch focused reviewer agents.
Encodes human-readable governance policies into machine-executable JSON constraints for AI agents and CI pipelines to validate automatically. Outputs rule files in .ai/governance/.
Share bugs, ideas, or general feedback.
DeepSchemas define rich schemas for files in your project. They provide:
/review and workflow quality gatesNamed schemas live in .deepwork/schemas/<name>/ and match files via glob patterns. Use these for file types that appear throughout your project.
.deepwork/schemas/api_endpoint/
deepschema.yml # Manifest with requirements, matchers, etc.
endpoint.schema.json # Optional JSON Schema for structural validation
examples/ # Optional example files
references/ # Optional reference docs
Anonymous schemas are single files placed alongside the file they apply to. Use these for one-off requirements on a specific file.
src/config.yml # The file
.deepschema.config.yml.yml # Its anonymous schema
The naming convention is .deepschema.<filename>.yml.
.deepwork/schemas/<name>/deepschema.yml inside it:summary: Short description of this file type
instructions: |
Guidelines for creating and modifying files of this type.
matchers:
- "**/*.config.yml"
- "src/configs/**/*.json"
requirements:
# Semantic rules only — structural constraints go in config.schema.json
documented-fields: "All fields SHOULD have inline comments explaining their purpose."
no-secrets: "Config files MUST NOT contain secrets or credentials."
# Structural validation — enforce types, required fields, enums, etc. here
json_schema_path: "config.schema.json"
# Optional: custom validation commands (file path passed as $1)
verification_bash_command:
- "yamllint -d relaxed"
get_named_schemas to verify your schema is discovered.Place a .deepschema.<filename>.yml file next to the target file:
requirements:
api-key-rotated: "The API key MUST be rotated every 90 days."
no-plaintext-secrets: "Credentials MUST use environment variable references, not literal values."
# Reference a named schema for shared requirements
parent_deep_schemas:
- api_endpoint
The json_schema_path file is the primary enforcement mechanism. Every constraint that can be expressed structurally MUST go in the JSON Schema, not in requirements. Requirements exist only for semantic rules that JSON Schema cannot express.
Put in the JSON Schema (not requirements):
additionalProperties: false)minItems, uniqueItems)minimum, maximum)pattern, format)if/then — e.g., "when type is 'http', url is required")Put in requirements (not the JSON Schema):
Build the JSON Schema to be as strict and comprehensive as possible. Use additionalProperties: false to catch typos. Use enums for closed sets. Use if/then for conditional requirements. Use pattern for string formats. Use $defs and $ref for reusable types. Use anyOf for discriminated unions. Use uniqueItems, minLength, minItems where appropriate. A good JSON Schema catches errors at write time before a reviewer ever sees the file. Requirements that duplicate what the schema already enforces are noise — they dilute the reviewer's attention and risk contradicting the schema.
For files that aren't JSON or YAML (markdown, shell scripts, plain text, custom formats), verification_bash_command serves the same role as json_schema_path — it's the primary structural enforcement mechanism. The same principle applies: anything a command can check exactly MUST go in a verification command, not in requirements.
# Example: RFC 2119 requirements files (markdown)
verification_bash_command:
- "grep -nE '^[0-9]+\\.' \"$1\" | grep -vE 'MUST|SHALL|SHOULD|MAY|REQUIRED|RECOMMENDED|OPTIONAL' | { if read -r line; then echo \"FAIL: Requirement without RFC 2119 keyword: $line\"; exit 1; fi; }"
requirements:
# Only semantic rules the command can't check
testability: "Each requirement MUST be specific enough to be verifiable."
Commands receive the file path as $1, must exit 0 on success and non-zero on failure, and have a 30-second timeout.
Before writing a JSON Schema from scratch, check whether a published schema already exists at SchemaStore (https://json.schemastore.org/<name>.json). SchemaStore hosts community-maintained schemas for hundreds of config file formats.
If a good schema exists:
claude_settings.schema.json)_source field at the top of the file with the original URL and sync date:
{
"_source": "Vendored from https://json.schemastore.org/example.json. To update: fetch the latest version from that URL and replace this file. Last synced: 2026-04-01."
}
json_schema_path at the local copy — this avoids network dependencies during validation_source field tells future maintainers where to look| Field | Description |
|---|---|
summary | Brief description for discoverability |
instructions | Guidelines for working with these files |
matchers | Glob patterns this schema applies to (named schemas) |
requirements | Key-value pairs of RFC 2119 requirements |
parent_deep_schemas | Named schemas to inherit requirements from |
json_schema_path | Relative path to a JSON Schema file |
verification_bash_command | Shell commands to validate the file (receives path as $1) |
examples | Array of {path, description} for example files |
references | Array of {path, description} or {url, description} for reference docs |
When you write or edit a file:
json_schema_path validation runs automaticallyverification_bash_command commands run with the file path as $1During /review and workflow quality gates, each schema generates a review rule that checks all requirements.
Named schemas are loaded from multiple directories in priority order (first match wins):
.deepwork/schemas/ — project-local schemasjob_yml, deepschema)DEEPWORK_ADDITIONAL_SCHEMAS_FOLDERS env var — colon-delimited extra directoriesget_named_schemas — list all discovered named schemas with their names, summaries, and matchers