Skip to content

Agents: Improvements#2092

Open
rahmanunver wants to merge 3 commits intomainfrom
chore/agentic-dev-setup
Open

Agents: Improvements#2092
rahmanunver wants to merge 3 commits intomainfrom
chore/agentic-dev-setup

Conversation

@rahmanunver
Copy link
Contributor

Pull request type

Refactoring (e.g. file rename, variable rename, etc.)

New feature (non-breaking change which adds functionality)


Description

Another step to make it easier for AI coding agents (Claude Code, GitHub Copilot) to work correctly in this monorepo with minimal manual intervention.

Post-edit hooks (auto-format + lint)

Added .claude/hooks/post-edit.sh — a PostToolUse hook that runs automatically after every file edit:

  • Runs npx prettier --write on the edited file
  • Walks up the directory tree to find the nearest eslint.config.mjs and runs npm run lint from that package
  • Exits 2 on lint errors, feeding the output back to Claude as in-context feedback (Copilot ignores this feedback)

The same script is registered for GitHub Copilot's coding agent via .github/hooks/hooks.json. The two agents use
different JSON schemas for the hook payload, the script detects and normalizes both:

  • Claude Code: { "tool_input": { "file_path": "..." } }
  • Copilot: { "toolArgs": "{\"path\": \"...\"}" }

Removal of rui-agent-rules

The rui-agent-rules.ts postinstall script generated symlinks from docs/requirements/*.md into .cursor/rules/ and .windsurf/rules/.

This approach is replaced by direct, curated per-agent instruction files, CLAUDE.md for Claude
Code, .github/copilot-instructions.md for Copilot, and docs/requirements/ linked from AGENTS.md for
Cursor/Windsurf. The symlink automation is removed along with its postinstall turbo task.

CLAUDE.md added

A new CLAUDE.md at the repo root gives Claude Code structured project context: commands, package structure,
conventions, and pointers to docs/requirements/ for deeper reference. This is Claude Code's native mechanism for
persistent project instructions.

AGENTS.md refined

Trimmed from 94 lines to 35. The previous version duplicated content from docs/requirements/. The new version is a
concise routing document: commands table, conventions summary, and a section pointing each agent type to its
canonical instruction file.


Note: .claude/settings.local.json is added to .gitignore — this file holds machine-local Claude Code settings and
should not be committed.

What should be covered while testing?

You can test the auto-linting behavior with your agent, ask it to test its PostToolUse hook deliberately to test the linting.


# Run lint from the package directory using the project's lint setup
if [[ -n "$PACKAGE_DIR" ]]; then
LINT_OUTPUT=$(cd "$PACKAGE_DIR" && npm run lint 2>&1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants