Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: detect and run build commands from subdirectories#43

Merged
wesbillman merged 2 commits intomainfrom
matt2e/inner-justfiles
Feb 11, 2026
Merged

feat: detect and run build commands from subdirectories#43
wesbillman merged 2 commits intomainfrom
matt2e/inner-justfiles

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Feb 11, 2026

Summary

  • Enhanced action detection to recursively discover justfiles/makefiles in subdirectories
  • Simplified implementation by delegating file discovery to AI agent
  • Actions from nested build files use "cd && " format

Changes

This PR includes two commits that implement subdirectory build file detection:

  1. Initial implementation: Added explicit recursive search for build files up to 2 levels deep
  2. Refactored approach: Removed explicit file searching, delegating discovery to the AI agent based on directory structure

The final implementation shows the directory structure to the AI agent and provides prompt instructions to detect and create actions for build files in subdirectories. This makes the system more flexible and reduces hardcoded search logic.

Test plan

  • Formatted code with cd staged && just fmt
  • Verified CI checks pass (staged-lint, staged-typecheck)
  • Manual testing: verify detection of nested justfiles/makefiles in test projects
  • Verify generated actions use correct "cd && " format

🤖 Generated with Claude Code

matt2e and others added 2 commits February 11, 2026 13:34
Enhanced action detection to recursively search subdirectories for
justfiles and makefiles (up to 2 levels deep). The AI detection prompt
now instructs to create actions with "cd <subpath> && <cmd>" format
for commands from nested build files.

Changes:
- Updated DETECTION_PROMPT_TEMPLATE with subdirectory instructions
- Added collect_subdirectory_build_files() to recursively find build files
- Modified collect_file_list() to show directory structure recursively
- Added example actions showing "cd subdir && just dev" pattern
- Build file discovery now includes subdirectories like "staged/justfile"

This allows detecting and running build commands from nested project
structures, making it easier to work with monorepos and multi-component
projects.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Removed explicit file searching logic for subdirectory build files
(justfiles/makefiles). The action detector now only collects root-level
files, relying on the AI agent to discover and analyze subdirectory
build files based on the directory structure and prompt instructions.

Changes:
- Removed collect_subdirectory_build_files() recursive search function
- Updated collect_relevant_files() to only check root directory
- AI agent still instructed via prompt to detect subdirectory build files
- Directory structure shown to AI via collect_file_list() allows discovery

This simplifies the detector code and delegates file discovery to the
AI agent where it belongs, making the system more flexible and reducing
hardcoded search logic.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@wesbillman wesbillman merged commit 1a7fb66 into main Feb 11, 2026
1 check passed
@wesbillman wesbillman deleted the matt2e/inner-justfiles branch February 11, 2026 21:52
loganj added a commit that referenced this pull request Feb 26, 2026
## Summary
- Add `tools_test.go` testing all 7 MCP tools via the Go SDK client
- Tests use `httptest.NewServer` + `StreamableClientTransport` for real MCP protocol
- Covers: find_project, create_thread, list_threads, read_thread, reply, files_in_review, wait_for_changes

**Stack**: Group B base — PR 4 stacks on this.

## Test plan
- [x] `go test ./internal/mcpserver/ -v` — all 10 tests pass
- [x] `go test -race ./internal/mcpserver/` passes
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