# Copilot instructions for Darkbot

Purpose
-------
Provide repository-specific guidance to Copilot sessions to help with builds, tests, and code reasoning.

Build / Test / Lint commands
---------------------------
- User install (simple build):
  - From the project root (/home/hko/darkbot):
    - ./build.sh
      - This runs configure in build/ and then make && make install (default --prefix=$HOME/darkbot).
- Developer (from git/source, out-of-tree build):
  - ./rebuild_all.sh  (runs autogen/bootstrap + configure in build/ and builds everything)
  - autogen.sh or bootstrap.sh can be used to generate configure when working from VCS.
- Smaller build variant: ./build_small.sh
- Enable testing (developer):
  - ./testing.sh  (runs configure with --enable-testing, then make && make install)
  - After ./testing.sh, test binaries/utilities are installed to the configured prefix (default $HOME/darkbot/bin). Run the specific binary you want to exercise directly (there is no single unified unit-test runner in this codebase).
- Clean / dist:
  - ./clean.sh, clean, distribute.sh
- Linting: There is no project-wide linter or formatting config in the repo. Use platform C tooling (gcc/clang, static analyzers) manually if needed.

How to run a single test
------------------------
- This project does not expose a harness like 'pytest' or 'ctest'. To run a single test:
  1. Enable testing and build: ./testing.sh
  2. Run the specific test binary or utility installed under the configured prefix (default: $HOME/darkbot/bin) or run the specific script in the top-level scripts/ directory (e.g., check-integrity, AddUser) depending on what you want to exercise.

High-level architecture
-----------------------
- Language: C (classic IRC bot implementation).
- Core source: source/ (core .c/.h files, prototypes, defines.h).  This is the runtime code for the bot.
- Build system: GNU autotools. Out-of-tree builds are supported via a build/ directory (configure and make are executed from build/).
- Top-level scripts: bootstrap.sh, autogen.sh, build.sh, rebuild_all.sh, build_small.sh, testing.sh, clean.sh — these wrap the autotools workflow and common developer tasks.
- Runtime data: dat/ contains database files (userlist.db, random DBs, etc.) used at runtime.
- Utilities: scripts/ contains shell utilities that operate on dat/ and the installed tree.
- Documentation: docs/ and share/doc/darkbot contain HACKING, INSTALL, README_UTILS, WHATSNEW; read those for developer and maintainer details.

Key conventions and repo-specific notes
--------------------------------------
- Out-of-tree builds: Use the provided build scripts; configure and generated files are placed into build/ to keep source/ pristine.
- Default install prefix: $HOME/darkbot when using the provided scripts; configure --prefix is set by the scripts.
- Required autotools versions (from docs/HACKING):
  - GNU M4: 1.4
  - autoconf: 2.59 or 2.60
  - automake: 1.9  (note: automake 1.10 is explicitly listed as not supported)
- Use gmake if present (the top-level scripts prefer gmake when available).
- There is no CI/linter config tracked in the repo; tests are enabled at build-time via --enable-testing.
- Database files in dat/ are authoritative for runtime; many utilities in scripts/ read/update them—exercise caution when running modify scripts against production data.

Where to look for more context
-----------------------------
- docs/HACKING — developer requirements and autotools notes
- docs/README_UTILS — descriptions for shell utilities in scripts/
- README — user-level build hints and references to the project website

AI assistant notes
------------------
- No existing .github/copilot-instructions.md was found; this file was added.
- No CLAUDE.md, .cursorrules, AGENTS.md, or other assistant-specific config was found in the project root to incorporate.

If you want edits
-----------------
If you prefer different default build prefixes, CI specifics, or want Copilot to prefer certain files/directories when suggesting changes (for example: "avoid editing dat/ files directly"), say which policy to add and it will be incorporated.

Configured MCP servers
----------------------
- A Build/Test MCP server (GitHub Actions) was added at .github/workflows/ci-build.yml. It runs on push and pull_request, installs basic autotools/build packages, runs ./build.sh and ./testing.sh.
- Adjust the workflow if you need a different OS matrix, additional packages, or finer-grained steps (e.g., explicit autogen/bootstrap before building).

