@open-agent-toolkit/cli 0.2.16 → 0.2.17
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/assets/docs/cli-utilities/config-and-local-state.md +3 -1
- package/assets/docs/cli-utilities/tool-packs.md +2 -0
- package/assets/docs/reference/oat-directory-structure.md +5 -1
- package/assets/public-package-versions.json +4 -4
- package/dist/commands/decision/agents-guidance.d.ts +15 -0
- package/dist/commands/decision/agents-guidance.d.ts.map +1 -0
- package/dist/commands/decision/agents-guidance.js +51 -0
- package/dist/commands/decision/index.d.ts +2 -0
- package/dist/commands/decision/index.d.ts.map +1 -1
- package/dist/commands/decision/index.js +15 -1
- package/dist/commands/init/tools/index.d.ts.map +1 -1
- package/dist/commands/init/tools/index.js +9 -0
- package/dist/commands/init/tools/project-management/agents-guidance.d.ts.map +1 -1
- package/dist/commands/init/tools/project-management/agents-guidance.js +0 -6
- package/dist/commands/init/tools/project-management/index.d.ts.map +1 -1
- package/dist/commands/init/tools/project-management/index.js +15 -6
- package/dist/commands/pjm/init.d.ts +1 -1
- package/dist/commands/pjm/init.d.ts.map +1 -1
- package/dist/commands/pjm/init.js +9 -1
- package/package.json +2 -2
|
@@ -85,7 +85,7 @@ For full project-management repo-reference setup, use [`oat pjm init`](tool-pack
|
|
|
85
85
|
|
|
86
86
|
Use the `oat decision` group for file-per-record decisions under `.oat/repo/reference/decisions/`. Each decision is its own file with a deterministic `DR-YYMMDD-slug` ID (the slug is capped at 30 characters at the last whole-word boundary, with trailing stop-words trimmed), and the human-facing index is a committed generated view.
|
|
87
87
|
|
|
88
|
-
- `oat decision init` - scaffold `.oat/repo/reference/decisions
|
|
88
|
+
- `oat decision init` - scaffold `.oat/repo/reference/decisions/`, the managed decision index, decision-scoped `AGENTS.md` guidance, and an idempotent `OAT decisions` section in the repository-root `AGENTS.md`
|
|
89
89
|
- `oat decision new <title>` - create a new decision record; supports `--status`, `--context`, `--decision`, `--consequences`, and `--created-at`
|
|
90
90
|
- `oat decision regenerate-index` - rebuild the managed decision index table from record frontmatter
|
|
91
91
|
- `oat decision migrate` - convert a legacy single `decision-record.md` into file-per-record decisions, preserving each old `ADR-NNN`/`DR-NNN` ID as `legacy_id`; applies by default, so pass `--dry-run` to preview the legacy-to-new mappings without writing, and `--delete-legacy` to remove the source file after a verified migration (unlike `oat pjm migrate`, which defaults to dry-run)
|
|
@@ -94,6 +94,8 @@ Pass `--context`, `--decision`, and `--consequences` together when creating a re
|
|
|
94
94
|
|
|
95
95
|
The decision index uses managed marker pairs and is deterministic, so an index merge conflict can be resolved by re-running `oat decision regenerate-index` and staging the result. Decision records replace the legacy single `decision-record.md`; repos still on the old layout migrate with `oat decision migrate` (or the broader `oat pjm migrate`).
|
|
96
96
|
|
|
97
|
+
`oat decision init` is the lightweight standalone setup path. It does not require the `project-management` tool pack and does not create current state, roadmap, or backlog artifacts. Its AGENTS guidance uses `oat decision` directly while also recognizing `oat-pjm-decision` when that optional skill is installed later.
|
|
98
|
+
|
|
97
99
|
## `oat local ...`
|
|
98
100
|
|
|
99
101
|
`oat local` manages local-only, gitignored paths that still need to follow you between the main repo and worktrees.
|
|
@@ -140,6 +140,8 @@ The canonical surface splits active operational state (under `pjm/`) from durabl
|
|
|
140
140
|
|
|
141
141
|
Decisions are now file-per-record under `reference/decisions/` (created and indexed with the [`oat decision`](config-and-local-state.md#oat-decision-) command group), replacing the legacy single `decision-record.md`. Repos still on the old `reference/` layout can migrate with `oat pjm migrate`.
|
|
142
142
|
|
|
143
|
+
For decision records without the broader PJM surface, run `oat decision init` directly. It creates only the decision directory, generated index, and decision-specific AGENTS guidance; it does not require the `project-management` pack or create current state, roadmap, and backlog artifacts. If the pack is installed later, its root guidance is maintained as a separate managed section so the decision instructions remain independently reusable.
|
|
144
|
+
|
|
143
145
|
`oat pjm init` is idempotent and non-destructive. Existing reference docs are skipped and left unchanged, so curated repo state is not overwritten on repeated runs.
|
|
144
146
|
|
|
145
147
|
Run `oat pjm doctor` to check an existing surface after the `project-management` pack is enabled: it reports missing canonical files, leftover template frontmatter, and legacy/loose/second-roadmap drift, and accepts `--json` for machine-readable output. When the pack is disabled or not configured, doctor reports PJM as disabled and skips drift checks. The same gated checks also run under project-scope `oat doctor`.
|
|
@@ -246,12 +246,16 @@ operational layer (`pjm/`) from durable references (`reference/`):
|
|
|
246
246
|
reference/
|
|
247
247
|
AGENTS.md
|
|
248
248
|
decisions/
|
|
249
|
+
AGENTS.md
|
|
250
|
+
index.md
|
|
249
251
|
```
|
|
250
252
|
|
|
251
253
|
Decisions are file-per-record under `reference/decisions/` (managed with the
|
|
252
254
|
`oat decision` command group), replacing the legacy single
|
|
253
255
|
`reference/decision-record.md`. Repos still on the old single-`reference/`
|
|
254
|
-
layout migrate with `oat pjm migrate`.
|
|
256
|
+
layout migrate with `oat pjm migrate`. Running `oat decision init` by itself
|
|
257
|
+
creates the `decisions/` subtree and decision-specific AGENTS guidance without
|
|
258
|
+
creating the broader `pjm/` surface.
|
|
255
259
|
|
|
256
260
|
## User scope (`~/.oat/`)
|
|
257
261
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type UpsertSectionResult } from '../shared/agents-md.js';
|
|
2
|
+
export declare const DECISION_AGENTS_SECTION_KEY = "decisions";
|
|
3
|
+
export declare function buildDecisionAgentsSectionBody(decisionsPath?: string): string;
|
|
4
|
+
export declare function buildScopedDecisionAgentsSectionBody(): string;
|
|
5
|
+
export interface InitializeDecisionAgentsGuidanceOptions {
|
|
6
|
+
projectRoot: string;
|
|
7
|
+
decisionsRoot: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DecisionAgentsGuidanceResult {
|
|
10
|
+
root: UpsertSectionResult['action'];
|
|
11
|
+
scoped: UpsertSectionResult['action'];
|
|
12
|
+
}
|
|
13
|
+
export declare function initializeScopedDecisionAgentsGuidance(decisionsRoot: string): Promise<UpsertSectionResult>;
|
|
14
|
+
export declare function initializeDecisionAgentsGuidance(options: InitializeDecisionAgentsGuidanceOptions): Promise<DecisionAgentsGuidanceResult>;
|
|
15
|
+
//# sourceMappingURL=agents-guidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-guidance.d.ts","sourceRoot":"","sources":["../../../src/commands/decision/agents-guidance.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,4BAA4B,CAAC;AAEpC,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAwBvD,wBAAgB,8BAA8B,CAC5C,aAAa,SAAyB,GACrC,MAAM,CAUR;AAED,wBAAgB,oCAAoC,IAAI,MAAM,CAU7D;AAED,MAAM,WAAW,uCAAuC;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;CACvC;AAED,wBAAsB,sCAAsC,CAC1D,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAO9B;AAED,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,uCAAuC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,CAgBvC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { mkdir } from 'node:fs/promises';
|
|
2
|
+
import { isAbsolute, relative, sep } from 'node:path';
|
|
3
|
+
import { upsertAgentsMdSection, } from '../shared/agents-md.js';
|
|
4
|
+
export const DECISION_AGENTS_SECTION_KEY = 'decisions';
|
|
5
|
+
const DEFAULT_DECISIONS_PATH = '.oat/repo/reference/decisions';
|
|
6
|
+
function portablePath(path) {
|
|
7
|
+
return path.split(sep).join('/');
|
|
8
|
+
}
|
|
9
|
+
function displayDecisionsPath(projectRoot, decisionsRoot) {
|
|
10
|
+
const relativePath = relative(projectRoot, decisionsRoot);
|
|
11
|
+
if (relativePath.length > 0 &&
|
|
12
|
+
!relativePath.startsWith('..') &&
|
|
13
|
+
!isAbsolute(relativePath)) {
|
|
14
|
+
return portablePath(relativePath);
|
|
15
|
+
}
|
|
16
|
+
return portablePath(decisionsRoot);
|
|
17
|
+
}
|
|
18
|
+
export function buildDecisionAgentsSectionBody(decisionsPath = DEFAULT_DECISIONS_PATH) {
|
|
19
|
+
return [
|
|
20
|
+
'### Decision Records',
|
|
21
|
+
'',
|
|
22
|
+
`- Durable repository decisions live under \`${decisionsPath}/\`; read \`${decisionsPath}/AGENTS.md\` before working with them.`,
|
|
23
|
+
`- Before finalizing a durable repository decision, review \`${decisionsPath}/index.md\` and any relevant records.`,
|
|
24
|
+
'- When the user asks to record a durable decision or confirms a proposed capture, use `oat-pjm-decision` when that skill is installed; otherwise use `oat decision new`.',
|
|
25
|
+
'- Do not hand-edit the generated decision index; run `oat decision regenerate-index` after record changes or to resolve index conflicts.',
|
|
26
|
+
'- If the decision surface is missing, initialize it with `oat decision init`.',
|
|
27
|
+
].join('\n');
|
|
28
|
+
}
|
|
29
|
+
export function buildScopedDecisionAgentsSectionBody() {
|
|
30
|
+
return [
|
|
31
|
+
'# Decision Record Guidance',
|
|
32
|
+
'',
|
|
33
|
+
'- This directory stores one Markdown file per durable repository decision plus a generated `index.md`.',
|
|
34
|
+
'- Review the index and relevant existing records before finalizing a decision.',
|
|
35
|
+
'- Create records with `oat decision new`; do not create IDs or filenames by hand.',
|
|
36
|
+
'- Keep context, the chosen decision, and consequences in the decision record.',
|
|
37
|
+
'- Do not hand-edit the generated table in `index.md`. Run `oat decision regenerate-index` after record changes or to resolve index conflicts.',
|
|
38
|
+
].join('\n');
|
|
39
|
+
}
|
|
40
|
+
export async function initializeScopedDecisionAgentsGuidance(decisionsRoot) {
|
|
41
|
+
await mkdir(decisionsRoot, { recursive: true });
|
|
42
|
+
return upsertAgentsMdSection(decisionsRoot, DECISION_AGENTS_SECTION_KEY, buildScopedDecisionAgentsSectionBody());
|
|
43
|
+
}
|
|
44
|
+
export async function initializeDecisionAgentsGuidance(options) {
|
|
45
|
+
const scoped = await initializeScopedDecisionAgentsGuidance(options.decisionsRoot);
|
|
46
|
+
const root = await upsertAgentsMdSection(options.projectRoot, DECISION_AGENTS_SECTION_KEY, buildDecisionAgentsSectionBody(displayDecisionsPath(options.projectRoot, options.decisionsRoot)));
|
|
47
|
+
return {
|
|
48
|
+
root: root.action,
|
|
49
|
+
scoped: scoped.action,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -2,6 +2,7 @@ import { buildCommandContext } from '../../app/command-context.js';
|
|
|
2
2
|
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
3
3
|
import { resolveProjectRoot } from '../../fs/paths.js';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
|
+
import { initializeDecisionAgentsGuidance } from './agents-guidance.js';
|
|
5
6
|
import { initializeDecisionRecords } from './init.js';
|
|
6
7
|
import { migrateDecisionRecords } from './migrate.js';
|
|
7
8
|
import { createDecisionRecord } from './new.js';
|
|
@@ -10,6 +11,7 @@ interface DecisionCommandDependencies {
|
|
|
10
11
|
buildCommandContext: typeof buildCommandContext;
|
|
11
12
|
resolveProjectRoot: typeof resolveProjectRoot;
|
|
12
13
|
resolveAssetsRoot: typeof resolveAssetsRoot;
|
|
14
|
+
initializeDecisionAgentsGuidance: typeof initializeDecisionAgentsGuidance;
|
|
13
15
|
initializeDecisionRecords: typeof initializeDecisionRecords;
|
|
14
16
|
regenerateDecisionIndex: typeof regenerateDecisionIndex;
|
|
15
17
|
createDecisionRecord: typeof createDecisionRecord;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/decision/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC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9C,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,gCAAgC,EAAE,OAAO,gCAAgC,CAAC;IAC1E,yBAAyB,EAAE,OAAO,yBAAyB,CAAC;IAC5D,uBAAuB,EAAE,OAAO,uBAAuB,CAAC;IACxD,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;CACvD;AA+CD,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACnD,OAAO,CAoNT"}
|
|
@@ -4,6 +4,7 @@ import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
|
4
4
|
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
5
5
|
import { resolveProjectRoot } from '../../fs/paths.js';
|
|
6
6
|
import { Command } from 'commander';
|
|
7
|
+
import { initializeDecisionAgentsGuidance } from './agents-guidance.js';
|
|
7
8
|
import { initializeDecisionRecords } from './init.js';
|
|
8
9
|
import { migrateDecisionRecords } from './migrate.js';
|
|
9
10
|
import { createDecisionRecord } from './new.js';
|
|
@@ -12,6 +13,7 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
12
13
|
buildCommandContext,
|
|
13
14
|
resolveProjectRoot,
|
|
14
15
|
resolveAssetsRoot,
|
|
16
|
+
initializeDecisionAgentsGuidance,
|
|
15
17
|
initializeDecisionRecords,
|
|
16
18
|
regenerateDecisionIndex,
|
|
17
19
|
createDecisionRecord,
|
|
@@ -55,8 +57,19 @@ export function createDecisionCommand(overrides = {}) {
|
|
|
55
57
|
const projectRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
56
58
|
const decisionsRoot = await resolveDecisionsRoot(context, projectRoot, options.decisionsRoot);
|
|
57
59
|
const result = await dependencies.initializeDecisionRecords(decisionsRoot);
|
|
60
|
+
let guidance;
|
|
61
|
+
try {
|
|
62
|
+
guidance = await dependencies.initializeDecisionAgentsGuidance({
|
|
63
|
+
projectRoot,
|
|
64
|
+
decisionsRoot,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
69
|
+
throw new Error(`Decision index initialized at ${result.decisionsRoot}, but AGENTS.md guidance could not be written: ${message}. Fix the guidance write error and rerun \`oat decision init\`.`, { cause: error });
|
|
70
|
+
}
|
|
58
71
|
if (context.json) {
|
|
59
|
-
context.logger.json({ status: 'ok', ...result });
|
|
72
|
+
context.logger.json({ status: 'ok', ...result, guidance });
|
|
60
73
|
}
|
|
61
74
|
else {
|
|
62
75
|
context.logger.info(`Initialized decision scaffold at ${result.decisionsRoot}`);
|
|
@@ -66,6 +79,7 @@ export function createDecisionCommand(overrides = {}) {
|
|
|
66
79
|
if (result.skipped.length > 0) {
|
|
67
80
|
context.logger.info(`Skipped existing: ${result.skipped.join(', ')}`);
|
|
68
81
|
}
|
|
82
|
+
context.logger.info(`AGENTS.md guidance: root=${guidance.root}, decisions=${guidance.scoped}`);
|
|
69
83
|
}
|
|
70
84
|
process.exitCode = 0;
|
|
71
85
|
}
|
|
@@ -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;
|
|
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;AAQ9B,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EAGlB,MAAM,iCAAiC,CAAC;AASzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAA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AUD,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,
|
|
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;
|
|
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
|
|
56
|
+
let projectManagementGuidanceAction;
|
|
57
|
+
let decisionGuidanceAction;
|
|
56
58
|
let agentsGuidanceWarning;
|
|
57
59
|
try {
|
|
58
|
-
const
|
|
59
|
-
|
|
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 (
|
|
83
|
-
|
|
84
|
-
context.logger.info(`AGENTS.md project-management section ${
|
|
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":"
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.2.17",
|
|
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.
|
|
37
|
+
"@open-agent-toolkit/control-plane": "0.2.17"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|