@musashishao/agent-kit 1.8.1 → 1.9.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 (92) hide show
  1. package/.agent/agents/ai-architect.md +39 -0
  2. package/.agent/agents/cloud-engineer.md +39 -0
  3. package/.agent/agents/game-asset-curator.md +317 -0
  4. package/.agent/agents/game-developer.md +190 -89
  5. package/.agent/agents/game-narrative-designer.md +310 -0
  6. package/.agent/agents/game-qa-agent.md +441 -0
  7. package/.agent/agents/marketing-specialist.md +41 -0
  8. package/.agent/agents/penetration-tester.md +15 -1
  9. package/.agent/rules/CODEX.md +26 -2
  10. package/.agent/rules/GEMINI.md +7 -5
  11. package/.agent/rules/REFERENCE.md +92 -2
  12. package/.agent/scripts/ak_cli.py +1 -1
  13. package/.agent/scripts/localize_workflows.py +54 -0
  14. package/.agent/scripts/memory_manager.py +24 -1
  15. package/.agent/skills/3d-web-experience/SKILL.md +386 -0
  16. package/.agent/skills/DEPENDENCIES.md +54 -0
  17. package/.agent/skills/ab-test-setup/SKILL.md +77 -0
  18. package/.agent/skills/active-directory-attacks/SKILL.md +59 -0
  19. package/.agent/skills/agent-evaluation/SKILL.md +430 -0
  20. package/.agent/skills/agent-memory-systems/SKILL.md +426 -0
  21. package/.agent/skills/agent-tool-builder/SKILL.md +139 -0
  22. package/.agent/skills/ai-agents-architect/SKILL.md +115 -0
  23. package/.agent/skills/ai-product/SKILL.md +86 -0
  24. package/.agent/skills/ai-wrapper-product/SKILL.md +90 -0
  25. package/.agent/skills/analytics-tracking/SKILL.md +88 -0
  26. package/.agent/skills/api-fuzzing-bug-bounty/SKILL.md +66 -0
  27. package/.agent/skills/app-store-optimization/SKILL.md +66 -0
  28. package/.agent/skills/autonomous-agent-patterns/SKILL.md +414 -0
  29. package/.agent/skills/aws-penetration-testing/SKILL.md +50 -0
  30. package/.agent/skills/aws-serverless/SKILL.md +327 -0
  31. package/.agent/skills/azure-functions/SKILL.md +340 -0
  32. package/.agent/skills/broken-authentication/SKILL.md +53 -0
  33. package/.agent/skills/browser-automation/SKILL.md +408 -0
  34. package/.agent/skills/browser-extension-builder/SKILL.md +422 -0
  35. package/.agent/skills/bullmq-specialist/SKILL.md +424 -0
  36. package/.agent/skills/bun-development/SKILL.md +386 -0
  37. package/.agent/skills/burp-suite-testing/SKILL.md +60 -0
  38. package/.agent/skills/clerk-auth/SKILL.md +432 -0
  39. package/.agent/skills/cloud-penetration-testing/SKILL.md +51 -0
  40. package/.agent/skills/copywriting/SKILL.md +66 -0
  41. package/.agent/skills/crewai/SKILL.md +470 -0
  42. package/.agent/skills/discord-bot-architect/SKILL.md +447 -0
  43. package/.agent/skills/email-sequence/SKILL.md +73 -0
  44. package/.agent/skills/ethical-hacking-methodology/SKILL.md +67 -0
  45. package/.agent/skills/firebase/SKILL.md +377 -0
  46. package/.agent/skills/game-development/godot-expert/SKILL.md +462 -0
  47. package/.agent/skills/game-development/npc-ai-integration/SKILL.md +110 -0
  48. package/.agent/skills/game-development/procedural-generation/SKILL.md +168 -0
  49. package/.agent/skills/game-development/unity-integration/SKILL.md +358 -0
  50. package/.agent/skills/game-development/webgpu-shading/SKILL.md +209 -0
  51. package/.agent/skills/gcp-cloud-run/SKILL.md +358 -0
  52. package/.agent/skills/graphql/SKILL.md +492 -0
  53. package/.agent/skills/idor-testing/SKILL.md +64 -0
  54. package/.agent/skills/inngest/SKILL.md +128 -0
  55. package/.agent/skills/langfuse/SKILL.md +415 -0
  56. package/.agent/skills/langgraph/SKILL.md +360 -0
  57. package/.agent/skills/launch-strategy/SKILL.md +68 -0
  58. package/.agent/skills/linux-privilege-escalation/SKILL.md +62 -0
  59. package/.agent/skills/llm-app-patterns/SKILL.md +367 -0
  60. package/.agent/skills/marketing-ideas/SKILL.md +66 -0
  61. package/.agent/skills/metasploit-framework/SKILL.md +60 -0
  62. package/.agent/skills/micro-saas-launcher/SKILL.md +93 -0
  63. package/.agent/skills/neon-postgres/SKILL.md +339 -0
  64. package/.agent/skills/paid-ads/SKILL.md +64 -0
  65. package/.agent/skills/supabase-integration/SKILL.md +411 -0
  66. package/.agent/workflows/ai-agent.md +36 -0
  67. package/.agent/workflows/autofix.md +1 -0
  68. package/.agent/workflows/brainstorm.md +1 -0
  69. package/.agent/workflows/context.md +1 -0
  70. package/.agent/workflows/create.md +1 -0
  71. package/.agent/workflows/dashboard.md +1 -0
  72. package/.agent/workflows/debug.md +1 -0
  73. package/.agent/workflows/deploy.md +1 -0
  74. package/.agent/workflows/enhance.md +1 -0
  75. package/.agent/workflows/game-prototype.md +154 -0
  76. package/.agent/workflows/marketing.md +37 -0
  77. package/.agent/workflows/next.md +1 -0
  78. package/.agent/workflows/orchestrate.md +1 -0
  79. package/.agent/workflows/pentest.md +37 -0
  80. package/.agent/workflows/plan.md +1 -0
  81. package/.agent/workflows/preview.md +2 -1
  82. package/.agent/workflows/quality.md +1 -0
  83. package/.agent/workflows/saas.md +36 -0
  84. package/.agent/workflows/spec.md +1 -0
  85. package/.agent/workflows/status.md +1 -0
  86. package/.agent/workflows/test.md +1 -0
  87. package/.agent/workflows/ui-ux-pro-max.md +1 -0
  88. package/README.md +52 -24
  89. package/bin/cli.js +68 -3
  90. package/docs/CHANGELOG_AI_INFRA.md +30 -0
  91. package/docs/MIGRATION_GUIDE_V1.9.md +55 -0
  92. package/package.json +1 -1
@@ -0,0 +1,414 @@
1
+ ---
2
+ name: autonomous-agent-patterns
3
+ description: "Design patterns for building autonomous coding agents. Covers agent loops, tool design, permission systems, sandboxing, and context management. Inspired by Cline, OpenAI Codex, and production agent systems."
4
+ version: "1.0.0"
5
+ source: "antigravity-awesome-skills (adapted)"
6
+ ---
7
+
8
+ # 🕹️ Autonomous Agent Patterns
9
+
10
+ > Design patterns for building autonomous coding agents, inspired by [Cline](https://github.com/cline/cline) and [OpenAI Codex](https://github.com/openai/codex).
11
+
12
+ ---
13
+
14
+ ## When to Use This Skill
15
+
16
+ - Building coding assistants or autonomous agents
17
+ - Designing tool interfaces for AI
18
+ - Implementing permission/approval systems
19
+ - Creating sandboxed execution environments
20
+ - Managing agent context and memory
21
+
22
+ ---
23
+
24
+ ## 1. Core Agent Architecture
25
+
26
+ ### 1.1 Agent Loop
27
+
28
+ ```
29
+ ┌─────────────────────────────────────────────────────────────┐
30
+ │ AGENT LOOP │
31
+ │ │
32
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
33
+ │ │ Think │───▶│ Decide │───▶│ Act │ │
34
+ │ │ (Reason) │ │ (Plan) │ │ (Execute)│ │
35
+ │ └──────────┘ └──────────┘ └──────────┘ │
36
+ │ ▲ │ │
37
+ │ │ ┌──────────┐ │ │
38
+ │ └─────────│ Observe │◀─────────┘ │
39
+ │ │ (Result) │ │
40
+ │ └──────────┘ │
41
+ └─────────────────────────────────────────────────────────────┘
42
+ ```
43
+
44
+ ```python
45
+ class AgentLoop:
46
+ def __init__(self, llm, tools, max_iterations=50):
47
+ self.llm = llm
48
+ self.tools = {t.name: t for t in tools}
49
+ self.max_iterations = max_iterations
50
+ self.history = []
51
+
52
+ def run(self, task: str) -> str:
53
+ self.history.append({"role": "user", "content": task})
54
+
55
+ for i in range(self.max_iterations):
56
+ # Think: Get LLM response with tool options
57
+ response = self.llm.chat(
58
+ messages=self.history,
59
+ tools=self._format_tools(),
60
+ tool_choice="auto"
61
+ )
62
+
63
+ # Decide: Check if agent wants to use a tool
64
+ if response.tool_calls:
65
+ for tool_call in response.tool_calls:
66
+ # Act: Execute the tool
67
+ result = self._execute_tool(tool_call)
68
+
69
+ # Observe: Add result to history
70
+ self.history.append({
71
+ "role": "tool",
72
+ "tool_call_id": tool_call.id,
73
+ "content": str(result)
74
+ })
75
+ else:
76
+ # No more tool calls = task complete
77
+ return response.content
78
+
79
+ return "Max iterations reached"
80
+ ```
81
+
82
+ ### 1.2 Multi-Model Architecture
83
+
84
+ ```python
85
+ class MultiModelAgent:
86
+ """
87
+ Use different models for different purposes:
88
+ - Fast model for planning
89
+ - Powerful model for complex reasoning
90
+ - Specialized model for code generation
91
+ """
92
+
93
+ def __init__(self):
94
+ self.models = {
95
+ "fast": "gpt-4o-mini", # Quick decisions
96
+ "smart": "gpt-4o", # Complex reasoning
97
+ "code": "claude-3-5-sonnet", # Code generation
98
+ }
99
+
100
+ def select_model(self, task_type: str) -> str:
101
+ model_map = {
102
+ "planning": "fast",
103
+ "analysis": "smart",
104
+ "code": "code"
105
+ }
106
+ return self.models.get(model_map.get(task_type, "smart"))
107
+ ```
108
+
109
+ ---
110
+
111
+ ## 2. Tool Design Patterns
112
+
113
+ ### 2.1 Tool Schema
114
+
115
+ ```python
116
+ @dataclass
117
+ class ToolDefinition:
118
+ name: str
119
+ description: str
120
+ parameters: dict
121
+
122
+ # Metadata for permission system
123
+ risk_level: str = "low" # low, medium, high
124
+ requires_approval: bool = False
125
+ timeout_seconds: int = 30
126
+
127
+ ESSENTIAL_TOOLS = [
128
+ ToolDefinition(
129
+ name="read_file",
130
+ description="Read contents of a file",
131
+ parameters={"path": {"type": "string", "required": True}},
132
+ risk_level="low"
133
+ ),
134
+ ToolDefinition(
135
+ name="write_file",
136
+ description="Write content to a file",
137
+ parameters={
138
+ "path": {"type": "string", "required": True},
139
+ "content": {"type": "string", "required": True}
140
+ },
141
+ risk_level="medium",
142
+ requires_approval=True
143
+ ),
144
+ ToolDefinition(
145
+ name="run_command",
146
+ description="Execute a shell command",
147
+ parameters={"command": {"type": "string", "required": True}},
148
+ risk_level="high",
149
+ requires_approval=True,
150
+ timeout_seconds=60
151
+ )
152
+ ]
153
+ ```
154
+
155
+ ### 2.2 Edit Tool Design
156
+
157
+ ```python
158
+ class EditTool:
159
+ """
160
+ Specialized tool for making targeted file edits.
161
+ Better than full file replace for large files.
162
+ """
163
+
164
+ def apply_edit(
165
+ self,
166
+ file_path: str,
167
+ target_content: str, # Content to find
168
+ replacement: str, # Content to replace with
169
+ start_line: int = None, # Optional line hints
170
+ end_line: int = None
171
+ ) -> ToolResult:
172
+ content = self._read_file(file_path)
173
+
174
+ # Find target content
175
+ if target_content not in content:
176
+ # Try fuzzy matching
177
+ match = self._fuzzy_find(content, target_content)
178
+ if not match:
179
+ return ToolResult(
180
+ success=False,
181
+ error="Target content not found"
182
+ )
183
+ target_content = match
184
+
185
+ # Apply replacement
186
+ new_content = content.replace(target_content, replacement, 1)
187
+
188
+ # Validate (syntax check for code files)
189
+ if not self._validate(file_path, new_content):
190
+ return ToolResult(
191
+ success=False,
192
+ error="Edit would cause syntax error"
193
+ )
194
+
195
+ self._write_file(file_path, new_content)
196
+ return ToolResult(success=True)
197
+ ```
198
+
199
+ ---
200
+
201
+ ## 3. Permission & Safety Patterns
202
+
203
+ ### 3.1 Permission Levels
204
+
205
+ ```python
206
+ class PermissionLevel(Enum):
207
+ AUTO = "auto" # Fully automatic
208
+ ASK_ONCE = "ask_once" # Ask once per session
209
+ ASK_EACH = "ask_each" # Ask every time
210
+ NEVER = "never" # Never allow
211
+
212
+ PERMISSION_CONFIG = {
213
+ # Low risk - auto-approve
214
+ "read_file": PermissionLevel.AUTO,
215
+ "list_directory": PermissionLevel.AUTO,
216
+ "search_code": PermissionLevel.AUTO,
217
+
218
+ # Medium risk - ask once
219
+ "write_file": PermissionLevel.ASK_ONCE,
220
+ "edit_file": PermissionLevel.ASK_ONCE,
221
+
222
+ # High risk - ask each time
223
+ "run_command": PermissionLevel.ASK_EACH,
224
+ "delete_file": PermissionLevel.ASK_EACH,
225
+
226
+ # Dangerous - never auto-approve
227
+ "sudo_command": PermissionLevel.NEVER,
228
+ "format_disk": PermissionLevel.NEVER
229
+ }
230
+ ```
231
+
232
+ ### 3.2 Approval Manager
233
+
234
+ ```python
235
+ class ApprovalManager:
236
+ def __init__(self, ui, config):
237
+ self.ui = ui
238
+ self.config = config
239
+ self.session_approvals = {}
240
+
241
+ def request_approval(self, tool_name: str, args: dict) -> bool:
242
+ level = self.config.get(tool_name, PermissionLevel.ASK_EACH)
243
+
244
+ if level == PermissionLevel.AUTO:
245
+ return True
246
+
247
+ if level == PermissionLevel.NEVER:
248
+ self.ui.show_error(f"Tool '{tool_name}' is not allowed")
249
+ return False
250
+
251
+ if level == PermissionLevel.ASK_ONCE:
252
+ if tool_name in self.session_approvals:
253
+ return self.session_approvals[tool_name]
254
+
255
+ # Show approval dialog
256
+ approved = self.ui.show_approval_dialog(
257
+ tool=tool_name,
258
+ args=args,
259
+ risk_level=self._assess_risk(tool_name, args)
260
+ )
261
+
262
+ if level == PermissionLevel.ASK_ONCE:
263
+ self.session_approvals[tool_name] = approved
264
+
265
+ return approved
266
+ ```
267
+
268
+ ### 3.3 Sandboxing
269
+
270
+ ```python
271
+ class SandboxedExecution:
272
+ """Execute code/commands in isolated environment"""
273
+
274
+ def __init__(self, workspace_dir: str):
275
+ self.workspace = workspace_dir
276
+ self.allowed_commands = ["npm", "python", "node", "git", "ls", "cat"]
277
+ self.blocked_paths = ["/etc", "/usr", "/bin", os.path.expanduser("~")]
278
+
279
+ def validate_path(self, path: str) -> bool:
280
+ """Ensure path is within workspace"""
281
+ real_path = os.path.realpath(path)
282
+ workspace_real = os.path.realpath(self.workspace)
283
+ return real_path.startswith(workspace_real)
284
+
285
+ def validate_command(self, command: str) -> bool:
286
+ """Check if command is allowed"""
287
+ cmd_parts = shlex.split(command)
288
+ if not cmd_parts:
289
+ return False
290
+ return cmd_parts[0] in self.allowed_commands
291
+
292
+ def execute_sandboxed(self, command: str) -> ToolResult:
293
+ if not self.validate_command(command):
294
+ return ToolResult(success=False, error="Command not allowed")
295
+
296
+ result = subprocess.run(
297
+ command,
298
+ shell=True,
299
+ cwd=self.workspace,
300
+ capture_output=True,
301
+ timeout=30,
302
+ env={**os.environ, "HOME": self.workspace}
303
+ )
304
+
305
+ return ToolResult(
306
+ success=result.returncode == 0,
307
+ output=result.stdout.decode(),
308
+ error=result.stderr.decode() if result.returncode != 0 else None
309
+ )
310
+ ```
311
+
312
+ ---
313
+
314
+ ## 4. Context Management
315
+
316
+ ### 4.1 Context Injection Patterns
317
+
318
+ ```python
319
+ class ContextManager:
320
+ """Manage what context the agent sees"""
321
+
322
+ def __init__(self, max_tokens: int = 100000):
323
+ self.max_tokens = max_tokens
324
+ self.priority_order = [
325
+ "system_prompt",
326
+ "user_request",
327
+ "recent_tool_results",
328
+ "relevant_files",
329
+ "conversation_history"
330
+ ]
331
+
332
+ def build_context(self, components: dict) -> list:
333
+ """Build context within token budget"""
334
+ context = []
335
+ remaining_tokens = self.max_tokens
336
+
337
+ for priority in self.priority_order:
338
+ if priority not in components:
339
+ continue
340
+
341
+ content = components[priority]
342
+ tokens = self._count_tokens(content)
343
+
344
+ if tokens <= remaining_tokens:
345
+ context.append(content)
346
+ remaining_tokens -= tokens
347
+ else:
348
+ # Truncate or summarize
349
+ truncated = self._truncate(content, remaining_tokens)
350
+ context.append(truncated)
351
+ break
352
+
353
+ return context
354
+ ```
355
+
356
+ ### 4.2 Checkpoint/Resume
357
+
358
+ ```python
359
+ class AgentCheckpoint:
360
+ """Save and restore agent state"""
361
+
362
+ def save(self, agent_state: dict, checkpoint_id: str):
363
+ checkpoint = {
364
+ "id": checkpoint_id,
365
+ "timestamp": datetime.now().isoformat(),
366
+ "messages": agent_state["messages"],
367
+ "tool_results": agent_state["tool_results"],
368
+ "files_modified": agent_state["files_modified"],
369
+ "current_task": agent_state["current_task"]
370
+ }
371
+
372
+ with open(f".agent/checkpoints/{checkpoint_id}.json", "w") as f:
373
+ json.dump(checkpoint, f)
374
+
375
+ def restore(self, checkpoint_id: str) -> dict:
376
+ with open(f".agent/checkpoints/{checkpoint_id}.json") as f:
377
+ return json.load(f)
378
+
379
+ def list_checkpoints(self) -> list:
380
+ path = Path(".agent/checkpoints")
381
+ return sorted(path.glob("*.json"), key=lambda p: p.stat().st_mtime)
382
+ ```
383
+
384
+ ---
385
+
386
+ ## 5. Best Practices Checklist
387
+
388
+ ### Agent Design
389
+ - ✅ Clear separation: Think → Decide → Act → Observe
390
+ - ✅ Max iteration limits to prevent infinite loops
391
+ - ✅ Multi-model routing for cost/performance
392
+ - ✅ Graceful degradation on errors
393
+
394
+ ### Safety
395
+ - ✅ Permission levels for all tools
396
+ - ✅ Sandboxed command execution
397
+ - ✅ Path validation (no escape from workspace)
398
+ - ✅ Dangerous command blocklist
399
+
400
+ ### UX
401
+ - ✅ Show what agent is thinking
402
+ - ✅ Clear approval dialogs with risk indicators
403
+ - ✅ Ability to cancel/interrupt
404
+ - ✅ Checkpoint/resume for long tasks
405
+
406
+ ---
407
+
408
+ ## Related Skills
409
+
410
+ - `langgraph` - Graph-based agent architecture
411
+ - `crewai` - Multi-agent collaboration
412
+ - `mcp-builder` - MCP server patterns
413
+ - `agent-memory-systems` - Memory architectures
414
+ - `verification-gate` - Verify before claiming done
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: aws-penetration-testing
3
+ description: "Specialized skill for auditing AWS environments. Covers IAM misconfigurations, S3 bucket leaks, CloudTrail evasion, and Lambda exploitation."
4
+ version: "1.0.0"
5
+ ---
6
+
7
+ # ☁️ AWS Penetration Testing
8
+
9
+ You are a Cloud Security auditor. You know that AWS security is 90% IAM and 10% everything else. You focus on finding paths to Privilege Escalation and data exfiltration.
10
+
11
+ ---
12
+
13
+ ## Key Attack Areas
14
+
15
+ ### 1. IAM Misconfigurations
16
+ Finding users or roles with "Over-privileged" permissions.
17
+ - **High Risk**: `iam:PutUserPolicy`, `iam:CreateAccessKey`, `sts:AssumeRole`.
18
+ - **Tool**: `Pacu` (AWS exploitation framework).
19
+
20
+ ### 2. S3 Bucket Leaks
21
+ Publicly accessible buckets containing sensitive data.
22
+ - **Discovery**: `cloud_enum`, `s3scanner`.
23
+ - **Command**: `aws s3 ls s3://target-bucket --no-sign-request`.
24
+
25
+ ### 3. Metadata Service (IMDS) Attacks
26
+ Stealing temporary credentials from an EC2 instance.
27
+ - **Exploit**: SSRF on a web app running on EC2 -> Query `http://169.254.169.254/latest/meta-data/iam/security-credentials/`.
28
+
29
+ ---
30
+
31
+ ## Privilege Escalation Patterns
32
+
33
+ 1. **Policy Attachment**: If you have `iam:AttachUserPolicy`, attach `AdministratorAccess` to yourself.
34
+ 2. **Access Key Creation**: If you have `iam:CreateAccessKey` for another user, create a key and login as them.
35
+ 3. **Lambda Trigger**: Update a Lambda function's code to send you a reverse shell when it's triggered.
36
+
37
+ ---
38
+
39
+ ## Persistence in AWS
40
+ - Create a secondary Access Key for a "quiet" user.
41
+ - Add an external account to a high-privilege Role's Trust Policy.
42
+ - Set up a scheduled Lambda function that pings your C2.
43
+
44
+ ---
45
+
46
+ ## Related Skills
47
+
48
+ - `aws-serverless` - Understanding the architecture
49
+ - `cloud-penetration-testing` - General cloud security
50
+ - `vulnerability-scanner` - Recon tools