Commit Graph

23 Commits

Author SHA1 Message Date
Дмитрий 78bb79eb45 feat(brain-plugins): add target field + register Phase 0 plugins in manifest
Implements D9 ENUM (user-level/consumer/user-level+consumer) and closes
Phase 0 install drift (К3) by registering skill-creator and claude-code-setup
in brain manifest. Also tags each entry with category from routing.md §4.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 13:48:03 +03:00
Дмитрий 96b1557fe8 docs(brain): link CLAUDE.md to brain-plugin-routing v1.0
Add short section pointing to new routing document and disabled-in-brain
soft-rule for FD/UPM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 13:46:24 +03:00
Дмитрий a741532d1e feat(brain-plugin-routing): create routing rules v1.0
Normative document for plugin selection in brain repo. Implements design
spec dbd80e9. Covers reestr, disabled-in-brain soft-rule, routing table,
categorization, install checklist, and update procedure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 13:45:34 +03:00
Дмитрий 22eb6abf05 docs(brain-plugin-routing): implementation plan
6 atomic tasks (5 commits + 1 verification) for implementing brain-plugin-routing.md
v1.0 per design spec dbd80e9.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 13:42:58 +03:00
Дмитрий dbd80e9715 docs(brain-plugin-routing): design spec for plugin selection rules
Brainstorming output for resolving 8 sources of ambiguity (К1-К8) when
selecting a plugin while working inside brain repo. Approach A chosen
(separate docs/brain-plugin-routing.md ~275 lines). Decisions D1-D12
locked. Implementation deferred to writing-plans skill.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 13:39:50 +03:00
Дмитрий b58f29d23c docs(brain-v2): Phase 0 meta-foundation analysis
Foundation step for brain v2 — establish canonical structure for skills
and rules. Adds two new meta-plugins to brain stack:
- skill-creator@claude-plugins-official (Anthropic verified)
- claude-code-setup@claude-plugins-official (Anthropic verified)

Phase 0 deliverables:
- preliminary.md: frontmatter conventions diff (Anthropic vs Obra),
  brain v1 inventory (0 custom skills, 17 inherited from 4 plugins),
  initial canonical decision before install
- final.md: post-install findings, divergences from preliminary,
  recommender output (manually applied on brain repo only — Liderra
  scope excluded per user instruction), audit of 17 inherited skills

Key findings:
- Anthropic skill-creator and Obra writing-skills are DIFFERENT
  philosophies (scientific vs disciplinarian), not just complementary.
  Decision: structure from Anthropic + testing from Obra, scoped by
  skill type
- `tools:` frontmatter field is OPTIONAL even in Anthropic canonical
- skill-creator advocates "pushy" descriptions against undertriggering
  (opposite to Obra's "Use when only" rule)
- Anthropic explicit anti-pattern: «If you find yourself writing ALWAYS
  or NEVER in all caps — yellow flag, reframe and explain reasoning»
- ui-ux-pro-max uses LEGACY skill.json format (others use SKILL.md) —
  brain v2 must support both schemas

Recommender external validation added 2 new candidates to shortlist:
plugin-dev (Anthropic) and hookify (Anthropic) — both high-ROI for
brain as plugin distributor.

Install method: Path 2 (manual git clone) — Claude CLI not installed
on machine, VSCode extension doesn't support /plugin install.
Settings.json and installed_plugins.json manually updated outside repo
(in ~/.claude/).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:59:53 +03:00
Дмитрий af32dfcd92 docs(visualizations): rebuild hooks-skills-plugins-map for brain v1.0
Adapt HTML visualization template under actual brain v1.0 state on
2026-05-11. Original copy from Liderra had stale context.

Changes:
- Hero block: date 2026-05-11, edition vIV, deconxt from Liderra
  («четыре MCP-сервера» added to counters)
- §II Hierarchy: remove version suffixes (Pravila_raboty_Claude.md,
  Plugin_stack_rules.md) — brain templates have no versions
- §VI Plugins: claude-md-management now "1 skill + 1 slash-command",
  ui-ux-pro-max stats actualized (67 styles, 161 palette, 57 fonts,
  99 UX guidelines, 25 chart types)
- §VII Skills: lede updated to "28 capabilities (27 skills + 1
  slash-command)"
- §VIII Filesystem: rebuilt to dual-source brain v1.0 model
  (user / brain source / project consumer)
- §XI MCP servers (NEW): 4 servers — magic, playwright, github, semgrep
- §XII Actions renumbered (was §XI)
- §X Graph data: revise-claude-md labeled as command, legend label
  "Скил/команда (28)"
- Footer meta: 2026-05-11, "brain v1.0 / 7 хуков / 4 плагина / 4 MCP
  / 28 capabilities"
- manifest.json SHA-256 hash sync (both project-mode and brain-internal
  entries)

Verified: HTML parses OK, JSON parses OK, hash matches manifest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:59:30 +03:00
Дмитрий 6935049934 chore(gitignore): ignore .claude/ local extension settings
VSCode Claude Code extension creates .claude/settings.local.json with
local permission overrides — these are user-machine-specific and should
not be tracked in the repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:59:09 +03:00
Дмитрий af310ebf7c docs(sessions): followup — close outstanding #4 (gh CLI install)
- gh 2.92.0 installed via choco (winget absent on Server 2022 Eval)
- gh auth already wired via GITHUB_TOKEN env (CoralMinister)
- Token scope: contents:read OK, issues/PRs forbidden
- Memory workspace bootstrapped for c:/моя/проекты/claude-brain/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 07:33:02 +03:00
Дмитрий bb40760a70 docs(sessions): brain v1.0 bootstrap session log
Comprehensive conspectus of the 2026-05-11 bootstrap session:
- Pre-bootstrap decisions (mode 0%, subagent-driven, etc.)
- Phase-by-phase chronology (commits + artifacts + verification outputs)
- 11 bugs discovered and fixed (6 plan + 5 Phase 9 runtime)
- Windows Server 2022 / Git Bash quirks (Cyrillic paths, jq fopen, etc.)
- Outstanding items (Liderra main push deferred, MAGIC_API_KEY rotation deferred)
- Workflow learnings (TDD success, Subagent dispatch granularity, mock CLI patterns)
- Final metrics (14 commits, 8/8 tests, 64/64 hook subtests, 0 leaks)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 07:12:31 +03:00
Дмитрий 52584df34e fix(scripts): 5 critical bugs from Phase 9 self-test
Bug 1: merge-mcp.sh fails on Cyrillic brain repo paths (jq fopen UTF-8 issue)
  → use --argjson with $(cat ...) instead of --slurpfile

Bug 2: install.sh stripped only trailing .template, missed middle .template.
  → strip both '.template.' middle and '.template' trailing patterns

Bug 3: manifest.json used brain-repo paths but verify.sh checked target paths
  → restructure manifest.files into {project-mode, user-mode, brain-internal} maps
  → verify.sh now picks map based on detected target mode

Bug 4: make_backup_dir created empty backup dir, no file preservation
  → rsync/cp -r target tree to backup before any modifications

Bug 5: brain's project-files/README.md overwrote consumer's README.md
  → install.sh now skips brain-internal READMEs in project/user copy loops

Phase 9 self-test re-run on c:/tmp/test-consumer-fix: install + verify both PASS.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
brain-v1.0
2026-05-11 01:24:52 +03:00
Дмитрий 97b5da32bf ci: GitHub Actions workflow — Python syntax + JSON valid + script tests + gitleaks + markdownlint
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 01:07:26 +03:00
Дмитрий 917ef337b2 docs: brain meta documentation + manifest.json
- CLAUDE.md (brain repo meta)
- README.md (root quick start)
- CHANGELOG.md (brain-v1.0 release notes)
- manifest.json (sha256 + min-python + required tools)
- docs/architecture.md (copy of Liderra spec)
- docs/how-to-use-brain.md
- docs/how-to-experiment.md
- docs/secrets-and-tokens.md
- docs/consumer-projects.md
- user-level-files/README.md
- project-files/README.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 01:05:10 +03:00
Дмитрий 3d24925d6e feat(scripts): extract.sh — reverse sync diff/apply for brain templates
Plan simplification: dropped the broken middle elif heuristic that had
unbalanced shell expression. Kept clean two-step fallback: .template
suffix first, bare filename second.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:58:57 +03:00
Дмитрий 6949a9d047 feat(scripts): install.sh — orchestrates project/user mode sync with plugins+MCP
Plan correction E: cp -r replaced with find-loop that strips .template
suffix on copy. Without this Test 3 (project mode: CLAUDE.md copied) can't
pass — fixture creates CLAUDE.md.template, target expects CLAUDE.md.
Real intent: brain stores templates as *.template, consumed without suffix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:58:10 +03:00
Дмитрий dd238e52f4 feat(scripts): verify.sh — .brain-version + sha256 + strict-secrets check
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:57:03 +03:00
Дмитрий ba0a28b2a0 feat(scripts): install-plugins.sh — marketplace add + plugin install + SHA verify
Uses corrected Claude CLI subcommand shape:
  claude plugin marketplace add <repo>   (NOT `claude marketplace add`)
  claude plugin marketplace list
  claude plugin install <name@marketplace>
  claude plugin info <name@marketplace> --json

Includes fallback for environments where `claude` CLI is not in PATH
(VSCode-extension install on Windows): logs manual edit instructions
and exits 0 so the parent installer can continue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:53:48 +03:00
Дмитрий 042316ea6a feat(scripts): setup-secrets.sh — placeholder resolution with --secret/--skip/--list modes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:52:54 +03:00
Дмитрий c37fd3c9e2 feat(scripts): merge-mcp.sh — preserves laravel-boost, replaces brain-managed MCP
Uses jq --slurpfile pattern (NOT broken `.[1].mcpServers` form from plan):
  jq --slurpfile brain "$brain_mcp" \
     '.mcpServers = ((.mcpServers // {}) + $brain[0].mcpServers)' "$target"

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:52:05 +03:00
Дмитрий 0ba32c29dc feat(scripts): merge-settings.sh — jq merge with preservation of theme/editorMode
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:50:56 +03:00
Дмитрий 9557109a17 feat(scripts): common.sh helpers (log_*, require_cmd, make_backup_dir)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:49:39 +03:00
Дмитрий ed9bade863 feat: extract brain artifacts from Liderra + ~/.claude/
project-files/:
- CLAUDE.md.template (266 lines)
- docs/Pravila_raboty_Claude.template.md (720 lines)
- docs/Plugin_stack_rules.template.md (916 lines)
- docs/Tooling.template.md (613 lines)
- docs/CHANGELOG_claude_md.template.md
- docs/visualizations/hooks-skills-plugins-map.html (3122 lines)
- .mcp.json.template (universal: playwright/github/semgrep; laravel-boost dropped)

user-level-files/:
- hooks/ (10 Python files: skill-marker, skill-check, economy-* x8)
- settings-fragment.json (enabledPlugins + permissions + hooks only)
- marketplaces.json (3 sources)
- plugins-manifest.json (4 plugins pinned with gitCommitSha)
- mcp-user.template.json (magic with <<MAGIC_API_KEY>> placeholder)

Gitleaks scan: 0 findings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 00:46:51 +03:00
Дмитрий 1e68fa9361 chore: initial brain repository scaffold
Initialize claude-brain repository with .gitignore and experiments/
placeholder directory.

- .gitignore covers Python artifacts, experiments WIP, secret resolution
  artifacts (*-resolved.json, .brain-deferred-secrets.txt), OS/editor files
- experiments/README.md + .gitkeep preserves directory while ignoring contents
2026-05-11 00:43:26 +03:00