agentleFS
manastalukdarmanastalukdar/ai-devstudio/AGENTS.md

ai-devstudio

AGENTS.md1 starsChanged 7 months agoMITView on GitHub

This software is released under the MIT License. https://opensource.org/licenses/MIT --> This document provides guidelines for AI assistants (particularly Claude Code) when working with the AI DevStudio project. It ensures consistent, safe, and effective collaboration between human developers and AI agents. AI DevStudio is a professional development environment that extends Claude Code CLI with 150 professional skills across 4 tiers for automated workflows, code quality analysis, and session management. Core Philosophy: Time-saving automation with safety-first design and professional-grade code quality. Format:…

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

75 rules. About 2 are common, 57 are distinctive, and 16 are very specific to this project.

  • ≈2

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈57

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 16

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Format: All skills follow the official Claude Skills format with YAML frontmatter and the Agent Skills open standard.

    line 20
  2. Common:

    ABSOLUTE REQUIREMENT: Never use Claude or AI credentials for git commits.

    line 26
  3. Distinctive:

    Always read files before editing or writing

    line 37
  4. Distinctive:

    Use Edit tool for existing files, Write tool only for genuinely new files

    line 38
  5. Distinctive:

    Never create unnecessary documentation files unless explicitly requested

    line 40
  6. Very specific:

    All skills are in the skills/ directory, each in its own subdirectory

    line 44
  7. Distinctive:

    Test skills thoroughly before marking as complete

    line 47
  8. Distinctive:

    Follow the official Claude Skills format structure

    line 48
  9. Very specific:

    Reading Skills: Use Read tool to examine skills/skill-name/SKILL.md files

    line 54
  10. Very specific:

    Create directory in skills/skill-name/

    line 56
  11. Very specific:

    Create SKILL.md with proper YAML frontmatter

    line 57
  12. Distinctive:

    Follow the template structure from existing skills

    line 58
  13. Distinctive:

    Testing Skills: Verify skill syntax and behavior before committing

    line 59
  14. Distinctive:

    Documentation: Update README.md and CLAUDE.md when adding/modifying skills

    line 60
  15. Distinctive:

    Test installation on multiple platforms when possible

    line 68
  16. Very specific:

    Verify dynamic discovery works after adding a new skill: ls skills/<new-skill>/SKILL.md

    line 70
  17. Very specific:

    Must integrate with .claude/sessions/ directory structure

    line 76
  18. Distinctive:

    Should preserve full context and history

    line 77
  19. Distinctive:

    Must handle edge cases (no active session, corrupt session files, etc.)

    line 78
  20. Very specific:

    Follow the patterns established in docs/session-management/sessions.md

    line 79
  21. Distinctive:

    Python: Follow PEP 8, use type hints where beneficial

    line 85
  22. Distinctive:

    Shell Scripts: Use shellcheck-compliant syntax

    line 86
  23. Distinctive:

    Markdown: Use consistent formatting, proper headers, code blocks

    line 87
  24. Distinctive:

    Keep README.md as the primary user-facing documentation

    line 92
  25. Distinctive:

    Use CLAUDE.md for project context and memory

    line 93
  26. Distinctive:

    Use AGENTS.md (this file) for AI interaction guidelines

    line 94
  27. Distinctive:

    Update CONTRIBUTING.md for contributor workflows

    line 95
  28. Distinctive:

    Verify command behavior with Claude Code CLI

    line 100
  29. Distinctive:

    Test edge cases and error handling

    line 101
  30. Distinctive:

    Ensure backwards compatibility when modifying existing commands

    line 102
  31. Very specific:

    Use kebab-case: session-start, fix-todos, security-scan

    line 157
  32. Distinctive:

    Follow established patterns in the skill family

    line 159
  33. Distinctive:

    Avoid abbreviations unless universally understood

    line 160
  34. Distinctive:

    Use git checkpoints for safety before destructive operations

    line 175
  35. Distinctive:

    Ask for explicit confirmation

    line 202
  36. Distinctive:

    Technical: Use precise technical terminology

    line 244
  37. Distinctive:

    When clarification is needed:

    line 250
  38. Distinctive:

    Ask specific, focused questions

    line 252
  39. Distinctive:

    Don't ask questions with obvious answers

    line 255
  40. Distinctive:

    When multiple approaches are valid:

    line 259
  41. Distinctive:

    Update command descriptions when behavior changes

    line 270
  42. Distinctive:

    Keep documentation current with codebase

    line 272
  43. Distinctive:

    Test commands with new Claude Code CLI versions

    line 273
  44. Distinctive:

    Use conventional commit messages

    line 278
  45. Distinctive:

    Keep commits focused and atomic

    line 279
  46. Distinctive:

    Write clear commit messages explaining "why"

    line 280
  47. Distinctive:

    Update version numbers consistently

    line 285
  48. Distinctive:

    Update CHANGELOG.md with changes

    line 286
  49. Distinctive:

    Test installation on all supported platforms

    line 287
  50. Distinctive:

    Verify all commands work with current Claude Code version

    line 288
  51. Very specific:

    Use /security-scan command for vulnerability detection

    line 295
  52. Common:

    Never commit sensitive data (API keys, passwords, credentials)

    line 296
  53. Distinctive:

    Never share session data without explicit permission

    line 303
  54. Distinctive:

    Don't expose internal implementation details unnecessarily

    line 305
  55. Very specific:

    Create new directory: skills/new-skill-name/

    line 311
  56. Distinctive:

    Add other frontmatter fields as needed

    line 315
  57. Distinctive:

    Add skill markdown content following established patterns

    line 316
  58. Distinctive:

    Test thoroughly with various scenarios

    line 317
  59. Very specific:

    Update installation scripts to include new skill (install.sh uses dynamic discovery — no manual array update needed.

    line 318
  60. Distinctive:

    Document in README.md and CLAUDE.md (update skill count)

    line 319
  61. Distinctive:

    Update this file if new patterns are introduced

    line 320
  62. Distinctive:

    Read and understand current implementation

    line 324
  63. Distinctive:

    Test all documented use cases

    line 327
  64. Distinctive:

    Update documentation if behavior changes

    line 328
  65. Distinctive:

    Consider impact on dependent skills

    line 329
  66. Distinctive:

    When adding framework-specific features:

    line 333
  67. Distinctive:

    Keep core commands framework-agnostic

    line 335
  68. Distinctive:

    Create separate commands for framework-specific functionality

    line 336
  69. Distinctive:

    Document framework requirements clearly

    line 339
  70. Very specific:

    Use context: fork in YAML frontmatter to run a skill in an isolated subagent:

    line 388
  71. Very specific:

    Create worktrees for each workstream: git worktree add ../feature-a feature-a

    line 403
  72. Very specific:

    Use the Task tool (not Bash) for inter-agent communication

    line 406
  73. Very specific:

    Never call Bash(git commit) from an agent — surface to user via Task output

    line 415
  74. Distinctive:

    Safety Ensured: No accidental data loss or corruption

    line 484
  75. Distinctive:

    Standards Followed: All guidelines in this document are followed

    line 485

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md
<!-- Copyright (c) 2025 Manas Talukdar This software is released under the MIT License. https://opensource.org/licenses/MIT -->

AGENTS.md - AI Agent Guidelines for AI DevStudio

Purpose

This document provides guidelines for AI assistants (particularly Claude Code) when working with the AI DevStudio project. It ensures consistent, safe, and effective collaboration between human developers and AI agents.

Project Identity

AI DevStudio is a professional development environment that extends Claude Code CLI with 150 professional skills across 4 tiers for automated workflows, code quality analysis, and session management.

Core Philosophy: Time-saving automation with safety-first design and professional-grade code quality.

Format: All skills follow the official Claude Skills format with YAML frontmatter and the Agent Skills open standard. Each skill resides in skills/skill-name/SKILL.md.

Critical Safety Rules

1. Git Credentials and Commits

ABSOLUTE REQUIREMENT: Never use Claude or AI credentials for git commits.

  • ✅ CORRECT: All commits must use the developer's configured git credentials
  • ❌ NEVER: Use "Claude Sonnet 4.5 noreply@anthropic.com" or any AI identity
  • ❌ NEVER: Include "Co-Authored-By: Claude" or similar AI attribution in commits
  • ❌ NEVER: Modify git config to set AI credentials

Rationale: Commits represent legal authorship and accountability. AI assistants are tools, not authors.

2. File Operations

  • Always read files before editing or writing
  • Use Edit tool for existing files, Write tool only for genuinely new files
  • Preserve existing code style, formatting, and conventions
  • Never create unnecessary documentation files unless explicitly requested

3. Skill Development

  • All skills are in the skills/ directory, each in its own subdirectory
  • Each skill has a SKILL.md file (uppercase) with YAML frontmatter
  • Skills must be self-contained with clear instructions
  • Test skills thoroughly before marking as complete
  • Follow the official Claude Skills format structure

Development Workflows

Working with Skills

  1. Reading Skills: Use Read tool to examine skills/skill-name/SKILL.md files
  2. Creating Skills:
    • Create directory in skills/skill-name/
    • Create SKILL.md with proper YAML frontmatter
    • Follow the template structure from existing skills
  3. Testing Skills: Verify skill syntax and behavior before committing
  4. Documentation: Update README.md and CLAUDE.md when adding/modifying skills

Installation Scripts

  • install.py and install.sh must be kept in sync
  • uninstall.py and uninstall.sh must be kept in sync
  • Installation copies from skills/ to ~/.claude/skills/
  • Uninstallation removes from ~/.claude/skills/ (and legacy ~/.claude/commands/ if present)
  • Test installation on multiple platforms when possible
  • install.sh and uninstall.sh use dynamic discovery via the GitHub API — no manual array update needed when adding new skills
  • Verify dynamic discovery works after adding a new skill: ls skills/<new-skill>/SKILL.md

Session Management

Skills in the session-* family require special attention:

  • Must integrate with .claude/sessions/ directory structure
  • Should preserve full context and history
  • Must handle edge cases (no active session, corrupt session files, etc.)
  • Follow the patterns established in docs/session-management/sessions.md

Code Quality Standards

Style and Formatting

  • Python: Follow PEP 8, use type hints where beneficial
  • Shell Scripts: Use shellcheck-compliant syntax
  • Markdown: Use consistent formatting, proper headers, code blocks
  • Commands: Clear structure with purpose, usage, examples, and edge cases

Documentation

  • Keep README.md as the primary user-facing documentation
  • Use CLAUDE.md for project context and memory
  • Use AGENTS.md (this file) for AI interaction guidelines
  • Update CONTRIBUTING.md for contributor workflows

Testing

  • Manually test installation scripts on supported platforms
  • Verify command behavior with Claude Code CLI
  • Test edge cases and error handling
  • Ensure backwards compatibility when modifying existing commands

Skill Development Guidelines

Skill Structure

Each skill must be in its own directory with a SKILL.md file (uppercase) that includes YAML frontmatter followed by markdown content:

---
name: skill-name
description: Clear description of what it does and when to use it
disable-model-invocation: false  # true for manual-only skills
---

# Skill Name

## Purpose
Clear one-line description

## Usage
How to invoke the skill

## Behavior
Step-by-step process

## Examples
Real-world use cases

## Edge Cases
How to handle errors and unusual situations

## Safety Considerations
Any risks or precautions

YAML Frontmatter Fields:

  • name: Skill name (lowercase, hyphens, max 64 chars)
  • description: What it does and when to use it (helps Claude decide when to invoke)
  • disable-model-invocation: Set to true for manual-only skills (side effects, user control)
  • user-invocable: Set to false to hide from menu (default: true)
  • allowed-tools: Optional - restrict which tools Claude can use
  • context: Set to fork to run in subagent
  • agent: Subagent type when using context: fork

Skill Categories

  1. Development Workflow: Automate repetitive tasks
  2. Code Quality & Security: Analysis and improvement
  3. Advanced Analysis: Deep understanding and explanation
  4. Session & Project Management: Context preservation and collaboration

Skill Naming

  • Use kebab-case: session-start, fix-todos, security-scan
  • Be descriptive but concise
  • Follow established patterns in the skill family
  • Avoid abbreviations unless universally understood

Integration Points

Claude Code CLI

  • Skills are invoked via /skill-name syntax (Claude Skills)
  • Skills receive context from Claude Code conversation history
  • Skills can use Claude Code's built-in tools (Read, Write, Edit, Bash, etc.)
  • Skills should be autonomous and minimize user interaction

Git Integration

  • Skills may read git status and history
  • Skills should never commit without explicit user request
  • Use git checkpoints for safety before destructive operations
  • Respect user's git configuration and credentials

File System

  • Primary workspace: Project root directory
  • Session data: .claude/sessions/ directory
  • Skill definitions: skills/ directory (each skill in skills/skill-name/SKILL.md)
  • Installation target: ~/.claude/skills/ (user-specific, personal skills) or .claude/skills/ (project-specific)

Common Patterns

Error Handling

If [error condition]:
1. Inform user of the issue
2. Provide clear error message
3. Suggest corrective action
4. Exit gracefully without making changes

User Confirmation

For destructive operations:

  1. Explain what will happen
  2. Ask for explicit confirmation
  3. Provide option to preview changes
  4. Allow user to cancel

Progress Feedback

For long-running operations:

  1. Show clear progress indicators
  2. Provide intermediate status updates
  3. Estimate completion when possible
  4. Allow interruption/cancellation

Anti-Patterns to Avoid

Never Do These

  • ❌ Use AI credentials for git operations
  • ❌ Commit code without explicit user request
  • ❌ Make destructive changes without checkpoints
  • ❌ Skip reading files before editing them
  • ❌ Create unnecessary documentation files
  • ❌ Add AI attribution to any generated content
  • ❌ Override user's git configuration
  • ❌ Modify files outside the project directory without permission
  • ❌ Execute commands that could cause data loss without confirmation
  • ❌ Hardcode paths or assume specific directory structures

Discouraged Practices

  • Creating new files when editing existing ones would suffice
  • Over-engineering simple solutions
  • Adding unnecessary abstractions
  • Verbose explanations when concise ones work
  • Using emoji in commits or generated code
  • Adding comments to self-explanatory code

Collaboration with Developers

Communication Style

  • Concise: Developers prefer brevity over verbosity
  • Technical: Use precise technical terminology
  • Action-Oriented: Focus on what needs to be done
  • Evidence-Based: Reference specific files and line numbers

Asking Questions

When clarification is needed:

  1. Ask specific, focused questions
  2. Provide context for why the information is needed
  3. Suggest reasonable defaults when applicable
  4. Don't ask questions with obvious answers

Providing Options

When multiple approaches are valid:

  1. Present 2-3 viable options
  2. Explain trade-offs clearly
  3. Recommend the best option with rationale
  4. Let the developer make the final decision

Project Maintenance

Regular Tasks

  • Update command descriptions when behavior changes
  • Sync installation scripts with new commands
  • Keep documentation current with codebase
  • Test commands with new Claude Code CLI versions
  • Review and close obsolete issues/TODOs

Version Control

  • Use conventional commit messages
  • Keep commits focused and atomic
  • Write clear commit messages explaining "why"
  • Reference issues/PRs when applicable

Release Process

  1. Update version numbers consistently
  2. Update CHANGELOG.md with changes
  3. Test installation on all supported platforms
  4. Verify all commands work with current Claude Code version
  5. Tag releases with semantic versioning

Security Considerations

Code Scanning

  • Use /security-scan command for vulnerability detection
  • Never commit sensitive data (API keys, passwords, credentials)
  • Be cautious with file operations outside project directory
  • Validate user input in command implementations

Privacy

  • Session data may contain sensitive project information
  • Never share session data without explicit permission
  • Respect .gitignore patterns
  • Don't expose internal implementation details unnecessarily

Extension and Customization

Adding New Skills

  1. Create new directory: skills/new-skill-name/
  2. Create SKILL.md with proper YAML frontmatter:
    • Set appropriate name and description
    • Choose correct disable-model-invocation setting
    • Add other frontmatter fields as needed
  3. Add skill markdown content following established patterns
  4. Test thoroughly with various scenarios
  5. Update installation scripts to include new skill (install.sh uses dynamic discovery — no manual array update needed; verify skills/<name>/SKILL.md exists)
  6. Document in README.md and CLAUDE.md (update skill count)
  7. Update this file if new patterns are introduced

Modifying Existing Skills

  1. Read and understand current implementation
  2. Identify specific changes needed
  3. Maintain backwards compatibility when possible
  4. Test all documented use cases
  5. Update documentation if behavior changes
  6. Consider impact on dependent skills

Framework-Specific Extensions

When adding framework-specific features:

  • Keep core commands framework-agnostic
  • Create separate commands for framework-specific functionality
  • Auto-detect framework when possible
  • Gracefully handle absence of framework
  • Document framework requirements clearly

Subagent Orchestration Patterns

Three-Tier Architecture

AI DevStudio uses a Command → Agent → Skill hierarchy:

  • Commands (.claude/commands/): High-level orchestrators. Invoke agents and skills, manage user interaction, aggregate results.
  • Agents (.claude/agents/): Specialized workers with restricted tool sets and preloaded skills. Run in isolated context.
  • Skills (skills/ or .claude/skills/): Atomic capability units. User-invocable or agent-consumed.

See /architecture:agent-command-system for a full mid-session reference.

Current Agents

AgentModelPurpose
code-reviewersonnetRead-only code quality analysis
security-auditorsonnetVulnerability scanning, OWASP, secrets detection
test-runnersonnetTest execution, failure analysis, TDD enforcement
claude-md-auditoropusDocumentation drift detection and repair (CLAUDE.md, AGENTS.md, README.md)
quality-fixersonnetIterative lint/shellcheck/type fix cycles (max 5 iterations)

Persistent Agent Memory

Each agent accumulates institutional knowledge across conversations via a memory directory:

.claude/agent-memory/
  claude-md-auditor/MEMORY.md
  code-reviewer/MEMORY.md
  security-auditor/MEMORY.md
  test-runner/MEMORY.md
  quality-fixer/MEMORY.md

Agents read their MEMORY.md at the start of each invocation and append new findings after completion.

Architecture Reference Commands

CommandPurpose
/architecture:skill-systemSkill tiers, YAML fields, naming, token budgets
/architecture:hook-eventsAll 19 hook events, settings structure, compact reminder
/architecture:agent-command-systemCommand/Agent/Skill hierarchy, agent table, memory system

Running Skills in Subagents

Use context: fork in YAML frontmatter to run a skill in an isolated subagent:

---
name: my-skill
description: Runs in a subagent
context: fork
agent: general
---

Parallel Agent Pattern (Boris Cherny Workflow)

For independent parallel workstreams, use git worktrees + tmux:

  1. Create worktrees for each workstream: git worktree add ../feature-a feature-a
  2. Launch agents in separate tmux panes, each in their worktree
  3. Agents communicate via shared state in .claude/sessions/ — never via direct bash IPC
  4. Use the Task tool (not Bash) for inter-agent communication
  5. Merge results when all agents complete

Implemented by the /parallel-agents skill.

Agent Design Rules

  • Restrict tools to minimum required (e.g., read-only agents get Read, Grep, Glob only)
  • Preload relevant skills via preloadedSkills frontmatter
  • Never call Bash(git commit) from an agent — surface to user via Task output
  • Agent-level self-evolution: agents may update their own skill files after execution to improve future runs

Hooks System

Claude Code supports 19 hook events that trigger shell commands at lifecycle points.

All 19 Hook Events

EventTriggeronce
PreToolUseBefore any tool callNo
PostToolUseAfter successful tool callNo
PostToolUseFailureAfter failed tool callNo
PermissionRequestWhen Claude requests permissionNo
UserPromptSubmitWhen user submits a messageNo
NotificationOn notification eventsNo
StopWhen Claude stops respondingNo
SubagentStartWhen a subagent startsNo
SubagentStopWhen a subagent stopsNo
PreCompactBefore context compactionYes
SessionStartWhen a session beginsYes
SessionEndWhen a session endsYes
SetupOn initial setupYes
TeammateIdleWhen a teammate goes idleNo
TaskCompletedWhen a task completesNo
ConfigChangeOn configuration changeNo
WorktreeCreateWhen a worktree is createdNo
WorktreeRemoveWhen a worktree is removedNo
InstructionsLoadedWhen instructions are loadedNo

Hook Configuration

Hooks are defined in .claude/settings.json under the hooks key:

"hooks": {
  "PreToolUse": [{ "hooks": [{ "type": "command", "command": "python3 ${CLAUDE_PROJECT_DIR}/.claude/hooks/scripts/hooks.py", "timeout": 5000, "async": true }] }],
  "SessionStart": [{ "hooks": [{ "type": "command", "command": "...", "timeout": 5000, "async": true, "once": true }] }]
}

Agent-Level Hooks

Agents can define their own hooks in YAML frontmatter:

hooks:
  PostToolUse:
    - type: command
      command: echo "Tool used" >> .claude/hooks/hooks-log.jsonl

DevStudio Hooks Script

.claude/hooks/scripts/hooks.py handles all 19 events with:

  • Platform-aware audio notifications (afplay/paplay/aplay/winsound)
  • JSONL logging to .claude/hooks/hooks-log.jsonl
  • --agent=<name> argument for agent-specific sound mapping
  • Graceful degradation when no audio player is available

Success Metrics

A successful interaction with AI DevStudio:

  1. Time Saved: Automates repetitive tasks effectively
  2. Quality Maintained: Code quality matches or exceeds manual work
  3. Context Preserved: Session continuity across conversations
  4. Safety Ensured: No accidental data loss or corruption
  5. Standards Followed: All guidelines in this document are followed

Resources

  • Main Documentation: README.md
  • Project Context: CLAUDE.md
  • Contribution Guidelines: CONTRIBUTING.md
  • Auto-Loaded Rules: .claude/rules/ (skill-development, git-workflow, code-quality, token-optimization)
  • Token Optimization Guide: TOKEN_OPTIMIZATION_GUIDE.md
  • Session System: docs/session-management/sessions.md
  • Hooks System: .claude/hooks/README.md
  • Migration Documentation: docs/migration/MIGRATION-PLAN.md
  • License: LICENSE (MIT)

Revision History

  • 2025-01-25: Initial creation with comprehensive AI agent guidelines
  • Added critical safety rules for git credentials
  • Documented command development patterns
  • Established code quality standards
  • Defined anti-patterns and best practices

Remember: AI DevStudio is a tool to enhance developer productivity. Always prioritize the developer's needs, maintain code quality, and follow safety-first principles.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.