opencode-swarm 7.112.2 → 7.113.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +1 -0
  2. package/.opencode/skills/ci-failure-batching/SKILL.md +2 -1
  3. package/.opencode/skills/ci-fix-monitor/SKILL.md +203 -0
  4. package/.opencode/skills/clarify/SKILL.md +1 -0
  5. package/.opencode/skills/clarify-spec/SKILL.md +1 -0
  6. package/.opencode/skills/codebase-review-swarm/SKILL.md +1 -0
  7. package/.opencode/skills/commit-pr/SKILL.md +15 -0
  8. package/.opencode/skills/consult/SKILL.md +1 -0
  9. package/.opencode/skills/council/SKILL.md +1 -0
  10. package/.opencode/skills/critic-gate/SKILL.md +1 -0
  11. package/.opencode/skills/deep-dive/SKILL.md +1 -0
  12. package/.opencode/skills/deep-research/SKILL.md +1 -0
  13. package/.opencode/skills/design-docs/SKILL.md +2 -1
  14. package/.opencode/skills/discover/SKILL.md +1 -0
  15. package/.opencode/skills/engineering-conventions/SKILL.md +2 -1
  16. package/.opencode/skills/execute/SKILL.md +1 -0
  17. package/.opencode/skills/fork-pr-operations/SKILL.md +136 -0
  18. package/.opencode/skills/gate-attribution/SKILL.md +2 -1
  19. package/.opencode/skills/issue-ingest/SKILL.md +1 -0
  20. package/.opencode/skills/loop/SKILL.md +7 -6
  21. package/.opencode/skills/merge-queue-readiness/SKILL.md +2 -1
  22. package/.opencode/skills/parallel-work-check/SKILL.md +133 -0
  23. package/.opencode/skills/phase-wrap/SKILL.md +1 -0
  24. package/.opencode/skills/plan/SKILL.md +1 -0
  25. package/.opencode/skills/pre-phase-briefing/SKILL.md +1 -0
  26. package/.opencode/skills/resume/SKILL.md +1 -0
  27. package/.opencode/skills/running-tests/SKILL.md +1 -0
  28. package/.opencode/skills/skill-edit-validation/SKILL.md +2 -1
  29. package/.opencode/skills/specify/SKILL.md +1 -0
  30. package/.opencode/skills/swarm/SKILL.md +1 -0
  31. package/.opencode/skills/swarm-ci-monitor/SKILL.md +5 -4
  32. package/.opencode/skills/swarm-implement/SKILL.md +4 -4
  33. package/.opencode/skills/swarm-pr-feedback/SKILL.md +26 -5
  34. package/.opencode/skills/swarm-pr-review/SKILL.md +2 -1
  35. package/.opencode/skills/swarm-pr-subscribe/SKILL.md +1 -0
  36. package/.opencode/skills/test-file-split/SKILL.md +102 -0
  37. package/.opencode/skills/worktree-retry-cleanup/SKILL.md +2 -1
  38. package/.opencode/skills/writing-tests/SKILL.md +43 -0
  39. package/dist/cli/{config-doctor-mmw4c50z.js → config-doctor-az11cwf5.js} +2 -2
  40. package/dist/cli/{curator-llm-factory-5bns4xy6.js → curator-llm-factory-nmhzc774.js} +5 -5
  41. package/dist/cli/{curator-snvp9542.js → curator-nm2c9y1p.js} +5 -5
  42. package/dist/cli/{guardrail-explain-4s7djf9p.js → guardrail-explain-q1np1xaw.js} +6 -6
  43. package/dist/cli/{guardrail-log-xjgr00eq.js → guardrail-log-hysxdwg9.js} +3 -3
  44. package/dist/cli/{hive-promoter-zs295trk.js → hive-promoter-z4dezw62.js} +5 -5
  45. package/dist/cli/{index-xehrmy76.js → index-0gf6de8b.js} +1 -1
  46. package/dist/cli/{index-cq2hgvd2.js → index-1ey3dxq7.js} +9 -1
  47. package/dist/cli/{index-npxmfj48.js → index-8f256d7t.js} +1 -1
  48. package/dist/cli/{index-82v0d72f.js → index-h389ed8y.js} +424 -87
  49. package/dist/cli/{index-9fjpecax.js → index-ky8eb4q6.js} +2 -2
  50. package/dist/cli/{index-snmfqhez.js → index-npd9rypp.js} +2009 -958
  51. package/dist/cli/{index-w84stmkx.js → index-r9fjzr3k.js} +1 -1
  52. package/dist/cli/{index-k6wd3chp.js → index-rqpm9cwe.js} +7 -7
  53. package/dist/cli/index.js +5 -5
  54. package/dist/cli/{schema-2p15yrvn.js → schema-qb313fyy.js} +1 -1
  55. package/dist/cli/{skill-generator-fe6q8xgm.js → skill-generator-nnwn4sq0.js} +1 -1
  56. package/dist/commands/loop.d.ts +1 -1
  57. package/dist/commands/registry.d.ts +1 -1
  58. package/dist/config/bundled-skills.d.ts +15 -5
  59. package/dist/config/project-init.d.ts +1 -1
  60. package/dist/config/schema.d.ts +2 -0
  61. package/dist/hooks/skill-propagation-gate.d.ts +45 -5
  62. package/dist/hooks/skill-scoring.d.ts +22 -1
  63. package/dist/index.js +88 -88
  64. package/dist/sast/rules/index.d.ts +0 -9
  65. package/dist/utils/gitignore-warning.d.ts +8 -4
  66. package/package.json +5 -1
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-npxmfj48.js";
5
+ } from "./index-8f256d7t.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-9fjpecax.js";
4
+ } from "./index-ky8eb4q6.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-w84stmkx.js";
7
+ } from "./index-r9fjzr3k.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -81,20 +81,20 @@ import {
81
81
  handleWriteRetroCommand,
82
82
  normalizeSwarmCommandInput,
83
83
  resolveCommand
84
- } from "./index-snmfqhez.js";
85
- import"./index-npxmfj48.js";
84
+ } from "./index-npd9rypp.js";
85
+ import"./index-8f256d7t.js";
86
86
  import"./index-c8s9a3zh.js";
87
- import"./index-xehrmy76.js";
87
+ import"./index-0gf6de8b.js";
88
88
  import {
89
89
  AGENT_TOOL_MAP,
90
90
  ORCHESTRATOR_NAME,
91
91
  stripKnownSwarmPrefix
92
- } from "./index-cq2hgvd2.js";
92
+ } from "./index-1ey3dxq7.js";
93
93
  import"./index-d0w40jm3.js";
94
94
  import"./index-scww5b77.js";
95
95
  import"./index-9fxs0rm1.js";
96
96
  import"./index-q1jaeynn.js";
97
- import"./index-82v0d72f.js";
97
+ import"./index-h389ed8y.js";
98
98
  import"./index-30ejh1tx.js";
99
99
  import"./index-t6wfwdm1.js";
100
100
  import"./index-hpp2r0sd.js";
package/dist/cli/index.js CHANGED
@@ -7,18 +7,18 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-snmfqhez.js";
11
- import"./index-npxmfj48.js";
10
+ } from "./index-npd9rypp.js";
11
+ import"./index-8f256d7t.js";
12
12
  import"./index-c8s9a3zh.js";
13
- import"./index-xehrmy76.js";
13
+ import"./index-0gf6de8b.js";
14
14
  import {
15
15
  DEFAULT_AGENT_CONFIGS
16
- } from "./index-cq2hgvd2.js";
16
+ } from "./index-1ey3dxq7.js";
17
17
  import"./index-d0w40jm3.js";
18
18
  import"./index-scww5b77.js";
19
19
  import"./index-9fxs0rm1.js";
20
20
  import"./index-q1jaeynn.js";
21
- import"./index-82v0d72f.js";
21
+ import"./index-h389ed8y.js";
22
22
  import"./index-30ejh1tx.js";
23
23
  import"./index-t6wfwdm1.js";
24
24
  import"./index-hpp2r0sd.js";
@@ -86,7 +86,7 @@ import {
86
86
  resolveGeneratedAgentRole,
87
87
  resolveGuardrailsConfig,
88
88
  stripKnownSwarmPrefix
89
- } from "./index-cq2hgvd2.js";
89
+ } from "./index-1ey3dxq7.js";
90
90
  import"./index-bfwt3abw.js";
91
91
  import"./index-p0arc26j.js";
92
92
  import"./index-293f68mj.js";
@@ -33,7 +33,7 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-82v0d72f.js";
36
+ } from "./index-h389ed8y.js";
37
37
  import"./index-30ejh1tx.js";
38
38
  import"./index-hpp2r0sd.js";
39
39
  import"./index-32bx4kch.js";
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Sanitizes the objective input, parses flags, and emits a [MODE: LOOP ...]
5
5
  * signal. The architect picks up the signal and loads
6
- * `.opencode/skills/loop/SKILL.md`, which runs the compound-engineering loop:
6
+ * `.swarm/bundled-skills/loop/SKILL.md`, which runs the compound-engineering loop:
7
7
  * brainstorm → plan → build → review → improve, iterating under
8
8
  * defense-in-depth stop conditions until the objective is met or a budget is
9
9
  * exhausted.
@@ -477,7 +477,7 @@ export declare const COMMAND_REGISTRY: {
477
477
  readonly handler: (ctx: CommandContext) => CommandResult;
478
478
  readonly description: "Enter architect MODE: LOOP — compound-engineering loop: brainstorm → plan → build → review → improve, iterating until done [objective]";
479
479
  readonly args: "<objective> [--max-cycles 1..5] [--autonomy checkpoint|auto] [--depth standard|exhaustive] [--resume]";
480
- readonly details: "Triggers the architect to run the compound-engineering loop defined in .opencode/skills/loop/SKILL.md: BRAINSTORM (requirements) → PLAN (+ critic gate) → BUILD (execute) → REVIEW (independent reviewer + critic on the diff, report-only) → IMPROVE (phase-wrap retrospective + compounding learning capture), then evaluate stop conditions and loop for another improvement cycle if the objective is unmet and budget remains. Generator and reviewer/critic run in separate contexts; failing assertions must be fixed at the root cause, never weakened, mocked, or skipped. Defense-in-depth stop conditions: objective met, --max-cycles budget (default 3), no-progress/plateau, oscillation, unrecoverable error, or explicit user stop. --autonomy auto (default) runs unattended with hard stops still enforced; --autonomy checkpoint pauses at phase gates for user approval. --depth exhaustive widens exploration. --resume continues an existing loop run from durable .swarm/loop/ state. Distinct from full-auto (autonomous cross-phase oversight) and turbo (parallel lanes within a phase): loop is a user-initiated, gated, compounding workflow.";
480
+ readonly details: "Triggers the architect to run the compound-engineering loop defined in .swarm/bundled-skills/loop/SKILL.md: BRAINSTORM (requirements) → PLAN (+ critic gate) → BUILD (execute) → REVIEW (independent reviewer + critic on the diff, report-only) → IMPROVE (phase-wrap retrospective + compounding learning capture), then evaluate stop conditions and loop for another improvement cycle if the objective is unmet and budget remains. Generator and reviewer/critic run in separate contexts; failing assertions must be fixed at the root cause, never weakened, mocked, or skipped. Defense-in-depth stop conditions: objective met, --max-cycles budget (default 3), no-progress/plateau, oscillation, unrecoverable error, or explicit user stop. --autonomy auto (default) runs unattended with hard stops still enforced; --autonomy checkpoint pauses at phase gates for user approval. --depth exhaustive widens exploration. --resume continues an existing loop run from durable .swarm/loop/ state. Distinct from full-auto (autonomous cross-phase oversight) and turbo (parallel lanes within a phase): loop is a user-initiated, gated, compounding workflow.";
481
481
  readonly category: "agent";
482
482
  readonly toolPolicy: "none";
483
483
  };
@@ -1,4 +1,12 @@
1
- export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "swarm-implement", "design-docs", "swarm-pr-review", "swarm", "swarm-pr-feedback", "swarm-pr-subscribe", "swarm-ci-monitor", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr", "ci-failure-batching", "gate-attribution", "merge-queue-readiness", "skill-edit-validation", "worktree-retry-cleanup"];
1
+ export declare const BUNDLED_PROJECT_SKILLS: readonly ["brainstorm", "specify", "clarify-spec", "resume", "clarify", "discover", "consult", "pre-phase-briefing", "council", "deep-dive", "deep-research", "codebase-review-swarm", "swarm-implement", "design-docs", "swarm-pr-review", "swarm", "swarm-pr-feedback", "swarm-pr-subscribe", "swarm-ci-monitor", "issue-ingest", "plan", "critic-gate", "execute", "phase-wrap", "loop", "writing-tests", "running-tests", "engineering-conventions", "commit-pr", "ci-failure-batching", "gate-attribution", "merge-queue-readiness", "skill-edit-validation", "worktree-retry-cleanup", "test-file-split", "fork-pr-operations", "parallel-work-check", "ci-fix-monitor"];
2
+ export type BundledProjectSkill = (typeof BUNDLED_PROJECT_SKILLS)[number];
3
+ /**
4
+ * Project-private runtime location for plugin-owned skills. Repository-native
5
+ * skill roots (`.opencode/skills`, `.claude/skills`, and `.agents/skills`) are
6
+ * user-owned and must never be used as materialization destinations.
7
+ */
8
+ export declare const BUNDLED_PROJECT_SKILL_ROOT = ".swarm/bundled-skills";
9
+ export declare function bundledProjectSkillFileReference(slug: BundledProjectSkill): string;
2
10
  interface CopyState {
3
11
  files: number;
4
12
  bytes: number;
@@ -7,10 +15,11 @@ interface BundledSkillFile {
7
15
  relativePath: string;
8
16
  }
9
17
  declare function collectBundledSkillFilesBoundedAsync(sourceDir: string, state: CopyState, relativeDir?: string): Promise<BundledSkillFile[]>;
18
+ declare function copyBundledDirectoryBoundedAsync(sourceDir: string, destDir: string): Promise<void>;
10
19
  /**
11
- * Materialize missing built-in mode skills into the target project so architect
12
- * MODE dispatch can load SKILL.md files in repositories that do not already
13
- * vendor the latest opencode-swarm skill tree.
20
+ * Materialize built-in mode skills into the target project's private runtime
21
+ * tree so architect MODE dispatch never collides with repository-owned skills
22
+ * that happen to use the same slug.
14
23
  *
15
24
  * Async, bounded, and fail-open: safe to `await withTimeout(...)` on the
16
25
  * plugin-init path (AGENTS.md Invariant 1). Runs at plugin init so the
@@ -24,6 +33,7 @@ declare function collectBundledSkillFilesBoundedAsync(sourceDir: string, state:
24
33
  export declare function syncBundledProjectSkillsIfMissingAsync(projectDirectory: string, packageRoot: string, quiet?: boolean): Promise<void>;
25
34
  export declare const _test_exports: {
26
35
  collectBundledSkillFilesBoundedAsync: typeof collectBundledSkillFilesBoundedAsync;
27
- resetBundledProjectSkillSyncCache: () => undefined;
36
+ copyBundledDirectoryBoundedAsync: typeof copyBundledDirectoryBoundedAsync;
37
+ resetBundledProjectSkillSyncCache: () => void;
28
38
  };
29
39
  export {};
@@ -6,7 +6,7 @@
6
6
  * Non-fatal: any fs error (permissions, disk full, etc.) is swallowed so the
7
7
  * plugin continues with its default or global config.
8
8
  */
9
- export declare function writeProjectConfigIfNew(directory: string, quiet?: boolean): void;
9
+ export declare function writeProjectConfigIfNew(directory: string, _quiet?: boolean): void;
10
10
  /**
11
11
  * Writes .swarm/config.example.json on first plugin init for a given project.
12
12
  * Creates .swarm/ if it does not yet exist. Non-fatal: all errors are silently
@@ -818,6 +818,7 @@ export type KnowledgeApplicationConfig = z.infer<typeof KnowledgeApplicationConf
818
818
  export declare const SkillPropagationConfigSchema: z.ZodObject<{
819
819
  enabled: z.ZodDefault<z.ZodBoolean>;
820
820
  enforce: z.ZodDefault<z.ZodBoolean>;
821
+ audiences: z.ZodDefault<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
821
822
  }, z.core.$strip>;
822
823
  export type SkillPropagationConfig = z.infer<typeof SkillPropagationConfigSchema>;
823
824
  export declare const SkillImproverConfigSchema: z.ZodObject<{
@@ -2110,6 +2111,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
2110
2111
  skillPropagation: z.ZodOptional<z.ZodObject<{
2111
2112
  enabled: z.ZodDefault<z.ZodBoolean>;
2112
2113
  enforce: z.ZodDefault<z.ZodBoolean>;
2114
+ audiences: z.ZodDefault<z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
2113
2115
  }, z.core.$strip>>;
2114
2116
  skill_improver: z.ZodOptional<z.ZodObject<{
2115
2117
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -8,9 +8,10 @@
8
8
  * tool to a skill-capable agent (coder, reviewer, test_engineer, sme,
9
9
  * docs, designer) and the SKILLS field is missing or "none" while
10
10
  * skills exist in the project, appends a warning event to
11
- * `.swarm/events.jsonl`. This is a SOFT WARNING it NEVER blocks
12
- * tool execution. Also records skill delegation entries to
13
- * `.swarm/skill-usage.jsonl` for auditability.
11
+ * `.swarm/events.jsonl`. Missing skills are a soft warning by default;
12
+ * malformed, escaping, unreadable, or audience-ineligible explicit
13
+ * `SKILLS:` references always block. Also records skill delegation entries
14
+ * to `.swarm/skill-usage.jsonl` for auditability.
14
15
  *
15
16
  * 2. `experimental.chat.messages.transform` — scans reviewer output
16
17
  * for SKILL_COMPLIANCE verdicts and records compliance outcomes
@@ -18,7 +19,7 @@
18
19
  */
19
20
  import * as fs from 'node:fs';
20
21
  import type { MessageWithParts } from './knowledge-types.js';
21
- import { computeSkillRelevanceScore, formatSkillIndexWithContext, readSkillMetadata } from './skill-scoring.js';
22
+ import { computeSkillRelevanceScore, formatSkillIndexWithContext, readSkillMetadata, type SkillAudienceContext, type SkillMetadata } from './skill-scoring.js';
22
23
  import { appendSkillUsageEntry, readSkillUsageEntries, readSkillUsageEntriesTail } from './skill-usage-log.js';
23
24
  /**
24
25
  * Load routing skills from .opencode/skill-routing.yaml for a target agent.
@@ -43,11 +44,14 @@ export interface SkillPropagationConfig {
43
44
  enabled: boolean;
44
45
  /** When true, blocks delegations missing SKILLS field instead of warning. */
45
46
  enforce?: boolean;
47
+ /** Project/domain audience tokens accepted by this repository. */
48
+ audiences?: readonly string[];
46
49
  }
47
50
  export declare const _internals: {
48
51
  readdirSync: typeof fs.readdirSync;
49
52
  existsSync: typeof fs.existsSync;
50
53
  statSync: typeof fs.statSync;
54
+ realpathSync: typeof fs.realpathSync;
51
55
  mkdirSync: typeof fs.mkdirSync;
52
56
  appendFileSync: typeof fs.appendFileSync;
53
57
  readFileSync: typeof fs.readFileSync;
@@ -63,6 +67,8 @@ export declare const _internals: {
63
67
  readSkillUsageEntries: typeof readSkillUsageEntries;
64
68
  readSkillUsageEntriesTail: typeof readSkillUsageEntriesTail;
65
69
  parseSkillPaths: typeof parseSkillPaths;
70
+ extractFileSkillReferences: typeof extractFileSkillReferences;
71
+ validateSkillReference: typeof validateSkillReference;
66
72
  extractTaskIdFromPrompt: typeof extractTaskIdFromPrompt;
67
73
  extractSkillsFieldFromPrompt: typeof extractSkillsFieldFromPrompt;
68
74
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
@@ -106,6 +112,39 @@ export declare function writeWarnEvent(directory: string, record: Record<string,
106
112
  * Returns empty array for empty, "none", or unparseable values.
107
113
  */
108
114
  export declare function parseSkillPaths(fieldValue: string): string[];
115
+ /** Return only authoritative file references; all other content is inline. */
116
+ export declare function extractFileSkillReferences(fieldValue: string): string[];
117
+ /** Bound synchronous filesystem validation driven by model-authored fields. */
118
+ export declare const MAX_EXPLICIT_SKILL_REFERENCES = 16;
119
+ export declare const MAX_PROVENANCE_SKILL_REFERENCES_PER_TRANSFORM = 64;
120
+ interface SkillReferenceValidation {
121
+ valid: boolean;
122
+ reason: string | null;
123
+ skillPath?: string;
124
+ metadata?: SkillMetadata;
125
+ }
126
+ /** Build the OpenCode plugin's active audience context. */
127
+ export declare function resolveSkillAudienceContext(config: SkillPropagationConfig): SkillAudienceContext;
128
+ /**
129
+ * Validate a repo-relative skill reference without trusting its frontmatter.
130
+ * Explicit and discovered loads require a real, readable SKILL.md. Legacy
131
+ * frontmatter-less skills remain compatible and have match-all audience;
132
+ * malformed or unreadable frontmatter fails closed.
133
+ */
134
+ export declare function validateSkillReference(directory: string, reference: string, context: SkillAudienceContext, options: {
135
+ enforceAudience: boolean;
136
+ requireFilePrefix?: boolean;
137
+ }): SkillReferenceValidation;
138
+ /**
139
+ * Mandatory explicit-reference integrity gate. This is intentionally separate
140
+ * from optional recommendation/scoring behavior and must run even when
141
+ * `skillPropagation.enabled` is false.
142
+ */
143
+ export declare function validateExplicitSkillReferencesBefore(directory: string, input: SkillGateInput, config: SkillPropagationConfig): Promise<{
144
+ blocked: boolean;
145
+ reason: string | null;
146
+ validatedSkillPaths?: string[];
147
+ }>;
109
148
  /**
110
149
  * Extract a task ID from a delegation prompt string.
111
150
  * Looks for patterns like "taskId: <id>" or "TASK: <id>" (case-insensitive).
@@ -146,4 +185,5 @@ export declare function skillPropagationGateBefore(directory: string, input: Ski
146
185
  */
147
186
  export declare function skillPropagationTransformScan(directory: string, output: {
148
187
  messages?: MessageWithParts[];
149
- }, sessionID?: string): Promise<void>;
188
+ }, sessionID?: string, config?: SkillPropagationConfig): Promise<void>;
189
+ export {};
@@ -33,10 +33,23 @@ export interface SkillStats {
33
33
  count: number;
34
34
  }>;
35
35
  }
36
+ export type SkillRunner = 'opencode' | 'claude' | 'codex';
37
+ /** Parsed state of an explicit (or absent) top-level audience declaration. */
38
+ export interface SkillAudienceMetadata {
39
+ status: 'absent' | 'valid' | 'invalid';
40
+ values: string[];
41
+ }
42
+ /** Active runner and project-domain audiences accepted by a skill loader. */
43
+ export interface SkillAudienceContext {
44
+ runner: SkillRunner;
45
+ audiences: readonly string[];
46
+ }
36
47
  /** Metadata extracted from a SKILL.md frontmatter block. */
37
48
  export interface SkillMetadata {
38
49
  /** Repo-relative path to the skill file. */
39
50
  path: string;
51
+ /** Whether frontmatter was readable and structurally present. */
52
+ frontmatterStatus?: 'valid' | 'absent' | 'invalid' | 'unavailable';
40
53
  /** Human-readable skill name. */
41
54
  name: string;
42
55
  /** Short description from frontmatter, or a fallback when absent. */
@@ -45,6 +58,8 @@ export interface SkillMetadata {
45
58
  skillType?: 'directive' | 'workflow';
46
59
  /** Literal trigger phrases from frontmatter. */
47
60
  triggers?: string[];
61
+ /** Bounded, top-level audience declaration and its parse status. */
62
+ audience?: SkillAudienceMetadata;
48
63
  }
49
64
  export declare const _internals: {
50
65
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
@@ -63,6 +78,12 @@ export declare const _internals: {
63
78
  * E.g. `.claude/skills/writing-tests/SKILL.md` → `writing-tests`
64
79
  */
65
80
  declare function extractSkillName(skillPath: string): string;
81
+ /**
82
+ * Match parsed skill audience metadata against the active project and runner.
83
+ * Domain tokens are ORed with domains, runner tokens are ORed with runners,
84
+ * and the two dimensions are ANDed together.
85
+ */
86
+ export declare function isSkillAudienceMatch(metadata: Pick<SkillMetadata, 'audience'>, context: SkillAudienceContext): boolean;
66
87
  /**
67
88
  * Parse the YAML-like frontmatter from a SKILL.md file. This intentionally
68
89
  * supports only the small subset skills use today: scalar `name` and scalar,
@@ -152,5 +173,5 @@ export declare function getSkillStats(skillPath: string, directory: string): Ski
152
173
  * @param directory - Project root directory.
153
174
  * @returns Multi-line formatted string, one line per skill.
154
175
  */
155
- export declare function formatSkillIndexWithContext(skills: string[], directory: string): string;
176
+ export declare function formatSkillIndexWithContext(skills: string[], directory: string, metadataBySkillPath?: ReadonlyMap<string, SkillMetadata>): string;
156
177
  export {};