···1+---
2+description: Analyze Current Product & Install Agent OS
3+globs:
4+alwaysApply: false
5+version: 1.0
6+encoding: UTF-8
7+---
8+9+# Analyze Current Product & Install Agent OS
10+11+## Overview
12+13+Install Agent OS into an existing codebase, analyze current product state and progress. Builds on plan-product.md
14+15+<pre_flight_check>
16+ EXECUTE: @.agent-os/instructions/meta/pre-flight.md
17+</pre_flight_check>
18+19+<process_flow>
20+21+<step number="1" name="analyze_existing_codebase">
22+23+### Step 1: Analyze Existing Codebase
24+25+Perform a deep codebase analysis of the current codebase to understand current state before documentation purposes.
26+27+<analysis_areas>
28+ <project_structure>
29+ - Directory organization
30+ - File naming patterns
31+ - Module structure
32+ - Build configuration
33+ </project_structure>
34+ <technology_stack>
35+ - Frameworks in use
36+ - Dependencies (package.json, Gemfile, requirements.txt, etc.)
37+ - Database systems
38+ - Infrastructure configuration
39+ </technology_stack>
40+ <implementation_progress>
41+ - Completed features
42+ - Work in progress
43+ - Authentication/authorization state
44+ - API endpoints
45+ - Database schema
46+ </implementation_progress>
47+ <code_patterns>
48+ - Coding style in use
49+ - Naming conventions
50+ - File organization patterns
51+ - Testing approach
52+ </code_patterns>
53+</analysis_areas>
54+55+<instructions>
56+ ACTION: Thoroughly analyze the existing codebase
57+ DOCUMENT: Current technologies, features, and patterns
58+ IDENTIFY: Architectural decisions already made
59+ NOTE: Development progress and completed work
60+</instructions>
61+62+</step>
63+64+<step number="2" subagent="context-fetcher" name="gather_product_context">
65+66+### Step 2: Gather Product Context
67+68+Use the context-fetcher subagent to supplement codebase analysis with business context and future plans.
69+70+<context_questions>
71+ Based on my analysis of your codebase, I can see you're building [OBSERVED_PRODUCT_TYPE].
72+73+ To properly set up Agent OS, I need to understand:
74+75+ 1. **Product Vision**: What problem does this solve? Who are the target users?
76+77+ 2. **Current State**: Are there features I should know about that aren't obvious from the code?
78+79+ 3. **Roadmap**: What features are planned next? Any major refactoring planned?
80+81+ 4. **Team Preferences**: Any coding standards or practices the team follows that I should capture?
82+</context_questions>
83+84+<instructions>
85+ ACTION: Ask user for product context
86+ COMBINE: Merge user input with codebase analysis
87+ PREPARE: Information for plan-product.md execution
88+</instructions>
89+90+</step>
91+92+<step number="3" name="execute_plan_product">
93+94+### Step 3: Execute Plan-Product with Context
95+96+Execute our standard flow for installing Agent OS in existing products
97+98+<execution_parameters>
99+ <main_idea>[DERIVED_FROM_ANALYSIS_AND_USER_INPUT]</main_idea>
100+ <key_features>[IDENTIFIED_IMPLEMENTED_AND_PLANNED_FEATURES]</key_features>
101+ <target_users>[FROM_USER_CONTEXT]</target_users>
102+ <tech_stack>[DETECTED_FROM_CODEBASE]</tech_stack>
103+</execution_parameters>
104+105+<execution_prompt>
106+ @.agent-os/instructions/core/plan-product.md
107+108+ I'm installing Agent OS into an existing product. Here's what I've gathered:
109+110+ **Main Idea**: [SUMMARY_FROM_ANALYSIS_AND_CONTEXT]
111+112+ **Key Features**:
113+ - Already Implemented: [LIST_FROM_ANALYSIS]
114+ - Planned: [LIST_FROM_USER]
115+116+ **Target Users**: [FROM_USER_RESPONSE]
117+118+ **Tech Stack**: [DETECTED_STACK_WITH_VERSIONS]
119+</execution_prompt>
120+121+<instructions>
122+ ACTION: Execute plan-product.md with gathered information
123+ PROVIDE: All context as structured input
124+ ALLOW: plan-product.md to create .agent-os/product/ structure
125+</instructions>
126+127+</step>
128+129+<step number="4" name="customize_generated_files">
130+131+### Step 4: Customize Generated Documentation
132+133+Refine the generated documentation to ensure accuracy for the existing product by updating roadmap, tech stack, and decisions based on actual implementation.
134+135+<customization_tasks>
136+ <roadmap_adjustment>
137+ - Mark completed features as done
138+ - Move implemented items to "Phase 0: Already Completed"
139+ - Adjust future phases based on actual progress
140+ </roadmap_adjustment>
141+ <tech_stack_verification>
142+ - Verify detected versions are correct
143+ - Add any missing infrastructure details
144+ - Document actual deployment setup
145+ </tech_stack_verification>
146+</customization_tasks>
147+148+<roadmap_template>
149+ ## Phase 0: Already Completed
150+151+ The following features have been implemented:
152+153+ - [x] [FEATURE_1] - [DESCRIPTION_FROM_CODE]
154+ - [x] [FEATURE_2] - [DESCRIPTION_FROM_CODE]
155+ - [x] [FEATURE_3] - [DESCRIPTION_FROM_CODE]
156+157+ ## Phase 1: Current Development
158+159+ - [ ] [IN_PROGRESS_FEATURE] - [DESCRIPTION]
160+161+ [CONTINUE_WITH_STANDARD_PHASES]
162+</roadmap_template>
163+164+165+</step>
166+167+<step number="5" name="final_verification">
168+169+### Step 5: Final Verification and Summary
170+171+Verify installation completeness and provide clear next steps for the user to start using Agent OS with their existing codebase.
172+173+<verification_checklist>
174+ - [ ] .agent-os/product/ directory created
175+ - [ ] All product documentation reflects actual codebase
176+ - [ ] Roadmap shows completed and planned features accurately
177+ - [ ] Tech stack matches installed dependencies
178+</verification_checklist>
179+180+<summary_template>
181+ ## ✅ Agent OS Successfully Installed
182+183+ I've analyzed your [PRODUCT_TYPE] codebase and set up Agent OS with documentation that reflects your actual implementation.
184+185+ ### What I Found
186+187+ - **Tech Stack**: [SUMMARY_OF_DETECTED_STACK]
188+ - **Completed Features**: [COUNT] features already implemented
189+ - **Code Style**: [DETECTED_PATTERNS]
190+ - **Current Phase**: [IDENTIFIED_DEVELOPMENT_STAGE]
191+192+ ### What Was Created
193+194+ - ✓ Product documentation in `.agent-os/product/`
195+ - ✓ Roadmap with completed work in Phase 0
196+ - ✓ Tech stack reflecting actual dependencies
197+198+ ### Next Steps
199+200+ 1. Review the generated documentation in `.agent-os/product/`
201+ 2. Make any necessary adjustments to reflect your vision
202+ 3. See the Agent OS README for usage instructions: https://github.com/buildermethods/agent-os
203+ 4. Start using Agent OS for your next feature:
204+ ```
205+ @.agent-os/instructions/core/create-spec.md
206+ ```
207+208+ Your codebase is now Agent OS-enabled! 🚀
209+</summary_template>
210+211+212+</step>
213+214+</process_flow>
215+216+<post_flight_check>
217+ EXECUTE: @.agent-os/instructions/meta/post-flight.md
218+</post_flight_check>
···1+"""
2+FastMCP quickstart example.
3+4+cd to the `examples/snippets/clients` directory and run:
5+ uv run server fastmcp_quickstart stdio
6+"""
7+8+from mcp.server.fastmcp import FastMCP
9+10+# Create an MCP server
11+mcp = FastMCP("mcpkg")
12+13+14+@mcp.prompt()
15+def analyze_product() -> str:
16+ return """# Analyze Product
1718+Analyze your product's codebase and install Agent OS
1920+Refer to the instructions located in this file:
21+instruction://analyze-product"""
22+23+24+@mcp.resource("instruction://{name}")
25+def read_instruction(name: str) -> str:
26+ with open(f".mcpkg/instructions/{name}.md", "r") as f:
27+ return f.read()