Commit Graph

13 Commits

Author SHA1 Message Date
Tig
e9976da95e Reapply "Merge branch 'v2_develop' of tig:gui-cs/Terminal.Gui into v2_develop"
This reverts commit 845c05ff47.
2026-02-06 08:57:29 -07:00
Tig
845c05ff47 Revert "Merge branch 'v2_develop' of tig:gui-cs/Terminal.Gui into v2_develop"
This reverts commit 8c4030aed6, reversing
changes made to 280d6a5c1f.
2026-02-06 08:41:02 -07:00
Tig
8ef82e7a82 Add AI agent context for app developers (#4650)
This enhances AI agent documentation to better support developers building
Terminal.Gui applications (vs. contributing to the library itself).

New files:
- llms.txt: Standard AI-readable project context file
- .claude/tasks/build-app.md: Step-by-step app development guide
- .claude/cookbook/common-patterns.md: UI recipes (forms, lists, menus, etc.)

Updated files:
- AGENTS.md: Links to API specs and distinguishes app builder vs contributor
- CLAUDE.md: Quick routing based on task type (building vs contributing)
- .claude/REFRESH.md: References to new task/cookbook resources

https://claude.ai/code/session_01N7etZEx4kzWejVyd2SL2v7

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-30 08:09:21 -07:00
Tig
9da9a7ebe4 Add compressed API docs reference to AGENTS.md (#4648)
- Create .claude/api-reference.md with condensed API documentation
  covering Application architecture, View hierarchy, Layout, Commands,
  CWP pattern, Navigation, Drawing, and Testing
- Add API Quick Reference section to AGENTS.md with inline summary
  of key concepts for AI agents
- Include critical terminology table (SuperView/SubView vs Parent/Child)
- Add code examples for common patterns

https://claude.ai/code/session_01PA5YNxogagLmiQrvvJNisX

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-30 08:06:53 -07:00
Tig
d454374946 plan 2026-01-23 10:32:10 -07:00
Tig
c9b5af908b Fix/agents instructions (#4590)
* New workflow that will analyze the dmp file on the macos runner.

* updated agents

* Revise XML documentation rules for clarity and consistency

Clarified XML documentation rules and improved wording for consistency.

* Updates API docs.

* Fixes IValue namespce

* Deleted old files
2026-01-20 11:58:18 -07:00
Tig
7684cdabbe Cleanup TableView: split into partials, fix warnings
- Split TableView.cs (2220 lines) into 5 semantic partial files:
  - TableView.cs (998 lines) - core functionality
  - TableView.Drawing.cs (448 lines) - rendering
  - TableView.Mouse.cs (114 lines) - mouse handling
  - TableView.Navigation.cs (159 lines) - navigation
  - TableView.Selection.cs (492 lines) - selection
- Applied ReSharper Full Cleanup and BackingFieldReorderer
- Fixed 15 ReSharper warnings (InvertIf, patterns, switch expressions)
- Reduced warnings from 18 to 2 (both optional style suggestions)
- Updated cleanup-agent.md: clarify CWP TODO comment requirements

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-14 18:22:25 -07:00
Tig
027aec9dfe Refactor cleanup-agent.md: Claude performs steps manually
Update cleanup agent documentation to clarify that Claude performs
cleanup steps manually (calling individual tools) rather than invoking
CleanupAgent.ps1 as an orchestrator.

Changes:
- Mark CleanupAgent.ps1 as legacy/deprecated in docs
- Remove redundant Examples section (commands already in tool reference)
- Remove File Organization and Future Improvements sections
- Condense ReSharper exception details from 38 lines to 3 lines
- Rename "What CleanupAgent.ps1 did" to "Step Details"
- Fix typos and grammar issues
- Reduce document from ~292 to 185 lines

Also fix PowerShell ternary syntax in CleanupAgent.ps1 exit statement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 14:43:02 -07:00
Tig
5bee1c18d5 Improve warning handling: attempt to fix instead of just rollback
- Changed bash code blocks to powershell in documentation
- Added Get-BuildWarnings function to capture detailed warning info
- Agent now attempts to fix build warnings by re-running ReSharper cleanup
- Up to 2 fix attempts before rolling back
- Outputs detailed warning info for diagnosis
- Only rolls back if unable to fix after all attempts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 15:06:31 -07:00
Tig
d2748734e9 Add warning verification to cleanup agent
- Track build warnings (compiler) and InspectCode warnings (ReSharper)
- HARD RULE: No new build warnings allowed (fails and rolls back)
- SOFT GOAL: InspectCode warnings should be reduced (reports but doesn't fail)
- Added Get-BuildWarningCount function
- Integrated warning checks into cleanup pipeline
- Updated summary report to show warning deltas
- Updated documentation in cleanup-agent.md

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 14:58:15 -07:00
Tig
a76ed76e7a Update cleanup agent with verified ReSharper CLI usage
- Document correct ReSharper cleanupcode command with --include parameter
- Tested and verified: --include works correctly for single file cleanup
- Update PowerShell script to pass FilePath parameter and use --include
- Changed verbosity from ERROR to WARN for better visibility
- Document observed exceptions in output (with honest assessment)
- Note: Exceptions appear but command succeeds (exit code 0)
- Update command examples to use WARN verbosity

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 14:45:44 -07:00
Tig
f921f8f6b5 Add code cleanup automation agent and Roslyn tools
Introduces a modular code cleanup system for Terminal.Gui, including:
- cleanup-agent.md: documentation for the new agent, usage, and best practices
- CleanupAgent.ps1: orchestrator script for file splitting, ReSharper cleanup, backing field reordering, nullable directive management, CWP TODOs, and validation/testing
- BackingFieldReorderer: Roslyn tool to move backing fields before their properties
- PartialSplitter: Roslyn tool to split large files into semantic partials

The system supports feature flags, robust error handling, and detailed reporting. Documentation covers limitations, troubleshooting, and future improvements.
2026-01-13 14:22:16 -07:00
Tig
258529c05d Modernize UICatalog scenarios and fix ReSharper warnings (#4544)
* Modernize ContextMenus scenario and add upgrade guide

- Add #nullable enable to ContextMenus.cs
- Move _cultureInfos initialization after Application.Init()
- Replace var with explicit types for Label
- Convert if statements to switch statement with not-null patterns
- Change local constants to SCREAMING_CASE per project conventions
- Add SCENARIO_UPGRADE_GUIDE.md with modernization checklist

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Modernize TextInputControls scenario

- Add #nullable enable and fix all nullable warnings
- Use modern IApplication pattern with using IApplication app
- Replace var with explicit types for non-built-in types
- Use target-typed new () syntax throughout
- Add null checks for nullable fields and parameters
- Fix event handler sender parameter nullability
- Remove Application.Shutdown() (handled by IApplication disposal)
- Run ReSharper full cleanup for formatting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix ReSharper hints in TextInputControls and modernize Editor

TextInputControls.cs:
- Fix captured variable issue by using sender parameter
- Rename local function to camelCase (textViewDrawContent)
- Replace unused lambda parameters with discards (_)
- Convert List initializer to collection expression
- Remove unnecessary null check

Editor.cs:
- Add modern IApplication pattern with using IApplication app
- Replace Application.Run with app.Run
- Replace Application.RequestStop with _appWindow?.RequestStop
- Remove Application.Shutdown() (handled by IApplication disposal)
- Run ReSharper full cleanup for formatting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update SCENARIO_UPGRADE_GUIDE with ReSharper hint fixes

Add guidance for:
- Lambda parameter discards (replace unused with _)
- Captured variable closures (use sender or disable warning)
- Local function naming (camelCase)
- Collection expressions (use [...] syntax)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Restructure AI guidance for drift prevention

Create .claude/ directory with focused rule files:
- REFRESH.md - Pre-edit checklist (read before every file)
- rules/type-declarations.md - No var except built-in types
- rules/target-typed-new.md - Use new() syntax
- rules/terminology.md - SubView/SuperView vs Parent/Child
- rules/event-patterns.md - Lambdas, closures, handlers
- rules/collection-expressions.md - [...] syntax
- rules/cwp-pattern.md - Cancellable Workflow Pattern
- tasks/scenario-modernization.md - Moved from Examples/

Simplify CLAUDE.md to reference .claude/ structure instead of
duplicating detailed guidance. This helps AI agents stay on track
by providing focused, re-readable micro-documents.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add Claude Code settings to .gitignore

These are user-local settings files that shouldn't be tracked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add code layout guidance for ReSharper backing field bug

Document known ReSharper bug (RSRP-484963) where "Properties w/
Backing Field" layout doesn't work. AI agents must manually place
backing fields immediately before their associated properties.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix ReSharper warnings across UICatalog scenarios

- Replace `is { }` with `is not null` for simple null checks
- Fix unused lambda parameters: `(s, e)` → `(_, _)` or `(_, e)`
- Change `var` to explicit types (Label, Window, FrameView, etc.)
- Remove redundant null-forgiving operators and self-assignments
- Modernize Application.Init pattern with `using IApplication app`
- Use pattern matching: `if (sender is not OptionSelector x)`
- Preserve `is { } variable` pattern matching where variable capture needed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fixed two scenarios.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 12:39:15 -07:00