Skip to content

Conversation

@dkmos2016
Copy link
Contributor

@dkmos2016 dkmos2016 commented Nov 2, 2025

Summary by CodeRabbit

  • New Features

    • iFlow integration added with project configurator and native slash-command support (proposal, apply, archive), including scaffolding and update behavior.
  • Documentation

    • README updated to list iFlow native slash commands and command directory location.
  • Tests

    • New tests for creating and refreshing iFlow command files and for updating the iFlow configuration file.

✏️ Tip: You can customize this high-level summary in your review settings.

@dkmos2016 dkmos2016 requested a review from TabishB as a code owner November 2, 2025 14:06
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 2, 2025

Walkthrough

Adds iFlow support: new AI tool entry, an Iflow ToolConfigurator, an Iflow SlashCommandConfigurator, registration of both configurators in their registries, README documentation update, and new tests for init/update behaviors.

Changes

Cohort / File(s) Summary
Tool List
src/core/config.ts
Added new AI tool entry { name: 'iFlow', value: 'iflow', available: true, successLabel: 'iFlow' } to AI_TOOLS.
Tool Configurator
src/core/configurators/iflow.ts
Added IflowConfigurator implementing ToolConfigurator with public properties (name, configFileName, isAvailable) and async configure(projectPath: string, openspecDir: string): Promise<void> which fetches a Claude template and updates IFLOW.md using OPENSPEC_MARKERS.
Configurator Registry
src/core/configurators/registry.ts
Imported and instantiated IflowConfigurator, registered it in the tool registry under id 'iflow'.
Slash Command Configurator
src/core/configurators/slash/iflow.ts
Added IflowSlashCommandConfigurator extending SlashCommandConfigurator; defines toolId = 'iflow', isAvailable = true, FILE_PATHS and FRONTMATTER mappings for proposal, apply, archive, plus getRelativePath and getFrontmatter helpers.
Slash Registry
src/core/configurators/slash/registry.ts
Imported and registered IflowSlashCommandConfigurator in the slash-configurator registry.
Docs
README.md
Added a new row for iFlow (iflow-cli) to the "Native Slash Commands" table showing commands and .iflow/commands/ location.
Tests
test/core/init.test.ts, test/core/update.test.ts
Added tests verifying iFlow init creates .iflow/commands/*.md with templates, markers and guardrails; added tests verifying update refreshes IFLOW slash commands and updates IFLOW.md.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant ToolRegistry
  participant IflowConfigurator
  participant TemplateManager
  participant FileSystemUtils

  User->>ToolRegistry: request configure 'iflow' (projectPath, openspecDir)
  ToolRegistry->>IflowConfigurator: configure(...)
  IflowConfigurator->>TemplateManager: getClaudeTemplate('iflow' / IFLOW)
  TemplateManager-->>IflowConfigurator: template content
  IflowConfigurator->>FileSystemUtils: updateFileWithMarkers(targetPath(IFLOW.md), OPENSPEC_MARKERS, content)
  FileSystemUtils-->>IflowConfigurator: file created/updated
  IflowConfigurator-->>ToolRegistry: done
  ToolRegistry-->>User: success
Loading
sequenceDiagram
  autonumber
  participant User
  participant SlashRegistry
  participant IflowSlashConfigurator
  participant FileSystemUtils

  User->>SlashRegistry: create/update slash command (proposal/apply/archive)
  SlashRegistry->>IflowSlashConfigurator: getRelativePath(id) / getFrontmatter(id)
  IflowSlashConfigurator->>FileSystemUtils: ensure file at .iflow/commands/... with frontmatter & template body
  FileSystemUtils-->>IflowSlashConfigurator: file ensured/updated
  IflowSlashConfigurator-->>SlashRegistry: configured
  SlashRegistry-->>User: success
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to inspect closely:
    • src/core/configurators/iflow.ts — template selection call and correct use of OPENSPEC_MARKERS when updating IFLOW.md.
    • src/core/configurators/slash/iflow.ts — correctness of FILE_PATHS and FRONTMATTER mappings and path handling.
    • Tests in test/core/init.test.ts and test/core/update.test.ts — ensure assertions match templates/markers and cleanup/setup are robust.

Possibly related PRs

Suggested reviewers

  • TabishB

Poem

🐇 I hopped through code to plant a new light,
IFLOW paths gleam in folders at night,
Templates tucked under markers so neat,
Commands now ready — a tidy small feat,
A rabbit winks, the repo feels bright.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main objective of the PR: adding iFlow-cli integration to the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9cdb074 and 49ada35.

📒 Files selected for processing (5)
  • src/core/config.ts (1 hunks)
  • src/core/configurators/iflow.ts (1 hunks)
  • src/core/configurators/registry.ts (2 hunks)
  • src/core/configurators/slash/iflow.ts (1 hunks)
  • src/core/configurators/slash/registry.ts (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
src/core/configurators/iflow.ts (5)
src/core/configurators/base.ts (1)
  • ToolConfigurator (1-6)
src/core/templates/index.ts (1)
  • TemplateManager (14-47)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-187)
src/core/config.ts (1)
  • OPENSPEC_MARKERS (3-6)
src/core/configurators/claude.ts (1)
  • ClaudeConfigurator (7-23)
src/core/configurators/registry.ts (2)
src/core/configurators/iflow.ts (1)
  • IflowConfigurator (7-23)
src/core/configurators/base.ts (1)
  • ToolConfigurator (1-6)
src/core/configurators/slash/registry.ts (1)
src/core/configurators/slash/iflow.ts (1)
  • IflowSlashCommandConfigurator (31-42)

Comment on lines +14 to +21
const content = TemplateManager.getClaudeTemplate();

await FileSystemUtils.updateFileWithMarkers(
filePath,
content,
OPENSPEC_MARKERS.start,
OPENSPEC_MARKERS.end
);
Copy link
Contributor

@coderabbitai coderabbitai bot Nov 2, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use an iFlow-specific template for IFLOW.md content.

Lines 14-21 call TemplateManager.getClaudeTemplate(), which writes Claude-specific guidance into IFLOW.md. That gives users the wrong setup steps for iFlow. Please add an iFlow template (e.g., TemplateManager.getIflowTemplate()) and use it here so the configurator emits the correct instructions.

🤖 Prompt for AI Agents
In src/core/configurators/iflow.ts around lines 14 to 21, the configurator is
using TemplateManager.getClaudeTemplate() which injects Claude-specific guidance
into IFLOW.md; replace that call with TemplateManager.getIflowTemplate() so the
file contains iFlow-specific instructions, and if getIflowTemplate doesn't exist
add it to TemplateManager (or import the correct iFlow template function)
returning the proper iFlow content; keep the subsequent
FileSystemUtils.updateFileWithMarkers call unchanged.

Choose a reason for hiding this comment

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

while ClaudeTemplate also works for iflow or other cli.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ydai-hub, thank you for clarifying! I understand now that the Claude template is generic enough to work with iFlow and other CLI tools, so using getClaudeTemplate() here is appropriate.


✏️ Learnings added
Learnt from: ydai-hub
Repo: Fission-AI/OpenSpec PR: 268
File: src/core/configurators/iflow.ts:14-21
Timestamp: 2025-11-17T12:07:21.674Z
Learning: In the OpenSpec repository, `TemplateManager.getClaudeTemplate()` returns a generic template that works for iFlow and other CLI tools, not just Claude-specific content. It's acceptable to use this template across different tool configurators.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@PanAndy
Copy link

PanAndy commented Nov 3, 2025

Could someone review this?
I’d like to use OpenSpec with the iflow-cli. Thanks!

@PanAndy
Copy link

PanAndy commented Nov 4, 2025

This PR could update the 'Supported AI Tools' section in README.md and also add iflow to Native Slash Commands.
@dkmos2016

peter10012 pushed a commit to xxmime/OpenSpec that referenced this pull request Nov 4, 2025
…sion-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.
@dkmos2016
Copy link
Contributor Author

This PR could update the 'Supported AI Tools' section in README.md and also add iflow to Native Slash Commands. @dkmos2016

done

peter10012 pushed a commit to xxmime/OpenSpec that referenced this pull request Nov 17, 2025
…sion-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.
peter10012 pushed a commit to xxmime/OpenSpec that referenced this pull request Nov 17, 2025
…sion-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.
@TabishB
Copy link
Contributor

TabishB commented Nov 17, 2025

Hey @ydai-hub Happy to get this merged in, although this is missing some tests for the init and update flow. Take a look at what we currently have.

Take a look at this PR for reference on the things we need: #288

@dkmos2016 dkmos2016 changed the title support iflow-cli feat(iflow-cli): add RooCode integration Nov 18, 2025
@dkmos2016 dkmos2016 changed the title feat(iflow-cli): add RooCode integration feat(iflow-cli): add iFlow-cli integration Nov 18, 2025
…sion-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1423eb and 6fd6f64.

📒 Files selected for processing (8)
  • README.md (1 hunks)
  • src/core/config.ts (1 hunks)
  • src/core/configurators/iflow.ts (1 hunks)
  • src/core/configurators/registry.ts (3 hunks)
  • src/core/configurators/slash/iflow.ts (1 hunks)
  • src/core/configurators/slash/registry.ts (3 hunks)
  • test/core/init.test.ts (1 hunks)
  • test/core/update.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/core/configurators/slash/registry.ts
  • README.md
  • src/core/configurators/slash/iflow.ts
  • src/core/config.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-17T12:07:21.701Z
Learnt from: ydai-hub
Repo: Fission-AI/OpenSpec PR: 268
File: src/core/configurators/iflow.ts:14-21
Timestamp: 2025-11-17T12:07:21.701Z
Learning: In the OpenSpec repository, `TemplateManager.getClaudeTemplate()` returns a generic template that works for iFlow and other CLI tools, not just Claude-specific content. It's acceptable to use this template across different tool configurators.

Applied to files:

  • src/core/configurators/iflow.ts
🧬 Code graph analysis (4)
src/core/configurators/registry.ts (2)
src/core/configurators/iflow.ts (1)
  • IflowConfigurator (7-23)
src/core/configurators/base.ts (1)
  • ToolConfigurator (1-6)
test/core/init.test.ts (1)
src/utils/file-system.ts (1)
  • fileExists (76-86)
test/core/update.test.ts (1)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-187)
src/core/configurators/iflow.ts (4)
src/core/configurators/base.ts (1)
  • ToolConfigurator (1-6)
src/core/templates/index.ts (1)
  • TemplateManager (14-47)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-187)
src/core/config.ts (1)
  • OPENSPEC_MARKERS (3-6)
🔇 Additional comments (3)
src/core/configurators/iflow.ts (1)

1-23: LGTM!

The IflowConfigurator implementation is clean and consistent with other tool configurators. The unused openspecDir parameter is acceptable since IFLOW.md is written to the project root, matching the pattern of CLAUDE.md and CLINE.md.

Based on learnings.

src/core/configurators/registry.ts (1)

7-7: LGTM!

The IflowConfigurator registration follows the established pattern consistently with other tool registrations.

Also applies to: 20-20, 29-29

test/core/init.test.ts (1)

456-471: LGTM!

The test correctly validates that existing IFLOW.md is updated with OpenSpec markers while preserving custom content.

Comment on lines +667 to +712
it('should refresh existing IFLOW slash commands', async () => {
const iflowProposal = path.join(
testDir,
'.iflow/commands/openspec-proposal.md'
);
await fs.mkdir(path.dirname(iflowProposal), { recursive: true });
const initialContent = `description: Scaffold a new OpenSpec change and validate strictly."
prompt = """
<!-- OPENSPEC:START -->
Old IFlow body
<!-- OPENSPEC:END -->
"""
`;
await fs.writeFile(iflowProposal, initialContent);

const consoleSpy = vi.spyOn(console, 'log');

await updateCommand.execute(testDir);

const updated = await fs.readFile(iflowProposal, 'utf-8');
expect(updated).toContain('description: Scaffold a new OpenSpec change and validate strictly.');
expect(updated).toContain('<!-- OPENSPEC:START -->');
expect(updated).toContain('**Guardrails**');
expect(updated).toContain('<!-- OPENSPEC:END -->');
expect(updated).not.toContain('Old IFlow body');

const iflowApply = path.join(
testDir,
'.iflow/commands/openspec-apply.md'
);
const iflowArchive = path.join(
testDir,
'.iflow/commands/openspec-archive.md'
);

await expect(FileSystemUtils.fileExists(iflowApply)).resolves.toBe(false);
await expect(FileSystemUtils.fileExists(iflowArchive)).resolves.toBe(false);

const [logMessage] = consoleSpy.mock.calls[0];
expect(logMessage).toContain(
'Updated slash commands: .iflow/commands/openspec-proposal.md'
);

consoleSpy.mockRestore();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix the inconsistent file format in the test.

The initialContent (lines 673-680) mixes markdown and TOML syntax. It starts with description: (markdown frontmatter style) but then includes prompt = """ (TOML style). Based on the init test (line 442 in init.test.ts), iFlow uses markdown format with a frontmatter description, not TOML.

Update the initialContent to use consistent markdown format:

-    const initialContent = `description: Scaffold a new OpenSpec change and validate strictly."
-
-prompt = """
-<!-- OPENSPEC:START -->
-Old IFlow body
-<!-- OPENSPEC:END -->
-"""
-`;
+    const initialContent = `description: Scaffold a new OpenSpec change and validate strictly.
+
+<!-- OPENSPEC:START -->
+Old IFlow body
+<!-- OPENSPEC:END -->
+`;

Also remove the TOML-style prompt assertion on line 689 if it doesn't apply to the markdown format.

🤖 Prompt for AI Agents
In test/core/update.test.ts around lines 667 to 712, the test's initialContent
mixes TOML-style prompt syntax with a markdown frontmatter description; replace
initialContent with a consistent markdown file: add a YAML/markdown frontmatter
block for description (--- description: ... ---) followed by the OPENSPEC body
(the <!-- OPENSPEC:START -->...<!-- OPENSPEC:END --> segment) so the file
matches the project's markdown command format, and remove any assertion that
expects TOML-style prompt syntax (e.g., a check for `prompt = """` or similar)
around line 689 so the test only asserts markdown-appropriate content.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/core/init.test.ts (1)

419-453: LGTM! Critical issue from previous review has been resolved.

The problematic testDir reassignment that was flagged in the past review comment has been fixed. Line 421 now correctly uses the sandboxed testDir from beforeEach, preventing test artifacts from polluting the project repository.

The test structure follows established patterns and validates:

  • File creation in .iflow/commands/ directory
  • Template content including descriptions and OPENSPEC markers
  • Key workflow instructions

Consider adding an extend mode test for iFlow.

Most other tools have a corresponding extend mode test that verifies the tool is marked as "already configured" during subsequent init runs (e.g., lines 915-925 for Qwen, lines 937-947 for Windsurf). Adding a similar test for iFlow would ensure consistency:

it('should mark IFlow as already configured during extend mode', async () => {
  queueSelections('iflow', DONE, 'iflow', DONE);
  await initCommand.execute(testDir);
  await initCommand.execute(testDir);

  const secondRunArgs = mockPrompt.mock.calls[1][0];
  const iflowChoice = secondRunArgs.choices.find(
    (choice: any) => choice.value === 'iflow'
  );
  expect(iflowChoice.configured).toBe(true);
});
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6fd6f64 and 705c34a.

📒 Files selected for processing (2)
  • test/core/init.test.ts (1 hunks)
  • test/core/update.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/core/update.test.ts
🧰 Additional context used
🧬 Code graph analysis (1)
test/core/init.test.ts (1)
src/utils/file-system.ts (1)
  • fileExists (76-86)
🔇 Additional comments (1)
test/core/init.test.ts (1)

455-470: LGTM!

The test correctly validates that the init command:

  • Injects OPENSPEC markers into an existing IFLOW.md file
  • Preserves custom user content
  • Adds the reference to @/openspec/AGENTS.md and update instructions

The test structure follows the established pattern used for other tools (CLAUDE.md, CLINE.md, QWEN.md) and properly uses the sandboxed test directory.

@dkmos2016
Copy link
Contributor Author

dkmos2016 commented Nov 20, 2025

Actionable comments posted: 2

fix conflicts and add UTs. could you help review again? @TabishB

Copy link
Contributor

@TabishB TabishB left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the updates @dkmos2016!!

@TabishB TabishB merged commit 19ccaab into Fission-AI:main Nov 20, 2025
7 checks passed
Balancor pushed a commit to Balancor/OpenSpec that referenced this pull request Nov 29, 2025
* support iflow-cli

* docs: add iFlow to supported AI tools in README ([Fission-AI#268](Fission-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.

* add UTs for iflow-cli
Balancor pushed a commit to Balancor/OpenSpec that referenced this pull request Nov 30, 2025
* support iflow-cli

* docs: add iFlow to supported AI tools in README ([Fission-AI#268](Fission-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.

* add UTs for iflow-cli
fenghaitao pushed a commit to fenghaitao/OpenSpec that referenced this pull request Dec 10, 2025
* support iflow-cli

* docs: add iFlow to supported AI tools in README ([Fission-AI#268](Fission-AI#268))

Add iFlow to the Native Slash Commands table in the README. iFlow support was implemented but was missing from the documentation.

* add UTs for iflow-cli
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.

4 participants