Phase 2: Smart para-init - File-Based Setup Scripts#12
Open
brian-lai wants to merge 6 commits into
Open
Conversation
- Create templates/ directory - Copy AGENTS.md to templates/AGENTS.md (10K, 408 lines) - Master template includes complete PARA methodology - Five-step workflow: Plan → Review → Execute → Summarize → Archive - Decision tree for when to use PARA workflow - Context directory structure documented - Token efficiency principles - Tool integration guidance This template will be used by setup scripts to create AGENTS.md in user projects during para-init execution. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create scripts/setup-tier1.sh (88 lines) - Copies AGENTS.md from templates/AGENTS.md - Checks if AGENTS.md already exists (skips if present) - Sets correct file permissions (644) - Includes verbose mode (--verbose) for debugging - Handles errors gracefully with proper exit codes Tier 1 tools (Cursor, Continue.dev) read AGENTS.md natively, so no symlinks are needed. This script simply creates AGENTS.md from the master template. Tested: Successfully detects existing AGENTS.md and skips creation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create scripts/setup-tier2.sh (162 lines) - Ensures AGENTS.md exists (creates from template if needed) - Creates .github/ directory for Copilot symlink - Creates symlink: .github/copilot-instructions.md → ../AGENTS.md (relative) - Creates symlink: GEMINI.md → AGENTS.md (relative) - Checks for existing files and symlinks (skips if present) - Supports --tool=copilot|gemini for selective setup - Includes verbose mode (--verbose) for debugging - Handles errors gracefully with proper exit codes Tier 2 tools (Copilot, Gemini) don't read AGENTS.md natively, so we create symlinks from their expected instruction file locations to AGENTS.md. Tested: Successfully created both symlinks with relative paths verified. - .github/copilot-instructions.md -> ../AGENTS.md - GEMINI.md -> AGENTS.md Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Replace placeholder setup_file_based_tools function with actual implementation - Call setup-tier1.sh for Tier 1 tools (Cursor, Continue.dev) - Call setup-tier2.sh for Tier 2 tools (Copilot, Gemini) - Display clear success messages per tool configured - Show tool capabilities (full PARA vs. methodology-only) - Provide appropriate next steps for each tool type: * Tier 1: Restart IDE, try slash commands * Tier 2: Reload IDE, read AGENTS.md, follow manual workflow End-to-end flow tested: 1. Detection: Found Claude Code, Cursor, Copilot, Gemini 2. Setup: Created AGENTS.md and symlinks (or skipped if existing) 3. Guidance: Clear capabilities and next steps displayed Idempotence verified: - Running para-init multiple times is safe - Existing files are detected and skipped - No errors or duplicate files created Phase 2 file-based setup is now complete! Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
All Phase 2 objectives achieved: - ✅ Templates created (templates/AGENTS.md) - ✅ Tier 1 setup script (scripts/setup-tier1.sh) - ✅ Tier 2 setup script (scripts/setup-tier2.sh) - ✅ Integration into para-init complete - ✅ End-to-end testing successful - ✅ Idempotence verified Phase 2 is ready for review and PR creation. Next: Phase 3 (User Experience & Display) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Phase 2: File-Based Setup Scripts
This PR implements the actual file creation logic for PARA-Programming setup, completing the smart initialization system started in Phase 1.
Plan:
context/plans/2026-02-02-smart-para-init-auto-detection.mdBranch:
para/smart-para-init-phase-2Phase: 2 of 4
📦 What's Included
1. Master Template (
templates/AGENTS.md- 408 lines)Complete PARA-Programming methodology template used by setup scripts:
This becomes the single source of truth for AGENTS.md across all projects.
2. Tier 1 Setup Script (
scripts/setup-tier1.sh- 88 lines)For: Cursor, Continue.dev (Full PARA Support)
Creates AGENTS.md without symlinks (tools read it natively):
Features:
Output:
3. Tier 2 Setup Script (
scripts/setup-tier2.sh- 162 lines)For: GitHub Copilot, Gemini (Methodology Only)
Creates AGENTS.md + symlinks (tools need specific file locations):
Features:
.github/directory for Copilot.github/copilot-instructions.md→../AGENTS.mdGEMINI.md→AGENTS.md--tool=copilot|geminiOutput:
4. Integration into para-init
Updated:
setup_file_based_tools()function inscripts/para-initReplaced placeholder with actual implementation:
setup-tier1.shfor Tier 1 toolssetup-tier2.shfor Tier 2 toolsExample output:
✅ Success Criteria Met
🧪 Testing
Test 1: Tier 1 Setup (Cursor)
✅ Result: AGENTS.md created with correct content and permissions
Test 2: Tier 2 Setup (Copilot + Gemini)
✅ Result: AGENTS.md + both symlinks created with relative paths
Test 3: Symlink Verification
✅ Result: Both symlinks use relative paths (not absolute)
Test 4: End-to-End para-init
$ ./scripts/para-init [Detects: Claude Code, Cursor, Copilot, Gemini] [Shows Claude plugin instructions] [Creates AGENTS.md and symlinks] [Displays capabilities and next steps] ✅ Setup complete!✅ Result: Full flow works, all tools configured correctly
Test 5: Idempotence
$ ./scripts/para-init ⚠️ AGENTS.md already exists (skipping) ⚠️ .github/copilot-instructions.md already exists (skipping) ⚠️ GEMINI.md already exists (skipping) ✅ Setup complete!✅ Result: Running twice is safe, existing files detected and skipped
📝 Implementation Notes
Design Decisions
1. Templates Directory
Created
templates/to hold the master AGENTS.md template. This provides:2. Separate Tier Scripts
Split into
setup-tier1.shandsetup-tier2.shbecause:3. Relative Symlinks
Always use relative paths (never absolute) because:
4. Idempotence by Design
All scripts check for existing files before creating:
para-initmultiple timesFile Structure
🔄 What's Next
Phase 3: User Experience & Display
Phase 2 establishes the core file creation logic. Phase 3 will polish the UX.
🚀 Ready for Review
This PR is complete and ready for review. Phase 2 delivers on the promise of smart, automatic setup.
Review checklist:
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com