@namch/agent-assistant 1.0.0 → 1.0.2
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.
- package/README.md +114 -522
- package/agents/backend-engineer.md +0 -8
- package/agents/brainstormer.md +0 -6
- package/agents/business-analyst.md +0 -5
- package/agents/database-architect.md +0 -6
- package/agents/debugger.md +0 -6
- package/agents/designer.md +0 -5
- package/agents/devops-engineer.md +0 -7
- package/agents/docs-manager.md +0 -6
- package/agents/frontend-engineer.md +0 -7
- package/agents/game-engineer.md +0 -7
- package/agents/mobile-engineer.md +0 -7
- package/agents/performance-engineer.md +0 -7
- package/agents/planner.md +0 -6
- package/agents/project-manager.md +0 -6
- package/agents/researcher.md +0 -5
- package/agents/reviewer.md +0 -6
- package/agents/scouter.md +0 -6
- package/agents/security-engineer.md +0 -7
- package/agents/tech-lead.md +0 -7
- package/agents/tester.md +0 -5
- package/cli/README.md +19 -10
- package/documents/business/business-features.md +1 -1
- package/documents/business/business-prd.md +4 -4
- package/documents/knowledge-architecture.md +1 -1
- package/documents/knowledge-domain.md +1 -1
- package/documents/knowledge-overview.md +14 -29
- package/documents/knowledge-source-base.md +14 -14
- package/package.json +1 -1
- package/rules/QUICK-REFERENCE.md +4 -1
- package/rules/SKILL-DISCOVERY.md +37 -14
- package/skills/active-directory-attacks/SKILL.md +383 -0
- package/skills/active-directory-attacks/references/advanced-attacks.md +382 -0
- package/skills/agent-evaluation/SKILL.md +64 -0
- package/skills/agent-memory-mcp/SKILL.md +82 -0
- package/skills/agent-memory-systems/SKILL.md +67 -0
- package/skills/agent-tool-builder/SKILL.md +53 -0
- package/skills/ai-agents-architect/SKILL.md +90 -0
- package/skills/ai-product/SKILL.md +54 -0
- package/skills/ai-wrapper-product/SKILL.md +273 -0
- package/skills/api-documentation-generator/SKILL.md +484 -0
- package/skills/api-fuzzing-bug-bounty/SKILL.md +433 -0
- package/skills/api-security-best-practices/SKILL.md +907 -0
- package/skills/autonomous-agent-patterns/SKILL.md +761 -0
- package/skills/autonomous-agents/SKILL.md +68 -0
- package/skills/aws-penetration-testing/SKILL.md +405 -0
- package/skills/aws-penetration-testing/references/advanced-aws-pentesting.md +469 -0
- package/skills/azure-functions/SKILL.md +42 -0
- package/skills/backend-dev-guidelines/SKILL.md +342 -0
- package/skills/backend-dev-guidelines/resources/architecture-overview.md +451 -0
- package/skills/backend-dev-guidelines/resources/async-and-errors.md +307 -0
- package/skills/backend-dev-guidelines/resources/complete-examples.md +638 -0
- package/skills/backend-dev-guidelines/resources/configuration.md +275 -0
- package/skills/backend-dev-guidelines/resources/database-patterns.md +224 -0
- package/skills/backend-dev-guidelines/resources/middleware-guide.md +213 -0
- package/skills/backend-dev-guidelines/resources/routing-and-controllers.md +756 -0
- package/skills/backend-dev-guidelines/resources/sentry-and-monitoring.md +336 -0
- package/skills/backend-dev-guidelines/resources/services-and-repositories.md +789 -0
- package/skills/backend-dev-guidelines/resources/testing-guide.md +235 -0
- package/skills/backend-dev-guidelines/resources/validation-patterns.md +754 -0
- package/skills/broken-authentication/SKILL.md +476 -0
- package/skills/bullmq-specialist/SKILL.md +57 -0
- package/skills/bun-development/SKILL.md +691 -0
- package/skills/burp-suite-testing/SKILL.md +380 -0
- package/skills/cloud-penetration-testing/SKILL.md +501 -0
- package/skills/cloud-penetration-testing/references/advanced-cloud-scripts.md +318 -0
- package/skills/computer-use-agents/SKILL.md +315 -0
- package/skills/content-creator/SKILL.md +248 -0
- package/skills/content-creator/assets/content_calendar_template.md +99 -0
- package/skills/content-creator/references/brand_guidelines.md +199 -0
- package/skills/content-creator/references/content_frameworks.md +534 -0
- package/skills/content-creator/references/social_media_optimization.md +317 -0
- package/skills/content-creator/scripts/brand_voice_analyzer.py +185 -0
- package/skills/content-creator/scripts/seo_optimizer.py +419 -0
- package/skills/context-window-management/SKILL.md +53 -0
- package/skills/conversation-memory/SKILL.md +61 -0
- package/skills/copy-editing/SKILL.md +439 -0
- package/skills/copywriting/SKILL.md +225 -0
- package/skills/crewai/SKILL.md +243 -0
- package/skills/discord-bot-architect/SKILL.md +277 -0
- package/skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/email-sequence/SKILL.md +925 -0
- package/skills/email-systems/SKILL.md +54 -0
- package/skills/ethical-hacking-methodology/SKILL.md +466 -0
- package/skills/executing-plans/SKILL.md +76 -0
- package/skills/file-path-traversal/SKILL.md +486 -0
- package/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/frontend-dev-guidelines/SKILL.md +359 -0
- package/skills/frontend-dev-guidelines/resources/common-patterns.md +331 -0
- package/skills/frontend-dev-guidelines/resources/complete-examples.md +872 -0
- package/skills/frontend-dev-guidelines/resources/component-patterns.md +502 -0
- package/skills/frontend-dev-guidelines/resources/data-fetching.md +767 -0
- package/skills/frontend-dev-guidelines/resources/file-organization.md +502 -0
- package/skills/frontend-dev-guidelines/resources/loading-and-error-states.md +501 -0
- package/skills/frontend-dev-guidelines/resources/performance.md +406 -0
- package/skills/frontend-dev-guidelines/resources/routing-guide.md +364 -0
- package/skills/frontend-dev-guidelines/resources/styling-guide.md +428 -0
- package/skills/frontend-dev-guidelines/resources/typescript-standards.md +418 -0
- package/skills/gcp-cloud-run/SKILL.md +288 -0
- package/skills/git-pushing/SKILL.md +33 -0
- package/skills/git-pushing/scripts/smart_commit.sh +19 -0
- package/skills/github-workflow-automation/SKILL.md +846 -0
- package/skills/html-injection-testing/SKILL.md +498 -0
- package/skills/idor-testing/SKILL.md +442 -0
- package/skills/inngest/SKILL.md +55 -0
- package/skills/javascript-mastery/SKILL.md +645 -0
- package/skills/kaizen/SKILL.md +730 -0
- package/skills/langfuse/SKILL.md +238 -0
- package/skills/langgraph/SKILL.md +287 -0
- package/skills/linux-privilege-escalation/SKILL.md +504 -0
- package/skills/llm-app-patterns/SKILL.md +760 -0
- package/skills/metasploit-framework/SKILL.md +478 -0
- package/skills/multi-agent-brainstorming/SKILL.md +256 -0
- package/skills/neon-postgres/SKILL.md +56 -0
- package/skills/nextjs-supabase-auth/SKILL.md +56 -0
- package/skills/nosql-expert/SKILL.md +111 -0
- package/skills/pentest-checklist/SKILL.md +334 -0
- package/skills/pentest-commands/SKILL.md +438 -0
- package/skills/plaid-fintech/SKILL.md +50 -0
- package/skills/planning-with-files/SKILL.md +211 -0
- package/skills/planning-with-files/examples.md +202 -0
- package/skills/planning-with-files/reference.md +218 -0
- package/skills/planning-with-files/scripts/check-complete.sh +44 -0
- package/skills/planning-with-files/scripts/init-session.sh +120 -0
- package/skills/planning-with-files/templates/findings.md +95 -0
- package/skills/planning-with-files/templates/progress.md +114 -0
- package/skills/planning-with-files/templates/task_plan.md +132 -0
- package/skills/privilege-escalation-methods/SKILL.md +333 -0
- package/skills/production-code-audit/SKILL.md +540 -0
- package/skills/prompt-caching/SKILL.md +61 -0
- package/skills/prompt-engineering/SKILL.md +171 -0
- package/skills/prompt-library/SKILL.md +322 -0
- package/skills/rag-engineer/SKILL.md +90 -0
- package/skills/rag-implementation/SKILL.md +63 -0
- package/skills/react-ui-patterns/SKILL.md +289 -0
- package/skills/red-team-tools/SKILL.md +310 -0
- package/skills/scanning-tools/SKILL.md +589 -0
- package/skills/shodan-reconnaissance/SKILL.md +503 -0
- package/skills/slack-bot-builder/SKILL.md +264 -0
- package/skills/smtp-penetration-testing/SKILL.md +500 -0
- package/skills/social-content/SKILL.md +807 -0
- package/skills/software-architecture/SKILL.md +75 -0
- package/skills/sql-injection-testing/SKILL.md +448 -0
- package/skills/sqlmap-database-pentesting/SKILL.md +400 -0
- package/skills/ssh-penetration-testing/SKILL.md +488 -0
- package/skills/stripe-integration/SKILL.md +69 -0
- package/skills/subagent-driven-development/SKILL.md +240 -0
- package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/skills/subagent-driven-development/implementer-prompt.md +78 -0
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/tavily-web/SKILL.md +36 -0
- package/skills/telegram-bot-builder/SKILL.md +254 -0
- package/skills/test-driven-development/SKILL.md +371 -0
- package/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/test-fixing/SKILL.md +119 -0
- package/skills/top-web-vulnerabilities/SKILL.md +543 -0
- package/skills/trigger-dev/SKILL.md +67 -0
- package/skills/twilio-communications/SKILL.md +295 -0
- package/skills/upstash-qstash/SKILL.md +68 -0
- package/skills/verification-before-completion/SKILL.md +139 -0
- package/skills/voice-agents/SKILL.md +68 -0
- package/skills/voice-ai-development/SKILL.md +302 -0
- package/skills/windows-privilege-escalation/SKILL.md +496 -0
- package/skills/wireshark-analysis/SKILL.md +497 -0
- package/skills/wordpress-penetration-testing/SKILL.md +485 -0
- package/skills/workflow-automation/SKILL.md +68 -0
- package/skills/xss-html-injection/SKILL.md +499 -0
- package/skills/zapier-make-patterns/SKILL.md +67 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Examples: Planning with Files in Action
|
|
2
|
+
|
|
3
|
+
## Example 1: Research Task
|
|
4
|
+
|
|
5
|
+
**User Request:** "Research the benefits of morning exercise and write a summary"
|
|
6
|
+
|
|
7
|
+
### Loop 1: Create Plan
|
|
8
|
+
```bash
|
|
9
|
+
Write task_plan.md
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
# Task Plan: Morning Exercise Benefits Research
|
|
14
|
+
|
|
15
|
+
## Goal
|
|
16
|
+
Create a research summary on the benefits of morning exercise.
|
|
17
|
+
|
|
18
|
+
## Phases
|
|
19
|
+
- [ ] Phase 1: Create this plan ✓
|
|
20
|
+
- [ ] Phase 2: Search and gather sources
|
|
21
|
+
- [ ] Phase 3: Synthesize findings
|
|
22
|
+
- [ ] Phase 4: Deliver summary
|
|
23
|
+
|
|
24
|
+
## Key Questions
|
|
25
|
+
1. What are the physical health benefits?
|
|
26
|
+
2. What are the mental health benefits?
|
|
27
|
+
3. What scientific studies support this?
|
|
28
|
+
|
|
29
|
+
## Status
|
|
30
|
+
**Currently in Phase 1** - Creating plan
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Loop 2: Research
|
|
34
|
+
```bash
|
|
35
|
+
Read task_plan.md # Refresh goals
|
|
36
|
+
WebSearch "morning exercise benefits"
|
|
37
|
+
Write notes.md # Store findings
|
|
38
|
+
Edit task_plan.md # Mark Phase 2 complete
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Loop 3: Synthesize
|
|
42
|
+
```bash
|
|
43
|
+
Read task_plan.md # Refresh goals
|
|
44
|
+
Read notes.md # Get findings
|
|
45
|
+
Write morning_exercise_summary.md
|
|
46
|
+
Edit task_plan.md # Mark Phase 3 complete
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Loop 4: Deliver
|
|
50
|
+
```bash
|
|
51
|
+
Read task_plan.md # Verify complete
|
|
52
|
+
Deliver morning_exercise_summary.md
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Example 2: Bug Fix Task
|
|
58
|
+
|
|
59
|
+
**User Request:** "Fix the login bug in the authentication module"
|
|
60
|
+
|
|
61
|
+
### task_plan.md
|
|
62
|
+
```markdown
|
|
63
|
+
# Task Plan: Fix Login Bug
|
|
64
|
+
|
|
65
|
+
## Goal
|
|
66
|
+
Identify and fix the bug preventing successful login.
|
|
67
|
+
|
|
68
|
+
## Phases
|
|
69
|
+
- [x] Phase 1: Understand the bug report ✓
|
|
70
|
+
- [x] Phase 2: Locate relevant code ✓
|
|
71
|
+
- [ ] Phase 3: Identify root cause (CURRENT)
|
|
72
|
+
- [ ] Phase 4: Implement fix
|
|
73
|
+
- [ ] Phase 5: Test and verify
|
|
74
|
+
|
|
75
|
+
## Key Questions
|
|
76
|
+
1. What error message appears?
|
|
77
|
+
2. Which file handles authentication?
|
|
78
|
+
3. What changed recently?
|
|
79
|
+
|
|
80
|
+
## Decisions Made
|
|
81
|
+
- Auth handler is in src/auth/login.ts
|
|
82
|
+
- Error occurs in validateToken() function
|
|
83
|
+
|
|
84
|
+
## Errors Encountered
|
|
85
|
+
- [Initial] TypeError: Cannot read property 'token' of undefined
|
|
86
|
+
→ Root cause: user object not awaited properly
|
|
87
|
+
|
|
88
|
+
## Status
|
|
89
|
+
**Currently in Phase 3** - Found root cause, preparing fix
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Example 3: Feature Development
|
|
95
|
+
|
|
96
|
+
**User Request:** "Add a dark mode toggle to the settings page"
|
|
97
|
+
|
|
98
|
+
### The 3-File Pattern in Action
|
|
99
|
+
|
|
100
|
+
**task_plan.md:**
|
|
101
|
+
```markdown
|
|
102
|
+
# Task Plan: Dark Mode Toggle
|
|
103
|
+
|
|
104
|
+
## Goal
|
|
105
|
+
Add functional dark mode toggle to settings.
|
|
106
|
+
|
|
107
|
+
## Phases
|
|
108
|
+
- [x] Phase 1: Research existing theme system ✓
|
|
109
|
+
- [x] Phase 2: Design implementation approach ✓
|
|
110
|
+
- [ ] Phase 3: Implement toggle component (CURRENT)
|
|
111
|
+
- [ ] Phase 4: Add theme switching logic
|
|
112
|
+
- [ ] Phase 5: Test and polish
|
|
113
|
+
|
|
114
|
+
## Decisions Made
|
|
115
|
+
- Using CSS custom properties for theme
|
|
116
|
+
- Storing preference in localStorage
|
|
117
|
+
- Toggle component in SettingsPage.tsx
|
|
118
|
+
|
|
119
|
+
## Status
|
|
120
|
+
**Currently in Phase 3** - Building toggle component
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**notes.md:**
|
|
124
|
+
```markdown
|
|
125
|
+
# Notes: Dark Mode Implementation
|
|
126
|
+
|
|
127
|
+
## Existing Theme System
|
|
128
|
+
- Located in: src/styles/theme.ts
|
|
129
|
+
- Uses: CSS custom properties
|
|
130
|
+
- Current themes: light only
|
|
131
|
+
|
|
132
|
+
## Files to Modify
|
|
133
|
+
1. src/styles/theme.ts - Add dark theme colors
|
|
134
|
+
2. src/components/SettingsPage.tsx - Add toggle
|
|
135
|
+
3. src/hooks/useTheme.ts - Create new hook
|
|
136
|
+
4. src/App.tsx - Wrap with ThemeProvider
|
|
137
|
+
|
|
138
|
+
## Color Decisions
|
|
139
|
+
- Dark background: #1a1a2e
|
|
140
|
+
- Dark surface: #16213e
|
|
141
|
+
- Dark text: #eaeaea
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**dark_mode_implementation.md:** (deliverable)
|
|
145
|
+
```markdown
|
|
146
|
+
# Dark Mode Implementation
|
|
147
|
+
|
|
148
|
+
## Changes Made
|
|
149
|
+
|
|
150
|
+
### 1. Added dark theme colors
|
|
151
|
+
File: src/styles/theme.ts
|
|
152
|
+
...
|
|
153
|
+
|
|
154
|
+
### 2. Created useTheme hook
|
|
155
|
+
File: src/hooks/useTheme.ts
|
|
156
|
+
...
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Example 4: Error Recovery Pattern
|
|
162
|
+
|
|
163
|
+
When something fails, DON'T hide it:
|
|
164
|
+
|
|
165
|
+
### Before (Wrong)
|
|
166
|
+
```
|
|
167
|
+
Action: Read config.json
|
|
168
|
+
Error: File not found
|
|
169
|
+
Action: Read config.json # Silent retry
|
|
170
|
+
Action: Read config.json # Another retry
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### After (Correct)
|
|
174
|
+
```
|
|
175
|
+
Action: Read config.json
|
|
176
|
+
Error: File not found
|
|
177
|
+
|
|
178
|
+
# Update task_plan.md:
|
|
179
|
+
## Errors Encountered
|
|
180
|
+
- config.json not found → Will create default config
|
|
181
|
+
|
|
182
|
+
Action: Write config.json (default config)
|
|
183
|
+
Action: Read config.json
|
|
184
|
+
Success!
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## The Read-Before-Decide Pattern
|
|
190
|
+
|
|
191
|
+
**Always read your plan before major decisions:**
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
[Many tool calls have happened...]
|
|
195
|
+
[Context is getting long...]
|
|
196
|
+
[Original goal might be forgotten...]
|
|
197
|
+
|
|
198
|
+
→ Read task_plan.md # This brings goals back into attention!
|
|
199
|
+
→ Now make the decision # Goals are fresh in context
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
This is why Manus can handle ~50 tool calls without losing track. The plan file acts as a "goal refresh" mechanism.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Reference: Manus Context Engineering Principles
|
|
2
|
+
|
|
3
|
+
This skill is based on context engineering principles from Manus, the AI agent company acquired by Meta for $2 billion in December 2025.
|
|
4
|
+
|
|
5
|
+
## The 6 Manus Principles
|
|
6
|
+
|
|
7
|
+
### Principle 1: Design Around KV-Cache
|
|
8
|
+
|
|
9
|
+
> "KV-cache hit rate is THE single most important metric for production AI agents."
|
|
10
|
+
|
|
11
|
+
**Statistics:**
|
|
12
|
+
- ~100:1 input-to-output token ratio
|
|
13
|
+
- Cached tokens: $0.30/MTok vs Uncached: $3/MTok
|
|
14
|
+
- 10x cost difference!
|
|
15
|
+
|
|
16
|
+
**Implementation:**
|
|
17
|
+
- Keep prompt prefixes STABLE (single-token change invalidates cache)
|
|
18
|
+
- NO timestamps in system prompts
|
|
19
|
+
- Make context APPEND-ONLY with deterministic serialization
|
|
20
|
+
|
|
21
|
+
### Principle 2: Mask, Don't Remove
|
|
22
|
+
|
|
23
|
+
Don't dynamically remove tools (breaks KV-cache). Use logit masking instead.
|
|
24
|
+
|
|
25
|
+
**Best Practice:** Use consistent action prefixes (e.g., `browser_`, `shell_`, `file_`) for easier masking.
|
|
26
|
+
|
|
27
|
+
### Principle 3: Filesystem as External Memory
|
|
28
|
+
|
|
29
|
+
> "Markdown is my 'working memory' on disk."
|
|
30
|
+
|
|
31
|
+
**The Formula:**
|
|
32
|
+
```
|
|
33
|
+
Context Window = RAM (volatile, limited)
|
|
34
|
+
Filesystem = Disk (persistent, unlimited)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Compression Must Be Restorable:**
|
|
38
|
+
- Keep URLs even if web content is dropped
|
|
39
|
+
- Keep file paths when dropping document contents
|
|
40
|
+
- Never lose the pointer to full data
|
|
41
|
+
|
|
42
|
+
### Principle 4: Manipulate Attention Through Recitation
|
|
43
|
+
|
|
44
|
+
> "Creates and updates todo.md throughout tasks to push global plan into model's recent attention span."
|
|
45
|
+
|
|
46
|
+
**Problem:** After ~50 tool calls, models forget original goals ("lost in the middle" effect).
|
|
47
|
+
|
|
48
|
+
**Solution:** Re-read `task_plan.md` before each decision. Goals appear in the attention window.
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
Start of context: [Original goal - far away, forgotten]
|
|
52
|
+
...many tool calls...
|
|
53
|
+
End of context: [Recently read task_plan.md - gets ATTENTION!]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Principle 5: Keep the Wrong Stuff In
|
|
57
|
+
|
|
58
|
+
> "Leave the wrong turns in the context."
|
|
59
|
+
|
|
60
|
+
**Why:**
|
|
61
|
+
- Failed actions with stack traces let model implicitly update beliefs
|
|
62
|
+
- Reduces mistake repetition
|
|
63
|
+
- Error recovery is "one of the clearest signals of TRUE agentic behavior"
|
|
64
|
+
|
|
65
|
+
### Principle 6: Don't Get Few-Shotted
|
|
66
|
+
|
|
67
|
+
> "Uniformity breeds fragility."
|
|
68
|
+
|
|
69
|
+
**Problem:** Repetitive action-observation pairs cause drift and hallucination.
|
|
70
|
+
|
|
71
|
+
**Solution:** Introduce controlled variation:
|
|
72
|
+
- Vary phrasings slightly
|
|
73
|
+
- Don't copy-paste patterns blindly
|
|
74
|
+
- Recalibrate on repetitive tasks
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## The 3 Context Engineering Strategies
|
|
79
|
+
|
|
80
|
+
Based on Lance Martin's analysis of Manus architecture.
|
|
81
|
+
|
|
82
|
+
### Strategy 1: Context Reduction
|
|
83
|
+
|
|
84
|
+
**Compaction:**
|
|
85
|
+
```
|
|
86
|
+
Tool calls have TWO representations:
|
|
87
|
+
├── FULL: Raw tool content (stored in filesystem)
|
|
88
|
+
└── COMPACT: Reference/file path only
|
|
89
|
+
|
|
90
|
+
RULES:
|
|
91
|
+
- Apply compaction to STALE (older) tool results
|
|
92
|
+
- Keep RECENT results FULL (to guide next decision)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Summarization:**
|
|
96
|
+
- Applied when compaction reaches diminishing returns
|
|
97
|
+
- Generated using full tool results
|
|
98
|
+
- Creates standardized summary objects
|
|
99
|
+
|
|
100
|
+
### Strategy 2: Context Isolation (Multi-Agent)
|
|
101
|
+
|
|
102
|
+
**Architecture:**
|
|
103
|
+
```
|
|
104
|
+
┌─────────────────────────────────┐
|
|
105
|
+
│ PLANNER AGENT │
|
|
106
|
+
│ └─ Assigns tasks to sub-agents │
|
|
107
|
+
├─────────────────────────────────┤
|
|
108
|
+
│ KNOWLEDGE MANAGER │
|
|
109
|
+
│ └─ Reviews conversations │
|
|
110
|
+
│ └─ Determines filesystem store │
|
|
111
|
+
├─────────────────────────────────┤
|
|
112
|
+
│ EXECUTOR SUB-AGENTS │
|
|
113
|
+
│ └─ Perform assigned tasks │
|
|
114
|
+
│ └─ Have own context windows │
|
|
115
|
+
└─────────────────────────────────┘
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Key Insight:** Manus originally used `todo.md` for task planning but found ~33% of actions were spent updating it. Shifted to dedicated planner agent calling executor sub-agents.
|
|
119
|
+
|
|
120
|
+
### Strategy 3: Context Offloading
|
|
121
|
+
|
|
122
|
+
**Tool Design:**
|
|
123
|
+
- Use <20 atomic functions total
|
|
124
|
+
- Store full results in filesystem, not context
|
|
125
|
+
- Use `glob` and `grep` for searching
|
|
126
|
+
- Progressive disclosure: load information only as needed
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## The Agent Loop
|
|
131
|
+
|
|
132
|
+
Manus operates in a continuous 7-step loop:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
┌─────────────────────────────────────────┐
|
|
136
|
+
│ 1. ANALYZE CONTEXT │
|
|
137
|
+
│ - Understand user intent │
|
|
138
|
+
│ - Assess current state │
|
|
139
|
+
│ - Review recent observations │
|
|
140
|
+
├─────────────────────────────────────────┤
|
|
141
|
+
│ 2. THINK │
|
|
142
|
+
│ - Should I update the plan? │
|
|
143
|
+
│ - What's the next logical action? │
|
|
144
|
+
│ - Are there blockers? │
|
|
145
|
+
├─────────────────────────────────────────┤
|
|
146
|
+
│ 3. SELECT TOOL │
|
|
147
|
+
│ - Choose ONE tool │
|
|
148
|
+
│ - Ensure parameters available │
|
|
149
|
+
├─────────────────────────────────────────┤
|
|
150
|
+
│ 4. EXECUTE ACTION │
|
|
151
|
+
│ - Tool runs in sandbox │
|
|
152
|
+
├─────────────────────────────────────────┤
|
|
153
|
+
│ 5. RECEIVE OBSERVATION │
|
|
154
|
+
│ - Result appended to context │
|
|
155
|
+
├─────────────────────────────────────────┤
|
|
156
|
+
│ 6. ITERATE │
|
|
157
|
+
│ - Return to step 1 │
|
|
158
|
+
│ - Continue until complete │
|
|
159
|
+
├─────────────────────────────────────────┤
|
|
160
|
+
│ 7. DELIVER OUTCOME │
|
|
161
|
+
│ - Send results to user │
|
|
162
|
+
│ - Attach all relevant files │
|
|
163
|
+
└─────────────────────────────────────────┘
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## File Types Manus Creates
|
|
169
|
+
|
|
170
|
+
| File | Purpose | When Created | When Updated |
|
|
171
|
+
|------|---------|--------------|--------------|
|
|
172
|
+
| `task_plan.md` | Phase tracking, progress | Task start | After completing phases |
|
|
173
|
+
| `findings.md` | Discoveries, decisions | After ANY discovery | After viewing images/PDFs |
|
|
174
|
+
| `progress.md` | Session log, what's done | At breakpoints | Throughout session |
|
|
175
|
+
| Code files | Implementation | Before execution | After errors |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Critical Constraints
|
|
180
|
+
|
|
181
|
+
- **Single-Action Execution:** ONE tool call per turn. No parallel execution.
|
|
182
|
+
- **Plan is Required:** Agent must ALWAYS know: goal, current phase, remaining phases
|
|
183
|
+
- **Files are Memory:** Context = volatile. Filesystem = persistent.
|
|
184
|
+
- **Never Repeat Failures:** If action failed, next action MUST be different
|
|
185
|
+
- **Communication is a Tool:** Message types: `info` (progress), `ask` (blocking), `result` (terminal)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Manus Statistics
|
|
190
|
+
|
|
191
|
+
| Metric | Value |
|
|
192
|
+
|--------|-------|
|
|
193
|
+
| Average tool calls per task | ~50 |
|
|
194
|
+
| Input-to-output token ratio | 100:1 |
|
|
195
|
+
| Acquisition price | $2 billion |
|
|
196
|
+
| Time to $100M revenue | 8 months |
|
|
197
|
+
| Framework refactors since launch | 5 times |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Key Quotes
|
|
202
|
+
|
|
203
|
+
> "Context window = RAM (volatile, limited). Filesystem = Disk (persistent, unlimited). Anything important gets written to disk."
|
|
204
|
+
|
|
205
|
+
> "if action_failed: next_action != same_action. Track what you tried. Mutate the approach."
|
|
206
|
+
|
|
207
|
+
> "Error recovery is one of the clearest signals of TRUE agentic behavior."
|
|
208
|
+
|
|
209
|
+
> "KV-cache hit rate is the single most important metric for a production-stage AI agent."
|
|
210
|
+
|
|
211
|
+
> "Leave the wrong turns in the context."
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Source
|
|
216
|
+
|
|
217
|
+
Based on Manus's official context engineering documentation:
|
|
218
|
+
https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Check if all phases in task_plan.md are complete
|
|
3
|
+
# Exit 0 if complete, exit 1 if incomplete
|
|
4
|
+
# Used by Stop hook to verify task completion
|
|
5
|
+
|
|
6
|
+
PLAN_FILE="${1:-task_plan.md}"
|
|
7
|
+
|
|
8
|
+
if [ ! -f "$PLAN_FILE" ]; then
|
|
9
|
+
echo "ERROR: $PLAN_FILE not found"
|
|
10
|
+
echo "Cannot verify completion without a task plan."
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
echo "=== Task Completion Check ==="
|
|
15
|
+
echo ""
|
|
16
|
+
|
|
17
|
+
# Count phases by status (using -F for fixed string matching)
|
|
18
|
+
TOTAL=$(grep -c "### Phase" "$PLAN_FILE" || true)
|
|
19
|
+
COMPLETE=$(grep -cF "**Status:** complete" "$PLAN_FILE" || true)
|
|
20
|
+
IN_PROGRESS=$(grep -cF "**Status:** in_progress" "$PLAN_FILE" || true)
|
|
21
|
+
PENDING=$(grep -cF "**Status:** pending" "$PLAN_FILE" || true)
|
|
22
|
+
|
|
23
|
+
# Default to 0 if empty
|
|
24
|
+
: "${TOTAL:=0}"
|
|
25
|
+
: "${COMPLETE:=0}"
|
|
26
|
+
: "${IN_PROGRESS:=0}"
|
|
27
|
+
: "${PENDING:=0}"
|
|
28
|
+
|
|
29
|
+
echo "Total phases: $TOTAL"
|
|
30
|
+
echo "Complete: $COMPLETE"
|
|
31
|
+
echo "In progress: $IN_PROGRESS"
|
|
32
|
+
echo "Pending: $PENDING"
|
|
33
|
+
echo ""
|
|
34
|
+
|
|
35
|
+
# Check completion
|
|
36
|
+
if [ "$COMPLETE" -eq "$TOTAL" ] && [ "$TOTAL" -gt 0 ]; then
|
|
37
|
+
echo "ALL PHASES COMPLETE"
|
|
38
|
+
exit 0
|
|
39
|
+
else
|
|
40
|
+
echo "TASK NOT COMPLETE"
|
|
41
|
+
echo ""
|
|
42
|
+
echo "Do not stop until all phases are complete."
|
|
43
|
+
exit 1
|
|
44
|
+
fi
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Initialize planning files for a new session
|
|
3
|
+
# Usage: ./init-session.sh [project-name]
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
PROJECT_NAME="${1:-project}"
|
|
8
|
+
DATE=$(date +%Y-%m-%d)
|
|
9
|
+
|
|
10
|
+
echo "Initializing planning files for: $PROJECT_NAME"
|
|
11
|
+
|
|
12
|
+
# Create task_plan.md if it doesn't exist
|
|
13
|
+
if [ ! -f "task_plan.md" ]; then
|
|
14
|
+
cat > task_plan.md << 'EOF'
|
|
15
|
+
# Task Plan: [Brief Description]
|
|
16
|
+
|
|
17
|
+
## Goal
|
|
18
|
+
[One sentence describing the end state]
|
|
19
|
+
|
|
20
|
+
## Current Phase
|
|
21
|
+
Phase 1
|
|
22
|
+
|
|
23
|
+
## Phases
|
|
24
|
+
|
|
25
|
+
### Phase 1: Requirements & Discovery
|
|
26
|
+
- [ ] Understand user intent
|
|
27
|
+
- [ ] Identify constraints
|
|
28
|
+
- [ ] Document in findings.md
|
|
29
|
+
- **Status:** in_progress
|
|
30
|
+
|
|
31
|
+
### Phase 2: Planning & Structure
|
|
32
|
+
- [ ] Define approach
|
|
33
|
+
- [ ] Create project structure
|
|
34
|
+
- **Status:** pending
|
|
35
|
+
|
|
36
|
+
### Phase 3: Implementation
|
|
37
|
+
- [ ] Execute the plan
|
|
38
|
+
- [ ] Write to files before executing
|
|
39
|
+
- **Status:** pending
|
|
40
|
+
|
|
41
|
+
### Phase 4: Testing & Verification
|
|
42
|
+
- [ ] Verify requirements met
|
|
43
|
+
- [ ] Document test results
|
|
44
|
+
- **Status:** pending
|
|
45
|
+
|
|
46
|
+
### Phase 5: Delivery
|
|
47
|
+
- [ ] Review outputs
|
|
48
|
+
- [ ] Deliver to user
|
|
49
|
+
- **Status:** pending
|
|
50
|
+
|
|
51
|
+
## Decisions Made
|
|
52
|
+
| Decision | Rationale |
|
|
53
|
+
|----------|-----------|
|
|
54
|
+
|
|
55
|
+
## Errors Encountered
|
|
56
|
+
| Error | Resolution |
|
|
57
|
+
|-------|------------|
|
|
58
|
+
EOF
|
|
59
|
+
echo "Created task_plan.md"
|
|
60
|
+
else
|
|
61
|
+
echo "task_plan.md already exists, skipping"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# Create findings.md if it doesn't exist
|
|
65
|
+
if [ ! -f "findings.md" ]; then
|
|
66
|
+
cat > findings.md << 'EOF'
|
|
67
|
+
# Findings & Decisions
|
|
68
|
+
|
|
69
|
+
## Requirements
|
|
70
|
+
-
|
|
71
|
+
|
|
72
|
+
## Research Findings
|
|
73
|
+
-
|
|
74
|
+
|
|
75
|
+
## Technical Decisions
|
|
76
|
+
| Decision | Rationale |
|
|
77
|
+
|----------|-----------|
|
|
78
|
+
|
|
79
|
+
## Issues Encountered
|
|
80
|
+
| Issue | Resolution |
|
|
81
|
+
|-------|------------|
|
|
82
|
+
|
|
83
|
+
## Resources
|
|
84
|
+
-
|
|
85
|
+
EOF
|
|
86
|
+
echo "Created findings.md"
|
|
87
|
+
else
|
|
88
|
+
echo "findings.md already exists, skipping"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# Create progress.md if it doesn't exist
|
|
92
|
+
if [ ! -f "progress.md" ]; then
|
|
93
|
+
cat > progress.md << EOF
|
|
94
|
+
# Progress Log
|
|
95
|
+
|
|
96
|
+
## Session: $DATE
|
|
97
|
+
|
|
98
|
+
### Current Status
|
|
99
|
+
- **Phase:** 1 - Requirements & Discovery
|
|
100
|
+
- **Started:** $DATE
|
|
101
|
+
|
|
102
|
+
### Actions Taken
|
|
103
|
+
-
|
|
104
|
+
|
|
105
|
+
### Test Results
|
|
106
|
+
| Test | Expected | Actual | Status |
|
|
107
|
+
|------|----------|--------|--------|
|
|
108
|
+
|
|
109
|
+
### Errors
|
|
110
|
+
| Error | Resolution |
|
|
111
|
+
|-------|------------|
|
|
112
|
+
EOF
|
|
113
|
+
echo "Created progress.md"
|
|
114
|
+
else
|
|
115
|
+
echo "progress.md already exists, skipping"
|
|
116
|
+
fi
|
|
117
|
+
|
|
118
|
+
echo ""
|
|
119
|
+
echo "Planning files initialized!"
|
|
120
|
+
echo "Files: task_plan.md, findings.md, progress.md"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Findings & Decisions
|
|
2
|
+
<!--
|
|
3
|
+
WHAT: Your knowledge base for the task. Stores everything you discover and decide.
|
|
4
|
+
WHY: Context windows are limited. This file is your "external memory" - persistent and unlimited.
|
|
5
|
+
WHEN: Update after ANY discovery, especially after 2 view/browser/search operations (2-Action Rule).
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
## Requirements
|
|
9
|
+
<!--
|
|
10
|
+
WHAT: What the user asked for, broken down into specific requirements.
|
|
11
|
+
WHY: Keeps requirements visible so you don't forget what you're building.
|
|
12
|
+
WHEN: Fill this in during Phase 1 (Requirements & Discovery).
|
|
13
|
+
EXAMPLE:
|
|
14
|
+
- Command-line interface
|
|
15
|
+
- Add tasks
|
|
16
|
+
- List all tasks
|
|
17
|
+
- Delete tasks
|
|
18
|
+
- Python implementation
|
|
19
|
+
-->
|
|
20
|
+
<!-- Captured from user request -->
|
|
21
|
+
-
|
|
22
|
+
|
|
23
|
+
## Research Findings
|
|
24
|
+
<!--
|
|
25
|
+
WHAT: Key discoveries from web searches, documentation reading, or exploration.
|
|
26
|
+
WHY: Multimodal content (images, browser results) doesn't persist. Write it down immediately.
|
|
27
|
+
WHEN: After EVERY 2 view/browser/search operations, update this section (2-Action Rule).
|
|
28
|
+
EXAMPLE:
|
|
29
|
+
- Python's argparse module supports subcommands for clean CLI design
|
|
30
|
+
- JSON module handles file persistence easily
|
|
31
|
+
- Standard pattern: python script.py <command> [args]
|
|
32
|
+
-->
|
|
33
|
+
<!-- Key discoveries during exploration -->
|
|
34
|
+
-
|
|
35
|
+
|
|
36
|
+
## Technical Decisions
|
|
37
|
+
<!--
|
|
38
|
+
WHAT: Architecture and implementation choices you've made, with reasoning.
|
|
39
|
+
WHY: You'll forget why you chose a technology or approach. This table preserves that knowledge.
|
|
40
|
+
WHEN: Update whenever you make a significant technical choice.
|
|
41
|
+
EXAMPLE:
|
|
42
|
+
| Use JSON for storage | Simple, human-readable, built-in Python support |
|
|
43
|
+
| argparse with subcommands | Clean CLI: python todo.py add "task" |
|
|
44
|
+
-->
|
|
45
|
+
<!-- Decisions made with rationale -->
|
|
46
|
+
| Decision | Rationale |
|
|
47
|
+
|----------|-----------|
|
|
48
|
+
| | |
|
|
49
|
+
|
|
50
|
+
## Issues Encountered
|
|
51
|
+
<!--
|
|
52
|
+
WHAT: Problems you ran into and how you solved them.
|
|
53
|
+
WHY: Similar to errors in task_plan.md, but focused on broader issues (not just code errors).
|
|
54
|
+
WHEN: Document when you encounter blockers or unexpected challenges.
|
|
55
|
+
EXAMPLE:
|
|
56
|
+
| Empty file causes JSONDecodeError | Added explicit empty file check before json.load() |
|
|
57
|
+
-->
|
|
58
|
+
<!-- Errors and how they were resolved -->
|
|
59
|
+
| Issue | Resolution |
|
|
60
|
+
|-------|------------|
|
|
61
|
+
| | |
|
|
62
|
+
|
|
63
|
+
## Resources
|
|
64
|
+
<!--
|
|
65
|
+
WHAT: URLs, file paths, API references, documentation links you've found useful.
|
|
66
|
+
WHY: Easy reference for later. Don't lose important links in context.
|
|
67
|
+
WHEN: Add as you discover useful resources.
|
|
68
|
+
EXAMPLE:
|
|
69
|
+
- Python argparse docs: https://docs.python.org/3/library/argparse.html
|
|
70
|
+
- Project structure: src/main.py, src/utils.py
|
|
71
|
+
-->
|
|
72
|
+
<!-- URLs, file paths, API references -->
|
|
73
|
+
-
|
|
74
|
+
|
|
75
|
+
## Visual/Browser Findings
|
|
76
|
+
<!--
|
|
77
|
+
WHAT: Information you learned from viewing images, PDFs, or browser results.
|
|
78
|
+
WHY: CRITICAL - Visual/multimodal content doesn't persist in context. Must be captured as text.
|
|
79
|
+
WHEN: IMMEDIATELY after viewing images or browser results. Don't wait!
|
|
80
|
+
EXAMPLE:
|
|
81
|
+
- Screenshot shows login form has email and password fields
|
|
82
|
+
- Browser shows API returns JSON with "status" and "data" keys
|
|
83
|
+
-->
|
|
84
|
+
<!-- CRITICAL: Update after every 2 view/browser operations -->
|
|
85
|
+
<!-- Multimodal content must be captured as text immediately -->
|
|
86
|
+
-
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
<!--
|
|
90
|
+
REMINDER: The 2-Action Rule
|
|
91
|
+
After every 2 view/browser/search operations, you MUST update this file.
|
|
92
|
+
This prevents visual information from being lost when context resets.
|
|
93
|
+
-->
|
|
94
|
+
*Update this file after every 2 view/browser/search operations*
|
|
95
|
+
*This prevents visual information from being lost*
|