Commit Graph

9 Commits

Author SHA1 Message Date
moilanik
0e6c748374 fix: skip ai-superpower repo itself during project scan
apply.sh was scanning its own directory and creating a recursive .ai
symlink inside .ai/, causing infinite folder nesting in VS Code.

- Skip $SCRIPT_DIR in scan_projects() to prevent self-symlinking
- Remove incorrectly created .ai/.ai symlink and .ai/.gitignore
- Add -root session reset command to ai-root-instructions.md
- Document -root command in README
2026-03-12 10:29:55 +02:00
moilanik
407c0a560c refactor(apply.sh): extract functions + expand clean-code skill
apply.sh:
- refactor entire script into main() + 14 named functions
- fix BSD sed portability: \s → [[:space:]]
- fix set -e traps: replace [[ ]] && cmd with if blocks
- write_version_file in both scan and update mode
- print_summary only in scan mode
- keep 3 justified comments, remove all section headers

clean-code.instructions.md:
- add Newspaper Readability section
- add Single Level of Abstraction (SLAB) section
- add Declarative and Imperative Layers section
- rewrite Comments section (Allowed / Forbidden / The test)
- add guard clause guidance to Functions section
- add "always use braces" rule to Formatting
- add "avoid optical illusions" rule to Formatting
- replace Bash/Python examples with TypeScript
2026-03-09 09:35:27 +02:00
moilanik
102f593909 feat: configurable docs folders + mandatory instructions rules
config.yaml: new repo-root config file with docs_folders list
(docs, documentation, doc). apply.sh reads this list and picks the
first existing folder per project instead of hardcoding docs/.

Instructions:
- core-principles: add No Vibe Coding and No Touching .ai/ sections
- ai-root-instructions: add mandatory instructions block — rules stay
  active for the whole session, not just at start; AI must stop and
  announce if instructions were not loaded
- project-context, docs: updated to list all docs folder alternatives
  and reference config.yaml as the source of truth

FR-5.0 added to apply-requirements.md. README step 4 updated.
2026-03-06 09:42:48 +02:00
moilanik
93b859f508 feat: add --update flag to refresh instructions without full setup
curl ... | bash -s -- --update pulls the latest .ai/ files and exits
without scanning projects or touching docs templates.

Bootstrap captures the pre-pull commit hash and forwards it to local
mode; local mode compares with HEAD and either reports "already up to
date" or prints new commit messages with git log --oneline.

FR-1.5 added to apply-requirements.md. README and apply.md updated.
2026-03-04 10:00:11 +02:00
moilanik
cd6f8b5c81 refactor: symlinks point directly to ai-superpower/.ai/ (revert copy approach)
- remove DEV_ROOT/.ai/ copy step — AI_TARGET = SCRIPT_DIR/.ai (repo)
- remove /dev/tty deleted copy folder from filesystem
- edits to .ai/ from any project land directly in git working tree
- docs/apply-requirements.md: FR-3 rewritten
- README.md: principles, install steps, directory structure updated
2026-03-03 11:49:35 +02:00
moilanik
6c0a40f186 fix: use /dev/tty directly for interactive docs/ prompt
- remove /dev/tty stdin redirect from exec (unreliable on macOS)
- check [[ -e /dev/tty ]] instead of [[ -t 0 ]] — works through curl | bash
- read answer directly from /dev/tty, bypassing piped stdin
2026-03-03 11:32:28 +02:00
moilanik
8d3758cd6c feat: interactive docs/ creation per project
- ask [y/N] per project when docs/ folder is missing
- bootstrap reopens stdin from /dev/tty so prompts work through curl | bash
- fallback to silent skip when stdin is not a TTY (non-interactive)
- docs/apply-requirements.md: FR-1.4 and FR-5.1 updated
2026-03-03 11:28:01 +02:00
moilanik
99d13e6e4a feat: complete apply.sh v1 — summary, guard, dev root install, updated docs
- apply.sh: direct-run guard (only curl | bash allowed)
- apply.sh: DEV_ROOT passed as explicit arg from bootstrap
- apply.sh: .ai/ copied to dev root as real folder; projects symlink there
- apply.sh: counters + detailed summary (version prev→new, templated, refreshed, no-docs)
- apply.sh: find errors silenced, no crash on empty dev root
- .ai-superpower: added warning comment about deletion side effects
- .gitignore: .ai-instructions.conf → .ai-superpower.version
- scripts/: removed (hello.sh, scan-projects-with-git.sh, verify-docs-folder.sh, add-ai-context-to-docs-folder.sh)
- templates: monorepo sections split into AI instructions + developer instructions
- README.md: rewritten to match current architecture and behaviour
- docs/apply-requirements.md: FR-2.4, FR-3, FR-5, FR-6, FR-7, FR-8 updated
- docs/apply-usecases.md: full detailed Mermaid flowchart replacing placeholder
2026-03-03 11:19:35 +02:00
moilanik
0a3c0cc906 test apply script via curl 2026-03-02 14:10:17 +02:00