Skip to content

Conversation

@sanjana2505006
Copy link

@sanjana2505006 sanjana2505006 commented Jan 24, 2026

Summary

Add comprehensive support for AI coding assistants working with the Grails codebase:

  • AGENTS.md: Optimized agent-friendly guide with quick reference, critical rules, technology stack, key modules, code patterns, and troubleshooting
  • Developer Skills: Three specialized skills in .agents/skills/ for Grails 7, Groovy 4, and Java 17
  • Agent Instruction Files: Symlinks to AGENTS.md for major AI tools (Claude, Gemini, Copilot, Cursor, Windsurf, Cline)
  • Claude Code Skills: Symlinks in .claude/skills/ enabling slash commands for developer skills

Architecture

All agent instruction files are symlinks to AGENTS.md, ensuring:

  • Single source of truth for all AI assistants
  • Content automatically stays in sync
  • No duplication maintenance burden
AGENTS.md (canonical source)
├── CLAUDE.md → AGENTS.md
├── GEMINI.md → AGENTS.md
├── .clinerules → AGENTS.md
├── .cursorrules → AGENTS.md
├── .windsurfrules → AGENTS.md
└── .github/copilot-instructions.md → AGENTS.md

Files Added

File Purpose
AGENTS.md Main agent guide (canonical source)
.agents/skills/grails-developer/SKILL.md Grails 7 development guidance
.agents/skills/groovy-developer/SKILL.md Groovy 4 syntax and patterns
.agents/skills/java-developer/SKILL.md Java 17 features and Groovy interop
CLAUDE.md Symlink → AGENTS.md
GEMINI.md Symlink → AGENTS.md
.github/copilot-instructions.md Symlink → AGENTS.md
.cursorrules Symlink → AGENTS.md
.windsurfrules Symlink → AGENTS.md
.clinerules Symlink → AGENTS.md
.claude/skills/*/SKILL.md Symlinks enabling Claude Code slash commands

AGENTS.md Highlights

  • Quick reference with common build/test commands
  • Critical rules (jakarta.*, @GrailsCompileStatic, etc.)
  • Technology stack and key modules reference
  • Spock test patterns and mocking examples
  • Test isolation warnings for parallel execution
  • Troubleshooting table for common issues
  • Mandatory skill reading instructions for AI agents before writing code

Skills Coverage

  • grails-developer: GORM, controllers, services, views, plugins, Spock/Geb testing
  • groovy-developer: Closures, DSLs, metaprogramming, static compilation, AST transforms
  • java-developer: Records, sealed classes, pattern matching, text blocks

Test Plan

  • RAT check passes (all files have Apache License headers)
  • Checkstyle passes
  • Files follow AGENTS.md open standard format
  • Skills compatible with multiple AI tools (opencode, claude, grok, gemini, copilot, cursor, windsurf)
  • Symlinks resolve correctly (verified with ls -la and cat)
  • Git stores symlinks with mode 120000

Copy link
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

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

There is a lot of information missing from this file. Some of it:

  1. We need to inform LLMs of our project structure (it's not that it's multiproject, but the composite build is important to mention). This includes directory discussions.
  2. Build instructions need run - rat & codestyle need explicitly mentioned
  3. We need rules on restructuring the project
  4. We need rules on dependency includes and when to include, where

The purpose of this file is to make it easier for the LLM to understand how to run tests, how to make changes, etc. While this is a good starting point, we need to be much more thorough.

@jamesfredley
Copy link
Contributor

AGENTS.md - some items we might want to include

@jamesfredley
Copy link
Contributor

@sanjana2505006 I am going to push some additional changes to this PR based on https://github.com/apache/superset/ and the conversation in our weekly Grails planning meeting.

Replaces the previous ASF license header notes with a comprehensive guide for automated coding agents and developers. Adds detailed instructions on environment setup, build/test commands, code style, Spock/Groovy conventions, commit/PR guidelines, parallel test isolation, and documentation processes for the grails-core repository.
Add three specialized skills in .agents/skills/ for AI agent guidance:

- grails-developer: Grails 7 development with GORM, controllers,
  services, views, plugins, and Spock/Geb testing
- groovy-developer: Groovy 4 syntax, closures, DSLs, metaprogramming,
  static compilation, and testing patterns
- java-developer: Java 17 features including records, sealed classes,
  pattern matching, and Groovy interoperability

Skills follow the open AGENTS.md standard format with compatibility
for Claude, Copilot, Cursor, Gemini, Windsurf, Cline, and others.
Add instruction files that reference AGENTS.md for various AI tools:

- CLAUDE.md: Claude Code
- GEMINI.md: Google Gemini CLI
- .github/copilot-instructions.md: GitHub Copilot
- .cursorrules: Cursor
- .windsurfrules: Windsurf
- .clinerules: Cline

Update AGENTS.md with optimized agent-friendly format:
- Quick reference section with common commands
- Critical rules highlighted (jakarta.*, @GrailsCompileStatic, etc.)
- Concise tables for technology stack, modules, and artefacts
- Code patterns for Spock tests, mocking, and framework access
- Test isolation warnings for parallel execution
- Troubleshooting table for common issues

All files include Apache License headers and reference the skills
in .agents/skills/ for detailed guidance.
@jamesfredley jamesfredley changed the title docs: create AGENTS.md for AI LLM crawlers Add AGENTS.md and AI coding assistant support Jan 28, 2026
@jamesfredley
Copy link
Contributor

We will likely want to copy this over to grails-spring-security, grails-cache and grails-quartz.

Eliminates duplication by making all AI assistant config files symlinks
to the canonical AGENTS.md, ensuring content loads automatically.
Updated AGENTS.md to require AI agents to read relevant skill files before writing or modifying Groovy, Grails, or Java code. This ensures agents follow best practices and guidelines specific to each language or framework.
Creates .claude/skills/ directory with symlinks to the canonical
skill files in .agents/skills/, enabling Claude Code slash commands.
Copy link
Contributor

@jdaugherty jdaugherty left a comment

Choose a reason for hiding this comment

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

I think this is a good start

@jdaugherty
Copy link
Contributor

@sanjana2505006 Let's let @jamesfredley implement the feedback in this PR and we'll merge once @matrei also reviews.

Deleted the .github/copilot-instructions.md symlink that pointed to ../AGENTS.md. This cleans up unused or obsolete configuration.
Added a new section detailing the repository's multi-project Gradle structure and build commands. Introduced pull request guidelines and review process table. Updated security reporting instructions to reference the ASF Security Team.
@jdaugherty jdaugherty modified the milestones: grails:7.0.7, grails:7.0.8 Jan 29, 2026
Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

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

👍 This is a great.

- Clarify @GrailsCompileStatic usage for artefact classes only
- Fix test isolation warning about static state cleanup
- Replace @ResourceLock with @shared (no Spock parallel execution)
- Update documentation URLs to grails.apache.org
- Fix grails-developer skill: logback-spring.xml, spring/resources.groovy
- Add integration-test/groovy directory to project structure
- Update to ContainerGebSpec for Geb tests
- Update plugin coordinates to org.apache.grails.plugins
- Change codeStyle to check task (more general)
- Use single quotes for simple strings in Groovy examples
- Rename 'double' to 'twice' (double is reserved word)
- Remove (Incubating) from Records section (stable in Groovy 4)
- Update @GrailsCompileStatic example to use dynamic finder
- Fix imports: groovy.lang.Delegate and groovy.lang.Singleton
- Add parentheses guidance to code style
- Clarify @GrailsCompileStatic usage with 'if needed'
- Update GString map key example with toString()
- Clarify == vs is comparison (same as Java)
- Update static imports guidance
- Update GORM URL to grails.apache.org
@jamesfredley
Copy link
Contributor

@matrei I pushed a couple commits with requested changes.

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants