|
20 | 20 | # Config source (in Docker image) and destination (Lambda writable) |
21 | 21 | CONFIG_SRC = Path('/opt/claude-config') |
22 | 22 | CONFIG_DST = Path('/tmp/.claude-code') |
| 23 | +SKILLS_SRC = Path('/opt/claude-skills') |
| 24 | +SKILLS_DST = CONFIG_DST / 'skills' |
23 | 25 |
|
24 | 26 |
|
25 | 27 | def setup_lambda_environment(): |
@@ -58,6 +60,17 @@ def setup_lambda_environment(): |
58 | 60 | shutil.copy2(item, dst) |
59 | 61 | print(f"Config copied from {CONFIG_SRC} to {CONFIG_DST}") |
60 | 62 |
|
| 63 | + # Copy skills to CLAUDE_CONFIG_DIR/skills/ for SDK to discover |
| 64 | + if SKILLS_SRC.exists(): |
| 65 | + SKILLS_DST.mkdir(parents=True, exist_ok=True) |
| 66 | + for item in SKILLS_SRC.iterdir(): |
| 67 | + dst = SKILLS_DST / item.name |
| 68 | + if item.is_dir(): |
| 69 | + shutil.copytree(item, dst, dirs_exist_ok=True) |
| 70 | + else: |
| 71 | + shutil.copy2(item, dst) |
| 72 | + print(f"Skills copied from {SKILLS_SRC} to {SKILLS_DST}") |
| 73 | + |
61 | 74 | print(f"Bedrock profile created at {credentials_file}") |
62 | 75 |
|
63 | 76 |
|
@@ -154,11 +167,12 @@ async def process_message( |
154 | 167 | permission_mode='bypassPermissions', # Lambda has no interactive terminal |
155 | 168 | max_turns=max_turns, |
156 | 169 | system_prompt=system_prompt, |
| 170 | + setting_sources=['user'], # Load skills from CLAUDE_CONFIG_DIR/skills/ |
157 | 171 | allowed_tools=[ |
158 | 172 | #'Bash', 'Read', 'Write', 'Edit', |
159 | 173 | #'Glob', 'Grep', 'WebFetch', |
160 | | - 'Task', |
161 | | - 'Skill' # Required for SubAgent invocation |
| 174 | + 'Task', # For SubAgents |
| 175 | + 'Skill', # For Skills |
162 | 176 | ], |
163 | 177 | mcp_servers=mcp_servers if mcp_servers else None, |
164 | 178 | agents=agents if agents else None, |
|
0 commit comments