Skip to content

Conversation

@mqasimca
Copy link

@mqasimca mqasimca commented Jan 9, 2026

Summary

This PR adds comprehensive configuration for Claude Code and OpenAI
Codex CLI
to improve developer experience when using AI coding assistants
with the Nylas Node.js SDK repository.

What's Included

Claude Code Configuration (.claude/)

Component Files Purpose
Root guidance CLAUDE.md Project context
Ignore file .claudeignore Exclude artifacts
Settings settings.json Permissions
Hooks 3 scripts Safety, formatting
Agents 6 files Parallel search
Commands 7 files Slash commands
Docs 3 files Detailed guides
Templates 4 files Scaffolding

OpenAI Codex CLI Configuration (.codex/)

Component Files Purpose
Root guidance AGENTS.md Repo context
Skills 8 SKILL.md Task guides

Features

Safety & Guardrails

Git restrictions: AI cannot commit/push/add/merge/rebase/reset
Protected files: src/version.ts, src/models/index.ts blocked
Secret protection: .env* files blocked
Dangerous commands: rm -rf, npm publish blocked
File size limit: 500 lines max for new files

Automation

Auto-formatting: Prettier + ESLint runs after every code edit
Pre-allowed permissions: Common operations run without prompts
Parallel search: 6 agents for fast codebase exploration

Productivity

Slash Command Action
/project:test Run tests
/project:build Build SDK
/project:fix Auto-fix lint issues
/project:explore {query} Parallel codebase search
/project:add-resource {name} Scaffold new resource
/project:add-endpoint Add endpoint to resource
/project:review Review code changes

Codex Skills

Skill Description
add-resource Create new API resource
add-endpoint Add method to resource
fix-typescript Fix TS errors
fix-tests Fix Jest failures
fix-lint Fix lint issues
add-query-params Add query params
handle-binary Binary responses
add-pagination Pagination support

File Changes

New Files (35)

CLAUDE.md                              # Claude guidance (71 lines)       
AGENTS.md                              # Codex guidance (173 lines)       
Makefile                               # Development commands (203 lines) 
.claudeignore                          # Files Claude should ignore       
                                                                          
.claude/                                                                  
├── settings.json                      # Permissions & hooks              
├── hooks/                                                                
│   ├── pre-tool-use.sh               # Safety checks                     
│   ├── post-tool-use.sh              # Auto-formatting                   
│   └── user-prompt-submit.sh         # (minimal)                         
├── agents/                                                               
│   ├── parallel-explore.md           # Orchestrator                      
│   ├── explore-resources.md          # Search src/resources/             
│   ├── explore-models.md             # Search src/models/                
│   ├── explore-tests.md              # Search tests/                     
│   ├── quick-search.md               # Fast keyword search               
│   └── codebase-analyzer.md          # Comprehensive analysis            
├── commands/                                                             
│   ├── test.md, build.md, fix.md     # Common tasks                      
│   ├── explore.md, review.md         # Search & review                   
│   └── add-resource.md, add-endpoint.md  # Scaffolding                   
├── docs/                                                                 
│   ├── architecture.md               # Detailed architecture             
│   ├── adding-resources.md           # Step-by-step guide                
│   └── testing-guide.md              # Testing patterns                  
└── shared/                                                               
    ├── README.md                     # Template usage guide              
    ├── model-template.ts             # Model scaffolding                 
    ├── resource-template.ts          # Resource scaffolding              
    └── test-template.spec.ts         # Test scaffolding                  
                                                                          
.codex/                                                                   
└── skills/                                                               
    ├── add-resource/SKILL.md                                             
    ├── add-endpoint/SKILL.md                                             
    ├── fix-typescript/SKILL.md                                           
    ├── fix-tests/SKILL.md                                                
    ├── fix-lint/SKILL.md                                                 
    ├── add-query-params/SKILL.md                                         
    ├── handle-binary/SKILL.md                                            
    └── add-pagination/SKILL.md                                           

Modified Files (4)

File Change
.eslintignore Add .claude to ignore list
.prettierignore Add .claude to ignore list
.gitignore Add /docs, auto-generated CLAUDE.md patterns
jest.config.js Add testPathIgnorePatterns for .claude/

Usage

For Claude Code Users

# Claude auto-loads CLAUDE.md on start                                    
# Use slash commands:                                                     
/project:test                                                             
/project:build                                                            
/project:explore calendars                                                
                                                                          
# Ask naturally:                                                          
"Add a new widgets resource"                                              
"Fix the failing tests"                                                   

For Codex CLI Users

# Codex auto-loads AGENTS.md                                              
codex "Add a new widgets resource"                                        
                                                                          
# With skills enabled                                                     
codex --enable skills "Fix the TypeScript errors"                         

Testing

[x] make ci passes (358 tests)
[x] ESLint clean
[x] Prettier formatted
[x] All hooks functional
[x] Templates valid TypeScript (excluded from CI via ignore files)

Documentation

• Root CLAUDE.md provides quick reference
• Detailed guides in .claude/docs/ for deep dives
• AGENTS.md provides Codex with full repository context
• Skills provide step-by-step task guidance

Breaking Changes

None. This PR only adds new configuration files.

Checklist

[x] AI assistants cannot commit/push (user controls git)
[x] Secrets protected (.env* blocked)
[x] Auto-generated files protected
[x] Templates excluded from linting/testing
[x] No duplicate content between Claude and Codex configs
[x] CI passes


Note

Introduces AI assistant scaffolding and developer tooling without changing SDK runtime behavior.

  • Adds .claude/ (agents, commands, docs, templates, safety hooks, settings) and CLAUDE.md for Claude Code
  • Adds .codex/skills/ and AGENTS.md for Codex task guides
  • New Makefile with build/test/lint/CI shortcuts
  • Updates ignore lists: .eslintignore, .prettierignore, .gitignore (include .claude/, /docs, local patterns)
  • Tweaks jest.config.js: ignore .claude/, add module mappers, ESM handling, setup files

No changes to src/ logic; primarily configuration, docs, and developer experience improvements.

Written by Cursor Bugbot for commit 70bbb81. This will update automatically on new commits. Configure here.

  This commit adds configuration for Claude Code and OpenAI Codex CLI to
  improve developer experience when using AI coding assistants with this
  repository.

  ## Claude Code Configuration (.claude/)

  ### Core Files
  - CLAUDE.md: Project guidance with quick start, architecture overview,
    git restrictions, and slash command reference
  - .claudeignore: Excludes build artifacts, dependencies, secrets, and
    other AI agent files from Claude's context

  ### Automation & Safety
  - settings.json: Pre-allowed permissions for common operations,
    denied git write operations (commit/push/add)
  - hooks/pre-tool-use.sh: Blocks dangerous commands, enforces 500-line
    limit for new files, protects auto-generated files
  - hooks/post-tool-use.sh: Auto-formats code with Prettier + ESLint

  ### Productivity Features
  - 6 parallel search agents for fast codebase exploration
  - 7 slash commands (/project:test, /project:build, /project:fix, etc.)
  - 3 detailed guides (architecture, adding-resources, testing)
  - 4 code templates for scaffolding new resources

  ## OpenAI Codex CLI Configuration (.codex/)

  ### Core Files
  - AGENTS.md: Repository context, code patterns, project structure,
    and conventions for Codex to understand the codebase

  ### Skills (.codex/skills/)
  8 reusable task-specific skills:
  - add-resource: Create new API resource with model, class, and tests
  - add-endpoint: Add method to existing resource
  - fix-typescript: Resolve TypeScript compilation errors
  - fix-tests: Fix failing Jest tests
  - fix-lint: Fix ESLint and Prettier issues
  - add-query-params: Add query parameter support
  - handle-binary: Implement binary/stream responses
  - add-pagination: Add pagination support

  ## Build Configuration Updates

  - .eslintignore: Exclude .claude/ from linting
  - .prettierignore: Exclude .claude/ from formatting
  - jest.config.js: Exclude .claude/ from test discovery
  - .gitignore: Ignore /docs (not .claude/docs/), auto-generated
    CLAUDE.md files in subdirectories

  ## Developer Experience

  - Auto-formatting on every edit (Prettier + ESLint)
  - Pre-allowed tools reduce permission prompts
  - Git safety: Claude/Codex write code, developers handle commits
  - New file size limit (500 lines) encourages modular code
  - Templates and guides accelerate onboarding

  ## File Summary

  New files: 35
  - .claude/: 24 files (agents, commands, docs, hooks, shared, settings)
  - .codex/: 8 files (skills)
  - Root: 3 files (CLAUDE.md, AGENTS.md, Makefile, .claudeignore)

  Modified files: 4
  - .eslintignore, .gitignore, .prettierignore, jest.config.js
@AaronDDM AaronDDM requested a review from radenkovic January 9, 2026 15:20
@AaronDDM AaronDDM self-requested a review January 9, 2026 15:27
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

"command": "bash .claude/hooks/pre-tool-use.sh"
}
]
}
Copy link

Choose a reason for hiding this comment

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

Pre-tool hook matcher prevents Edit/Write protections from running

High Severity

The PreToolUse hook is configured with "matcher": "Bash", meaning the pre-tool-use.sh script only executes for Bash commands. However, the script contains protection logic for Edit and Write tools (lines 30-52) that guards src/version.ts, src/models/index.ts, package-lock.json, .env files, and enforces the 500-line limit for new files. Since the hook never triggers for Edit/Write tools, these safety checks are dead code and the documented file protections don't actually work. The matcher needs to include Edit and Write tools.

Additional Locations (1)

Fix in Cursor Fix in Web


# Block npm publish without dry-run
echo "$CMD" | grep -qE 'npm\s+publish' && ! echo "$CMD" | grep -qE '--dry-run' && \
block "BLOCKED: Use 'npm publish --dry-run' first."
Copy link

Choose a reason for hiding this comment

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

Non-portable regex patterns fail on BSD grep

Medium Severity

The grep patterns on lines 18, 22, and 26 use \s to match whitespace, which is a Perl-compatible regex extension not supported by POSIX extended regex. On macOS with BSD grep, \s doesn't match whitespace characters, so the safety checks for blocking git write operations, dangerous rm commands, and npm publish will silently fail. Using [[:space:]] instead would be portable across both GNU and BSD grep.

Fix in Cursor Fix in Web

queryParams: {
limit: 10,
},
});
Copy link

Choose a reason for hiding this comment

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

Test template assertion missing required overrides property

Low Severity

The "with query params" test assertion is missing overrides: undefined in the expected call object. The resource template always passes overrides to _list() (even when undefined), and AGENTS.md explicitly shows assertions should include overrides: undefined when the caller doesn't provide it. Since Jest's toHaveBeenCalledWith performs exact matching, this test would fail when developers use the template because the actual call includes overrides: undefined but the assertion doesn't expect it.

Fix in Cursor Fix in Web

@AaronDDM AaronDDM changed the title Add AI Coding Assistant Configuration [TW-4564] Add AI Coding Assistant Configuration Jan 9, 2026
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