@csark0812/skeleton 1.6.2 → 2.0.0
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 +19 -12
- package/dist/audit/config/load.d.ts +18 -0
- package/dist/audit/config/types.d.ts +75 -0
- package/dist/audit/core/code-fit.d.ts +35 -0
- package/dist/audit/core/collect.d.ts +21 -0
- package/dist/audit/core/context.d.ts +46 -0
- package/dist/audit/core/draft.d.ts +11 -0
- package/dist/audit/core/fix.d.ts +29 -0
- package/dist/audit/core/git-meta.d.ts +1 -0
- package/dist/audit/core/markdown.d.ts +16 -0
- package/dist/audit/core/report.d.ts +31 -0
- package/dist/audit/core/review-proof.d.ts +23 -0
- package/dist/audit/core/shared.d.ts +25 -0
- package/dist/audit/core/skill-provenance.d.ts +37 -0
- package/dist/audit/core/skill-roots.d.ts +54 -0
- package/dist/audit/core/ssot-collect.d.ts +16 -0
- package/dist/audit/core/ssot-fit.d.ts +38 -0
- package/dist/audit/core/ssot.d.ts +28 -0
- package/dist/audit/fix/anchors.d.ts +6 -0
- package/dist/audit/fix/doc-meta.d.ts +4 -0
- package/dist/audit/fix/match-anchor.d.ts +8 -0
- package/dist/audit/fix/ssot.d.ts +3 -0
- package/dist/audit/policies/load.d.ts +13 -0
- package/dist/audit/policies/types.d.ts +46 -0
- package/dist/audit/rules/banned.d.ts +7 -0
- package/dist/audit/rules/code-fit.d.ts +13 -0
- package/dist/audit/rules/doc-meta.d.ts +8 -0
- package/dist/audit/rules/index.d.ts +26 -0
- package/dist/audit/rules/links.d.ts +7 -0
- package/dist/audit/rules/near-duplicate.d.ts +8 -0
- package/dist/audit/rules/prose-policy.d.ts +7 -0
- package/dist/audit/rules/review-proof.d.ts +1 -0
- package/dist/audit/rules/scan-gaps.d.ts +7 -0
- package/dist/audit/rules/scan-roots.d.ts +7 -0
- package/dist/audit/rules/skill-index.d.ts +10 -0
- package/dist/audit/rules/ssot-summary.d.ts +8 -0
- package/dist/audit/rules/ssot.d.ts +7 -0
- package/dist/cli.js +4439 -3631
- package/dist/hooks/customize-on-skill-read.js +27 -1
- package/dist/plugin-types.d.ts +12 -131
- package/dist/plugin-types.js +6 -3
- package/dist/references/check.d.ts +10 -0
- package/dist/references/constants.d.ts +9 -0
- package/dist/references/discover.d.ts +19 -0
- package/dist/result-types.d.ts +72 -0
- package/dist/result-types.js +0 -0
- package/package.json +26 -17
- package/schemas/config.schema.json +29 -1
- package/schemas/policy-file.schema.json +5 -2
- package/schemas/result.schema.json +207 -0
- package/templates/skeleton-init/skeleton.toml +6 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import type { FixEdit } from "../core/fix.ts";
|
|
3
|
+
export declare function bumpDocMetaLastReviewed(content: string, gitDate: string): string | null;
|
|
4
|
+
export declare function collectDocMetaFixes(ctx: AuditContext): FixEdit[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ANCHOR_MATCH_MIN_SCORE: number;
|
|
2
|
+
export declare const ANCHOR_MATCH_MIN_MARGIN = 0.15;
|
|
3
|
+
export interface AnchorMatch {
|
|
4
|
+
slug: string;
|
|
5
|
+
score: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function scoreAnchorMatch(brokenSlug: string, candidateSlug: string): number;
|
|
8
|
+
export declare function findBestAnchorMatch(brokenSlug: string, candidates: Iterable<string>): AnchorMatch | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MatchedPolicyEntry, PolicyEntry, PolicyFile } from "./types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Compile YAML entries. Matching is case-insensitive by default. The legacy
|
|
4
|
+
* `skill-hub-duplication` name remains case-sensitive for 1.x compatibility;
|
|
5
|
+
* new policies must use the explicit `caseSensitive` field.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compilePolicy(name: string, raw: PolicyEntry[]): PolicyFile;
|
|
8
|
+
/** Make sure that every non-regex policy has an installed evaluator. */
|
|
9
|
+
export declare function assertPolicyHandlers(policies: PolicyFile[], rules: Array<{
|
|
10
|
+
id: string;
|
|
11
|
+
}>): void;
|
|
12
|
+
export declare function loadPolicyFile(absPath: string, content: string): PolicyFile;
|
|
13
|
+
export declare function policiesForFile(policies: PolicyFile[], relPath: string): MatchedPolicyEntry[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Severity } from "../core/report.ts";
|
|
2
|
+
interface PolicyEntryBase {
|
|
3
|
+
id: string;
|
|
4
|
+
message: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
severity?: Severity;
|
|
7
|
+
canonical?: string;
|
|
8
|
+
/** Match regex bytes exactly when true. Default: false. */
|
|
9
|
+
caseSensitive?: boolean;
|
|
10
|
+
/** Restrict a matched marker to configured draft locations. */
|
|
11
|
+
placement?: "any" | "draft-only";
|
|
12
|
+
}
|
|
13
|
+
export type PolicyEntry = (PolicyEntryBase & {
|
|
14
|
+
mode?: "pattern";
|
|
15
|
+
pattern: string;
|
|
16
|
+
}) | (PolicyEntryBase & {
|
|
17
|
+
mode: "fingerprint";
|
|
18
|
+
pattern?: string;
|
|
19
|
+
/** Audit rule id that evaluates this non-regex entry. */
|
|
20
|
+
handledBy: string;
|
|
21
|
+
});
|
|
22
|
+
export interface CompiledPolicyEntry {
|
|
23
|
+
id: string;
|
|
24
|
+
message: string;
|
|
25
|
+
mode: "pattern" | "fingerprint";
|
|
26
|
+
pattern?: string;
|
|
27
|
+
scope?: string;
|
|
28
|
+
severity?: Severity;
|
|
29
|
+
canonical?: string;
|
|
30
|
+
caseSensitive?: boolean;
|
|
31
|
+
placement?: "any" | "draft-only";
|
|
32
|
+
handledBy?: string;
|
|
33
|
+
regex: RegExp | null;
|
|
34
|
+
}
|
|
35
|
+
export interface PolicyFile {
|
|
36
|
+
name: string;
|
|
37
|
+
entries: CompiledPolicyEntry[];
|
|
38
|
+
}
|
|
39
|
+
export interface PolicyFileYaml {
|
|
40
|
+
name: string;
|
|
41
|
+
entries: PolicyEntry[];
|
|
42
|
+
}
|
|
43
|
+
export type MatchedPolicyEntry = CompiledPolicyEntry & {
|
|
44
|
+
policyName: string;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Docs↔code surface fit. Always discovers marked docs across the full scan
|
|
5
|
+
* perimeter (ignores path-filtered ctx.files) so code drift is still caught.
|
|
6
|
+
*/
|
|
7
|
+
export declare function runCodeFitRule(ctx: AuditContext): Issue[];
|
|
8
|
+
/** Path-scoped suite membership, but alwaysRun so --paths does not skip it. */
|
|
9
|
+
export declare const codeFitRule: {
|
|
10
|
+
id: string;
|
|
11
|
+
alwaysRun: boolean;
|
|
12
|
+
run: typeof runCodeFitRule;
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function gitFreshnessMessage(reviewedStr: string, gitDate: string): string;
|
|
4
|
+
export declare function runDocMetaRule(ctx: AuditContext): Issue[];
|
|
5
|
+
export declare const docMetaRule: {
|
|
6
|
+
id: string;
|
|
7
|
+
run: typeof runDocMetaRule;
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import type { Issue } from "../core/report.ts";
|
|
3
|
+
export type AuditSuite = "docs" | "skills";
|
|
4
|
+
export interface AuditRule {
|
|
5
|
+
id: string;
|
|
6
|
+
global?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* When true, still run under `--paths` / path-scoped validate (globals are skipped).
|
|
9
|
+
* Used by rules that must re-check the full scan corpus (e.g. code-fit markers).
|
|
10
|
+
*/
|
|
11
|
+
alwaysRun?: boolean;
|
|
12
|
+
/** Which audit suites include this rule. Default: `["docs"]`. */
|
|
13
|
+
suites?: AuditSuite[];
|
|
14
|
+
run: (ctx: AuditContext) => Issue[];
|
|
15
|
+
}
|
|
16
|
+
export declare const docsRules: AuditRule[];
|
|
17
|
+
export declare const skillsRules: AuditRule[];
|
|
18
|
+
export declare const allRules: AuditRule[];
|
|
19
|
+
export declare function assembleRules(pluginRules?: AuditRule[]): {
|
|
20
|
+
docs: AuditRule[];
|
|
21
|
+
skills: AuditRule[];
|
|
22
|
+
self: AuditRule[];
|
|
23
|
+
};
|
|
24
|
+
export declare function rulesForSuite(suite: string, pluginRules?: AuditRule[]): AuditRule[];
|
|
25
|
+
export declare function globalRulesForSuite(suite: string, pluginRules?: AuditRule[]): AuditRule[];
|
|
26
|
+
export declare function pathScopedRulesForSuite(suite: string, pluginRules?: AuditRule[]): AuditRule[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function jaccard(a: Set<string>, b: Set<string>): number;
|
|
4
|
+
export declare function runNearDuplicateRule(ctx: AuditContext): Issue[];
|
|
5
|
+
export declare const nearDuplicateRule: {
|
|
6
|
+
id: string;
|
|
7
|
+
run: typeof runNearDuplicateRule;
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function runProsePolicyRule(ctx: AuditContext): Issue[];
|
|
4
|
+
export declare const prosePolicyRule: {
|
|
5
|
+
id: string;
|
|
6
|
+
run: typeof runProsePolicyRule;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { reviewProofRule, runReviewProofRule } from "../core/review-proof.ts";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function runCoverageGapsRule(ctx: AuditContext): Issue[];
|
|
4
|
+
export declare const coverageGapsRule: {
|
|
5
|
+
id: string;
|
|
6
|
+
run: typeof runCoverageGapsRule;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function runScanRootsRule(ctx: AuditContext): Issue[];
|
|
4
|
+
export declare const scanRootsRule: {
|
|
5
|
+
id: string;
|
|
6
|
+
run: typeof runScanRootsRule;
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function runSkillIndexRule(ctx: AuditContext): Issue[];
|
|
4
|
+
export declare const skillIndexRule: {
|
|
5
|
+
id: string;
|
|
6
|
+
run: typeof runSkillIndexRule;
|
|
7
|
+
};
|
|
8
|
+
export declare function skillCountOnDisk(ctx: AuditContext): number;
|
|
9
|
+
/** Success-suffix detail: owned audited vs foreign ignored. */
|
|
10
|
+
export declare function skillAuditSuffix(ctx: AuditContext): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AuditContext } from "../core/context.ts";
|
|
2
|
+
import { type Issue } from "../core/report.ts";
|
|
3
|
+
export declare function runSsotSummaryRule(ctx: AuditContext): Issue[];
|
|
4
|
+
export declare const ssotSummaryRule: {
|
|
5
|
+
id: string;
|
|
6
|
+
run: typeof runSsotSummaryRule;
|
|
7
|
+
};
|
|
8
|
+
export { buildEvidenceText, ssotBodyOverlap, ssotEvidenceOverlap, } from "../core/ssot-fit.ts";
|