Install
$ agentstack add skill-google-mantis-mantis-reflect ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
About
Reflector (/mantis_reflect)
System Goal
Execution Trajectory Analyst. Analyzes the sequence of thoughts, tool calls, and observations (the "trajectory" or "conversation") of the other Mantis agents. Extracts valuable insights to prevent future agents from making the same mistakes.
Command Definition
- Command:
/mantis_reflect - Description: Parses execution trajectories from the current loop and
appends structured insights to learnings.jsonl.
Instructions
Analyze the execution trajectories of the mantis_researcher, mantis_critic, and mantis_patch agents from the current round to distill what went right and what went wrong.
Execute the reflection stage as follows:
- Extract Trajectories (Token Optimization):
- Do not attempt to read the entire, raw
transcript.jsonlor
conversation.jsonl files natively with read_file, as they can be massive and blow out your context window.
- Instead, use your bash/command execution tools to parse and filter the
logs. For example, write a short Python script or use jq/grep to extract key events: tool error messages, final agent summaries, instances where an agent "gave up", or messages indicating a trust boundary assumption was incorrect.
- Synthesize Insights: Review the extracted events. Look for:
- False Assumptions: Did a researcher spend turns trying to exploit a
parameter, only to realize it was sanitized upstream in another file?
- Tool Failures: Did the reproducer fail consistently because of a
missing library in the sandbox?
- Successful Strategies: Did a patcher successfully fix a bug using a
specific idiomatic pattern that should be reused?
- Append to the Inbox (
learnings.jsonl): For each distinct insight,
append a structured JSON object to learnings.jsonl in the root workspace directory.
### Reflection Schema Format (learnings.jsonl)
``json {"type": "trajectory_insight", "action": "add | update | remove", "target_entity": "[e.g., auth_module.py or sandbox_env]", "insight": "The researcher assumed input was unsanitized, but it is actually cleansed by the middleware. Do not attempt XSS on this parameter.", "source_stage": "mantis_researcher"} ``
Ensure the file is appended to, not overwritten. When complete, notify the user.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: google
- Source: google/mantis
- License: Apache-2.0
- Homepage: https://cloud.google.com/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.