Skip to content

docs: add contributing guide (CONTRIBUTING.md)#665

Open
ymstar wants to merge 5 commits into
colbymchenry:mainfrom
ymstar:feat/contributing-md
Open

docs: add contributing guide (CONTRIBUTING.md)#665
ymstar wants to merge 5 commits into
colbymchenry:mainfrom
ymstar:feat/contributing-md

Conversation

@ymstar
Copy link
Copy Markdown
Contributor

@ymstar ymstar commented Jun 3, 2026

Summary

Add CONTRIBUTING.md — a comprehensive guide for contributors covering development setup, project architecture, testing conventions, commit message format, and PR workflow.

This branch is built on top of @andreinknv's work from PR #97 (docs/ADDING-A-LANGUAGE.md), whose commits are preserved with original authorship. The contributing guide references their cookbook in the "Adding a New Language" section.

Changes

File Change
CONTRIBUTING.md New contributing guide (~250 lines)
README.md Add Contributing section referencing CONTRIBUTING.md and docs/ADDING-A-LANGUAGE.md
CLAUDE.md Add pointer to CONTRIBUTING.md in House rules

What it covers

  • Prerequisites and development setup
  • Project structure overview
  • Making changes (types, extractors, MCP, installer)
  • Adding a new language (references docs/ADDING-A-LANGUAGE.md)
  • Testing philosophy and conventions
  • Commit message format (Conventional Commits)
  • PR checklist and review process
  • Issue reporting guidelines

Attribution

Based on @andreinknv's ADDING-A-LANGUAGE.md cookbook (cherry-picked with original commit authorship preserved). The upstream PR was closed without merging, so the cookbook content was incorporated by cherry-picking the original commits to retain proper git attribution.

andreinknv and others added 5 commits June 3, 2026 17:21
Adds docs/ADDING-A-LANGUAGE.md walking through every step a contributor
needs to add a new language extractor:

  1. Source a tree-sitter wasm grammar — covers the three real-world
     paths (already in tree-sitter-wasms, pre-built release artifact,
     build from source via tree-sitter-cli's bundled wasi-sdk).
  2. Probe the AST with a small scratch script before writing code.
  3. Register in src/types.ts + src/extraction/grammars.ts.
  4. Type-check before adding extraction logic.
  5. Pick a pattern: LanguageExtractor config (procedural / OO) or a
     self-contained extractor class (declarative / template / non-OO).
  6. Map onto existing NodeKind / EdgeKind values.
  7. Tests + end-to-end CLI smoke.
  8. PR description checklist.

Each section points at the existing extractors as worked examples
(R for the OO path, HCL/SQL/Liquid for the custom path, Pascal+DFM
for the cross-format case). README.md and CLAUDE.md gain a one-line
pointer to the cookbook.

Closes colbymchenry#55.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sections 3, 5a, 5b previously taught the monolithic-file pattern that
PR colbymchenry#116 obsoletes. After colbymchenry#116, adding a language is one new file in
src/extraction/languages/ + 2 lines in registry.ts (and an optional
1-line addition to the Language union for TypeScript narrowing).

Updated:
- Section 3: full rewrite. Was 3-file mutation (types.ts, grammars.ts,
  CLAUDE.md). Now: 1 LanguageDef file + registry import + Language
  union entry. Includes a "why per-file" sidebar pointing at the
  cross-PR conflict bottleneck the registry resolves.
- Section 5a: drops the EXTRACTORS-map registration step. The
  extractor is referenced from the LanguageDef directly.
- Section 5b: drops the tree-sitter.ts dispatch wiring. customExtractor
  on the LanguageDef takes the dispatch — no per-language if-branches.

Section 1 (sourcing wasm), Section 2 (probing AST), Sections 6/7/8
(NodeKind mapping, tests, PR checklist), and the existing-extractors
reference table are unchanged — those parts of the workflow didn't
change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add CONTRIBUTING.md covering development setup, project architecture,
testing conventions, commit message format, and PR workflow. References
docs/ADDING-A-LANGUAGE.md for language addition contributions.
Reference CONTRIBUTING.md and docs/ADDING-A-LANGUAGE.md from the README.
@ymstar ymstar changed the title docs: add contributing guide docs: add contributing guide (CONTRIBUTING.md) Jun 3, 2026
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.

2 participants