The three tasks below cover project creation, structural improvements, and additional tests. The Agent component sends the complete prompt to the selected application; you can also copy and adapt the prompt to your project’s needs.
Create a new func project
Who it is for
This workflow is for developers using func for the first time and teams that want to establish an isolated CLI package inside an existing monorepo. Open the target repository in your coding agent; you do not need to check Node.js, package-manager, or workspace configuration one item at a time.
What the agent does
- Reads repository instructions and checks the package manager and directory boundary.
- Passes the fixed project name
func-exampleto the creator and installs its dependencies. - Reads the generated source and runs the help handler to verify the CLI.
Expected result
The repository gains a runnable func project with a clear boundary, plus a report of created files, the chosen location, and the verification result. Use it as a learning baseline or the foundation for a real business CLI.
Improve an existing func project
Who it is for
This workflow is for maintainers of a working func project. Use it when commands keep accumulating, handlers have started to own business logic, or the boundaries between modules, services, and generated output are no longer clear.
What the agent does
- Inspects the responsibilities of the entry, modules, commands, services, tests, and output.
- Finds mixed responsibilities and reorganizes the project around business boundaries.
- Updates affected imports, registrations, and test paths, then runs relevant checks.
Expected result
Users invoke the CLI in exactly the same way and receive the same output, while the executable entry becomes smaller and commands and reusable services gain clearer ownership. Future features, debugging, and team handoffs require a smaller area of the project to understand and change.
Add tests for CLI commands
Who it is for
This workflow is for maintainers adding commands, preparing a release, or finishing a structural refactor. It protects the behavior your CLI promises to users instead of re-testing func internals, making it useful as regression coverage before merging code.
What the agent does
- Compares existing commands and tests to find gaps in user-visible behavior.
- Spawns the executable to cover command names, aliases, handler paths, option constraints, and owned failures.
- Asserts stable exit behavior, stdout, and stderr, then runs the smallest relevant test set.
Expected result
The new tests protect the CLI contract your application owns: how users invoke it, what success prints, and how failures exit. They expose behavior regressions during later refactors or dependency upgrades without relying on brittle implementation details.
Reference and verify
After a task finishes, compare the result with setup.txt and rules.txt to verify the func setup, project boundary, and testing conventions. The manual workflow remains available in Quick Start.