|
1 | 1 | use crate::agents::AgentToolRegistry; |
2 | 2 | use crate::cli::ResolvedGenerateArgs; |
| 3 | +use crate::constants::AGENTS_MD_AGENTS; |
| 4 | +use crate::models::source_file::warn_on_partial_group_rules; |
3 | 5 | use crate::operations::source_reader::detect_symlink_mode; |
4 | 6 | use crate::operations::{self, GenerationResult}; |
5 | 7 | use crate::utils::file_utils::{traverse_project_directories, write_directory_files}; |
@@ -137,6 +139,12 @@ fn collect_all_files_for_directory( |
137 | 139 | let mut files_by_agent: HashMap<String, Vec<PathBuf>> = HashMap::new(); |
138 | 140 |
|
139 | 141 | if !source_files.is_empty() { |
| 142 | + let has_agents_md_group = agents |
| 143 | + .iter() |
| 144 | + .any(|agent| AGENTS_MD_AGENTS.iter().any(|name| name == &agent.as_str())); |
| 145 | + if has_agents_md_group { |
| 146 | + warn_on_partial_group_rules(&source_files, &AGENTS_MD_AGENTS, "AGENTS.md"); |
| 147 | + } |
140 | 148 | let body_files = operations::generate_body_contents(&source_files, current_dir); |
141 | 149 | directory_files_to_write.extend(body_files); |
142 | 150 | let optional_files = |
@@ -344,16 +352,8 @@ blockedAgents: [goose] |
344 | 352 | Not for goose optional rule |
345 | 353 | "#; |
346 | 354 |
|
347 | | - create_file( |
348 | | - temp_dir.path(), |
349 | | - "ai-rules/claude-only.md", |
350 | | - claude_only_rule, |
351 | | - ); |
352 | | - create_file( |
353 | | - temp_dir.path(), |
354 | | - "ai-rules/not-goose.md", |
355 | | - no_goose_rule, |
356 | | - ); |
| 355 | + create_file(temp_dir.path(), "ai-rules/claude-only.md", claude_only_rule); |
| 356 | + create_file(temp_dir.path(), "ai-rules/not-goose.md", no_goose_rule); |
357 | 357 |
|
358 | 358 | let args = ResolvedGenerateArgs { |
359 | 359 | agents: Some(vec!["claude".to_string(), "goose".to_string()]), |
|
0 commit comments