Skip to content

feat: add Easy Code as a supported AI tool#1352

Open
redknox wants to merge 3 commits into
Fission-AI:mainfrom
redknox:add-easycode-tool
Open

feat: add Easy Code as a supported AI tool#1352
redknox wants to merge 3 commits into
Fission-AI:mainfrom
redknox:add-easycode-tool

Conversation

@redknox

@redknox redknox commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Adds Easy Code as a supported AI tool in OpenSpec.

Easy Code is a terminal-based AI coding assistant that uses a project-local .easycode/ directory. Its slash commands are stored as TOML files (not Markdown), which required a dedicated adapter.

Changes

File Change
src/core/config.ts Register easycode in AI_TOOLS with skillsDir: '.easycode'
src/core/command-generation/adapters/easycode.ts New TOML adapter
src/core/command-generation/adapters/index.ts Export easycodeAdapter
src/core/command-generation/registry.ts Register easycodeAdapter
src/core/command-generation/toml.ts New TOML serialization helpers

Command format

Easy Code commands use TOML with a description basic string and a prompt basic multiline string:

description = "Propose a new change"

prompt = """
<command body>
"""

Triple-double-quote (""") is used instead of triple-single-quote (''') because basic multiline strings support escape sequences, making it safe to embed arbitrary content (backslashes, control characters, sequences of double quotes).

TOML serialization

src/core/command-generation/toml.ts provides two helpers:

  • escapeTOMLBasicString — escapes \\, ", \n, \r, \t, and all disallowed control characters (U+0000–U+0008, U+000B–U+000C, U+000E–U+001F, U+007F) as \uXXXX
  • escapeTOMLMultilineString — same control-character coverage, preserves real newlines, and escapes runs of 3+ consecutive " to prevent premature block termination

Testing

Tested locally against the compiled package:

openspec init --tools easycode

Output:

  • .easycode/commands/opsx/{propose,explore,apply,sync,archive}.toml — correct TOML format
  • .easycode/skills/openspec-{propose,explore,apply-change,sync-specs,archive-change}/SKILL.md — standard SKILL.md format
  • openspec/config.yaml created

Build: pnpm run build completes with zero TypeScript errors.

- Register 'easycode' in AI_TOOLS (config.ts) with skillsDir '.easycode'
- Add EasycodeAdapter (easycode.ts): generates TOML commands at
  .easycode/commands/opsx/<id>.toml, matching Easy Code's native format
- Export easycodeAdapter from adapters/index.ts
- Register easycodeAdapter in CommandAdapterRegistry

Easy Code (https://easycode.ai) is a terminal-based AI coding assistant.
Its commands use TOML with a description field and a prompt multiline
literal string, distinct from the Markdown/YAML frontmatter format used
by most other tools.

Tested locally: `openspec init --tools easycode` generates 5 SKILL.md
files and 5 .toml command files in the expected directory structure.
@redknox redknox requested a review from TabishB as a code owner July 13, 2026 05:49
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Easy Code as a configured AI tool and introduces a registered adapter that generates .easycode/commands/opsx/<commandId>.toml files with escaped TOML descriptions and multiline prompts.

Changes

Easy Code command support

Layer / File(s) Summary
TOML serialization and Easy Code adapter
src/core/command-generation/toml.ts, src/core/command-generation/adapters/easycode.ts
Adds TOML escaping helpers and an adapter that formats command descriptions and prompts into Easy Code TOML files.
Tool configuration and registry integration
src/core/config.ts, src/core/command-generation/adapters/index.ts, src/core/command-generation/registry.ts
Adds Easy Code to AI_TOOLS, re-exports its adapter, and registers it in CommandAdapterRegistry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CommandGenerator
  participant CommandAdapterRegistry
  participant easycodeAdapter
  participant EasyCodeFile
  CommandGenerator->>CommandAdapterRegistry: resolve easycode adapter
  CommandAdapterRegistry->>easycodeAdapter: format command content
  easycodeAdapter->>EasyCodeFile: write escaped TOML command file
Loading

Possibly related issues

Possibly related PRs

Suggested reviewers: tabishb

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding Easy Code as a supported AI tool.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/command-generation/adapters/easycode.ts`:
- Around line 23-25: Update formatFile to serialize both description and body
with TOML-safe encoding that preserves arbitrary content, including backslashes
and control characters in description and triple single quotes in the prompt
body. Replace the manual escaping and vulnerable literal construction with the
project’s existing TOML serializer if available, and add coverage for all three
cases.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e6d23291-6e2c-4e6c-996b-6237e0fb710c

📥 Commits

Reviewing files that changed from the base of the PR and between 0a99f41 and 15563ec.

📒 Files selected for processing (4)
  • src/core/command-generation/adapters/easycode.ts
  • src/core/command-generation/adapters/index.ts
  • src/core/command-generation/registry.ts
  • src/core/config.ts

Comment thread src/core/command-generation/adapters/easycode.ts Outdated
Per code review: the original formatFile had unsafe manual escaping
that would corrupt output for descriptions containing backslashes or
control characters, and prompt bodies containing triple-single-quotes.

Changes:
- Add src/core/command-generation/toml.ts with two helpers:
    escapeTOMLBasicString  — escapes \, ", \n, \r, \t for TOML
                              basic strings (double-quoted)
    escapeTOMLMultilineString — escapes \ and \r, and breaks any
                              run of 3+ consecutive " (lookahead match)
                              for TOML basic multiline strings
- Switch prompt block from triple-single-quote literal string (''')
  to triple-double-quote basic multiline string ("""), which allows
  full escape sequence support and handles arbitrary body content
- Update easycode.ts to use both helpers

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/command-generation/toml.ts`:
- Around line 18-25: Update both TOML escaping functions, including
escapeTOMLBasicString and its multiline counterpart, to replace every remaining
disallowed control character with a TOML \uXXXX escape. Preserve existing
backslash, quote, newline, carriage-return, and tab handling, while covering
U+0000–U+0008, U+000B–U+000C, U+000E–U+001F, and U+007F according to each string
mode’s allowed characters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2363f698-df0b-4038-a8be-406ee3219017

📥 Commits

Reviewing files that changed from the base of the PR and between 15563ec and b943f36.

📒 Files selected for processing (2)
  • src/core/command-generation/adapters/easycode.ts
  • src/core/command-generation/toml.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/core/command-generation/adapters/easycode.ts

Comment thread src/core/command-generation/toml.ts
Per code review: TOML basic strings forbid U+0000-U+0008, U+000B-U+000C,
U+000E-U+001F, and U+007F. Add escapeControlChars() helper that replaces
these with \uXXXX sequences, and apply it in both escapeTOMLBasicString
and escapeTOMLMultilineString after their named-escape passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant