@codedrifters/configulator 0.0.407 → 0.0.408

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.mjs CHANGED
@@ -5027,7 +5027,15 @@ var createRuleSkill = {
5027
5027
  "- Use `ruleExtensions` to add project-specific content to existing bundle rules instead of replacing them"
5028
5028
  ].join("\n")
5029
5029
  };
5030
- function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
5030
+ var DEFAULT_BASE_CONVENTIONS = {
5031
+ progressFiles: resolveProgressFiles(),
5032
+ sharedEditing: resolveSharedEditing(),
5033
+ temporalFraming: resolveTemporalFraming(),
5034
+ skillEvals: resolveSkillEvals(),
5035
+ issueTemplates: resolveIssueTemplates(),
5036
+ hasDownstreamIssueKindBundles: true
5037
+ };
5038
+ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS, conventions = DEFAULT_BASE_CONVENTIONS) {
5031
5039
  return {
5032
5040
  name: "base",
5033
5041
  description: "Core rules: project overview, interaction style, and general coding conventions",
@@ -5696,7 +5704,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
5696
5704
  // them via `agentConfig.additionalRulePaths`; other consumers
5697
5705
  // get a clean default.
5698
5706
  filePatterns: [".claude/agents/*.md", ".claude/procedures/**"],
5699
- content: renderProgressFilesRuleContent(resolveProgressFiles()),
5707
+ content: renderProgressFilesRuleContent(conventions.progressFiles),
5700
5708
  platforms: {
5701
5709
  cursor: { exclude: true }
5702
5710
  },
@@ -5707,7 +5715,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
5707
5715
  description: "Shared-editing safety: single-entry deterministic-sort inserts on index files, commit-path verification, and the merge-conflict resolution recipe that keeps concurrent agent sessions from dropping each other's rows on shared registries and feature matrices.",
5708
5716
  scope: AGENT_RULE_SCOPE.FILE_PATTERN,
5709
5717
  filePatterns: DEFAULT_SHARED_INDEX_PATHS,
5710
- content: renderSharedEditingRuleContent(resolveSharedEditing()),
5718
+ content: renderSharedEditingRuleContent(conventions.sharedEditing),
5711
5719
  platforms: {
5712
5720
  cursor: { exclude: true }
5713
5721
  },
@@ -5725,7 +5733,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
5725
5733
  "docs/src/content/docs/standards-research/**/*.md",
5726
5734
  "docs/src/content/docs/customer-research/**/*.md"
5727
5735
  ],
5728
- content: renderTemporalFramingRuleContent(resolveTemporalFraming()),
5736
+ content: renderTemporalFramingRuleContent(conventions.temporalFraming),
5729
5737
  platforms: {
5730
5738
  cursor: { exclude: true }
5731
5739
  },
@@ -5738,7 +5746,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
5738
5746
  // Bundle defaults exclude paths into configulator's own
5739
5747
  // source — see comment on progress-file-convention above.
5740
5748
  filePatterns: [".claude/skills/**"],
5741
- content: renderSkillEvalsRuleContent(resolveSkillEvals()),
5749
+ content: renderSkillEvalsRuleContent(conventions.skillEvals),
5742
5750
  platforms: {
5743
5751
  cursor: { exclude: true }
5744
5752
  },
@@ -5755,7 +5763,10 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
5755
5763
  ".claude/agents/*.md",
5756
5764
  `${paths.docsRoot}/agents/issue-templates.md`
5757
5765
  ],
5758
- content: renderIssueTemplatesRuleContent(resolveIssueTemplates()),
5766
+ content: renderIssueTemplatesRuleContent(
5767
+ conventions.issueTemplates,
5768
+ conventions.hasDownstreamIssueKindBundles
5769
+ ),
5759
5770
  platforms: {
5760
5771
  cursor: { exclude: true }
5761
5772
  },
@@ -19462,37 +19473,7 @@ var scanCommand = {
19462
19473
  ""
19463
19474
  ].join("\n")
19464
19475
  };
19465
- var orchestratorBundle = {
19466
- name: "orchestrator",
19467
- description: "Pipeline orchestrator agent for issue triage, PR review, and queue management",
19468
- // Always included by default
19469
- appliesWhen: () => true,
19470
- rules: [
19471
- {
19472
- name: "orchestrator-conventions",
19473
- description: "Guidelines for orchestrator agent behavior and pipeline management, including the funnel-tier dispatch sort, scope gate, and per-agent scheduled-task layout",
19474
- scope: AGENT_RULE_SCOPE.FILE_PATTERN,
19475
- // Bundle defaults exclude paths into configulator's own source
19476
- // (only meaningful when configulator is a workspace package).
19477
- // codedrifters/packages restores them via
19478
- // `agentConfig.additionalRulePaths`.
19479
- filePatterns: [
19480
- ".claude/agents/orchestrator.md",
19481
- ".claude/scheduled-tasks/**"
19482
- ],
19483
- content: buildOrchestratorConventionsContent(
19484
- DEFAULT_AGENT_TIERS,
19485
- resolveScopeGate(),
19486
- resolveRunRatio(),
19487
- resolveScheduledTasks(),
19488
- resolveUnblockDependents()
19489
- ),
19490
- platforms: {
19491
- cursor: { exclude: true }
19492
- },
19493
- tags: ["workflow"]
19494
- }
19495
- ],
19476
+ var ORCHESTRATOR_BUNDLE_STATIC = {
19496
19477
  subAgents: [orchestratorSubAgent, issueWorkerSubAgent],
19497
19478
  procedures: [
19498
19479
  checkBlockedProcedure,
@@ -19508,6 +19489,51 @@ var orchestratorBundle = {
19508
19489
  ]
19509
19490
  }
19510
19491
  };
19492
+ var DEFAULT_ORCHESTRATOR_CONVENTIONS = {
19493
+ tiers: DEFAULT_AGENT_TIERS,
19494
+ scopeGate: resolveScopeGate(),
19495
+ runRatio: resolveRunRatio(),
19496
+ scheduledTasks: resolveScheduledTasks(),
19497
+ unblockDependents: resolveUnblockDependents(),
19498
+ excludeBundles: []
19499
+ };
19500
+ function buildOrchestratorBundle(conventions = DEFAULT_ORCHESTRATOR_CONVENTIONS) {
19501
+ return {
19502
+ name: "orchestrator",
19503
+ description: "Pipeline orchestrator agent for issue triage, PR review, and queue management",
19504
+ // Always included by default
19505
+ appliesWhen: () => true,
19506
+ rules: [
19507
+ {
19508
+ name: "orchestrator-conventions",
19509
+ description: "Guidelines for orchestrator agent behavior and pipeline management, including the funnel-tier dispatch sort, scope gate, and per-agent scheduled-task layout",
19510
+ scope: AGENT_RULE_SCOPE.FILE_PATTERN,
19511
+ // Bundle defaults exclude paths into configulator's own source
19512
+ // (only meaningful when configulator is a workspace package).
19513
+ // codedrifters/packages restores them via
19514
+ // `agentConfig.additionalRulePaths`.
19515
+ filePatterns: [
19516
+ ".claude/agents/orchestrator.md",
19517
+ ".claude/scheduled-tasks/**"
19518
+ ],
19519
+ content: buildOrchestratorConventionsContent(
19520
+ conventions.tiers,
19521
+ conventions.scopeGate,
19522
+ conventions.runRatio,
19523
+ conventions.scheduledTasks,
19524
+ conventions.unblockDependents,
19525
+ conventions.excludeBundles
19526
+ ),
19527
+ platforms: {
19528
+ cursor: { exclude: true }
19529
+ },
19530
+ tags: ["workflow"]
19531
+ }
19532
+ ],
19533
+ ...ORCHESTRATOR_BUNDLE_STATIC
19534
+ };
19535
+ }
19536
+ var orchestratorBundle = buildOrchestratorBundle();
19511
19537
 
19512
19538
  // src/agent/bundles/people-profile.ts
19513
19539
  function buildPeopleProfileAnalystSubAgent(paths, issueDefaults, tier) {
@@ -33981,10 +34007,14 @@ function renderPriorityRulesSection(rules) {
33981
34007
  }
33982
34008
 
33983
34009
  // src/agent/bundles/index.ts
33984
- function buildBuiltInBundles(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAULT_RESOLVED_ISSUE_DEFAULTS, defaultAgentTier = AGENT_MODEL.BALANCED, bundleAgentTiers = /* @__PURE__ */ new Map(), prReviewPolicy = resolvePrReviewPolicy(), buildPolicy = DEFAULT_BUILD_POLICY) {
34010
+ var DEFAULT_RULE_CONVENTIONS = {
34011
+ base: DEFAULT_BASE_CONVENTIONS,
34012
+ orchestrator: DEFAULT_ORCHESTRATOR_CONVENTIONS
34013
+ };
34014
+ function buildBuiltInBundles(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAULT_RESOLVED_ISSUE_DEFAULTS, defaultAgentTier = AGENT_MODEL.BALANCED, bundleAgentTiers = /* @__PURE__ */ new Map(), prReviewPolicy = resolvePrReviewPolicy(), buildPolicy = DEFAULT_BUILD_POLICY, conventions = DEFAULT_RULE_CONVENTIONS) {
33985
34015
  const tierFor = (bundle) => bundleAgentTiers.get(bundle) ?? defaultAgentTier;
33986
34016
  return [
33987
- buildBaseBundle(paths),
34017
+ buildBaseBundle(paths, conventions.base),
33988
34018
  upstreamConfigulatorDocsBundle,
33989
34019
  typescriptBundle,
33990
34020
  vitestBundle,
@@ -33997,7 +34027,7 @@ function buildBuiltInBundles(paths = DEFAULT_AGENT_PATHS, issueDefaults = DEFAUL
33997
34027
  slackBundle,
33998
34028
  buildMeetingAnalysisBundle(tierFor("meeting-analysis")),
33999
34029
  agendaBundle,
34000
- orchestratorBundle,
34030
+ buildOrchestratorBundle(conventions.orchestrator),
34001
34031
  buildPrReviewBundle(prReviewPolicy),
34002
34032
  buildRequirementsAnalystBundle(paths, issueDefaults),
34003
34033
  buildRequirementsWriterBundle(paths, issueDefaults),
@@ -35085,6 +35115,13 @@ var AgentConfig = class _AgentConfig extends Component8 {
35085
35115
  * credential requirement when a remote cache actually exists. The
35086
35116
  * getter is lazy by design — `TurboRepo` must already be attached
35087
35117
  * to the project when the bundles are first read.
35118
+ *
35119
+ * Every **config-driven convention rule** is likewise resolved here
35120
+ * and seeded into its owning bundle, so the rule enters the rule map
35121
+ * already carrying the consumer's settings. Rewriting those rules
35122
+ * after the map was assembled — the previous approach — silently
35123
+ * discarded any `ruleExtensions` append or same-name `rules`
35124
+ * override that had already been merged in.
35088
35125
  */
35089
35126
  get pathAwareBundles() {
35090
35127
  if (!this.cachedBundles) {
@@ -35094,11 +35131,52 @@ var AgentConfig = class _AgentConfig extends Component8 {
35094
35131
  resolveDefaultAgentTier(this.options),
35095
35132
  resolveBundleAgentTiers(this.options),
35096
35133
  resolvePrReviewPolicy(this.options.prReviewPolicy),
35097
- resolveBuildPolicy(this.project)
35134
+ resolveBuildPolicy(this.project),
35135
+ this.resolvedRuleConventions
35098
35136
  );
35099
35137
  }
35100
35138
  return this.cachedBundles;
35101
35139
  }
35140
+ /**
35141
+ * Resolved settings for every config-driven convention rule, derived
35142
+ * from this project's options. Consumed by `buildBuiltInBundles` so
35143
+ * the `base` and `orchestrator` bundles seed final rule content.
35144
+ *
35145
+ * `excludeBundles` feeds two of these: the orchestrator's rendered
35146
+ * tier table / scope-gate overrides / scheduled-tasks registry drop
35147
+ * rows owned by excluded bundles, and the issue-templates rule falls
35148
+ * back to its disabled stub once every downstream-issue-kind bundle
35149
+ * has been excluded.
35150
+ */
35151
+ get resolvedRuleConventions() {
35152
+ const excludeBundles = this.options.excludeBundles ?? [];
35153
+ const orchestratorAssets = resolveOrchestratorAssets(
35154
+ this.options.tiers,
35155
+ this.options.scopeGate,
35156
+ this.options.runRatio,
35157
+ this.options.scheduledTasks,
35158
+ this.options.unblockDependents,
35159
+ excludeBundles
35160
+ );
35161
+ return {
35162
+ base: {
35163
+ progressFiles: resolveProgressFiles(this.options.progressFiles),
35164
+ sharedEditing: resolveSharedEditing(this.options.sharedEditing),
35165
+ temporalFraming: resolveTemporalFraming(this.options.temporalFraming),
35166
+ skillEvals: resolveSkillEvals(this.options.skillEvals),
35167
+ issueTemplates: resolveIssueTemplates(this.options.issueTemplates),
35168
+ hasDownstreamIssueKindBundles: hasAnyDownstreamIssueKindBundle(excludeBundles)
35169
+ },
35170
+ orchestrator: {
35171
+ tiers: orchestratorAssets.tiers,
35172
+ scopeGate: orchestratorAssets.scopeGate,
35173
+ runRatio: orchestratorAssets.runRatio,
35174
+ scheduledTasks: orchestratorAssets.scheduledTasks,
35175
+ unblockDependents: orchestratorAssets.unblockDependents,
35176
+ excludeBundles
35177
+ }
35178
+ };
35179
+ }
35102
35180
  /**
35103
35181
  * Returns the bundles that are active for this project: auto-detected
35104
35182
  * bundles (when `autoDetectBundles !== false`) plus force-included
@@ -35413,43 +35491,10 @@ ${section}`
35413
35491
  }
35414
35492
  }
35415
35493
  const excludedBundleNames = this.options.excludeBundles ?? [];
35416
- if (this.options.tiers || this.options.scopeGate || this.options.runRatio || this.options.scheduledTasks || this.options.unblockDependents || excludedBundleNames.length > 0) {
35417
- const orchestratorRule = ruleMap.get("orchestrator-conventions");
35418
- if (orchestratorRule) {
35419
- const { conventionsContent } = resolveOrchestratorAssets(
35420
- this.options.tiers,
35421
- this.options.scopeGate,
35422
- this.options.runRatio,
35423
- this.options.scheduledTasks,
35424
- this.options.unblockDependents,
35425
- excludedBundleNames
35426
- );
35427
- if (conventionsContent !== orchestratorRule.content) {
35428
- ruleMap.set("orchestrator-conventions", {
35429
- ...orchestratorRule,
35430
- content: conventionsContent
35431
- });
35432
- }
35433
- }
35434
- }
35435
35494
  const injectBundleHooks = this.options.claudeMd?.injectBundleHooks ?? true;
35436
35495
  const resolvedProgressFiles = resolveProgressFiles(
35437
35496
  this.options.progressFiles
35438
35497
  );
35439
- if (this.options.progressFiles) {
35440
- const progressRule = ruleMap.get("progress-file-convention");
35441
- if (progressRule) {
35442
- const progressContent = renderProgressFilesRuleContent(
35443
- resolvedProgressFiles
35444
- );
35445
- if (progressContent !== progressRule.content) {
35446
- ruleMap.set("progress-file-convention", {
35447
- ...progressRule,
35448
- content: progressContent
35449
- });
35450
- }
35451
- }
35452
- }
35453
35498
  if (injectBundleHooks && resolvedProgressFiles.enabled) {
35454
35499
  for (const [ruleName, label] of PROGRESS_FILE_BUNDLE_HOOKS) {
35455
35500
  const existing = ruleMap.get(ruleName);
@@ -35476,20 +35521,6 @@ ${hook}`
35476
35521
  const resolvedSharedEditingForRules = resolveSharedEditing(
35477
35522
  this.options.sharedEditing
35478
35523
  );
35479
- if (this.options.sharedEditing) {
35480
- const sharedEditingRule = ruleMap.get("shared-editing-safety");
35481
- if (sharedEditingRule) {
35482
- const sharedEditingContent = renderSharedEditingRuleContent(
35483
- resolvedSharedEditingForRules
35484
- );
35485
- if (sharedEditingContent !== sharedEditingRule.content) {
35486
- ruleMap.set("shared-editing-safety", {
35487
- ...sharedEditingRule,
35488
- content: sharedEditingContent
35489
- });
35490
- }
35491
- }
35492
- }
35493
35524
  if (injectBundleHooks && resolvedSharedEditingForRules.enabled) {
35494
35525
  for (const [ruleName, label] of SHARED_EDITING_BUNDLE_HOOKS) {
35495
35526
  const existing = ruleMap.get(ruleName);
@@ -35516,20 +35547,6 @@ ${hook}`
35516
35547
  const resolvedSkillEvalsForRules = resolveSkillEvals(
35517
35548
  this.options.skillEvals
35518
35549
  );
35519
- if (this.options.skillEvals) {
35520
- const skillEvalsRule = ruleMap.get("skill-evals");
35521
- if (skillEvalsRule) {
35522
- const skillEvalsContent = renderSkillEvalsRuleContent(
35523
- resolvedSkillEvalsForRules
35524
- );
35525
- if (skillEvalsContent !== skillEvalsRule.content) {
35526
- ruleMap.set("skill-evals", {
35527
- ...skillEvalsRule,
35528
- content: skillEvalsContent
35529
- });
35530
- }
35531
- }
35532
- }
35533
35550
  if (injectBundleHooks && resolvedSkillEvalsForRules.enabled) {
35534
35551
  for (const [ruleName, label] of SKILL_EVALS_BUNDLE_HOOKS) {
35535
35552
  const existing = ruleMap.get(ruleName);
@@ -35557,21 +35574,6 @@ ${hook}`
35557
35574
  this.options.issueTemplates
35558
35575
  );
35559
35576
  const hasDownstreamBundles = hasAnyDownstreamIssueKindBundle(excludedBundleNames);
35560
- if (this.options.issueTemplates || !hasDownstreamBundles) {
35561
- const issueTemplatesRule = ruleMap.get("issue-templates-convention");
35562
- if (issueTemplatesRule) {
35563
- const issueTemplatesContent = renderIssueTemplatesRuleContent(
35564
- resolvedIssueTemplatesForRules,
35565
- hasDownstreamBundles
35566
- );
35567
- if (issueTemplatesContent !== issueTemplatesRule.content) {
35568
- ruleMap.set("issue-templates-convention", {
35569
- ...issueTemplatesRule,
35570
- content: issueTemplatesContent
35571
- });
35572
- }
35573
- }
35574
- }
35575
35577
  if (injectBundleHooks && resolvedIssueTemplatesForRules.enabled && hasDownstreamBundles) {
35576
35578
  for (const [ruleName, label] of ISSUE_TEMPLATES_BUNDLE_HOOKS) {
35577
35579
  const existing = ruleMap.get(ruleName);
@@ -35595,23 +35597,6 @@ ${hook}`
35595
35597
  });
35596
35598
  }
35597
35599
  }
35598
- const resolvedTemporalFramingForRules = resolveTemporalFraming(
35599
- this.options.temporalFraming
35600
- );
35601
- if (this.options.temporalFraming) {
35602
- const temporalFramingRule = ruleMap.get("temporal-framing-convention");
35603
- if (temporalFramingRule) {
35604
- const temporalFramingContent = renderTemporalFramingRuleContent(
35605
- resolvedTemporalFramingForRules
35606
- );
35607
- if (temporalFramingContent !== temporalFramingRule.content) {
35608
- ruleMap.set("temporal-framing-convention", {
35609
- ...temporalFramingRule,
35610
- content: temporalFramingContent
35611
- });
35612
- }
35613
- }
35614
- }
35615
35600
  const tierExamples = this.options.features?.sourceTierExamples;
35616
35601
  if (_AgentConfig.hasActiveTierExamples(tierExamples)) {
35617
35602
  const sourceRule = ruleMap.get("source-quality-verification");
@@ -41836,6 +41821,7 @@ export {
41836
41821
  DEFAULT_API_EXTRACTOR_REPORT_FILENAME,
41837
41822
  DEFAULT_API_EXTRACTOR_REPORT_FOLDER,
41838
41823
  DEFAULT_AUDIT_REPORT_DIR,
41824
+ DEFAULT_BASE_CONVENTIONS,
41839
41825
  DEFAULT_BUILD_POLICY,
41840
41826
  DEFAULT_BUNDLE_OVERRIDES,
41841
41827
  DEFAULT_DECOMPOSITION_TEMPLATE,
@@ -41852,6 +41838,7 @@ export {
41852
41838
  DEFAULT_ISSUE_TEMPLATES_PATH,
41853
41839
  DEFAULT_ISSUE_TEMPLATES_REQUIRE_REFERENCE,
41854
41840
  DEFAULT_OFF_PEAK_CRON_EXAMPLE,
41841
+ DEFAULT_ORCHESTRATOR_CONVENTIONS,
41855
41842
  DEFAULT_PARTIAL_UNBLOCK_COMMENT_TEMPLATE,
41856
41843
  DEFAULT_PATHS_EXEMPT_FROM_SIZE,
41857
41844
  DEFAULT_PRIORITY_LABELS,
@@ -41864,6 +41851,7 @@ export {
41864
41851
  DEFAULT_REQUIREMENT_CATEGORY_DIRS,
41865
41852
  DEFAULT_REQUIRE_PRODUCT_CONTEXT,
41866
41853
  DEFAULT_RESOLVED_ISSUE_DEFAULTS,
41854
+ DEFAULT_RULE_CONVENTIONS,
41867
41855
  DEFAULT_SAMPLE_COMPILER_OPTIONS,
41868
41856
  DEFAULT_SCHEDULED_TASKS_ROOT,
41869
41857
  DEFAULT_SCHEDULED_TASK_ENTRIES,
@@ -41967,6 +41955,7 @@ export {
41967
41955
  buildIndustryDiscoveryBundle,
41968
41956
  buildMaintenanceAuditBundle,
41969
41957
  buildMeetingAnalysisBundle,
41958
+ buildOrchestratorBundle,
41970
41959
  buildOrchestratorConventionsContent,
41971
41960
  buildPeopleProfileBundle,
41972
41961
  buildPrReviewBundle,