skillset 0.0.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.
- package/dist/hook.js +14 -0
- package/dist/index.js +110 -0
- package/dist/types/cache/index.d.ts +9 -0
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/config/index.d.ts +29 -0
- package/dist/types/doctor.d.ts +12 -0
- package/dist/types/format/index.d.ts +3 -0
- package/dist/types/hook.d.ts +1 -0
- package/dist/types/hooks/hook-runner.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/indexer/index.d.ts +6 -0
- package/dist/types/logger/index.d.ts +2 -0
- package/dist/types/resolver/index.d.ts +3 -0
- package/dist/types/tokenizer/index.d.ts +2 -0
- package/dist/types/tree/index.d.ts +24 -0
- package/dist/types/tree/markdown.d.ts +18 -0
- package/dist/types/types.d.ts +43 -0
- package/package.json +53 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CacheSchema, Skill } from "../types";
|
|
2
|
+
export declare const CACHE_PATHS: {
|
|
3
|
+
project: string;
|
|
4
|
+
user: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function loadCaches(): CacheSchema;
|
|
7
|
+
export declare function writeCacheSync(path: string, cache: CacheSchema): void;
|
|
8
|
+
export declare function updateCacheSync(target: "project" | "user", updater: (cache: CacheSchema) => CacheSchema): void;
|
|
9
|
+
export declare function isStructureFresh(skill: Skill, ttlSeconds: number): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildCli(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ConfigSchema, Mode } from "../types";
|
|
2
|
+
export declare const CONFIG_PATHS: {
|
|
3
|
+
project: string;
|
|
4
|
+
projectLocal: string;
|
|
5
|
+
user: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function loadConfig(): ConfigSchema;
|
|
8
|
+
export declare function ensureConfigFiles(): void;
|
|
9
|
+
export declare function modeLabel(mode: Mode): "warn" | "strict";
|
|
10
|
+
/**
|
|
11
|
+
* Write config to a specific file
|
|
12
|
+
*/
|
|
13
|
+
export declare function writeConfig(scope: "project" | "local" | "user", config: Partial<ConfigSchema>): void;
|
|
14
|
+
/**
|
|
15
|
+
* Read config from a specific scope
|
|
16
|
+
*/
|
|
17
|
+
export declare function readConfigByScope(scope: "project" | "local" | "user"): Partial<ConfigSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Get path for a specific config scope
|
|
20
|
+
*/
|
|
21
|
+
export declare function getConfigPath(scope: "project" | "local" | "user"): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get a config value using dot notation
|
|
24
|
+
*/
|
|
25
|
+
export declare function getConfigValue(config: ConfigSchema, key: string): unknown | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Set a config value using dot notation
|
|
28
|
+
*/
|
|
29
|
+
export declare function setConfigValue(config: Partial<ConfigSchema>, key: string, value: unknown): Partial<ConfigSchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run full diagnostic check
|
|
3
|
+
*/
|
|
4
|
+
export declare function runFullDiagnostic(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Run config-specific diagnostic
|
|
7
|
+
*/
|
|
8
|
+
export declare function runConfigDiagnostic(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Run skill-specific diagnostic
|
|
11
|
+
*/
|
|
12
|
+
export declare function runSkillDiagnostic(skillAlias: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runUserPromptSubmitHook(stdin: string): Promise<string>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CacheSchema, ConfigSchema, InvocationToken, ResolveResult } from "../types";
|
|
2
|
+
export declare function resolveToken(token: InvocationToken, config?: ConfigSchema, cache?: CacheSchema): ResolveResult;
|
|
3
|
+
export declare function resolveTokens(tokens: InvocationToken[], config?: ConfigSchema, cache?: CacheSchema): ResolveResult[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CacheSchema, Skill } from "../types";
|
|
2
|
+
export { parseMarkdownHeadings, headingsToTreeObject } from "./markdown";
|
|
3
|
+
interface TreeOptions {
|
|
4
|
+
/** Include markdown heading structure for SKILL.md files */
|
|
5
|
+
includeMarkdown?: boolean;
|
|
6
|
+
/** Maximum depth to recurse */
|
|
7
|
+
maxDepth?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Build a tree for a single skill, showing its directory + SKILL.md headings.
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildSkillTree(skill: Skill, options?: TreeOptions): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Build a tree for a namespace, showing all skills in that namespace.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildNamespaceTree(namespace: string, cache: CacheSchema, options?: TreeOptions): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Build a tree from a direct path (directory or SKILL.md file).
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildPathTree(path: string, options?: TreeOptions): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Determine if input is a namespace reference.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isNamespaceRef(input: string): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse markdown content and extract heading structure.
|
|
3
|
+
* Only used for SKILL.md files.
|
|
4
|
+
*/
|
|
5
|
+
export interface HeadingNode {
|
|
6
|
+
level: number;
|
|
7
|
+
text: string;
|
|
8
|
+
children: HeadingNode[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse markdown content into a heading tree structure.
|
|
12
|
+
* Only captures ## and ### headings (ignores # as that's usually the title).
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseMarkdownHeadings(content: string): HeadingNode[];
|
|
15
|
+
/**
|
|
16
|
+
* Convert heading tree to object-treeify compatible format.
|
|
17
|
+
*/
|
|
18
|
+
export declare function headingsToTreeObject(headings: HeadingNode[]): Record<string, unknown>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type Mode = "warn" | "strict";
|
|
2
|
+
export interface Skill {
|
|
3
|
+
skillRef: string;
|
|
4
|
+
path: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string | undefined;
|
|
7
|
+
structure: string | undefined;
|
|
8
|
+
lineCount: number | undefined;
|
|
9
|
+
cachedAt: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface CacheSchema {
|
|
12
|
+
version: number;
|
|
13
|
+
structureTTL: number;
|
|
14
|
+
skills: Record<string, Skill>;
|
|
15
|
+
}
|
|
16
|
+
export interface MappingEntry {
|
|
17
|
+
skillRef: string;
|
|
18
|
+
pinned?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfigSchema {
|
|
21
|
+
version: number;
|
|
22
|
+
mode: Mode;
|
|
23
|
+
showStructure: boolean;
|
|
24
|
+
maxLines: number;
|
|
25
|
+
mappings: Record<string, MappingEntry>;
|
|
26
|
+
namespaceAliases: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
export interface ResolveResult {
|
|
29
|
+
invocation: InvocationToken;
|
|
30
|
+
skill?: Skill;
|
|
31
|
+
reason?: string;
|
|
32
|
+
candidates?: Skill[];
|
|
33
|
+
}
|
|
34
|
+
export interface InvocationToken {
|
|
35
|
+
raw: string;
|
|
36
|
+
alias: string;
|
|
37
|
+
namespace: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
export interface InjectOutcome {
|
|
40
|
+
resolved: ResolveResult[];
|
|
41
|
+
warnings: string[];
|
|
42
|
+
context: string;
|
|
43
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skillset",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Deterministic skill invocation for AI coding agents via $skill syntax.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"skillset": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "bun run src/index.ts --",
|
|
12
|
+
"clean": "rm -rf dist",
|
|
13
|
+
"types": "bunx tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
14
|
+
"build": "bun run clean && bun build ./src/index.ts ./src/hook.ts --outdir dist --target bun --minify && bun run types",
|
|
15
|
+
"lint": "bunx biome check .",
|
|
16
|
+
"format": "bunx ultracite fix .",
|
|
17
|
+
"prepublishOnly": "bunx biome check . && bun test && bun run build",
|
|
18
|
+
"test": "bun test"
|
|
19
|
+
},
|
|
20
|
+
"files": ["dist"],
|
|
21
|
+
"author": "Matt Galligan",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"bun": ">=1.0.0"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"chalk": "^5.3.0",
|
|
28
|
+
"commander": "^11.1.0",
|
|
29
|
+
"inquirer": "^9.2.12",
|
|
30
|
+
"object-treeify": "^5.0.1",
|
|
31
|
+
"ora": "^8.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@biomejs/biome": "^1.8.0",
|
|
35
|
+
"@types/inquirer": "9",
|
|
36
|
+
"bun-types": "^1.3.2",
|
|
37
|
+
"typescript": "^5.6.3",
|
|
38
|
+
"ultracite": "^6.4.2"
|
|
39
|
+
},
|
|
40
|
+
"exports": {
|
|
41
|
+
".": "./dist/index.js",
|
|
42
|
+
"./hook": "./dist/hook.js"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/outfitter-dev/skillset.git"
|
|
47
|
+
},
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://github.com/outfitter-dev/skillset/issues"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://github.com/outfitter-dev/skillset#readme",
|
|
52
|
+
"keywords": ["claude", "ai", "agents", "skills", "codex", "cli"]
|
|
53
|
+
}
|