@open-agent-toolkit/cli 0.2.16 → 0.2.18

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 (33) hide show
  1. package/assets/docs/cli-utilities/config-and-local-state.md +3 -1
  2. package/assets/docs/cli-utilities/tool-packs.md +2 -0
  3. package/assets/docs/reference/oat-directory-structure.md +5 -1
  4. package/assets/public-package-versions.json +4 -4
  5. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +3 -3
  6. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +3 -3
  7. package/assets/skills/oat-project-implement/SKILL.md +12 -4
  8. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +5 -2
  9. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +3 -3
  10. package/assets/skills/oat-project-implement/references/phase-execution.md +23 -4
  11. package/assets/skills/oat-project-import-plan/SKILL.md +8 -5
  12. package/assets/skills/oat-project-new/SKILL.md +8 -5
  13. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +3 -3
  14. package/assets/skills/oat-project-quick-start/SKILL.md +13 -8
  15. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +3 -3
  16. package/dist/commands/decision/agents-guidance.d.ts +15 -0
  17. package/dist/commands/decision/agents-guidance.d.ts.map +1 -0
  18. package/dist/commands/decision/agents-guidance.js +51 -0
  19. package/dist/commands/decision/index.d.ts +2 -0
  20. package/dist/commands/decision/index.d.ts.map +1 -1
  21. package/dist/commands/decision/index.js +15 -1
  22. package/dist/commands/gate/index.d.ts.map +1 -1
  23. package/dist/commands/gate/index.js +95 -3
  24. package/dist/commands/init/tools/index.d.ts.map +1 -1
  25. package/dist/commands/init/tools/index.js +9 -0
  26. package/dist/commands/init/tools/project-management/agents-guidance.d.ts.map +1 -1
  27. package/dist/commands/init/tools/project-management/agents-guidance.js +0 -6
  28. package/dist/commands/init/tools/project-management/index.d.ts.map +1 -1
  29. package/dist/commands/init/tools/project-management/index.js +15 -6
  30. package/dist/commands/pjm/init.d.ts +1 -1
  31. package/dist/commands/pjm/init.d.ts.map +1 -1
  32. package/dist/commands/pjm/init.js +9 -1
  33. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { spawn } from 'node:child_process';
1
+ import { execFileSync, spawn } from 'node:child_process';
2
2
  import { createHash, randomUUID } from 'node:crypto';
3
3
  import { mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises';
4
4
  import { tmpdir } from 'node:os';
@@ -1691,6 +1691,74 @@ function writeReviewGateTargetingFailure(context, payload) {
1691
1691
  context.logger.error(`Expected project=${payload.corroboration.expectedProject} run=${payload.gateInvocation.runId}; actual containing_project=${payload.corroboration.actual.containingProject ?? 'missing'} artifact_project=${payload.corroboration.actual.artifactProject ?? 'missing'} run_matches=${payload.corroboration.actual.matchingArtifactPaths.join(',') || 'none'}.`);
1692
1692
  context.logger.error('This targeting failure is not receive-eligible and must be corrected before severity or invocation remediation.');
1693
1693
  }
1694
+ /**
1695
+ * Commits `project-log.md` after this gate run appends to it.
1696
+ *
1697
+ * The log is tracked, so an uncommitted append leaves the worktree dirty for
1698
+ * whatever runs next — including a dispatched subagent whose preflight requires
1699
+ * a clean tree. The commit is pathspec-scoped to the log alone so unrelated
1700
+ * working-tree changes are never swept in.
1701
+ *
1702
+ * Scope note: this commits the whole log file, so a log that was already dirty
1703
+ * before the gate ran is committed along with this run's entry. That is
1704
+ * deliberate — leaving the earlier append uncommitted would reproduce the dirty
1705
+ * tree this exists to prevent — but it does mean the commit is not always
1706
+ * exactly one entry.
1707
+ *
1708
+ * Never throws: git failures are reported to the caller, which degrades to a
1709
+ * diagnostic rather than altering the gate's exit status. On failure the index
1710
+ * is restored so a partially staged log is not left behind.
1711
+ */
1712
+ function commitReviewGateProjectLog(repoRoot, logPath) {
1713
+ const run = (args) => execFileSync('git', args, {
1714
+ cwd: repoRoot,
1715
+ encoding: 'utf8',
1716
+ // Capture stderr rather than inheriting it so skip/failure probes do not
1717
+ // leak raw `git fatal:` lines into gate output.
1718
+ stdio: ['ignore', 'pipe', 'pipe'],
1719
+ }).trim();
1720
+ try {
1721
+ run(['rev-parse', '--is-inside-work-tree']);
1722
+ }
1723
+ catch {
1724
+ return { committed: false };
1725
+ }
1726
+ let staged = false;
1727
+ try {
1728
+ if (run(['status', '--porcelain', '--', logPath]).length === 0) {
1729
+ return { committed: false };
1730
+ }
1731
+ run(['add', '--', logPath]);
1732
+ staged = true;
1733
+ run([
1734
+ 'commit',
1735
+ '-m',
1736
+ 'chore(oat): record gate review in project log',
1737
+ '--',
1738
+ logPath,
1739
+ ]);
1740
+ return { committed: true };
1741
+ }
1742
+ catch (error) {
1743
+ if (staged) {
1744
+ try {
1745
+ // A failed commit (hook, signing, identity) would otherwise leave the
1746
+ // log staged, which is a worse state than the dirty tree we started in.
1747
+ run(['reset', '--quiet', '--', logPath]);
1748
+ }
1749
+ catch {
1750
+ // Best effort: the reported commit failure already tells the caller the
1751
+ // log needs attention.
1752
+ }
1753
+ }
1754
+ const stderr = error && typeof error === 'object' && 'stderr' in error
1755
+ ? error.stderr
1756
+ : undefined;
1757
+ const message = (stderr != null ? stderr.toString().trim() : '') ||
1758
+ (error instanceof Error ? error.message : String(error));
1759
+ return { committed: false, error: message };
1760
+ }
1761
+ }
1694
1762
  async function finalizeReviewGateProjectLog(context, dependencies, finalization) {
1695
1763
  const findings = finalization.counts
1696
1764
  ? ` findings=critical:${finalization.counts.critical},important:${finalization.counts.important},medium:${finalization.counts.medium},minor:${finalization.counts.minor}`
@@ -1699,8 +1767,26 @@ async function finalizeReviewGateProjectLog(context, dependencies, finalization)
1699
1767
  ? ` artifact=${finalization.artifactPath}`
1700
1768
  : '';
1701
1769
  const body = `target=${finalization.target} threshold=${finalization.threshold}${findings} exit=${finalization.exitCode} status=${finalization.status}${artifact}`;
1770
+ // Finalization runs after the JSON envelope is emitted, and `logger.warn` is
1771
+ // suppressed in JSON mode. Automation would otherwise get no signal that the
1772
+ // project log is still dirty, so route these through the diagnostic channel.
1773
+ const report = (type, reason, logPath) => {
1774
+ if (context.json) {
1775
+ dependencies.writeDiagnostic(`${JSON.stringify({
1776
+ type,
1777
+ reason,
1778
+ ...(logPath != null ? { logPath } : {}),
1779
+ project: finalization.project,
1780
+ })}\n`);
1781
+ return;
1782
+ }
1783
+ const subject = type === 'gate-project-log-append-failed'
1784
+ ? 'append oat gate review result to the project log'
1785
+ : 'commit the oat gate review project log entry';
1786
+ context.logger.warn(`Warning: unable to ${subject}: ${reason}. Gate result is unchanged.`);
1787
+ };
1702
1788
  try {
1703
- await dependencies.appendProjectLog({
1789
+ const result = await dependencies.appendProjectLog({
1704
1790
  repoRoot: finalization.repoRoot,
1705
1791
  home: finalization.home,
1706
1792
  project: finalization.project,
@@ -1709,9 +1795,15 @@ async function finalizeReviewGateProjectLog(context, dependencies, finalization)
1709
1795
  ref: finalization.ref,
1710
1796
  body,
1711
1797
  });
1798
+ if (result.status === 'appended') {
1799
+ const commit = commitReviewGateProjectLog(finalization.repoRoot, result.logPath);
1800
+ if (commit.error != null) {
1801
+ report('gate-project-log-commit-failed', commit.error, result.logPath);
1802
+ }
1803
+ }
1712
1804
  }
1713
1805
  catch (error) {
1714
- context.logger.warn(`Warning: unable to append oat gate review result to the project log: ${error instanceof Error ? error.message : String(error)}. Gate result is unchanged.`);
1806
+ report('gate-project-log-append-failed', error instanceof Error ? error.message : String(error));
1715
1807
  }
1716
1808
  }
1717
1809
  async function updateConfigLayer(context, layer, dependencies, mutate) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/init/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EAEnB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EAGlB,MAAM,iC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;AAUD,UAAU,oBAAoB;IAC5B,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAwKD,UAAU,eAAe;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,eAAe,EAAE,EACvB,OAAO,EAAE,eAAe,EAAE,GACzB,MAAM,CASR;AA4GD,wBAAgB,2BAA2B,IAAI,oBAAoB,GAAG,IAAI,CAIzE;AA2TD,UAAU,aAAa;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,CA8CxE;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,qBAAqB,GAClC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAqfrB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAErB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAC7C,OAAO,CAmET"}
@@ -1,6 +1,7 @@
1
1
  import { rm, unlink } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import { buildCommandContext, } from '../../../app/command-context.js';
4
+ import { buildDecisionAgentsSectionBody, DECISION_AGENTS_SECTION_KEY, } from '../../decision/agents-guidance.js';
4
5
  import { copyDirWithStatus } from '../../init/tools/shared/copy-helpers.js';
5
6
  import { applyGitignore } from '../../local/apply.js';
6
7
  import { addLocalPaths } from '../../local/manage.js';
@@ -858,6 +859,9 @@ export async function runInitTools(context, dependencies) {
858
859
  const projectManagementSectionResult = selectedPacks.includes('project-management')
859
860
  ? await dependencies.upsertAgentsMdSection(projectRoot, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, buildProjectManagementAgentsSectionBody())
860
861
  : null;
862
+ const decisionSectionResult = selectedPacks.includes('project-management')
863
+ ? await dependencies.upsertAgentsMdSection(projectRoot, DECISION_AGENTS_SECTION_KEY, buildDecisionAgentsSectionBody())
864
+ : null;
861
865
  // Migrate: remove legacy <!-- OAT workflows --> section if present
862
866
  await dependencies.removeAgentsMdSection(projectRoot, 'workflows');
863
867
  if (!context.json && sectionResult.action !== 'no-change') {
@@ -868,6 +872,11 @@ export async function runInitTools(context, dependencies) {
868
872
  projectManagementSectionResult.action !== 'no-change') {
869
873
  context.logger.info(`AGENTS.md project-management section ${projectManagementSectionResult.action}.`);
870
874
  }
875
+ if (!context.json &&
876
+ decisionSectionResult !== null &&
877
+ decisionSectionResult.action !== 'no-change') {
878
+ context.logger.info(`AGENTS.md decisions section ${decisionSectionResult.action}.`);
879
+ }
871
880
  const affectedScopesList = [...affectedScopes];
872
881
  lastRunInitToolsMetadata = {
873
882
  affectedScopes: affectedScopesList,
@@ -1 +1 @@
1
- {"version":3,"file":"agents-guidance.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/agents-guidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAE1E,wBAAgB,uCAAuC,IAAI,MAAM,CAehE"}
1
+ {"version":3,"file":"agents-guidance.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/agents-guidance.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAE1E,wBAAgB,uCAAuC,IAAI,MAAM,CAShE"}
@@ -7,11 +7,5 @@ export function buildProjectManagementAgentsSectionBody() {
7
7
  '- Consult it when prioritizing or planning work, checking the backlog, starting or closing tracked work, or looking for established repository context.',
8
8
  '- Start with `.oat/repo/AGENTS.md`; it routes to `pjm/` for active state and `reference/` for durable records.',
9
9
  '- If the surface is missing, initialize it with `oat pjm init`.',
10
- '',
11
- '### Decision Records',
12
- '',
13
- '- Before finalizing a durable repository decision, review `.oat/repo/reference/decisions/index.md` and any relevant records.',
14
- '- When the user asks to record a durable decision or confirms a proposed capture, use `oat-pjm-decision`; use `oat decision new` for the CLI path.',
15
- '- Do not hand-edit the generated decision index; run `oat decision regenerate-index` after record changes.',
16
10
  ].join('\n');
17
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAY9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AAMtC,UAAU,sCAAsC;IAC9C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,wBAAwB,EAAE,CACxB,OAAO,EAAE,+BAA+B,KACrC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC9C;AASD,wBAAgB,uCAAuC,CACrD,SAAS,GAAE,OAAO,CAAC,sCAAsC,CAAM,GAC9D,OAAO,CAsHT"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/project-management/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAgB9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AAMtC,UAAU,sCAAsC;IAC9C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,wBAAwB,EAAE,CACxB,OAAO,EAAE,+BAA+B,KACrC,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC9C;AASD,wBAAgB,uCAAuC,CACrD,SAAS,GAAE,OAAO,CAAC,sCAAsC,CAAM,GAC9D,OAAO,CAwIT"}
@@ -1,4 +1,5 @@
1
1
  import { buildCommandContext, } from '../../../../app/command-context.js';
2
+ import { buildDecisionAgentsSectionBody, DECISION_AGENTS_SECTION_KEY, } from '../../../decision/agents-guidance.js';
2
3
  import { upsertAgentsMdSection, } from '../../../shared/agents-md.js';
3
4
  import { readGlobalOptions } from '../../../shared/shared.utils.js';
4
5
  import { canonicalPathsForPack, setInstalledCanonicalPaths, } from '../../../tools/shared/install-sync-context.js';
@@ -52,11 +53,15 @@ export function createInitToolsProjectManagementCommand(overrides = {}) {
52
53
  force: options.force,
53
54
  });
54
55
  didInstall = true;
55
- let agentsGuidanceAction;
56
+ let projectManagementGuidanceAction;
57
+ let decisionGuidanceAction;
56
58
  let agentsGuidanceWarning;
57
59
  try {
58
- const agentsGuidanceResult = await upsertAgentsMdSection(targetRoot, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, buildProjectManagementAgentsSectionBody());
59
- agentsGuidanceAction = agentsGuidanceResult.action;
60
+ const projectManagementGuidanceResult = await upsertAgentsMdSection(targetRoot, PROJECT_MANAGEMENT_AGENTS_SECTION_KEY, buildProjectManagementAgentsSectionBody());
61
+ projectManagementGuidanceAction =
62
+ projectManagementGuidanceResult.action;
63
+ const decisionGuidanceResult = await upsertAgentsMdSection(targetRoot, DECISION_AGENTS_SECTION_KEY, buildDecisionAgentsSectionBody());
64
+ decisionGuidanceAction = decisionGuidanceResult.action;
60
65
  }
61
66
  catch (error) {
62
67
  const message = error instanceof Error ? error.message : String(error);
@@ -79,9 +84,13 @@ export function createInitToolsProjectManagementCommand(overrides = {}) {
79
84
  context.logger.info(`Target root: ${targetRoot}`);
80
85
  context.logger.info(`Skills: copied=${result.copiedSkills.length}, updated=${result.updatedSkills.length}, skipped=${result.skippedSkills.length}`);
81
86
  context.logger.info(`Templates: copied=${result.copiedTemplates.length}, updated=${result.updatedTemplates.length}, skipped=${result.skippedTemplates.length}`);
82
- if (agentsGuidanceAction !== undefined &&
83
- agentsGuidanceAction !== 'no-change') {
84
- context.logger.info(`AGENTS.md project-management section ${agentsGuidanceAction}.`);
87
+ if (projectManagementGuidanceAction !== undefined &&
88
+ projectManagementGuidanceAction !== 'no-change') {
89
+ context.logger.info(`AGENTS.md project-management section ${projectManagementGuidanceAction}.`);
90
+ }
91
+ if (decisionGuidanceAction !== undefined &&
92
+ decisionGuidanceAction !== 'no-change') {
93
+ context.logger.info(`AGENTS.md decisions section ${decisionGuidanceAction}.`);
85
94
  }
86
95
  if (agentsGuidanceWarning !== undefined) {
87
96
  context.logger.warn(agentsGuidanceWarning);
@@ -9,6 +9,6 @@ export interface RepoReferenceInitResult {
9
9
  skipped: string[];
10
10
  }
11
11
  export declare const INSTRUCTIONS_SYNC_HINT: string;
12
- export declare const CANONICAL_REPO_REFERENCE_PATHS: readonly [...("AGENTS.md" | "README.md" | "pjm/AGENTS.md" | "pjm/current-state.md" | "pjm/handoffs/README.md" | "pjm/roadmap.md" | "reference/AGENTS.md")[], "pjm/backlog/index.md", "pjm/backlog/completed.md", "pjm/backlog/items/.gitkeep", "pjm/backlog/archived/.gitkeep", "reference/decisions/index.md"];
12
+ export declare const CANONICAL_REPO_REFERENCE_PATHS: readonly [...("AGENTS.md" | "README.md" | "pjm/AGENTS.md" | "pjm/current-state.md" | "pjm/handoffs/README.md" | "pjm/roadmap.md" | "reference/AGENTS.md")[], "pjm/backlog/index.md", "pjm/backlog/completed.md", "pjm/backlog/items/.gitkeep", "pjm/backlog/archived/.gitkeep", "reference/decisions/AGENTS.md", "reference/decisions/index.md"];
13
13
  export declare function initializeRepoReference(options: InitializeRepoReferenceOptions): Promise<RepoReferenceInitResult>;
14
14
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/init.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAoBD,eAAO,MAAM,sBAAsB,QAEiD,CAAC;AAWrF,eAAO,MAAM,8BAA8B,iTAIjC,CAAC;AAyEX,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CAgElC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/init.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAoBD,eAAO,MAAM,sBAAsB,QAEiD,CAAC;AAerF,eAAO,MAAM,8BAA8B,kVAIjC,CAAC;AAyEX,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CAqElC"}
@@ -1,6 +1,7 @@
1
1
  import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
2
2
  import { dirname, join } from 'node:path';
3
3
  import { initializeBacklog } from '../backlog/init.js';
4
+ import { initializeScopedDecisionAgentsGuidance } from '../decision/agents-guidance.js';
4
5
  import { initializeDecisionRecords } from '../decision/init.js';
5
6
  import { stripTemplateFrontmatter } from '../shared/strip-template-frontmatter.js';
6
7
  const TEMPLATE_TARGETS = [
@@ -23,7 +24,11 @@ const BACKLOG_PATHS = [
23
24
  'pjm/backlog/items/.gitkeep',
24
25
  'pjm/backlog/archived/.gitkeep',
25
26
  ];
26
- const DECISION_PATHS = ['reference/decisions/index.md'];
27
+ const DECISION_AGENTS_PATH = 'reference/decisions/AGENTS.md';
28
+ const DECISION_PATHS = [
29
+ DECISION_AGENTS_PATH,
30
+ 'reference/decisions/index.md',
31
+ ];
27
32
  export const CANONICAL_REPO_REFERENCE_PATHS = [
28
33
  ...TEMPLATE_TARGETS.map((target) => target.target),
29
34
  ...BACKLOG_PATHS,
@@ -119,6 +124,9 @@ export async function initializeRepoReference(options) {
119
124
  }
120
125
  }
121
126
  await initializeDecisionRecords(join(options.repoRoot, 'reference', 'decisions'));
127
+ if (!existingDecisionPaths.has(DECISION_AGENTS_PATH)) {
128
+ await initializeScopedDecisionAgentsGuidance(join(options.repoRoot, 'reference', 'decisions'));
129
+ }
122
130
  for (const relativePath of DECISION_PATHS) {
123
131
  if (existingDecisionPaths.has(relativePath)) {
124
132
  skipped.push(relativePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
4
4
  "private": false,
5
5
  "description": "Open Agent Toolkit CLI",
6
6
  "homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
@@ -34,7 +34,7 @@
34
34
  "ora": "^9.0.0",
35
35
  "yaml": "2.8.2",
36
36
  "zod": "^3.25.76",
37
- "@open-agent-toolkit/control-plane": "0.2.16"
37
+ "@open-agent-toolkit/control-plane": "0.2.18"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.0",