@zgeoff/skill-gate 0.2.7 → 0.2.8

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.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # @zgeoff/skill-gate
2
2
 
3
- The skill gate is a Claude Code hook that denies an edit until the session has loaded every skill
4
- the path needs, and names the missing skills. It denies a call to a gated tool, such as an MCP tool,
5
- the same way until the session has loaded the skills and read the reference files the tool needs.
6
- After a Bash command, it compares `git status` with the status before the command, and it blocks
7
- when the command changed a gated file that the session lacks the skills for. The package holds no
8
- rules: each repo keeps its own in `.claude/skill-gate.json`, and a repo without that file has no
9
- gate.
3
+ The skill gate is a Claude Code and Codex CLI hook that denies an edit until the session has loaded
4
+ every skill the path needs, and names the missing skills. It denies a call to a gated tool, such as
5
+ an MCP tool, the same way until the session has loaded the skills and read the reference files the
6
+ tool needs. After a Bash command, it compares `git status` with the status before the command, and
7
+ it blocks when the command changed a gated file that the session lacks the skills for. The package
8
+ holds no rules: each repo keeps its own in `.claude/skill-gate.json`, and a repo without that file
9
+ has no gate.
10
10
 
11
11
  ## Install
12
12
 
@@ -67,6 +67,14 @@ the matcher skips. This example gates `mcp__tracker__update_ticket`:
67
67
  }
68
68
  ```
69
69
 
70
+ ## Codex
71
+
72
+ The same entry point runs as a Codex hook when its command passes `--harness codex`, and it gates
73
+ `apply_patch` edits, gated tools and Bash commands as it does under Claude Code. Codex has no Skill
74
+ tool, so the gate keeps a ledger of what each session loaded.
75
+ [Gating Codex edits](../../docs/guides/skill-gate-codex.md) holds the `.codex/hooks.json` example,
76
+ the trust step and the ledger rules.
77
+
70
78
  ## Rules
71
79
 
72
80
  `.claude/skill-gate.json` maps path globs to the skills each path needs, and the optional `tools`
@@ -1,4 +1,6 @@
1
+ import type { Harness } from './harness.ts';
1
2
  import type { BashChangeHookOutput, PostToolEvent } from './types.ts';
2
3
  export declare function buildBashChangeOutput(event: PostToolEvent, changedPaths: readonly string[], missing: readonly string[], context?: {
3
4
  readonly compacted?: boolean;
5
+ readonly harness?: Harness;
4
6
  }): BashChangeHookOutput | null;
@@ -1,4 +1,6 @@
1
+ import type { Harness } from './harness.ts';
1
2
  import type { SkillGateHookOutput } from './types.ts';
2
3
  export declare function buildBashSkillGateOutput(gatedPaths: readonly string[], missing: readonly string[], context?: {
3
4
  readonly compacted?: boolean;
5
+ readonly harness?: Harness;
4
6
  }): SkillGateHookOutput | null;
@@ -0,0 +1,3 @@
1
+ import type { Harness } from './harness.ts';
2
+ import type { EditEntry, SkillGateHookOutput, SkillGateOutputContext } from './types.ts';
3
+ export declare function buildEditOutput(harness: Harness, entries: readonly EditEntry[], context: SkillGateOutputContext): SkillGateHookOutput | null;
@@ -0,0 +1,2 @@
1
+ import type { EditEntry, SkillGateHookOutput, SkillGateOutputContext } from './types.ts';
2
+ export declare function buildPatchGateOutput(entries: readonly EditEntry[], context?: SkillGateOutputContext): SkillGateHookOutput | null;
@@ -0,0 +1,5 @@
1
+ export interface ClassifiedReads {
2
+ readonly skills: readonly string[];
3
+ readonly readPaths: readonly string[];
4
+ }
5
+ export declare function classifyCommandReads(readFiles: readonly string[], projectDir: string, references: readonly string[]): ClassifiedReads;
@@ -0,0 +1 @@
1
+ export declare function collectCommandReads(command: string, cwd: string): readonly string[];
@@ -0,0 +1 @@
1
+ export declare function collectPromptSkills(prompt: string): readonly string[];
@@ -0,0 +1,2 @@
1
+ import type { SkillGateOutputContext, UnknownSkill } from './types.ts';
2
+ export declare function collectRuleWarnings(unknown: readonly UnknownSkill[], context: SkillGateOutputContext): readonly string[];
@@ -0,0 +1 @@
1
+ export type Harness = 'claude-code' | 'codex';
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { runSkillGate } from './run-skill-gate.ts';
2
+ export type { Harness } from './harness.ts';