Validate Gitignore
code.validate_gitignore
Overview
When you send .gitignore content and an explicit file list, we parse patterns and report whether each path would be ignored, which rule matched, and optional decision traces. We never walk a filesystem or invoke Git — do not use this for real working-tree or global-exclude behavior.
gitignore precedence and negation are subtle. We evaluate your rules deterministically so you know what would be ignored.
Reliability
STRICT and deterministic; last matching pattern wins. Domain errors (not retryable; fix input): GITIGNORE_COMPLEXITY_LIMIT_EXCEEDED (too many files, patterns, or evaluations — reduce inputs); GITIGNORE_PATH_INVALID (absolute or traversal path — send relative safe paths). Syntax errors appear in warnings and set valid=false.
Context footprint
Returns parsed patterns, per-path results, warnings, and _meta. A successful call costs 1 execution credit.
When to use it
When you have .gitignore text and a bounded path list to check.
When you need real working-tree or global-exclude behavior.
Scope
Non-goals
- Does not walk a filesystem
- Does not invoke Git
- Does not support .gitattributes
- Does not apply global excludes implicitly
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
What this means
This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response does not contain submitted content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| gitignore | string | Yes | Exact gitignore rules text. |
| files | array | Yes | From 0 through 100,000 explicit relative paths to evaluate, each a path string or a closed {path, optional isDirectory} object. |
| basePath | string | No | Relative matching prefix; omit it for the empty root. |
| includeDecisionTrace | boolean | No | Whether decision fields are returned; omit it for true. |
| options | object | No | Closed matching options; omit it to apply sensitive matching with decision traces. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| valid | boolean | Yes | Whether no syntax errors occurred. |
| patterns | array | Yes | From 0 through 10,000 usable rules in source order, each a closed line, pattern, negation, directoryOnly and anchored. |
| results | array | Yes | From 0 through 100,000 path verdicts in caller order, each a closed path, ignored flag and matching rule. |
| warnings | array | Yes | From 0 through 10,000 bounded parser warnings, each a closed code, message, line and severity. |
| _meta | object | Yes | Closed bounded evaluation-count receipt with patternCount and fileCount for this run. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"code.validate_gitignore","input":{"gitignore":"*.log\n","files":["a.log","a.txt"]}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("code.validate_gitignore", {"files":["target/a.class","important.txt"],"gitignore":"target/\n!important.txt\n"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
| GITIGNORE_COMPLEXITY_LIMIT_EXCEEDED | 429 | No | A size, quota, rate, or time limit was exceeded. |
| GITIGNORE_PATH_INVALID | 400 | No | The request payload failed this skill's input validation. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not walk a filesystem
- Does not invoke Git
- Does not support .gitattributes
- Does not apply global excludes implicitly
- Evaluating a real working tree
- Global or core.excludesFile behavior
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "code.validate_gitignore",
"input": {
"files": [
"target/a.class",
"important.txt"
],
"gitignore": "target/\n!important.txt\n"
}
}Examples
Negation un-ignores an earlier pattern
{
"files": [
"target/a.class",
"important.txt"
],
"gitignore": "target/\n!important.txt\n"
}{
"warnings": [],
"valid": true,
"_meta": {
"patternCount": 2,
"fileCount": 2
},
"results": [
{
"negation": false,
"path": "target/a.class",
"matchedLine": 1,
"ignored": true,
"matchedPattern": "target/"
},
{
"negation": true,
"path": "important.txt",
"matchedLine": 2,
"ignored": false,
"matchedPattern": "!important.txt"
}
],
"patterns": [
{
"anchored": false,
"negation": false,
"pattern": "target/",
"directoryOnly": true,
"line": 1
},
{
"anchored": false,
"negation": true,
"pattern": "!important.txt",
"directoryOnly": false,
"line": 2
}
]
}Simple glob ignores log files only
{
"files": [
"a.log",
"a.txt"
],
"gitignore": "*.log\n"
}{
"warnings": [],
"valid": true,
"_meta": {
"patternCount": 1,
"fileCount": 2
},
"results": [
{
"negation": false,
"path": "a.log",
"matchedLine": 1,
"ignored": true,
"matchedPattern": "*.log"
},
{
"path": "a.txt",
"ignored": false,
"matchedLine": null,
"matchedPattern": null,
"negation": false
}
],
"patterns": [
{
"anchored": false,
"negation": false,
"pattern": "*.log",
"directoryOnly": false,
"line": 1
}
]
}Recommended use cases
- Preview whether files would be ignored before commit
- Lint .gitignore syntax
- Explain which pattern matched a path
Avoid for
- Evaluating a real working tree
- Global or core.excludesFile behavior
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.