Metadata-Version: 2.4
Name: ignorecraft
Version: 0.0.2
Summary: Compile Git ignore policies with preserved custom rules and versioned upstream templates
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
License-File: pkg/gitignore_policy/data/NOTICE.md
Keywords: gitignore,git,templates,compiler
Author: Astrivant LLC
Requires-Python: >=3.12,!=3.14.1,<4
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Version Control :: Git
Project-URL: Documentation, https://github.com/astrivant/ignorecraft/tree/main/docs
Project-URL: Homepage, https://github.com/astrivant/ignorecraft
Project-URL: Issues, https://github.com/astrivant/ignorecraft/issues
Description-Content-Type: text/markdown

# Ignorecraft

[![Measured coverage](https://raw.githubusercontent.com/astrivant/ignorecraft/gh-pages/badges/coverage.svg)](https://github.com/astrivant/ignorecraft/tree/gh-pages/badges)

Your project changes. Its ignore rules should keep up without erasing the exceptions
you maintain. Ignorecraft turns repository filenames into a reviewable `.gitignore`,
using Toptal's template catalog and a versioned archive of the responses.

<!-- toc:start -->
**Table of contents**

- [Quick start](#quick-start)
- [Why Ignorecraft](#why-ignorecraft)
- [How it fits together](#how-it-fits-together)
- [Inputs and commands](#inputs-and-commands)
- [Develop and integrate](#develop-and-integrate)
<!-- toc:end -->

## Quick start

Requires Python 3.12+ (excluding 3.14.1) and Git. From this checkout:

```bash
python -m pip install .
ignorecraft plan --repo /existing/project
ignorecraft update --repo /existing/project
ignorecraft update --repo /existing/project --write
```

Review the plan and diff before applying them. Network access is needed for missing
or expired templates. The package is prepared for PyPI publication; the first
published version will make `python -m pip install ignorecraft` available.

## Why Ignorecraft

- **Keep your exceptions.** Generated rules and custom rules have separate,
  integrity-checked boundaries. Refreshes preserve your custom bytes and ordering.
- **See why a template applies.** Category selection reports filename evidence;
  explicit include/exclude options handle unusual toolchains.
- **Review upstream changes.** Public responses retain their hashes, observation
  times and separate diffs. Repeated use cannot postpone the weekly refresh.
- **Catch accidental staging.** An offline hook reports newly staged ignored files,
  macOS metadata and downloaded Helm dependencies without changing the index.

## How it fits together

```mermaid
flowchart LR
    git[Git filenames] --> detect[Category evidence]
    detect --> request[Public template request]
    request --> cache[Hashed response archive]
    cache --> compiler[Policy compiler]
    custom[Existing custom rules] --> compiler
    compiler --> preview[Reviewable diff]
    preview -->|explicit write| policy[.gitignore]
    classDef source fill:#F8F9F4,stroke:#647D8B,color:#243746
    classDef process fill:#F8F9F4,stroke:#829B85,color:#243746
    class git,custom,cache,policy source
    class detect,request,compiler,preview process
```

Only category names leave the machine. Detection reads filenames, does not execute
project manifests and does not upload source contents. The runtime has no external
Python dependencies. Learn about [cache integrity and customization](docs/cache.md).

## Inputs and commands

| Input | Purpose |
| --- | --- |
| `--repo PATH` | Existing checkout; defaults to the current directory |
| `--cache PATH` | Writable archive; defaults to `$XDG_DATA_HOME/gitignore-policy` or `~/.local/share/gitignore-policy` |
| `--include CATEGORY` | Add an exact catalog category; repeatable |
| `--exclude CATEGORY` | Remove a category, including inferred ones; repeatable |
| `--platform` | `darwin`, `linux`, `win32` or `none`; defaults to the host |
| `--refresh` | Refresh immediately; otherwise refresh missing or expired observations |
| `--write` | Apply the proposed update; omitted by default |
| `XDG_DATA_HOME` | Base directory for the default persistent cache |

```bash
ignorecraft catalog --match python
ignorecraft plan --repo . --include vscode --exclude node
ignorecraft check --repo .
```

`check` is offline. It never changes cache timestamps, stages files or deletes them.
The existing `gitignore-policy` command and `gitignore_policy` import remain
available; both commands use the same implementation and cache contract.

## Develop and integrate

See [development and hooks](docs/development.md), [release verification](docs/releases.md)
and the [portable agent guide](SKILL.md) ([online](https://github.com/astrivant/ignorecraft/blob/main/SKILL.md)).
The agent guide distinguishes remote inspection from commands requiring a checkout.

Ignorecraft's compiler is [Apache-2.0 licensed](LICENSE). Cached templates retain
their [provider attribution and separate CC0 terms](pkg/gitignore_policy/data/NOTICE.md).
Development helpers retain their [individual notices](scripts/NOTICE.md).

