Skip to content

chore(agents): add AI agent skills, security-guard hooks, and MCP config [FTTECH-16437] - #15

Merged
gillesperrin merged 1 commit into
masterfrom
chore/add-ai-agent-skills-and-hooks
Oct 21, 2026
Merged

gillesperrin merged 1 commit into
masterfrom
chore/add-ai-agent-skills-and-hooks

Conversation

@gillesperrin

Copy link
Copy Markdown

What Does It Do?

Adds shared AI agent tooling: branch/commit/PR skills, security-guard hooks, and Linear MCP config for Claude, Cursor, and Codex.

Context

Local agents needed the Mobsuccess workflow skills and safe-shell hooks so branch → commit → Linear ticket → PR can run consistently in this repo.

Test Plan

  • Skills resolve under .cursor/skills, .claude/skills, and .codex/skills
  • Security-guard hook script is executable and its test suite passes
  • Linear MCP config is present in .mcp.json / .cursor/mcp.json
  • No runtime change to the PHP CS Fixer GitHub Action itself

Made with Cursor

Copilot AI lite review requested due to automatic review settings October 21, 2026 16:54
@github-actions github-actions Bot added the chore Chore feature label Oct 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical security-hook and sensitive-file handling issues remain unresolved.

13 open issues
What changed in this PR

Adds shared AI-agent skills, Linear MCP configuration, and security-guard hooks for Claude, Cursor, and Codex.

Changes:

  • Adds branch, PR, and review workflow skills.
  • Configures Linear MCP integrations.
  • Adds security hooks and tests.
File Description
ai-lock.json Records installed skills, MCP, and hook metadata.
.mcp.json Adds global Linear MCP configuration.
.cursor/​mcp.json Adds Cursor Linear MCP configuration.
.cursor/​hooks.json Registers the Cursor security hook.
.codex/​config.toml Adds Codex Linear MCP configuration.
.claude/​settings.json Registers the Claude security hook.
.agents/​skills/​review-pr/​SKILL.md Adds PR review workflow guidance.
.agents/​skills/​check-pr-comment/​SKILL.md Adds review-comment triage workflow.
.agents/​skills/​branch-commit-pr/​SKILL.md Adds automated branch and draft PR workflow.
.agents/​skills/​branch-commit-pr-ticket/​SKILL.md Adds Linear ticket and PR workflow.
.agents/​hooks/​security-guard/​security-guard.sh Implements command and path safety checks.
.agents/​hooks/​security-guard/​test-security-guard.sh Adds security-guard tests.

Review effort: Lite

# Strip quoted strings (single, double, heredoc bodies) to avoid false positives
# on content inside commit messages, echo statements, etc.
local cmd_no_quotes
cmd_no_quotes=$(echo "$cmd" | sed -E "s/'[^']*'//g; s/\"[^\"]*\"//g")
Comment on lines +147 to +148
if echo "$cmd_no_quotes" | grep -qE 'rm[[:space:]]+-[a-zA-Z]*[rR][a-zA-Z]*[fF]?[[:space:]]+(/home|/usr|/var|/etc|/opt|/boot|/bin|/sbin|/lib)(/([[:space:]*]|$)|[[:space:]]|$)'; then
block "Recursive delete on system directories is blocked."
Comment on lines +164 to +166
# Note: We intentionally don't block rm with variable expansion (e.g., rm -rf $DIR)
# because it causes too many false positives for legitimate cleanup operations.
# Users should be careful with unquoted variables in rm commands.
Comment on lines +426 to +427
if echo "$file_path" | grep -qE '^/etc/(passwd|shadow|sudoers|sudoers\.d/|gshadow|master\.passwd|login\.defs|security/)'; then
block "Reading system authentication files is blocked."
Comment on lines +574 to +583
check_mcp_tool() {
local tool_name="$1"

# Block potentially dangerous MCP operations
# Add specific MCP server checks here based on your setup

# Example: block destructive database MCP operations
if echo "$tool_name" | grep -qE 'mcp__.*__(delete|drop|truncate|destroy)'; then
block "Destructive MCP operation detected: $tool_name"
fi
Comment on lines +35 to +39
```bash
git status
git diff --stat
git diff
git log --oneline -1 # Get last commit message if any
Comment on lines +169 to +182
Flag and **STOP the workflow** (do not stage, commit, or push) if any untracked file matches a suspicious pattern:

- Secrets / credentials: `.env`, `.env.*`, `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*secret*`, `*credential*`, `*password*`, `*token*`
- Build / cache artefacts: `*.pyc`, `__pycache__/`, `node_modules/`, `dist/`, `build/`, `.cache/`
- Editor / OS noise: `.DS_Store`, `Thumbs.db`, `*.swp`, `*.swo`, `*~`
- Debug / temp: `*.log`, `*.tmp`, `*.bak`, `debug.*`, `test-output*`

When stopping, tell the user **which files matched** and suggest either adding them to `.gitignore` or reviewing them before proceeding.

If no suspicious files are found, continue to Step 6.

### Step 6: Stage and Commit

- Stage all relevant changes **including untracked files** with `git add -A` (or `git add .`) so new files are never forgotten. Files in `.gitignore` are excluded automatically.
Comment thread ai-lock.json
Comment on lines +88 to +92
"agents": [
"claude-code",
"cursor",
"codex"
],
Comment on lines +26 to +35
bash_input() {
local cmd="$1"
cat <<EOF
{
"session_id": "test-session",
"hook_event_name": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "$cmd"
}
Comment on lines +159 to +164
if [ -f "pnpm-lock.yaml" ]; then
pnpm validate 2>/dev/null || pnpm lint 2>/dev/null || pnpm check 2>/dev/null
elif [ -f "package-lock.json" ]; then
npm run validate 2>/dev/null || npm run lint 2>/dev/null || npm run check 2>/dev/null
elif [ -f "yarn.lock" ]; then
yarn validate 2>/dev/null || yarn lint 2>/dev/null || yarn check 2>/dev/null
@gillesperrin
gillesperrin merged commit 3726046 into master Oct 21, 2026
2 checks passed
@gillesperrin
gillesperrin deleted the chore/add-ai-agent-skills-and-hooks branch October 21, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Chore feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants