feat(cli): Add Codex support and Cursor commands expansion#19
Merged
Conversation
Codex auto-discovers skills from .agents/skills/ per its official docs — the same path our 'no tools detected' fallback already writes to. Add Codex as a first-class detected tool (via .codex/ directory or .codex/config.toml) so the install summary names it explicitly instead of falling back to generic 'no tools detected' wording. Codex receives no commands: custom slash commands are deprecated upstream and skills are the official replacement. While here, expand the Cursor descriptor to include a commands path (.cursor/commands/tskl/) — Cursor 1.6 added commands as a real authored surface, and the harness already supports per-tool commands. Disambiguate the .agents/ lookup (shared between Codex and the fallback) by deriving the wizard's tool map from the canonical TOOLS registry, seeded with AGENTS_FALLBACK first so registered tools win on collision. Refs LINEAR-OSS-5 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refs LINEAR-OSS-5 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refs LINEAR-OSS-5 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the CLI’s tool registry and install behavior to (1) detect OpenAI Codex and treat .agents/ installs as “Codex” when appropriate, and (2) install tskl slash-command files for Cursor in addition to skills. It also updates the wizard’s location prompt hints and syncs the OpenSpec cli-init spec accordingly.
Changes:
- Add Codex as a detected tool (
.codex//.codex/config.toml) that installs skills to.agents/skills/and receives no commands. - Expand Cursor’s tool descriptor to also install embedded commands to
.cursor/commands/tskl/. - Improve wizard location hints to show
detected (ToolName)and update OpenSpec requirements + tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/install/install.ts | Export TOOLS, add Codex descriptor, add Cursor commands support, document .agents collision precedence. |
| packages/cli/src/wizard/index.ts | Derive TOOL_BY_INSTALL_DIR from registry to avoid duplicated descriptors and resolve .agents collisions deterministically. |
| packages/cli/src/wizard/steps/locations.ts | Show detected tool names in install-location hints. |
| packages/cli/test/install.test.ts | Add Codex detection/install tests, Cursor commands install test, and .agents collision ordering test. |
| openspec/specs/cli-init/spec.md | Update Cursor requirements and add Codex requirements / collision behavior requirements. |
| openspec/changes/archive/2026-05-12-add-codex-and-cursor-commands/* | Archive spec-driven change artifacts (proposal/design/tasks/spec delta). |
| .changeset/codex-and-cursor-commands.md | Publish CLI minor version changeset describing Codex + Cursor command additions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Updates from copilot review: - Correct misleading "Claude Code only" comment on command placement; commands are written for any tool descriptor that defines a path. - Rewrite self-contradictory comment in the Codex config.toml detection test to describe the actual assertion. - Replace stale `commands/taskless/` and `.claude/commands/taskless/` references in the cli-init spec with `commands/tskl/` and `.claude/commands/tskl/` so docs match the implementation. - Skip the AGENTS_FALLBACK append in `checkStaleness` when a detected tool already uses `.agents`; prevents duplicate Codex/fallback rows. - Assert the Codex `commands/tskl/` directory does not exist (via readdir) instead of checking a single hard-coded filename. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The CLI subcommand was renamed from `rules` to `rule` in v0.7.0, but several JSDoc comments and active openspec docs still referenced the plural form. Align them with the implementation: - Schema docstrings in `src/schemas/rules-*.ts`, `src/schemas/ast-grep-rule.ts`, and `src/rules/verify-examples.ts` now reference `taskless rule <verb>`. - Active specs (`cli-check`, `cli-help`, `cli`, `cli-rules`, `cli-taskless-bootstrap`) updated to use the singular form. The intentional back-compat references documenting the rename (`cli-rules/spec.md` lines 13, 22, 28, 175) are preserved. No behavior change. Archived openspec changes and CHANGELOG entries are left as historical record. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
thecodedrift
added a commit
that referenced
this pull request
May 12, 2026
Updates from copilot review: - Correct misleading "Claude Code only" comment on command placement; commands are written for any tool descriptor that defines a path. - Rewrite self-contradictory comment in the Codex config.toml detection test to describe the actual assertion. - Replace stale `commands/taskless/` and `.claude/commands/taskless/` references in the cli-init spec with `commands/tskl/` and `.claude/commands/tskl/` so docs match the implementation. - Skip the AGENTS_FALLBACK append in `checkStaleness` when a detected tool already uses `.agents`; prevents duplicate Codex/fallback rows. - Assert the Codex `commands/tskl/` directory does not exist (via readdir) instead of checking a single hard-coded filename. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OpenAI Codex as a first-class detected tool and expand Cursor with slash commands.
Codex auto-discovers skills from
.agents/skills/per its official docs — the same path our "no tools detected" fallback already writes to. So we've been silently shipping into Codex's canonical location, but the install summary said "no tools detected" and used generic fallback wording. This PR detects Codex via.codex/or.codex/config.toml, labels the install summary accordingly, and registers Codex in the tool array. Codex receives no command files: custom slash commands are deprecated upstream and skills are the official replacement.Cursor gains commands: Cursor 1.6 added
.cursor/commands/<name>.mdas a real authored surface (per cursor.com/docs). The harness already supports per-tool commands, so this is just addingcommands: { path: "commands/tskl" }to the Cursor descriptor. Cursor users now get the sametsklslash-command UX Claude users already had.The
.agents/lookup is shared between Codex (installDir: ".agents") andAGENTS_FALLBACK. Disambiguated by deriving the wizard'sTOOL_BY_INSTALL_DIRmap from the canonicalTOOLSregistry, seeded withAGENTS_FALLBACKfirst so registered tools win on collision (Object.fromEntrieskeeps the last value for a duplicate key). ThefindToolByInstallDirectoryhelper ininstall.tsfollows the same ordering — registered tools come before the fallback in the lookup array.Spec changes were synced inline rather than via auto-merge at archive time. The OpenSpec change is archived under
openspec/changes/archive/2026-05-12-add-codex-and-cursor-commands/for reference.Reviewer notes:
TOOLSis new — previously the registry was internal toinstall.ts. Wizard imports it now to avoid duplicating descriptors.detectedtodetected (ToolName). Worth a glance to confirm the formatting reads well in practice..codex/→.agents/skills/taskless/SKILL.md) and Cursor (.cursor/→ both skills and commands written). No Codex CLI was launched against the install — the documented read path is what we wrote to.Refs LINEAR-OSS-5