Project Lifecycle Management Agent
The lifecycle agent manages the full project lifecycle: creation with conversational kickoff, status tracking through stages, project switching, and test protocol execution. It uses the Python project and testing modules for all operations.
Context Loading
Before lifecycle operations:
- Read
src/maxpat/project.pyfor project management functions - Read
src/maxpat/testing.pyfor test checklist generation - Read
patches/.active-project.jsonfor current active project - Read active project's
status.mdfor current stage and progress - Read active project's
config.jsonviaload_project_config()for package configuration
Python Interface
from src.maxpat.project import (
create_project, get_active_project, set_active_project,
read_status, update_status, list_projects,
init_versions, get_version, bump_version, list_versions,
load_project_config, save_project_config, get_allowed_packages,
)
from src.maxpat.testing import (
generate_test_checklist, save_test_results,
record_confirmation, format_proven_form, append_proven_form,
)
Capabilities
Project Creation
- Create new project with
create_project(name, base_dir)which scaffolds the full directory structure create_project()also creates an empty .maxpat file atpatches/{name}/generated/{name}.maxpatwith canvas background color -- user can open in MAX immediately- Start conversational kickoff: ask clarifying questions about audio/MIDI requirements, signal flow, UI needs
- Write answers to project's
context.md - See
references/project-structure.mdfor standard directory layout
Package Configuration
- After
create_project(), prompt the user to select packages for the project - Present packages in two groups using
ObjectDatabase().list_packages()andget_package_info(): - Bundled packages (tier == "bundled" in package_info.json): ship with MAX, always available
- Community packages (tier == "community" or "licensed"): require separate install
- User picks individual packages from each group (no preset bundles)
- Write selection with
save_project_config(project_dir, {"packages": [selected_names]}) - Package names must exactly match keys in package_info.json (e.g., "BEAP", "Vizzie", "ableton-dsp")
- If user selects no packages, write
{"packages": []}(core-only, per D-08) - Users change packages later by editing
patches/<project>/config.jsonor callingsave_project_config(project_dir, {"packages": [...]}); a project without config.json is core-only (allowed_packages=[])
Community Package Extraction Gate
When a user selects a community package (tier == "community" in package_info.json):
- Check
extractedfield in package_info.json viaObjectDatabase().get_package_info(name) - If
extractedisfalse, the package has stub data only -- do NOT generate patches with its objects - Show the user the install + extract path:
- Package Manager packages (FluCoMa, CNMAT, Bach, Odot, ml-lib, Cage, Dada, EARS, Rhythmic Time Toolkit): "Install via MAX Package Manager (Help -> Package Manager -> search '{name}'), then run:
python .claude/scripts/extract_objects.py --package \"{name}\"" - IRCAM Spat: "Download from https://forum.ircam.fr/projects/detail/spat/ (free account required), copy spat5 folder to ~/Documents/Max 9/Packages/, then run:
python .claude/scripts/extract_objects.py --package \"IRCAM Spat\"" - After extraction completes,
extractedflips totrueand the package is unblocked - Bach ecosystem note: Cage, Dada, and EARS all require Bach installed first. If user selects any of these, ensure Bach is also selected and extracted.
Template Suggestions on Package Selection
After the user selects packages for a project, suggest relevant workflow templates:
- If BEAP selected: "BEAP modular templates are available in the DSP agent -- see
max-dsp-agent/SKILL.mdPackage Workflow Templates for FM synthesis, sequenced patterns, and canonical signal chains." - If FluCoMa selected: "FluCoMa workflow templates cover real-time analysis, offline buffer processing, and ML classification pipelines -- see
max-dsp-agent/SKILL.mdPackage Workflow Templates." - If Bach selected: "Bach workflow templates cover llll construction, notation display, and algorithmic composition -- see
max-patch-agent/SKILL.mdPackage Workflow Templates. IMPORTANT: a flat MAX list connects directly to a bach inlet -- there is no converter object to insert; use bach.flat / bach.iter / bach.pack for structured conversion and bach.nth N for extraction." - If multiple DSP packages selected: mention both DSP agent template sections.
- If no packages selected: skip template suggestions.
This is informational guidance only -- do not auto-scaffold template code into projects.
Status Tracking
- Read current status with
read_status(project_dir) - Update status with
update_status(project_dir, stage=..., progress=...) - Track stages: ideation, discuss, research, build, verify
- See
references/status-tracking.mdfor stage definitions and progress format
Project Switching
- List all projects with
list_projects(base_dir) - Switch active project with
set_active_project(name, base_dir) - Get current active project with
get_active_project(base_dir) - Validate project directory exists on switch (detect desync)
Version Tracking
- Track project versions with
init_versions(project_dir),get_version(project_dir),bump_version(project_dir, bump, description),list_versions(project_dir) - New projects auto-initialize at 0.0.0 via
create_project() - Bump after significant changes: patch for fixes, minor for new features, major for breaking changes
- See
references/status-tracking.mdfor version tracking API details
Test Protocol Execution
- Generate manual test checklist from patch with
generate_test_checklist(patch_dict, patch_name, patch_path="") - Save test results with
save_test_results(project_dir, test_name, results_md) - See
references/test-protocol.mdfor checklist format and result recording
Confirmation Lifecycle
- Trigger: the user says a feature works in MAX (a passing checklist item, or in conversation, including after a
/max-iteratefix). - Record:
record_confirmation(project_dir, feature, evidence, version=None, max_version=None, files=None)with the user's own words asevidence. It writestest-results/v<version>-<slug>-confirmed.md(<date>-<slug>-confirmed.mdwhen the project has no versions.json), never overwrites (-2,-3, ...), rejects private paths and files outside the project, and commits only that path (Rule #7). - Offer: when the confirmation teaches general MAX knowledge (valid beyond this project), draft a lesson with
format_proven_form(title, rule, form, why, evidence), evidence[confirmed] <project> v<version> (<date>). - Evidence tiers:
[confirmed],[bundle],[code],[observed], as defined in.claude/skills/references/proven-forms.md;[confirmed]needs a version and a date. - Consent: show the entry verbatim and ask (multiple choice): append as drafted / edit first / skip. Only on append call
append_proven_form(section, title, rule, form, why, evidence); it refuses duplicate titles, unknown sections and private paths. - Commit:
append_proven_formnever commits. Commit.claude/skills/references/proven-forms.mdby explicit path (git commit -- .claude/skills/references/proven-forms.md), nevergit add -A. - The full flow is
/max-teststeps 6-7.
References
references/project-structure.md-- Standard directory layout for MAX projectsreferences/status-tracking.md-- Stage definitions and progress formatreferences/test-protocol.md-- Manual test checklist generation and result recording
When to Use
/max-new-- Create new project/max-status-- Show project overview and progress/max-switch-- Change active project/max-test-- Generate test checklist from generated patches- Whenever the user says a feature works in MAX -- record the confirmation and offer a proven-forms lesson (Confirmation Lifecycle)
- Any command that needs to read/update project state
When NOT to Use
- For patch/code generation (use specialist agents via router)
- For critic review (use max-critic)