Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .cursor/AI-access-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# AI Access Policy

AI-ассистент всегда имеет полный доступ ко всем файлам проекта (включая memory-bank, .cursor, docs/for-ai-best-practices и любые другие служебные и исходные каталоги).

- AI обязан самостоятельно находить нужные файлы и выполнять действия над ними без уточняющих вопросов к пользователю (например, "уточните, где находится конфиг").
- Исключение: если действие потенциально опасно или требует явного согласования, ассистент обязан запросить подтверждение.
- Это правило приоритетно для всех AI-операций в проекте.
11 changes: 11 additions & 0 deletions .cursor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## AI Access Policy

См. [AI-access-policy.md](./AI-access-policy.md) — политика полного доступа AI-ассистента ко всем файлам проекта и проактивных действий.

---

## Environment Parameters

См. [rules/environment.yaml](rules/environment.yaml) — параметры операционной и тестовой среды, доступные AI-ассистенту для автоматизации и диагностики.

---
9 changes: 8 additions & 1 deletion .cursor/rules/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# .cursor/rules/ — Modular Rules for Cursor AI
# .cursor/rules: Project Rules & AI Onboarding

This directory contains all rules and standards for automation and AI assistants in the Agent Plugins Platform.

Expand Down Expand Up @@ -82,6 +82,12 @@ This directory contains all rules and standards for automation and AI assistants
workflow.mdc
```

<<<<<<< HEAD
## Кросс-ссылки на организационные best practices

- [Инструкция по переносу best practices и автоматизаций](../../docs/for-ai-best-practices/transfer-best-practices.md)
- [Организационные знания и правила (memory-bank)](../../memory-bank/README.md)
=======
---
## AI Fallback Rule

Expand All @@ -93,6 +99,7 @@ If an AI agent cannot answer a question from its own memory-bank, it must first

https://github.com/LebedevIV/agent-plugins-platform-boilerplate
---
>>>>>>> origin/develop

## How to Use
- The AI assistant should always refer to specific .mdc files when making decisions
Expand Down
33 changes: 33 additions & 0 deletions .cursor/rules/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
os: Manjaro Linux (Plasma)
os_version: 6.12.37-1-MANJARO
os_arch: x64
cursor:
version: 1.2.4
vscode_version: 1.99.3
commit: a8e95743c5268be73767c46944a71f4465d05c90
build_date: 2025-07-10T16:59:43.242Z
electron: 34.5.1
chromium: 132.0.6834.210
node: 20.19.0
v8: 13.2.152.41-electron.0
browser:
main: Chrome
main_version: 138.0.7204.100
install: Flatpak
test: Chromium
test_version: 138.0.7204.100
test_install: official repo (external), required for test automation
editor: Cursor
chrome_launch: Flatpak, custom args possible
debug_tools:
- Cursor
- Debugger for Chrome
- Composer Web
preferred_doc_lang: en
devtools_note: F12 only for main page, inspect sidepanel via context menu
extension_tab_name: Agent Platform Tools
ai_file_access: true # AI assistant has full access to all project files
cli_tools:
- git
- gh (GitHub CLI)
# Add more CLI tools as needed
5 changes: 5 additions & 0 deletions .cursor/rules/workflow/branches.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
- For bugfixes, use the prefix `fix/` and a clear description of the problem.
- Never mix bugfixes and features in the same branch.
- After merging a bugfix, update feature branches via rebase/merge from develop.
- Direct commits or merges to `main` and `develop` are strictly forbidden. All changes must go through pull requests into `develop` only.
- Merging to `main` is allowed only from `develop` after release approval.
- **Branch Purpose Tracking:** Before starting a new, unrelated task, you must finish the current branch (commit, push, PR, merge) and only then create a new branch for the next task. This prevents mixing tasks and improves review clarity. Exceptions: urgent bugfixes (fix/).

# Examples
- ✅ `feature/pyodide-integration`
- ✅ `fix/tailwindcss-build-script`
- ❌ `feature/pyodide-integration` + unrelated refactor in same branch

description:
globs:
alwaysApply: false
Expand Down
4 changes: 3 additions & 1 deletion .cursor/rules/workflow/workflow.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

- В ветке main запрещено вести работу. main используется только для релизов и production.
- В ветке develop запрещено вести работу напрямую. Все изменения — только через feature-ветки с именованием feature/{смысловое_название}, которые создаются автоматически по смыслу задачи.
- Слияние feature-веток только через pull request.
- Слияние feature-веток только через pull request в develop.
- Прямой merge или commit в main и develop запрещён.
- В main разрешён merge только из develop после релизного ревью.
- Все PR должны содержать описание изменений, ссылки на документацию и changelog.
description:
globs:
Expand Down
3 changes: 3 additions & 0 deletions .git-secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
secrets.json
undefined
undefined
58 changes: 33 additions & 25 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<!-- Note: Please ensure your PR is targeting the `dev` branch -->

<!-- Describe what this PR is for in the title. -->

> `*` denotes required fields

## Priority*

- [ ] High: This PR needs to be merged first, before other tasks.
- [x] Medium: This PR should be merged quickly to prevent conflicts due to common changes. (default)
- [ ] Low: This PR does not affect other tasks, so it can be merged later.

## Purpose of the PR*
<!-- Describe the purpose of the PR. -->

## Changes*


## How to check the feature
<!-- Describe how to check the feature in detail -->
<!-- If there are any visual changes, please attach a screenshot for easy identification. -->


## Reference
<!-- Any helpful information for understanding the PR. -->
# Pull Request: [Краткое описание изменений]

## Описание
<!-- Опишите, что изменено, зачем и для кого. Укажите, какие правила, best practices или задачи покрывает этот PR. -->

- [ ] Тип изменений: feature / fix / docs / chore / refactor
- [ ] Ссылка на задачу/issue: <!-- #номер_задачи или короткое описание -->
- [ ] Краткое описание изменений:
-
-

## Чек-лист
- [ ] Все изменения оформлены через отдельную ветку (feature/fix/doc/...)
- [ ] Нет прямых коммитов в main/develop
- [ ] Все тесты (CI) проходят успешно
- [ ] Документация и changelog обновлены
- [ ] Кросс-ссылки на правила и best practices добавлены
- [ ] **Перед началом новой задачи завершена текущая ветка (commit, push, PR, merge), новая ветка создана только после merge**

## Ссылки и документация
- [ ] [README](../README.md)
- [ ] [Best Practices](../docs/for-ai-best-practices/README.md)
- [ ] [Workflow & Branch Protection](../docs/for-ai-best-practices/development-principles.md)
- [ ] [Cursor Rules Index](../.cursor/rules/index.mdc)

## Требования к ревью
- [ ] Проверить соответствие workflow и защите веток
- [ ] Проверить кросс-ссылки и описание
- [ ] Оставить комментарии или одобрить PR

---

_Этот шаблон подставляется автоматически для всех новых Pull Request. Следуйте структуре для ускорения ревью и автоматизации!_
25 changes: 25 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Security Audit

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run pnpm audit
run: pnpm audit --audit-level=moderate
21 changes: 21 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Danger PR Checks

on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
danger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx danger ci --dangerfile danger/dangerfile.js
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit "$1"
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
#!/bin/sh
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" = "main" ] || [ "$branch" = "develop" ]; then
echo "\e[31mDirect commit to $branch is forbidden! Use PRs and merge only from allowed branches.\e[0m"
exit 1
fi

bash bash-scripts/prevent-branch-mixing.sh || exit 1

pnpm dlx lint-staged --allow-empty
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh
bash bash-scripts/prevent-main-develop-push.sh
bash bash-scripts/prevent-branch-mixing.sh --push || exit 1
21 changes: 21 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"branches": ["main", { "name": "develop", "prerelease": true }],
"plugins": [
["@semantic-release/commit-analyzer"],
["@semantic-release/release-notes-generator"],
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md", "package.json", "packages/*/package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
["@semantic-release/github"]
]
}
Empty file added CHANGELOG.md
Empty file.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Agent-Plugins-Platform
# Agent Plugins Platform

Браузерное расширение, которое позволяет выполнять Python плагины в браузере с использованием Pyodide и MCP протокола.

Expand Down Expand Up @@ -176,8 +176,16 @@ MIT License - см. файл [LICENSE](LICENSE)
- Все тестовые скрипты и логи рекомендуется запускать и смотреть именно в этой вкладке или через боковую панель расширения.
- Название вкладки уникальное, чтобы не путать с системной вкладкой DevTools.

<<<<<<< HEAD
## Организационные best practices и автоматизация

- [Инструкция по переносу best practices и автоматизаций (для пользователя)](docs/transfer-best-practices-user.md)
- [AI best practices (только для AI-ассистентов, EN)](docs/for-ai-best-practices/README.md)
- [Организационные знания и правила (memory-bank, EN, только для AI)](memory-bank/README.md)
=======
---
## AI Knowledge Fallback

If the AI agent cannot answer a question from its own memory-bank, it must first consult the .cursor/rules directory, and if no answer is found there, then consult the memory-bank directory. See [.cursor/rules/doc/ai-fallback.rules.md](.cursor/rules/doc/ai-fallback.rules.md) for details.
---
>>>>>>> origin/develop
36 changes: 36 additions & 0 deletions bash-scripts/prevent-branch-mixing.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

branch=$(git rev-parse --abbrev-ref HEAD)

# Определяем тип ветки (feature, fix, chore, docs, refactor)
if [[ "$branch" =~ ^(feature|fix|chore|docs|refactor)/ ]]; then
branch_type=${BASH_REMATCH[1]}
else
branch_type=""
fi

# Получаем последний коммит-месседж (для pre-commit) или все новые коммиты (для pre-push)
if [[ "$1" == "--push" ]]; then
# Для pre-push: анализируем все новые коммиты
range=$(git rev-list --branches --not --remotes | head -n 1)..HEAD
messages=$(git log $range --pretty=%s)
else
# Для pre-commit: анализируем staged коммит
messages=$(git log -1 --pretty=%s)
fi

# Проверяем, есть ли в коммит-месседже другой тип задачи
for msg in $messages; do
if [[ "$msg" =~ ^(feature|fix|chore|docs|refactor)/ ]]; then
msg_type=${BASH_REMATCH[1]}
if [[ "$branch_type" != "$msg_type" ]]; then
echo -e "\e[31m[Branch Purpose Rule]\e[0m Ветка $branch предназначена для задач типа $branch_type, но коммит содержит задачу типа $msg_type. Завершите текущую ветку (commit, push, PR, merge) перед началом новой задачи!"
exit 1
fi
fi
# Можно добавить дополнительные проверки по ключевым словам
# Например, если в коммите есть 'new feature' в ветке fix/
# ...
done

exit 0
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
35 changes: 35 additions & 0 deletions danger/dangerfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Dangerfile for Agent-Plugins-Platform

// Проверка наличия описания PR
if (!danger.github.pr.body || danger.github.pr.body.length < 20) {
warn('PR description is too short or missing. Please provide a detailed description of your changes.');
}

// Проверка наличия changelog (если изменён src/ или core/)
const hasChangelog = danger.git.modified_files.some(f => f.toLowerCase().includes('changelog'));
const hasSrcChange = danger.git.modified_files.some(
f =>
f.startsWith('src/') ||
f.startsWith('core/') ||
f.startsWith('chrome-extension/src/') ||
f.startsWith('platform-core/'),
);
if (hasSrcChange && !hasChangelog) {
warn('You changed source code but did not update the CHANGELOG. Please add a changelog entry.');
}

// Проверка наличия кросс-ссылок на правила/документацию
if (
!danger.github.pr.body ||
!danger.github.pr.body.match(
/(best practices|workflow|branch|progress|cursor rules|development-principles|memory-bank)/i,
)
) {
warn('PR description should include cross-references to rules, best practices, or documentation.');
}

// Проверка обновления документации при изменениях в src/
const hasDocsChange = danger.git.modified_files.some(f => f.startsWith('docs/') || f.startsWith('memory-bank/'));
if (hasSrcChange && !hasDocsChange) {
message('Consider updating documentation if your code changes affect usage, architecture, or workflow.');
}
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Документация проекта

## Организационные best practices и автоматизация

- [Инструкция по переносу best practices и автоматизаций (для пользователя)](transfer-best-practices-user.md)
- [AI best practices (только для AI-ассистентов, EN)](for-ai-best-practices/README.md)
- [Организационные знания и правила (memory-bank, EN, только для AI)](../memory-bank/README.md)
1 change: 1 addition & 0 deletions docs/api/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
1 change: 1 addition & 0 deletions docs/api/assets/hierarchy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
window.hierarchyData = 'eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzytWsqqurQUAmx4Kpg==';
Loading
Loading