Skip to content

Add GitHub Copilot instructions and agent configuration for Celery/Django patterns#132

Merged
danieleguido merged 13 commits intodevelopfrom
copilot/setup-agents-and-instructions
Jan 15, 2026
Merged

Add GitHub Copilot instructions and agent configuration for Celery/Django patterns#132
danieleguido merged 13 commits intodevelopfrom
copilot/setup-agents-and-instructions

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Documents repository conventions for the Django+Celery task processing system to enable better AI-assisted development and faster developer onboarding.

Files Added

.github/copilot-instructions.md (271 lines)

  • Repository architecture: Django app with Celery workers, MySQL, Redis
  • Task organization: impresso/tasks/ for Celery decorators, impresso/utils/tasks/ for helpers
  • Job tracking pattern: update_job_progress(), is_task_stopped()
  • Logging convention: f"[job:{job.pk} user:{user.pk}] message"

.github/agents/celery-tasks.md (424 lines)

  • Task definition patterns with retry logic and exponential backoff
  • Job progress tracking through database and Redis state updates
  • User access control via bitmap masks and group membership

.github/agents/testing.md (590 lines)

  • TestCase vs TransactionTestCase usage for signal/transaction testing
  • Email testing with mail.outbox inspection patterns
  • Celery task testing with synchronous execution in test environment
  • Mocking strategies for SMTP dependencies

.github/agents/django-development.md (666 lines)

  • Model patterns with Profile/UserBitmap relationships
  • Admin customization: list displays, actions, field organization
  • Management command structure with argument parsing and error handling
  • Signal registration for user creation (Profile/UserBitmap auto-creation)

.github/agents/documentation.md (677 lines)

  • Google-style docstring conventions for Python code
  • Environment variable documentation tables
  • Setup/deployment guide structure
  • Troubleshooting patterns for common issues (DB connection, Redis, Celery workers)

.github/README.md (94 lines)

  • Overview of instruction file purposes and usage

Key Patterns Documented

Celery Task Structure:

@shared_task(
    bind=True,
    autoretry_for=(Exception,),
    exponential_backoff=2,
    retry_kwargs={"max_retries": 5},
    retry_jitter=True,
)
def task_name(self, job_id: int):
    job = Job.objects.get(pk=job_id)
    update_job_progress(task=self, job=job, progress=0.5, ...)
    if is_task_stopped(task=self, job=job, ...):
        return

User Permission Enforcement:

user_bitmask = BitMask64(job.creator.profile.user_bitmap_key)
# User bitmap access controls for permissions

Documentation focuses on current active tasks: user account management, email notifications, user permissions (UserBitmap), special membership requests, and plan change requests.

Updates

Updated documentation to reflect removal of collection and export tasks from develop branch. Removed references to:

  • Solr integration patterns
  • Collection management tasks
  • CSV/ZIP export functionality
  • Related pagination helpers and utility modules

Total: ~2,400 lines documenting conventions specific to this Django+Celery architecture for user management and background task processing.

Original prompt

This section details on the original issue you should resolve

<issue_title>setup AGENTS and copilot instructions</issue_title>
<issue_description>
This repository uses Celery as the background task processing system for the Django application (see tasks and related modules)
This document describes the available agents (workers), their responsibilities, and conventions for adding new tasks.
</issue_description>

<agent_instructions>add convenient files for Agents and specify relevant sections. You can use tests to see potentialities of this repository.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@danieleguido danieleguido marked this pull request as ready for review January 15, 2026 15:03
Copilot AI and others added 3 commits January 15, 2026 15:09
- Create .github/copilot-instructions.md with repository overview
- Add .github/agents/celery-tasks.md for Celery task development
- Add .github/agents/testing.md for test development
- Add .github/agents/django-development.md for Django development
- Document all conventions, patterns, and best practices

Co-authored-by: danieleguido <1181642+danieleguido@users.noreply.github.com>
- Create .github/agents/documentation.md
- Include comprehensive guidelines for writing and maintaining documentation
- Cover README structure, code docstrings, API documentation, changelog
- Add setup and deployment documentation guidelines
- Include troubleshooting and contributing guidelines

Co-authored-by: danieleguido <1181642+danieleguido@users.noreply.github.com>
- Create .github/README.md explaining the structure
- Document purpose and usage of copilot instructions
- Provide overview of agent-specific instruction files
- Include repository overview and key concepts
- Add contributing guidelines for maintaining instructions

Co-authored-by: danieleguido <1181642+danieleguido@users.noreply.github.com>
Copilot AI changed the title [WIP] Add agents setup and copilot instructions Add GitHub Copilot instructions and agent configuration for Celery/Django patterns Jan 15, 2026
Copilot AI requested a review from danieleguido January 15, 2026 15:17
@danieleguido
Copy link
Contributor

@copilot develop branch changed, I've removed all tasks related to collections and exports, can you update the agents?

@danieleguido
Copy link
Contributor

@copilot develop branch changed, I've removed all tasks related to collections and exports, can you update the agents?

- Remove Solr integration documentation
- Remove collection management task patterns
- Remove CSV/ZIP export examples
- Remove pagination with Solr helpers
- Update task modules list to only include active tasks
- Update management commands to only list existing ones
- Remove references to removed utility modules (collection.py, export.py, textreuse.py)
- Simplify key models list to only include used models
- Update common commands examples

Co-authored-by: danieleguido <1181642+danieleguido@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 15, 2026

@copilot develop branch changed, I've removed all tasks related to collections and exports, can you update the agents?

Updated the agent documentation to remove all collection and export task references. The changes include:

  • Removed Solr integration documentation
  • Removed collection management and CSV/ZIP export patterns
  • Updated task module lists to only include active tasks (account, userBitmap, email, userSpecialMembershipRequest)
  • Removed references to deleted utility modules (collection.py, export.py, textreuse.py)
  • Updated management commands to only list existing ones

Commit: af69589

Copilot AI and others added 5 commits January 15, 2026 15:40
- Replace exportqueryascsv example with createaccount example
- Update changelog example to reflect current features
- Remove references to export and collection functionality

Co-authored-by: danieleguido <1181642+danieleguido@users.noreply.github.com>
- Remove "Solr integration" from agent capabilities description

Co-authored-by: danieleguido <1181642+danieleguido@users.noreply.github.com>
@danieleguido danieleguido merged commit 98c1a03 into develop Jan 15, 2026
1 check passed
@danieleguido danieleguido deleted the copilot/setup-agents-and-instructions branch January 15, 2026 15:53
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.

setup AGENTS and copilot instructions

2 participants