Repository navigation
chore(agents): add AI agent skills, security-guard hooks, and MCP config [FTTECH-16437] - #15
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
🟡 Changes recommended
Critical security-hook and sensitive-file handling issues remain unresolved.
13 open issues
Quote stripping bypasses command safety checks · New Recursive rm option variants bypass deletion protection · New Variable expansion bypasses recursive deletion protection · New Path traversal bypasses sensitive path checks · New MCP validation ignores destructive tool arguments · New Malformed tool payloads fail open · New Unrestricted git diff exposes sensitive tracked files · New Tracked sensitive files bypass staging safety checks · New Automatic git diff exposes secrets to the agent · New Tracked sensitive changes bypass commit protection · New Codex lacks the advertised security guard hook · New Unescaped JSON command input truncates safety checks · New Validation failures incorrectly trigger fallback commands · New
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 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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
.cursor/skills,.claude/skills, and.codex/skills.mcp.json/.cursor/mcp.jsonMade with Cursor