Skip to content

Commit 4a4e14f

Browse files
rubenmarcusclaude
andauthored
chore(release): v0.2.0 stable release (#171)
* feat: Show rate limit stats and reset time when limit reached Closes github#80 Generated by ralph-starter auto mode * feat: Add session pause/resume for rate limit recovery Closes github#79 Generated by ralph-starter auto mode * fix: improve cleanTaskName to handle list prefixes, HTML, and links Strip numbered list prefixes, bullet markers, HTML tags, markdown links, and collapse whitespace in task names for cleaner display. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: increase task name truncation limits for better readability Increase completed task name limit from 25 to 50 chars and loop header task name limit from 40 to 60 chars so task context is preserved in the CLI output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use terminal width for dynamic task name truncation Replace hardcoded truncation limits with terminal-width-aware helpers. Task names now adapt to the available terminal space instead of cutting at arbitrary character counts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add source integration icons to task name display Show a compact icon (GitHub, Linear, Figma, Notion, etc.) next to task names in the loop header so users can quickly identify where tasks originated from. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: replace shimmer with readable progress text Replace the per-character color cycling shimmer effect with a subtle slow pulse between white and cyan. Much more readable and accessible while still providing visual feedback. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add progress bar and box-drawing utilities Add box.ts with drawBox(), drawSeparator(), and renderProgressBar() helpers. Update ProgressRenderer with iteration tracking, progress bar display, and live cost indicator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: box-drawing headers, startup summary, and completion banner Replace plain separator lines with box-drawing UI throughout the executor. Adds a startup config summary box, per-iteration header boxes with agent/iteration info, and a clean completion banner with stats. Wire progress bar with iteration and cost tracking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add status separators and compact validation feedback Show a status separator between iterations with iteration count, task progress, cost, and elapsed time. Replace verbose validation error output with a compact one-line summary. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: improve skill detection with YAML frontmatter and .agents/skills support - Add .agents/skills/ directory scanning (multi-agent skill sharing) - Support subdirectories with SKILL.md inside (not just flat .md files) - Parse YAML frontmatter for skill name and description - Parse npx add-skill commands from skills.sh - Add findSkill() helper for looking up skills by name - Refactor directory scanning into reusable scanSkillsDir() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: expand skills registry with categories and info command - Add 6 curated skill entries across 4 categories (agents, development, testing, design) - Group skills by category in list output with visual separators - Add 'info' action to show installed skill details - Search now matches against categories - Add interactive browse with categorized choices Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: sync MCP server version with package.json Read version dynamically from package.json instead of hardcoding '0.1.0'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add ralph_list_presets and ralph_fetch_spec MCP tools - Add ralph_list_presets tool to discover all 19 workflow presets by category - Add ralph_fetch_spec tool to preview specs from GitHub, Linear, Notion, and Figma without running the full coding loop - Improve all existing tool descriptions with detailed context for LLM clients - ralph_fetch_spec supports Figma modes (spec, tokens, components, content, assets) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add figma_to_code and batch_issues MCP prompts - Add figma_to_code prompt for Figma design-to-code workflow with framework and mode selection (spec, tokens, components, content) - Add batch_issues prompt for processing multiple GitHub/Linear issues automatically with auto mode - Update fetch_and_build prompt to include Figma as a source option - Update fetch_and_build to use ralph_fetch_spec for preview before building Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: expose activity log as MCP resource Add .ralph/activity.md as a readable MCP resource so Claude Desktop and other MCP clients can access loop execution history, timing data, and cost information. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add smart context windowing to reduce input tokens per iteration Introduces a context builder that progressively narrows the prompt sent to agents across loop iterations. Iteration 1 gets full context (spec + skills + plan), iterations 2-3 get trimmed plan context, and iterations 4+ get minimal context with just the current task. Validation feedback is compressed to reduce token waste. Adds --context-budget flag for optional token budget enforcement. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add Anthropic SDK with prompt caching support Replaces raw fetch calls to Anthropic API with the official @anthropic-ai/sdk, enabling prompt caching via cache_control on system messages. Cache reads are 90% cheaper than regular input tokens. Adds cache-aware pricing to cost tracker with savings metrics displayed in CLI output and activity summaries. Also adds system message support and usage tracking for OpenAI/OpenRouter providers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add Anthropic Batch API support for 50% cost reduction Adds --batch flag to ralph-starter auto command that submits tasks via the Anthropic Batch API instead of running agent loops. Batch requests are processed asynchronously at 50% cost reduction. Includes polling with exponential backoff, progress display, and cost savings summary. Note: batch mode uses the API directly (no tool use), best for planning, code generation, and review tasks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review feedback on MCP tools and prompts - Fix batch_issues prompt: use ralph_run with auto mode instead of incorrectly referencing ralph_fetch_spec for listing issues - Fix handleListPresets category filter: use strict equality instead of substring match to prevent unintended matches - handleFetchSpec already passes path to fetchFromIntegration (linter fix) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review round 2 - Normalize framework casing in figma_to_code prompt (consistent display name) - Guard undefined args in handleListPresets with fallback to empty object - Enforce non-empty path in ralph_fetch_spec schema (.min(1)) and always assign path to options instead of truthiness check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve build errors from PR merges - Restore drawSeparator import in executor.ts - Remove conflicting getPackageVersion import in server.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address CodeRabbit review issues in batch API - Add empty requests guard in submitBatch - Add retry logic for transient errors in polling loop - Extract taskCustomId helper to avoid duplicated pattern - Add pricing caveat for non-Sonnet models Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add stable-release label for non-beta releases Add `stable-release` label support to prepare-release workflow. When a PR with this label is merged to main, the workflow strips the prerelease suffix and applies a proper semver bump instead of incrementing the beta number. Example: 0.1.1-beta.16 + feat PR + stable-release → 0.2.0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve CI failures on staging PR - Update pnpm-lock.yaml to include @anthropic-ai/sdk dependency - Remove duplicate rate-limits.md doc (rate-limiting.md already exists) - Use 'release' label instead of 'stable-release' in workflow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(security): resolve CodeQL alerts - Loop HTML tag removal to prevent incomplete sanitization bypass - Replace TOCTOU existsSync+readFileSync with try/catch - Remove unused fullTask variable in context-builder Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(security): eliminate file system race condition in skills detection Remove statSync+readFileSync TOCTOU pattern entirely. Instead of checking file type then reading, try reading directly and catch errors. This eliminates the race window between stat and read. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): fetch remote branch before force-push in docs SEO sync The --force-with-lease push fails when the automation branch already exists remotely because the local checkout has no knowledge of the remote ref. Adding a fetch first resolves the stale info rejection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revert "fix(ci): fetch remote branch before force-push in docs SEO sync" This reverts commit 73dfbcc. * docs: add branch naming convention with staging/v<version> rule Staging branches must use semver version numbers (e.g. staging/v0.2.0) instead of arbitrary names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve wizard hanging on "Setting up project..." initCommand has interactive prompts (git init confirmation, agent selection) and agent detection that blocks when called from the wizard since the wizard's spinner consumes stdout. Added nonInteractive flag to skip prompts, auto-init git, and skip agent detection when called from the wizard context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: fixes * feat: improve skills * fix: wizard fixes * feat: prompt --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3265c7f commit 4a4e14f

35 files changed

+3102
-387
lines changed

.github/workflows/prepare-release.yml

Lines changed: 69 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,22 @@ permissions:
1212

1313
jobs:
1414
# NOTE: Auto-labeling (including candidate-release) is handled by auto-label.yml
15-
# This workflow aggregates ALL merged candidate-release PRs since the last release
15+
# This workflow aggregates ALL merged candidate-release/release PRs since the last release
16+
#
17+
# Labels:
18+
# candidate-release → beta bump (0.1.1-beta.16 → 0.1.1-beta.17)
19+
# release → stable bump (0.1.1-beta.16 → 0.2.0)
1620

17-
# Create/update release PR when a PR with candidate-release label is merged
21+
# Create/update release PR when a PR with candidate-release or release label is merged
1822
create-release-pr:
1923
name: Create Release PR
2024
if: |
2125
github.event.action == 'closed' &&
2226
github.event.pull_request.merged == true &&
23-
contains(github.event.pull_request.labels.*.name, 'candidate-release') &&
27+
(
28+
contains(github.event.pull_request.labels.*.name, 'candidate-release') ||
29+
contains(github.event.pull_request.labels.*.name, 'release')
30+
) &&
2431
!startsWith(github.event.pull_request.head.ref, 'release/')
2532
runs-on: ubuntu-latest
2633
steps:
@@ -57,16 +64,26 @@ jobs:
5764
echo "No release tags found, collecting all candidate-release PRs"
5865
fi
5966
60-
# Query all merged PRs with candidate-release label since the tag date
67+
# Query all merged PRs with candidate-release or release label since the tag date
6168
# Exclude release branch PRs
62-
PR_JSON=$(gh pr list \
69+
CANDIDATE_JSON=$(gh pr list \
6370
--state merged \
6471
--label "candidate-release" \
6572
--base main \
6673
--json number,title,mergedAt,headRefName \
6774
--limit 100 \
6875
--jq "[.[] | select(.mergedAt > \"$TAG_DATE\" and (.headRefName | startswith(\"release/\") | not))]"
6976
)
77+
STABLE_JSON=$(gh pr list \
78+
--state merged \
79+
--label "release" \
80+
--base main \
81+
--json number,title,mergedAt,headRefName \
82+
--limit 100 \
83+
--jq "[.[] | select(.mergedAt > \"$TAG_DATE\" and (.headRefName | startswith(\"release/\") | not))]"
84+
)
85+
# Merge and deduplicate by PR number
86+
PR_JSON=$(echo "$CANDIDATE_JSON $STABLE_JSON" | jq -s 'add | unique_by(.number)')
7087
7188
PR_COUNT=$(echo "$PR_JSON" | jq length)
7289
echo "Found $PR_COUNT merged PRs since $LATEST_TAG"
@@ -125,24 +142,49 @@ jobs:
125142
echo "Version bump: $BUMP (current: $CURRENT_VERSION)"
126143
echo "Changes: $(echo "$CHANGES" | jq -r '.[] | " - #\(.pr): \(.rawTitle)"')"
127144
145+
- name: Check if stable release
146+
if: steps.collect.outputs.skip != 'true'
147+
id: stable
148+
run: |
149+
IS_STABLE="${{ contains(github.event.pull_request.labels.*.name, 'release') }}"
150+
echo "is_stable=$IS_STABLE" >> $GITHUB_OUTPUT
151+
echo "Stable release: $IS_STABLE"
152+
128153
- name: Calculate new version
129154
if: steps.collect.outputs.skip != 'true'
130155
id: version
131156
env:
132157
CURRENT: ${{ steps.bump.outputs.current }}
133158
BUMP: ${{ steps.bump.outputs.bump }}
159+
IS_STABLE: ${{ steps.stable.outputs.is_stable }}
134160
run: |
161+
if [ "$IS_STABLE" = "true" ]; then
162+
# Stable release: strip prerelease suffix, apply semver bump to base
163+
BASE=$(echo "$CURRENT" | sed 's/-.*$//')
164+
IFS='.' read -r MAJOR MINOR PATCH <<< "$BASE"
135165
136-
# Parse version (handle prerelease)
137-
if [[ "$CURRENT" == *"-"* ]]; then
138-
# It's a prerelease, just bump the prerelease number
166+
case "$BUMP" in
167+
major)
168+
NEW_VERSION="$((MAJOR + 1)).0.0"
169+
;;
170+
minor)
171+
NEW_VERSION="${MAJOR}.$((MINOR + 1)).0"
172+
;;
173+
patch)
174+
NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))"
175+
;;
176+
esac
177+
178+
echo "Stable release: $CURRENT -> $NEW_VERSION (bump: $BUMP)"
179+
elif [[ "$CURRENT" == *"-"* ]]; then
180+
# Beta release: bump the prerelease number
139181
BASE=$(echo "$CURRENT" | sed 's/-.*$//')
140182
PRE_TYPE=$(echo "$CURRENT" | sed 's/.*-\([a-z]*\).*/\1/')
141183
PRE_NUM=$(echo "$CURRENT" | sed 's/.*\.\([0-9]*\)$/\1/')
142184
NEW_PRE_NUM=$((PRE_NUM + 1))
143185
NEW_VERSION="${BASE}-${PRE_TYPE}.${NEW_PRE_NUM}"
144186
else
145-
# Parse semver
187+
# Already stable, apply semver bump
146188
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
147189
148190
case "$BUMP" in
@@ -202,6 +244,7 @@ jobs:
202244
EXISTING_NUMBER: ${{ steps.check.outputs.number }}
203245
EXISTING_BRANCH: ${{ steps.check.outputs.branch }}
204246
EXISTING_VERSION: ${{ steps.check.outputs.version }}
247+
IS_STABLE: ${{ steps.stable.outputs.is_stable }}
205248
run: |
206249
TODAY=$(date +%Y-%m-%d)
207250
RELEASE_BRANCH="release/v${NEW_VERSION}"
@@ -257,10 +300,18 @@ jobs:
257300
# Build PR body with all included changes
258301
PR_CHANGES_LIST=$(echo "$CHANGES_JSON" | jq -r '.[] | "- #\(.pr): \(.rawTitle)"')
259302
303+
if [ "$IS_STABLE" = "true" ]; then
304+
RELEASE_LABEL="Stable Release"
305+
NPM_TAG_INFO="Package will be published to npm with \`latest\` tag"
306+
else
307+
RELEASE_LABEL="Release"
308+
NPM_TAG_INFO="Package will be published to npm"
309+
fi
310+
260311
PR_BODY=$(cat <<EOF
261-
## Release v${NEW_VERSION}
312+
## ${RELEASE_LABEL} v${NEW_VERSION}
262313
263-
This PR was automatically created to prepare release v${NEW_VERSION}.
314+
This PR was automatically created to prepare ${RELEASE_LABEL,,} v${NEW_VERSION}.
264315
265316
### Changes included
266317
${PR_CHANGES_LIST}
@@ -273,7 +324,7 @@ jobs:
273324
### What happens when this PR is merged
274325
1. Git tag \`v${NEW_VERSION}\` will be created
275326
2. GitHub Release will be published
276-
3. Package will be published to npm
327+
3. ${NPM_TAG_INFO}
277328
278329
---
279330
This PR was auto-generated by the release workflow.
@@ -286,8 +337,13 @@ jobs:
286337
echo "Updated existing release PR #${EXISTING_NUMBER}"
287338
else
288339
# Create new PR
340+
if [ "$IS_STABLE" = "true" ]; then
341+
PR_TITLE="chore(release): v${NEW_VERSION} (stable)"
342+
else
343+
PR_TITLE="chore(release): v${NEW_VERSION}"
344+
fi
289345
gh pr create \
290-
--title "chore(release): v${NEW_VERSION}" \
346+
--title "$PR_TITLE" \
291347
--body "$PR_BODY" \
292348
--label "release" \
293349
--base main

CONTRIBUTING.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,23 @@ pnpm build
6363

6464
### 1. Create a Branch
6565

66+
Follow the branch naming convention:
67+
6668
```bash
67-
git checkout -b feature/my-feature
68-
# or
69-
git checkout -b fix/my-fix
69+
git checkout -b feature/my-feature # New features
70+
git checkout -b fix/my-fix # Bug fixes
71+
git checkout -b staging/v0.2.0 # Staging branches (use target version)
72+
git checkout -b release/v0.2.0 # Release branches (automated)
7073
```
7174

75+
**Branch naming rules:**
76+
- `feature/<name>` — New features
77+
- `fix/<name>` — Bug fixes
78+
- `docs/<name>` — Documentation changes
79+
- `chore/<name>` — Maintenance tasks
80+
- `staging/v<version>` — Pre-release staging (must use target semver)
81+
- `release/v<version>` — Release branches (created by CI)
82+
7283
### 2. Make Your Changes
7384

7485
- Keep changes focused - one feature or fix per PR

IMPLEMENTATION_PLAN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
- [ ] Add `--figma-preview` to show changes without applying
4040
- [ ] Add `--figma-mapping <file>` for custom content mapping
4141

42+
### Session Management
43+
- [x] Create `src/loop/session.ts` for pause/resume support
44+
- [x] Add `ralph-starter pause` command
45+
- [x] Add `ralph-starter resume` command
46+
- [ ] Store session state in `.ralph-session.json`
47+
4248
### Task 6: Documentation
4349

4450
- [ ] Add content mode section to README.md

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,33 @@ Control API call frequency to manage costs:
368368
ralph-starter run --rate-limit 50 "build X"
369369
```
370370

371+
**When rate limits are reached**, ralph-starter displays detailed stats:
372+
373+
```
374+
⚠ Claude rate limit reached
375+
376+
Rate Limit Stats:
377+
• Session usage: 100% (50K / 50K tokens)
378+
• Requests made: 127 this hour
379+
• Time until reset: ~47 minutes (resets at 04:30 UTC)
380+
381+
Session Progress:
382+
• Tasks completed: 3/5
383+
• Current task: "Add swarm mode CLI flags"
384+
• Branch: auto/github-54
385+
• Iterations completed: 12
386+
387+
To resume when limit resets:
388+
ralph-starter run
389+
390+
Tip: Check your limits at https://claude.ai/settings
391+
```
392+
393+
This helps you:
394+
- Know exactly when you can resume
395+
- Track progress on your current session
396+
- Understand your usage patterns
397+
371398
### Cost Tracking
372399

373400
Track estimated token usage and costs during loops:

docs/docs/cli/skill.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@ installed skills from three locations:
123123
Detected skills are matched against the project's tech stack
124124
and included in the agent's prompt context when relevant.
125125

126+
## Auto Skill Discovery
127+
128+
When running a task, ralph-starter can also query the skills.sh
129+
registry to find and install relevant skills automatically.
130+
If you want to disable this behavior, set:
131+
132+
```bash
133+
RALPH_DISABLE_SKILL_AUTO_INSTALL=1
134+
```
135+
126136
## Behavior
127137

128138
- The `add` action uses `npx add-skill` under the hood.

docs/docs/wizard/overview.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $ ralph-starter
8383
❯ Yes, I know what I want to build
8484
No, help me brainstorm ideas
8585
86-
? What's your idea for today?
86+
? Which idea do you want to build?
8787
(e.g., "a habit tracker app" or "an API for managing recipes")
8888
> a personal finance tracker
8989
@@ -107,7 +107,7 @@ $ ralph-starter
107107
108108
Complexity: Working MVP
109109
110-
? Does this look right?
110+
? Is this the right specs?
111111
❯ Yes, let's build it!
112112
I want to change something
113113
Start over with a different idea

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"access": "public"
6767
},
6868
"dependencies": {
69+
"@anthropic-ai/sdk": "^0.73.0",
6970
"@modelcontextprotocol/sdk": "^1.0.0",
7071
"chalk": "^5.3.0",
7172
"chalk-animation": "^2.0.3",

pnpm-lock.yaml

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)