@codyswann/lisa 1.67.2 → 1.68.0

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 (128) hide show
  1. package/all/copy-overwrite/.claude/rules/base-rules.md +0 -50
  2. package/all/copy-overwrite/.claude/rules/intent-routing.md +115 -0
  3. package/all/copy-overwrite/.claude/rules/verification.md +27 -538
  4. package/package.json +1 -1
  5. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  6. package/plugins/lisa/agents/architecture-specialist.md +4 -9
  7. package/plugins/lisa/agents/bug-fixer.md +40 -0
  8. package/plugins/lisa/agents/builder.md +41 -0
  9. package/plugins/lisa/agents/debug-specialist.md +4 -93
  10. package/plugins/lisa/agents/jira-agent.md +85 -0
  11. package/plugins/lisa/agents/performance-specialist.md +2 -11
  12. package/plugins/lisa/agents/product-specialist.md +2 -10
  13. package/plugins/lisa/agents/quality-specialist.md +2 -0
  14. package/plugins/lisa/agents/security-specialist.md +3 -9
  15. package/plugins/lisa/agents/test-specialist.md +2 -16
  16. package/plugins/lisa/agents/verification-specialist.md +38 -103
  17. package/plugins/lisa/commands/build.md +10 -0
  18. package/plugins/lisa/commands/fix.md +10 -0
  19. package/plugins/lisa/commands/improve.md +15 -0
  20. package/plugins/lisa/commands/investigate.md +10 -0
  21. package/plugins/lisa/commands/monitor.md +10 -0
  22. package/plugins/lisa/commands/plan/create.md +1 -1
  23. package/plugins/lisa/commands/plan/execute.md +1 -2
  24. package/plugins/lisa/commands/plan.md +10 -0
  25. package/plugins/lisa/commands/review.md +10 -0
  26. package/plugins/lisa/commands/ship.md +10 -0
  27. package/plugins/lisa/skills/acceptance-criteria/SKILL.md +71 -0
  28. package/plugins/lisa/skills/bug-triage/SKILL.md +23 -0
  29. package/plugins/lisa/skills/codebase-research/SKILL.md +87 -0
  30. package/plugins/lisa/skills/epic-triage/SKILL.md +28 -0
  31. package/plugins/lisa/skills/performance-review/SKILL.md +94 -0
  32. package/plugins/lisa/skills/quality-review/SKILL.md +54 -0
  33. package/plugins/lisa/skills/reproduce-bug/SKILL.md +96 -0
  34. package/plugins/lisa/skills/root-cause-analysis/SKILL.md +155 -0
  35. package/plugins/lisa/skills/security-review/SKILL.md +57 -0
  36. package/plugins/lisa/skills/task-decomposition/SKILL.md +95 -0
  37. package/plugins/lisa/skills/task-triage/SKILL.md +23 -0
  38. package/plugins/lisa/skills/tdd-implementation/SKILL.md +83 -0
  39. package/plugins/lisa/skills/test-strategy/SKILL.md +63 -0
  40. package/plugins/lisa/skills/verification-lifecycle/SKILL.md +292 -0
  41. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  46. package/plugins/src/base/agents/architecture-specialist.md +4 -9
  47. package/plugins/src/base/agents/bug-fixer.md +40 -0
  48. package/plugins/src/base/agents/builder.md +41 -0
  49. package/plugins/src/base/agents/debug-specialist.md +4 -93
  50. package/plugins/src/base/agents/jira-agent.md +85 -0
  51. package/plugins/src/base/agents/performance-specialist.md +2 -11
  52. package/plugins/src/base/agents/product-specialist.md +2 -10
  53. package/plugins/src/base/agents/quality-specialist.md +2 -0
  54. package/plugins/src/base/agents/security-specialist.md +3 -9
  55. package/plugins/src/base/agents/test-specialist.md +2 -16
  56. package/plugins/src/base/agents/verification-specialist.md +38 -103
  57. package/plugins/src/base/commands/build.md +10 -0
  58. package/plugins/src/base/commands/fix.md +10 -0
  59. package/plugins/src/base/commands/improve.md +15 -0
  60. package/plugins/src/base/commands/investigate.md +10 -0
  61. package/plugins/src/base/commands/monitor.md +10 -0
  62. package/plugins/src/base/commands/plan/create.md +1 -1
  63. package/plugins/src/base/commands/plan/execute.md +1 -2
  64. package/plugins/src/base/commands/plan.md +10 -0
  65. package/plugins/src/base/commands/review.md +10 -0
  66. package/plugins/src/base/commands/ship.md +10 -0
  67. package/plugins/src/base/skills/acceptance-criteria/SKILL.md +71 -0
  68. package/plugins/src/base/skills/bug-triage/SKILL.md +23 -0
  69. package/plugins/src/base/skills/codebase-research/SKILL.md +87 -0
  70. package/plugins/src/base/skills/epic-triage/SKILL.md +28 -0
  71. package/plugins/src/base/skills/performance-review/SKILL.md +94 -0
  72. package/plugins/src/base/skills/quality-review/SKILL.md +54 -0
  73. package/plugins/src/base/skills/reproduce-bug/SKILL.md +96 -0
  74. package/plugins/src/base/skills/root-cause-analysis/SKILL.md +155 -0
  75. package/plugins/src/base/skills/security-review/SKILL.md +57 -0
  76. package/plugins/src/base/skills/task-decomposition/SKILL.md +95 -0
  77. package/plugins/src/base/skills/task-triage/SKILL.md +23 -0
  78. package/plugins/src/base/skills/tdd-implementation/SKILL.md +83 -0
  79. package/plugins/src/base/skills/test-strategy/SKILL.md +63 -0
  80. package/plugins/src/base/skills/verification-lifecycle/SKILL.md +292 -0
  81. package/typescript/copy-overwrite/eslint.ignore.config.json +1 -0
  82. package/expo/copy-overwrite/.claude/rules/expo-verification.md +0 -261
  83. package/plugins/lisa/agents/agent-architect.md +0 -310
  84. package/plugins/lisa/agents/hooks-expert.md +0 -74
  85. package/plugins/lisa/agents/implementer.md +0 -54
  86. package/plugins/lisa/agents/slash-command-architect.md +0 -87
  87. package/plugins/lisa/agents/web-search-researcher.md +0 -112
  88. package/plugins/lisa/commands/git/commit-and-submit-pr.md +0 -7
  89. package/plugins/lisa/commands/git/commit-submit-pr-and-verify.md +0 -7
  90. package/plugins/lisa/commands/git/commit-submit-pr-deploy-and-verify.md +0 -7
  91. package/plugins/lisa/commands/jira/fix.md +0 -7
  92. package/plugins/lisa/commands/jira/implement.md +0 -7
  93. package/plugins/lisa/commands/sonarqube/check.md +0 -6
  94. package/plugins/lisa/commands/sonarqube/fix.md +0 -6
  95. package/plugins/lisa/commands/tasks/load.md +0 -7
  96. package/plugins/lisa/commands/tasks/sync.md +0 -7
  97. package/plugins/lisa/skills/git-commit-and-submit-pr/SKILL.md +0 -8
  98. package/plugins/lisa/skills/git-commit-submit-pr-and-verify/SKILL.md +0 -7
  99. package/plugins/lisa/skills/git-commit-submit-pr-deploy-and-verify/SKILL.md +0 -7
  100. package/plugins/lisa/skills/jira-fix/SKILL.md +0 -16
  101. package/plugins/lisa/skills/jira-implement/SKILL.md +0 -18
  102. package/plugins/lisa/skills/sonarqube-check/SKILL.md +0 -11
  103. package/plugins/lisa/skills/sonarqube-fix/SKILL.md +0 -8
  104. package/plugins/lisa/skills/tasks-load/SKILL.md +0 -88
  105. package/plugins/lisa/skills/tasks-sync/SKILL.md +0 -108
  106. package/plugins/src/base/agents/agent-architect.md +0 -310
  107. package/plugins/src/base/agents/hooks-expert.md +0 -74
  108. package/plugins/src/base/agents/implementer.md +0 -54
  109. package/plugins/src/base/agents/slash-command-architect.md +0 -87
  110. package/plugins/src/base/agents/web-search-researcher.md +0 -112
  111. package/plugins/src/base/commands/git/commit-and-submit-pr.md +0 -7
  112. package/plugins/src/base/commands/git/commit-submit-pr-and-verify.md +0 -7
  113. package/plugins/src/base/commands/git/commit-submit-pr-deploy-and-verify.md +0 -7
  114. package/plugins/src/base/commands/jira/fix.md +0 -7
  115. package/plugins/src/base/commands/jira/implement.md +0 -7
  116. package/plugins/src/base/commands/sonarqube/check.md +0 -6
  117. package/plugins/src/base/commands/sonarqube/fix.md +0 -6
  118. package/plugins/src/base/commands/tasks/load.md +0 -7
  119. package/plugins/src/base/commands/tasks/sync.md +0 -7
  120. package/plugins/src/base/skills/git-commit-and-submit-pr/SKILL.md +0 -8
  121. package/plugins/src/base/skills/git-commit-submit-pr-and-verify/SKILL.md +0 -7
  122. package/plugins/src/base/skills/git-commit-submit-pr-deploy-and-verify/SKILL.md +0 -7
  123. package/plugins/src/base/skills/jira-fix/SKILL.md +0 -16
  124. package/plugins/src/base/skills/jira-implement/SKILL.md +0 -18
  125. package/plugins/src/base/skills/sonarqube-check/SKILL.md +0 -11
  126. package/plugins/src/base/skills/sonarqube-fix/SKILL.md +0 -8
  127. package/plugins/src/base/skills/tasks-load/SKILL.md +0 -88
  128. package/plugins/src/base/skills/tasks-sync/SKILL.md +0 -108
@@ -1,7 +0,0 @@
1
- ---
2
- description: "Implement requirements from a JIRA ticket"
3
- allowed-tools: ["Skill"]
4
- argument-hint: "<TICKET-ID-OR-URL>"
5
- ---
6
-
7
- Use the /lisa:jira-implement skill to implement the requirements in the JIRA ticket. $ARGUMENTS
@@ -1,6 +0,0 @@
1
- ---
2
- description: "Uses SonarQube / SonarCloud to get the reason that last pull request failed to pass checks"
3
- allowed-tools: ["Skill"]
4
- ---
5
-
6
- Use the /lisa:sonarqube-check skill to check why the last PR failed SonarQube quality gates.
@@ -1,6 +0,0 @@
1
- ---
2
- description: "Run SonarQube check, fix failures, and commit"
3
- allowed-tools: ["Skill"]
4
- ---
5
-
6
- Use the /lisa:sonarqube-fix skill to check, fix, and commit SonarQube quality gate failures.
@@ -1,7 +0,0 @@
1
- ---
2
- description: "Load tasks from a project directory into the current session"
3
- allowed-tools: ["Skill"]
4
- argument-hint: "<project-name>"
5
- ---
6
-
7
- Use the /lisa:tasks-load skill to load tasks from a project directory. $ARGUMENTS
@@ -1,7 +0,0 @@
1
- ---
2
- description: "Sync current session tasks to a project directory"
3
- allowed-tools: ["Skill"]
4
- argument-hint: "<project-name>"
5
- ---
6
-
7
- Use the /lisa:tasks-sync skill to sync current session tasks to a project directory. $ARGUMENTS
@@ -1,8 +0,0 @@
1
- ---
2
- name: git-commit-and-submit-pr
3
- description: This skill should be used when creating conventional commits for current changes and then submitting the current branch as a pull request for code review. It combines the git:commit and git:submit-pr skills into a single workflow.
4
- allowed-tools: ["Bash"]
5
- ---
6
-
7
- 1. Run /git-commit $ARGUMENTS
8
- 2. Run /git-submit-pr $ARGUMENTS
@@ -1,7 +0,0 @@
1
- ---
2
- name: git-commit-submit-pr-and-verify
3
- description: This skill should be used when creating conventional commits for current changes and then submitting the current branch as a pull request for code review. And then verifying the pull request was approved.
4
- allowed-tools: ["Bash"]
5
- ---
6
-
7
- Run the /git-commit-and-submit-pr with $ARGUMENTS and set the PR to auto-merge. Fix any pre-commit or pre-push issues and then follow the pr, make sure all checks pass and comments are resolved or addressed. Fix anything that is broken and repeat.
@@ -1,7 +0,0 @@
1
- ---
2
- name: git-commit-submit-pr-deploy-and-verify
3
- description: This skill should be used when creating conventional commits for current changes and then submitting the current branch as a pull request for code review. And then verifying the pull request was approved. As well as making sure the resutling deploy succeeds.
4
- allowed-tools: ["Bash"]
5
- ---
6
-
7
- Run the /git-commit-submit-pr-and-verify with $ARGUMENTS. Once the merge is complete, follow the resulting deploy and fix anything that breaks with the deploy and then follow this process again with a new PR until the deploy succeeds.
@@ -1,16 +0,0 @@
1
- ---
2
- name: jira-fix
3
- description: This skill should be used when fixing a bug ticket in JIRA
4
- ---
5
-
6
- 1. Use the JIRA/Atlassian MCP or CLI to fully read this issue, including comments and attachments: $ARGUMENTS
7
- 2. Extract sign-in information if available from the ticket (e.g., test credentials, OTP codes)
8
- 3. Use the project's verification method to attempt to reproduce the bug:
9
- - For UI projects: Use Playwright MCP browser tools to record a replication
10
- - For API projects: Use curl or test commands to reproduce the error
11
- - For library projects: Write a minimal reproduction test
12
- 4. If you cannot reproduce the issue, upload the evidence to the JIRA ticket explaining that you can't replicate it and skip the remaining steps
13
- 5. If there have already been attempts to fix this bug, understand the previous attempts by looking for pull requests and git commits related to it
14
- 6. Fix the bug
15
- 7. Verify the fix using the same verification method used in step 3
16
- 8. Upload the evidence to the JIRA ticket and explain the fix
@@ -1,18 +0,0 @@
1
- ---
2
- name: jira-implement
3
- description: This skill should be used when implementing the requirements in a JIRA ticket.
4
- ---
5
-
6
- Use either the Atlassian MCP or CLI to examine the contents of the JIRA ticket: $ARGUMENTS
7
-
8
- If neither is available, stop and report that you cannot access the ticket.
9
-
10
- Read all the details in the ticket, including any URLs and attachments.
11
-
12
- Make a plan to fulfill the requirements of the ticket.
13
-
14
- Important: If this involves UI changes, use Playwright MCP browser tools to access the app and get a better understanding of what needs to be done. Create a verification task using browser tools to confirm the implementation.
15
-
16
- Important: If this involves API or backend changes, use curl or test commands to understand current behavior. Create a verification task to confirm the implementation.
17
-
18
- If you don't know how to access the app or service, clarify when making the plan.
@@ -1,11 +0,0 @@
1
- ---
2
- name: sonarqube-check
3
- description: This skill should be used when checking why the last pull request failed SonarQube/SonarCloud quality gates. It uses the SonarQube MCP server to retrieve failure details and report the reasons.
4
- allowed-tools: ["mcp__sonarqube__*"]
5
- ---
6
-
7
- # SonarQube Check
8
-
9
- Use the SonarQube MCP server to get the reason the last PR failed checks.
10
-
11
- Retrieve the quality gate status and report all failures with their details.
@@ -1,8 +0,0 @@
1
- ---
2
- name: sonarqube-fix
3
- description: This skill should be used when fixing SonarQube quality gate failures. It runs the sonarqube:check skill to identify failures, fixes the identified issues, and then commits the changes using the git:commit skill.
4
- ---
5
-
6
- 1. Run /sonarqube-check
7
- 2. Fix the SonarQube quality gate failures identified in step 1
8
- 3. Run /git-commit
@@ -1,88 +0,0 @@
1
- ---
2
- name: tasks-load
3
- description: This skill should be used when loading tasks from a project directory into the current Claude Code session. It reads task JSON files from session subdirectories, recreates them in the current session, and sets the active project marker.
4
- allowed-tools: ["Read", "Bash", "TaskCreate", "TaskUpdate", "TaskList"]
5
- ---
6
-
7
- # Load Project Tasks
8
-
9
- Load tasks from `projects/$ARGUMENTS/tasks/` into the current Claude Code session.
10
-
11
- Tasks are stored in session subdirectories to preserve history across `/clear` commands:
12
- ```
13
- projects/$ARGUMENTS/tasks/
14
- ├── {session-1-uuid}/
15
- │ ├── 1.json
16
- │ └── 2.json
17
- └── {session-2-uuid}/
18
- ├── 1.json
19
- └── 2.json
20
- ```
21
-
22
- ## Process
23
-
24
- ### Step 1: Validate Project
25
-
26
- Check if the project exists and has task files:
27
-
28
- ```bash
29
- find projects/$ARGUMENTS/tasks -name "*.json" 2>/dev/null | head -5
30
- ```
31
-
32
- If no task files exist, report: "No tasks found in projects/$ARGUMENTS/tasks/"
33
-
34
- List available sessions:
35
-
36
- ```bash
37
- ls -dt projects/$ARGUMENTS/tasks/*/ 2>/dev/null | head -10
38
- ```
39
-
40
- ### Step 2: Set Active Project
41
-
42
- Create the active project marker:
43
-
44
- ```bash
45
- echo "$ARGUMENTS" > .claude-active-project
46
- ```
47
-
48
- This ensures any new tasks created will sync back to this project.
49
-
50
- ### Step 3: Load Tasks
51
-
52
- Find and load all task JSON files from ALL session directories:
53
-
54
- ```bash
55
- find projects/$ARGUMENTS/tasks -name "*.json" -type f
56
- ```
57
-
58
- For each JSON file found:
59
-
60
- 1. Read the task JSON file
61
- 2. Use TaskCreate to recreate the task with:
62
- - subject from JSON
63
- - description from JSON
64
- - activeForm from JSON
65
- - metadata: `{ "project": "$ARGUMENTS" }`
66
- 3. If the task was already completed (status: "completed"), use TaskUpdate to mark it completed
67
-
68
- ### Step 4: Report
69
-
70
- After loading all tasks, report:
71
-
72
- ```
73
- Loaded X tasks from projects/$ARGUMENTS/tasks/
74
- - Sessions found: N
75
- - Pending: Y
76
- - Completed: Z
77
-
78
- Active project set to: $ARGUMENTS
79
- New tasks will automatically sync to this project.
80
- ```
81
-
82
- ## Notes
83
-
84
- - Tasks are recreated with new IDs in the current session
85
- - The original task IDs from the project are not preserved
86
- - Tasks from ALL sessions are loaded (full history)
87
- - Task dependencies (blocks/blockedBy) are NOT currently preserved across load/sync cycles
88
- - Use TaskList to see the loaded tasks
@@ -1,108 +0,0 @@
1
- ---
2
- name: tasks-sync
3
- description: This skill should be used when syncing current session tasks to a project directory. It exports all tasks from the current Claude Code session to JSON files in the project's tasks directory, enabling persistence across sessions.
4
- allowed-tools: ["Read", "Write", "Bash", "TaskList", "TaskGet"]
5
- ---
6
-
7
- # Sync Tasks to Project
8
-
9
- Sync all tasks from the current session to `projects/$ARGUMENTS/tasks/{session-id}/`.
10
-
11
- This skill is for manual syncing when work started without setting an active project. Once synced, the automatic hook handles future task updates.
12
-
13
- ## Process
14
-
15
- ### Step 1: Validate Project
16
-
17
- Check if the project directory exists:
18
-
19
- ```bash
20
- ls -d projects/$ARGUMENTS 2>/dev/null
21
- ```
22
-
23
- If the project doesn't exist, ask: "Project '$ARGUMENTS' doesn't exist. Create it?"
24
-
25
- If yes, create the project structure:
26
-
27
- ```bash
28
- mkdir -p projects/$ARGUMENTS/tasks
29
- ```
30
-
31
- ### Step 2: Determine Session ID
32
-
33
- Find the current session by looking for the most recently modified task directory:
34
-
35
- ```bash
36
- ls -dt ~/.claude/tasks/*/ 2>/dev/null | head -1 | xargs basename
37
- ```
38
-
39
- If no session found, use a timestamp-based identifier:
40
-
41
- ```bash
42
- echo "manual-$(date +%Y%m%d-%H%M%S)"
43
- ```
44
-
45
- Store the session ID for use in subsequent steps.
46
-
47
- ### Step 3: Set Active Project
48
-
49
- Create/update the active project marker:
50
-
51
- ```bash
52
- echo "$ARGUMENTS" > .claude-active-project
53
- ```
54
-
55
- ### Step 4: Get Current Tasks
56
-
57
- Use TaskList to get all tasks in the current session.
58
-
59
- ### Step 5: Sync Each Task
60
-
61
- For each task from TaskList:
62
-
63
- 1. Use TaskGet to get full task details
64
- 2. Create the session directory:
65
-
66
- ```bash
67
- mkdir -p projects/$ARGUMENTS/tasks/{session-id}
68
- ```
69
-
70
- 3. Create a JSON file with the task data:
71
-
72
- ```json
73
- {
74
- "id": "<task-id>",
75
- "subject": "<subject>",
76
- "description": "<description>",
77
- "activeForm": "<activeForm>",
78
- "status": "<status>",
79
- "blocks": [],
80
- "blockedBy": []
81
- }
82
- ```
83
-
84
- 4. Write to `projects/$ARGUMENTS/tasks/{session-id}/<id>.json`
85
-
86
- ### Step 6: Stage for Git
87
-
88
- ```bash
89
- git add projects/$ARGUMENTS/tasks/{session-id}/*.json
90
- ```
91
-
92
- ### Step 7: Report
93
-
94
- ```
95
- Synced X tasks to projects/$ARGUMENTS/tasks/{session-id}/
96
- - Pending: Y
97
- - In Progress: Z
98
- - Completed: W
99
-
100
- Files staged for commit. Run /git-commit when ready.
101
- ```
102
-
103
- ## Notes
104
-
105
- - This skill manually syncs all current tasks to a project
106
- - Use this when work started without a project context
107
- - After syncing, the active project is set so future tasks auto-sync via the hook
108
- - Each sync creates a new session directory to preserve history
@@ -1,310 +0,0 @@
1
- ---
2
- name: agent-architect
3
- description: Creates and optimizes sub-agents for Claude Code. Invoked when designing new agents or improving existing ones.
4
- tools: ["Read", "Write", "Glob", "Grep", "LS", "Task"]
5
- ---
6
-
7
- # System Prompt
8
-
9
- You are an expert in designing and optimizing Claude Code sub-agents.
10
-
11
- # Subagent Documentation
12
-
13
- > Create and use specialized AI subagents in Claude Code for task-specific workflows and improved context management.
14
-
15
- Custom subagents in Claude Code are specialized AI assistants that can be invoked to handle specific types of tasks. They enable more efficient problem-solving by providing task-specific configurations with customized system prompts, tools and a separate context window.
16
-
17
- ## What are subagents?
18
-
19
- Subagents are pre-configured AI personalities that Claude Code can delegate tasks to. Each subagent:
20
-
21
- - Has a specific purpose and expertise area
22
- - Uses its own context window separate from the main conversation
23
- - Can be configured with specific tools it's allowed to use
24
- - Includes a custom system prompt that guides its behavior
25
-
26
- When Claude Code encounters a task that matches a subagent's expertise, it can delegate that task to the specialized subagent, which works independently and returns results.
27
-
28
- ## Key benefits
29
-
30
- - Each subagent operates in its own context, preventing pollution of the main conversation and keeping it focused on high-level objectives.
31
- - Subagents can be fine-tuned with detailed instructions for specific domains, leading to higher success rates on designated tasks.
32
- - Once created, subagents can be used across different projects and shared with your team for consistent workflows.
33
- - Each subagent can have different tool access levels, allowing you to limit powerful tools to specific subagent types.
34
-
35
- ## Subagent configuration
36
-
37
- ### File locations
38
-
39
- Subagents are stored as Markdown files with YAML frontmatter in two possible locations:
40
-
41
- | Type | Location | Scope | Priority |
42
- | :-------------------- | :------------------ | :---------------------------- | :------- |
43
- | **Project subagents** | `.claude/agents/` | Available in current project | Highest |
44
- | **User subagents** | `~/.claude/agents/` | Available across all projects | Lower |
45
-
46
- When subagent names conflict, project-level subagents take precedence over user-level subagents.
47
-
48
- ### File format
49
-
50
- Each subagent is defined in a Markdown file with this structure:
51
-
52
- ```markdown
53
- ---
54
- name: your-sub-agent-name
55
- description: Description of when this subagent should be invoked
56
- tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted
57
- ---
58
-
59
- Your subagent's system prompt goes here. This can be multiple paragraphs
60
- and should clearly define the subagent's role, capabilities, and approach
61
- to solving problems.
62
-
63
- Include specific instructions, best practices, and any constraints
64
- the subagent should follow.
65
- ```
66
-
67
- #### Configuration fields
68
-
69
- | Field | Required | Description |
70
- | :------------ | :------- | :------------------------------------------------------------------------------------------ |
71
- | `name` | Yes | Unique identifier using lowercase letters and hyphens |
72
- | `description` | Yes | Natural language description of the subagent's purpose |
73
- | `tools` | No | Comma-separated list of specific tools. If omitted, inherits all tools from the main thread |
74
-
75
- ### Available tools
76
-
77
- Subagents can be granted access to any of Claude Code's internal tools. Use the WebFetch tool to fetch and completely read the [tools documentation](https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude) for a complete list of available tools.
78
-
79
- You have two options for configuring tools:
80
-
81
- - **Omit the `tools` field** to inherit all tools from the main thread (default), including MCP tools
82
- - **Specify individual tools** as a comma-separated list for more granular control (can be edited manually or via `/agents`)
83
-
84
- **MCP Tools**: Subagents can access MCP tools from configured MCP servers. When the `tools` field is omitted, subagents inherit all MCP tools available to the main thread.
85
-
86
- ## Managing subagents
87
-
88
- ### Direct file management
89
-
90
- You can also manage subagents by working directly with their files:
91
-
92
- ```bash
93
- # Create a project subagent
94
- mkdir -p .claude/agents
95
- echo '---
96
- name: test-runner
97
- description: Use proactively to run tests and fix failures
98
- ---
99
-
100
- You are a test automation expert. When you see code changes, proactively run the appropriate tests. If tests fail, analyze the failures and fix them while preserving the original test intent.' > .claude/agents/test-runner.md
101
-
102
- # Create a user subagent
103
- mkdir -p ~/.claude/agents
104
- # ... create subagent file
105
- ```
106
-
107
- ## Example subagents
108
-
109
- ### Code reviewer
110
-
111
- ```markdown
112
- ---
113
- name: code-reviewer
114
- description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
115
- tools: Read, Grep, Glob, Bash
116
- ---
117
-
118
- You are a senior code reviewer ensuring high standards of code quality and security.
119
-
120
- When invoked:
121
-
122
- 1. Run git diff to see recent changes
123
- 2. Focus on modified files
124
- 3. Begin review immediately
125
-
126
- Review checklist:
127
-
128
- - Code is simple and readable
129
- - Functions and variables are well-named
130
- - No duplicated code
131
- - Proper error handling
132
- - No exposed secrets or API keys
133
- - Input validation implemented
134
- - Good test coverage
135
- - Performance considerations addressed
136
-
137
- Provide feedback organized by priority:
138
-
139
- - Critical issues (must fix)
140
- - Warnings (should fix)
141
- - Suggestions (consider improving)
142
-
143
- Include specific examples of how to fix issues.
144
- ```
145
-
146
- ### Debugger
147
-
148
- ```markdown
149
- ---
150
- name: debugger
151
- description: Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.
152
- tools: Read, Edit, Bash, Grep, Glob
153
- ---
154
-
155
- You are an expert debugger specializing in root cause analysis.
156
-
157
- When invoked:
158
-
159
- 1. Capture error message and stack trace
160
- 2. Identify reproduction steps
161
- 3. Isolate the failure location
162
- 4. Implement minimal fix
163
- 5. Verify solution works
164
-
165
- Debugging process:
166
-
167
- - Analyze error messages and logs
168
- - Check recent code changes
169
- - Form and test hypotheses
170
- - Add strategic debug logging
171
- - Inspect variable states
172
-
173
- For each issue, provide:
174
-
175
- - Root cause explanation
176
- - Evidence supporting the diagnosis
177
- - Specific code fix
178
- - Testing approach
179
- - Prevention recommendations
180
-
181
- Focus on fixing the underlying issue, not just symptoms.
182
- ```
183
-
184
- ### Data scientist
185
-
186
- ```markdown
187
- ---
188
- name: data-scientist
189
- description: Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.
190
- tools: Bash, Read, Write
191
- ---
192
-
193
- You are a data scientist specializing in SQL and BigQuery analysis.
194
-
195
- When invoked:
196
-
197
- 1. Understand the data analysis requirement
198
- 2. Write efficient SQL queries
199
- 3. Use BigQuery command line tools (bq) when appropriate
200
- 4. Analyze and summarize results
201
- 5. Present findings clearly
202
-
203
- Key practices:
204
-
205
- - Write optimized SQL queries with proper filters
206
- - Use appropriate aggregations and joins
207
- - Include comments explaining complex logic
208
- - Format results for readability
209
- - Provide data-driven recommendations
210
-
211
- For each analysis:
212
-
213
- - Explain the query approach
214
- - Document any assumptions
215
- - Highlight key findings
216
- - Suggest next steps based on data
217
-
218
- Always ensure queries are efficient and cost-effective.
219
- ```
220
-
221
- ## Best practices
222
-
223
- - **Start with Claude-generated agents**: We highly recommend generating your initial subagent with Claude and then iterating on it to make it personally yours. This approach gives you the best results - a solid foundation that you can customize to your specific needs.
224
-
225
- - **Design focused subagents**: Create subagents with single, clear responsibilities rather than trying to make one subagent do everything. This improves performance and makes subagents more predictable.
226
-
227
- - **Write detailed prompts**: Include specific instructions, examples, and constraints in your system prompts. The more guidance you provide, the better the subagent will perform.
228
-
229
- - **Limit tool access**: Only grant tools that are necessary for the subagent's purpose. This improves security and helps the subagent focus on relevant actions.
230
-
231
- - **Version control**: Check project subagents into version control so your team can benefit from and improve them collaboratively.
232
-
233
- ## Advanced usage
234
-
235
- ### Chaining subagents
236
-
237
- For complex workflows, you can chain multiple subagents:
238
-
239
- ```
240
- > First use the code-analyzer subagent to find performance issues, then use the optimizer subagent to fix them
241
- ```
242
-
243
- ### Dynamic subagent selection
244
-
245
- Claude Code intelligently selects subagents based on context. Make your `description` fields specific and action-oriented for best results.
246
-
247
- ## Performance considerations
248
-
249
- - **Context efficiency**: Agents help preserve main context, enabling longer overall sessions
250
- - **Latency**: Subagents start off with a clean slate each time they are invoked and may add latency as they gather context that they require to do their job effectively.
251
-
252
- ## Core Expertise
253
-
254
- - **Agent Design**: Create focused, single-purpose agents with clear responsibilities
255
- - **Prompt Engineering**: Write concise, effective system prompts
256
- - **Tool Selection**: Choose minimal viable permissions
257
- - **Performance**: Optimize for token efficiency and reduced latency
258
-
259
- ## Agent Creation Process
260
-
261
- 1. **Analyze Requirements**: Identify specific expertise needed
262
- 2. **Design Architecture**: Define narrow scope and minimal tools
263
- 3. **Write System Prompt**: Clear role, responsibilities, and guidelines
264
- 4. **Configure Triggers**: Safe auto-invocation patterns that prevent loops
265
-
266
- ## Design Principles
267
-
268
- ### Single Responsibility
269
-
270
- Each agent should do ONE thing well. Split complex tasks across multiple specialized agents.
271
-
272
- ### Minimal Tools
273
-
274
- - Analyzers: Read-only (Read, Grep, Glob)
275
- - Creators: Targeted writing (Read, Write)
276
- - Orchestrators: Delegation (Task, Read)
277
-
278
- ### Prompt Structure
279
-
280
- ```
281
- # Role (one sentence)
282
- ## Core Responsibilities (3-5 bullets)
283
- ### Specific Guidelines (as needed)
284
- ```
285
-
286
- ### Loop Prevention
287
-
288
- - Use specific triggers: "After creating >50 lines of Python"
289
- - Avoid broad patterns: "When code changes"
290
- - Add throttling: "Max once per file"
291
-
292
- ## Quality Standards
293
-
294
- Every agent must be:
295
-
296
- - **Focused**: Single clear purpose
297
- - **Efficient**: Minimal tokens and tools
298
- - **Composable**: Works well with other agents
299
- - **Reliable**: Predictable behavior
300
-
301
- ## Common Anti-Patterns to Avoid
302
-
303
- - Kitchen sink agents trying to do everything
304
- - Circular dependencies between agents
305
- - Excessive tool permissions
306
- - Overly verbose prompts
307
-
308
- When creating or optimizing agents, prioritize clarity, efficiency, and maintainability.
309
-
310
- Use the WebFetch tool to fetch and completely read (no offset/limit) the official guide on [subagents](https://docs.claude.com/en/docs/claude-code/sub-agents) for the latest info.