How to create a task completion workflow in Manus AI for building a React component
Manus AI installed and configured, existing React project with npm/yarn/pnpm, code editor available
What this does
Manus AI can orchestrate a multi-step workflow to produce a fully functional React component. The workflow includes requirement analysis, scaffold generation, implementation, test writing, and integration verification. This guide demonstrates how to define and execute such a workflow from the Manus CLI to produce production-ready component code.
Steps
- Open a terminal and navigate to the React project directory using
cd /path/to/project. - Start a Manus session with
manus session start. The session runs in the foreground of the terminal. - Define the component scope by prompting with a clear requirement, for example: "Create a reusable DataTable component with sortable columns, pagination controls, and row selection. Use TypeScript, Tailwind CSS for styling, and follow the existing project conventions in
src/components/." - Manus analyzes the request, reads existing project patterns from the components directory, and drafts a specification document in memory.
- Review the proposed component structure. Request modifications by typing follow-up prompts such as "Add support for custom cell renderers" or "Use the existing Button component instead of raw HTML buttons".
- Approve the implementation phase by typing "proceed with implementation". Manus generates the component file, types file, and any required CSS.
- Request test coverage by prompting "Generate unit tests for the DataTable component using React Testing Library".
- Verify the generated files exist by running
manus task statuswhich lists all files created or modified during the session. - Run the project's test suite with
npm testoryarn testto confirm the new component passes existing tests. - Finalize the session by typing
manus session commitwhich saves a summary of the workflow, created files, and any manual steps required to complete integration.
Verification
ls src/components/DataTable/
Expected output:
DataTable.tsx
DataTable.types.ts
DataTable.test.tsx
DataTable.module.css
Common failures
Component generated outside project directory — Manus may create files in the wrong location if the working directory is not set correctly. Always
cdto the project root before starting the session and confirm the path withmanus task status.Dependencies missing after component creation — If the component introduces new imports such as a utility library, the tests may fail due to missing packages. Run
npm installafter the workflow completes to install any new dependencies Manus detected.Styling conflicts with existing CSS — Generated CSS modules may use class names that conflict with existing styles. Manually review the generated CSS file and rename classes to match project conventions if visual regressions appear.
Test suite fails on generated tests — If the project uses a specific testing setup (custom renderers, mocked modules), the generated tests may need adjustment. Update the test file imports to match the project's testing configuration.
Related guides
- Install and set up Manus AI on your local development machine
- Use Manus AI to research and compare API options for your project