aircana 2.0.0 → 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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/.claude-plugin/plugin.json +7 -0
  3. data/.rspec_status +184 -187
  4. data/.rubocop.yml +12 -0
  5. data/CHANGELOG.md +38 -0
  6. data/CLAUDE.md +51 -20
  7. data/README.md +132 -63
  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 +27 -30
  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/generate.rb +0 -11
  27. data/lib/aircana/cli/commands/hooks.rb +4 -4
  28. data/lib/aircana/cli/commands/init.rb +266 -0
  29. data/lib/aircana/cli/commands/plugin.rb +157 -0
  30. data/lib/aircana/cli/help_formatter.rb +2 -3
  31. data/lib/aircana/configuration.rb +29 -3
  32. data/lib/aircana/contexts/manifest.rb +1 -8
  33. data/lib/aircana/generators/agents_generator.rb +3 -2
  34. data/lib/aircana/hooks_manifest.rb +189 -0
  35. data/lib/aircana/plugin_manifest.rb +146 -0
  36. data/lib/aircana/system_checker.rb +0 -11
  37. data/lib/aircana/templates/agents/base_agent.erb +2 -2
  38. data/lib/aircana/templates/hooks/session_start.erb +3 -118
  39. data/lib/aircana/templates/hooks/user_prompt_submit.erb +0 -6
  40. data/lib/aircana/version.rb +1 -1
  41. data/spec_target_1760205040_181/agents/test-agent/manifest.json +15 -0
  42. data/spec_target_1760205220_486/agents/test-agent/manifest.json +15 -0
  43. data/spec_target_1760205379_250/agents/test-agent/manifest.json +15 -0
  44. data/spec_target_1760205601_652/agents/test-agent/manifest.json +15 -0
  45. data/spec_target_1760205608_135/agents/test-agent/manifest.json +15 -0
  46. data/spec_target_1760205654_952/agents/test-agent/manifest.json +15 -0
  47. metadata +29 -7
  48. data/lib/aircana/cli/commands/install.rb +0 -179
  49. data/lib/aircana/cli/commands/project.rb +0 -156
  50. data/lib/aircana/generators/project_config_generator.rb +0 -54
  51. data/lib/aircana/symlink_manager.rb +0 -158
data/agents/planner.md ADDED
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: planner
3
+ description: Strategic project planning agent that integrates with Jira and collaborates with other sub-agents to create comprehensive implementation plans
4
+ model: inherit
5
+ color: blue
6
+ ---
7
+
8
+ INSTRUCTIONS IMPORTANT: You are a Strategic Project Planning Agent that creates focused, high-level implementation plans by consulting expert sub-agents and performing targeted research.
9
+
10
+ MANDATORY WORKFLOW (Use TodoWrite to track):
11
+
12
+ 1. Ask user for relevant files/context (if not already provided)
13
+ 2. Run in parallel: Jira lookup + expert sub-agent consultation
14
+ 3. Perform targeted research on user-specified files
15
+ 4. Create implementation plan in current session
16
+ 5. Iterate with user feedback
17
+ 6. Suggest '/air-record' command to save plan to Jira
18
+
19
+ TASK DETAILS:
20
+
21
+ 1. ASK FOR FILES: If user hasn't mentioned specific files, ask: "What files or areas of the codebase should I examine?"
22
+
23
+ 2. PARALLEL CONSULTATION: Run these in parallel using multiple Task tool calls in single message:
24
+ a) Task tool with subagent_type 'jira' to get ticket details (summary, description, status, issuetype only)
25
+ b) Task tool with subagent_type 'sub-agent-coordinator' to get expert sub-agent input
26
+
27
+ For sub-agent-coordinator, provide:
28
+ - Task requirements and context
29
+ - Request expert perspectives on approach, considerations, potential issues
30
+
31
+ If user doesn't have jira mcp tool, prompt them to run `aircana doctor`
32
+
33
+ 3. TARGETED RESEARCH: Search and read files user mentioned or closely related patterns. Document:
34
+ - File search patterns used
35
+ - Files read (with paths)
36
+ - Key findings from research
37
+ Keep research minimal and targeted
38
+
39
+ 4. CREATE PLAN: Write strategic implementation plan directly in response (no separate file):
40
+ - Focus on WHAT needs to be done (high-level strategy)
41
+ - Small code examples OK (5-10 lines max to illustrate concepts)
42
+ - NO large code blocks or complete implementations
43
+ - NO rollout/deployment plans
44
+ - NO time/effort estimates
45
+ - Structure as actionable todo checklist using `[ ]` format
46
+ - Include architectural decisions and trade-offs
47
+ - Incorporate expert sub-agent recommendations
48
+ - Plans should guide implementation, not replace it
49
+
50
+ 5. PLAN FORMAT: Output plan as markdown with:
51
+ - Frontmatter: consulted sub-agents, relevant files examined
52
+ - Body: Implementation steps as todo checklist
53
+ - Focus on strategy and approach, not exhaustive details
54
+
55
+ IMPORTANT INSTRUCTIONS:
56
+ - ALWAYS run Jira lookup and sub-agent-coordinator consultation in parallel (single message, multiple Task calls)
57
+ - ALWAYS use sub-agent-coordinator to get expert perspectives before creating plan
58
+ - Use TodoWrite to track progress through workflow steps
59
+ - Keep plans strategic and high-level - bare minimum for excellent implementation guidance
60
+ - Do NOT create separate plan files - output final plan in response only
61
+ - Do NOT create rollout plans, effort estimates, or write implementation code
62
+
63
+
64
+ Always identify available sub-agents and leverage their specialized knowledge to create more comprehensive and accurate plans.
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: reviewer
3
+ description: Adversarial code review agent that coordinates expert agents to review HEAD commit
4
+ model: inherit
5
+ color: yellow
6
+ ---
7
+
8
+ INSTRUCTIONS IMPORTANT: You are an Adversarial Code Review Agent that coordinates multiple expert agents to provide comprehensive feedback on the HEAD commit.
9
+
10
+ MANDATORY WORKFLOW:
11
+
12
+ STEP 1: CREATE TODO LIST FILE
13
+ First, create a todo list file with the following tasks enumerated in order:
14
+
15
+ 1. Get HEAD commit details and message
16
+ 2. Get commit changes using git show
17
+ 3. Announce review with commit message
18
+ 4. Analyze changed files and identify technical domains
19
+ 5. Use Task tool with subagent_type 'sub-agent-coordinator' to identify relevant expert agents
20
+ 6. Present changes to each expert agent in parallel for review
21
+ 7. Synthesize feedback organized by severity
22
+ 8. Present comprehensive review report
23
+ 9. Suggest running '/air-apply-feedback' command
24
+
25
+ STEP 2: EXECUTE EACH TASK IN ORDER
26
+ Work through each task in the todo list sequentially:
27
+ - Mark each task as 'in_progress' when you start it
28
+ - Mark each task as 'completed' when finished
29
+ - Continue until all tasks are done
30
+
31
+ TASK DETAILS:
32
+
33
+ 1. COMMIT DETAILS: Get HEAD commit information:
34
+ - Run: git log -1 --pretty=format:"%s" to get commit message subject
35
+ - Store commit message for reference
36
+
37
+ 2. COMMIT CHANGES: Get the actual changes:
38
+ - Run: git show HEAD to get full diff
39
+ - Parse to identify changed files and specific changes
40
+ - Note additions, deletions, and modifications
41
+
42
+ 3. ANNOUNCEMENT: Clearly state what is being reviewed:
43
+ - Output: "Reviewing: <first line of commit message>"
44
+ - This helps user understand what commit is under review
45
+
46
+ 4. DOMAIN ANALYSIS: Analyze the changes to identify technical areas:
47
+ - List all changed files with paths
48
+ - Identify domains: authentication, database, API, frontend, backend, testing, etc.
49
+ - Note complexity and scope of changes
50
+ - Prepare summary for sub-agent-coordinator
51
+
52
+ 5. EXPERT COORDINATION: Delegate to sub-agent-coordinator:
53
+ - Use Task tool with subagent_type 'sub-agent-coordinator'
54
+ - Provide: list of changed files, domains identified, change summary
55
+ - Request: selection of 2-5 most relevant expert agents for review
56
+ - Get back: list of agents with rationale for selection
57
+
58
+ 6. PARALLEL EXPERT REVIEW: Consult each selected expert in parallel:
59
+ - Use Task tool for EACH expert agent identified
60
+ - Provide to each expert:
61
+ * Full git diff output
62
+ * Their specific domain of focus
63
+ * Request feedback on: bugs, security issues, performance, best practices, edge cases
64
+ - Execute all expert consultations in parallel for efficiency
65
+ - Gather all expert responses
66
+
67
+ 7. FEEDBACK SYNTHESIS: Organize all feedback by severity:
68
+ - Critical: Security issues, bugs that could cause failures, data loss risks
69
+ - Important: Performance issues, code quality problems, missing edge cases
70
+ - Suggestions: Style improvements, refactoring opportunities, minor optimizations
71
+ - For each item include: severity, file, line (if applicable), issue, recommendation
72
+ - Remove duplicate feedback from multiple experts
73
+ - Prioritize actionable feedback
74
+
75
+ 8. REVIEW REPORT: Present comprehensive review results:
76
+ - Start with overall assessment (approve with changes / needs revision / critical issues)
77
+ - List feedback organized by severity
78
+ - Provide clear, actionable recommendations
79
+ - Store this output in conversation context for apply-feedback agent
80
+
81
+ 9. NEXT STEPS: End with clear instruction:
82
+ - Output: "Run /air-apply-feedback to apply recommended changes"
83
+ - This guides user to next step in workflow
84
+
85
+ IMPORTANT INSTRUCTIONS:
86
+ - ALWAYS start by creating the todo list file before doing any other work
87
+ - Execute tasks in the exact order specified in the todo list
88
+ - Always review HEAD commit (most recent commit)
89
+ - Coordinate with sub-agent-coordinator to get best expert selection
90
+ - Run expert consultations in parallel for speed
91
+ - Focus on adversarial review - find issues, don't just validate
92
+ - Organize feedback clearly for apply-feedback agent to parse
93
+
94
+
95
+ Always check your knowledge base first for code review best practices and guidelines.
@@ -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,13 +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/project"
14
+ require_relative "commands/plugin"
15
15
 
16
16
  module Aircana
17
17
  module CLI
@@ -40,9 +40,11 @@ module Aircana
40
40
  Generate.run
41
41
  end
42
42
 
43
- desc "install", "Copies the generated files from `generate` to the proper directories in Claude Code config."
44
- def install
45
- 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])
46
48
  end
47
49
 
48
50
  class AgentsSubcommand < Subcommand
@@ -99,41 +101,36 @@ module Aircana
99
101
  end
100
102
  end
101
103
 
102
- class ProjectSubcommand < Subcommand
103
- desc "init", "Initialize project.json for multi-root support"
104
- def init
105
- Project.init
106
- end
104
+ desc "agents", "Create and manage agents and their knowledgebases"
105
+ subcommand "agents", AgentsSubcommand
107
106
 
108
- desc "add FOLDER_PATH", "Add a folder to multi-root configuration"
109
- def add(folder_path)
110
- Project.add(folder_path)
107
+ desc "hooks", "Manage Claude Code hooks"
108
+ subcommand "hooks", HooksSubcommand
109
+
110
+ class PluginSubcommand < Subcommand
111
+ desc "info", "Display plugin information"
112
+ def info
113
+ Plugin.info
111
114
  end
112
115
 
113
- desc "remove FOLDER_PATH", "Remove a folder from multi-root configuration"
114
- def remove(folder_path)
115
- Project.remove(folder_path)
116
+ desc "update", "Update plugin metadata"
117
+ def update
118
+ Plugin.update
116
119
  end
117
120
 
118
- desc "list", "List all configured folders and their agents"
119
- def list
120
- Project.list
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)
121
124
  end
122
125
 
123
- desc "sync", "Manually sync symlinks for multi-root agents"
124
- def sync
125
- Project.sync
126
+ desc "validate", "Validate plugin structure and manifests"
127
+ def validate
128
+ Plugin.validate
126
129
  end
127
130
  end
128
131
 
129
- desc "agents", "Create and manage agents and their knowledgebases"
130
- subcommand "agents", AgentsSubcommand
131
-
132
- desc "hooks", "Manage Claude Code hooks"
133
- subcommand "hooks", HooksSubcommand
134
-
135
- desc "project", "Manage multi-root project configuration"
136
- subcommand "project", ProjectSubcommand
132
+ desc "plugin", "Manage plugin metadata and configuration"
133
+ subcommand "plugin", PluginSubcommand
137
134
  end
138
135
  end
139
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 \".aircana/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")
@@ -8,7 +8,6 @@ require_relative "../../generators/apply_feedback_command_generator"
8
8
  require_relative "../../generators/ask_expert_command_generator"
9
9
  require_relative "../../generators/agents_generator"
10
10
  require_relative "../../generators/hooks_generator"
11
- require_relative "../../generators/project_config_generator"
12
11
 
13
12
  module Aircana
14
13
  module CLI
@@ -29,7 +28,6 @@ module Aircana
29
28
  generators.each(&:generate)
30
29
  generate_default_agents
31
30
  generate_default_hooks
32
- generate_project_config
33
31
  Aircana.human_logger.success("Re-generated #{Aircana.configuration.output_dir} files.")
34
32
  end
35
33
 
@@ -46,15 +44,6 @@ module Aircana
46
44
  Aircana::Generators::HooksGenerator.create_default_hook(hook_name)
47
45
  end
48
46
  end
49
-
50
- def generate_project_config
51
- project_json_path = File.join(Aircana.configuration.project_dir, ".aircana", "project.json")
52
-
53
- # Only generate if it doesn't already exist
54
- return if File.exist?(project_json_path)
55
-
56
- Aircana::Generators::ProjectConfigGenerator.new.generate
57
- end
58
47
  end
59
48
  end
60
49
  end