Skip to content

feat: Add AI-assisted setup path for complex repos (setup.sh --ai) - #2

Draft
mlgitdev wants to merge 3 commits into
itseffi:mainfrom
mlgitdev:feature/complex-repo-auto-setup
Draft

feat: Add AI-assisted setup path for complex repos (setup.sh --ai)#2
mlgitdev wants to merge 3 commits into
itseffi:mainfrom
mlgitdev:feature/complex-repo-auto-setup

Conversation

@mlgitdev

Copy link
Copy Markdown

Summary

  • Adds an AI-installer skill that enables intelligent, complexity-aware setup for existing repositories
  • setup.sh --ai bootstraps workspace infrastructure and invokes the AI which scans, classifies (Zero/Simple/Multi/Complex), proposes config, and writes after approval
  • Supports 4 runtimes: Claude Code, Cursor, Cline, Antigravity
  • Non-destructive: never modifies user files, uses companion file pattern
  • Clean uninstall via setup.sh --remove

Key Features

  • --target <path> — run against any repo without cd
  • --auto — unattended execution (requires explicit --runtime)
  • --dry-run — preview without writing
  • Framework coexistence — defers persona routing when BMAD detected
  • Workspace bootstrapping — copies skills, workflows, dirs into target
  • AI infers GOALS.md from repo structure (replaces questionnaire)

Verification Status

  • ✅ Claude Code — tested against complex tier repo (BMAD, 54 skills, 7 concern folders)
  • ✅ Cursor — tested, generated 4 .cursor/rules/ (806-809), proper numbering, no collisions
  • ✅ Shell tests: 29/29 passed
  • ✅ Python tests: 24/24 passed
  • ⬜ Cline, Antigravity — not tested (no environment), requesting reviewer validation

Test plan

  • Run sh tests/test_setup.sh — all 29 pass
  • Run pytest tests/test_content.py — all 24 pass
  • Run ./setup.sh --ai --target examples/uj-3-flask-simple --runtime claude and invoke /agentic-os-setup
  • Verify setup.sh --remove cleanly removes all generated files
  • Test against your own real-world repo and report unexpected classifications

Planning Methodology

Planned using BMad Method. Artifacts in _bmad-output/prd-ai-assisted-setup-2026-06-20/.

🤖 Generated with Claude Code

Adds an AI-installer skill that enables intelligent, complexity-aware setup
for existing repositories. Users run setup.sh --ai to bootstrap workspace
infrastructure and invoke the AI skill which scans repo structure, classifies
complexity (Zero/Simple/Multi/Complex), proposes configuration proportional
to detected needs, previews as unified diffs, and writes after approval.

Key capabilities:
- Workspace bootstrapping (dirs, skills, workflows, AGENTS.md inference)
- 4 runtime adapters (Claude, Cursor, Cline, Antigravity)
- --target for running against external repos
- --auto for unattended execution (requires explicit --runtime)
- Non-destructive: never modifies user files, companion file pattern
- Framework coexistence (defers persona routing when BMAD detected)
- Clean uninstall via setup.sh --remove (manifest-tracked)
- Test infrastructure: shell + Python tests, 4 UJ-based fixtures

Planned using BMad Method. Planning artifacts in _bmad-output/.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dget

The agentic-os-setup skill instructed the AI to generate a "complete operational
manual" inline in AGENTS.md, contradicting the repo's own progressive-disclosure
principle and producing a fat always-on file that burns tokens every turn and can
overflow the runtime context-file cap.

- SKILL.md: invert the AGENTS.md generation rule — keep always-on RULES inline,
  emit step-by-step PROCEDURES as on-demand skills (task-management,
  orchestration-model). Add a Context Budget rule (~10k char target, ~20k hard cap,
  relocate-not-delete). Update Complex tier expectations and Write Sequence to
  create + manifest + gitignore the emitted skill packs (privacy/removal coverage).
  Add an MCP "on-demand, not all up front" note for the integration tool surface.
- templates/context-budget.md: new keep-inline-vs-emit-as-skill rubric template.
- examples/complex-output.md: demonstrate the split across all four runtimes
  (claude, cursor, cline, antigravity) — lean AGENTS.md managed block + emitted
  task-management skill + per-runtime companion files.
- README.md: align the Memory Stack section with progressive disclosure.

Verified: validate_skills.py (no new failures; resolves 2 prior), test_content.py
24/24, skill evals 6/6, routing evals 5/5, eval-case validation pass.
…4-runtime verification

Follow-up to the progressive-disclosure change. Adds executable guardrails and
real-world test evidence, and stops tracking generated eval output.

- tests/test_content.py: new TestContextBudget class (7 assertions) that locks the
  lean-AGENTS.md contract — the Complex calibration example's managed block must stay
  within budget, carry a "Skills & Workflows" index, and inline NO procedure sections;
  SKILL.md must define the context budget and instruct emitting procedures as on-demand
  skills; the example must cover all four runtimes. Guards against silent regression
  back to the fat operational manual. 24 -> 31 tests, all pass.
- .gitignore: ignore generated eval results (Evals/skills|memory/results/*.json) while
  keeping the READMEs; untrack the 7 result JSONs that were committed upstream. Mirrors
  the existing tests/results/ rule — these are run artifacts, not source.
- pull-request.md: replace the stale "AGENTS.md = full behavioral instructions" notes
  with verified results from running the installer against the architect-docs monorepo
  cloned four times (one runtime each). All four produced a lean AGENTS.md within budget
  (Claude 5.2k, Cursor 4.8k, Cline 4.2k, Antigravity 4.2k), an emitted task-management
  skill, correct BMAD persona deferral, and clean per-runtime files — verified on disk.

Gate: shell 29/29, python 31/31, skill evals 6/6, routing 5/5.
@itseffi

itseffi commented Jun 29, 2026

Copy link
Copy Markdown
Owner

I like the idea and the direction. I checked the current PR head. Shell tests pass, but a few things need fixing before I'd merge this:

  • setup.sh --remove can delete an existing user file like AGENTS.md; it should remove only the managed block
  • manifest paths need to be normalized so uninstall cannot delete outside the target repo
  • python3 scripts/validate_skills.py currently fails
  • tests should cover the uninstall safety cases above

Once those are fixed, happy to re-review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants