Alien-TinyCDB

 view release on metacpan or  search on metacpan

.claude/agents/alien-tinycdb-worker.md  view on Meta::CPAN

---
name: alien-tinycdb-worker
description: "Default Alien::TinyCDB worker — implement, refactor, debug and test this Alien::Base distribution that provides Michael Tokarev's TinyCDB C library to Perl. Owns the alienfile + dist.ini alien_build=1 build config (Alien::Build path),...
model: inherit
allowed-tools: Read, Edit, Write, Bash, Glob, Grep
briefing:
  skills:
    - alien-tinycdb-core
    - perl-alien
    - perl-xs
    - getty-perl-release-author-getty
    - perl-release-dist-ini
    - kanban-issues-karr-cli
---

You are the alien-tinycdb-worker for **Alien::TinyCDB**, an Alien::Base wrapper that hands
the TinyCDB (corpit.ru cdb) C library to XS and FFI consumers via cflags/libs/dynamic_libs.

Implement, refactor, debug and test code in this distribution. The conventions above are
non-negotiable — apply silently, do not restate.

Coordinate via `karr`: pick tickets from the local board, and record drift you find as
new tickets rather than expanding scope mid-change.

## Repo facts that live in no skill

- **The build is configured in the `alienfile` (Alien::Build path).** `[@Author::GETTY]`
  carries `alien_build = 1` and `cpanfile` configure-requires `Alien::Build` /
  `Alien::Build::MM`, so a `Makefile.PL` is generated via `Alien::Build::MM` (MakeMaker

.claude/rules/alien-tinycdb-rules.md  view on Meta::CPAN

Depends on whether the Agent/Task tool is available to you.

- **You can spawn subagents** (orchestrating main agent): Do NOT touch behavior-relevant
  code yourself — delegate. Your lane: coordinate, inspect, plan, review diffs, run
  tests, manage git, edit `Changes`/`README.md`. When in doubt, delegate. Why: only the
  `alien-tinycdb-*` agents get their skills force-loaded via `briefing.skills`; you get no
  briefing and would edit the build config without the Alien and TinyCDB context.

  | Task | Agent |
  |---|---|
  | Implement / refactor / debug the `alienfile`/`dist.ini` build config, the `.pm`, or `t/` | `alien-tinycdb-worker` (default) |
  | Pre-release audit | `alien-tinycdb-release-checker` |

- **You cannot spawn subagents** (you ARE an `alien-tinycdb-*` agent): the lock does not
  apply — implement, refactor, debug and test per these rules.

Behavior-relevant = the `alienfile` build recipe and `dist.ini`'s `alien_build=1` config
(probe/download/build/install), `lib/Alien/TinyCDB.pm`, and `t/`. Prose in `README.md` and
`Changes` bullets are not.

## Coordination — karr board (always in scope)

Ticket coordination is the orchestrating agent's job, so `karr` is always in scope — don't
invoke the `kanban-issues-karr-cli` skill first, just use it. Git-native kanban; state
lives in `refs/karr/*`.

.claude/skills/perl-alien/SKILL.md  view on Meta::CPAN

---
name: perl-alien
description: "Use when a distribution provides a C library or tool through Alien::Build — writing or debugging an alienfile, probe/system/share builds, pkg-config detection, bundling a source tarball, or consuming cflags and libs from Alien::Base i...
---

# Alien — providing a C library to CPAN

An `Alien::Foo` distribution answers one question at install time: **is a usable
libfoo already here, and if not, how is one built?** Everything downstream — the XS
module that links against it, the FFI module that dlopens it — asks the resulting
class for flags and never repeats that logic.

Two halves, both small:

.claude/skills/perl-release-dist-ini/SKILL.md  view on Meta::CPAN

---
name: perl-release-dist-ini
description: "Load when reading, editing or debugging any dist.ini — Perl distributions and plugin bundles (Author::GETTY, Author::ETHER, ...), version config, plugins, prereqs."
user-invocable: false
allowed-tools: Read, Grep
model: sonnet
---

Generic Dist::Zilla dist.ini reference — applies to any distribution regardless of author bundle.
For `[@Author::GETTY]`-specific conventions (next-version semantics, POD commands, bundle options), the getty-perl-release-author-getty skill applies additionally.

When analyzing dist.ini:

.claude/skills/perl-xs/SKILL.md  view on Meta::CPAN

---
name: perl-xs
description: "Use when writing or debugging XS — a .xs file, a typemap, ppport.h, xsubpp errors, C compile errors in generated code, segfaults or leaks at the Perl/C boundary, or wrapping a C library as a Perl distribution."
---

# XS — the Perl/C boundary

An `.xs` file is C with a preprocessor in front of it. `xsubpp` turns each XSUB
declaration into a C function reachable through Perl's calling convention; every
other line lands in the generated `.c` verbatim. So most of an XS file is plain C,
and the XS-specific part is three decisions:

1. **How does a C pointer live inside a Perl SV?** → `sv_magicext` with a per-type

.claude/skills/perl-xs/references/build-and-test.md  view on Meta::CPAN

PERL_DESTRUCT_LEVEL=2 valgrind --leak-check=full perl -Mblib t/03-whatever.t
```

`PERL_DESTRUCT_LEVEL=2` makes Perl free its own arenas at exit, so what valgrind
still reports is yours.

**Blocking.** A C call that hangs turns a failing test into a hanging suite. Guard
any call that can block on the network with `alarm`, so the failure mode is a
reported failure rather than a CI job that runs until the timeout.

For debugging symbols, rebuild with `perl Makefile.PL OPTIMIZE='-g -O0'`.

.claude/skills/perl-xs/references/objects-and-memory.md  view on Meta::CPAN

and widening a struct is a local change while replacing a bare handle is not.

## Allocation and release

| Task | Use | Not |
|---|---|---|
| allocate | `Newx(ptr, n, type)` / `Newxz` (zeroed) | `malloc` |
| free | `Safefree(ptr)` | `free` |
| grow | `Renew(ptr, n, type)` | `realloc` |

Perl's allocators are the ones Perl's own debugging and memory accounting see.
`Newxz` zeroes, which is worth taking: a state enum whose zero value is the initial
state costs nothing to initialise.

## The free hook

```c
static int foo_conn_free(pTHX_ SV *sv, MAGIC *mg) {
    FOO_Conn *self = (FOO_Conn *)(void *)mg->mg_ptr;
    if (self->conn) { foolib_close(self->conn); foolib_free(self->conn); }
    Safefree(self);

CLAUDE.md  view on Meta::CPAN

either a system install or a build from upstream source — via `cflags`/`libs`/`dynamic_libs`.

## Delegation

Delegate behavior-relevant code to the right agent instead of touching it yourself — the
principle, the lane definition and this dist's hazards are in
`.claude/rules/alien-tinycdb-rules.md` (auto-loaded every turn).

| Task | Agent |
|---|---|
| Implement / refactor / debug the `alienfile`/`dist.ini` build config, `lib/Alien/TinyCDB.pm`, or `t/` | `alien-tinycdb-worker` (default) |
| Pre-release audit | `alien-tinycdb-release-checker` |

The agents carry their knowledge via `briefing.skills` (see `.claude/agents/`); the main
agent delegates rather than loading them. The TinyCDB specifics — the `alienfile` build
recipe (the `Alien::Build` path, `alien_build=1`), share-vs-system probing, the shared
library built for FFI, that upstream is fetched not vendored, and the consumer contract —
live in skill `alien-tinycdb-core` under
`.claude/skills/`; the rest of the skills there are hardlinks from the shared library,
maintained via `manage-skills` in their home repos.



( run in 1.370 second using v1.01-cache-2.11-cpan-c32d3c3b8f1 )