gitignore-scaffold

Gitignore pattern setup and directory scaffolding — covers negation patterns, .gitkeep tracking, and git check-ignore verification workflows

5 stars

Best use case

gitignore-scaffold is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Gitignore pattern setup and directory scaffolding — covers negation patterns, .gitkeep tracking, and git check-ignore verification workflows

Teams using gitignore-scaffold should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/gitignore-scaffold/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/development/gitignore-scaffold/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/gitignore-scaffold/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How gitignore-scaffold Compares

Feature / Agentgitignore-scaffoldStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Gitignore pattern setup and directory scaffolding — covers negation patterns, .gitkeep tracking, and git check-ignore verification workflows

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# gitignore-scaffold

## Quick Start

When adding directories that must exist in git but whose contents should be ignored,
use the `directory/*` pattern (not `directory/`) combined with `.gitkeep` negation.

```gitignore
data/standards/promoted/*          # ignore contents
!data/standards/promoted/.gitkeep  # but track .gitkeep
```

## When to Use

- Setting up empty directory structures that must persist in version control
- Adding gitignore rules for data directories, build outputs, or cache folders
- Troubleshooting why `.gitkeep` files are not being tracked

## Workflow

### 1. Create directory structure

```bash
mkdir -p data/standards/promoted
```

### 2. Add `.gitkeep` to empty directories

```bash
touch data/standards/promoted/.gitkeep
```

### 3. Add gitignore patterns

Use `directory/*` form — **never** `directory/` when `.gitkeep` must be tracked.

```gitignore
data/standards/promoted/*
!data/standards/promoted/.gitkeep
```

### 4. Verify with `git check-ignore`

```bash
# Should be ignored (exit 0):
git check-ignore -q "data/standards/promoted/example.csv"

# Should NOT be ignored (exit 1):
git check-ignore -q "data/standards/promoted/.gitkeep"
```

### 5. Regression-test existing patterns

After modifying `.gitignore`, confirm pre-existing patterns still work:

```bash
git check-ignore -q "path/to/known-ignored-file"
```

## Pattern Types — Critical Distinction

| Pattern | Ignores | Negation works? |
|---------|---------|-----------------|
| `directory/` | Directory AND everything inside | No — git skips the entire tree |
| `directory/*` | Only the contents | Yes — individual files can be negated |

**Rule:** Always use `directory/*` when you need to negate specific files inside.

## Common Gotchas

1. **`directory/` kills negation** — the most common mistake. Git never looks inside
   a fully-ignored directory, so `!directory/.gitkeep` has no effect.
2. **Order matters** — the negation line (`!`) must appear *after* the ignore line.
3. **Nested negation** — for deeply nested paths, every ancestor directory must use
   the `/*` form, not the `/` form.
4. **Cached files** — if a file was already tracked before the ignore rule was added,
   `git rm --cached <file>` is required to stop tracking it.
5. **Always verify** — never trust visual inspection of `.gitignore`; run
   `git check-ignore -q` to confirm behavior programmatically.

Related Skills

repo-cleanup-gitignore-updates

5
from vamseeachanta/workspace-hub

Sub-skill of repo-cleanup: Gitignore Updates.

git-sync-manager-1-repository-discovery-from-gitignore

5
from vamseeachanta/workspace-hub

Sub-skill of git-sync-manager: 1. Repository Discovery from .gitignore.

repo-structure-gitignore-enforcement-root-level-output-artifacts

5
from vamseeachanta/workspace-hub

Sub-skill of repo-structure: Gitignore Enforcement: Root-Level Output Artifacts.

test-oversized-skill

5
from vamseeachanta/workspace-hub

A test fixture skill that exceeds 200 lines with multiple H2/H3 sections for split testing.

interactive-report-generator

5
from vamseeachanta/workspace-hub

Generate interactive HTML reports with Plotly visualizations from data analysis results. Supports dashboards, charts, and professional styling.

data-validation-reporter

5
from vamseeachanta/workspace-hub

Generate interactive validation reports with quality scoring, missing data analysis, and type checking. Combines Pandas validation, Plotly visualization, and YAML configuration for comprehensive data quality reporting.

agent-os-framework

5
from vamseeachanta/workspace-hub

Generate standardized .agent-os directory structure with product documentation, mission, tech-stack, roadmap, and decision records. Enables AI-native workflows.

OrcaFlex Specialist Skill

5
from vamseeachanta/workspace-hub

```yaml

repo-ecosystem-hygiene

5
from vamseeachanta/workspace-hub

Interpret the daily read-only repo ecosystem hygiene audit and route remediation through approved workflows.

domain-knowledge-sweep

5
from vamseeachanta/workspace-hub

Systematic multi-source research of an engineering domain. Spawns parent issue → 6 research subissues (Standards, Academic, Industry, LinkedIn-marketing, Code-audit, Synthesis) → gap implementation subissues. Replaces LinkedIn-only extraction with defensible comprehensive sourcing.

subagent-write-verification

5
from vamseeachanta/workspace-hub

Independently verify subagent-claimed file writes with filesystem and git checks before treating the artifact as real, before committing it, and before referencing the path in downstream prompts.

git-operation-serialization-preflight

5
from vamseeachanta/workspace-hub

Before any commit, stash, merge, reset, rebase, or checkout in a multi-agent or shared-checkout environment, run a bounded preflight to detect active git writers and stale index/config locks, then serialize the mutating step under a single-writer guarantee.