Skip to content

feat: add sample workflows and usage documentation#742

Open
chengxiang1997 wants to merge 1 commit into
breaking-brake:mainfrom
chengxiang1997:main
Open

feat: add sample workflows and usage documentation#742
chengxiang1997 wants to merge 1 commit into
breaking-brake:mainfrom
chengxiang1997:main

Conversation

@chengxiang1997
Copy link
Copy Markdown

@chengxiang1997 chengxiang1997 commented Apr 16, 2026

Summary

  • Add two new sample workflows: getting-started (beginner, 7 nodes) and code-review (intermediate, 15 nodes)
  • Update README with comprehensive usage examples section including quick start guide
  • Add i18n translation keys for new samples

Changes

  • resources/samples/getting-started-sample.json - new sample
  • resources/samples/code-review-sample.json - new sample
  • README.md - updated Usage Examples section
  • src/webview/src/i18n/translation-keys.ts - added type definitions
  • src/webview/src/i18n/translations/en.ts - added translations

Test plan

  • Verify sample workflows can be loaded from Start Menu and Toolbar
  • Check all three samples are displayed with correct names and descriptions
  • Verify i18n works correctly

Closes #448

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added two built-in sample workflows: "Getting Started" for beginners and "Code Review" for automated code review processes
    • Sample workflows are now accessible via the Start Menu and toolbar
  • Documentation

    • Updated usage documentation with practical examples and descriptions of available sample workflows
    • Added step-by-step guide for creating your first workflow, including node configuration and connection

- Add getting-started-sample.json (beginner, 7 nodes)
- Add code-review-sample.json (intermediate, 15 nodes)
- Update README with usage examples section and quick start guide
- Add i18n translation keys for new samples
- Addresses issue breaking-brake#448: users can now find usage examples

Co-Authored-By: chengxiang1997 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

This PR introduces two sample workflows (Getting Started and Code Review) as bundled JSON definitions with corresponding documentation and internationalization support. The README is updated to guide users on accessing and using these samples via the UI.

Changes

Cohort / File(s) Summary
Documentation
README.md
Replaced placeholder with Usage Examples section explaining how to access sample workflows via Start Menu/toolbar, listing three named samples with difficulty levels, and providing step-by-step instructions for creating first workflows.
Sample Workflows
resources/samples/code-review-sample.json, resources/samples/getting-started-sample.json
Added two new sample workflow definitions. Code Review workflow (15 nodes) automates PR review with branching logic for submission/edit/cancel. Getting Started workflow (7 nodes) demonstrates basic flow with user input collection, confirmation branching, and restart loop.
Internationalization
src/webview/src/i18n/translation-keys.ts, src/webview/src/i18n/translations/en.ts
Added four new translation keys (sample.gettingStarted.name, sample.gettingStarted.description, sample.codeReview.name, sample.codeReview.description) with corresponding English translations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • PR #719: Both PRs add bundled sample workflow JSON files and corresponding i18n/translation-key modifications to support sample workflows in the studio.

Suggested labels

released

Poem

📚 Two samples bloom in bundled delight,
Getting started and code review done right,
With translations and docs shining bright,
Users now find examples at sight! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add sample workflows and usage documentation' accurately and concisely summarizes the main changes: adding sample workflows and documentation.
Linked Issues check ✅ Passed The PR fully addresses issue #448 by providing sample workflows (getting-started and code-review), documenting usage examples in README, and implementing i18n support for discoverability.
Out of Scope Changes check ✅ Passed All changes are directly scoped to address issue #448: sample workflow files, README documentation, and i18n translations for the samples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

Copy link
Copy Markdown

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 143-146: Update the node counts in the README table and the
meta.nodeCount fields in the sample JSONs to match the actual workflows: change
the Getting Started entry to 8 nodes and the Code Review entry to 11 nodes, and
set meta.nodeCount in getting-started-sample.json to 8 and in
code-review-sample.json to 11; ensure you update the README table row for
"Getting Started" and "Code Review" and the meta.nodeCount property in the
corresponding JSON files (getting-started-sample.json and
code-review-sample.json).

In `@resources/samples/code-review-sample.json`:
- Around line 2-9: The meta.nodeCount value in the JSON metadata is incorrect
(set to 15) and must be updated to match the actual workflow node count (11);
locate the "meta" object and the nodeCount property (meta.nodeCount) in the file
and change its value from 15 to 11 so the metadata accurately reflects the
workflow definition.

In `@resources/samples/getting-started-sample.json`:
- Around line 2-9: The meta.nodeCount value is incorrect (currently 7) and must
reflect the actual workflow node count; update the meta.nodeCount field in
getting-started-sample.json to 8 so it matches the actual number of nodes
defined in the workflow (ensure the change is applied to the "meta.nodeCount"
property).
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 55bfece5-1395-49fd-b8e2-2bf2b130e6df

📥 Commits

Reviewing files that changed from the base of the PR and between a9cdf0d and 436b39f.

📒 Files selected for processing (5)
  • README.md
  • resources/samples/code-review-sample.json
  • resources/samples/getting-started-sample.json
  • src/webview/src/i18n/translation-keys.ts
  • src/webview/src/i18n/translations/en.ts

Comment thread README.md
Comment on lines +143 to +146
|------|------------|-------------|
| **Getting Started** | Beginner | A simple workflow demonstrating basic prompt nodes and branching logic (7 nodes) |
| **Code Review** | Intermediate | An automated code review workflow for GitHub PRs with submission options (15 nodes) |
| **GitHub Issue Planning** | Advanced | A complete workflow: fetch issue, analyze code, verify fixes, and retrospective (29 nodes) |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Node counts in the table don't match the actual sample JSON files.

The table lists:

  • Getting Started: 7 nodes (actual: 8 nodes)
  • Code Review: 15 nodes (actual: 11 nodes)

Please update the node counts to match the actual workflow definitions in:

  • resources/samples/getting-started-sample.json (8 nodes)
  • resources/samples/code-review-sample.json (11 nodes)

This also affects the meta.nodeCount field in both JSON files, which should be corrected as well.

📊 Verification of actual node counts

getting-started-sample.json has 8 nodes:

  1. start-1
  2. prompt-greeting
  3. prompt-task
  4. prompt-summary
  5. ask-confirm
  6. prompt-process
  7. prompt-restart
  8. end-1

code-review-sample.json has 11 nodes:

  1. start-1
  2. prompt-pr-url
  3. prompt-fetch-pr
  4. prompt-changes
  5. prompt-tests
  6. prompt-summary
  7. ask-submit
  8. prompt-submit-review
  9. prompt-edit-review
  10. prompt-cancelled
  11. end-1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 143 - 146, Update the node counts in the README table
and the meta.nodeCount fields in the sample JSONs to match the actual workflows:
change the Getting Started entry to 8 nodes and the Code Review entry to 11
nodes, and set meta.nodeCount in getting-started-sample.json to 8 and in
code-review-sample.json to 11; ensure you update the README table row for
"Getting Started" and "Code Review" and the meta.nodeCount property in the
corresponding JSON files (getting-started-sample.json and
code-review-sample.json).

Comment on lines +2 to +9
"meta": {
"id": "code-review-sample",
"nameKey": "sample.codeReview.name",
"descriptionKey": "sample.codeReview.description",
"difficulty": "intermediate",
"tags": ["code-review", "automation"],
"nodeCount": 15
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incorrect nodeCount in metadata.

The meta.nodeCount field is set to 15, but the actual number of nodes in the workflow is 11. This creates an inconsistency between the metadata and the actual workflow definition.

🔧 Proposed fix
   "meta": {
     "id": "code-review-sample",
     "nameKey": "sample.codeReview.name",
     "descriptionKey": "sample.codeReview.description",
     "difficulty": "intermediate",
     "tags": ["code-review", "automation"],
-    "nodeCount": 15
+    "nodeCount": 11
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"meta": {
"id": "code-review-sample",
"nameKey": "sample.codeReview.name",
"descriptionKey": "sample.codeReview.description",
"difficulty": "intermediate",
"tags": ["code-review", "automation"],
"nodeCount": 15
},
"meta": {
"id": "code-review-sample",
"nameKey": "sample.codeReview.name",
"descriptionKey": "sample.codeReview.description",
"difficulty": "intermediate",
"tags": ["code-review", "automation"],
"nodeCount": 11
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/samples/code-review-sample.json` around lines 2 - 9, The
meta.nodeCount value in the JSON metadata is incorrect (set to 15) and must be
updated to match the actual workflow node count (11); locate the "meta" object
and the nodeCount property (meta.nodeCount) in the file and change its value
from 15 to 11 so the metadata accurately reflects the workflow definition.

Comment on lines +2 to +9
"meta": {
"id": "getting-started-sample",
"nameKey": "sample.gettingStarted.name",
"descriptionKey": "sample.gettingStarted.description",
"difficulty": "beginner",
"tags": ["getting-started", "basic"],
"nodeCount": 7
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Incorrect nodeCount in metadata.

The meta.nodeCount field is set to 7, but the actual number of nodes in the workflow is 8. This creates an inconsistency between the metadata and the actual workflow definition.

🔧 Proposed fix
   "meta": {
     "id": "getting-started-sample",
     "nameKey": "sample.gettingStarted.name",
     "descriptionKey": "sample.gettingStarted.description",
     "difficulty": "beginner",
     "tags": ["getting-started", "basic"],
-    "nodeCount": 7
+    "nodeCount": 8
   },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"meta": {
"id": "getting-started-sample",
"nameKey": "sample.gettingStarted.name",
"descriptionKey": "sample.gettingStarted.description",
"difficulty": "beginner",
"tags": ["getting-started", "basic"],
"nodeCount": 7
},
"meta": {
"id": "getting-started-sample",
"nameKey": "sample.gettingStarted.name",
"descriptionKey": "sample.gettingStarted.description",
"difficulty": "beginner",
"tags": ["getting-started", "basic"],
"nodeCount": 8
},
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/samples/getting-started-sample.json` around lines 2 - 9, The
meta.nodeCount value is incorrect (currently 7) and must reflect the actual
workflow node count; update the meta.nodeCount field in
getting-started-sample.json to 8 so it matches the actual number of nodes
defined in the workflow (ensure the change is applied to the "meta.nodeCount"
property).

@breaking-brake
Copy link
Copy Markdown
Owner

Thanks for adding these samples!

I'd like to push a small follow-up commit to this branch to add the missing translations for the new sample.gettingStarted and sample.codeReview keys (ja / ko / zh-CN / zh-TW), so all locales stay consistent. Since Allow edits from maintainers is enabled, I'll push directly — please let me know if you'd prefer to handle it yourself.

One thing I'd like to explore as a follow-up (not blocking this PR):

  • The Code Review sample could potentially benefit from using a sub-agent for the per-file review step to enable parallel analysis. I'll open a separate PR if I decide to pursue this — flagging it here so it's not a surprise later.

The Getting Started sample looks great as-is; keeping it simple is the right call for a beginner example.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Where can I find some usage or example?

2 participants