{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"$id": "https://github.com/csark0812/skeleton/schemas/config.schema.json",
	"title": "Skeleton config",
	"type": "object",
	"additionalProperties": false,
	"required": ["scan", "daysUntilStale"],
	"properties": {
		"scan": {
			"type": "object",
			"additionalProperties": false,
			"required": ["include", "exclude"],
			"properties": {
				"include": {
					"type": "array",
					"items": { "type": "string", "minLength": 1 },
					"minItems": 1
				},
				"exclude": {
					"type": "array",
					"items": { "type": "string" }
				},
				"nonPublicSkills": {
					"type": "array",
					"items": { "type": "string", "pattern": "^[a-z0-9-]+$" },
					"description": "Skill slugs that exist on disk but must not appear in README Taxonomy (consumer-internal skills)"
				}
			}
		},
		"deny": {
			"type": "object",
			"additionalProperties": false,
			"description": "Path denylist — matching files must not exist in the repo",
			"properties": {
				"paths": {
					"type": "array",
					"items": { "type": "string" },
					"description": "Repo-wide globs that must not exist (often outside scan.include)"
				}
			}
		},
		"daysUntilStale": {
			"type": "integer",
			"minimum": 1,
			"description": "Re-read cadence in days, measured from the commit that recorded a document's review (warn; --strict → error)."
		},
		"docsLint": {
			"type": "object",
			"additionalProperties": false,
			"description": "Near-duplicate and SSOT-summary lint tunables",
			"properties": {
				"nearDuplicateThreshold": {
					"type": "number",
					"minimum": 0,
					"maximum": 1,
					"description": "Jaccard threshold on word shingles (default 0.72)"
				},
				"ssotOverlapMin": {
					"type": "number",
					"minimum": 0,
					"maximum": 1,
					"description": "Min fraction of SSOT tokens that must appear in H1/lead/body evidence (default 0.35)"
				},
				"ssotBetterMatchMargin": {
					"type": "number",
					"minimum": 0,
					"maximum": 1,
					"description": "Margin by which another file must beat own overlap for better-match warn (default 0.15)"
				},
				"ssotPhraseCheck": {
					"type": "boolean",
					"description": "When overlap fails, mention missing SSOT phrase in the message (default true)"
				},
				"ignorePairs": {
					"type": "array",
					"items": {
						"type": "array",
						"items": { "type": "string", "minLength": 1 },
						"minItems": 2,
						"maxItems": 2
					},
					"description": "Repo-relative path pairs skipped by near-dupe / duplicate-SSOT checks"
				},
				"ignoreGlobs": {
					"type": "array",
					"items": { "type": "string", "minLength": 1 },
					"description": "Globs excluded from near-dupe / duplicate-SSOT"
				}
			}
		},
		"skillOwnership": {
			"type": "object",
			"additionalProperties": false,
			"description": "Provenance-aware skill body linting: foreign (synced) skills are skipped; owned local skills stay audited",
			"properties": {
				"lockfile": {
					"type": "string",
					"minLength": 1,
					"description": "Repo-relative skills lock path (default: skills-lock.json)"
				},
				"ownedSlugs": {
					"type": "array",
					"items": { "type": "string", "pattern": "^[a-z0-9-]+$" },
					"description": "Force these skill slugs to be treated as owned (lint here) even when the lockfile marks them foreign"
				},
				"foreignSlugs": {
					"type": "array",
					"items": { "type": "string", "pattern": "^[a-z0-9-]+$" },
					"description": "Force these skill slugs to be treated as foreign (skip body lint) even when absent from the lockfile"
				}
			}
		},
		"reviewCoverage": {
			"type": "object",
			"additionalProperties": false,
			"description": "Require files matching include to appear in at least one scanned document's review-deps. Omit the section to use built-in code defaults. Set include to [] to disable.",
			"properties": {
				"include": {
					"type": "array",
					"items": { "type": "string", "minLength": 1 },
					"description": "Repo-relative globs that require an owning paper. Empty array disables coverage and uncovered-changed-path."
				},
				"exclude": {
					"type": "array",
					"items": { "type": "string", "minLength": 1 },
					"description": "Globs removed from the coverage set (added to built-in test and fixture excludes)"
				}
			}
		},
		"review": {
			"type": "object",
			"additionalProperties": false,
			"description": "Harness-neutral review settings for `skeleton review prepare`",
			"properties": {
				"humanPaths": {
					"type": "array",
					"items": { "type": "string", "minLength": 1 },
					"description": "Globs for high-consequence paths; a change there needs a person, not an agent"
				},
				"command": {
					"type": "string",
					"minLength": 1,
					"description": "Shell command that receives the review bundle on stdin (`review prepare --run`)"
				},
				"reviewers": {
					"type": "integer",
					"minimum": 1,
					"maximum": 5,
					"description": "Fixed number of independent reviews for every change, overriding the computed tier (1 for a short prose-only change, otherwise 2). `review prepare --run` starts that many in parallel; the author acts on all their findings."
				},
				"omitFromDiff": {
					"type": "array",
					"items": { "type": "string", "minLength": 1 },
					"description": "Globs left out of the bundle's diff text and listed by name, like lockfiles and generated files"
				}
			}
		},
		"plugins": {
			"type": "array",
			"items": { "type": "string", "minLength": 1 },
			"description": "Plugin entry paths relative to .skeleton/; each entry must have a built sibling .mjs (run skeleton build-plugin)"
		},
		"draftPathPrefixes": {
			"type": "array",
			"items": { "type": "string", "minLength": 1 },
			"description": "Allow-list directory prefixes for draft-marker prose-policy placement (plus _draft-*.md filenames). Trailing / is implied. Repo-relative only (e.g. drafts/) — not ., ./, or /. Not scan.exclude."
		}
	}
}
