Skip to content

Version 1.10.0#23

Merged
zahardev merged 11 commits into
mainfrom
version/1.10.0
May 3, 2026
Merged

Version 1.10.0#23
zahardev merged 11 commits into
mainfrom
version/1.10.0

Conversation

@zahardev

@zahardev zahardev commented May 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Configurable TDD (tdd: true | false | ask) — agents assess testability per step and apply test-first only when configured
  • New plan-steps.md prompt loaded at plan-creation time, reducing session-start context by ~62 lines from process.md
  • Branch verification via git status before remote operations (push, PR creation, version extraction from branch)
  • Fix git log triple-dot to double-dot in draft-pr.md for correct commit range
  • Fix misleading /do-it suggestion after /add-step when step already exists
  • CLI fixes: update crash on file-as-directory, gh-fix-tests skipping local verification, version auto-increment prevention

Test plan

  • node --test test/*.test.js passes (171 tests)
  • /create-task on a git-branch source project runs git status and extracts version correctly
  • /finish-task with push: true verifies branch before pushing
  • /add-step only suggests /run-step in confirmation
  • tdd: true produces test-first plan steps; tdd: false skips TDD assessment

Summary by CodeRabbit

  • New Features

    • Configurable TDD option (true|false|ask) and a dedicated plan-steps guide for creating task steps.
  • Improvements

    • Enforced dependency-ordered plan-step rules and stricter local test verification when fixing tests.
    • Safer push flow that verifies branch state before remote writes.
    • Version updates tied to release prep rather than individual tasks.
    • Fixed PR branch-range behavior and narrowed next-action suggestions to only recommend /run-step.
  • Documentation

    • Updated changelog, readme, and release notes for 1.10.0.

detect() used existsSync which returns true for files — mkdir then
fails with ENOTDIR when trying to create subdirectories inside it.

Co-Authored-By: Claude Opus 4.6 (1M context) via AIContext
"(optional)" label caused the AI to skip local runs every time,
treating CI as the verification loop instead.

Co-Authored-By: Claude via AIContext
Old rule "each new task means a new version" caused the AI to
increment versions on its own instead of using the branch name.

Co-Authored-By: Claude via AIContext
"No — create one" and "No — skip" shared a prefix that caused
the AI to collapse them into a single option.

Co-Authored-By: Claude via AIContext
TDD rules and planning guidelines were loaded at session start but forgotten
by plan-creation time. Moving them to a dedicated prompt that loads when needed
fixes the attention gap. TDD is now config-driven (tdd: true|false|ask).

Co-Authored-By: Claude via AIContext
Prompts relied on stale session-start context for branch identity.
Now resolve-task-naming, finish-task, and draft-pr explicitly run
git status first. Also fixes git log triple-dot to double-dot in
draft-pr (triple-dot includes noise from base branch commits).

Co-Authored-By: Claude via AIContext
After step creation, only /run-step is relevant — /do-it is for
when no step exists yet.

Co-Authored-By: Claude via AIContext
@coderabbitai

coderabbitai Bot commented May 3, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: de1bd347-9134-4abb-89cb-16ee02895c7d

📥 Commits

Reviewing files that changed from the base of the PR and between 6e4ad10 and 2675db4.

⛔ Files ignored due to path filters (2)
  • assets/logo5.svg is excluded by !**/*.svg
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • CHANGELOG.md
  • README.md
  • package.json
✅ Files skipped from review due to trivial changes (3)
  • package.json
  • README.md
  • CHANGELOG.md

📝 Walkthrough

Walkthrough

This PR extracts TDD-aware planning rules into .aicontext/prompts/plan-steps.md, adds a top-level tdd config, updates prompt and doc references to use the new plan rules, tightens several prompt workflows (git range, push checks, test verification, next-action suggestions), adjusts assistant detection/installer logic in bin/aicontext.js, and bumps package/docs versions.

Changes

Planning Rules Centralization & Prompt + Docs Updates

Layer / File(s) Summary
New Plan Rules
.aicontext/prompts/plan-steps.md
Add new TDD-aware plan construction guidance driven by tdd, enforce WHAT-not-HOW phrasing, checkbox format, dependency order, and forbid spec/task/manual steps.
Config Template & Validation
.aicontext/templates/config.template.yml, .aicontext/prompts/ensure-config.md
Add top-level tdd: ask to template; require/collect tdd during config completeness checks and interactive resolution.
Prompt References
.aicontext/prompts/add-step.md, .aicontext/prompts/create-task.md, .aicontext/prompts/plan-tasks.md, .aicontext/prompts/start-feature.md, .aicontext/prompts/review-task.md, .aicontext/readme.md
Replace references to planning/TDD guidance in rules/process.md with references to prompts/plan-steps.md and treat TDD as config-driven.
Prompt Workflow Refinements
.aicontext/prompts/draft-pr.md, .aicontext/prompts/finish-task.md, .aicontext/prompts/gh-fix-tests.md, .aicontext/prompts/resolve-asks.md, .aicontext/prompts/resolve-task-naming.md
Change git log commit-range to double-dot, add git status/branch verification before pushing, require local test re-run for test-failure fixes, include root-level tdd in asks, and clarify {issue_id}/{version} resolution.
Process Rules Cleanup & Versioning
.aicontext/rules/process.md
Remove prior Test-Driven Development and Task Planning Guidelines sections; change versioning to track releases (use resolved version verbatim, no auto-increment) and restrict version updates to release-prep steps.
Docs / Help Text
.aicontext/prompts/aic-help.md, .aicontext/prompts/start.md, README.md, .aicontext/readme.md, CHANGELOG.md
Update descriptions to call rules/process.md “lifecycle rules”, point planning to plan-steps.md, add 1.10.0 changelog/README entries, and update help text.
Standards
.aicontext/rules/standards.md
Add Question UX rule: closed-question option lists must include exactly the listed options (no merging/dropping).

Assistant Detection, Installer, and CLI Messaging

Layer / File(s) Summary
Helper & Detection
bin/aicontext.js
Add isDirectory() helper; change assistant detect routines (claude, cursor, codex) to verify install paths are directories using isDirectory(...) instead of fs.existsSync(...).
Installer Signature & Behavior
bin/aicontext.js
Make ASSISTANTS.cursor.install synchronous and remove unused opts parameter ((packageRoot, target, opts)(packageRoot, target)), copying the .cursor entry point accordingly.
CLI Messaging
bin/aicontext.js
Clarify interactive bulk-override prompt text to state preserved framework-project files during updates.
Package & Changelog
package.json, CHANGELOG.md, README.md
Bump package version to 1.10.0 and add changelog/README entries describing configurable TDD and plan-step rules.

Sequence Diagram

sequenceDiagram
    participant User
    participant Config as Config/Validation
    participant Prompt as Planning Prompt
    participant Exec as CLI/Executor

    User->>Config: Load repo config (includes `tdd`)
    Config->>Config: Validate required keys (tdd, after_step.*, after_task.*)
    alt tdd missing or ask
        Config->>User: Prompt to resolve `tdd` (yes/no)
    end
    User->>Prompt: Invoke planning (start-feature/create-task/add-step)
    Prompt->>Prompt: Read `tdd` value
    alt tdd == true
        Prompt->>Prompt: Emit test-first plan steps (test → implement → verify)
    else tdd == false
        Prompt->>Prompt: Emit standard ordered plan steps
    end
    Prompt->>Exec: Execute actions (run-step, finish-task, push)
    Exec->>Exec: Run git checks (`git status`) and assistant detection (`isDirectory(...)`)
    Exec->>User: Ask for confirmations when branch/HEAD invalid or push needed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • Version 1.8.0 #21: Earlier addition of TDD-aware planning into .aicontext/rules/process.md — this PR rehomes and refactors that logic into plan-steps.md.
  • Version/1.2.0 #9: Overlaps in assistant detection/installer logic and function-signature edits in bin/aicontext.js.
  • Version/1.7.0 #19: Related prompt and docs edits around planning, TDD config, and step/run semantics.

Poem

🐰 I hop through docs and plans anew,
Checklist boxes saying what to do—
TDD asks, decisions crisp and bright,
Branches checked, pushes paused till right.
Hooray for tidy flows tonight!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Version 1.10.0' is minimally specific and refers only to a version bump, but the changeset encompasses substantial feature additions (configurable TDD, plan-steps extraction, branch verification, git range fixes, and workflow improvements) beyond a simple version update. Consider a more descriptive title that captures the main features, such as 'Add configurable TDD and plan-steps documentation' or include a subtitle highlighting key changes from the developer's perspective.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch version/1.10.0

Review rate limit: 4/5 reviews remaining, refill in 12 minutes.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
bin/aicontext.js (1)

58-76: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle assistant-path file collisions before install (regression in add-assistant).

Directory-only detection is correct, but on Line 1059/Line 1068 a file at .claude/.cursor/.codex is now treated as “not installed,” then install crashes when writing directories. Add an explicit preflight conflict check in addAssistant (and ideally shared for install flows).

💡 Suggested fix
 async function addAssistant(name, targetDir, skipConfirm = false) {
   const target = path.resolve(targetDir || '.');
@@
   const assistant = ASSISTANTS[name];
+  const assistantPath = path.join(target, assistant.folder.replace(/\/$/, ''));
+  const isDirAssistant = ['claude', 'cursor', 'codex'].includes(name);
+  if (isDirAssistant && fs.existsSync(assistantPath) && !isDirectory(assistantPath)) {
+    log(`Cannot install ${assistant.label}: ${assistantPath} exists as a file.`, 'red');
+    log('Rename/remove the file, then retry.', 'dim');
+    return;
+  }
+
   if (assistant.detect(target)) {
     log(`${assistant.label} (${assistant.folder}) is already installed.`, 'yellow');
     log(`Run \`aicontext update\` to refresh it.`, 'dim');
     return;
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bin/aicontext.js` around lines 58 - 76, The install path check is missing a
preflight for file-vs-directory collisions causing installs to crash when a file
exists at the assistant folder (e.g. ".claude", ".cursor", ".codex"); update
addAssistant to call a shared helper (e.g. ensureAssistantTargetIsDirectory or
validateInstallTarget) before performing installs so it checks path existence
and type and fails fast or prompts when the target exists as a file, and reuse
that helper from install flows that call copyRecursive, copyFrameworkAgents, and
copyFrameworkSkills; also ensure the per-assistant detect methods remain
directory-only but the installer always verifies the target is a directory (or
empty/non-existent) before writing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.aicontext/prompts/add-step.md:
- Line 36: Update the confirmation text that currently reads "Show the step that
was added" to handle both the new-add and existing-step flows: detect the
"existing-step" path and use a neutral message like "Show the step that was
added or the existing step referenced" (or similar) so it does not assume a new
add; also prompt the user to execute the step with "/run-step". Locate the
phrase "Show the step that was added" and the "existing-step" path in
add-step.md and replace the hardcoded confirmation with this conditional/neutral
wording and include the suggested "/run-step" instruction.

In @.aicontext/prompts/finish-task.md:
- Line 68: The prompt's instruction for after_task.push that runs "git status"
then "git push -u origin {current-branch}" lacks explicit abort checks; update
the prompt so after_task.push first inspects git status output and aborts if any
fail-fast conditions are detected (detached HEAD, no current branch name,
unmerged/uncommitted changes, or branch mismatch against expected
{current-branch}), instructing the agent to stop and report the exact condition
instead of running git push; reference the after_task.push step and the git push
-u origin {current-branch} action so the agent performs these verifications and
only proceeds to push when all checks pass.

In @.aicontext/prompts/resolve-task-naming.md:
- Line 40: The fallback description incorrectly says to "extract branch name via
task_naming.branch_pattern" — update the wording so it clearly states that when
task_naming.source is unset you should infer package-json if package.json has a
version field, otherwise use git-branch and run git status to extract the
{version} token using task_naming.branch_pattern (i.e., the pattern is used to
derive {version}, not the branch name); adjust the sentence to replace "branch
name" with "{version}" and make clear the pattern maps branch text to the
{version} value.

In @.aicontext/prompts/review-task.md:
- Line 11: The TDD enforcement in the review-task prompt currently flags
test-first violations whenever config.tdd is true; update the check so it
mirrors plan-steps.md by skipping the TDD gate when the plan indicates
"no-tests" (i.e., when the task/plan contains the no-tests marker or explicit
absence of tests). Concretely, modify the TDD structure logic that reads the tdd
flag to also inspect the plan metadata (the same no-tests condition used in
plan-steps.md) and only enforce test-first rules for functions/steps under
/review-task when tdd is true AND no-tests is not set.

---

Outside diff comments:
In `@bin/aicontext.js`:
- Around line 58-76: The install path check is missing a preflight for
file-vs-directory collisions causing installs to crash when a file exists at the
assistant folder (e.g. ".claude", ".cursor", ".codex"); update addAssistant to
call a shared helper (e.g. ensureAssistantTargetIsDirectory or
validateInstallTarget) before performing installs so it checks path existence
and type and fails fast or prompts when the target exists as a file, and reuse
that helper from install flows that call copyRecursive, copyFrameworkAgents, and
copyFrameworkSkills; also ensure the per-assistant detect methods remain
directory-only but the installer always verifies the target is a directory (or
empty/non-existent) before writing.
🪄 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: e5a6b109-8206-41c6-a7ed-0cde103d8888

📥 Commits

Reviewing files that changed from the base of the PR and between eb93601 and 69ce23a.

📒 Files selected for processing (19)
  • .aicontext/prompts/add-step.md
  • .aicontext/prompts/aic-help.md
  • .aicontext/prompts/create-task.md
  • .aicontext/prompts/draft-pr.md
  • .aicontext/prompts/ensure-config.md
  • .aicontext/prompts/finish-task.md
  • .aicontext/prompts/gh-fix-tests.md
  • .aicontext/prompts/plan-steps.md
  • .aicontext/prompts/plan-tasks.md
  • .aicontext/prompts/resolve-asks.md
  • .aicontext/prompts/resolve-task-naming.md
  • .aicontext/prompts/review-task.md
  • .aicontext/prompts/start-feature.md
  • .aicontext/prompts/start.md
  • .aicontext/readme.md
  • .aicontext/rules/process.md
  • .aicontext/rules/standards.md
  • .aicontext/templates/config.template.yml
  • bin/aicontext.js

Comment thread .aicontext/prompts/add-step.md
Comment thread .aicontext/prompts/finish-task.md Outdated
Comment thread .aicontext/prompts/resolve-task-naming.md Outdated
Comment thread .aicontext/prompts/review-task.md Outdated
…ts gate

Adds fail-fast before push when HEAD is detached or branch name is
unavailable. Fixes "extract branch name" → "extract {version}" wording.
Mirrors plan-steps.md "skip when no tests" rule in review-task TDD check.

Co-Authored-By: Claude via AIContext
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 3, 2026
@zahardev zahardev changed the title Add configurable TDD and prompt fixes Version 1.10.0 May 3, 2026
zahardev added 2 commits May 3, 2026 13:04
Co-Authored-By: Claude via AIContext
Configurable TDD, plan-steps extraction, branch verification,
git range fix, misleading next-action fix.

Co-Authored-By: Claude via AIContext
@zahardev zahardev merged commit e1009fc into main May 3, 2026
2 checks passed
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