@csark0812/skeleton 4.0.1 → 4.0.2
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 +6 -6
- package/dist/audit/config/types.d.ts +8 -0
- package/dist/audit/core/context.d.ts +5 -0
- package/dist/audit/core/repo-files.d.ts +5 -0
- package/dist/audit/core/report.d.ts +1 -0
- package/dist/audit/core/review-coverage.d.ts +18 -0
- package/dist/audit/rules/review-coverage.d.ts +8 -0
- package/dist/cli.js +574 -257
- package/dist/plugin-types.js +6 -0
- package/package.json +1 -1
- package/schemas/config.schema.json +17 -0
- package/templates/skeleton-init/pre-commit-config.yaml +9 -0
- package/templates/skeleton-init/skeleton.toml +7 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- source-of-truth: Package overview -->
|
|
4
4
|
|
|
5
|
-
<!-- doc-meta: owner=eng | last-reviewed=2026-09-
|
|
5
|
+
<!-- doc-meta: owner=eng | last-reviewed=2026-09-13 -->
|
|
6
6
|
|
|
7
7
|
<!-- review-deps: paths=src/cli.ts,package.json -->
|
|
8
8
|
|
|
@@ -157,15 +157,15 @@ skeleton customize resolve <slug>
|
|
|
157
157
|
| Path | Action |
|
|
158
158
|
| ----------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
159
159
|
| Docs in scan perimeter | path-scoped audit |
|
|
160
|
-
| Owned skill bodies (`SKILL.md` trees) |
|
|
160
|
+
| Owned skill bodies (`SKILL.md` trees) | run `audit skills` |
|
|
161
161
|
| Foreign / lockfile-synced skill bodies | skip → lint in the owning skills/toolbox repo |
|
|
162
162
|
| `.sh`, `.bash`, `.zsh` | shellcheck or `bash -n` |
|
|
163
163
|
| Other `.json` | JSONC-tolerant syntax check |
|
|
164
164
|
| Any repository file | native gates where applicable + audit documents whose `review-deps` path or glob matched |
|
|
165
165
|
|
|
166
|
-
Pre-commit: `skeleton validate changed --staged` (
|
|
166
|
+
Pre-commit: `skeleton validate changed --staged` (index bytes, coverage, owning papers).
|
|
167
167
|
|
|
168
|
-
CI: `skeleton validate changed --base origin/main` (global rules first, then changed files).
|
|
168
|
+
CI: `skeleton validate changed --base origin/main` (global rules first, then changed files, same coverage fail).
|
|
169
169
|
|
|
170
170
|
## Ecosystem
|
|
171
171
|
|
|
@@ -200,8 +200,8 @@ bun run check
|
|
|
200
200
|
|
|
201
201
|
`bun run check` = lint + test + typecheck + build + `audit:self`.
|
|
202
202
|
|
|
203
|
-
`validate:changed` does not replace code tests. It classifies code separately and also audits every scanned document whose `review-deps` declaration matches a changed file.
|
|
203
|
+
`validate:changed` does not replace code tests. It classifies code separately and also audits every scanned document whose `review-deps` declaration matches a changed file. A coverage-candidate path with no owning paper fails on local and CI runs. Owned skill-body edits run the skills suite. `--staged` reads git index bytes.
|
|
204
204
|
|
|
205
205
|
For code: `bun test`, `bun run typecheck`, `bun run build`.
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
`skeleton init` writes `.pre-commit-config.yaml`. Install [pre-commit](https://pre-commit.com/) once (`brew install pre-commit` or `pipx install pre-commit`), then `pre-commit install`.
|
|
@@ -24,6 +24,13 @@ export interface SkillOwnershipConfig {
|
|
|
24
24
|
/** Force these slugs foreign even if absent from the lockfile / local. */
|
|
25
25
|
foreignSlugs?: string[];
|
|
26
26
|
}
|
|
27
|
+
/** Files that must appear in at least one scanned document's review-deps. */
|
|
28
|
+
export interface ReviewCoverageConfig {
|
|
29
|
+
/** Repo-relative globs that require an owning paper. Empty include disables the gate. */
|
|
30
|
+
include?: string[];
|
|
31
|
+
/** Globs removed from the coverage set. */
|
|
32
|
+
exclude?: string[];
|
|
33
|
+
}
|
|
27
34
|
/** Verifiable evidence that a human review covered exact document and code bytes. */
|
|
28
35
|
export interface ReviewProofConfig {
|
|
29
36
|
/** Hash mode stores reviewed document and code-target digests in a lockfile. */
|
|
@@ -54,6 +61,7 @@ export interface SkeletonConfig {
|
|
|
54
61
|
customize?: CustomizeConfig;
|
|
55
62
|
skillOwnership?: SkillOwnershipConfig;
|
|
56
63
|
reviewProof?: ReviewProofConfig;
|
|
64
|
+
reviewCoverage?: ReviewCoverageConfig;
|
|
57
65
|
docsLint?: DocsLintConfig;
|
|
58
66
|
/**
|
|
59
67
|
* Plugin entry paths relative to `.skeleton/` (e.g. `plugins/example.ts`).
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SkeletonConfig } from "../config/types.ts";
|
|
2
2
|
import type { PolicyFile } from "../policies/types.ts";
|
|
3
|
+
import type { FileSource } from "./repo-files.ts";
|
|
3
4
|
import { type SkillIndex } from "./skill-roots.ts";
|
|
4
5
|
import type { SsotForm } from "./ssot.ts";
|
|
5
6
|
import { type SsotFileEntry } from "./ssot-collect.ts";
|
|
@@ -30,6 +31,8 @@ export interface AuditContext {
|
|
|
30
31
|
lockedSkillSlugs: Set<string>;
|
|
31
32
|
/** Compiled prose policies from plugins (empty when no plugins / no policy globs). */
|
|
32
33
|
policies: PolicyFile[];
|
|
34
|
+
/** Read document and dependency bytes from the worktree or the git index. */
|
|
35
|
+
fileSource?: FileSource;
|
|
33
36
|
}
|
|
34
37
|
export interface AuditOptions {
|
|
35
38
|
root?: string;
|
|
@@ -42,5 +45,7 @@ export interface AuditOptions {
|
|
|
42
45
|
* matches path-scoped / validate `--base` prove.
|
|
43
46
|
*/
|
|
44
47
|
includeExcludedSkillTrees?: boolean;
|
|
48
|
+
/** When `index`, review-proof and coverage reads use `git show :path`. */
|
|
49
|
+
fileSource?: FileSource;
|
|
45
50
|
}
|
|
46
51
|
export declare function createContext(options?: AuditOptions): AuditContext;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type FileSource = "worktree" | "index";
|
|
2
|
+
/** Read a repo-relative file from the worktree or the git index. */
|
|
3
|
+
export declare function readRepoText(root: string, relPath: string, source?: FileSource): string | null;
|
|
4
|
+
/** True when worktree bytes differ from HEAD, including new untracked files. */
|
|
5
|
+
export declare function pathDiffersFromHead(root: string, relPath: string): boolean;
|
|
@@ -29,3 +29,4 @@ export declare function issue(rule: string, file: string, details: string | Issu
|
|
|
29
29
|
export declare function issue(rule: string, file: string, message: string, options?: IssueOptions): Issue;
|
|
30
30
|
export declare function finalizeIssues(issues: Issue[], strict: boolean): Issue[];
|
|
31
31
|
export declare function printReport(issues: Issue[], options: ReportOptions): number;
|
|
32
|
+
export declare function isRereadIssue(item: Issue): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SkeletonConfig } from "../config/types.ts";
|
|
2
|
+
import { type FileSource } from "./repo-files.ts";
|
|
3
|
+
import type { SkillIndex } from "./skill-roots.ts";
|
|
4
|
+
export declare const DEFAULT_REVIEW_COVERAGE_INCLUDE: string[];
|
|
5
|
+
export declare const DEFAULT_REVIEW_COVERAGE_EXCLUDE: string[];
|
|
6
|
+
export declare function reviewCoveragePatterns(config: SkeletonConfig): {
|
|
7
|
+
include: string[];
|
|
8
|
+
exclude: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function pathRequiresReviewCoverage(relPath: string, config: SkeletonConfig): boolean;
|
|
11
|
+
export declare function collectReviewDependencyPatterns(input: {
|
|
12
|
+
root: string;
|
|
13
|
+
config: SkeletonConfig;
|
|
14
|
+
skillIndex: SkillIndex;
|
|
15
|
+
fileSource?: FileSource;
|
|
16
|
+
}): string[];
|
|
17
|
+
export declare function pathHasReviewOwner(relPath: string, patterns: string[]): boolean;
|
|
18
|
+
export declare function collectReviewCoverageFiles(root: string, config: SkeletonConfig): 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 runReviewCoverageRule(ctx: AuditContext): Issue[];
|
|
4
|
+
export declare const reviewCoverageRule: {
|
|
5
|
+
id: string;
|
|
6
|
+
global: boolean;
|
|
7
|
+
run: typeof runReviewCoverageRule;
|
|
8
|
+
};
|