Skip to content

Latest commit

 

History

History
114 lines (75 loc) · 3.37 KB

File metadata and controls

114 lines (75 loc) · 3.37 KB

CLAUDE.md

Askbot is a Django-based Q&A forum (like StackOverflow). Django 4.2, Python 3.8+, PostgreSQL recommended.

Development Setup

# Install
pip install -e .
askbot-setup

# Pre-commit (required)
pre-commit install
  • Test project: testproject/
  • Virtual env may be specified in task files

Testing

If you want to override settings - either django or askbot livesettings - use decorators designed for this, not context managers, if the setting value should not change during the test.

# Tox (recommended)
tox

Use virtual environment `env-md`

# Direct
cd askbot_site/

../env-md/bin/python manage.py test --parallel 8 askbot.tests askbot.deps.django_authopenid.tests

# Database config (if needed)
DB_TYPE=postgres DB_USER=askbot DB_PASS=askB0T! DB_HOST=localhost DB_PORT=5432 DB_NAME=askbotfortox

Before writing new tests: Check if the desired test already exists. Search existing test files for similar test cases. If a test exists, inform the developer. If not, plan the new test.

Running One-Off Python Scripts

Use manage.py shell with heredoc for one-off scripts that need Django context:

cd askbot_site && ../env-md/bin/python manage.py shell << 'EOF'
from askbot.utils.markup import markdown_input_converter

result = markdown_input_converter("**test**")
print(result)
EOF

This properly initializes Django settings and all app configurations.

Working with JavaScript, Svelte and SASS assets.

All client side media assets are located in askbot/media. Sass files are in askbot/media/sass. Javascript

To rebuild css files from sass and the help panel, refer to askbot/media/CLAUDE.md

Issue Tracking

This project uses bd (beads). Run bd onboard to get started.

bd ready              # Find available work
bd show <id>          # View issue details
bd update <id> --status in_progress  # Claim work
bd close <id>         # Complete work
bd sync               # Sync with git
bd new "<title>"      # Create a new issue
bd comments <id>      # List comments on an issue
bd comments add <id> "message"  # Add a comment

Dependencies: bd dep <blocker> --blocks <blocked> | bd dep tree <id>

Making issues part of an epic If I ask an issue X to be part of certain epic E, the issue in question must be blocking the said epic issue - i.e. bd dep <X-id> --blocks <E-id>

Creating issues: Issues must be self-sufficient—include all necessary context, acceptance criteria, and relevant file paths so that implementing them requires no additional hand-typed context (e.g., "implement issue X" should be enough).

Use /land skill when ending a work session.

Changelog

Changelog is in askbot/doc/source/changelog.rst

  • all new edits should be appended to thes section "Development (not yet released)"
  • entries must be brief - ideally 1 liners, should not be too technical

Architecture

See .claude/docs/architecture.md for detailed architecture reference including:

  • Django app structure and core models
  • Configuration system (Livesettings)
  • Template system (Jinja2)
  • Authentication (django_authopenid fork)
  • Multi-language support, search, email, Celery tasks

Coding style

Comments in the code must:

  • be concise
  • limit use of the technical jargon
  • must be written in clear simple English
  • should not cross reference files or lines of code - that info rots quickly

Python code must adhere to PEP8 standards.