waypoint-codex 0.1.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 (40) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -0
  3. package/bin/waypoint.js +3 -0
  4. package/dist/src/cli.js +140 -0
  5. package/dist/src/core.js +605 -0
  6. package/dist/src/docs-index.js +95 -0
  7. package/dist/src/templates.js +34 -0
  8. package/dist/src/types.js +1 -0
  9. package/package.json +47 -0
  10. package/templates/.agents/skills/error-audit/SKILL.md +69 -0
  11. package/templates/.agents/skills/error-audit/references/error-patterns.md +37 -0
  12. package/templates/.agents/skills/observability-audit/SKILL.md +67 -0
  13. package/templates/.agents/skills/observability-audit/references/observability-patterns.md +35 -0
  14. package/templates/.agents/skills/planning/SKILL.md +133 -0
  15. package/templates/.agents/skills/ux-states-audit/SKILL.md +63 -0
  16. package/templates/.agents/skills/ux-states-audit/references/ux-patterns.md +34 -0
  17. package/templates/.codex/agents/code-health-reviewer.toml +14 -0
  18. package/templates/.codex/agents/code-reviewer.toml +14 -0
  19. package/templates/.codex/agents/docs-researcher.toml +14 -0
  20. package/templates/.codex/agents/plan-reviewer.toml +14 -0
  21. package/templates/.codex/config.toml +19 -0
  22. package/templates/.gitignore.snippet +3 -0
  23. package/templates/.waypoint/README.md +13 -0
  24. package/templates/.waypoint/SOUL.md +54 -0
  25. package/templates/.waypoint/agent-operating-manual.md +79 -0
  26. package/templates/.waypoint/agents/code-health-reviewer.md +87 -0
  27. package/templates/.waypoint/agents/code-reviewer.md +102 -0
  28. package/templates/.waypoint/agents/docs-researcher.md +73 -0
  29. package/templates/.waypoint/agents/plan-reviewer.md +86 -0
  30. package/templates/.waypoint/automations/README.md +18 -0
  31. package/templates/.waypoint/automations/docs-garden.toml +7 -0
  32. package/templates/.waypoint/automations/repo-health.toml +8 -0
  33. package/templates/.waypoint/config.toml +13 -0
  34. package/templates/.waypoint/rules/README.md +6 -0
  35. package/templates/.waypoint/scripts/build-docs-index.mjs +153 -0
  36. package/templates/.waypoint/scripts/prepare-context.mjs +174 -0
  37. package/templates/WORKSPACE.md +26 -0
  38. package/templates/docs/README.md +16 -0
  39. package/templates/docs/code-guide.md +31 -0
  40. package/templates/managed-agents-block.md +21 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mark Morgan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # Waypoint
2
+
3
+ It gives a repository a clean working contract for Codex:
4
+
5
+ - a small `AGENTS.md` map
6
+ - a live `WORKSPACE.md`
7
+ - indexed `docs/`
8
+ - repo-local skills under `.agents/skills/`
9
+ - optional sync for Codex App automations and user-home rules
10
+
11
+ Waypoint is a standalone Codex-native repository operating system. It is advisory-first, repo-local, and open-source-first.
12
+
13
+ ## Why it exists
14
+
15
+ The next agent should be able to pick up a repository with full context by reading the repository itself.
16
+
17
+ Waypoint pushes projects toward:
18
+
19
+ - docs-first project memory
20
+ - visible operational state
21
+ - explicit session bootstrap
22
+ - battle-tested reusable workflows
23
+ - less hidden magic and less reliance on chat history
24
+
25
+ ## What ships today
26
+
27
+ - `waypoint init` — scaffold the core repository contract
28
+ - `waypoint doctor` — validate repo health and detect drift
29
+ - `waypoint sync` — rebuild `DOCS_INDEX.md` and optionally sync automations/rules into Codex home
30
+ - `waypoint import-legacy` — analyze a legacy repository layout and write an adoption report into a target Waypoint repo
31
+
32
+ ## Install for development
33
+
34
+ From the `projects/waypoint/` directory:
35
+
36
+ ```bash
37
+ npm install
38
+ npm run build
39
+ ```
40
+
41
+ Run directly in development:
42
+
43
+ ```bash
44
+ npm run dev -- --help
45
+ ```
46
+
47
+ Run the compiled CLI after building:
48
+
49
+ ```bash
50
+ node dist/src/cli.js --help
51
+ ```
52
+
53
+ Run the tests:
54
+
55
+ ```bash
56
+ npm test
57
+ ```
58
+
59
+ ## Install for usage
60
+
61
+ Global install:
62
+
63
+ ```bash
64
+ npm install -g waypoint-codex
65
+ ```
66
+
67
+ One-off usage:
68
+
69
+ ```bash
70
+ npx waypoint-codex@latest --help
71
+ ```
72
+
73
+ After upgrading the CLI, refresh a repo's scaffold with:
74
+
75
+ ```bash
76
+ waypoint init --with-automations --with-roles
77
+ waypoint doctor
78
+ ```
79
+
80
+ ## Quick start
81
+
82
+ Initialize a repository:
83
+
84
+ ```bash
85
+ npx tsx src/cli.ts init /path/to/repo
86
+ ```
87
+
88
+ Check repo health:
89
+
90
+ ```bash
91
+ npx tsx src/cli.ts doctor /path/to/repo
92
+ ```
93
+
94
+ Sync optional user-home artifacts:
95
+
96
+ ```bash
97
+ npx tsx src/cli.ts sync /path/to/repo
98
+ ```
99
+
100
+ Analyze a legacy repository layout and scaffold a target Waypoint repo:
101
+
102
+ ```bash
103
+ npx tsx src/cli.ts import-legacy /path/to/source-repo /path/to/new-repo --init-target
104
+ ```
105
+
106
+ ## Repo contract
107
+
108
+ Waypoint creates and manages:
109
+
110
+ ```text
111
+ repo/
112
+ ├── AGENTS.md
113
+ ├── WORKSPACE.md
114
+ ├── DOCS_INDEX.md
115
+ ├── docs/
116
+ ├── .agents/skills/
117
+ └── .waypoint/
118
+ ```
119
+
120
+ Optional packs:
121
+
122
+ - `.waypoint/automations/*.toml`
123
+ - `.waypoint/rules/*.rules`
124
+ - `.codex/config.toml`
125
+ - `.codex/agents/*.toml`
126
+
127
+ ## Shipped Waypoint skills
128
+
129
+ - `planning`
130
+ - `error-audit`
131
+ - `observability-audit`
132
+ - `ux-states-audit`
133
+
134
+ ## Optional role pack
135
+
136
+ If you initialize with `--with-roles`, Waypoint also scaffolds project-scoped Codex role configs for:
137
+
138
+ - `code-health-reviewer`
139
+ - `code-reviewer`
140
+ - `docs-researcher`
141
+ - `plan-reviewer`
142
+
143
+ ## Tested
144
+
145
+ - `waypoint init`
146
+ - `waypoint doctor`
147
+ - `waypoint sync` with real Codex automation TOML output
148
+ - `waypoint import-legacy`
149
+
150
+ ## Notes
151
+
152
+ - Core Waypoint does not require Codex App, Cloud tasks, IDE integration, plugins, or MCP.
153
+ - App automations are supported as an optional declarative sync target.
154
+ - Rules are supported as an optional sync target.
155
+
156
+ For public docs, see [docs/overview.md](docs/overview.md), [docs/architecture.md](docs/architecture.md), [docs/upgrading.md](docs/upgrading.md), [docs/releasing.md](docs/releasing.md), and [docs/importing-existing-repos.md](docs/importing-existing-repos.md).
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/src/cli.js";
3
+
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from "node:util";
3
+ import path from "node:path";
4
+ import process from "node:process";
5
+ import { doctorRepository, importLegacyRepo, initRepository, syncRepository } from "./core.js";
6
+ const VERSION = "0.1.0";
7
+ function resolveRepo(input) {
8
+ return path.resolve(input ?? ".");
9
+ }
10
+ function printFindings(findings) {
11
+ if (findings.length === 0) {
12
+ console.log("Waypoint doctor: no findings.");
13
+ return;
14
+ }
15
+ for (const finding of findings) {
16
+ console.log(`[${finding.severity.toUpperCase()}] ${finding.category}: ${finding.message}`);
17
+ console.log(` Fix: ${finding.remediation}`);
18
+ for (const filePath of finding.paths ?? []) {
19
+ console.log(` Path: ${filePath}`);
20
+ }
21
+ }
22
+ }
23
+ function printHelp() {
24
+ console.log(`usage: waypoint [--version] <command> [options]
25
+
26
+ Commands:
27
+ init Initialize a repository with Waypoint scaffolding
28
+ doctor Validate repository health and report drift
29
+ sync Rebuild docs index and sync optional user-home artifacts
30
+ import-legacy Analyze a legacy repository layout and produce a Waypoint adoption report
31
+ `);
32
+ }
33
+ async function main() {
34
+ const argv = process.argv.slice(2);
35
+ if (argv.length === 0 || argv[0] === "-h" || argv[0] === "--help") {
36
+ printHelp();
37
+ return 0;
38
+ }
39
+ if (argv[0] === "--version") {
40
+ console.log(VERSION);
41
+ return 0;
42
+ }
43
+ const command = argv[0];
44
+ if (command === "init") {
45
+ const { values, positionals } = parseArgs({
46
+ args: argv.slice(1),
47
+ options: {
48
+ "app-friendly": { type: "boolean", default: false },
49
+ "with-roles": { type: "boolean", default: false },
50
+ "with-rules": { type: "boolean", default: false },
51
+ "with-automations": { type: "boolean", default: false }
52
+ },
53
+ allowPositionals: true
54
+ });
55
+ const projectRoot = resolveRepo(positionals[0]);
56
+ const results = initRepository(projectRoot, {
57
+ profile: values["app-friendly"] ? "app-friendly" : "universal",
58
+ withRoles: values["with-roles"],
59
+ withRules: values["with-rules"],
60
+ withAutomations: values["with-automations"]
61
+ });
62
+ for (const line of results) {
63
+ console.log(`- ${line}`);
64
+ }
65
+ return 0;
66
+ }
67
+ if (command === "doctor") {
68
+ const { values, positionals } = parseArgs({
69
+ args: argv.slice(1),
70
+ options: {
71
+ json: { type: "boolean", default: false }
72
+ },
73
+ allowPositionals: true
74
+ });
75
+ const projectRoot = resolveRepo(positionals[0]);
76
+ const findings = doctorRepository(projectRoot);
77
+ if (values.json) {
78
+ console.log(JSON.stringify({ findings }, null, 2));
79
+ }
80
+ else {
81
+ printFindings(findings);
82
+ }
83
+ const severities = new Set(findings.map((finding) => finding.severity));
84
+ if (severities.has("error")) {
85
+ return 2;
86
+ }
87
+ if (severities.has("warn")) {
88
+ return 1;
89
+ }
90
+ return 0;
91
+ }
92
+ if (command === "sync") {
93
+ const { positionals } = parseArgs({
94
+ args: argv.slice(1),
95
+ allowPositionals: true
96
+ });
97
+ const projectRoot = resolveRepo(positionals[0]);
98
+ const results = syncRepository(projectRoot);
99
+ for (const line of results) {
100
+ console.log(`- ${line}`);
101
+ }
102
+ return 0;
103
+ }
104
+ if (command === "import-legacy") {
105
+ const { values, positionals } = parseArgs({
106
+ args: argv.slice(1),
107
+ options: {
108
+ "init-target": { type: "boolean", default: false }
109
+ },
110
+ allowPositionals: true
111
+ });
112
+ if (positionals.length === 0) {
113
+ console.error("import-legacy requires a source repository path.");
114
+ return 2;
115
+ }
116
+ const sourceRepo = resolveRepo(positionals[0]);
117
+ const targetRepo = positionals[1] ? resolveRepo(positionals[1]) : undefined;
118
+ const result = importLegacyRepo(sourceRepo, targetRepo, {
119
+ initTarget: values["init-target"]
120
+ });
121
+ for (const line of result.actions) {
122
+ console.log(`- ${line}`);
123
+ }
124
+ if (!targetRepo) {
125
+ console.log(result.report);
126
+ }
127
+ return 0;
128
+ }
129
+ console.error(`Unknown command: ${command}`);
130
+ printHelp();
131
+ return 2;
132
+ }
133
+ main()
134
+ .then((code) => {
135
+ process.exitCode = code;
136
+ })
137
+ .catch((error) => {
138
+ console.error(error instanceof Error ? error.message : String(error));
139
+ process.exitCode = 1;
140
+ });