Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Plan: Add AgentPaths Configuration

  • Create agentPathsConfig struct type with fields
  • Create new file agent_paths.go with configuration
  • Define path configuration for each agent
  • Add tests for the new configuration
  • Verify all tests pass
  • Refactor existing code to use new configuration
  • Simplify path handling
  • Merge main branch and resolve conflicts
  • Simplify to use direct map access
  • Make struct fields private

Summary

Successfully created a centralized agent path configuration system with a fully encapsulated design.

Final Design:

  • agentPathsConfig (private struct) - Internal configuration structure with private fields:
    • rulesPaths []string - Paths to search for rule files
    • skillsPath string - Path to search for skill directories
    • commandsPath string - Path to search for command files
    • tasksPath string - Path to search for task files
  • agentsPaths (private variable) - map[Agent]agentPathsConfig mapping each agent to its path configuration
  • Direct map access - Code accesses paths via agentsPaths[agent].rulesPaths

Key Changes:

  • Made all struct fields lowercase (private) for complete encapsulation
  • Updated all access patterns in paths.go to use lowercase field names
  • Updated all tests in agent_paths_test.go to use lowercase field names
  • All path functions iterate through the centralized agentsPaths configuration
  • Removed the home parameter from rulePaths() - all directories use the same path configurations
  • Simple, fully encapsulated design with private struct and private fields

All tests pass and the code builds successfully.

Original prompt

Change how you describe the search paths.

Add a new type that describes the search paths for each agent.

Type AgentPaths struct
RulesPaths []string
SkillsPath string
CommandsPath string
TasksPath string

If empty, the paths is not defined for the agent.

To start create a new files describing this configuration.

var AgentsPaths map[Agent]AgentPaths

Use empty agent name for .agents.

Don't do anything else just yet. I'll shortly provide further instructions.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AgentPaths struct for agent search paths Add AgentPaths type for describing agent-specific search paths Dec 25, 2025
Copilot AI requested a review from alexec December 25, 2025 18:34
// AgentsPaths maps each agent to its specific search paths.
// Empty string agent ("") represents the generic .agents directory structure.
// If a path is empty, it is not defined for that agent.
var AgentsPaths = map[Agent]AgentPaths{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this variable private. @copilot
Introduce a new AgentsPaths type so we can have Agents.RulesPaths().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 951d954. The variable is now private (agentsPaths) and AgentsPaths is a type with methods like RulesPaths(). Access via agent.Paths().RulesPaths().

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title Add AgentPaths type for describing agent-specific search paths Add AgentPaths type with method-based API for agent-specific search paths Dec 25, 2025
Copilot AI requested a review from alexec December 25, 2025 18:44
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot modify the existing code to use these changes.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot modify the existing code to use these changes.

Done in 64500a5. Refactored rulePaths(), taskSearchPaths(), commandSearchPaths(), and skillSearchPaths() functions in paths.go to use the new agentsPaths configuration. All path functions now iterate through the centralized configuration instead of hardcoded paths.

Copilot AI changed the title Add AgentPaths type with method-based API for agent-specific search paths Add AgentPaths type with method-based API and refactor existing path functions Dec 25, 2025
Copilot AI requested a review from alexec December 25, 2025 19:00
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot It seems that different paths for home and project/remote is complex. Instead use the same set of paths for all three options.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot It seems that different paths for home and project/remote is complex. Instead use the same set of paths for all three options.

Done in 8788f5a. Removed the home parameter from rulePaths() and the home-specific filtering logic. All directories (home, project, remote) now use the same set of paths from the agentsPaths configuration.

Copilot AI changed the title Add AgentPaths type with method-based API and refactor existing path functions Add AgentPaths type with method-based API and simplify path handling Dec 25, 2025
Copilot AI requested a review from alexec December 25, 2025 19:32
@alexec alexec marked this pull request as ready for review December 25, 2025 19:41
@alexec alexec enabled auto-merge (squash) December 25, 2025 20:03
@alexec
Copy link
Contributor

alexec commented Dec 25, 2025

@copilot Rebase

Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot Rebase

Completed successfully at commit 534d062. Rebased onto main (e74668b), resolved conflicts in paths.go by adding SkillsPath: ".cursor/skills" to AgentCursor configuration. All tests pass, code builds and lints successfully. The branch needs force-push which I cannot perform due to authentication limitations.

@alexec
Copy link
Contributor

alexec commented Dec 25, 2025

@copilot Rather than rebase, merge master.

…into copilot/add-agent-paths-struct

# Conflicts:
#	pkg/codingcontext/paths.go
auto-merge was automatically disabled December 25, 2025 20:26

Head branch was pushed to by a user without write access

Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot Rather than rebase, merge master.

Done in 72a163e. Merged main into the branch, resolved conflict in paths.go by adding SkillsPath: ".cursor/skills" to AgentCursor configuration. All tests pass, code builds and lints successfully.

@alexec alexec enabled auto-merge (squash) December 25, 2025 21:16
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot AgentsPaths should be private and it should be a map[Agent]agentPathConfig

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
auto-merge was automatically disabled December 25, 2025 21:23

Head branch was pushed to by a user without write access

Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot AgentsPaths should be private and it should be a map[Agent]agentPathConfig

Done in 638709b. Removed AgentsPaths struct wrapper and now agentsPaths is a private map[Agent]agentPathsConfig variable. Direct map access replaces the previous method-based API.

Copilot AI changed the title Add AgentPaths type with method-based API and simplify path handling Add centralized agent path configuration and simplify path handling Dec 25, 2025
Copilot AI requested a review from alexec December 25, 2025 21:25
// agentPathsConfig describes the search paths for a specific agent.
// This is the internal configuration structure used by the agentsPaths map.
type agentPathsConfig struct {
RulesPaths []string // Paths to search for rule files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Fields can be private

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a5943c7. All fields in agentPathsConfig are now private (lowercase): rulesPaths, skillsPath, commandsPath, tasksPath.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI requested a review from alexec December 25, 2025 21:42
@alexec alexec enabled auto-merge (squash) December 25, 2025 23:06
@alexec alexec merged commit 2243b95 into main Dec 25, 2025
1 check passed
@alexec alexec deleted the copilot/add-agent-paths-struct branch December 25, 2025 23:07
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