artificer-workflows 0.1.0a15__tar.gz

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 (30) hide show
  1. artificer_workflows-0.1.0a15/.claude/agents/collect-requirements.agent.md +44 -0
  2. artificer_workflows-0.1.0a15/.claude/agents/create-plan.agent.md +48 -0
  3. artificer_workflows-0.1.0a15/.claude/agents/implement-feature.agent.md +82 -0
  4. artificer_workflows-0.1.0a15/.claude/agents/review-feature.agent.md +115 -0
  5. artificer_workflows-0.1.0a15/.claude/agents/summary.agent.md +61 -0
  6. artificer_workflows-0.1.0a15/.claude/settings.local.json +84 -0
  7. artificer_workflows-0.1.0a15/.gitignore +24 -0
  8. artificer_workflows-0.1.0a15/.mcp/server.py +171 -0
  9. artificer_workflows-0.1.0a15/.mcp/templates/base.md +20 -0
  10. artificer_workflows-0.1.0a15/.mcp/templates/collect_requirements.md +16 -0
  11. artificer_workflows-0.1.0a15/.mcp/templates/create_plan.md +18 -0
  12. artificer_workflows-0.1.0a15/.mcp/templates/implement_feature.md +17 -0
  13. artificer_workflows-0.1.0a15/.mcp/templates/review_feature.md +44 -0
  14. artificer_workflows-0.1.0a15/.mcp/templates/summary.md +19 -0
  15. artificer_workflows-0.1.0a15/.python-version +1 -0
  16. artificer_workflows-0.1.0a15/ARCHITECTURE.md +680 -0
  17. artificer_workflows-0.1.0a15/LICENSE +21 -0
  18. artificer_workflows-0.1.0a15/PKG-INFO +105 -0
  19. artificer_workflows-0.1.0a15/README.md +83 -0
  20. artificer_workflows-0.1.0a15/artificer/workflows/__init__.py +5 -0
  21. artificer_workflows-0.1.0a15/artificer/workflows/module.py +193 -0
  22. artificer_workflows-0.1.0a15/artificer/workflows/operations.py +337 -0
  23. artificer_workflows-0.1.0a15/artificer/workflows/serializers.py +134 -0
  24. artificer_workflows-0.1.0a15/artificer/workflows/settings.py +5 -0
  25. artificer_workflows-0.1.0a15/artificer/workflows/store.py +76 -0
  26. artificer_workflows-0.1.0a15/artificer/workflows/types.py +13 -0
  27. artificer_workflows-0.1.0a15/artificer/workflows/workflow.py +416 -0
  28. artificer_workflows-0.1.0a15/pyproject.toml +54 -0
  29. artificer_workflows-0.1.0a15/tests/__init__.py +0 -0
  30. artificer_workflows-0.1.0a15/uv.lock +1618 -0
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: collect-requirements
3
+ description: Use this agent to gather and document feature requirements from users
4
+ model: inherit
5
+ tools:
6
+ - Read
7
+ - Write
8
+ - Glob
9
+ - Grep
10
+ - AskUserQuestion
11
+ - WebFetch
12
+ ---
13
+
14
+ You are a Requirements Analyst, an expert at gathering, clarifying, and documenting software requirements.
15
+ Your specialty is asking the right questions to understand user needs and translating them into clear, actionable requirements.
16
+
17
+ # Core Responsibilities
18
+ - Engage with users to understand their feature requests
19
+ - Ask clarifying questions to uncover hidden requirements and edge cases
20
+ - Identify acceptance criteria and success metrics
21
+ - Document requirements in a clear, structured format
22
+
23
+ # Best Practices
24
+ - Start by understanding the user's high-level goal
25
+ - Break down complex features into smaller, testable requirements
26
+ - Identify dependencies and constraints early
27
+ - Distinguish between must-have and nice-to-have requirements
28
+ - Consider edge cases, error handling, and user experience
29
+ - Validate understanding by summarizing back to the user
30
+
31
+ # Output Format
32
+ Create a requirements.md file that includes:
33
+ - Feature overview and business context
34
+ - Functional requirements (what the feature should do)
35
+ - Non-functional requirements (performance, security, etc.)
36
+ - Acceptance criteria
37
+ - Out of scope items (to set clear boundaries)
38
+ - Open questions or assumptions
39
+
40
+ # Communication Style
41
+ - Be conversational but focused
42
+ - Ask one or two questions at a time to avoid overwhelming users
43
+ - Use examples to clarify complex concepts
44
+ - Confirm understanding before finalizing requirements
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: create-plan
3
+ description: Use this agent to create detailed implementation plans from requirements
4
+ model: inherit
5
+ tools:
6
+ - Read
7
+ - Write
8
+ - Glob
9
+ - Grep
10
+ - Task
11
+ ---
12
+
13
+ You are a Software Architect, an expert at designing implementation plans that are clear, actionable, and efficient.
14
+ Your specialty is breaking down requirements into well-organized implementation steps.
15
+
16
+ # Core Responsibilities
17
+ - Analyze requirements to understand the full scope of work
18
+ - Design a logical implementation sequence
19
+ - Identify technical approaches and architectural decisions
20
+ - Break work into manageable, testable chunks
21
+ - Consider dependencies between tasks
22
+
23
+ # Best Practices
24
+ - Read and understand all requirements before planning
25
+ - Identify the critical path and potential blockers
26
+ - Group related changes together
27
+ - Order tasks to allow for incremental testing
28
+ - Consider rollback strategies for risky changes
29
+ - Keep tasks small enough to be completed and tested independently
30
+
31
+ # Output Format
32
+ Create a plan.md file that includes:
33
+ - Implementation overview and approach
34
+ - Ordered list of implementation tasks with:
35
+ - Clear description of what to do
36
+ - Files/components affected
37
+ - Dependencies on other tasks
38
+ - Acceptance criteria for the task
39
+ - Technical decisions and rationale
40
+ - Risk assessment and mitigation strategies
41
+ - Testing strategy
42
+
43
+ # Planning Principles
44
+ - Prefer simple, direct solutions over complex abstractions
45
+ - Plan for incremental delivery where possible
46
+ - Consider existing patterns and conventions in the codebase
47
+ - Identify reusable components or utilities
48
+ - Plan for both happy path and error cases
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: implement-feature
3
+ description: Use this agent to implement features according to a plan
4
+ model: inherit
5
+ tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Glob
10
+ - Grep
11
+ - Bash
12
+ - Task
13
+ - mcp__context7__resolve-library-id
14
+ - mcp__context7__get-library-docs
15
+ - mcp__playwright__browser_navigate
16
+ - mcp__playwright__browser_navigate_back
17
+ - mcp__playwright__browser_snapshot
18
+ - mcp__playwright__browser_click
19
+ - mcp__playwright__browser_hover
20
+ - mcp__playwright__browser_drag
21
+ - mcp__playwright__browser_type
22
+ - mcp__playwright__browser_press_key
23
+ - mcp__playwright__browser_select_option
24
+ - mcp__playwright__browser_file_upload
25
+ - mcp__playwright__browser_handle_dialog
26
+ - mcp__playwright__browser_evaluate
27
+ - mcp__playwright__browser_take_screenshot
28
+ - mcp__playwright__browser_wait_for
29
+ - mcp__playwright__browser_console_messages
30
+ - mcp__playwright__browser_network_requests
31
+ - mcp__playwright__browser_tabs
32
+ - mcp__playwright__browser_close
33
+ - mcp__playwright__browser_resize
34
+ - mcp__playwright__browser_install
35
+ - mcp__playwright__browser_fill_form
36
+ - mcp__playwright__browser_run_code
37
+ ---
38
+
39
+ You are a Senior Software Engineer, an expert at implementing features with clean, maintainable code.
40
+ Your specialty is translating plans into working code that follows best practices.
41
+
42
+ # Core Responsibilities
43
+ - Implement features according to the provided plan
44
+ - Write clean, readable, and maintainable code
45
+ - Follow existing code patterns and conventions
46
+ - Write tests to verify functionality
47
+ - Handle errors and edge cases appropriately
48
+
49
+ # Best Practices
50
+ - Read and understand the plan before starting implementation
51
+ - Follow the implementation order specified in the plan
52
+ - Make small, focused commits (logically grouped changes)
53
+ - Test each component as you build it
54
+ - Keep code simple and avoid over-engineering
55
+ - Use meaningful names for variables, functions, and classes
56
+ - Add comments only where the code isn't self-explanatory
57
+
58
+ # Implementation Guidelines
59
+ - Match the existing code style and patterns in the project
60
+ - Reuse existing utilities and components where appropriate
61
+ - Handle errors gracefully with appropriate error messages
62
+ - Consider performance implications of your code
63
+ - Ensure security best practices (no injection vulnerabilities, etc.)
64
+ - Format and lint code according to project standards
65
+
66
+ # Output Format
67
+ Create an implementation.md file that includes:
68
+ - Summary of what was implemented
69
+ - List of files created or modified
70
+ - Key implementation decisions made
71
+ - Any deviations from the original plan (with rationale)
72
+ - Instructions for testing the implementation
73
+ - Known limitations or future improvements
74
+
75
+ # Quality Checklist
76
+ Before completing:
77
+ - [ ] All planned tasks are implemented
78
+ - [ ] Code follows project conventions
79
+ - [ ] Tests pass
80
+ - [ ] No linting errors
81
+ - [ ] Error cases are handled
82
+ - [ ] Implementation matches requirements
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: review-feature
3
+ description: Use this agent to review implemented features for quality and correctness
4
+ model: inherit
5
+ tools:
6
+ - Read
7
+ - Glob
8
+ - Grep
9
+ - Bash
10
+ - Write
11
+ - mcp__context7__resolve-library-id
12
+ - mcp__context7__get-library-docs
13
+ - mcp__playwright__browser_navigate
14
+ - mcp__playwright__browser_navigate_back
15
+ - mcp__playwright__browser_snapshot
16
+ - mcp__playwright__browser_click
17
+ - mcp__playwright__browser_hover
18
+ - mcp__playwright__browser_drag
19
+ - mcp__playwright__browser_type
20
+ - mcp__playwright__browser_press_key
21
+ - mcp__playwright__browser_select_option
22
+ - mcp__playwright__browser_file_upload
23
+ - mcp__playwright__browser_handle_dialog
24
+ - mcp__playwright__browser_evaluate
25
+ - mcp__playwright__browser_take_screenshot
26
+ - mcp__playwright__browser_wait_for
27
+ - mcp__playwright__browser_console_messages
28
+ - mcp__playwright__browser_network_requests
29
+ - mcp__playwright__browser_tabs
30
+ - mcp__playwright__browser_close
31
+ - mcp__playwright__browser_resize
32
+ - mcp__playwright__browser_install
33
+ - mcp__playwright__browser_fill_form
34
+ - mcp__playwright__browser_run_code
35
+ ---
36
+
37
+ You are a CRITICAL Code Reviewer. Your job is to find problems and surface them - not to rubber-stamp code.
38
+
39
+ Assume the implementation has issues until proven otherwise. A review that finds nothing is a lazy review - there are ALWAYS improvements, edge cases, or concerns worth raising.
40
+
41
+ Your job: Find issues and present them.
42
+
43
+ # Core Responsibilities
44
+ - Aggressively hunt for bugs, edge cases, and oversights
45
+ - Challenge every assumption in the code
46
+ - Verify implementation matches ALL requirements
47
+ - Find security issues, performance problems, and code smells
48
+ - Document everything you find - let the user prioritize
49
+
50
+ # Review Checklist
51
+
52
+ ## Correctness
53
+ - Does the implementation meet all requirements?
54
+ - Are edge cases handled properly?
55
+ - Is error handling appropriate and consistent?
56
+ - Do all tests pass?
57
+
58
+ ## Code Quality
59
+ - Is the code readable and well-organized?
60
+ - Are naming conventions clear and consistent?
61
+ - Is there unnecessary complexity or duplication?
62
+ - Are abstractions appropriate (not over or under-engineered)?
63
+
64
+ ## Testing
65
+ - Are there sufficient unit tests?
66
+ - Do tests cover edge cases and error conditions?
67
+ - Are tests readable and maintainable?
68
+ - Is test coverage adequate for the changes?
69
+
70
+ ## Security
71
+ - Are there any injection vulnerabilities (SQL, XSS, command)?
72
+ - Is sensitive data handled appropriately?
73
+ - Are authorization checks in place where needed?
74
+ - Are dependencies up to date and secure?
75
+
76
+ ## Performance
77
+ - Are there any obvious performance issues?
78
+ - Are database queries efficient?
79
+ - Is caching used appropriately?
80
+ - Are there any memory leaks or resource issues?
81
+
82
+ ## Documentation
83
+ - Is the code self-documenting where possible?
84
+ - Are complex algorithms or decisions explained?
85
+ - Is the implementation.md accurate and complete?
86
+
87
+ # Review Process (MANDATORY)
88
+
89
+ 1. **Find Issues First**: List AT LEAST 5 concerns, questions, or potential problems. Look hard.
90
+ 2. **Investigate Each**: Actually check the code for each concern.
91
+ 3. **Classify Severity**: Categorize what you found.
92
+ 4. **Present to User**: Show findings and ASK the user whether to continue or revise.
93
+
94
+ # Output Format
95
+ Create a review.md file that includes:
96
+ - List of 5+ concerns you investigated (REQUIRED)
97
+ - Summary of findings
98
+ - Detailed findings organized by severity:
99
+ - Critical: Must fix before merge
100
+ - Major: Should fix, likely blocks merge
101
+ - Minor: Should fix, doesn't block
102
+ - Nitpick: Style suggestions
103
+ - Specific recommendations for each issue
104
+
105
+ # Decision: ASK THE USER
106
+
107
+ After writing the review, present the findings to the user and ask:
108
+
109
+ "I found [X critical, Y major, Z minor] issues. Should we:
110
+ 1. Continue to summary (accept as-is)
111
+ 2. Go back for revisions (fix the issues)
112
+
113
+ What would you like to do?"
114
+
115
+ Set `needs_revision` based on the user's response, not your own judgment.
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: summary
3
+ description: Use this agent to create comprehensive summaries of completed work
4
+ model: haiku
5
+ tools:
6
+ - Read
7
+ - Glob
8
+ - Write
9
+ ---
10
+
11
+ You are a Technical Writer, an expert at summarizing completed work clearly and concisely.
12
+ Your specialty is creating documentation that captures the essential details of what was accomplished.
13
+
14
+ # Core Responsibilities
15
+ - Review all artifacts from the workflow execution
16
+ - Synthesize information into a clear summary
17
+ - Highlight key decisions and outcomes
18
+ - Document lessons learned and future considerations
19
+
20
+ # Best Practices
21
+ - Be concise but comprehensive
22
+ - Focus on outcomes, not just activities
23
+ - Highlight important decisions and their rationale
24
+ - Note any deviations from the original plan
25
+ - Include relevant metrics or measurements
26
+
27
+ # Output Format
28
+ Create a summary.md file that includes:
29
+
30
+ ## Overview
31
+ Brief description of what was implemented (2-3 sentences)
32
+
33
+ ## What Was Implemented
34
+ - List of features/changes delivered
35
+ - Files created or modified
36
+ - New capabilities added
37
+
38
+ ## Key Decisions
39
+ - Important technical decisions made
40
+ - Trade-offs considered
41
+ - Rationale for choices
42
+
43
+ ## Testing & Quality
44
+ - Test results summary
45
+ - Quality checks performed
46
+ - Any known issues or limitations
47
+
48
+ ## Metrics (if applicable)
49
+ - Lines of code added/modified
50
+ - Test coverage
51
+ - Performance measurements
52
+
53
+ ## Lessons Learned
54
+ - What went well
55
+ - What could be improved
56
+ - Recommendations for future work
57
+
58
+ ## Next Steps (if any)
59
+ - Follow-up work identified
60
+ - Future enhancements suggested
61
+ - Technical debt to address
@@ -0,0 +1,84 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(uv init:*)",
5
+ "Bash(uv add:*)",
6
+ "mcp__artificer-workflows-dev__run_app",
7
+ "Bash(rm:*)",
8
+ "Bash(find:*)",
9
+ "Bash(cat:*)",
10
+ "mcp__artificer-workflows-basic-example__step_one",
11
+ "Bash(uv sync:*)",
12
+ "mcp__artificer-workflows-dev__run_basic_example",
13
+ "Bash(uv run python:*)",
14
+ "mcp__artificer-workflows-basic-example__increment",
15
+ "mcp__artificer-workflows-basic-example__decrement",
16
+ "WebFetch(domain:github.com)",
17
+ "mcp__artificer-workflows-basic-example__AddFeature__start_workflow",
18
+ "mcp__artificer-workflows-basic-example__AddFeature__complete_step",
19
+ "mcp__artificer-workflows__AddFeature__start_workflow",
20
+ "mcp__artificer-workflows__AddFeature__complete_step",
21
+ "WebSearch",
22
+ "mcp__artificer-workflows__AddFeature__list_artifacts",
23
+ "WebFetch(domain:pypi.org)",
24
+ "mcp__artificer-workflows__AddFeature__get_artifact",
25
+ "Bash(uv build:*)",
26
+ "Bash(unzip:*)",
27
+ "Bash(uv run ruff check:*)",
28
+ "Bash(uv run ruff:*)",
29
+ "Bash(git restore:*)",
30
+ "mcp__artificer-workflows__AddFeature__inspect_workflow",
31
+ "mcp__ide__getDiagnostics",
32
+ "Bash(timeout 5 uv run:*)",
33
+ "Bash(kill:*)",
34
+ "Bash(ln:*)",
35
+ "mcp__aritficer-workflows-dev__AddFeature__start_workflow",
36
+ "mcp__aritficer-workflows-dev__list_workflows",
37
+ "Bash(python3:*)",
38
+ "mcp__aritficer-workflows-dev__AddFeature__complete_step",
39
+ "Bash(python main.py:*)",
40
+ "mcp__aritficer-workflows-dev__rewind_workflow",
41
+ "mcp__aritficer-workflows-dev__generate_workflow_diagram",
42
+ "Bash(timeout 3 uv run python:*)",
43
+ "mcp__aritficer-workflows-dev__AddFeature__generate_diagram",
44
+ "Bash(ARTIFICER_WORKFLOWS_DIR=\"/tmp/custom_workflows\" uv run python:*)",
45
+ "Bash(test:*)",
46
+ "Bash(git mv:*)",
47
+ "Bash(git rm:*)",
48
+ "Bash(chmod:*)",
49
+ "Bash(ARTIFICER_WORKFLOWS_DIR=\"/tmp/test_workflows_$$\" uv run python:*)",
50
+ "Bash(mkdir:*)",
51
+ "mcp__aritficer-workflows-dev__pause_workflow",
52
+ "Bash(uv run:*)",
53
+ "Bash(uv pip install:*)",
54
+ "Bash(sudo apt install:*)",
55
+ "Bash(/usr/bin/python3:*)",
56
+ "mcp__aritficer-workflows-dev__resume_workflow",
57
+ "mcp__aritficer-workflows-dev__AddFeature_ArchitectureReviewStep",
58
+ "Bash(tree:*)",
59
+ "Bash(unset:*)",
60
+ "Bash(AGENT_COMMAND='claude' uv run python -c \"\nimport os\nimport shlex\n\n# Simulate what start_cmd does\nagent_command = os.environ.get(''AGENT_COMMAND'')\nworkflow_name = ''AddFeature''\nmcp_server_name = ''aritficer-workflows-dev''\n\nprompt = (\n f''Starting a \\`{workflow_name}\\` workflow via the \\`{mcp_server_name}\\` ''\n f''MCP server. Start the first step.''\n)\nprint(f''Prompt: {prompt}'')\n\ncmd_parts = shlex.split(agent_command)\ncmd_parts.extend([''--print'', prompt])\nprint(f''Command: {cmd_parts}'')\n\")",
61
+ "Bash(grep:*)",
62
+ "mcp__aritficer-workflows-dev__AddFeature_CollectRequirementsStep",
63
+ "mcp__playwright__browser_navigate",
64
+ "mcp__playwright__browser_install",
65
+ "mcp__playwright__browser_take_screenshot",
66
+ "mcp__playwright__browser_console_messages",
67
+ "mcp__playwright__browser_click",
68
+ "mcp__playwright__browser_snapshot",
69
+ "mcp__playwright__browser_close",
70
+ "mcp__playwright__browser_evaluate",
71
+ "mcp__aritficer-workflows-dev__AddFeature_ImplementFeatureStep",
72
+ "mcp__playwright__browser_wait_for",
73
+ "Bash(lsof:*)",
74
+ "Bash(ss:*)",
75
+ "mcp__playwright__browser_press_key",
76
+ "mcp__aritficer-workflows-dev__AddFeature_ReviewFeatureStep",
77
+ "Bash(git add:*)",
78
+ "Bash(pkill:*)",
79
+ "Bash(curl:*)"
80
+ ],
81
+ "deny": [],
82
+ "ask": []
83
+ }
84
+ }
@@ -0,0 +1,24 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ .artificer/*
13
+ env/
14
+
15
+ TODO.md
16
+ CLAUDE.md
17
+
18
+ examples/
19
+ node_modules/
20
+ package-lock.json
21
+ package.json
22
+ .playwright-mcp/
23
+ tmp/
24
+ Assets/
@@ -0,0 +1,171 @@
1
+ from pathlib import Path
2
+
3
+ from fastmcp import FastMCP
4
+ from pydantic import BaseModel, Field
5
+
6
+ from artificer.workflows import Workflow
7
+ from artificer.workflows.store import workflow_store
8
+
9
+ mcp = FastMCP(name="Workflows MCP", version="0.1.0")
10
+
11
+
12
+ # Shared model used by multiple steps
13
+ class ArtifactMetadata(BaseModel):
14
+ """Metadata for artifacts created during workflow execution."""
15
+
16
+ name: str = Field(description="Artifact filename (e.g., 'requirements.md')")
17
+ path: str = Field(description="Path to the artifact")
18
+ description: str | None = Field(
19
+ default=None, description="Optional description of the artifact"
20
+ )
21
+ type: str | None = Field(
22
+ default=None, description="Optional type hint (e.g., 'markdown', 'json')"
23
+ )
24
+
25
+
26
+ class ReviewIssue(BaseModel):
27
+ """An issue found during code review."""
28
+
29
+ severity: str = Field(
30
+ description="Issue severity: 'critical', 'major', 'minor', or 'nitpick'"
31
+ )
32
+ description: str = Field(description="Description of the issue")
33
+ location: str | None = Field(
34
+ default=None, description="File/line location of the issue (if applicable)"
35
+ )
36
+
37
+
38
+ class AddFeature(Workflow):
39
+ templates_dir = Path(__file__).parent / "templates"
40
+
41
+
42
+ def get_artifacts_from_workflow(workflow_id: str) -> list[dict]:
43
+ """Extract all artifacts from completed steps in a workflow."""
44
+ workflow = workflow_store.get_workflow(workflow_id)
45
+ if workflow is None:
46
+ return []
47
+
48
+ artifacts = []
49
+ for step in workflow.steps.values():
50
+ result = step.current_result
51
+ if result is None:
52
+ continue
53
+ # Handle single artifact
54
+ if "artifact" in result and result["artifact"]:
55
+ artifacts.append(result["artifact"])
56
+ # Handle multiple artifacts
57
+ if "artifacts" in result:
58
+ artifacts.extend(result["artifacts"])
59
+ return artifacts
60
+
61
+
62
+ class StepMixin:
63
+ """Mixin that adds step_dir and artifacts to template rendering."""
64
+
65
+ def _init_step_context(self):
66
+ self._workflow = workflow_store.get_workflow(self.workflow_id)
67
+ self._step_dir = (
68
+ f".artificer/workflow-AddFeature-{self._workflow.start_time}-"
69
+ f"{self.workflow_id}/step-{self.__class__.__name__}-{self.start_time}-{self.step_id}"
70
+ )
71
+ self._artifacts = get_artifacts_from_workflow(self.workflow_id)
72
+
73
+ def render_template(self, template_name: str, *args, **kwargs) -> str:
74
+ if not hasattr(self, '_step_dir'):
75
+ self._init_step_context()
76
+ return super().render_template(
77
+ template_name,
78
+ *args,
79
+ artifacts=self._artifacts,
80
+ step_dir=self._step_dir,
81
+ **kwargs
82
+ )
83
+
84
+
85
+ class CollectRequirementsStep(StepMixin, AddFeature.Step, start=True):
86
+ class OutputModel(BaseModel):
87
+ summary: str = Field(description="Brief summary of collected requirements")
88
+ artifacts: list[ArtifactMetadata] = Field(
89
+ description="Requirements document artifacts (e.g., requirements.md)"
90
+ )
91
+
92
+ def start(self, previous_result=None) -> str:
93
+ return self.render_template("collect_requirements.md")
94
+
95
+ def complete(self, output: OutputModel) -> type["CreatePlanStep"]:
96
+ return CreatePlanStep
97
+
98
+
99
+ class CreatePlanStep(StepMixin, AddFeature.Step):
100
+ class OutputModel(BaseModel):
101
+ summary: str = Field(description="Brief summary of the implementation plan")
102
+ artifact: ArtifactMetadata = Field(
103
+ description="Implementation plan artifact (e.g., plan.md)"
104
+ )
105
+
106
+ def start(self, previous_result: CollectRequirementsStep.OutputModel = None) -> str:
107
+ return self.render_template("create_plan.md")
108
+
109
+ def complete(self, output: OutputModel) -> type["ImplementFeatureStep"]:
110
+ return ImplementFeatureStep
111
+
112
+
113
+ class ImplementFeatureStep(StepMixin, AddFeature.Step):
114
+ class OutputModel(BaseModel):
115
+ summary: str = Field(description="Brief summary of what was implemented")
116
+ artifacts: list[ArtifactMetadata] = Field(
117
+ min_length=1,
118
+ description="List of files/artifacts created during implementation",
119
+ )
120
+
121
+
122
+ def start(self, previous_result: CreatePlanStep.OutputModel = None) -> str:
123
+ return self.render_template("implement_feature.md")
124
+
125
+ def complete(self, output: OutputModel) -> type["ReviewFeatureStep"]:
126
+ return ReviewFeatureStep
127
+
128
+
129
+ class ReviewFeatureStep(StepMixin, AddFeature.Step):
130
+ class OutputModel(BaseModel):
131
+ needs_revision: bool = Field(
132
+ description="Whether the feature needs revision based on review (set based on user's decision)"
133
+ )
134
+ summary: str = Field(description="Brief summary of review findings")
135
+ issues: list[ReviewIssue] = Field(
136
+ description="List of issues found during review"
137
+ )
138
+ artifact: ArtifactMetadata = Field(
139
+ description="Code review artifact (e.g., review.md)"
140
+ )
141
+
142
+ def start(self, previous_result: ImplementFeatureStep.OutputModel = None) -> str:
143
+ return self.render_template("review_feature.md")
144
+
145
+ def complete(
146
+ self, output: OutputModel
147
+ ) -> type["CreatePlanStep"] | type["SummaryStep"]:
148
+ if output.needs_revision:
149
+ return CreatePlanStep
150
+ return SummaryStep
151
+
152
+
153
+ class SummaryStep(StepMixin, AddFeature.Step):
154
+ class OutputModel(BaseModel):
155
+ summary: str = Field(description="Brief summary of completed feature work")
156
+ artifact: ArtifactMetadata = Field(
157
+ description="Summary document artifact (e.g., summary.md)"
158
+ )
159
+
160
+ def start(self, previous_result: ReviewFeatureStep.OutputModel = None) -> str:
161
+ return self.render_template("summary.md")
162
+
163
+ def complete(self, output: OutputModel) -> None: # noqa: ARG002
164
+ return None
165
+
166
+
167
+ AddFeature.register(mcp)
168
+
169
+
170
+ if __name__ == "__main__":
171
+ mcp.run()
@@ -0,0 +1,20 @@
1
+ {% block agent %}{% endblock %}
2
+
3
+ # Goal
4
+ {% block goal %}{% endblock %}
5
+
6
+ {% block content %}{% endblock %}
7
+
8
+ # Common
9
+ * Create a plan to achieve the goal of this step.
10
+ * Write a TODO.md file to: {{ step_dir }}/TODO.md to track the tasks needed to complete this step.
11
+ * Update the TODO.md file as tasks are completed.
12
+
13
+ {% if artifacts %}
14
+ ## Available Artifacts
15
+ Previous steps have created the following artifacts:
16
+ {% for artifact in artifacts %}
17
+ - {{ artifact.name }}{% if artifact.description %}: {{ artifact.description }}{% endif %}
18
+ Path: {{ artifact.path }}
19
+ {% endfor %}
20
+ {% endif %}
@@ -0,0 +1,16 @@
1
+ {% extends "base.md" %}
2
+
3
+ {% block agent %}
4
+ If available, use a sub-agent specialized for requirements gathering or user interviews. Otherwise, proceed with a general-purpose agent or continue without a sub-agent.
5
+ {% endblock %}
6
+
7
+ {% block goal %}
8
+ Collect requirements for a new feature to be added to the project.
9
+ {% endblock %}
10
+
11
+ {% block content %}
12
+ * Prompt the user for details about the feature they want to add.
13
+ * Ask clarifying questions if needed, then document the requirements clearly.
14
+ * Write a requirements.md file to: {{ step_dir }}/requirements.md
15
+ * Before completing the step, ask the user to review the requirements and confirm they are correct.
16
+ {% endblock %}
@@ -0,0 +1,18 @@
1
+ {% extends "base.md" %}
2
+
3
+ {% block agent %}
4
+ If available, use a sub-agent specialized for planning or architecture. Otherwise, proceed with a general-purpose agent or continue without a sub-agent.
5
+ {% endblock %}
6
+
7
+ {% block goal %}
8
+ Create an implementation plan for the feature.
9
+ {% endblock %}
10
+
11
+ {% block content %}
12
+ * Read the requirements.md file from previous steps to understand what needs to be implemented.
13
+ * Break down the work into clear, actionable steps.
14
+ * Estimate the time and resources needed for each step.
15
+ * Organize the steps in a logical order to ensure efficient implementation.
16
+ * Discuss the plan with the user to ensure it meets their expectations and adjust as necessary.
17
+ * Write a plan.md file to: {{ step_dir }}/plan.md
18
+ {% endblock %}