What this is: A normative description of how code, docs, and process work in ForgeLM. Not aspirational — extracted from the actual state of
pyproject.toml,forgelm/,tests/, and.github/.Who this is for: Contributors (human or AI) making changes. Read the relevant standard before the first commit of a PR.
How to change a standard: PR to this directory. Every rule here cites a concrete file — changing the rule requires either updating the cited code first or discussing why the cited code should change.
| Standard | Scope | Read before |
|---|---|---|
| coding.md | Python style, type hints, docstrings, naming | Any .py change |
| architecture.md | Module boundaries, config flow, optional deps | New modules, refactors |
| regex.md | Regex hygiene, ReDoS exposure, fixture fragmentation | Any re.compile / re.sub change |
| error-handling.md | Exceptions, exit codes, user-facing messages | Any error path work |
| logging-observability.md | Loggers, structured events, webhooks, audit log | Anything that emits output |
| testing.md | Test layout, fixtures, coverage, CI gates | Every feature PR |
| documentation.md | Markdown structure, docstrings, mermaid, link hygiene | Any doc change |
| localization.md | TR/EN mirror rules, CLI language policy | User-facing strings |
| code-review.md | PR template, review checklist, merge criteria | Every PR |
| release.md | Semver, CHANGELOG, PyPI publish, version bumps | Release time only |
If you're new to the codebase, read them in this order — each one takes 5-10 minutes:
- architecture.md — mental model of how modules fit
- coding.md — what your Python should look like
- testing.md — what CI will demand
- error-handling.md + logging-observability.md — how failures and signals flow
- documentation.md + localization.md — for the docs side
- code-review.md — last stop before opening the PR
- release.md — only when cutting a version
These apply to this directory:
- Every rule must cite real code. No rule may say "the style is X" without pointing to a file that demonstrates X. If the codebase and the rule disagree, one of them is wrong — the rule does not automatically win.
- Keep each standard under ~250 lines. A standard you can't skim in 5 minutes gets ignored. Push deep examples to guides/ and link.
- Prefer imperative, testable statements. "Log errors at
ERRORlevel beforesys.exit()" is better than "log errors appropriately." - Update with code. A PR that violates a standard must either (a) get rejected, (b) fix the violation, or (c) update the standard in the same PR with reasoning.
- ../guides/ — Tutorial-style documents for end users. Different audience: users of the library, not contributors.
- ../reference/ — API/config reference material for end users.
- ../qms/ — Quality management SOPs aimed at regulated-industry deployers (EU AI Act Art. 17). Partially overlaps with this directory but is organizational, not technical.
- ../../CONTRIBUTING.md — Entry-level contributor guide; should summarize and link to standards here.
- ../../CLAUDE.md — AI-agent-specific guidance. References standards but is not a replacement.