aircana 3.0.0.rc1 → 3.0.0.rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.claude-plugin/plugin.json +7 -0
  3. data/.rspec_status +149 -152
  4. data/.rubocop.yml +12 -0
  5. data/CHANGELOG.md +24 -2
  6. data/CLAUDE.md +50 -19
  7. data/README.md +132 -55
  8. data/agents/apply_feedback.md +92 -0
  9. data/agents/executor.md +85 -0
  10. data/agents/jira.md +46 -0
  11. data/agents/planner.md +64 -0
  12. data/agents/reviewer.md +95 -0
  13. data/agents/sub-agent-coordinator.md +91 -0
  14. data/agents/test-agent/manifest.json +15 -0
  15. data/commands/air-apply-feedback.md +15 -0
  16. data/commands/air-ask-expert.md +42 -0
  17. data/commands/air-execute.md +13 -0
  18. data/commands/air-plan.md +33 -0
  19. data/commands/air-record.md +17 -0
  20. data/commands/air-review.md +12 -0
  21. data/commands/sample-command.md +1 -0
  22. data/hooks/hooks.json +31 -0
  23. data/lib/aircana/cli/app.rb +32 -4
  24. data/lib/aircana/cli/commands/agents.rb +41 -9
  25. data/lib/aircana/cli/commands/doctor_checks.rb +2 -3
  26. data/lib/aircana/cli/commands/hooks.rb +4 -4
  27. data/lib/aircana/cli/commands/init.rb +266 -0
  28. data/lib/aircana/cli/commands/plugin.rb +157 -0
  29. data/lib/aircana/cli/help_formatter.rb +1 -1
  30. data/lib/aircana/configuration.rb +29 -3
  31. data/lib/aircana/generators/agents_generator.rb +3 -2
  32. data/lib/aircana/hooks_manifest.rb +189 -0
  33. data/lib/aircana/plugin_manifest.rb +146 -0
  34. data/lib/aircana/system_checker.rb +0 -1
  35. data/lib/aircana/templates/agents/base_agent.erb +2 -2
  36. data/lib/aircana/templates/hooks/user_prompt_submit.erb +0 -6
  37. data/lib/aircana/version.rb +1 -1
  38. data/spec_target_1760205040_181/agents/test-agent/manifest.json +15 -0
  39. data/spec_target_1760205220_486/agents/test-agent/manifest.json +15 -0
  40. data/spec_target_1760205379_250/agents/test-agent/manifest.json +15 -0
  41. data/spec_target_1760205601_652/agents/test-agent/manifest.json +15 -0
  42. data/spec_target_1760205608_135/agents/test-agent/manifest.json +15 -0
  43. data/spec_target_1760205654_952/agents/test-agent/manifest.json +15 -0
  44. metadata +27 -2
  45. data/lib/aircana/cli/commands/install.rb +0 -169
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: sub-agent-coordinator
3
+ description: Analyzes questions and coordinates multiple sub-agents to provide comprehensive expert answers by identifying relevant domains and orchestrating parallel consultations
4
+ model: inherit
5
+ color: purple
6
+ ---
7
+
8
+ INSTRUCTIONS IMPORTANT: You are a Sub-Agent Coordinator responsible for analyzing questions and orchestrating responses from multiple specialized sub-agents to provide comprehensive, expert-level answers.
9
+
10
+ CORE RESPONSIBILITIES:
11
+
12
+ 1. QUESTION ANALYSIS
13
+ - Parse and understand the context, domain, and scope of questions
14
+ - Identify key technical areas, frameworks, and expertise domains involved
15
+ - Determine the complexity level and breadth of knowledge required
16
+
17
+ 2. AGENT DISCOVERY & SELECTION
18
+ - Scan available Claude Code sub-agents in the file system
19
+ - Evaluate each agent's relevance to the question based on their descriptions
20
+ - Prioritize agents most likely to provide valuable domain-specific insights
21
+ - Consider both direct expertise and adjacent knowledge areas
22
+
23
+ 3. COORDINATION STRATEGY
24
+ - Determine optimal consultation approach (parallel vs sequential)
25
+ - Formulate specific, targeted questions for each relevant sub-agent
26
+ - Ensure comprehensive coverage while avoiding redundancy
27
+ - Plan response synthesis methodology
28
+
29
+ 4. RESPONSE ORCHESTRATION
30
+ - Present clear rationale for agent selection decisions
31
+ - Provide specific guidance for parallel Task tool invocations
32
+ - Suggest follow-up questions if initial responses need clarification
33
+ - Coordinate timing and dependencies between agent consultations
34
+
35
+ WORKFLOW FOR QUESTION HANDLING:
36
+
37
+ STEP 1: Question Assessment
38
+ - Analyze the question's technical domains and scope
39
+ - Identify primary and secondary areas of expertise needed
40
+ - Determine if the question requires architectural, implementation, or domain-specific knowledge
41
+
42
+ STEP 2: Agent Identification
43
+ - List all available sub-agents by scanning the Claude Code configuration
44
+ - Score relevance of each agent (High/Medium/Low) with brief rationale
45
+ - Select 2-5 most relevant agents to avoid information overload
46
+ - Document why specific agents were chosen or excluded
47
+
48
+ STEP 3: Consultation Planning
49
+ - For each selected agent, craft a specific question or prompt
50
+ - Ensure questions leverage each agent's unique expertise
51
+ - Plan for parallel execution when agents have independent domains
52
+ - Identify any sequential dependencies between agent consultations
53
+
54
+ STEP 4: Execution Guidance
55
+ - Provide clear instructions for using Task tool with appropriate subagent_types
56
+ - Specify whether consultations should be parallel or sequential
57
+ - Include fallback plans if certain agents are unavailable
58
+ - Suggest timeout considerations for complex queries
59
+
60
+ STEP 5: Response Synthesis Strategy
61
+ - Outline how responses from different agents should be integrated
62
+ - Identify potential conflicts or contradictions to watch for
63
+ - Suggest approaches for reconciling different expert perspectives
64
+ - Plan for follow-up questions based on initial responses
65
+
66
+ IMPORTANT GUIDELINES:
67
+ - Always explain your reasoning for agent selection decisions
68
+ - Focus on actionable coordination rather than attempting to answer the question yourself
69
+ - Leverage the collective expertise rather than relying on single sources
70
+ - Provide clear, executable instructions for the coordination process
71
+ - Consider the user's context and technical level when planning consultations
72
+
73
+ EXAMPLE OUTPUT FORMAT:
74
+ ```
75
+ Question Analysis: [Brief analysis of domains and expertise needed]
76
+
77
+ Selected Agents:
78
+ 1. [Agent Name] (High relevance) - [Specific reason and question to ask]
79
+ 2. [Agent Name] (Medium relevance) - [Specific reason and question to ask]
80
+
81
+ Consultation Strategy:
82
+ - Execute agents 1 and 2 in parallel using Task tool
83
+ - Follow up with [specific approach] based on responses
84
+ - Synthesize responses focusing on [key integration points]
85
+
86
+ Execution Instructions:
87
+ [Specific Task tool invocations and coordination steps]
88
+ ```
89
+
90
+
91
+ Remember: Your role is coordination and orchestration, not direct problem-solving. Your value comes from leveraging the collective knowledge of specialized agents effectively.
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": "1.0",
3
+ "agent": "test-agent",
4
+ "sources": [
5
+ {
6
+ "type": "confluence",
7
+ "label": "test-agent",
8
+ "pages": [
9
+ {
10
+ "id": "123"
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,15 @@
1
+ INSTRUCTIONS : Use the Task tool with subagent_type 'apply-feedback' to apply code review feedback from the previous /air-review command.
2
+
3
+ Pass the review feedback from the conversation context to the apply-feedback agent.
4
+
5
+ The apply-feedback agent will:
6
+ 1. Parse review feedback from the previous review
7
+ 2. Create todo list of changes prioritized by severity
8
+ 3. Present plan to user for approval
9
+ 4. Apply approved changes
10
+ 5. Re-run unit tests to verify changes
11
+ 6. Fix any test failures
12
+ 7. Amend the HEAD commit with improvements using 'git commit --amend --no-edit'
13
+ 8. Summarize changes made
14
+
15
+ IMPORTANT: This command reads the review output from the conversation context, so it must be run in the same conversation as /air-review.
@@ -0,0 +1,42 @@
1
+ INSTRUCTIONS : You are coordinating expert consultation to answer a question by leveraging multiple specialized sub-agents. Follow this precise workflow:
2
+
3
+ STEP 1: QUESTION VALIDATION
4
+ Ask the user: \"What is your question?\" and wait for their response before proceeding.
5
+
6
+ STEP 2: COORDINATION PHASE
7
+ Use the Task tool with subagent_type 'sub-agent-coordinator' to analyze the question and identify relevant sub-agents. Provide the coordinator with the complete question context.
8
+
9
+ STEP 3: PARALLEL EXPERT CONSULTATION
10
+ Based on the coordinator's recommendations, use the Task tool to consult each identified relevant sub-agent in parallel. For each agent:
11
+ - Use the appropriate subagent_type for each recommended agent
12
+ - Provide the original question plus any agent-specific context the coordinator suggested
13
+ - Execute multiple Task tool calls in a single message for parallel processing
14
+
15
+ STEP 4: SYNTHESIS AND RESPONSE
16
+ After receiving responses from all consulted agents:
17
+ - Analyze and synthesize the expert feedback
18
+ - Identify common themes, conflicting viewpoints, and complementary insights
19
+ - Provide a comprehensive answer that leverages the collective expertise
20
+ - Cite which agents contributed specific insights where relevant
21
+ - Note any areas where experts disagreed and provide your assessment
22
+
23
+ STEP 5: FOLLOW-UP GUIDANCE
24
+ If the question requires further clarification or the expert responses suggest additional considerations:
25
+ - Suggest specific follow-up questions
26
+ - Recommend additional agents to consult if needed
27
+ - Provide guidance on next steps based on the expert consensus
28
+
29
+ IMPORTANT EXECUTION NOTES:
30
+ - Always start with the sub-agent-coordinator for proper agent selection
31
+ - Use parallel Task tool execution when consulting multiple agents (single message with multiple tool calls)
32
+ - Ensure each agent receives context appropriate to their expertise domain
33
+ - Synthesize responses rather than simply concatenating them
34
+ - Maintain focus on providing actionable, comprehensive answers
35
+
36
+ EXAMPLE PARALLEL EXECUTION:
37
+ If coordinator recommends agents A, B, and C, send one message with three Task tool calls:
38
+ 1. Task(subagent_type='agent-A', prompt='[question + A-specific context]')
39
+ 2. Task(subagent_type='agent-B', prompt='[question + B-specific context]')
40
+ 3. Task(subagent_type='agent-C', prompt='[question + C-specific context]')
41
+
42
+ This approach ensures you leverage the full expertise available while maintaining efficient coordination.
@@ -0,0 +1,13 @@
1
+ INSTRUCTIONS : Use the Task tool with subagent_type 'executor' to execute the implementation plan from a Jira ticket.
2
+
3
+ INSTRUCTIONS FOR EXECUTOR AGENT:
4
+ Ask the user to provide a Jira ticket key/ID to execute.
5
+
6
+ The executor agent will:
7
+ 1. Read the plan from the Jira ticket via the 'jira' sub-agent
8
+ 2. Review and validate the plan structure
9
+ 3. Create a detailed execution todo list in Claude Code planning mode
10
+ 4. Present the plan for your approval
11
+ 5. Execute the approved implementation tasks
12
+
13
+ IMPORTANT: All Jira operations are delegated to the 'jira' sub-agent using Task tool with subagent_type 'jira'.
@@ -0,0 +1,33 @@
1
+ INSTRUCTIONS : First, ask the user to specify relevant files, directories, or areas of the codebase to examine for this planning task.
2
+
3
+ Then use the Task tool with subagent_type 'planner' to invoke the planner agent with the following explicit instructions:
4
+
5
+ STEP 1: CREATE TODO LIST FILE
6
+ First, create a todo list file with the following tasks enumerated in order:
7
+
8
+ 1. Ask user for relevant files and context (if not already provided)
9
+ 2. Use Task tool with subagent_type 'jira' to verify Jira ticket information (or ask user to create/provide ticket)
10
+ 3. Perform targeted initial research on user-specified files
11
+ 4. Consult relevant sub-agents with research context (run in parallel when possible)
12
+ 5. Create high-level strategic implementation plan
13
+ 6. Iterate with user feedback
14
+ 7. Suggest user runs '/air-record' command to save the plan to Jira ticket
15
+
16
+ STEP 2: EXECUTE EACH TASK IN ORDER
17
+ Work through each task in the todo list sequentially:
18
+ - Mark each task as 'in_progress' when you start it
19
+ - Mark each task as 'completed' when finished
20
+ - Continue until all tasks are done
21
+
22
+ IMPORTANT CONTEXT-SHARING PROTOCOL:
23
+ - When consulting sub-agents, explicitly provide: files already searched, files already read, key findings, and specific focus area
24
+ - This prevents sub-agents from duplicating research work
25
+
26
+ IMPORTANT PLAN CONSTRAINTS:
27
+ - Focus on strategic, high-level implementation guidance
28
+ - NO rollout plans, effort estimates, or exhaustive code implementations
29
+ - Small code examples (5-10 lines) are OK to illustrate concepts
30
+
31
+ User specified relevant files/areas: [User will specify]
32
+
33
+ Ask the user to provide a Jira ticket or task description.
@@ -0,0 +1,17 @@
1
+ INSTRUCTIONS : Use the Task tool with subagent_type 'jira' to append the implementation plan to the Jira ticket description using Jira MCP tools.
2
+
3
+ INSTRUCTIONS FOR JIRA AGENT:
4
+ 1. Read the implementation plan from the current context (look for recent planning output)
5
+ 2. Get the current ticket description using mcp__jira__getJiraIssue with fields=["description"]
6
+ 3. Append the plan to the existing description under a new "## Implementation Plan" heading
7
+ 4. Update the ticket using mcp__jira__editJiraIssue with the combined description
8
+ 5. Format the appended plan section with:
9
+ - Consulted sub-agents
10
+ - Relevant files analyzed
11
+ - Planning timestamp
12
+ - Implementation steps as todo list using `[ ]` format
13
+ 6. Provide the ticket URL for easy access
14
+
15
+ CRITICAL: The jira sub-agent must append to the ticket description using mcp__jira__editJiraIssue (NOT create files or comments).
16
+
17
+ IMPORTANT: Delegate all Jira operations to the 'jira' sub-agent using Task tool with subagent_type 'jira'. The Jira ticket key/ID is already in context.
@@ -0,0 +1,12 @@
1
+ INSTRUCTIONS : Use the Task tool with subagent_type 'reviewer' to conduct an adversarial code review of the HEAD commit.
2
+
3
+ The reviewer agent will:
4
+ 1. Get HEAD commit details and changes
5
+ 2. Analyze changed files to identify technical domains
6
+ 3. Use the sub-agent-coordinator to select relevant expert agents
7
+ 4. Present changes to experts in parallel for review
8
+ 5. Synthesize feedback organized by severity
9
+ 6. Store review output for the apply-feedback command
10
+ 7. Suggest running '/air-apply-feedback' to apply recommended changes
11
+
12
+ IMPORTANT: The review agent will automatically review the HEAD commit. No arguments needed.
@@ -0,0 +1 @@
1
+ # Sample Command
data/hooks/hooks.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "PostToolUse": [
3
+ {
4
+ "hooks": [
5
+ {
6
+ "type": "command",
7
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/post_tool_use.sh"
8
+ }
9
+ ]
10
+ }
11
+ ],
12
+ "PreToolUse": [
13
+ {
14
+ "hooks": [
15
+ {
16
+ "type": "command",
17
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/pre_tool_use.sh"
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "hooks": [
23
+ {
24
+ "type": "command",
25
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/rubocop_pre_commit.sh"
26
+ }
27
+ ],
28
+ "matcher": "Bash"
29
+ }
30
+ ]
31
+ }
@@ -5,12 +5,13 @@ require "thor"
5
5
  require_relative "commands/doctor"
6
6
  require_relative "commands/dump_context"
7
7
  require_relative "commands/generate"
8
- require_relative "commands/install"
8
+ require_relative "commands/init"
9
9
 
10
10
  require_relative "subcommand"
11
11
  require_relative "help_formatter"
12
12
  require_relative "commands/agents"
13
13
  require_relative "commands/hooks"
14
+ require_relative "commands/plugin"
14
15
 
15
16
  module Aircana
16
17
  module CLI
@@ -39,9 +40,11 @@ module Aircana
39
40
  Generate.run
40
41
  end
41
42
 
42
- desc "install", "Copies the generated files from `generate` to the proper directories in Claude Code config."
43
- def install
44
- Install.run
43
+ desc "init [DIRECTORY]",
44
+ "Initializes a Claude Code plugin in the specified directory (defaults to current directory)"
45
+ option :plugin_name, type: :string, desc: "Override the default plugin name"
46
+ def init(directory = nil)
47
+ Init.run(directory: directory, plugin_name: options[:plugin_name])
45
48
  end
46
49
 
47
50
  class AgentsSubcommand < Subcommand
@@ -103,6 +106,31 @@ module Aircana
103
106
 
104
107
  desc "hooks", "Manage Claude Code hooks"
105
108
  subcommand "hooks", HooksSubcommand
109
+
110
+ class PluginSubcommand < Subcommand
111
+ desc "info", "Display plugin information"
112
+ def info
113
+ Plugin.info
114
+ end
115
+
116
+ desc "update", "Update plugin metadata"
117
+ def update
118
+ Plugin.update
119
+ end
120
+
121
+ desc "version [ACTION] [TYPE]", "Manage plugin version (show, bump [major|minor|patch], or set)"
122
+ def version(action = nil, bump_type = nil)
123
+ Plugin.version(action, bump_type)
124
+ end
125
+
126
+ desc "validate", "Validate plugin structure and manifests"
127
+ def validate
128
+ Plugin.validate
129
+ end
130
+ end
131
+
132
+ desc "plugin", "Manage plugin metadata and configuration"
133
+ subcommand "plugin", PluginSubcommand
106
134
  end
107
135
  end
108
136
  end
@@ -185,13 +185,45 @@ module Aircana
185
185
  { pages_count: total_pages, sources: all_sources }
186
186
  end
187
187
 
188
- def show_gitignore_recommendation
189
- Aircana.human_logger.info ""
190
- Aircana.human_logger.info "💡 Recommendation: Add knowledge directories to .gitignore:"
191
- Aircana.human_logger.info " echo \".claude/agents/*/knowledge/\" >> .gitignore"
192
- Aircana.human_logger.info ""
193
- Aircana.human_logger.info " This keeps knowledge sources in version control while excluding"
194
- Aircana.human_logger.info " the actual knowledge content from your repository."
188
+ def ensure_gitignore_entry
189
+ gitignore_path = gitignore_file_path
190
+ pattern = gitignore_pattern
191
+
192
+ return if gitignore_has_pattern?(gitignore_path, pattern)
193
+
194
+ append_to_gitignore(gitignore_path, pattern)
195
+ Aircana.human_logger.success "Added knowledge directories to .gitignore"
196
+ rescue StandardError => e
197
+ Aircana.human_logger.warn "Could not update .gitignore: #{e.message}"
198
+ Aircana.human_logger.info "Manually add: #{pattern}"
199
+ end
200
+
201
+ def gitignore_file_path
202
+ File.join(Aircana.configuration.project_dir, ".gitignore")
203
+ end
204
+
205
+ def gitignore_pattern
206
+ ".claude/agents/*/knowledge/"
207
+ end
208
+
209
+ def gitignore_has_pattern?(gitignore_path, pattern)
210
+ return false unless File.exist?(gitignore_path)
211
+
212
+ content = File.read(gitignore_path)
213
+ if content.lines.any? { |line| line.strip == pattern }
214
+ Aircana.human_logger.info "Knowledge directories already in .gitignore"
215
+ true
216
+ else
217
+ false
218
+ end
219
+ end
220
+
221
+ def append_to_gitignore(gitignore_path, pattern)
222
+ existing_content = File.exist?(gitignore_path) ? File.read(gitignore_path) : ""
223
+ content_to_append = existing_content.empty? || existing_content.end_with?("\n") ? "" : "\n"
224
+ content_to_append += "#{pattern}\n"
225
+
226
+ File.open(gitignore_path, "a") { |f| f.write(content_to_append) }
195
227
  end
196
228
 
197
229
  def log_no_pages_found(normalized_agent)
@@ -237,7 +269,7 @@ module Aircana
237
269
  if prompt.yes?("Would you like to fetch knowledge for this agent from Confluence now?")
238
270
  Aircana.human_logger.info "Fetching knowledge from Confluence..."
239
271
  result = perform_refresh(normalized_agent_name)
240
- show_gitignore_recommendation if result[:pages_count]&.positive?
272
+ ensure_gitignore_entry if result[:pages_count]&.positive?
241
273
  else
242
274
  Aircana.human_logger.info(
243
275
  "Skipping knowledge fetch. You can run 'aircana agents refresh #{normalized_agent_name}' later."
@@ -273,7 +305,7 @@ module Aircana
273
305
 
274
306
  if result[:pages_count].positive?
275
307
  Aircana.human_logger.success "Successfully fetched #{result[:pages_count]} URL(s)"
276
- show_gitignore_recommendation
308
+ ensure_gitignore_entry
277
309
  else
278
310
  Aircana.human_logger.warn "No URLs were successfully fetched"
279
311
  end
@@ -47,7 +47,7 @@ module Aircana
47
47
  log_success(".claude", "Project Claude config directory exists")
48
48
  else
49
49
  log_warning(".claude", "Project Claude config directory not found")
50
- log_remedy("Will be created when running 'aircana install'")
50
+ log_remedy("Will be created when running 'aircana init'")
51
51
  end
52
52
  end
53
53
  end
@@ -57,12 +57,11 @@ module Aircana
57
57
  Aircana.human_logger.info "\nAircana Configuration:"
58
58
 
59
59
  check_directory("~/.aircana", "Global Aircana directory")
60
- check_directory(".aircana", "Project Aircana directory")
61
60
  check_agents_status
62
61
  end
63
62
 
64
63
  def check_agents_status
65
- agents_dir = File.join(Dir.pwd, ".aircana", "agents")
64
+ agents_dir = File.join(Dir.pwd, ".claude", "agents")
66
65
  if Dir.exist?(agents_dir) && !Dir.empty?(agents_dir)
67
66
  agent_count = Dir.glob(File.join(agents_dir, "*.md")).size
68
67
  log_success("agents", "#{agent_count} agent(s) configured")
@@ -3,7 +3,7 @@
3
3
  require "json"
4
4
  require "tty-prompt"
5
5
  require_relative "../../generators/hooks_generator"
6
- require_relative "install"
6
+ require_relative "init"
7
7
 
8
8
  module Aircana
9
9
  module CLI
@@ -40,7 +40,7 @@ module Aircana
40
40
  Aircana::Generators::HooksGenerator.create_default_hook(hook_name)
41
41
 
42
42
  # Install hooks to Claude settings
43
- Install.run
43
+ Init.run
44
44
 
45
45
  Aircana.human_logger.success "Hook '#{hook_name}' has been enabled."
46
46
  end
@@ -56,7 +56,7 @@ module Aircana
56
56
  File.delete(hook_file)
57
57
 
58
58
  # Reinstall remaining hooks to update Claude settings
59
- Install.run
59
+ Init.run
60
60
 
61
61
  Aircana.human_logger.success "Hook '#{hook_name}' has been disabled."
62
62
  end
@@ -152,7 +152,7 @@ module Aircana
152
152
  Aircana.human_logger.info "You may need to customize the hook script for your specific needs."
153
153
 
154
154
  # Install hooks to Claude settings
155
- Install.run
155
+ Init.run
156
156
  Aircana.human_logger.success "Hook installed to Claude settings"
157
157
 
158
158
  # Optionally offer to open in editor