@ethlete/agent-rules 0.1.0-next.5 → 0.1.0-next.7

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +175 -4
  3. package/content/git-hooks/post-checkout.sh +10 -0
  4. package/content/git-hooks/pre-push.sh +5 -0
  5. package/content/hooks/context-warning.py +39 -11
  6. package/content/skills/git-commit/SKILL.md +6 -7
  7. package/content/skills/git-flow/SKILL.md +83 -0
  8. package/content/skills/handoff/SKILL.md +4 -0
  9. package/content/skills/query/SKILL.md +17 -13
  10. package/package.json +12 -1
  11. package/src/index.js +11 -10
  12. package/src/index.js.map +1 -1
  13. package/src/lib/commitlint.d.ts +10 -0
  14. package/src/lib/commitlint.js +51 -0
  15. package/src/lib/commitlint.js.map +1 -0
  16. package/src/lib/config.d.ts +28 -0
  17. package/src/lib/config.js +21 -3
  18. package/src/lib/config.js.map +1 -1
  19. package/src/lib/git-flow/build.d.ts +35 -0
  20. package/src/lib/git-flow/build.js +24 -0
  21. package/src/lib/git-flow/build.js.map +1 -0
  22. package/src/lib/git-flow/config.d.ts +59 -0
  23. package/src/lib/git-flow/config.js +50 -0
  24. package/src/lib/git-flow/config.js.map +1 -0
  25. package/src/lib/git-flow/index.d.ts +5 -0
  26. package/src/lib/git-flow/index.js +9 -0
  27. package/src/lib/git-flow/index.js.map +1 -0
  28. package/src/lib/git-flow/parse.d.ts +49 -0
  29. package/src/lib/git-flow/parse.js +274 -0
  30. package/src/lib/git-flow/parse.js.map +1 -0
  31. package/src/lib/git-flow/start.d.ts +22 -0
  32. package/src/lib/git-flow/start.js +24 -0
  33. package/src/lib/git-flow/start.js.map +1 -0
  34. package/src/lib/git-flow/validate.d.ts +34 -0
  35. package/src/lib/git-flow/validate.js +72 -0
  36. package/src/lib/git-flow/validate.js.map +1 -0
  37. package/src/lib/git-flow-command.d.ts +4 -0
  38. package/src/lib/git-flow-command.js +157 -0
  39. package/src/lib/git-flow-command.js.map +1 -0
  40. package/src/lib/git-flow-repair.d.ts +17 -0
  41. package/src/lib/git-flow-repair.js +150 -0
  42. package/src/lib/git-flow-repair.js.map +1 -0
  43. package/src/lib/git-flow-start.d.ts +20 -0
  44. package/src/lib/git-flow-start.js +147 -0
  45. package/src/lib/git-flow-start.js.map +1 -0
  46. package/src/lib/git.d.ts +27 -0
  47. package/src/lib/git.js +49 -0
  48. package/src/lib/git.js.map +1 -0
  49. package/src/lib/gitlab.d.ts +35 -0
  50. package/src/lib/gitlab.js +98 -0
  51. package/src/lib/gitlab.js.map +1 -0
  52. package/src/lib/jira.d.ts +28 -0
  53. package/src/lib/jira.js +83 -0
  54. package/src/lib/jira.js.map +1 -0
  55. package/src/lib/plan.d.ts +0 -1
  56. package/src/lib/plan.js +20 -4
  57. package/src/lib/plan.js.map +1 -1
  58. package/src/lib/prompt.d.ts +8 -0
  59. package/src/lib/prompt.js +27 -0
  60. package/src/lib/prompt.js.map +1 -0
  61. package/src/lib/render.d.ts +20 -2
  62. package/src/lib/render.js +31 -8
  63. package/src/lib/render.js.map +1 -1
  64. package/src/lib/sync.d.ts +0 -1
  65. package/src/lib/sync.js +2 -2
  66. package/src/lib/sync.js.map +1 -1
  67. package/src/lib/targets/claude-hooks.js +1 -1
  68. package/src/lib/targets/claude-hooks.js.map +1 -1
  69. package/src/lib/targets/claude.js +1 -1
  70. package/src/lib/targets/claude.js.map +1 -1
  71. package/src/lib/targets/codex-hooks.js +1 -1
  72. package/src/lib/targets/codex-hooks.js.map +1 -1
  73. package/src/lib/targets/codex.js +1 -1
  74. package/src/lib/targets/codex.js.map +1 -1
  75. package/src/lib/targets/copilot.js +1 -1
  76. package/src/lib/targets/copilot.js.map +1 -1
  77. package/src/lib/targets/cursor.js +1 -1
  78. package/src/lib/targets/cursor.js.map +1 -1
  79. package/src/lib/targets/git-hooks.d.ts +24 -0
  80. package/src/lib/targets/git-hooks.js +70 -0
  81. package/src/lib/targets/git-hooks.js.map +1 -0
  82. package/src/lib/targets/hooks-shared.d.ts +0 -1
  83. package/src/lib/targets/hooks-shared.js +7 -7
  84. package/src/lib/targets/hooks-shared.js.map +1 -1
  85. package/src/lib/targets/shared.d.ts +0 -1
  86. package/src/lib/targets/shared.js +1 -1
  87. package/src/lib/targets/shared.js.map +1 -1
@@ -0,0 +1,10 @@
1
+ /** The file that validates commit messages, as the skill should name it, or `null` when none does. */
2
+ export type CommitlintSource = string | null;
3
+ export declare const findCommitlintConfig: (root: string) => CommitlintSource;
4
+ /**
5
+ * The git-commit skill states where its format comes from, and whether a message can be verified,
6
+ * from what the repo actually has. Promising a `commitlint` run to a repo without one makes the
7
+ * agent narrate the contradiction it finds instead of just writing the commit — so a repo with no
8
+ * commitlint gets a guide that never mentions it.
9
+ */
10
+ export declare const commitMessageVars: (source: CommitlintSource) => Record<string, string>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commitMessageVars = exports.findCommitlintConfig = void 0;
4
+ const fs_1 = require("fs");
5
+ const path_1 = require("path");
6
+ const COMMITLINT_CONFIG_FILES = [
7
+ 'commitlint.config.js',
8
+ 'commitlint.config.cjs',
9
+ 'commitlint.config.mjs',
10
+ 'commitlint.config.ts',
11
+ 'commitlint.config.mts',
12
+ 'commitlint.config.json',
13
+ 'commitlint.config.yaml',
14
+ 'commitlint.config.yml',
15
+ '.commitlintrc',
16
+ '.commitlintrc.js',
17
+ '.commitlintrc.cjs',
18
+ '.commitlintrc.mjs',
19
+ '.commitlintrc.ts',
20
+ '.commitlintrc.json',
21
+ '.commitlintrc.yaml',
22
+ '.commitlintrc.yml',
23
+ ];
24
+ const findCommitlintConfig = (root) => {
25
+ const configFile = COMMITLINT_CONFIG_FILES.find((name) => (0, fs_1.existsSync)((0, path_1.join)(root, name)));
26
+ if (configFile)
27
+ return configFile;
28
+ const manifestPath = (0, path_1.join)(root, 'package.json');
29
+ if (!(0, fs_1.existsSync)(manifestPath))
30
+ return null;
31
+ const manifest = JSON.parse((0, fs_1.readFileSync)(manifestPath, 'utf8'));
32
+ return manifest.commitlint ? 'package.json' : null;
33
+ };
34
+ exports.findCommitlintConfig = findCommitlintConfig;
35
+ /**
36
+ * The git-commit skill states where its format comes from, and whether a message can be verified,
37
+ * from what the repo actually has. Promising a `commitlint` run to a repo without one makes the
38
+ * agent narrate the contradiction it finds instead of just writing the commit — so a repo with no
39
+ * commitlint gets a guide that never mentions it.
40
+ */
41
+ const commitMessageVars = (source) => source
42
+ ? {
43
+ commitRuleSource: `the **commitlint rules** in \`${source}\` - conventional commits with a required scope`,
44
+ commitValidation: 'When unsure a message passes, check it: `echo "<msg>" | npx commitlint`.',
45
+ }
46
+ : {
47
+ commitRuleSource: "this repo's **conventional-commit** convention",
48
+ commitValidation: 'Nothing checks the message once it is written, so get the type, scope and subject case right the first time.',
49
+ };
50
+ exports.commitMessageVars = commitMessageVars;
51
+ //# sourceMappingURL=commitlint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commitlint.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/commitlint.ts"],"names":[],"mappings":";;;AAAA,2BAA8C;AAC9C,+BAA4B;AAK5B,MAAM,uBAAuB,GAAG;IAC9B,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;IACvB,sBAAsB;IACtB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,eAAe;IACf,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,oBAAoB;IACpB,mBAAmB;CACpB,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAoB,EAAE;IACrE,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,eAAU,EAAC,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAExF,IAAI,UAAU;QAAE,OAAO,UAAU,CAAC;IAElC,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEhD,IAAI,CAAC,IAAA,eAAU,EAAC,YAAY,CAAC;QAAE,OAAO,IAAI,CAAC;IAE3C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,YAAY,EAAE,MAAM,CAAC,CAA6B,CAAC;IAE5F,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEF;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAAC,MAAwB,EAA0B,EAAE,CACpF,MAAM;IACJ,CAAC,CAAC;QACE,gBAAgB,EAAE,iCAAiC,MAAM,iDAAiD;QAC1G,gBAAgB,EAAE,0EAA0E;KAC7F;IACH,CAAC,CAAC;QACE,gBAAgB,EAAE,gDAAgD;QAClE,gBAAgB,EACd,8GAA8G;KACjH,CAAC;AAVK,QAAA,iBAAiB,qBAUtB"}
@@ -1,8 +1,23 @@
1
1
  import { ContentScope } from './frontmatter';
2
+ import { GitFlowConfig } from './git-flow';
2
3
  export declare const AGENT_TARGETS: readonly ["claude", "codex", "cursor", "copilot"];
3
4
  export type AgentTarget = (typeof AGENT_TARGETS)[number];
4
5
  export declare const CONFIG_FILE_NAME = "ethlete-agents.config.json";
5
6
  export declare const LOCAL_CONFIG_FILE_NAME = "ethlete-agents.config.local.json";
7
+ /**
8
+ * Non-secret Jira wiring, committed with the repo — `git-flow start` resolves an issue key through
9
+ * it. Credentials never live here; they come from the environment or the gitignored local config.
10
+ */
11
+ export type JiraSettings = {
12
+ host?: string;
13
+ /**
14
+ * The instance's field holding a Story's branch subject (`customfield_10050`). Without it the
15
+ * summary is slugified instead, which is a paraphrase rather than the agreed subject.
16
+ */
17
+ subjectField?: string;
18
+ /** Branch type per Jira issue type, e.g. `{ "Bug": "fix" }`. Anything unlisted becomes `feat`. */
19
+ typeByIssueType?: Record<string, string>;
20
+ };
6
21
  export type SyncConfig = {
7
22
  root: string;
8
23
  targets: AgentTarget[];
@@ -18,6 +33,11 @@ export type SyncConfig = {
18
33
  claudeMdImportsAgentsMd: boolean;
19
34
  /** Opt-in agent hooks (they run commands on the developer's machine, so never default). */
20
35
  hooks: string[];
36
+ /** Opt-in git hooks, appended to the repo's own husky hooks. Same reason they never default. */
37
+ gitHooks: string[];
38
+ /** The branch grammar, resolved against its defaults — see `@ethlete/agent-rules/git-flow`. */
39
+ gitFlow: GitFlowConfig;
40
+ jira: JiraSettings;
21
41
  };
22
42
  /**
23
43
  * The gitignored local config holds per-machine values, read at runtime — by the generated hook
@@ -31,11 +51,19 @@ export type SyncConfig = {
31
51
  * a handoff instead of writing the handoff file automatically.
32
52
  * - `sdkSourcePath` points at a local `ethlete-sdk` checkout, which the SDK source and local-build
33
53
  * skills read when they need the SDK's own sources instead of the published package.
54
+ * - `jira` holds the per-user Jira credentials `git-flow start` needs. This is the one place in the
55
+ * repo a secret may sit, and only because the file is gitignored; `JIRA_EMAIL`/`JIRA_API_TOKEN`
56
+ * in the environment are the alternative.
34
57
  */
35
58
  export type LocalConfig = {
36
59
  disableHooks?: boolean | string[];
37
60
  disableAutoHandoffSave?: boolean;
38
61
  sdkSourcePath?: string;
62
+ jira?: {
63
+ host?: string;
64
+ email?: string;
65
+ token?: string;
66
+ };
39
67
  };
40
68
  export type LocalConfigState = {
41
69
  exists: false;
package/src/lib/config.js CHANGED
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadConfig = exports.detectTargets = exports.readLocalConfig = exports.LOCAL_CONFIG_FILE_NAME = exports.CONFIG_FILE_NAME = exports.AGENT_TARGETS = void 0;
4
4
  const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
+ const commitlint_1 = require("./commitlint");
7
+ const git_flow_1 = require("./git-flow");
6
8
  const load_content_1 = require("./load-content");
7
9
  exports.AGENT_TARGETS = ['claude', 'codex', 'cursor', 'copilot'];
8
10
  exports.CONFIG_FILE_NAME = 'ethlete-agents.config.json';
@@ -13,7 +15,7 @@ const readRawConfig = (root) => {
13
15
  return {};
14
16
  return JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
15
17
  };
16
- const LOCAL_CONFIG_KEYS = ['disableHooks', 'disableAutoHandoffSave', 'sdkSourcePath'];
18
+ const LOCAL_CONFIG_KEYS = ['disableHooks', 'disableAutoHandoffSave', 'sdkSourcePath', 'jira'];
17
19
  const readLocalConfig = (root) => {
18
20
  const path = (0, path_1.join)(root, exports.LOCAL_CONFIG_FILE_NAME);
19
21
  if (!(0, fs_1.existsSync)(path))
@@ -55,21 +57,37 @@ const assertKnownTargets = (targets) => {
55
57
  throw new Error(`Unknown target(s): ${unknown.join(', ')}. Known targets: ${exports.AGENT_TARGETS.join(', ')}.`);
56
58
  }
57
59
  };
60
+ /**
61
+ * The git-flow skill interpolates the grammar it teaches from the same `gitFlow` block the
62
+ * validator reads, so the documented convention cannot drift from the enforced one. A repo can
63
+ * still override any of these through `vars`.
64
+ */
65
+ const gitFlowVars = (gitFlow) => ({
66
+ gitFlowDevelopmentBranch: gitFlow.baseBranches.development,
67
+ gitFlowProductionBranch: gitFlow.baseBranches.production,
68
+ gitFlowTypes: gitFlow.types,
69
+ gitFlowEnforcement: gitFlow.enforcement,
70
+ gitFlowSubPrefix: gitFlow.subPrefix,
71
+ });
58
72
  const loadConfig = (options) => {
59
- var _a, _b, _c, _d, _e;
73
+ var _a, _b, _c, _d, _e, _f, _g;
60
74
  const { root, targetOverride } = options;
61
75
  const raw = readRawConfig(root);
62
76
  const configured = raw.targets && raw.targets !== 'auto' ? raw.targets : undefined;
63
77
  const targets = (_a = targetOverride !== null && targetOverride !== void 0 ? targetOverride : configured) !== null && _a !== void 0 ? _a : (0, exports.detectTargets)(root);
78
+ const gitFlow = (0, git_flow_1.resolveGitFlowConfig)(raw.gitFlow);
64
79
  assertKnownTargets(targets);
65
80
  return {
66
81
  root,
67
82
  targets,
68
83
  scopes: raw.profile === 'sdk' ? ['both'] : ['consumer', 'both'],
69
- vars: Object.assign(Object.assign({}, (0, load_content_1.loadDefaultVars)()), ((_b = raw.vars) !== null && _b !== void 0 ? _b : {})),
84
+ vars: Object.assign(Object.assign(Object.assign(Object.assign({}, (0, load_content_1.loadDefaultVars)()), gitFlowVars(gitFlow)), (0, commitlint_1.commitMessageVars)((0, commitlint_1.findCommitlintConfig)(root))), ((_b = raw.vars) !== null && _b !== void 0 ? _b : {})),
70
85
  exclude: (_c = raw.exclude) !== null && _c !== void 0 ? _c : [],
71
86
  claudeMdImportsAgentsMd: (_d = raw.claudeMdImportsAgentsMd) !== null && _d !== void 0 ? _d : false,
72
87
  hooks: (_e = raw.hooks) !== null && _e !== void 0 ? _e : [],
88
+ gitHooks: (_f = raw.gitHooks) !== null && _f !== void 0 ? _f : [],
89
+ gitFlow,
90
+ jira: (_g = raw.jira) !== null && _g !== void 0 ? _g : {},
73
91
  };
74
92
  };
75
93
  exports.loadConfig = loadConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/config.ts"],"names":[],"mappings":";;;AAAA,2BAA8C;AAC9C,+BAA4B;AAE5B,iDAAiD;AAEpC,QAAA,aAAa,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAIlE,QAAA,gBAAgB,GAAG,4BAA4B,CAAC;AAEhD,QAAA,sBAAsB,GAAG,kCAAkC,CAAC;AA4BzE,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IACrC,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,wBAAgB,CAAC,CAAC;IAE1C,IAAI,CAAC,IAAA,eAAU,EAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjC,OAAO,I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A1BW,QAAA,UAAU,cA0BrB"}
@@ -0,0 +1,35 @@
1
+ import { GitFlowConfig } from './config';
2
+ export declare const slugifySubject: (subject: string) => string;
3
+ /**
4
+ * `parent` is the full branch name the new branch nests under — `feat/FIP-2177-user-management`
5
+ * for a sub-feature, `release/2026.04.28` for a release fix. The nested name keeps that whole path
6
+ * under the config's `subPrefix`, so the parent stays derivable from the child.
7
+ */
8
+ export type BranchNameSpec = {
9
+ kind: 'main-feature';
10
+ type?: string;
11
+ key: string;
12
+ subject: string;
13
+ } | {
14
+ kind: 'sub-feature';
15
+ parent: string;
16
+ key: string;
17
+ subject: string;
18
+ } | {
19
+ kind: 'release';
20
+ date: string;
21
+ } | {
22
+ kind: 'release-fix';
23
+ parent: string;
24
+ key: string;
25
+ subject: string;
26
+ } | {
27
+ kind: 'hotfix';
28
+ key: string;
29
+ subject: string;
30
+ };
31
+ /** Builds a conforming branch name from the grammar. The single naming implementation. */
32
+ export declare const buildBranchName: (options: {
33
+ spec: BranchNameSpec;
34
+ config: GitFlowConfig;
35
+ }) => string;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBranchName = exports.slugifySubject = void 0;
4
+ const slugifySubject = (subject) => subject
5
+ .trim()
6
+ .toLowerCase()
7
+ .replace(/[^a-z0-9]+/g, '-')
8
+ .replace(/^-+|-+$/g, '');
9
+ exports.slugifySubject = slugifySubject;
10
+ /** Builds a conforming branch name from the grammar. The single naming implementation. */
11
+ const buildBranchName = (options) => {
12
+ var _a;
13
+ const { spec, config } = options;
14
+ if (spec.kind === 'release')
15
+ return `${config.releasePrefix}/${spec.date}`;
16
+ const leaf = [spec.key.toUpperCase(), (0, exports.slugifySubject)(spec.subject)].filter(Boolean).join('-');
17
+ if (spec.kind === 'main-feature')
18
+ return `${(_a = spec.type) !== null && _a !== void 0 ? _a : 'feat'}/${leaf}`;
19
+ if (spec.kind === 'hotfix')
20
+ return `${config.hotfixPrefix}/${leaf}`;
21
+ return `${config.subPrefix}/${spec.parent}/${leaf}`;
22
+ };
23
+ exports.buildBranchName = buildBranchName;
24
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/git-flow/build.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,EAAE,CAChD,OAAO;KACJ,IAAI,EAAE;KACN,WAAW,EAAE;KACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;KAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AALhB,QAAA,cAAc,kBAKE;AAc7B,0FAA0F;AACnF,MAAM,eAAe,GAAG,CAAC,OAAwD,EAAE,EAAE;;IAC1F,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEjC,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,GAAG,MAAM,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IAE3E,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAA,sBAAc,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE9F,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc;QAAE,OAAO,GAAG,MAAA,IAAI,CAAC,IAAI,mCAAI,MAAM,IAAI,IAAI,EAAE,CAAC;IAC1E,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,GAAG,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;IAEpE,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;AACtD,CAAC,CAAC;AAXW,QAAA,eAAe,mBAW1B"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The branch grammar as data: one config drives the parser, the validators, the CLI, the generated
3
+ * skill and `@ethlete/timetrack`'s correlation engine.
4
+ *
5
+ * Nothing in this folder may import `fs`, `path` or `process`, or take a dependency — it is
6
+ * reachable as `@ethlete/agent-rules/git-flow` and gets bundled into a browser webview.
7
+ */
8
+ export declare const GIT_FLOW_RULES: readonly ["unknown-type", "missing-key", "key-case", "missing-subject", "type-alias", "deprecated-prefix", "release-date", "wrong-mr-target", "protected-push"];
9
+ export type GitFlowRule = (typeof GIT_FLOW_RULES)[number];
10
+ export type GitFlowSeverity = 'off' | 'warn' | 'error';
11
+ export type GitFlowEnforcement = 'advisory' | 'gated';
12
+ export type GitFlowBranchKind = 'main-feature' | 'sub-feature' | 'release' | 'release-fix' | 'hotfix' | 'protected' | 'unknown';
13
+ /**
14
+ * A legacy spelling that means one of the known kinds. `match` is a regular expression whose
15
+ * `subject` and `key` named groups feed `renameTo`, in which `<subject>` and `<KEY>` are the
16
+ * placeholders — an unresolved `<KEY>` is left in place, because only Jira can supply it.
17
+ */
18
+ export type GitFlowDeprecatedShape = {
19
+ match: string;
20
+ kind: GitFlowBranchKind;
21
+ renameTo: string;
22
+ };
23
+ export type GitFlowConfig = {
24
+ enforcement: GitFlowEnforcement;
25
+ /**
26
+ * The segment a nested branch is prefixed with. Git refuses a ref that is both a branch and a
27
+ * directory of branches, so a sub-feature cannot be spelled `<parent>/<KEY>-<subject>` while its
28
+ * parent exists — the push is rejected with "refname conflict". The prefix moves the whole nested
29
+ * tree out of the way while keeping the parent's full path inside the child's name.
30
+ */
31
+ subPrefix: string;
32
+ keyPattern: string;
33
+ /**
34
+ * Project prefixes a key may use, e.g. `["FIP"]`. Empty accepts anything `keyPattern` matches,
35
+ * which also accepts `chore/angular-22` as issue ANGULAR-22 — set this in any repo whose
36
+ * branch subjects can start with a word followed by a number.
37
+ */
38
+ keyPrefixes: string[];
39
+ baseBranches: {
40
+ development: string;
41
+ production: string;
42
+ };
43
+ types: string[];
44
+ typeAliases: Record<string, string>;
45
+ releasePrefix: string;
46
+ releasePattern: string;
47
+ hotfixPrefix: string;
48
+ subjectCase: 'kebab';
49
+ deprecatedShapes: GitFlowDeprecatedShape[];
50
+ severity: Record<GitFlowRule, GitFlowSeverity>;
51
+ };
52
+ export declare const DEFAULT_GIT_FLOW_CONFIG: GitFlowConfig;
53
+ export type RawGitFlowConfig = Partial<Omit<GitFlowConfig, 'baseBranches' | 'typeAliases' | 'severity'>> & {
54
+ baseBranches?: Partial<GitFlowConfig['baseBranches']>;
55
+ typeAliases?: Record<string, string>;
56
+ severity?: Partial<Record<GitFlowRule, GitFlowSeverity>>;
57
+ };
58
+ /** Fills a repo's `gitFlow` config block out to a complete grammar. */
59
+ export declare const resolveGitFlowConfig: (raw?: RawGitFlowConfig) => GitFlowConfig;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /**
3
+ * The branch grammar as data: one config drives the parser, the validators, the CLI, the generated
4
+ * skill and `@ethlete/timetrack`'s correlation engine.
5
+ *
6
+ * Nothing in this folder may import `fs`, `path` or `process`, or take a dependency — it is
7
+ * reachable as `@ethlete/agent-rules/git-flow` and gets bundled into a browser webview.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.resolveGitFlowConfig = exports.DEFAULT_GIT_FLOW_CONFIG = exports.GIT_FLOW_RULES = void 0;
11
+ exports.GIT_FLOW_RULES = [
12
+ 'unknown-type',
13
+ 'missing-key',
14
+ 'key-case',
15
+ 'missing-subject',
16
+ 'type-alias',
17
+ 'deprecated-prefix',
18
+ 'release-date',
19
+ 'wrong-mr-target',
20
+ 'protected-push',
21
+ ];
22
+ exports.DEFAULT_GIT_FLOW_CONFIG = {
23
+ enforcement: 'advisory',
24
+ subPrefix: 'sub',
25
+ keyPattern: '[A-Z]{2,10}-\\d+',
26
+ keyPrefixes: [],
27
+ baseBranches: { development: 'next', production: 'main' },
28
+ types: ['feat', 'fix', 'refactor', 'chore', 'docs', 'perf', 'test', 'style', 'build', 'ci'],
29
+ typeAliases: { feature: 'feat', bugfix: 'fix' },
30
+ releasePrefix: 'release',
31
+ releasePattern: '\\d{4}\\.\\d{2}\\.\\d{2}',
32
+ hotfixPrefix: 'hotfix',
33
+ subjectCase: 'kebab',
34
+ deprecatedShapes: [{ match: '^dev-(?<subject>.+)$', kind: 'main-feature', renameTo: 'feat/<KEY>-<subject>' }],
35
+ severity: {
36
+ 'unknown-type': 'warn',
37
+ 'missing-key': 'warn',
38
+ 'key-case': 'warn',
39
+ 'missing-subject': 'warn',
40
+ 'type-alias': 'warn',
41
+ 'deprecated-prefix': 'warn',
42
+ 'release-date': 'warn',
43
+ 'wrong-mr-target': 'warn',
44
+ 'protected-push': 'error',
45
+ },
46
+ };
47
+ /** Fills a repo's `gitFlow` config block out to a complete grammar. */
48
+ const resolveGitFlowConfig = (raw) => (Object.assign(Object.assign(Object.assign({}, exports.DEFAULT_GIT_FLOW_CONFIG), raw), { baseBranches: Object.assign(Object.assign({}, exports.DEFAULT_GIT_FLOW_CONFIG.baseBranches), raw === null || raw === void 0 ? void 0 : raw.baseBranches), typeAliases: Object.assign(Object.assign({}, exports.DEFAULT_GIT_FLOW_CONFIG.typeAliases), raw === null || raw === void 0 ? void 0 : raw.typeAliases), severity: Object.assign(Object.assign({}, exports.DEFAULT_GIT_FLOW_CONFIG.severity), raw === null || raw === void 0 ? void 0 : raw.severity) }));
49
+ exports.resolveGitFlowConfig = resolveGitFlowConfig;
50
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/git-flow/config.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEU,QAAA,cAAc,GAAG;IAC5B,cAAc;IACd,aAAa;IACb,UAAU;IACV,iBAAiB;IACjB,YAAY;IACZ,mBAAmB;IACnB,cAAc;IACd,iBAAiB;IACjB,gBAAgB;CACR,CAAC;AAiDE,QAAA,uBAAuB,GAAkB;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,CAAE,QAAQ,KACjE,CAAC;AANU,QAAA,oBAAoB,wBAM9B"}
@@ -0,0 +1,5 @@
1
+ export * from './build';
2
+ export * from './config';
3
+ export * from './parse';
4
+ export * from './start';
5
+ export * from './validate';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./build"), exports);
5
+ tslib_1.__exportStar(require("./config"), exports);
6
+ tslib_1.__exportStar(require("./parse"), exports);
7
+ tslib_1.__exportStar(require("./start"), exports);
8
+ tslib_1.__exportStar(require("./validate"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/git-flow/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,qDAA2B"}
@@ -0,0 +1,49 @@
1
+ import { GitFlowBranchKind, GitFlowConfig, GitFlowRule } from './config';
2
+ export type GitFlowFinding = {
3
+ rule: GitFlowRule;
4
+ message: string;
5
+ /** The conforming spelling, when it can be derived without asking Jira for an issue key. */
6
+ suggestion?: string;
7
+ };
8
+ export type BranchParseResult = {
9
+ branch: string;
10
+ /** True only for a fully conforming name — an alias or a lowercase key still parses, but is not `ok`. */
11
+ ok: boolean;
12
+ kind: GitFlowBranchKind;
13
+ /** The normalized type segment (`feature/` resolves to `feat`). */
14
+ type?: string;
15
+ storyKey?: string;
16
+ taskKey?: string;
17
+ /** The most specific issue the branch names — what time should be logged against. */
18
+ issueKey?: string;
19
+ subject?: string;
20
+ /** The branch this one nests under, for a sub-feature or a release fix. */
21
+ parent?: string;
22
+ /** The branch matched a `deprecatedShapes` entry, so it should be excluded from adoption reports. */
23
+ deprecated: boolean;
24
+ expectedBase?: string;
25
+ expectedMrTargets: string[];
26
+ /** Set by `resolveThroughBase` when the story key came from the base branch rather than this name. */
27
+ inheritedFrom?: string;
28
+ suggestedName?: string;
29
+ findings: GitFlowFinding[];
30
+ };
31
+ export declare const stripRefPrefix: (ref: string) => string;
32
+ /**
33
+ * Classifies a branch name against the grammar. Never throws: an unrecognised name comes back as
34
+ * `kind: 'unknown'` with findings, so the validator and timetrack's correlation engine can read
35
+ * the same result for different purposes.
36
+ */
37
+ export declare const parseBranch: (options: {
38
+ branch: string;
39
+ config: GitFlowConfig;
40
+ }) => BranchParseResult;
41
+ /**
42
+ * Attributes a keyless branch through the branch it is based on. Reviewed branches land in an
43
+ * integration branch, so a flat name like `feat/logout-confirmation` usually has a parent that
44
+ * does carry the story key. Deterministic — no model involved.
45
+ */
46
+ export declare const resolveThroughBase: (options: {
47
+ branch: BranchParseResult;
48
+ base: BranchParseResult;
49
+ }) => BranchParseResult;