@jawache/flow 0.1.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/LICENCE +21 -0
- package/README.md +309 -0
- package/dist/flow.mjs +167 -0
- package/dist/index.mjs +18 -0
- package/dist/packs.mjs +116 -0
- package/dist/types/adapter/archive.d.ts +45 -0
- package/dist/types/adapter/claude.d.ts +157 -0
- package/dist/types/adapter/domain.d.ts +1112 -0
- package/dist/types/adapter/product.d.ts +10 -0
- package/dist/types/checks/domain.d.ts +792 -0
- package/dist/types/engine/domain.d.ts +747 -0
- package/dist/types/engine/state.d.ts +104 -0
- package/dist/types/errors.d.ts +14 -0
- package/dist/types/flow.d.ts +1 -0
- package/dist/types/glob.d.ts +53 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/language/domain.d.ts +641 -0
- package/dist/types/packs/docs.d.ts +49 -0
- package/dist/types/packs/fcis.d.ts +71 -0
- package/dist/types/packs/flow.d.ts +50 -0
- package/dist/types/packs/git.d.ts +107 -0
- package/dist/types/packs/index.d.ts +10 -0
- package/dist/types/packs/justfile.d.ts +83 -0
- package/dist/types/packs/node.d.ts +39 -0
- package/dist/types/packs/secrets.d.ts +117 -0
- package/dist/types/packs/tdd.d.ts +52 -0
- package/dist/types/packs/typescript.d.ts +101 -0
- package/dist/types/packs/work.d.ts +49 -0
- package/dist/types/version.d.ts +2 -0
- package/package.json +61 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** What this pack cannot know: the two gate recipes, and whether the repo has shared config files. */
|
|
2
|
+
export interface Gates {
|
|
3
|
+
/** The recipe that typechecks every project in one pass. */
|
|
4
|
+
readonly typecheck: string;
|
|
5
|
+
/** The recipe that lints the repo. */
|
|
6
|
+
readonly lint: string;
|
|
7
|
+
/**
|
|
8
|
+
* The shared tsconfig every project must extend — a path (`./tsconfig.base.json`) or a package
|
|
9
|
+
* name. Optional, and with nothing here the rule does not ask for one.
|
|
10
|
+
*
|
|
11
|
+
* flow ships no such file: a base states one fleet's opinion about target, module and lib, and a
|
|
12
|
+
* neutral engine has no business having one. What the pack holds without it is the opinion that
|
|
13
|
+
* travels — `strictOptions` below stay on wherever they are set.
|
|
14
|
+
*/
|
|
15
|
+
readonly tsconfigBase?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The shared eslint config the repo's own config must import — a path
|
|
18
|
+
* (`./eslint.config.base.js`) or a package name. Optional; with nothing here there is no entry.
|
|
19
|
+
*/
|
|
20
|
+
readonly eslintBase?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The compiler options that may never be turned off. Defaults to `["strict",
|
|
23
|
+
* "noUncheckedIndexedAccess"]`.
|
|
24
|
+
*
|
|
25
|
+
* Stated as option names under `compilerOptions`, each asserted `true`. This is the pack's whole
|
|
26
|
+
* opinion when no base file is named.
|
|
27
|
+
*/
|
|
28
|
+
readonly strictOptions?: readonly string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* TypeScript discipline as shared configuration: strict stays on, the checker is never silenced.
|
|
32
|
+
*
|
|
33
|
+
* This pack does not re-implement a linter. The escape hatches — `@ts-expect-error`, explicit
|
|
34
|
+
* `any`, double assertions — are typescript-eslint's `strictTypeChecked` job, and it does it
|
|
35
|
+
* better than a hand-rolled pattern can. What is left is the half a linter cannot do: keep the
|
|
36
|
+
* repo's own configs pointing at a shared base, run both tools at the gate, and teach the design
|
|
37
|
+
* habit no tool checks.
|
|
38
|
+
*
|
|
39
|
+
* @setup The two gate recipes, and nothing else. THIS PACK SHIPS NO FILE: a base states one
|
|
40
|
+
* fleet's opinion about target, module and lib, and a neutral engine has no business having one,
|
|
41
|
+
* so with no base named the pack holds only the opinion that travels — the strict options stay on
|
|
42
|
+
* wherever they are set.
|
|
43
|
+
*
|
|
44
|
+
* A shared base is still worth having, and a repo that keeps one names it in `tsconfigBase` and
|
|
45
|
+
* `eslintBase`; the two rules then hold every project to it. REFERENCE below, not a file to match:
|
|
46
|
+
* the smallest base that carries the opinion, to copy as `tsconfig.base.json` and then add a
|
|
47
|
+
* repo's own emit and module settings to. Every `tsconfig*.json` extends it.
|
|
48
|
+
*
|
|
49
|
+
* ```json
|
|
50
|
+
* {
|
|
51
|
+
* "compilerOptions": {
|
|
52
|
+
* "strict": true,
|
|
53
|
+
* "noUncheckedIndexedAccess": true,
|
|
54
|
+
* "exactOptionalPropertyTypes": true,
|
|
55
|
+
* "noImplicitOverride": true,
|
|
56
|
+
* "noFallthroughCasesInSwitch": true,
|
|
57
|
+
* "noUnusedLocals": true,
|
|
58
|
+
* "noUnusedParameters": true
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* …and the lint half as `eslint.config.base.js`, which the repo's own `eslint.config.js` imports
|
|
64
|
+
* and spreads. It is deliberately not a hand-rolled rule set: `strictTypeChecked` is the maintained
|
|
65
|
+
* good-patterns set, it already holds the escape hatches at error, and it supersedes every idiom
|
|
66
|
+
* rule a pack could write. `projectService` is what makes the type-aware rules work at all.
|
|
67
|
+
*
|
|
68
|
+
* ```js
|
|
69
|
+
* import tseslint from "typescript-eslint";
|
|
70
|
+
*
|
|
71
|
+
* export default tseslint.config(
|
|
72
|
+
* { ignores: ["dist/**", "coverage/**"] },
|
|
73
|
+
* ...tseslint.configs.strictTypeChecked,
|
|
74
|
+
* {
|
|
75
|
+
* languageOptions: {
|
|
76
|
+
* parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname },
|
|
77
|
+
* },
|
|
78
|
+
* },
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
* @adopt Bind it with the two gate recipes this repo really has. Expect the first commit after
|
|
82
|
+
* binding to run both tools over everything — a repo that has been typechecking one project at a
|
|
83
|
+
* time usually finds errors in the ones nobody was checking.
|
|
84
|
+
*/
|
|
85
|
+
export declare const typescript: import("../index.ts").Pack<{
|
|
86
|
+
commitRunsTsc: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "description", "commit">;
|
|
87
|
+
commitRunsEslint: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "description", "commit">;
|
|
88
|
+
eslintFromBase?: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "on" | "description", "write" | "commit">;
|
|
89
|
+
/**
|
|
90
|
+
* Without it, strictness is treated as a setting rather than a design tool: the escape hatches
|
|
91
|
+
* get reached for under time pressure, and impossible states go on being representable because
|
|
92
|
+
* nothing ever said to model them out.
|
|
93
|
+
*/
|
|
94
|
+
strictTypesNoInvalidStates: import("../index.ts").BreadcrumbSentence<"text" | "at" | "on" | "description", "touch">;
|
|
95
|
+
/**
|
|
96
|
+
* Without it, a project quietly stops extending the shared base — or extends it and then turns
|
|
97
|
+
* `strict` back off — and the fleet's one standard becomes per-project taste that only shows up
|
|
98
|
+
* as a bug much later.
|
|
99
|
+
*/
|
|
100
|
+
tsconfigStrict: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "on" | "description", "write" | "commit">;
|
|
101
|
+
}, Gates>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** The top-level chat: no sidecar, no agent type. The supervisor's rung. */
|
|
2
|
+
export declare const parent: import("../index.ts").Category;
|
|
3
|
+
/**
|
|
4
|
+
* A supervised builder — one phase of a plan, its own to write.
|
|
5
|
+
*
|
|
6
|
+
* The two brief needles are the two sentences a builder's own brief always carries, and they
|
|
7
|
+
* recover every builder the generic buckets hid.
|
|
8
|
+
*/
|
|
9
|
+
export declare const builder: import("../index.ts").Category;
|
|
10
|
+
/**
|
|
11
|
+
* Anything spawned to JUDGE rather than to build — the verifier at a phase boundary, and the five
|
|
12
|
+
* review lenses a closing review spawns.
|
|
13
|
+
*
|
|
14
|
+
* One category rather than six, because the rules that bind to it say the same thing to all of
|
|
15
|
+
* them: a reader does not write. The verifier's own agent definition withholds Edit and Write
|
|
16
|
+
* already; this is the half that holds for the lenses too, and it holds at the rail rather than in
|
|
17
|
+
* a frontmatter list somebody can widen.
|
|
18
|
+
*/
|
|
19
|
+
export declare const checker: import("../index.ts").Category;
|
|
20
|
+
/**
|
|
21
|
+
* The WORK LIFECYCLE's rungs: who is acting, and what each rung may do.
|
|
22
|
+
*
|
|
23
|
+
* A pack for repos that run the `work` lifecycle skill — spec · plan · start · build · review ·
|
|
24
|
+
* reflect · complete. It names the three rungs the lifecycle has (parent · builder · checker),
|
|
25
|
+
* binds one rule per rung to keep them from doing each other's jobs, and adds the two rules about
|
|
26
|
+
* the commands that write the journal: the inbox is the human's queue, and prose recorded through
|
|
27
|
+
* a shell is prose the shell can rewrite first.
|
|
28
|
+
*
|
|
29
|
+
* IT IMPORTS NOTHING FROM WORK. It is a plain consumer of flow's public door, exactly like every
|
|
30
|
+
* other pack here, and it knows the work CLI only as command strings on a rail. That is what lets
|
|
31
|
+
* flow ship it without depending on the tool it is about.
|
|
32
|
+
*
|
|
33
|
+
* flow ships no category names and never will: what a rung is called is a property of the way a
|
|
34
|
+
* team works, not of a guard engine. These three are the WORK lifecycle's, defined here beside the
|
|
35
|
+
* rules that bind to them — a builder may not do a parent's job, a checker may not write.
|
|
36
|
+
*
|
|
37
|
+
* @install The `work` CLI and its lifecycle skill. Every rule here reads a `work …` command line,
|
|
38
|
+
* so in a repo that does not run the lifecycle they are five rules that can never fire.
|
|
39
|
+
* @adopt Bind it only in a repo whose tasks are actually run through the lifecycle. The three rung
|
|
40
|
+
* rules are scoped to categories this pack defines, so they judge nobody until a session is
|
|
41
|
+
* classified as a builder or a checker — a human at a keyboard is neither.
|
|
42
|
+
*/
|
|
43
|
+
export declare const work: import("../index.ts").Pack<{
|
|
44
|
+
planIsTheParents: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "for" | "description", "command">;
|
|
45
|
+
checkersDoNotWrite: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "for" | "description", "write">;
|
|
46
|
+
ticksAreTheChilds: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "for" | "description", "command">;
|
|
47
|
+
noAgentInboxItems: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "description", "command">;
|
|
48
|
+
noShellSubstitutionInProse: import("../index.ts").GuardrailSentence<"at" | "check" | "message" | "test" | "description", "command">;
|
|
49
|
+
}, undefined>;
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jawache/flow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Guardrails and breadcrumbs as code — packs you import, a config that typechecks, one adapter per harness.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jawache/flow.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"claude",
|
|
12
|
+
"claude-code",
|
|
13
|
+
"guardrails",
|
|
14
|
+
"hooks",
|
|
15
|
+
"lint"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"bin": {
|
|
19
|
+
"flow": "dist/flow.mjs"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/types/index.d.ts",
|
|
24
|
+
"default": "./dist/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./packs": {
|
|
27
|
+
"types": "./dist/types/packs/index.d.ts",
|
|
28
|
+
"default": "./dist/packs.mjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/flow.mjs",
|
|
33
|
+
"dist/index.mjs",
|
|
34
|
+
"dist/packs.mjs",
|
|
35
|
+
"dist/types/"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=24"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"//": "Commands live in the justfile — run `just` (build · typecheck · test · test-rules · test-packs · gate · link · release)."
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@ast-grep/napi": "^0.42.3",
|
|
48
|
+
"dependency-cruiser": "^18.1.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^24.13.4",
|
|
52
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
53
|
+
"commit-and-tag-version": "^13.1.2",
|
|
54
|
+
"esbuild": "^0.28.1",
|
|
55
|
+
"eslint": "^10.8.1",
|
|
56
|
+
"eslint-plugin-n": "^18.3.0",
|
|
57
|
+
"typescript": "^5.6.0",
|
|
58
|
+
"typescript-eslint": "^8.67.0",
|
|
59
|
+
"vitest": "4.1.10"
|
|
60
|
+
}
|
|
61
|
+
}
|