waypoint-codex 0.19.2 → 1.0.0

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 (41) hide show
  1. package/README.md +18 -37
  2. package/dist/src/cli.js +1 -1
  3. package/dist/src/core.js +33 -116
  4. package/dist/src/docs-index.js +1 -1
  5. package/dist/src/templates.js +0 -10
  6. package/package.json +1 -1
  7. package/templates/.agents/skills/agi-help/SKILL.md +1 -1
  8. package/templates/.agents/skills/code-guide-audit/SKILL.md +1 -5
  9. package/templates/.agents/skills/planning/SKILL.md +12 -10
  10. package/templates/.agents/skills/pr-review/SKILL.md +0 -1
  11. package/templates/.codex/agents/code-health-reviewer.toml +6 -5
  12. package/templates/.codex/agents/code-reviewer.toml +6 -5
  13. package/templates/.codex/agents/plan-reviewer.toml +6 -5
  14. package/templates/.waypoint/ACTIVE_PLANS.md +7 -7
  15. package/templates/.waypoint/README.md +5 -8
  16. package/templates/.waypoint/config.toml +0 -5
  17. package/templates/.waypoint/docs/README.md +1 -3
  18. package/templates/.waypoint/scripts/build-docs-index.mjs +25 -11
  19. package/templates/.waypoint/scripts/prepare-context.mjs +120 -205
  20. package/templates/WORKSPACE.md +2 -6
  21. package/templates/managed-agents-block.md +22 -111
  22. package/dist/src/track-index.js +0 -107
  23. package/templates/.agents/skills/break-it-qa/SKILL.md +0 -184
  24. package/templates/.agents/skills/break-it-qa/agents/openai.yaml +0 -4
  25. package/templates/.agents/skills/conversation-retrospective/SKILL.md +0 -147
  26. package/templates/.agents/skills/conversation-retrospective/agents/openai.yaml +0 -4
  27. package/templates/.agents/skills/docs-sync/SKILL.md +0 -78
  28. package/templates/.agents/skills/docs-sync/agents/openai.yaml +0 -4
  29. package/templates/.agents/skills/merge-ready-owner/SKILL.md +0 -196
  30. package/templates/.agents/skills/merge-ready-owner/agents/openai.yaml +0 -4
  31. package/templates/.agents/skills/pre-pr-hygiene/SKILL.md +0 -83
  32. package/templates/.agents/skills/pre-pr-hygiene/agents/openai.yaml +0 -4
  33. package/templates/.agents/skills/work-tracker/SKILL.md +0 -139
  34. package/templates/.agents/skills/work-tracker/agents/openai.yaml +0 -4
  35. package/templates/.agents/skills/workspace-compress/SKILL.md +0 -113
  36. package/templates/.agents/skills/workspace-compress/agents/openai.yaml +0 -4
  37. package/templates/.waypoint/SOUL.md +0 -71
  38. package/templates/.waypoint/agent-operating-manual.md +0 -178
  39. package/templates/.waypoint/scripts/build-track-index.mjs +0 -169
  40. package/templates/.waypoint/track/README.md +0 -38
  41. package/templates/.waypoint/track/_template.md +0 -48
@@ -3,11 +3,12 @@ model_reasoning_effort = "high"
3
3
  sandbox_mode = "read-only"
4
4
  developer_instructions = """
5
5
  Read these files in order before doing anything else:
6
- 1. .waypoint/SOUL.md
7
- 2. .waypoint/agent-operating-manual.md
8
- 3. .waypoint/WORKSPACE.md
9
- 4. .waypoint/context/MANIFEST.md
10
- 5. every file listed in that manifest
6
+ 1. AGENTS.md
7
+ 2. .waypoint/WORKSPACE.md
8
+ 3. .waypoint/ACTIVE_PLANS.md
9
+ 4. .waypoint/DOCS_INDEX.md
10
+ 5. .waypoint/context/SNAPSHOT.md
11
+ 6. .waypoint/context/RECENT_THREAD.md
11
12
 
12
13
  After reading them, follow these operating instructions:
13
14
 
@@ -3,11 +3,12 @@ model_reasoning_effort = "high"
3
3
  sandbox_mode = "read-only"
4
4
  developer_instructions = """
5
5
  Read these files in order before doing anything else:
6
- 1. .waypoint/SOUL.md
7
- 2. .waypoint/agent-operating-manual.md
8
- 3. .waypoint/WORKSPACE.md
9
- 4. .waypoint/context/MANIFEST.md
10
- 5. every file listed in that manifest
6
+ 1. AGENTS.md
7
+ 2. .waypoint/WORKSPACE.md
8
+ 3. .waypoint/ACTIVE_PLANS.md
9
+ 4. .waypoint/DOCS_INDEX.md
10
+ 5. .waypoint/context/SNAPSHOT.md
11
+ 6. .waypoint/context/RECENT_THREAD.md
11
12
 
12
13
  After reading them, follow these operating instructions:
13
14
 
@@ -1,21 +1,21 @@
1
1
  # Active Plans
2
2
 
3
- This file is the live execution-contract layer for approved plans that are currently in flight.
3
+ This file is the live execution checklist for approved plan work that is currently in flight.
4
4
 
5
5
  Keep it short and current.
6
6
 
7
- For each active plan, include:
7
+ For the active plan, include:
8
8
  - source plan path under `.waypoint/plans/`
9
9
  - whether the plan is approved
10
- - the current phase
11
- - the checklist or acceptance criteria for that phase
12
- - what checkpoint must pass before moving to the next phase
13
- - any explicit non-goals or approved deferrals
10
+ - the current phase or focus
11
+ - the remaining checklist / todos
12
+ - blockers or approved deferrals
13
+ - current verification state
14
14
 
15
15
  Rules:
16
16
  - Read this file during bootstrap and before meaningful implementation.
17
17
  - Follow the approved plan. Do not silently deviate from it.
18
- - Update this file whenever the active plan, current phase, checkpoint, or approved scope changes.
18
+ - Update this file whenever the active plan, checklist, blockers, or verification state changes.
19
19
  - If no approved plan is active, say so plainly here.
20
20
 
21
21
  ## Active Plan
@@ -2,16 +2,13 @@
2
2
 
3
3
  Repo-local Waypoint configuration and project memory files.
4
4
 
5
- - `config.toml` — Waypoint feature toggles and file locations
5
+ - `config.toml` — Waypoint configuration and file locations
6
6
  - `WORKSPACE.md` — live operational state; new or materially revised entries in multi-topic sections are timestamped
7
- - `ACTIVE_PLANS.md` — live execution-contract view of the approved plan(s) and current phase checkpoints
8
- - `DOCS_INDEX.md` — generated docs and plans routing map
9
- - `SOUL.md` — agent identity and working values
10
- - `agent-operating-manual.md` — required session workflow
7
+ - `ACTIVE_PLANS.md` — active plan pointer, execution checklist, blockers, and verification state
8
+ - `DOCS_INDEX.md` — generated docs routing map
11
9
  - `docs/` — Waypoint-managed long-lived project memory (architecture, decisions, debugging knowledge); routable docs use `summary`, `last_updated`, and `read_when` frontmatter
12
- - `plans/` — durable implementation, rollout, and migration plans; routable plans use `summary`, `last_updated`, and `read_when` frontmatter
13
- - `agents/` — agent prompt files that Waypoint's reviewer agents can read and follow
14
- - `context/` — generated session context bundle
10
+ - `plans/` — stored implementation, rollout, and migration plans
11
+ - `context/` — generated volatile context (`SNAPSHOT.md` and `RECENT_THREAD.md`)
15
12
  - `scripts/` — repo-local Waypoint helper scripts
16
13
 
17
14
  Durable guidance now lives in `AGENTS.md`:
@@ -2,9 +2,4 @@ version = 1
2
2
  profile = "__PROFILE__"
3
3
  workspace_file = ".waypoint/WORKSPACE.md"
4
4
  docs_dirs = [".waypoint/docs"]
5
- plans_dirs = [".waypoint/plans"]
6
5
  docs_index_file = ".waypoint/DOCS_INDEX.md"
7
-
8
- [features]
9
- repo_skills = true
10
- docs_index = true
@@ -14,8 +14,6 @@ These are **project docs**, not Waypoint internals.
14
14
 
15
15
  Put durable implementation and rollout plans in `.waypoint/plans/`.
16
16
 
17
- Do not use `.waypoint/docs/` as the execution tracker layer for active long-running work. That belongs under `.waypoint/track/`.
18
-
19
17
  Every routable doc needs YAML frontmatter:
20
18
 
21
19
  ```yaml
@@ -27,4 +25,4 @@ read_when:
27
25
  ---
28
26
  ```
29
27
 
30
- Refresh `last_updated` whenever you materially change a doc. `DOCS_INDEX.md` is generated from both `.waypoint/docs/` and `.waypoint/plans/`.
28
+ Refresh `last_updated` whenever you materially change a doc. `DOCS_INDEX.md` is generated from routed docs only.
@@ -15,6 +15,7 @@ const SKIP_DIRS = new Set([
15
15
  ]);
16
16
 
17
17
  const SKIP_NAMES = new Set(["README.md", "CHANGELOG.md", "LICENSE.md"]);
18
+ const DEFAULT_DOCS_DIR = ".waypoint/docs";
18
19
 
19
20
  export function findProjectRoot(startDir) {
20
21
  let current = path.resolve(startDir);
@@ -39,6 +40,28 @@ function detectProjectRoot() {
39
40
  return findProjectRoot(process.cwd());
40
41
  }
41
42
 
43
+ function configuredDocsDirs(projectRoot) {
44
+ const configPath = path.join(projectRoot, ".waypoint", "config.toml");
45
+ if (!existsSync(configPath)) {
46
+ return [{ heading: `${DEFAULT_DOCS_DIR}/`, dir: path.join(projectRoot, DEFAULT_DOCS_DIR) }];
47
+ }
48
+
49
+ const configText = readFileSync(configPath, "utf8");
50
+ const docsDirsMatch = configText.match(/^\s*docs_dirs\s*=\s*\[(.*?)\]\s*$/ms);
51
+ const legacyDocsDirMatch = configText.match(/^\s*docs_dir\s*=\s*"([^"]+)"\s*$/m);
52
+
53
+ const rawRoots = docsDirsMatch
54
+ ? [...docsDirsMatch[1].matchAll(/"([^"]+)"/g)].map((match) => match[1])
55
+ : legacyDocsDirMatch
56
+ ? [legacyDocsDirMatch[1]]
57
+ : [DEFAULT_DOCS_DIR];
58
+
59
+ return rawRoots.map((root) => ({
60
+ heading: root.endsWith("/") ? root : `${root}/`,
61
+ dir: path.join(projectRoot, root),
62
+ }));
63
+ }
64
+
42
65
  function parseFrontmatter(filePath) {
43
66
  const text = readFileSync(filePath, "utf8");
44
67
  if (!text.startsWith("---\n")) {
@@ -118,21 +141,12 @@ function collectDocEntries(projectRoot, docsDir) {
118
141
  }
119
142
 
120
143
  export function renderDocsIndex(projectRoot) {
121
- const sections = [
122
- {
123
- heading: ".waypoint/docs/",
124
- dir: path.join(projectRoot, ".waypoint", "docs"),
125
- },
126
- {
127
- heading: ".waypoint/plans/",
128
- dir: path.join(projectRoot, ".waypoint", "plans"),
129
- },
130
- ];
144
+ const sections = configuredDocsDirs(projectRoot);
131
145
 
132
146
  const lines = [
133
147
  "# Docs Index",
134
148
  "",
135
- "Auto-generated by `.waypoint/scripts/build-docs-index.mjs`. Read matching docs and plans before working on a task.",
149
+ "Auto-generated by `.waypoint/scripts/build-docs-index.mjs`. Read matching docs before working on a task.",
136
150
  "",
137
151
  ];
138
152
 
@@ -7,10 +7,20 @@ import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
9
  import { findProjectRoot, writeDocsIndex } from "./build-docs-index.mjs";
10
- import { writeTracksIndex } from "./build-track-index.mjs";
11
10
 
12
11
  const __filename = fileURLToPath(import.meta.url);
13
12
  const __dirname = path.dirname(__filename);
13
+ const CODEX_SESSION_DIR_NAMES = ["sessions", "archived_sessions"];
14
+ const SECRET_PATTERNS = [
15
+ /npm_[A-Za-z0-9]+/g,
16
+ /github_pat_[A-Za-z0-9_]+/g,
17
+ /gh[pousr]_[A-Za-z0-9]+/g,
18
+ /sk-[A-Za-z0-9]+/g,
19
+ /sk_[A-Za-z0-9]+/g,
20
+ /fc-[A-Za-z0-9]+/g,
21
+ /AIza[0-9A-Za-z\-_]{20,}/g,
22
+ ];
23
+ const MAX_RECENT_TURNS = 25;
14
24
 
15
25
  function detectProjectRoot() {
16
26
  const scriptBasedRoot = findProjectRoot(path.resolve(__dirname, "../.."));
@@ -49,11 +59,6 @@ function runCommand(command, cwd) {
49
59
  }
50
60
  }
51
61
 
52
- function safeExec(command, cwd) {
53
- const result = runCommand(command, cwd);
54
- return result.ok ? result.stdout : "";
55
- }
56
-
57
62
  function escapeRegex(value) {
58
63
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
59
64
  }
@@ -116,18 +121,6 @@ function renderPullRequestBlock(result, emptyMessage) {
116
121
  return result.stdout || emptyMessage;
117
122
  }
118
123
 
119
- const CODEX_SESSION_DIR_NAMES = ["sessions", "archived_sessions"];
120
- const SECRET_PATTERNS = [
121
- /npm_[A-Za-z0-9]+/g,
122
- /github_pat_[A-Za-z0-9_]+/g,
123
- /gh[pousr]_[A-Za-z0-9]+/g,
124
- /sk-[A-Za-z0-9]+/g,
125
- /sk_[A-Za-z0-9]+/g,
126
- /fc-[A-Za-z0-9]+/g,
127
- /AIza[0-9A-Za-z\-_]{20,}/g,
128
- ];
129
- const MAX_RECENT_TURNS = 25;
130
-
131
124
  function codexHome() {
132
125
  return process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
133
126
  }
@@ -491,9 +484,7 @@ function writeRecentThread(contextDir, projectRoot, threadIdOverride = null) {
491
484
  `- Session cwd: \`${snapshot.sessionCwd}\``,
492
485
  `- Included turns: ${selectedTurns.length} of ${snapshot.turns.length} meaningful turns`,
493
486
  `- Compactions in source session: ${snapshot.compactionCount}`,
494
- snapshot.selectedFromPreCompaction
495
- ? "- Selection rule: take the 25 meaningful turns immediately before the last compaction."
496
- : "- Selection rule: no compaction found, so take the latest meaningful turns from the local transcript.",
487
+ "- Selection rule: take the 25 meaningful turns immediately before the last compaction.",
497
488
  "- Noise filter: bootstrap AGENTS payloads are excluded.",
498
489
  "- Secret handling: obvious token formats are redacted before writing this file.",
499
490
  "",
@@ -512,91 +503,14 @@ function writeRecentThread(contextDir, projectRoot, threadIdOverride = null) {
512
503
  return filePath;
513
504
  }
514
505
 
515
- function writeContextFile(contextDir, name, title, body) {
516
- const filePath = path.join(contextDir, name);
517
- const content = `# ${title}\n\n${body && body.trim().length > 0 ? body.trim() : "None."}\n`;
518
- writeFileSync(filePath, content, "utf8");
519
- return filePath;
520
- }
521
-
522
- function writeActiveTrackers(contextDir, projectRoot, activeTracks) {
523
- return writeContextFile(
524
- contextDir,
525
- "ACTIVE_TRACKERS.md",
526
- "Active Trackers",
527
- activeTracks.length === 0
528
- ? "No active tracker files found."
529
- : [
530
- "These trackers should be read when resuming long-running work:",
531
- "",
532
- ...activeTracks.map((trackPath) => `- \`${trackPath}\``),
533
- ].join("\n"),
534
- );
535
- }
536
-
537
- function writeActivePlans(contextDir, projectRoot) {
538
- const activePlansPath = path.join(projectRoot, ".waypoint", "ACTIVE_PLANS.md");
539
- return writeContextFile(
540
- contextDir,
541
- "ACTIVE_PLANS.md",
542
- "Active Plans",
543
- existsSync(activePlansPath)
544
- ? [
545
- "Read this file before meaningful implementation when approved plan work is in flight:",
546
- "",
547
- `- \`${path.relative(projectRoot, activePlansPath)}\``,
548
- ].join("\n")
549
- : "`.waypoint/ACTIVE_PLANS.md` is missing.",
550
- );
551
- }
552
-
553
- function main() {
554
- const projectRoot = detectProjectRoot();
555
- const contextDir = path.join(projectRoot, ".waypoint", "context");
556
- ensureDir(contextDir);
557
- const threadIdFlagIndex = process.argv.indexOf("--thread-id");
558
- const threadIdOverride =
559
- threadIdFlagIndex >= 0 && threadIdFlagIndex + 1 < process.argv.length
560
- ? process.argv[threadIdFlagIndex + 1]
561
- : null;
562
-
563
- const docsIndexPath = writeDocsIndex(projectRoot);
564
- const { outputPath: tracksIndexPath, activeTracks } = writeTracksIndex(projectRoot);
565
- const codingAgent = loadCodingAgent(projectRoot);
566
- const codingAgentLabelText = codingAgentLabel(codingAgent);
567
-
506
+ function writeSnapshot(contextDir, projectRoot) {
507
+ const filePath = path.join(contextDir, "SNAPSHOT.md");
568
508
  const currentTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
569
509
  const currentLocalDatetime = new Date().toString();
570
510
 
571
- const uncommittedChangesPath = writeContextFile(
572
- contextDir,
573
- "UNCOMMITTED_CHANGES.md",
574
- "Uncommitted Changes",
575
- (() => {
576
- const status = runCommand(["git", "status", "--short", "--branch"], projectRoot);
577
- const unstaged = runCommand(["git", "diff", "--stat"], projectRoot);
578
- const staged = runCommand(["git", "diff", "--stat", "--cached"], projectRoot);
579
- return [
580
- "## Status",
581
- "",
582
- "```",
583
- renderCommandBlock(status, "No uncommitted changes."),
584
- "```",
585
- "",
586
- "## Diff Stat",
587
- "",
588
- "```",
589
- renderCommandBlock(unstaged, "No unstaged tracked diff."),
590
- "```",
591
- "",
592
- "## Staged Diff Stat",
593
- "",
594
- "```",
595
- renderCommandBlock(staged, "No staged diff."),
596
- "```",
597
- ].join("\n");
598
- })()
599
- );
511
+ const status = runCommand(["git", "status", "--short", "--branch"], projectRoot);
512
+ const unstaged = runCommand(["git", "diff", "--stat"], projectRoot);
513
+ const staged = runCommand(["git", "diff", "--stat", "--cached"], projectRoot);
600
514
 
601
515
  const authorFilter = currentAuthorFilter(projectRoot);
602
516
  const recentCommitsResult = authorFilter
@@ -606,128 +520,129 @@ function main() {
606
520
  stdout: "",
607
521
  stderr: "Could not determine current git author from local git config.",
608
522
  };
609
- const recentCommitsPath = writeContextFile(
610
- contextDir,
611
- "RECENT_COMMITS.md",
612
- "Recent Commits",
523
+
524
+ const prContext = githubPullRequestContext(projectRoot);
525
+ const openPrs = prContext.ok
526
+ ? runCommand(
527
+ [
528
+ "gh",
529
+ "pr",
530
+ "list",
531
+ "--repo",
532
+ prContext.repo,
533
+ "--state",
534
+ "open",
535
+ "--author",
536
+ prContext.viewer,
537
+ "--limit",
538
+ "5",
539
+ "--json",
540
+ "number,title,author,headRefName",
541
+ "--template",
542
+ "{{range .}}#{{.number}} {{.title}} ({{.author.login}}) [{{.headRefName}}]\n{{end}}",
543
+ ],
544
+ projectRoot
545
+ )
546
+ : prContext;
547
+ const mergedPrs = prContext.ok
548
+ ? runCommand(
549
+ [
550
+ "gh",
551
+ "pr",
552
+ "list",
553
+ "--repo",
554
+ prContext.repo,
555
+ "--state",
556
+ "merged",
557
+ "--author",
558
+ prContext.viewer,
559
+ "--limit",
560
+ "5",
561
+ "--json",
562
+ "number,title,author,mergedAt",
563
+ "--template",
564
+ "{{range .}}#{{.number}} {{.title}} ({{.author.login}}) merged {{timeago .mergedAt}}\n{{end}}",
565
+ ],
566
+ projectRoot
567
+ )
568
+ : prContext;
569
+
570
+ writeFileSync(
571
+ filePath,
613
572
  [
573
+ "# Snapshot",
574
+ "",
575
+ "Generated volatile context for the current repo state.",
576
+ "",
577
+ "## Context Snapshot",
578
+ "",
579
+ `- Local timezone: ${currentTimezone}`,
580
+ `- Current local datetime: ${currentLocalDatetime}`,
581
+ "",
582
+ "## Git Status",
583
+ "",
584
+ "```",
585
+ renderCommandBlock(status, "No uncommitted changes."),
586
+ "```",
587
+ "",
588
+ "## Unstaged Diff Stat",
589
+ "",
590
+ "```",
591
+ renderCommandBlock(unstaged, "No unstaged tracked diff."),
592
+ "```",
593
+ "",
594
+ "## Staged Diff Stat",
595
+ "",
596
+ "```",
597
+ renderCommandBlock(staged, "No staged diff."),
598
+ "```",
599
+ "",
600
+ "## Recent Commits",
601
+ "",
614
602
  authorFilter ? `Author filter: ${authorFilter.label}` : "Author filter: unavailable",
615
603
  "",
616
604
  "```",
617
605
  renderCommandBlock(recentCommitsResult, "No recent commits found for the current author."),
618
606
  "```",
619
- ].join("\n")
620
- );
621
-
622
- const prContext = githubPullRequestContext(projectRoot);
623
- const openPrs =
624
- prContext.ok
625
- ? runCommand(
626
- [
627
- "gh",
628
- "pr",
629
- "list",
630
- "--repo",
631
- prContext.repo,
632
- "--state",
633
- "open",
634
- "--author",
635
- prContext.viewer,
636
- "--limit",
637
- "5",
638
- "--json",
639
- "number,title,author,headRefName",
640
- "--template",
641
- "{{range .}}#{{.number}} {{.title}} ({{.author.login}}) [{{.headRefName}}]\n{{end}}",
642
- ],
643
- projectRoot
644
- )
645
- : prContext;
646
- const mergedPrs =
647
- prContext.ok
648
- ? runCommand(
649
- [
650
- "gh",
651
- "pr",
652
- "list",
653
- "--repo",
654
- prContext.repo,
655
- "--state",
656
- "merged",
657
- "--author",
658
- prContext.viewer,
659
- "--limit",
660
- "5",
661
- "--json",
662
- "number,title,author,mergedAt",
663
- "--template",
664
- "{{range .}}#{{.number}} {{.title}} ({{.author.login}}) merged {{timeago .mergedAt}}\n{{end}}",
665
- ],
666
- projectRoot
667
- )
668
- : prContext;
669
- const prsPath = writeContextFile(
670
- contextDir,
671
- "PULL_REQUESTS.md",
672
- "Pull Requests",
673
- [
607
+ "",
608
+ "## Pull Requests",
609
+ "",
674
610
  prContext.ok ? `GitHub viewer: ${prContext.viewer}` : `GitHub context: ${prContext.error}`,
675
611
  prContext.ok ? `GitHub repo: ${prContext.repo}` : "",
676
612
  "",
677
- "## Open PRs",
613
+ "### Open PRs",
678
614
  "",
679
615
  "```",
680
616
  renderPullRequestBlock(openPrs, "No open PRs found for the current GitHub user."),
681
617
  "```",
682
618
  "",
683
- "## Recently Merged PRs",
619
+ "### Recently Merged PRs",
684
620
  "",
685
621
  "```",
686
622
  renderPullRequestBlock(mergedPrs, "No recently merged PRs found for the current GitHub user."),
687
623
  "```",
688
- ].join("\n")
624
+ "",
625
+ ].join("\n"),
626
+ "utf8"
689
627
  );
690
- const recentThreadPath = writeRecentThread(contextDir, projectRoot, threadIdOverride);
691
- const activePlansPath = writeActivePlans(contextDir, projectRoot);
692
- const activeTrackersPath = writeActiveTrackers(contextDir, projectRoot, activeTracks);
693
628
 
694
- const manifestPath = path.join(contextDir, "MANIFEST.md");
695
- const manifestLines = [
696
- "# Waypoint Context Manifest",
697
- "",
698
- "Read every file listed below. This manifest is a required session-start context bundle.",
699
- "",
700
- "## Context Snapshot",
701
- "",
702
- `- Local timezone: ${currentTimezone}`,
703
- `- Current local datetime: ${currentLocalDatetime}`,
704
- "",
705
- "## Required generated files",
706
- "",
707
- `- \`${path.relative(projectRoot, uncommittedChangesPath)}\` — uncommitted change summary`,
708
- `- \`${path.relative(projectRoot, recentCommitsPath)}\` — recent commits`,
709
- `- \`${path.relative(projectRoot, prsPath)}\` — open and recently merged pull requests`,
710
- `- \`${path.relative(projectRoot, recentThreadPath)}\` — latest meaningful turns from the local ${codingAgentLabelText} session for this repo`,
711
- `- \`${path.relative(projectRoot, activePlansPath)}\` — active plan summary`,
712
- `- \`${path.relative(projectRoot, docsIndexPath)}\` — current docs index`,
713
- `- \`${path.relative(projectRoot, tracksIndexPath)}\` — current tracker index`,
714
- `- \`${path.relative(projectRoot, activeTrackersPath)}\` — active tracker summary`,
715
- "",
716
- "## Stable source-of-truth files to read before this manifest",
717
- "",
718
- "- `.waypoint/SOUL.md`",
719
- "- `.waypoint/agent-operating-manual.md`",
720
- "- `.waypoint/WORKSPACE.md`",
721
- "- `.waypoint/ACTIVE_PLANS.md`",
722
- "",
723
- "## Active tracker files to read after this manifest",
724
- "",
725
- ...(activeTracks.length > 0 ? activeTracks.map((trackPath) => `- \`${trackPath}\``) : ["- None."]),
726
- "",
727
- `Generated by: \`${path.relative(projectRoot, fileURLToPath(import.meta.url))}\``,
728
- "",
729
- ];
730
- writeFileSync(manifestPath, `${manifestLines.join("\n")}`, "utf8");
629
+ return filePath;
630
+ }
631
+
632
+ function main() {
633
+ const projectRoot = detectProjectRoot();
634
+ const contextDir = path.join(projectRoot, ".waypoint", "context");
635
+ ensureDir(contextDir);
636
+
637
+ const threadIdFlagIndex = process.argv.indexOf("--thread-id");
638
+ const threadIdOverride =
639
+ threadIdFlagIndex >= 0 && threadIdFlagIndex + 1 < process.argv.length
640
+ ? process.argv[threadIdFlagIndex + 1]
641
+ : null;
642
+
643
+ writeDocsIndex(projectRoot);
644
+ writeSnapshot(contextDir, projectRoot);
645
+ writeRecentThread(contextDir, projectRoot, threadIdOverride);
731
646
 
732
647
  console.log(`Prepared Waypoint context in ${contextDir}`);
733
648
  }
@@ -1,6 +1,6 @@
1
1
  # Workspace
2
2
 
3
- Timestamp discipline: Prefix new or materially revised bullets in `Active Plans`, `Active Trackers`, `Current State`, `In Progress`, `Next`, `Parked`, and `Done Recently` with `[YYYY-MM-DD HH:MM TZ]`.
3
+ Timestamp discipline: Prefix new or materially revised bullets in `Active Plans`, `Current State`, `In Progress`, `Next`, `Parked`, and `Done Recently` with `[YYYY-MM-DD HH:MM TZ]`.
4
4
 
5
5
  ## Active Goal
6
6
 
@@ -8,11 +8,7 @@ Describe the main thing currently being built or changed.
8
8
 
9
9
  ## Active Plans
10
10
 
11
- Point at `.waypoint/ACTIVE_PLANS.md` and note the currently active approved plan and phase.
12
-
13
- ## Active Trackers
14
-
15
- List any active tracker docs under `.waypoint/track/`, with the current phase or next step.
11
+ Point at `.waypoint/ACTIVE_PLANS.md` and note the currently active approved plan or execution focus.
16
12
 
17
13
  ## Current State
18
14