-
Notifications
You must be signed in to change notification settings - Fork 12
CSharp Language Support Tasks
Input: Design documents from .speckit/features/110-csharp-code-indexing/
Prerequisites: plan.md (required), spec.md (required), research.md, quickstart.md
Tests: Per Constitution III (Test-Alongside), test tasks are included. Tests MUST be written during implementation in the same PR/commit.
Organization: All three user stories touch the same 2 source files, so tasks are organized as a single implementation phase with story labels for traceability.
- [P]: Can run in parallel (different files, no dependencies)
- [Story]: Which user story this task belongs to (e.g., US1, US2, US3)
- Include exact file paths in descriptions
Purpose: Verify environment and tree-sitter C# grammar availability
- T001 Verify
tree-sitter-language-packincludes thec_sharpgrammar — runpython -c "from tree_sitter_language_pack import get_language; get_language('c_sharp')"indoc-serve-server/ - T002 Create a sample C# test fixture file at
doc-serve-server/tests/fixtures/sample.cscontaining a class with methods, properties, interfaces, enums, XML doc comments, and a namespace declaration for use in unit tests
Phase 2: User Story 1 — Index C# Source Files (Priority: P1) + User Story 2 — Extract C# Symbol Metadata (Priority: P2) + User Story 3 — Content-Based Detection (Priority: P3) 🎯 MVP
Goal: Full C# indexing with AST-aware chunking, symbol metadata extraction, XML doc comment extraction, and content-based language detection. All three stories are combined because they modify the same two files.
Independent Test: Index a directory containing C# source files. Verify .cs files are loaded, parsed into AST-aware chunks at class/method boundaries, stored with correct language and symbol metadata, and queryable by method name or language=csharp filter.
- T003 [P] [US1] Write unit tests for C# file extension detection in
doc-serve-server/tests/unit/test_document_loader.py— test that.csand.csxare recognized ascsharp, testis_supported_language("csharp")returns True - T004 [P] [US2] Write unit tests for C# AST parsing and symbol extraction in
doc-serve-server/tests/unit/test_chunking.py— test thatCodeChunkerwith languagecsharpproduces chunks at class/method boundaries, test symbol metadata extraction (name, kind, parameters, return type, line numbers) for classes, methods, interfaces, properties, enums, structs - T005 [P] [US2] Write unit test for C# XML doc comment extraction in
doc-serve-server/tests/unit/test_chunking.py— test that/// <summary>comments are extracted as docstring metadata on the corresponding chunk - T006 [P] [US3] Write unit tests for C# content-based detection in
doc-serve-server/tests/unit/test_document_loader.py— test that content containingusing System;, namespace declarations, property accessors, and attributes is detected ascsharp - T007 [P] [US1] Write integration test for C# indexing end-to-end in
doc-serve-server/tests/unit/test_chunking.py— test that a sample.csfile is loaded, chunked with AST awareness, and produces chunks with correctlanguage=csharpmetadata
- T008 [P] [US1] Add
.csand.csxtoEXTENSION_TO_LANGUAGEdictionary indoc-serve-server/doc_serve_server/indexing/document_loader.py— map both extensions to"csharp" - T009 [P] [US1] Add
.csand.csxtoCODE_EXTENSIONSset indoc-serve-server/doc_serve_server/indexing/document_loader.py - T010 [P] [US3] Add C# content-detection patterns to
CONTENT_PATTERNSdictionary indoc-serve-server/doc_serve_server/indexing/document_loader.py— key:"csharp", patterns:using\s+System,namespace\s+\w+,\{\s*get\s*;\s*(set\s*;)?\s*\},\[[\w]+(\(.*\))?\],public\s+(class|interface|struct|record|enum)\s+\w+ - T011 [US1] Add
"csharp": "c_sharp"to the language mapping dictionary in_setup_language()method indoc-serve-server/doc_serve_server/indexing/chunking.py - T012 [US2] Add C# AST query patterns to
_get_symbols()method indoc-serve-server/doc_serve_server/indexing/chunking.py— add acsharpcase querying for:class_declaration,method_declaration,constructor_declaration,interface_declaration,property_declaration,enum_declaration,struct_declaration,record_declaration,namespace_declaration. Extract symbol name from thenamefield of each node. - T013 [US2] Add XML doc comment extraction for C# in
_get_symbols()or_extract_docstring()indoc-serve-server/doc_serve_server/indexing/chunking.py— detect///comment nodes preceding declarations, extract text content, strip XML tags for plain text, store asdocstringmetadata on the chunk
- T014 Run all unit tests:
cd doc-serve-server && poetry run pytest tests/unit/test_document_loader.py tests/unit/test_chunking.py -v - T015 Run full test suite:
cd doc-serve-server && poetry run pytest - T016 Run
task before-pushfrom repository root to verify formatting, linting, type checking, and all tests pass
Checkpoint: C# code indexing is fully functional. All .cs and .csx files are recognized, parsed with AST-aware chunking, and searchable with correct metadata. Content-based detection works for ambiguous files.
Purpose: Documentation and final verification
- T017 [P] Run quickstart.md verification checklist — confirm all 7 items pass
- T018 [P] Update
.speckit/features/110-csharp-code-indexing/spec.mdstatus from "Draft" to "Implemented"
- Setup (Phase 1): No dependencies — verify grammar availability first
- Implementation (Phase 2): Depends on Setup — all three user stories in one phase
- Polish (Phase 3): Depends on Phase 2 completion
All three stories are implemented together in Phase 2 because they modify the same files:
- US1 (P1): Extension mapping + parser setup → enables file loading and AST chunking
- US2 (P2): Symbol extraction + doc comments → depends on parser from US1
- US3 (P3): Content patterns → independent of US1/US2 (different dict in same file)
- Tests (T003-T007) can all run in parallel
- T008, T009, T010 can run in parallel (different dicts in same file, but independent additions)
- T011 must complete before T012-T013 (parser setup before symbol queries)
- T014-T016 run sequentially after all implementation tasks
Phase 1: T001 and T002 can run in parallel Phase 2 Tests: T003, T004, T005, T006, T007 can all run in parallel (5 tasks) Phase 2 Impl: T008, T009, T010 can run in parallel (extension + content patterns)
# Launch all tests in parallel (write first, expect failures):
Task: "T003 [P] [US1] Unit tests for C# extension detection"
Task: "T004 [P] [US2] Unit tests for C# AST parsing"
Task: "T005 [P] [US2] Unit tests for XML doc comment extraction"
Task: "T006 [P] [US3] Unit tests for content-based detection"
Task: "T007 [P] [US1] Integration test for C# indexing"
# Launch parallel implementation for document_loader.py:
Task: "T008 [P] [US1] Add .cs/.csx to EXTENSION_TO_LANGUAGE"
Task: "T009 [P] [US1] Add .cs/.csx to CODE_EXTENSIONS"
Task: "T010 [P] [US3] Add C# content patterns"
# Sequential implementation for chunking.py:
Task: "T011 [US1] Add csharp→c_sharp parser mapping"
Task: "T012 [US2] Add C# AST query patterns"
Task: "T013 [US2] Add XML doc comment extraction"- Complete Phase 1: Setup (T001-T002)
- Complete Phase 2: All user stories (T003-T016)
- Complete Phase 3: Polish (T017-T018)
- VALIDATE: Run quickstart.md checklist
This feature is small enough (~100 lines of new code across 2 files) to implement and ship in a single pass.
- All three user stories combined into one phase because they modify the same 2 source files
- [P] tasks = different files or independent additions, no dependencies
- [USn] label maps task to specific user story for traceability
- Test tasks included per Constitution III (Test-Alongside)
- No API changes needed (FR-009) — no contracts/ directory generated
- No data-model.md needed — no new entities, just configuration additions
- Design-Architecture-Overview
- Design-Query-Architecture
- Design-Storage-Architecture
- Design-Class-Diagrams
- GraphRAG-Guide
- Agent-Skill-Hybrid-Search-Guide
- Agent-Skill-Graph-Search-Guide
- Agent-Skill-Vector-Search-Guide
- Agent-Skill-BM25-Search-Guide
Search
Server
Setup
- Pluggable-Providers-Spec
- GraphRAG-Integration-Spec
- Agent-Brain-Plugin-Spec
- Multi-Instance-Architecture-Spec