Conversation
Add `make env` and `make env-script` targets for Makefile-centric environment setup as alternative to `source setup.sh`. - Makefile: add `env` target (exports AGENTIZE_HOME, PYTHONPATH) and document it in `make help` output. - templates/python/Makefile: add `env` (PROJECT_ROOT, PATH, PYTHONPATH), `env-script` (generates setup.sh), and `help` targets. - templates/c/Makefile: add `env` (PROJECT_ROOT, PATH, C_INCLUDE_PATH, LIBRARY_PATH), `env-script`, and `help` targets. - templates/cxx/Makefile: add `env` (PROJECT_ROOT, PATH, CPLUS_INCLUDE_PATH, LIBRARY_PATH), `env-script`, and `help` targets. - templates/README.md: document new env, env-script, and help targets. - tests/lint/test-makefile-env-target.sh: verify make env output and eval correctness. - tests/lint/test-makefile-help-env-targets.sh: verify make help documents env target. - tests/sdk/test-template-env-targets.sh: verify all template Makefiles have env, env-script, help targets with language-specific exports. Test status: 60/60 shell tests passed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds make env / make env-script / make help targets to the main Makefile and SDK templates to standardize environment setup (either via eval $(make env) or generating setup.sh), and introduces shell tests to validate these targets.
Changes:
- Add
env,env-script, andhelptargets to the Python/C/C++ template Makefiles with language-specific exports. - Add
envtarget (and help text) to the repo rootMakefile. - Add lint/sdk shell tests to verify
make envoutput and template target presence.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Makefile |
Adds env target and documents it in make help. |
templates/python/Makefile |
Adds env, env-script, help targets for Python SDK template. |
templates/c/Makefile |
Adds env, env-script, help targets for C SDK template. |
templates/cxx/Makefile |
Adds env, env-script, help targets for C++ SDK template. |
templates/README.md |
Documents new template Makefile targets and usage. |
tests/lint/test-makefile-env-target.sh |
Validates make env prints eval-able exports. |
tests/lint/test-makefile-help-env-targets.sh |
Validates make help documents make env usage. |
tests/sdk/test-template-env-targets.sh |
Validates templates include the new Makefile targets and exports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ! grep -q 'env' "$MAKEFILE" | head -1; then | ||
| echo "FAIL: $lang/Makefile .PHONY missing env" |
There was a problem hiding this comment.
The .PHONY check is broken: grep -q produces no output, so piping it to head -1 makes the pipeline succeed regardless of whether the match exists. This can cause the test to miss missing .PHONY entries. Suggest checking the .PHONY: line explicitly (e.g., grep for ^\.PHONY: containing env env-script help) without piping.
| if ! grep -q 'env' "$MAKEFILE" | head -1; then | |
| echo "FAIL: $lang/Makefile .PHONY missing env" | |
| if ! grep -q '^\.PHONY:.*\benv\b.*\benv-script\b.*\bhelp\b' "$MAKEFILE"; then | |
| echo "FAIL: $lang/Makefile .PHONY missing env, env-script, or help" |
| # Verify the output is valid shell (can be eval'd without error) | ||
| eval "$ENV_OUTPUT" 2>/dev/null | ||
| if [ $? -ne 0 ]; then | ||
| test_fail "make env output is not valid shell syntax" | ||
| fi | ||
|
|
||
| # Verify AGENTIZE_HOME was actually set after eval | ||
| if [ -z "$AGENTIZE_HOME" ]; then | ||
| test_fail "AGENTIZE_HOME not set after eval \$(make env)" | ||
| fi |
There was a problem hiding this comment.
This test asserts AGENTIZE_HOME is set after eval, but AGENTIZE_HOME is already exported by tests/common.sh, so this check can pass even if make env failed to set it. Consider unset AGENTIZE_HOME (and possibly PYTHONPATH) before eval, then assert the variables are set to the expected values afterwards.
| env: | ||
| @echo 'export PROJECT_ROOT="$(CURDIR)"' | ||
| @echo 'export PATH="$(CURDIR)/build/bin:$$PATH"' | ||
| @echo 'export PYTHONPATH="$(CURDIR)/src:$$PYTHONPATH"' | ||
|
|
||
| env-script: | ||
| @echo "Generating setup.sh..." | ||
| @echo '#!/bin/bash' > setup.sh | ||
| @echo '# Generated by make env-script' >> setup.sh | ||
| @echo 'export PROJECT_ROOT="$(CURDIR)"' >> setup.sh | ||
| @echo 'export PATH="$$PROJECT_ROOT/build/bin:$$PATH"' >> setup.sh | ||
| @echo 'export PYTHONPATH="$$PROJECT_ROOT/src:$$PYTHONPATH"' >> setup.sh | ||
| @chmod +x setup.sh |
There was a problem hiding this comment.
PYTHONPATH is being set to $(CURDIR)/src, but this template doesn't have a src/ directory (it has the package directory at the repo root, e.g. project_name/). As a result, eval $(make env) / make env-script won't actually put the SDK on PYTHONPATH. Update the export to match the template layout (likely $(CURDIR) or a configurable source path).
Address code review findings: - Makefile: fix shell escaping in help target so `make help` does not execute `make env` as a side effect (use `\$$` instead of `$$`). - tests: add executable permission to all 3 new test files. - tests/sdk/test-template-env-targets.sh: fix dead test check where `grep -q | head -1` always succeeds; use proper .PHONY line check. Test status: 60/60 shell tests passed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…16) scripts/mega-planner.py: new standalone 7-stage multi-agent debate pipeline script with full 4-mode CLI (default, --from-issue, --refine-issue, --resolve-issue). Uses only agentize.workflow.api (Session DSL, run_acw, prompt/path/gh utils). scripts/mega-planner.md: documentation for the mega-planner script interfaces. scripts/prompts/: co-located agent prompt files (7 files copied from .claude-plugin/). scripts/prompts/README.md: directory documentation explaining prompt file sources. scripts/README.md: added mega-planner section to scripts directory documentation. python/tests/test_mega_planner.py: 12 tests covering pipeline stages, execution order, prompt rendering, resolve mode, skip_consensus, and feature name extraction. python/agentize/workflow/planner.py: deleted deprecated backward-compat shim (shadowed by planner/ package directory, marked TODO:Delete). python/agentize/workflow/planner.md: deleted documentation for deprecated shim. All 34 tests pass (12 new mega-planner + 22 existing planner). Implements the plan from issue #16.
scripts/mega-planner.py: fix debate report header to list only 5 perspectives (items 6-7 are appended dynamically by caller); pass full feature_desc to consensus prompt instead of truncated feature_name; narrow except clause to specific exception types; replace Optional[str] with str | None for consistency with PEP 604 style.
[feat][#16] Re-implement mega-planner as standalone Python script
Summary
Re-implemented the mega-planner (previously a Claude Code plugin command in
.claude-plugin/commands/mega-planner.md) as a standalone Python script. The script orchestrates a 7-stage multi-agent debate pipeline using theagentize.workflow.apiSession DSL, with co-located prompt files and full 4-mode CLI support.Changes
scripts/mega-planner.py(~500 LOC) implementing the full 7-stage pipeline: understander -> (bold + paranoia in parallel) -> (critique + proposal-reducer + code-reducer in parallel) -> consensus--feature-desc),--from-issue,--refine-issue,--resolve-issuescripts/prompts/for co-location with the scriptscripts/prompts/README.mddocumenting prompt file sources and synchronizationscripts/mega-planner.mddocumenting script interfaces, CLI modes, and internal helpersscripts/README.mdwith mega-planner sectionpython/tests/test_mega_planner.pywith 12 tests covering pipeline stages, execution order, prompt rendering, resolve mode, skip_consensus, and feature name extractionpython/agentize/workflow/planner.py(dead code, shadowed by planner/ package directory, marked "TODO: Delete")python/agentize/workflow/planner.md(docs for deprecated shim)Testing
python/tests/test_mega_planner.pywith 12 tests verifying:Related Issue
Closes #16