@codedrifters/configulator 0.0.254 → 0.0.256

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/lib/index.d.mts CHANGED
@@ -925,6 +925,201 @@ interface AgentPathsConfig {
925
925
  */
926
926
  readonly industriesRoot?: string;
927
927
  }
928
+ /*******************************************************************************
929
+ *
930
+ * Priority Rules
931
+ *
932
+ ******************************************************************************/
933
+ /**
934
+ * A single project-specific priority-detection rule.
935
+ *
936
+ * Rules let consuming repos declare a sector-prefix regex, label, body
937
+ * regex, or explicit issue-number pin that maps to one of the five
938
+ * `priority:*` tiers. The `base` bundle renders a "Project-specific
939
+ * priority rules" subsection into the `issue-label-conventions` rule
940
+ * when `AgentConfigOptions.priorityRules` is non-empty, in precedence
941
+ * order.
942
+ *
943
+ * Precedence is **first match wins** — rules are evaluated in the
944
+ * order supplied, and the bundle's default inference heuristics act as
945
+ * the fallback when nothing matches.
946
+ *
947
+ * @see AgentConfigOptions.priorityRules
948
+ */
949
+ interface PriorityRule {
950
+ /** Target priority tier the rule maps matched issues to. */
951
+ readonly priority: "critical" | "high" | "medium" | "low" | "trivial";
952
+ /**
953
+ * Match predicate. At least one sub-field should be set; multiple
954
+ * sub-fields on the same rule combine as a logical OR (any one
955
+ * matching fires the rule).
956
+ */
957
+ readonly match: {
958
+ /** Any of these labels present on the issue matches. */
959
+ readonly labels?: ReadonlyArray<string>;
960
+ /** Regex applied to the issue title, anchored as supplied. */
961
+ readonly titleRegex?: string;
962
+ /** Regex applied to the issue body, anchored as supplied. */
963
+ readonly bodyRegex?: string;
964
+ /** Explicit issue numbers pinned to this priority. */
965
+ readonly issueNumbers?: ReadonlyArray<number>;
966
+ };
967
+ /**
968
+ * Human-readable rationale rendered into the generated rule
969
+ * content so reviewers understand why the rule exists.
970
+ */
971
+ readonly rationale: string;
972
+ }
973
+ /*******************************************************************************
974
+ *
975
+ * Focus Scoring
976
+ *
977
+ ******************************************************************************/
978
+ /**
979
+ * Match predicate for a single focus area. At least one sub-field
980
+ * should be set; multiple sub-fields on the same match combine as a
981
+ * logical OR (any one matching contributes the focus area's weight).
982
+ *
983
+ * @see FocusArea
984
+ */
985
+ interface FocusAreaMatch {
986
+ /** Any of these labels present on the issue matches. */
987
+ readonly labels?: ReadonlyArray<string>;
988
+ /**
989
+ * Case-insensitive substrings matched against the issue title.
990
+ * A hit on any single keyword fires the match.
991
+ */
992
+ readonly titleKeywords?: ReadonlyArray<string>;
993
+ /**
994
+ * Case-insensitive substrings matched against the issue body.
995
+ * A hit on any single keyword fires the match.
996
+ */
997
+ readonly bodyKeywords?: ReadonlyArray<string>;
998
+ }
999
+ /**
1000
+ * A single scored focus area — a named customer, segment,
1001
+ * organization, software product, regulation, or person the project
1002
+ * cares about right now. Matching issues receive this area's
1003
+ * `weight` as a priority boost at triage time.
1004
+ *
1005
+ * @see FocusConfig
1006
+ * @see ./bundles/focus.ts#renderFocusSection
1007
+ */
1008
+ interface FocusArea {
1009
+ /** Human-readable name for the focus area (e.g. "Acme Corp"). */
1010
+ readonly name: string;
1011
+ /**
1012
+ * Consuming-repo-defined vocabulary describing what kind of entity
1013
+ * this focus area represents (e.g. `"customer"`, `"segment"`,
1014
+ * `"organization"`, `"software"`, `"regulation"`, `"person"`).
1015
+ * The `AgentExpansionRules.allowedTypes` /
1016
+ * `AgentExpansionRules.forbiddenTypes` lists gate what values
1017
+ * agents are permitted to introduce.
1018
+ */
1019
+ readonly type: string;
1020
+ /**
1021
+ * Provenance. `"human"` entries are curated by a maintainer;
1022
+ * `"agent"` entries were appended by an agent under the
1023
+ * agent-expansion rules and must carry a `discoveredIn` reference.
1024
+ */
1025
+ readonly source: "human" | "agent";
1026
+ /**
1027
+ * Issue reference (e.g. `"#123"`) that introduced the focus area.
1028
+ * Required when `source` is `"agent"` so the provenance of every
1029
+ * agent-appended entry is auditable; optional for human entries.
1030
+ */
1031
+ readonly discoveredIn?: string;
1032
+ /** Match predicate that decides which issues this area applies to. */
1033
+ readonly match: FocusAreaMatch;
1034
+ /**
1035
+ * Positive integer weight contributed to the issue's focus score
1036
+ * when the match fires. Consuming repos typically cap this with
1037
+ * `AgentExpansionRules.maxWeight` (default 8 in openhi's reference
1038
+ * implementation).
1039
+ */
1040
+ readonly weight: number;
1041
+ }
1042
+ /**
1043
+ * Guard-rails on what agents are allowed to append to `focus.json`
1044
+ * without human review. The agent-expansion contract is append-only:
1045
+ * agents never modify or remove existing entries.
1046
+ */
1047
+ interface AgentExpansionRules {
1048
+ /**
1049
+ * Hard cap on the `weight` an agent may set on a newly appended
1050
+ * focus area. Human curators may use higher weights.
1051
+ */
1052
+ readonly maxWeight: number;
1053
+ /**
1054
+ * Whitelist of `FocusArea.type` values agents are permitted to
1055
+ * introduce. Any type outside this list must be added by a human.
1056
+ */
1057
+ readonly allowedTypes: ReadonlyArray<string>;
1058
+ /**
1059
+ * Explicit blocklist of `FocusArea.type` values agents must never
1060
+ * introduce, even if the list accidentally overlaps
1061
+ * `allowedTypes`. `forbiddenTypes` wins on conflict.
1062
+ */
1063
+ readonly forbiddenTypes: ReadonlyArray<string>;
1064
+ /**
1065
+ * Optional cap on the number of entries in each keyword array
1066
+ * (`match.labels`, `match.titleKeywords`, `match.bodyKeywords`)
1067
+ * on an agent-appended focus area. Prevents runaway keyword
1068
+ * expansion. Human entries are not subject to this cap.
1069
+ */
1070
+ readonly maxKeywords?: number;
1071
+ }
1072
+ /**
1073
+ * Top-level configuration for the focus-scoring engine. The schema
1074
+ * and agent-expansion rules live in the configulator bundle; the
1075
+ * actual `focus.json` file is authored and curated in the consuming
1076
+ * repo.
1077
+ *
1078
+ * When supplied via `AgentConfigOptions.focus`, the `base` bundle
1079
+ * appends a "Focus scoring" subsection to the
1080
+ * `issue-label-conventions` rule that teaches agents how to read
1081
+ * `focus.json`, how focus weight interacts with the
1082
+ * `priority:*` taxonomy, and what they may and may not append to
1083
+ * the file.
1084
+ *
1085
+ * @see FocusArea
1086
+ * @see AgentExpansionRules
1087
+ * @see ./bundles/focus.ts#renderFocusSection
1088
+ */
1089
+ interface FocusConfig {
1090
+ /**
1091
+ * Path to the focus file relative to the repo root.
1092
+ * @default ".claude/focus.json"
1093
+ */
1094
+ readonly focusFilePath?: string;
1095
+ /**
1096
+ * Schema version the consuming repo's `focus.json` conforms to.
1097
+ * Bump when the schema changes in a backwards-incompatible way.
1098
+ * @default 1
1099
+ */
1100
+ readonly schemaVersion?: number;
1101
+ /**
1102
+ * Cumulative focus-score thresholds that map into the
1103
+ * `priority:*` taxonomy. An issue whose total focus score
1104
+ * (sum of matched focus-area weights) reaches `high` is boosted
1105
+ * to `priority:high`; reaching `medium` keeps it at
1106
+ * `priority:medium`. Scores below `medium` do not affect the
1107
+ * inferred priority.
1108
+ *
1109
+ * @remarks `high` and `medium` must be integers. The JSON schema
1110
+ * at `schemas/focus.schema.json` enforces this for `focus.json`.
1111
+ */
1112
+ readonly thresholds?: {
1113
+ readonly high: number;
1114
+ readonly medium: number;
1115
+ };
1116
+ /**
1117
+ * Guard-rails that govern what agents may append to `focus.json`.
1118
+ * When omitted, the rendered rule documents that agents must
1119
+ * **not** append to `focus.json` without human review.
1120
+ */
1121
+ readonly agentExpansionRules?: AgentExpansionRules;
1122
+ }
928
1123
  /*******************************************************************************
929
1124
  *
930
1125
  * AgentConfig Options
@@ -1023,6 +1218,40 @@ interface AgentConfigOptions {
1023
1218
  * does not yet alter generated rules.
1024
1219
  */
1025
1220
  readonly paths?: AgentPathsConfig;
1221
+ /**
1222
+ * Project-specific priority-detection rules. Each rule declares a
1223
+ * match predicate (labels, title regex, body regex, or explicit
1224
+ * issue numbers) and a target `priority:*` tier.
1225
+ *
1226
+ * When non-empty, the `base` bundle renders a "Project-specific
1227
+ * priority rules" subsection into the `issue-label-conventions`
1228
+ * rule. Precedence is **first match wins**; the bundle's default
1229
+ * inference heuristics act as the fallback when no rule matches.
1230
+ *
1231
+ * @see PriorityRule
1232
+ * @see ./bundles/priority-rules.ts#renderPriorityRulesSection
1233
+ */
1234
+ readonly priorityRules?: ReadonlyArray<PriorityRule>;
1235
+ /**
1236
+ * Focus-scoring configuration. Declares the path to the consuming
1237
+ * repo's `focus.json` file, score thresholds, and the
1238
+ * agent-expansion rules that govern what agents may append to the
1239
+ * file.
1240
+ *
1241
+ * When set, the `base` bundle appends a "Focus scoring"
1242
+ * subsection to the `issue-label-conventions` rule that teaches
1243
+ * agents (a) how to read `focus.json`, (b) how focus weight
1244
+ * interacts with the `priority:*` taxonomy, and (c) the
1245
+ * agent-driven expansion contract. The actual `focus.json` file
1246
+ * is authored and curated in the consuming repo — configulator
1247
+ * ships the schema and agent instructions only.
1248
+ *
1249
+ * @see FocusConfig
1250
+ * @see FocusArea
1251
+ * @see AgentExpansionRules
1252
+ * @see ./bundles/focus.ts#renderFocusSection
1253
+ */
1254
+ readonly focus?: FocusConfig;
1026
1255
  }
1027
1256
 
1028
1257
  /**
@@ -1295,6 +1524,36 @@ declare const prReviewBundle: AgentRuleBundle;
1295
1524
  */
1296
1525
  declare const projenBundle: AgentRuleBundle;
1297
1526
 
1527
+ /**
1528
+ * Render the markdown subsection appended to the
1529
+ * `issue-label-conventions` rule when `AgentConfigOptions.focus` is
1530
+ * supplied. Returns an empty string when `focus` is undefined so
1531
+ * callers can unconditionally concatenate the result.
1532
+ *
1533
+ * The section documents three things for agents:
1534
+ *
1535
+ * 1. How to read `focus.json` at triage time
1536
+ * 2. How focus weight interacts with the `priority:*` taxonomy
1537
+ * 3. The agent-driven expansion contract (what agents may append)
1538
+ *
1539
+ * Configulator ships this rule content plus a JSON Schema that
1540
+ * validates the `focus.json` file; the file itself is authored and
1541
+ * curated in the consuming repo.
1542
+ */
1543
+ declare function renderFocusSection(focus: FocusConfig | undefined): string;
1544
+
1545
+ /**
1546
+ * Render the markdown subsection appended to the
1547
+ * `issue-label-conventions` rule when `AgentConfigOptions.priorityRules`
1548
+ * is non-empty. Returns an empty string when the supplied array is
1549
+ * empty so callers can unconditionally concatenate the result.
1550
+ *
1551
+ * Precedence is **first match wins** — rules render in the order
1552
+ * supplied. The bundle's default inference heuristics act as the
1553
+ * fallback when no rule matches.
1554
+ */
1555
+ declare function renderPriorityRulesSection(rules: ReadonlyArray<PriorityRule>): string;
1556
+
1298
1557
  /**
1299
1558
  * Requirements-analyst bundle — opt-in via `includeBundles: [\"requirements-analyst\"]`.
1300
1559
  *
@@ -4017,4 +4276,4 @@ declare const COMPLETE_JOB_ID = "complete";
4017
4276
  */
4018
4277
  declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
4019
4278
 
4020
- export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, type AgentConfigOptions, type AgentModel, type AgentPathsConfig, type AgentPlatform, type AgentPlatformOverrides, type AgentProcedure, type AgentRule, type AgentRuleBundle, type AgentRuleScope, type AgentSkill, type AgentSubAgent, type AgentSubAgentPlatformOverrides, type ApproveMergeUpgradeOptions, AstroConfig, type AstroConfigOptions, type AstroIntegrationSpec, AstroOutput, AstroProject, type AstroProjectOptions, type AwsAccount, AwsCdkProject, type AwsCdkProjectOptions, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, type AwsDeploymentTargetOptions, type AwsLocalDeploymentConfig, type AwsOrganization, type AwsRegion, AwsTeardownWorkflow, type AwsTeardownWorkflowOptions, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, type CiDeploymentConfig, type ClassTypeOptions, type ClaudeAutoModeConfig, type ClaudeHookAction, type ClaudeHookEntry, type ClaudeHooksConfig, type ClaudePermissionsConfig, type ClaudeRuleTarget, type ClaudeSandboxConfig, type ClaudeSettingsConfig, type CopilotHandoff, type CursorHookAction, type CursorHooksConfig, type CursorSettingsConfig, DEFAULT_AGENT_PATHS, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, type DeployWorkflowOptions, type DeploymentMetadata, type GitBranch, type GitHubBoardMetadata, type GitHubProjectMetadata, type GitHubSprintMetadata, type IDependencyResolver, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, type LabelDefinition, type LayoutEnforcement, type LayoutViolation, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, type McpServerConfig, type McpTransport, type MergeMethod, type MonorepoLayoutRoot, MonorepoProject, type MonorepoProjectOptions, type OrganizationMetadata, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, ProjectMetadata, type ProjectMetadataOptions, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, type RepositoryMetadata, ResetTask, type ResetTaskOptions, type ResolvedAgentPaths, type ResolvedProjectMetadata, STARLIGHT_ROLE, type SlackMetadata, type StarlightEditLink, type StarlightLogo, StarlightProject, type StarlightProjectOptions, type StarlightRole, type StarlightSidebarItem, type StarlightSingletonViolation, type StarlightSocialLink, type SyncLabelsOptions, type TemplateResolveResult, TestRunner, TurboRepo, type TurboRepoOptions, TurboRepoTask, type TurboRepoTaskOptions, TypeScriptConfig, TypeScriptProject, type TypeScriptProjectOptions, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, type VersionKey, Vitest, type VitestConfigOptions, type VitestOptions, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, formatStarlightSingletonViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAgentPaths, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, validateStarlightSingleton, vitestBundle };
4279
+ export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, type AgentConfigOptions, type AgentExpansionRules, type AgentModel, type AgentPathsConfig, type AgentPlatform, type AgentPlatformOverrides, type AgentProcedure, type AgentRule, type AgentRuleBundle, type AgentRuleScope, type AgentSkill, type AgentSubAgent, type AgentSubAgentPlatformOverrides, type ApproveMergeUpgradeOptions, AstroConfig, type AstroConfigOptions, type AstroIntegrationSpec, AstroOutput, AstroProject, type AstroProjectOptions, type AwsAccount, AwsCdkProject, type AwsCdkProjectOptions, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, type AwsDeploymentTargetOptions, type AwsLocalDeploymentConfig, type AwsOrganization, type AwsRegion, AwsTeardownWorkflow, type AwsTeardownWorkflowOptions, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, type CiDeploymentConfig, type ClassTypeOptions, type ClaudeAutoModeConfig, type ClaudeHookAction, type ClaudeHookEntry, type ClaudeHooksConfig, type ClaudePermissionsConfig, type ClaudeRuleTarget, type ClaudeSandboxConfig, type ClaudeSettingsConfig, type CopilotHandoff, type CursorHookAction, type CursorHooksConfig, type CursorSettingsConfig, DEFAULT_AGENT_PATHS, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, type DeployWorkflowOptions, type DeploymentMetadata, type FocusArea, type FocusAreaMatch, type FocusConfig, type GitBranch, type GitHubBoardMetadata, type GitHubProjectMetadata, type GitHubSprintMetadata, type IDependencyResolver, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, type LabelDefinition, type LayoutEnforcement, type LayoutViolation, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, type McpServerConfig, type McpTransport, type MergeMethod, type MonorepoLayoutRoot, MonorepoProject, type MonorepoProjectOptions, type OrganizationMetadata, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, type PriorityRule, ProjectMetadata, type ProjectMetadataOptions, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, type RepositoryMetadata, ResetTask, type ResetTaskOptions, type ResolvedAgentPaths, type ResolvedProjectMetadata, STARLIGHT_ROLE, type SlackMetadata, type StarlightEditLink, type StarlightLogo, StarlightProject, type StarlightProjectOptions, type StarlightRole, type StarlightSidebarItem, type StarlightSingletonViolation, type StarlightSocialLink, type SyncLabelsOptions, type TemplateResolveResult, TestRunner, TurboRepo, type TurboRepoOptions, TurboRepoTask, type TurboRepoTaskOptions, TypeScriptConfig, TypeScriptProject, type TypeScriptProjectOptions, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, type VersionKey, Vitest, type VitestConfigOptions, type VitestOptions, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, formatStarlightSingletonViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, renderFocusSection, renderPriorityRulesSection, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAgentPaths, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, validateStarlightSingleton, vitestBundle };
package/lib/index.d.ts CHANGED
@@ -974,6 +974,201 @@ interface AgentPathsConfig {
974
974
  */
975
975
  readonly industriesRoot?: string;
976
976
  }
977
+ /*******************************************************************************
978
+ *
979
+ * Priority Rules
980
+ *
981
+ ******************************************************************************/
982
+ /**
983
+ * A single project-specific priority-detection rule.
984
+ *
985
+ * Rules let consuming repos declare a sector-prefix regex, label, body
986
+ * regex, or explicit issue-number pin that maps to one of the five
987
+ * `priority:*` tiers. The `base` bundle renders a "Project-specific
988
+ * priority rules" subsection into the `issue-label-conventions` rule
989
+ * when `AgentConfigOptions.priorityRules` is non-empty, in precedence
990
+ * order.
991
+ *
992
+ * Precedence is **first match wins** — rules are evaluated in the
993
+ * order supplied, and the bundle's default inference heuristics act as
994
+ * the fallback when nothing matches.
995
+ *
996
+ * @see AgentConfigOptions.priorityRules
997
+ */
998
+ interface PriorityRule {
999
+ /** Target priority tier the rule maps matched issues to. */
1000
+ readonly priority: "critical" | "high" | "medium" | "low" | "trivial";
1001
+ /**
1002
+ * Match predicate. At least one sub-field should be set; multiple
1003
+ * sub-fields on the same rule combine as a logical OR (any one
1004
+ * matching fires the rule).
1005
+ */
1006
+ readonly match: {
1007
+ /** Any of these labels present on the issue matches. */
1008
+ readonly labels?: ReadonlyArray<string>;
1009
+ /** Regex applied to the issue title, anchored as supplied. */
1010
+ readonly titleRegex?: string;
1011
+ /** Regex applied to the issue body, anchored as supplied. */
1012
+ readonly bodyRegex?: string;
1013
+ /** Explicit issue numbers pinned to this priority. */
1014
+ readonly issueNumbers?: ReadonlyArray<number>;
1015
+ };
1016
+ /**
1017
+ * Human-readable rationale rendered into the generated rule
1018
+ * content so reviewers understand why the rule exists.
1019
+ */
1020
+ readonly rationale: string;
1021
+ }
1022
+ /*******************************************************************************
1023
+ *
1024
+ * Focus Scoring
1025
+ *
1026
+ ******************************************************************************/
1027
+ /**
1028
+ * Match predicate for a single focus area. At least one sub-field
1029
+ * should be set; multiple sub-fields on the same match combine as a
1030
+ * logical OR (any one matching contributes the focus area's weight).
1031
+ *
1032
+ * @see FocusArea
1033
+ */
1034
+ interface FocusAreaMatch {
1035
+ /** Any of these labels present on the issue matches. */
1036
+ readonly labels?: ReadonlyArray<string>;
1037
+ /**
1038
+ * Case-insensitive substrings matched against the issue title.
1039
+ * A hit on any single keyword fires the match.
1040
+ */
1041
+ readonly titleKeywords?: ReadonlyArray<string>;
1042
+ /**
1043
+ * Case-insensitive substrings matched against the issue body.
1044
+ * A hit on any single keyword fires the match.
1045
+ */
1046
+ readonly bodyKeywords?: ReadonlyArray<string>;
1047
+ }
1048
+ /**
1049
+ * A single scored focus area — a named customer, segment,
1050
+ * organization, software product, regulation, or person the project
1051
+ * cares about right now. Matching issues receive this area's
1052
+ * `weight` as a priority boost at triage time.
1053
+ *
1054
+ * @see FocusConfig
1055
+ * @see ./bundles/focus.ts#renderFocusSection
1056
+ */
1057
+ interface FocusArea {
1058
+ /** Human-readable name for the focus area (e.g. "Acme Corp"). */
1059
+ readonly name: string;
1060
+ /**
1061
+ * Consuming-repo-defined vocabulary describing what kind of entity
1062
+ * this focus area represents (e.g. `"customer"`, `"segment"`,
1063
+ * `"organization"`, `"software"`, `"regulation"`, `"person"`).
1064
+ * The `AgentExpansionRules.allowedTypes` /
1065
+ * `AgentExpansionRules.forbiddenTypes` lists gate what values
1066
+ * agents are permitted to introduce.
1067
+ */
1068
+ readonly type: string;
1069
+ /**
1070
+ * Provenance. `"human"` entries are curated by a maintainer;
1071
+ * `"agent"` entries were appended by an agent under the
1072
+ * agent-expansion rules and must carry a `discoveredIn` reference.
1073
+ */
1074
+ readonly source: "human" | "agent";
1075
+ /**
1076
+ * Issue reference (e.g. `"#123"`) that introduced the focus area.
1077
+ * Required when `source` is `"agent"` so the provenance of every
1078
+ * agent-appended entry is auditable; optional for human entries.
1079
+ */
1080
+ readonly discoveredIn?: string;
1081
+ /** Match predicate that decides which issues this area applies to. */
1082
+ readonly match: FocusAreaMatch;
1083
+ /**
1084
+ * Positive integer weight contributed to the issue's focus score
1085
+ * when the match fires. Consuming repos typically cap this with
1086
+ * `AgentExpansionRules.maxWeight` (default 8 in openhi's reference
1087
+ * implementation).
1088
+ */
1089
+ readonly weight: number;
1090
+ }
1091
+ /**
1092
+ * Guard-rails on what agents are allowed to append to `focus.json`
1093
+ * without human review. The agent-expansion contract is append-only:
1094
+ * agents never modify or remove existing entries.
1095
+ */
1096
+ interface AgentExpansionRules {
1097
+ /**
1098
+ * Hard cap on the `weight` an agent may set on a newly appended
1099
+ * focus area. Human curators may use higher weights.
1100
+ */
1101
+ readonly maxWeight: number;
1102
+ /**
1103
+ * Whitelist of `FocusArea.type` values agents are permitted to
1104
+ * introduce. Any type outside this list must be added by a human.
1105
+ */
1106
+ readonly allowedTypes: ReadonlyArray<string>;
1107
+ /**
1108
+ * Explicit blocklist of `FocusArea.type` values agents must never
1109
+ * introduce, even if the list accidentally overlaps
1110
+ * `allowedTypes`. `forbiddenTypes` wins on conflict.
1111
+ */
1112
+ readonly forbiddenTypes: ReadonlyArray<string>;
1113
+ /**
1114
+ * Optional cap on the number of entries in each keyword array
1115
+ * (`match.labels`, `match.titleKeywords`, `match.bodyKeywords`)
1116
+ * on an agent-appended focus area. Prevents runaway keyword
1117
+ * expansion. Human entries are not subject to this cap.
1118
+ */
1119
+ readonly maxKeywords?: number;
1120
+ }
1121
+ /**
1122
+ * Top-level configuration for the focus-scoring engine. The schema
1123
+ * and agent-expansion rules live in the configulator bundle; the
1124
+ * actual `focus.json` file is authored and curated in the consuming
1125
+ * repo.
1126
+ *
1127
+ * When supplied via `AgentConfigOptions.focus`, the `base` bundle
1128
+ * appends a "Focus scoring" subsection to the
1129
+ * `issue-label-conventions` rule that teaches agents how to read
1130
+ * `focus.json`, how focus weight interacts with the
1131
+ * `priority:*` taxonomy, and what they may and may not append to
1132
+ * the file.
1133
+ *
1134
+ * @see FocusArea
1135
+ * @see AgentExpansionRules
1136
+ * @see ./bundles/focus.ts#renderFocusSection
1137
+ */
1138
+ interface FocusConfig {
1139
+ /**
1140
+ * Path to the focus file relative to the repo root.
1141
+ * @default ".claude/focus.json"
1142
+ */
1143
+ readonly focusFilePath?: string;
1144
+ /**
1145
+ * Schema version the consuming repo's `focus.json` conforms to.
1146
+ * Bump when the schema changes in a backwards-incompatible way.
1147
+ * @default 1
1148
+ */
1149
+ readonly schemaVersion?: number;
1150
+ /**
1151
+ * Cumulative focus-score thresholds that map into the
1152
+ * `priority:*` taxonomy. An issue whose total focus score
1153
+ * (sum of matched focus-area weights) reaches `high` is boosted
1154
+ * to `priority:high`; reaching `medium` keeps it at
1155
+ * `priority:medium`. Scores below `medium` do not affect the
1156
+ * inferred priority.
1157
+ *
1158
+ * @remarks `high` and `medium` must be integers. The JSON schema
1159
+ * at `schemas/focus.schema.json` enforces this for `focus.json`.
1160
+ */
1161
+ readonly thresholds?: {
1162
+ readonly high: number;
1163
+ readonly medium: number;
1164
+ };
1165
+ /**
1166
+ * Guard-rails that govern what agents may append to `focus.json`.
1167
+ * When omitted, the rendered rule documents that agents must
1168
+ * **not** append to `focus.json` without human review.
1169
+ */
1170
+ readonly agentExpansionRules?: AgentExpansionRules;
1171
+ }
977
1172
  /*******************************************************************************
978
1173
  *
979
1174
  * AgentConfig Options
@@ -1072,6 +1267,40 @@ interface AgentConfigOptions {
1072
1267
  * does not yet alter generated rules.
1073
1268
  */
1074
1269
  readonly paths?: AgentPathsConfig;
1270
+ /**
1271
+ * Project-specific priority-detection rules. Each rule declares a
1272
+ * match predicate (labels, title regex, body regex, or explicit
1273
+ * issue numbers) and a target `priority:*` tier.
1274
+ *
1275
+ * When non-empty, the `base` bundle renders a "Project-specific
1276
+ * priority rules" subsection into the `issue-label-conventions`
1277
+ * rule. Precedence is **first match wins**; the bundle's default
1278
+ * inference heuristics act as the fallback when no rule matches.
1279
+ *
1280
+ * @see PriorityRule
1281
+ * @see ./bundles/priority-rules.ts#renderPriorityRulesSection
1282
+ */
1283
+ readonly priorityRules?: ReadonlyArray<PriorityRule>;
1284
+ /**
1285
+ * Focus-scoring configuration. Declares the path to the consuming
1286
+ * repo's `focus.json` file, score thresholds, and the
1287
+ * agent-expansion rules that govern what agents may append to the
1288
+ * file.
1289
+ *
1290
+ * When set, the `base` bundle appends a "Focus scoring"
1291
+ * subsection to the `issue-label-conventions` rule that teaches
1292
+ * agents (a) how to read `focus.json`, (b) how focus weight
1293
+ * interacts with the `priority:*` taxonomy, and (c) the
1294
+ * agent-driven expansion contract. The actual `focus.json` file
1295
+ * is authored and curated in the consuming repo — configulator
1296
+ * ships the schema and agent instructions only.
1297
+ *
1298
+ * @see FocusConfig
1299
+ * @see FocusArea
1300
+ * @see AgentExpansionRules
1301
+ * @see ./bundles/focus.ts#renderFocusSection
1302
+ */
1303
+ readonly focus?: FocusConfig;
1075
1304
  }
1076
1305
 
1077
1306
  /**
@@ -1344,6 +1573,36 @@ declare const prReviewBundle: AgentRuleBundle;
1344
1573
  */
1345
1574
  declare const projenBundle: AgentRuleBundle;
1346
1575
 
1576
+ /**
1577
+ * Render the markdown subsection appended to the
1578
+ * `issue-label-conventions` rule when `AgentConfigOptions.focus` is
1579
+ * supplied. Returns an empty string when `focus` is undefined so
1580
+ * callers can unconditionally concatenate the result.
1581
+ *
1582
+ * The section documents three things for agents:
1583
+ *
1584
+ * 1. How to read `focus.json` at triage time
1585
+ * 2. How focus weight interacts with the `priority:*` taxonomy
1586
+ * 3. The agent-driven expansion contract (what agents may append)
1587
+ *
1588
+ * Configulator ships this rule content plus a JSON Schema that
1589
+ * validates the `focus.json` file; the file itself is authored and
1590
+ * curated in the consuming repo.
1591
+ */
1592
+ declare function renderFocusSection(focus: FocusConfig | undefined): string;
1593
+
1594
+ /**
1595
+ * Render the markdown subsection appended to the
1596
+ * `issue-label-conventions` rule when `AgentConfigOptions.priorityRules`
1597
+ * is non-empty. Returns an empty string when the supplied array is
1598
+ * empty so callers can unconditionally concatenate the result.
1599
+ *
1600
+ * Precedence is **first match wins** — rules render in the order
1601
+ * supplied. The bundle's default inference heuristics act as the
1602
+ * fallback when no rule matches.
1603
+ */
1604
+ declare function renderPriorityRulesSection(rules: ReadonlyArray<PriorityRule>): string;
1605
+
1347
1606
  /**
1348
1607
  * Requirements-analyst bundle — opt-in via `includeBundles: [\"requirements-analyst\"]`.
1349
1608
  *
@@ -4066,5 +4325,5 @@ declare const COMPLETE_JOB_ID = "complete";
4066
4325
  */
4067
4326
  declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
4068
4327
 
4069
- export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, AstroConfig, AstroOutput, AstroProject, AwsCdkProject, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, AwsTeardownWorkflow, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, DEFAULT_AGENT_PATHS, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, MonorepoProject, PROD_DEPLOY_NAME, PnpmWorkspace, ProjectMetadata, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, ResetTask, STARLIGHT_ROLE, StarlightProject, TestRunner, TurboRepo, TurboRepoTask, TypeScriptConfig, TypeScriptProject, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, Vitest, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, formatStarlightSingletonViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAgentPaths, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, validateStarlightSingleton, vitestBundle };
4070
- export type { AgentConfigOptions, AgentModel, AgentPathsConfig, AgentPlatform, AgentPlatformOverrides, AgentProcedure, AgentRule, AgentRuleBundle, AgentRuleScope, AgentSkill, AgentSubAgent, AgentSubAgentPlatformOverrides, ApproveMergeUpgradeOptions, AstroConfigOptions, AstroIntegrationSpec, AstroProjectOptions, AwsAccount, AwsCdkProjectOptions, AwsDeploymentTargetOptions, AwsLocalDeploymentConfig, AwsOrganization, AwsRegion, AwsTeardownWorkflowOptions, CiDeploymentConfig, ClassTypeOptions, ClaudeAutoModeConfig, ClaudeHookAction, ClaudeHookEntry, ClaudeHooksConfig, ClaudePermissionsConfig, ClaudeRuleTarget, ClaudeSandboxConfig, ClaudeSettingsConfig, CopilotHandoff, CursorHookAction, CursorHooksConfig, CursorSettingsConfig, DeployWorkflowOptions, DeploymentMetadata, GitBranch, GitHubBoardMetadata, GitHubProjectMetadata, GitHubSprintMetadata, IDependencyResolver, LabelDefinition, LayoutEnforcement, LayoutViolation, McpServerConfig, McpTransport, MergeMethod, MonorepoLayoutRoot, MonorepoProjectOptions, OrganizationMetadata, PnpmWorkspaceOptions, ProjectMetadataOptions, RemoteCacheOptions, RepositoryMetadata, ResetTaskOptions, ResolvedAgentPaths, ResolvedProjectMetadata, SlackMetadata, StarlightEditLink, StarlightLogo, StarlightProjectOptions, StarlightRole, StarlightSidebarItem, StarlightSingletonViolation, StarlightSocialLink, SyncLabelsOptions, TemplateResolveResult, TurboRepoOptions, TurboRepoTaskOptions, TypeScriptProjectOptions, VersionKey, VitestConfigOptions, VitestOptions };
4328
+ export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, AstroConfig, AstroOutput, AstroProject, AwsCdkProject, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, AwsTeardownWorkflow, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, DEFAULT_AGENT_PATHS, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, MonorepoProject, PROD_DEPLOY_NAME, PnpmWorkspace, ProjectMetadata, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, ResetTask, STARLIGHT_ROLE, StarlightProject, TestRunner, TurboRepo, TurboRepoTask, TypeScriptConfig, TypeScriptProject, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, Vitest, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, formatStarlightSingletonViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, renderFocusSection, renderPriorityRulesSection, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAgentPaths, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, validateStarlightSingleton, vitestBundle };
4329
+ export type { AgentConfigOptions, AgentExpansionRules, AgentModel, AgentPathsConfig, AgentPlatform, AgentPlatformOverrides, AgentProcedure, AgentRule, AgentRuleBundle, AgentRuleScope, AgentSkill, AgentSubAgent, AgentSubAgentPlatformOverrides, ApproveMergeUpgradeOptions, AstroConfigOptions, AstroIntegrationSpec, AstroProjectOptions, AwsAccount, AwsCdkProjectOptions, AwsDeploymentTargetOptions, AwsLocalDeploymentConfig, AwsOrganization, AwsRegion, AwsTeardownWorkflowOptions, CiDeploymentConfig, ClassTypeOptions, ClaudeAutoModeConfig, ClaudeHookAction, ClaudeHookEntry, ClaudeHooksConfig, ClaudePermissionsConfig, ClaudeRuleTarget, ClaudeSandboxConfig, ClaudeSettingsConfig, CopilotHandoff, CursorHookAction, CursorHooksConfig, CursorSettingsConfig, DeployWorkflowOptions, DeploymentMetadata, FocusArea, FocusAreaMatch, FocusConfig, GitBranch, GitHubBoardMetadata, GitHubProjectMetadata, GitHubSprintMetadata, IDependencyResolver, LabelDefinition, LayoutEnforcement, LayoutViolation, McpServerConfig, McpTransport, MergeMethod, MonorepoLayoutRoot, MonorepoProjectOptions, OrganizationMetadata, PnpmWorkspaceOptions, PriorityRule, ProjectMetadataOptions, RemoteCacheOptions, RepositoryMetadata, ResetTaskOptions, ResolvedAgentPaths, ResolvedProjectMetadata, SlackMetadata, StarlightEditLink, StarlightLogo, StarlightProjectOptions, StarlightRole, StarlightSidebarItem, StarlightSingletonViolation, StarlightSocialLink, SyncLabelsOptions, TemplateResolveResult, TurboRepoOptions, TurboRepoTaskOptions, TypeScriptProjectOptions, VersionKey, VitestConfigOptions, VitestOptions };