feat(flutter-cursor-templates): introduce MCP integration and conventions in project brief

- Added optional MCP integration settings in project-brief.yaml, allowing for environment-based server configurations.
- Introduced conventions for strict package imports to enhance code organization and maintainability.
- Updated brief schema to validate new MCP properties and ensure correct usage.
- Implemented MCP JSON builder to generate .cursor/mcp.json based on project brief settings.
- Enhanced resolver to include MCP configuration in generated files when enabled.

This update improves integration capabilities and enforces coding standards across the project.
This commit is contained in:
2026-05-14 13:33:13 +05:30
parent 2ee257c630
commit da64f769da
109 changed files with 2076 additions and 85 deletions
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Cursor rule hygiene — run from the Flutter app repository root.
# Usage: bash tool/cursor_audit.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
RULES_DIR="$REPO_ROOT/.cursor/rules"
if [[ ! -d "$RULES_DIR" ]]; then
echo "No .cursor/rules at $RULES_DIR — run cursor_gen first."
exit 0
fi
echo "=== Cursor rule audit ==="
echo "Rules without fenced code blocks (\`\`\`):"
missing=0
while IFS= read -r -d '' f; do
if ! grep -q '```' "$f" 2>/dev/null; then
echo " $f"
missing=1
fi
done < <(find "$RULES_DIR" -name '*.mdc' -print0)
if [[ "$missing" -eq 0 ]]; then
echo " (none — every .mdc contains at least one \`\`\` fence)"
fi
echo ""
echo "Rules with alwaysApply: true (should be few):"
grep -rl 'alwaysApply: true' "$RULES_DIR" 2>/dev/null | while read -r p; do echo " $p"; done || true
echo ""
feat_dir="$RULES_DIR/features"
if [[ -d "$feat_dir" ]]; then
echo "Stale feature rules (no lib/features/<name>):"
stale=0
for f in "$feat_dir"/*.mdc; do
[[ -e "$f" ]] || continue
name="$(basename "$f" .mdc)"
if [[ ! -d "$REPO_ROOT/lib/features/$name" ]]; then
echo " STALE: $f"
stale=1
fi
done
if [[ "$stale" -eq 0 ]]; then
echo " (none)"
fi
else
echo "No rules/features/ directory."
fi
echo "=== Done ==="