@marktiderman/genesis-features 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/chunk-YKNISEPJ.js +318 -0
- package/dist/chunk-YKNISEPJ.js.map +1 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/model-CW5ocPFw.d.ts +288 -0
- package/dist/node.d.ts +140 -0
- package/dist/node.js +337 -0
- package/dist/node.js.map +1 -0
- package/dist/react.d.ts +57 -0
- package/dist/react.js +231 -0
- package/dist/react.js.map +1 -0
- package/package.json +80 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mark Tiderman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,139 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @marktiderman/genesis-features
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A repo's features in one typed code file that running code imports. Every other format (the
|
|
4
|
+
AGENTS.md pointer, `features.json`, an OpenFeature `flags.json`, the agent skill, a README
|
|
5
|
+
section, the admin page) is generated from it, and `genesis features check` fails CI when a
|
|
6
|
+
generated copy is stale or the registry and the code disagree.
|
|
7
|
+
|
|
8
|
+
Phase 1 is deliberately small: one flat file per repo. No database, no sync, no hierarchy.
|
|
9
|
+
|
|
10
|
+
## The registry
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
// src/features.ts
|
|
14
|
+
import { defineFeatures, type FeatureIdOf } from "@marktiderman/genesis-features";
|
|
15
|
+
|
|
16
|
+
export const features = defineFeatures({
|
|
17
|
+
tasks: {
|
|
18
|
+
name: "Tasks",
|
|
19
|
+
summary: "Coach and client both add and check off next steps.", // internal, one sentence
|
|
20
|
+
status: "live", // planned | building | beta | live | deprecated | retired
|
|
21
|
+
owner: "mark",
|
|
22
|
+
apps: ["web"],
|
|
23
|
+
audience: ["client", "coach"],
|
|
24
|
+
acceptance: ["A client can tick off a task their coach added."], // required on beta and live
|
|
25
|
+
visibility: "customer", // internal | customer | public | client:<name>
|
|
26
|
+
access: "all", // or { plan: "pro" }: the id is the entitlement's lookup key
|
|
27
|
+
reviewedAt: "2026-10-22",
|
|
28
|
+
links: { code: ["src/components/TasksPanel.tsx"], docs: ["docs/tasks.md"], issue: "#42" },
|
|
29
|
+
tagline: "Never lose a next step.", // with visibility "public": marketing output
|
|
30
|
+
category: "Coaching",
|
|
31
|
+
},
|
|
32
|
+
billing: { name: "Billing", summary: "…", status: "planned", horizon: "next", /* … */ },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type FeatureId = FeatureIdOf<typeof features>;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`defineFeatures` validates every entry with Zod and lists every problem at once:
|
|
39
|
+
|
|
40
|
+
- Unknown fields, bad dates and paths that leave the repo are errors.
|
|
41
|
+
- `planned` needs a `horizon` (now, next, later), and only planned or building features may have one. That's the roadmap, with no dates.
|
|
42
|
+
- `beta` and `live` need `acceptance`.
|
|
43
|
+
- `claimedBy` is only for `building`.
|
|
44
|
+
- Ids and `aliases` are unique.
|
|
45
|
+
|
|
46
|
+
It returns the same object, so code reads `features.tasks.status` directly. Name features by `FeatureId` everywhere, so a typo is a type error.
|
|
47
|
+
|
|
48
|
+
Ids are permanent. `check` and `build` refuse when an id recorded in `features.json` disappears. Retire a feature with `status: "retired"`, and rename one through `aliases`.
|
|
49
|
+
|
|
50
|
+
## Flags
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { defineFlags } from "@marktiderman/genesis-features";
|
|
54
|
+
import { features } from "./features";
|
|
55
|
+
|
|
56
|
+
export const flags = defineFlags(features, {
|
|
57
|
+
"tasks.v2": { feature: "tasks", kind: "release", owner: "mark", default: false, scopes: ["platform", "user"], expires: "2026-12-01" },
|
|
58
|
+
"tasks.kill": { feature: "tasks", kind: "ops", owner: "mark", default: true, scopes: ["platform"],
|
|
59
|
+
runbook: "docs/runbooks/tasks.md", splitReason: "a kill switch outlives the rollout" },
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- `feature` must be a `FeatureId`: an unknown one is a type error and a runtime error.
|
|
64
|
+
- Flags are grouped by feature, so a feature's second flag needs a `splitReason`.
|
|
65
|
+
- `release` and `experiment` flags need `expires`, and `ops` flags need a `runbook`.
|
|
66
|
+
- A `permission` flag fails `check`, because paid access is `access`, not a flag.
|
|
67
|
+
- `check` scans the code for flag reads through the accessors (default `useFlag(…)`, `getFlag(…)` and `<Flag name=…>`; set them with `flagAccessors`). It fails on:
|
|
68
|
+
- a computed key;
|
|
69
|
+
- a key that is read but not defined, or defined but never read;
|
|
70
|
+
- a flag past its `expires` date.
|
|
71
|
+
|
|
72
|
+
## Generated output and the check
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
genesis features build # AGENTS.md pointer, features.json, flags.json, the skill, the marketing block; @AGENTS.md in CLAUDE.md
|
|
76
|
+
genesis features check # CI. --labels "a,b" checks a PR's feature:<id> labels; --prs reads merged PRs with gh
|
|
77
|
+
genesis features check --summary # for a SessionStart hook: counts, stale output, expired flags, planned-but-shipped, claims
|
|
78
|
+
genesis features find <term> # search ids, aliases, names, summaries, flags and code paths
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Errors fail the check:**
|
|
82
|
+
|
|
83
|
+
- Generated output is stale.
|
|
84
|
+
- A `links.code` path doesn't exist.
|
|
85
|
+
- A flag breaks one of the rules above.
|
|
86
|
+
- An id was removed.
|
|
87
|
+
- A feature tag names an unknown id: `@feat:<id>` in tests, `Features: <id>` in a changeset's body, or `feature:<id>` on a PR.
|
|
88
|
+
- CLAUDE.md has no `@AGENTS.md` line.
|
|
89
|
+
|
|
90
|
+
**Warnings don't fail it:**
|
|
91
|
+
|
|
92
|
+
- A review is due: `reviewedAt` is over 90 days old, or missing.
|
|
93
|
+
- A live feature has no test tagged with its `@feat:<id>`.
|
|
94
|
+
- A feature is still `planned`, but shipped work is tagged with it: a changeset with `Features: <id>`, or (with `--prs`) a merged PR labelled `feature:<id>`. The warning names each one, e.g. "billing is still planned, but .changeset/x.md and PR #123 shipped work for it". `--prs` asks `gh pr list --state merged --label feature:<id>` for each planned id and alias; when `gh` is missing or fails, you get one warning and only changesets count. From code, pass the PRs yourself as `checkFeatureOutputs({ …, evidence: { prs: { billing: [{ number, title }] } } })`.
|
|
95
|
+
- A route or server-function file isn't covered by any `links.code`.
|
|
96
|
+
- A docs path is missing.
|
|
97
|
+
|
|
98
|
+
The check only ever compares generated output with the generator, never two hand-written files.
|
|
99
|
+
|
|
100
|
+
The AGENTS.md block is a short pointer with counts, not the list. Agents run `find` and read the skill (`.claude/skills/features/SKILL.md`, which covers finding, adding, changing and retiring features, and says to remove the code before the flag).
|
|
101
|
+
|
|
102
|
+
### Settings
|
|
103
|
+
|
|
104
|
+
The CLI reads settings from `package.json`, which also needs `"genesisFeatures"`. Command-line options win.
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
"genesisFeatures": {
|
|
108
|
+
"registry": "src/features.ts",
|
|
109
|
+
"flagsFile": "src/lib/flags/registry.ts",
|
|
110
|
+
"command": "bun run features",
|
|
111
|
+
"marketing": "README.md",
|
|
112
|
+
"flagAccessors": ["useFlag", "flag", "<Flag name>"],
|
|
113
|
+
"coverage": ["src/routes/**/*.tsx", "**/*.functions.ts"]
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Other settings: `agents`, `claude`, `json`, `openfeature`, `skill` (each a path, or `false`), `scan`, `tests`, `coverageIgnore`, `changesets`, `reviewDays`.
|
|
118
|
+
|
|
119
|
+
The CLI loads TypeScript itself, so the registry needs no build step. Keep its imports to packages, with no path aliases.
|
|
120
|
+
|
|
121
|
+
## The page
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
import { FeatureList } from "@marktiderman/genesis-features/react";
|
|
125
|
+
|
|
126
|
+
<FeatureList features={features} flags={flags} pathHref={(p) => `https://github.com/acme/app/blob/main/${p}`} />
|
|
127
|
+
<FeatureList features={features} variant="marketing" title="What it does" />
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The default view is a genesis-ui `ResourcePage` over static data:
|
|
131
|
+
|
|
132
|
+
- A table, and in its grid view a board grouped by status (`KanbanBoard`).
|
|
133
|
+
- Status chips (`StatusBadge`), plus filters by app, audience and visibility.
|
|
134
|
+
- A detail panel with links, acceptance and flags.
|
|
135
|
+
- Planned work stays off the list and shows on the roadmap (Now, Next, Later) below it.
|
|
136
|
+
|
|
137
|
+
`variant="marketing"` shows public, shipped features that have a tagline, as cards: highlights first, then grouped by category.
|
|
138
|
+
|
|
139
|
+
genesis-ui (2.7.0 or later), React and lucide-react are optional peers, needed only by `/react`. Gate the route yourself; the component shows whatever it is given.
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// src/model.ts
|
|
4
|
+
var FEATURE_STATUSES = ["planned", "building", "beta", "live", "deprecated", "retired"];
|
|
5
|
+
var FEATURE_HORIZONS = ["now", "next", "later"];
|
|
6
|
+
var FLAG_KINDS = ["release", "experiment", "ops", "permission"];
|
|
7
|
+
var ID = /^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$/;
|
|
8
|
+
var DAY = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/;
|
|
9
|
+
var MONTH_OR_DAY = /^\d{4}-(0[1-9]|1[0-2])(-(0[1-9]|[12]\d|3[01]))?$/;
|
|
10
|
+
var URL_RE = /^https?:\/\/\S+$/;
|
|
11
|
+
var ISSUE = /^(https?:\/\/\S+|([\w.-]+\/[\w.-]+)?#\d+)$/;
|
|
12
|
+
var text = z.string().trim().min(1);
|
|
13
|
+
var day = z.string().regex(DAY, "must be YYYY-MM-DD");
|
|
14
|
+
var repoPath = text.refine(
|
|
15
|
+
(p) => !p.startsWith("/") && !/^[a-z]:/i.test(p) && !p.split(/[\\/]/).includes(".."),
|
|
16
|
+
{ message: "must be a path relative to the repo root, without .." }
|
|
17
|
+
);
|
|
18
|
+
var pathOrUrl = z.union([z.string().regex(URL_RE), repoPath]);
|
|
19
|
+
var linksSchema = z.object({
|
|
20
|
+
code: z.array(repoPath).optional(),
|
|
21
|
+
docs: z.array(pathOrUrl).optional(),
|
|
22
|
+
issue: z.string().regex(ISSUE, "must be a URL, #123 or owner/repo#123").optional()
|
|
23
|
+
}).strict();
|
|
24
|
+
var visibilitySchema = z.union([
|
|
25
|
+
z.enum(["internal", "customer", "public"]),
|
|
26
|
+
z.string().regex(/^client:\S+$/, "must be internal, customer, public or client:<name>")
|
|
27
|
+
]);
|
|
28
|
+
var featureSchema = z.object({
|
|
29
|
+
name: text,
|
|
30
|
+
summary: text,
|
|
31
|
+
status: z.enum(FEATURE_STATUSES),
|
|
32
|
+
owner: text,
|
|
33
|
+
apps: z.array(text).min(1),
|
|
34
|
+
audience: z.array(text).min(1),
|
|
35
|
+
horizon: z.enum(FEATURE_HORIZONS).optional(),
|
|
36
|
+
visibility: visibilitySchema.optional(),
|
|
37
|
+
access: z.union([z.literal("all"), z.object({ plan: text }).strict()]).optional(),
|
|
38
|
+
acceptance: z.array(text).optional(),
|
|
39
|
+
aliases: z.array(z.string().regex(ID, "must be a feature id")).optional(),
|
|
40
|
+
reviewedAt: day.optional(),
|
|
41
|
+
claimedBy: text.optional(),
|
|
42
|
+
since: z.string().regex(MONTH_OR_DAY, "must be YYYY-MM-DD or YYYY-MM").optional(),
|
|
43
|
+
links: linksSchema.optional(),
|
|
44
|
+
tagline: text.optional(),
|
|
45
|
+
category: text.optional(),
|
|
46
|
+
media: z.object({ image: pathOrUrl.optional(), video: pathOrUrl.optional(), alt: text }).strict().optional(),
|
|
47
|
+
highlight: z.boolean().optional()
|
|
48
|
+
}).strict();
|
|
49
|
+
var flagValue = z.union([z.boolean(), z.string(), z.number(), z.record(z.string(), z.unknown())]);
|
|
50
|
+
var flagSchema = z.object({
|
|
51
|
+
feature: text,
|
|
52
|
+
kind: z.enum(FLAG_KINDS),
|
|
53
|
+
owner: text,
|
|
54
|
+
default: flagValue,
|
|
55
|
+
scopes: z.array(text).min(1),
|
|
56
|
+
description: text.optional(),
|
|
57
|
+
expires: day.optional(),
|
|
58
|
+
runbook: pathOrUrl.optional(),
|
|
59
|
+
splitReason: text.optional()
|
|
60
|
+
}).strict();
|
|
61
|
+
var FeatureRegistryError = class extends Error {
|
|
62
|
+
constructor(problems) {
|
|
63
|
+
super(`Invalid feature registry:
|
|
64
|
+
${problems.map((p) => ` - ${p}`).join("\n")}`);
|
|
65
|
+
this.problems = problems;
|
|
66
|
+
this.name = "FeatureRegistryError";
|
|
67
|
+
}
|
|
68
|
+
problems;
|
|
69
|
+
};
|
|
70
|
+
function issues(prefix, error) {
|
|
71
|
+
return error.issues.map((i) => `${[prefix, ...i.path].join(".")}: ${i.message}`);
|
|
72
|
+
}
|
|
73
|
+
function featureProblems(id, def) {
|
|
74
|
+
const problems = [];
|
|
75
|
+
const early = def.status === "planned" || def.status === "building";
|
|
76
|
+
if (def.horizon && !early) problems.push(`${id}.horizon: only planned and building features are on the roadmap`);
|
|
77
|
+
if (def.status === "planned" && !def.horizon) problems.push(`${id}.horizon: a planned feature needs now, next or later`);
|
|
78
|
+
if ((def.status === "beta" || def.status === "live") && !def.acceptance?.length) {
|
|
79
|
+
problems.push(`${id}.acceptance: a ${def.status} feature needs at least one testable sentence`);
|
|
80
|
+
}
|
|
81
|
+
if (def.claimedBy && def.status !== "building") problems.push(`${id}.claimedBy: only a building feature can be claimed`);
|
|
82
|
+
if (def.media && !def.media.image && !def.media.video) problems.push(`${id}.media: needs an image or a video`);
|
|
83
|
+
return problems;
|
|
84
|
+
}
|
|
85
|
+
function defineFeatures(features) {
|
|
86
|
+
const problems = [];
|
|
87
|
+
const owners = /* @__PURE__ */ new Map();
|
|
88
|
+
for (const [id, def] of Object.entries(features)) {
|
|
89
|
+
if (!ID.test(id)) problems.push(`${id}: the id must be lowercase letters and digits, joined by -, _ or .`);
|
|
90
|
+
const parsed = featureSchema.safeParse(def);
|
|
91
|
+
if (!parsed.success) {
|
|
92
|
+
problems.push(...issues(id, parsed.error));
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
problems.push(...featureProblems(id, def));
|
|
96
|
+
for (const name of [id, ...def.aliases ?? []]) {
|
|
97
|
+
const other = owners.get(name);
|
|
98
|
+
if (other !== void 0) problems.push(`${id}: "${name}" is already ${other === name ? "a feature id" : `an alias of ${other}`}`);
|
|
99
|
+
else owners.set(name, id);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (problems.length) throw new FeatureRegistryError(problems);
|
|
103
|
+
return Object.freeze(features);
|
|
104
|
+
}
|
|
105
|
+
function defineFlags(features, flags) {
|
|
106
|
+
const problems = [];
|
|
107
|
+
const seen = /* @__PURE__ */ new Map();
|
|
108
|
+
for (const [name, def] of Object.entries(flags)) {
|
|
109
|
+
const parsed = flagSchema.safeParse(def);
|
|
110
|
+
if (!parsed.success) {
|
|
111
|
+
problems.push(...issues(name, parsed.error));
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const flag = parsed.data;
|
|
115
|
+
if (!Object.hasOwn(features, flag.feature)) problems.push(`${name}.feature: "${flag.feature}" is not a feature`);
|
|
116
|
+
if ((flag.kind === "release" || flag.kind === "experiment") && !flag.expires) {
|
|
117
|
+
problems.push(`${name}.expires: a ${flag.kind} flag needs an expiry date`);
|
|
118
|
+
}
|
|
119
|
+
if (flag.kind === "ops" && !flag.runbook) problems.push(`${name}.runbook: an ops flag needs a runbook`);
|
|
120
|
+
const first = seen.get(flag.feature);
|
|
121
|
+
if (first === void 0) seen.set(flag.feature, name);
|
|
122
|
+
else if (!flag.splitReason)
|
|
123
|
+
problems.push(`${name}.splitReason: "${flag.feature}" already has the flag ${first}; say why this one is separate`);
|
|
124
|
+
}
|
|
125
|
+
if (problems.length) throw new FeatureRegistryError(problems);
|
|
126
|
+
return Object.freeze(flags);
|
|
127
|
+
}
|
|
128
|
+
function flagsForFeature(flags, id) {
|
|
129
|
+
if (!flags) return [];
|
|
130
|
+
return Object.entries(flags).filter(([, flag]) => flag.feature === id).map(([name]) => name);
|
|
131
|
+
}
|
|
132
|
+
function expiredFlags(flags, today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)) {
|
|
133
|
+
if (!flags) return [];
|
|
134
|
+
return Object.entries(flags).filter(([, flag]) => flag.expires !== void 0 && flag.expires < today).map(([name]) => name);
|
|
135
|
+
}
|
|
136
|
+
function toRecords(features, flags) {
|
|
137
|
+
return Object.entries(features).map(([id, def]) => ({
|
|
138
|
+
id,
|
|
139
|
+
...def,
|
|
140
|
+
visibility: def.visibility ?? "customer",
|
|
141
|
+
access: def.access ?? "all",
|
|
142
|
+
flags: flagsForFeature(flags, id)
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
function findFeatures(features, term, flags) {
|
|
146
|
+
const needle = term.trim().toLowerCase();
|
|
147
|
+
if (!needle) return [];
|
|
148
|
+
const score = (r) => {
|
|
149
|
+
if (r.id === needle || r.aliases?.includes(needle)) return 0;
|
|
150
|
+
if (r.id.includes(needle) || r.name.toLowerCase().includes(needle)) return 1;
|
|
151
|
+
if (r.flags.some((f) => f.toLowerCase().includes(needle))) return 2;
|
|
152
|
+
const rest = [r.summary, r.tagline, r.category, ...r.links?.code ?? [], ...r.aliases ?? []];
|
|
153
|
+
return rest.some((v) => v?.toLowerCase().includes(needle)) ? 3 : -1;
|
|
154
|
+
};
|
|
155
|
+
return toRecords(features, flags).map((r) => [score(r), r]).filter(([s]) => s >= 0).sort((a, b) => a[0] - b[0]).map(([, r]) => r);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// src/generate.ts
|
|
159
|
+
var AGENTS_BLOCK_START = "<!-- genesis-features:start -->";
|
|
160
|
+
var AGENTS_BLOCK_END = "<!-- genesis-features:end -->";
|
|
161
|
+
var MARKETING_BLOCK_START = "<!-- genesis-features:marketing:start -->";
|
|
162
|
+
var MARKETING_BLOCK_END = "<!-- genesis-features:marketing:end -->";
|
|
163
|
+
function toJson(features, flags, options = {}) {
|
|
164
|
+
const doc = {
|
|
165
|
+
generatedFrom: options.source ?? "src/features.ts",
|
|
166
|
+
features: toRecords(features, flags),
|
|
167
|
+
flags: flags ?? {}
|
|
168
|
+
};
|
|
169
|
+
return `${JSON.stringify(doc, null, 2)}
|
|
170
|
+
`;
|
|
171
|
+
}
|
|
172
|
+
function flagType(value) {
|
|
173
|
+
if (typeof value === "boolean") return "boolean";
|
|
174
|
+
if (typeof value === "string") return "string";
|
|
175
|
+
if (typeof value === "number") return Number.isInteger(value) ? "integer" : "float";
|
|
176
|
+
return "object";
|
|
177
|
+
}
|
|
178
|
+
var OPENFEATURE_MANIFEST_SCHEMA = "https://raw.githubusercontent.com/open-feature/cli/refs/heads/main/schema/v0/flag-manifest.json";
|
|
179
|
+
function toOpenFeatureManifest(flags, features) {
|
|
180
|
+
const manifest = {
|
|
181
|
+
$schema: OPENFEATURE_MANIFEST_SCHEMA,
|
|
182
|
+
flags: Object.fromEntries(
|
|
183
|
+
Object.entries(flags).map(([key, flag]) => [
|
|
184
|
+
key,
|
|
185
|
+
{
|
|
186
|
+
flagType: flagType(flag.default),
|
|
187
|
+
defaultValue: flag.default,
|
|
188
|
+
description: flag.description ?? `${flag.kind} flag for ${features?.[flag.feature]?.name ?? flag.feature}`
|
|
189
|
+
}
|
|
190
|
+
])
|
|
191
|
+
)
|
|
192
|
+
};
|
|
193
|
+
return `${JSON.stringify(manifest, null, 2)}
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
var cell = (value) => value.replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
|
|
197
|
+
function toAgentsMarkdown(features, flags, options = {}) {
|
|
198
|
+
const source = options.source ?? "src/features.ts";
|
|
199
|
+
const command = options.command ?? "genesis features";
|
|
200
|
+
const skill = options.skill === void 0 ? ".claude/skills/features/SKILL.md" : options.skill;
|
|
201
|
+
const records = toRecords(features, flags);
|
|
202
|
+
const counts = FEATURE_STATUSES.map((s) => [s, records.filter((r) => r.status === s).length]).filter(([, n]) => n > 0).map(([s, n]) => `${n} ${s}`).join(", ");
|
|
203
|
+
const flagCount = flags ? Object.keys(flags).length : 0;
|
|
204
|
+
const lines = [
|
|
205
|
+
AGENTS_BLOCK_START,
|
|
206
|
+
"## Features",
|
|
207
|
+
"",
|
|
208
|
+
`Every feature is in \`${source}\`: ${records.length} features (${counts})${flagCount ? `, ${flagCount} flag${flagCount === 1 ? "" : "s"}` : ""}.`,
|
|
209
|
+
"",
|
|
210
|
+
`- Before adding UI, routes or flags, run \`${command} find <term>\` to see whether a feature already covers it.`,
|
|
211
|
+
`- New work starts as an entry in \`${source}\`; then run \`${command} build\`. \`${command} check\` runs in CI.`,
|
|
212
|
+
...skill ? [`- Finding, adding and retiring features: \`${skill}\`.`] : [],
|
|
213
|
+
"",
|
|
214
|
+
`Generated by \`${command} build\`. Don't edit this block.`,
|
|
215
|
+
AGENTS_BLOCK_END
|
|
216
|
+
];
|
|
217
|
+
return lines.join("\n");
|
|
218
|
+
}
|
|
219
|
+
function marketingRecords(features) {
|
|
220
|
+
return toRecords(features).filter((r) => r.visibility === "public" && r.tagline && (r.status === "live" || r.status === "beta")).sort((a, b) => Number(Boolean(b.highlight)) - Number(Boolean(a.highlight)));
|
|
221
|
+
}
|
|
222
|
+
function toMarketingMarkdown(features, options = {}) {
|
|
223
|
+
const records = marketingRecords(features);
|
|
224
|
+
const lines = [MARKETING_BLOCK_START, `## ${options.heading ?? "Features"}`, ""];
|
|
225
|
+
const highlights = records.filter((r) => r.highlight);
|
|
226
|
+
for (const r of highlights) lines.push(`- **${cell(r.name)}** \u2014 ${cell(r.tagline)}`);
|
|
227
|
+
if (highlights.length) lines.push("");
|
|
228
|
+
const categories = [...new Set(records.filter((r) => !r.highlight).map((r) => r.category ?? "More"))];
|
|
229
|
+
for (const category of categories) {
|
|
230
|
+
lines.push(`### ${category}`, "");
|
|
231
|
+
for (const r of records.filter((x) => !x.highlight && (x.category ?? "More") === category)) {
|
|
232
|
+
lines.push(`- **${cell(r.name)}**${r.status === "beta" ? " (beta)" : ""} \u2014 ${cell(r.tagline)}`);
|
|
233
|
+
}
|
|
234
|
+
lines.push("");
|
|
235
|
+
}
|
|
236
|
+
lines.push(`<sub>Generated from \`${options.source ?? "src/features.ts"}\`.</sub>`, MARKETING_BLOCK_END);
|
|
237
|
+
return lines.join("\n");
|
|
238
|
+
}
|
|
239
|
+
var BrokenBlockError = class extends Error {
|
|
240
|
+
constructor(start) {
|
|
241
|
+
super(`The generated block's markers are broken (${start} and its end marker must each appear once, in order). Fix them by hand, or delete both and the block between them.`);
|
|
242
|
+
this.name = "BrokenBlockError";
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
var count = (doc, marker) => doc.split(marker).length - 1;
|
|
246
|
+
function readBlock(doc, start, end) {
|
|
247
|
+
const starts = count(doc, start);
|
|
248
|
+
const ends = count(doc, end);
|
|
249
|
+
if (starts === 0 && ends === 0) return null;
|
|
250
|
+
const from = doc.indexOf(start);
|
|
251
|
+
const to = doc.indexOf(end);
|
|
252
|
+
if (starts !== 1 || ends !== 1 || to < from) throw new BrokenBlockError(start);
|
|
253
|
+
return doc.slice(from, to + end.length);
|
|
254
|
+
}
|
|
255
|
+
function replaceBlock(doc, block, start, end) {
|
|
256
|
+
const current = readBlock(doc, start, end);
|
|
257
|
+
if (current !== null) return doc.replace(current, () => block);
|
|
258
|
+
const base = doc.length === 0 || doc.endsWith("\n") ? doc : `${doc}
|
|
259
|
+
`;
|
|
260
|
+
return `${base}${base.length ? "\n" : ""}${block}
|
|
261
|
+
`;
|
|
262
|
+
}
|
|
263
|
+
var readAgentsBlock = (doc) => readBlock(doc, AGENTS_BLOCK_START, AGENTS_BLOCK_END);
|
|
264
|
+
var replaceAgentsBlock = (doc, block) => replaceBlock(doc, block, AGENTS_BLOCK_START, AGENTS_BLOCK_END);
|
|
265
|
+
function toSkillMarkdown(options = {}) {
|
|
266
|
+
const source = options.source ?? "src/features.ts";
|
|
267
|
+
const command = options.command ?? "genesis features";
|
|
268
|
+
return `---
|
|
269
|
+
name: features
|
|
270
|
+
description: Find, add, change and retire this repo's features in ${source}, and their flags. Use before adding UI, a route, a server function or a flag, when someone asks what the product does, or when shipping, deprecating or removing something.
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
<!-- Generated by \`${command} build\`. Don't edit; it is rewritten. -->
|
|
274
|
+
|
|
275
|
+
# Features
|
|
276
|
+
|
|
277
|
+
\`${source}\` is the one list of what this product does. Running code imports it, and every
|
|
278
|
+
other copy (the AGENTS.md block, JSON, the flags manifest, the admin page) is generated from it.
|
|
279
|
+
|
|
280
|
+
## Find
|
|
281
|
+
- \`${command} find <term>\` searches ids, aliases, names, summaries and code paths. Run it before
|
|
282
|
+
building anything new: extend the feature that already covers it rather than adding a second one.
|
|
283
|
+
|
|
284
|
+
## Add
|
|
285
|
+
1. Add an entry to \`${source}\`. The key is the id: lowercase, permanent, never reused.
|
|
286
|
+
Required: \`name\`, \`summary\` (internal, one sentence), \`status\`, \`owner\`, \`apps\`, \`audience\`.
|
|
287
|
+
- \`planned\` needs a \`horizon\` (now, next, later). No dates on the roadmap.
|
|
288
|
+
- \`building\`: set \`claimedBy\` to your name or session while you work on it.
|
|
289
|
+
- \`beta\` and \`live\` need \`acceptance\`: one testable sentence each. Tag the tests that prove
|
|
290
|
+
them with \`@feat:<id>\` in a comment or the test name.
|
|
291
|
+
- \`links.code\`: the files or folders that implement it. \`check\` fails when one is missing.
|
|
292
|
+
- \`visibility\` (internal, customer, public, client:<name>) and \`access\` ("all" or { plan }).
|
|
293
|
+
Paid access is \`access\`, never a flag. The id is the billing entitlement's lookup key.
|
|
294
|
+
- For a public page: \`tagline\` (the customer benefit), \`category\`, \`media\`, \`highlight\`.
|
|
295
|
+
2. Flags go in the flags registry with \`feature: <id>\`. One flag per feature; a second needs a
|
|
296
|
+
\`splitReason\`. \`release\` and \`experiment\` flags need \`expires\`, \`ops\` flags a \`runbook\`.
|
|
297
|
+
Read flags only through the typed accessor with a literal key, never a computed one.
|
|
298
|
+
3. Run \`${command} build\` and commit what it writes. Tag the changeset (a \`Features: <id>\` line in
|
|
299
|
+
its body) or the PR (a \`feature:<id>\` label).
|
|
300
|
+
|
|
301
|
+
## Change
|
|
302
|
+
- Move \`status\` as it ships: planned, building, beta, live, deprecated, retired. \`check\` warns when a
|
|
303
|
+
planned feature already has shipped work tagged with it (a changeset, or with \`--prs\` a merged PR).
|
|
304
|
+
- Set \`reviewedAt\` (today) whenever you check an entry against the product; \`check\` warns after 90 days.
|
|
305
|
+
- Rename by giving the feature a new id and putting the old one in \`aliases\`. Never delete an id.
|
|
306
|
+
|
|
307
|
+
## Retire
|
|
308
|
+
1. Remove the code first: the UI, routes, server functions and tests.
|
|
309
|
+
2. Then remove its flags from the flags registry (the code that read them is gone, so \`check\`
|
|
310
|
+
would flag them as unused).
|
|
311
|
+
3. Set \`status: "retired"\`, keep the entry, and drop \`links.code\` paths that no longer exist.
|
|
312
|
+
4. Run \`${command} build\` and \`${command} check\`.
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export { AGENTS_BLOCK_END, AGENTS_BLOCK_START, BrokenBlockError, FEATURE_HORIZONS, FEATURE_STATUSES, FLAG_KINDS, FeatureRegistryError, MARKETING_BLOCK_END, MARKETING_BLOCK_START, OPENFEATURE_MANIFEST_SCHEMA, defineFeatures, defineFlags, expiredFlags, featureSchema, findFeatures, flagSchema, flagsForFeature, marketingRecords, readAgentsBlock, readBlock, replaceAgentsBlock, replaceBlock, toAgentsMarkdown, toJson, toMarketingMarkdown, toOpenFeatureManifest, toRecords, toSkillMarkdown };
|
|
317
|
+
//# sourceMappingURL=chunk-YKNISEPJ.js.map
|
|
318
|
+
//# sourceMappingURL=chunk-YKNISEPJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/model.ts","../src/generate.ts"],"names":[],"mappings":";;;AAOO,IAAM,mBAAmB,CAAC,SAAA,EAAW,YAAY,MAAA,EAAQ,MAAA,EAAQ,cAAc,SAAS;AAWxF,IAAM,gBAAA,GAAmB,CAAC,KAAA,EAAO,MAAA,EAAQ,OAAO;AA6FhD,IAAM,UAAA,GAAa,CAAC,SAAA,EAAW,YAAA,EAAc,OAAO,YAAY;AA2CvE,IAAM,EAAA,GAAK,qCAAA;AACX,IAAM,GAAA,GAAM,+CAAA;AACZ,IAAM,YAAA,GAAe,kDAAA;AACrB,IAAM,MAAA,GAA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SAAA,EAcP,OAAO,kBAAkB,OAAO,CAAA;AAAA,CAAA;AAE3C","file":"chunk-YKNISEPJ.js","sourcesContent":["import { z } from \"zod\";\n\n/**\n * Where a feature is in its life. The order is the board's column order.\n *\n * @stability Beta\n */\nexport const FEATURE_STATUSES = [\"planned\", \"building\", \"beta\", \"live\", \"deprecated\", \"retired\"] as const;\n\n/** @stability Beta */\nexport type FeatureStatus = (typeof FEATURE_STATUSES)[number];\n\n/**\n * When a planned or building feature is due, without dates: the roadmap's\n * three columns.\n *\n * @stability Beta\n */\nexport const FEATURE_HORIZONS = [\"now\", \"next\", \"later\"] as const;\n\n/** @stability Beta */\nexport type FeatureHorizon = (typeof FEATURE_HORIZONS)[number];\n\n/**\n * Who may see a feature listed. `public` features with a `tagline` go on\n * marketing output; `client:<name>` is one customer's own feature.\n *\n * @stability Beta\n */\nexport type FeatureVisibility = \"internal\" | \"customer\" | \"public\" | `client:${string}`;\n\n/**\n * Who gets a feature: everyone, or one paid plan. The feature id doubles as\n * the billing entitlement's lookup key (a Stripe `lookup_key`).\n *\n * @stability Beta\n */\nexport type FeatureAccess = \"all\" | { plan: string };\n\n/**\n * Pointers from a feature to where it lives. `code` paths are relative to the\n * repository root and `genesis features check` fails when one doesn't exist.\n *\n * @stability Beta\n */\nexport interface FeatureLinks {\n /** Files or folders that implement the feature, relative to the repo root. */\n code?: readonly string[];\n /** Docs: a repo-relative path or a URL. */\n docs?: readonly string[];\n /** The tracking issue: a URL, `#123` or `owner/repo#123`. */\n issue?: string;\n}\n\n/** A picture or video for a marketing page. @stability Beta */\nexport interface FeatureMedia {\n image?: string;\n video?: string;\n alt: string;\n}\n\n/**\n * One feature. The object key in {@link defineFeatures} is its id: permanent,\n * never reused, and renamed only through `aliases`.\n *\n * @stability Beta\n */\nexport interface FeatureDef {\n name: string;\n /** One sentence for the team: what it does for whom. */\n summary: string;\n status: FeatureStatus;\n /** Who answers for it: a person, a team or an agent session's name. */\n owner: string;\n /** Which of the repo's apps or surfaces carry it, e.g. `[\"web\"]`. */\n apps: readonly string[];\n /** Who it is for, e.g. `[\"client\", \"coach\"]`. */\n audience: readonly string[];\n /** Roadmap column. Only on planned (required) or building features. */\n horizon?: FeatureHorizon;\n /** Default `customer`. */\n visibility?: FeatureVisibility;\n /** Default `all`. */\n access?: FeatureAccess;\n /** One testable sentence each. Required on beta and live features. */\n acceptance?: readonly string[];\n /** Ids this feature had before. An old id can't be reused. */\n aliases?: readonly string[];\n /** When someone last checked this entry against the product: `YYYY-MM-DD`. */\n reviewedAt?: string;\n /** Who is building it right now. Only on building features. */\n claimedBy?: string;\n /** When it first shipped or started: `YYYY-MM-DD` or `YYYY-MM`. */\n since?: string;\n links?: FeatureLinks;\n /** One line of benefit, for customers. Needed for marketing output. */\n tagline?: string;\n /** A group on a marketing page. */\n category?: string;\n media?: FeatureMedia;\n /** A hero item on a marketing page. */\n highlight?: boolean;\n}\n\n/**\n * Why a flag exists. `release` and `experiment` flags need `expires`, `ops`\n * flags need a `runbook`, and `permission` flags fail `check`: paid access\n * belongs in entitlements (`access`), not flags.\n *\n * @stability Beta\n */\nexport const FLAG_KINDS = [\"release\", \"experiment\", \"ops\", \"permission\"] as const;\n\n/** @stability Beta */\nexport type FlagKind = (typeof FLAG_KINDS)[number];\n\n/** A flag's default: anything an OpenFeature flag can hold. */\nexport type FlagValue = boolean | string | number | { readonly [key: string]: unknown };\n\n/**\n * One flag. `feature` names the {@link FeatureDef} it belongs to; a feature's\n * flags are found by reverse lookup ({@link flagsForFeature}) and never\n * written on the feature itself.\n *\n * @stability Beta\n */\nexport interface FlagDef<F extends string = string> {\n feature: F;\n kind: FlagKind;\n owner: string;\n default: FlagValue;\n /** Where it can be set, e.g. `[\"platform\", \"practice\", \"user\"]`. */\n scopes: readonly string[];\n description?: string;\n /** `YYYY-MM-DD`. Required on release and experiment flags; `check` fails after it. */\n expires?: string;\n /** What to do when you flip it: a repo path or a URL. Required on ops flags. */\n runbook?: string;\n /**\n * Flags are grouped by feature: one flag per feature by default. Every flag\n * after a feature's first must say why it is a separate flag.\n */\n splitReason?: string;\n}\n\n/** The id type of a features object: `type FeatureId = FeatureIdOf<typeof features>`. */\nexport type FeatureIdOf<T> = Extract<keyof T, string>;\n\n/** A features object as {@link defineFeatures} returns it. */\nexport type Features<Id extends string = string> = { readonly [K in Id]: FeatureDef };\n\n/** A flags object as {@link defineFlags} returns it. */\nexport type Flags<F extends string = string> = { readonly [name: string]: FlagDef<F> };\n\nconst ID = /^[a-z][a-z0-9]*(?:[-_.][a-z0-9]+)*$/;\nconst DAY = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/;\nconst MONTH_OR_DAY = /^\\d{4}-(0[1-9]|1[0-2])(-(0[1-9]|[12]\\d|3[01]))?$/;\nconst URL_RE = /^https?:\\/\\/\\S+$/;\nconst ISSUE = /^(https?:\\/\\/\\S+|([\\w.-]+\\/[\\w.-]+)?#\\d+)$/;\n\nconst text = z.string().trim().min(1);\nconst day = z.string().regex(DAY, \"must be YYYY-MM-DD\");\n\n/** A repo-relative path that stays inside the repo. */\nconst repoPath = text.refine(\n (p) => !p.startsWith(\"/\") && !/^[a-z]:/i.test(p) && !p.split(/[\\\\/]/).includes(\"..\"),\n { message: \"must be a path relative to the repo root, without ..\" },\n);\nconst pathOrUrl = z.union([z.string().regex(URL_RE), repoPath]);\n\nconst linksSchema = z\n .object({\n code: z.array(repoPath).optional(),\n docs: z.array(pathOrUrl).optional(),\n issue: z.string().regex(ISSUE, \"must be a URL, #123 or owner/repo#123\").optional(),\n })\n .strict();\n\nconst visibilitySchema = z.union([\n z.enum([\"internal\", \"customer\", \"public\"]),\n z.string().regex(/^client:\\S+$/, \"must be internal, customer, public or client:<name>\"),\n]);\n\n/** The Zod schema for one {@link FeatureDef}, field by field. Cross-field rules live in {@link featureProblems}. */\nexport const featureSchema = z\n .object({\n name: text,\n summary: text,\n status: z.enum(FEATURE_STATUSES),\n owner: text,\n apps: z.array(text).min(1),\n audience: z.array(text).min(1),\n horizon: z.enum(FEATURE_HORIZONS).optional(),\n visibility: visibilitySchema.optional(),\n access: z.union([z.literal(\"all\"), z.object({ plan: text }).strict()]).optional(),\n acceptance: z.array(text).optional(),\n aliases: z.array(z.string().regex(ID, \"must be a feature id\")).optional(),\n reviewedAt: day.optional(),\n claimedBy: text.optional(),\n since: z.string().regex(MONTH_OR_DAY, \"must be YYYY-MM-DD or YYYY-MM\").optional(),\n links: linksSchema.optional(),\n tagline: text.optional(),\n category: text.optional(),\n media: z\n .object({ image: pathOrUrl.optional(), video: pathOrUrl.optional(), alt: text })\n .strict()\n .optional(),\n highlight: z.boolean().optional(),\n })\n .strict();\n\nconst flagValue: z.ZodType<FlagValue> = z.union([z.boolean(), z.string(), z.number(), z.record(z.string(), z.unknown())]);\n\n/** The Zod schema for one {@link FlagDef}. Cross-flag rules live in {@link defineFlags}. */\nexport const flagSchema = z\n .object({\n feature: text,\n kind: z.enum(FLAG_KINDS),\n owner: text,\n default: flagValue,\n scopes: z.array(text).min(1),\n description: text.optional(),\n expires: day.optional(),\n runbook: pathOrUrl.optional(),\n splitReason: text.optional(),\n })\n .strict();\n\n/** Thrown by {@link defineFeatures} and {@link defineFlags}; lists every problem at once. */\nexport class FeatureRegistryError extends Error {\n constructor(readonly problems: string[]) {\n super(`Invalid feature registry:\\n${problems.map((p) => ` - ${p}`).join(\"\\n\")}`);\n this.name = \"FeatureRegistryError\";\n }\n}\n\nfunction issues(prefix: string, error: z.ZodError): string[] {\n return error.issues.map((i) => `${[prefix, ...i.path].join(\".\")}: ${i.message}`);\n}\n\n/** The rules between one feature's fields, as problem strings. */\nfunction featureProblems(id: string, def: FeatureDef): string[] {\n const problems: string[] = [];\n const early = def.status === \"planned\" || def.status === \"building\";\n if (def.horizon && !early) problems.push(`${id}.horizon: only planned and building features are on the roadmap`);\n if (def.status === \"planned\" && !def.horizon) problems.push(`${id}.horizon: a planned feature needs now, next or later`);\n if ((def.status === \"beta\" || def.status === \"live\") && !def.acceptance?.length) {\n problems.push(`${id}.acceptance: a ${def.status} feature needs at least one testable sentence`);\n }\n if (def.claimedBy && def.status !== \"building\") problems.push(`${id}.claimedBy: only a building feature can be claimed`);\n if (def.media && !def.media.image && !def.media.video) problems.push(`${id}.media: needs an image or a video`);\n return problems;\n}\n\n/**\n * The one source of truth for a repo's features. Validates every entry and\n * returns the same object, so running code reads it directly and the key type\n * becomes the repo's `FeatureId`:\n *\n * ```ts\n * export const features = defineFeatures({\n * tasks: { name: \"Tasks\", summary: \"…\", status: \"live\", owner: \"mark\", apps: [\"web\"], audience: [\"client\"],\n * acceptance: [\"A client can tick off a task their coach added.\"] },\n * });\n * export type FeatureId = FeatureIdOf<typeof features>;\n * ```\n *\n * @stability Beta\n */\nexport function defineFeatures<const T extends Record<string, FeatureDef>>(features: T): T {\n const problems: string[] = [];\n const owners = new Map<string, string>();\n for (const [id, def] of Object.entries(features)) {\n if (!ID.test(id)) problems.push(`${id}: the id must be lowercase letters and digits, joined by -, _ or .`);\n const parsed = featureSchema.safeParse(def);\n if (!parsed.success) {\n problems.push(...issues(id, parsed.error));\n continue;\n }\n problems.push(...featureProblems(id, def));\n for (const name of [id, ...(def.aliases ?? [])]) {\n const other = owners.get(name);\n if (other !== undefined) problems.push(`${id}: \"${name}\" is already ${other === name ? \"a feature id\" : `an alias of ${other}`}`);\n else owners.set(name, id);\n }\n }\n if (problems.length) throw new FeatureRegistryError(problems);\n return Object.freeze(features);\n}\n\n/**\n * Flags, each tied to a feature of `features`. An unknown `feature` is a type\n * error, and at runtime:\n * - every flag needs an `owner`, a `kind`, a `default` and its `scopes`;\n * - `release` and `experiment` flags need an `expires` date, `ops` flags a `runbook`;\n * - a feature's second (third, …) flag needs a `splitReason`, because flags\n * are grouped by feature unless there's a stated reason to split.\n *\n * `permission` flags are accepted here so the app still runs, and refused by\n * `genesis features check`.\n *\n * @stability Beta\n */\nexport function defineFlags<F extends string, const T extends Record<string, FlagDef<NoInfer<F>>>>(\n features: { readonly [K in F]: FeatureDef },\n flags: T,\n): T {\n const problems: string[] = [];\n const seen = new Map<string, string>();\n for (const [name, def] of Object.entries(flags)) {\n const parsed = flagSchema.safeParse(def);\n if (!parsed.success) {\n problems.push(...issues(name, parsed.error));\n continue;\n }\n const flag = parsed.data;\n if (!Object.hasOwn(features, flag.feature)) problems.push(`${name}.feature: \"${flag.feature}\" is not a feature`);\n if ((flag.kind === \"release\" || flag.kind === \"experiment\") && !flag.expires) {\n problems.push(`${name}.expires: a ${flag.kind} flag needs an expiry date`);\n }\n if (flag.kind === \"ops\" && !flag.runbook) problems.push(`${name}.runbook: an ops flag needs a runbook`);\n const first = seen.get(flag.feature);\n if (first === undefined) seen.set(flag.feature, name);\n else if (!flag.splitReason)\n problems.push(`${name}.splitReason: \"${flag.feature}\" already has the flag ${first}; say why this one is separate`);\n }\n if (problems.length) throw new FeatureRegistryError(problems);\n return Object.freeze(flags);\n}\n\n/**\n * The names of the flags that belong to a feature, in declaration order.\n *\n * @stability Beta\n */\nexport function flagsForFeature(flags: Flags | undefined, id: string): string[] {\n if (!flags) return [];\n return Object.entries(flags)\n .filter(([, flag]) => flag.feature === id)\n .map(([name]) => name);\n}\n\n/**\n * Flags whose `expires` date is before `today` (`YYYY-MM-DD`, default today in\n * UTC): remove the code path, then the flag.\n *\n * @stability Beta\n */\nexport function expiredFlags(flags: Flags | undefined, today = new Date().toISOString().slice(0, 10)): string[] {\n if (!flags) return [];\n return Object.entries(flags)\n .filter(([, flag]) => flag.expires !== undefined && flag.expires < today)\n .map(([name]) => name);\n}\n\n/**\n * A feature flattened for a list, a board or JSON: its id, its fields with\n * defaults filled in, and the names of its flags.\n *\n * @stability Beta\n */\nexport interface FeatureRecord extends FeatureDef {\n [key: string]: unknown;\n id: string;\n visibility: FeatureVisibility;\n access: FeatureAccess;\n flags: string[];\n}\n\n/**\n * Features as records, in declaration order, each with its flags attached.\n *\n * @stability Beta\n */\nexport function toRecords(features: Features, flags?: Flags): FeatureRecord[] {\n return Object.entries(features).map(([id, def]) => ({\n id,\n ...def,\n visibility: def.visibility ?? \"customer\",\n access: def.access ?? \"all\",\n flags: flagsForFeature(flags, id),\n }));\n}\n\n/**\n * Features matching `term` in their id, aliases, name, summary, tagline,\n * category or code paths, best matches (id and name) first.\n *\n * @stability Beta\n */\nexport function findFeatures(features: Features, term: string, flags?: Flags): FeatureRecord[] {\n const needle = term.trim().toLowerCase();\n if (!needle) return [];\n const score = (r: FeatureRecord) => {\n if (r.id === needle || r.aliases?.includes(needle)) return 0;\n if (r.id.includes(needle) || r.name.toLowerCase().includes(needle)) return 1;\n if (r.flags.some((f) => f.toLowerCase().includes(needle))) return 2;\n const rest = [r.summary, r.tagline, r.category, ...(r.links?.code ?? []), ...(r.aliases ?? [])];\n return rest.some((v) => v?.toLowerCase().includes(needle)) ? 3 : -1;\n };\n return toRecords(features, flags)\n .map((r) => [score(r), r] as const)\n .filter(([s]) => s >= 0)\n .sort((a, b) => a[0] - b[0])\n .map(([, r]) => r);\n}\n","import { FEATURE_STATUSES, toRecords, type FeatureRecord, type Features, type Flags, type FlagValue } from \"./model\";\n\n/** Marks the start of the generated block in AGENTS.md. */\nexport const AGENTS_BLOCK_START = \"<!-- genesis-features:start -->\";\n/** Marks the end of the generated block in AGENTS.md. */\nexport const AGENTS_BLOCK_END = \"<!-- genesis-features:end -->\";\n/** Marks the start of the generated marketing block (e.g. in README.md). */\nexport const MARKETING_BLOCK_START = \"<!-- genesis-features:marketing:start -->\";\n/** Marks the end of the generated marketing block. */\nexport const MARKETING_BLOCK_END = \"<!-- genesis-features:marketing:end -->\";\n\nexport interface GenerateOptions {\n /** The file the registry lives in, named in the \"generated from\" notes. Default `src/features.ts`. */\n source?: string;\n /** How agents run the CLI here, e.g. `genesis features` or `bun run features`. Default `genesis features`. */\n command?: string;\n /** Where the skill lives, named in the AGENTS.md pointer. Default `.claude/skills/features/SKILL.md`. */\n skill?: string | false;\n}\n\n/**\n * The registry as JSON, for tools that can't import TypeScript. Stable: no\n * timestamps, features in declaration order, so `check` can compare it. It is\n * also the record of every id ever used, which keeps ids permanent.\n *\n * @stability Beta\n */\nexport function toJson(features: Features, flags?: Flags, options: GenerateOptions = {}): string {\n const doc = {\n generatedFrom: options.source ?? \"src/features.ts\",\n features: toRecords(features, flags),\n flags: flags ?? {},\n };\n return `${JSON.stringify(doc, null, 2)}\\n`;\n}\n\nfunction flagType(value: FlagValue): string {\n if (typeof value === \"boolean\") return \"boolean\";\n if (typeof value === \"string\") return \"string\";\n if (typeof value === \"number\") return Number.isInteger(value) ? \"integer\" : \"float\";\n return \"object\";\n}\n\n/** The schema an OpenFeature CLI flag manifest points at. */\nexport const OPENFEATURE_MANIFEST_SCHEMA =\n \"https://raw.githubusercontent.com/open-feature/cli/refs/heads/main/schema/v0/flag-manifest.json\";\n\n/**\n * The flags as an OpenFeature CLI flag manifest (`flags.json`), so\n * `openfeature generate` can make typed accessors from the same registry.\n *\n * @stability Beta\n */\nexport function toOpenFeatureManifest(flags: Flags, features?: Features): string {\n const manifest = {\n $schema: OPENFEATURE_MANIFEST_SCHEMA,\n flags: Object.fromEntries(\n Object.entries(flags).map(([key, flag]) => [\n key,\n {\n flagType: flagType(flag.default),\n defaultValue: flag.default,\n description: flag.description ?? `${flag.kind} flag for ${features?.[flag.feature]?.name ?? flag.feature}`,\n },\n ]),\n ),\n };\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\nconst cell = (value: string) => value.replace(/\\|/g, \"\\\\|\").replace(/\\r?\\n/g, \" \");\n\n/**\n * The marker-delimited block for AGENTS.md: deliberately short. It points\n * agents at `find` and the skill and gives counts, never the whole list, so\n * AGENTS.md stays small however many features there are.\n *\n * @stability Beta\n */\nexport function toAgentsMarkdown(features: Features, flags?: Flags, options: GenerateOptions = {}): string {\n const source = options.source ?? \"src/features.ts\";\n const command = options.command ?? \"genesis features\";\n const skill = options.skill === undefined ? \".claude/skills/features/SKILL.md\" : options.skill;\n const records = toRecords(features, flags);\n const counts = FEATURE_STATUSES.map((s) => [s, records.filter((r) => r.status === s).length] as const)\n .filter(([, n]) => n > 0)\n .map(([s, n]) => `${n} ${s}`)\n .join(\", \");\n const flagCount = flags ? Object.keys(flags).length : 0;\n const lines = [\n AGENTS_BLOCK_START,\n \"## Features\",\n \"\",\n `Every feature is in \\`${source}\\`: ${records.length} features (${counts})${flagCount ? `, ${flagCount} flag${flagCount === 1 ? \"\" : \"s\"}` : \"\"}.`,\n \"\",\n `- Before adding UI, routes or flags, run \\`${command} find <term>\\` to see whether a feature already covers it.`,\n `- New work starts as an entry in \\`${source}\\`; then run \\`${command} build\\`. \\`${command} check\\` runs in CI.`,\n ...(skill ? [`- Finding, adding and retiring features: \\`${skill}\\`.`] : []),\n \"\",\n `Generated by \\`${command} build\\`. Don't edit this block.`,\n AGENTS_BLOCK_END,\n ];\n return lines.join(\"\\n\");\n}\n\n/** The public, shipped features a marketing page shows: visibility public, a tagline, live or beta. */\nexport function marketingRecords(features: Features): FeatureRecord[] {\n return toRecords(features)\n .filter((r) => r.visibility === \"public\" && r.tagline && (r.status === \"live\" || r.status === \"beta\"))\n .sort((a, b) => Number(Boolean(b.highlight)) - Number(Boolean(a.highlight)));\n}\n\n/**\n * A benefit-led feature list for a README or a marketing page: public, shipped\n * features with a tagline, highlights first, grouped by category.\n *\n * @stability Beta\n */\nexport function toMarketingMarkdown(features: Features, options: { heading?: string; source?: string } = {}): string {\n const records = marketingRecords(features);\n const lines = [MARKETING_BLOCK_START, `## ${options.heading ?? \"Features\"}`, \"\"];\n const highlights = records.filter((r) => r.highlight);\n for (const r of highlights) lines.push(`- **${cell(r.name)}** — ${cell(r.tagline!)}`);\n if (highlights.length) lines.push(\"\");\n const categories = [...new Set(records.filter((r) => !r.highlight).map((r) => r.category ?? \"More\"))];\n for (const category of categories) {\n lines.push(`### ${category}`, \"\");\n for (const r of records.filter((x) => !x.highlight && (x.category ?? \"More\") === category)) {\n lines.push(`- **${cell(r.name)}**${r.status === \"beta\" ? \" (beta)\" : \"\"} — ${cell(r.tagline!)}`);\n }\n lines.push(\"\");\n }\n lines.push(`<sub>Generated from \\`${options.source ?? \"src/features.ts\"}\\`.</sub>`, MARKETING_BLOCK_END);\n return lines.join(\"\\n\");\n}\n\n/** Thrown when a generated block's markers are broken: one is missing, repeated or out of order. */\nexport class BrokenBlockError extends Error {\n constructor(start: string) {\n super(`The generated block's markers are broken (${start} and its end marker must each appear once, in order). Fix them by hand, or delete both and the block between them.`);\n this.name = \"BrokenBlockError\";\n }\n}\n\nconst count = (doc: string, marker: string) => doc.split(marker).length - 1;\n\n/**\n * The block between `start` and `end` inside `doc`, markers included, or null\n * when there is none. Throws {@link BrokenBlockError} when only one marker is\n * there, or either is repeated or out of order, rather than guess where the\n * block ends and wipe the text after it.\n */\nexport function readBlock(doc: string, start: string, end: string): string | null {\n const starts = count(doc, start);\n const ends = count(doc, end);\n if (starts === 0 && ends === 0) return null;\n const from = doc.indexOf(start);\n const to = doc.indexOf(end);\n if (starts !== 1 || ends !== 1 || to < from) throw new BrokenBlockError(start);\n return doc.slice(from, to + end.length);\n}\n\n/**\n * `doc` with the block between `start` and `end` replaced by `block`, or with\n * `block` appended when it has none yet. Everything outside the markers is\n * left as it was.\n */\nexport function replaceBlock(doc: string, block: string, start: string, end: string): string {\n const current = readBlock(doc, start, end);\n if (current !== null) return doc.replace(current, () => block);\n const base = doc.length === 0 || doc.endsWith(\"\\n\") ? doc : `${doc}\\n`;\n return `${base}${base.length ? \"\\n\" : \"\"}${block}\\n`;\n}\n\n/** The generated AGENTS.md block inside `doc`, or null. */\nexport const readAgentsBlock = (doc: string) => readBlock(doc, AGENTS_BLOCK_START, AGENTS_BLOCK_END);\n\n/**\n * `doc` with its generated AGENTS.md block replaced by `block`, or with\n * `block` appended when it has none yet.\n *\n * @stability Beta\n */\nexport const replaceAgentsBlock = (doc: string, block: string) => replaceBlock(doc, block, AGENTS_BLOCK_START, AGENTS_BLOCK_END);\n\n/**\n * The agent skill for working with the registry, written to\n * `.claude/skills/features/SKILL.md` by `genesis features build`.\n *\n * @stability Beta\n */\nexport function toSkillMarkdown(options: GenerateOptions = {}): string {\n const source = options.source ?? \"src/features.ts\";\n const command = options.command ?? \"genesis features\";\n return `---\nname: features\ndescription: Find, add, change and retire this repo's features in ${source}, and their flags. Use before adding UI, a route, a server function or a flag, when someone asks what the product does, or when shipping, deprecating or removing something.\n---\n\n<!-- Generated by \\`${command} build\\`. Don't edit; it is rewritten. -->\n\n# Features\n\n\\`${source}\\` is the one list of what this product does. Running code imports it, and every\nother copy (the AGENTS.md block, JSON, the flags manifest, the admin page) is generated from it.\n\n## Find\n- \\`${command} find <term>\\` searches ids, aliases, names, summaries and code paths. Run it before\n building anything new: extend the feature that already covers it rather than adding a second one.\n\n## Add\n1. Add an entry to \\`${source}\\`. The key is the id: lowercase, permanent, never reused.\n Required: \\`name\\`, \\`summary\\` (internal, one sentence), \\`status\\`, \\`owner\\`, \\`apps\\`, \\`audience\\`.\n - \\`planned\\` needs a \\`horizon\\` (now, next, later). No dates on the roadmap.\n - \\`building\\`: set \\`claimedBy\\` to your name or session while you work on it.\n - \\`beta\\` and \\`live\\` need \\`acceptance\\`: one testable sentence each. Tag the tests that prove\n them with \\`@feat:<id>\\` in a comment or the test name.\n - \\`links.code\\`: the files or folders that implement it. \\`check\\` fails when one is missing.\n - \\`visibility\\` (internal, customer, public, client:<name>) and \\`access\\` (\"all\" or { plan }).\n Paid access is \\`access\\`, never a flag. The id is the billing entitlement's lookup key.\n - For a public page: \\`tagline\\` (the customer benefit), \\`category\\`, \\`media\\`, \\`highlight\\`.\n2. Flags go in the flags registry with \\`feature: <id>\\`. One flag per feature; a second needs a\n \\`splitReason\\`. \\`release\\` and \\`experiment\\` flags need \\`expires\\`, \\`ops\\` flags a \\`runbook\\`.\n Read flags only through the typed accessor with a literal key, never a computed one.\n3. Run \\`${command} build\\` and commit what it writes. Tag the changeset (a \\`Features: <id>\\` line in\n its body) or the PR (a \\`feature:<id>\\` label).\n\n## Change\n- Move \\`status\\` as it ships: planned, building, beta, live, deprecated, retired. \\`check\\` warns when a\n planned feature already has shipped work tagged with it (a changeset, or with \\`--prs\\` a merged PR).\n- Set \\`reviewedAt\\` (today) whenever you check an entry against the product; \\`check\\` warns after 90 days.\n- Rename by giving the feature a new id and putting the old one in \\`aliases\\`. Never delete an id.\n\n## Retire\n1. Remove the code first: the UI, routes, server functions and tests.\n2. Then remove its flags from the flags registry (the code that read them is gone, so \\`check\\`\n would flag them as unused).\n3. Set \\`status: \"retired\"\\`, keep the entry, and drop \\`links.code\\` paths that no longer exist.\n4. Run \\`${command} build\\` and \\`${command} check\\`.\n`;\n}\n"]}
|