feature-define
Interactive creator for a project feature: scaffolds the domain knowledge markdown at ai-context/features/<slug>.md AND the antenna skill at .claude/skills/<slug>/SKILL.md, both from the canonical templates. Also registers the antenna in the project's CLAUDE.md. Trigger: /feature-define <name>, define feature, documentar funcionalidad, nueva feature.
What this skill does
# feature-define
> Creates the two artifacts every project feature MUST have:
> 1. `ai-context/features/<slug>.md` — the authoritative domain knowledge.
> 2. `.claude/skills/<slug>/SKILL.md` — the antenna that activates on
> triggers and forces a read of the markdown.
>
> Both are scaffolded from `skills/_templates/feature/` in the global
> agent-config repo. The antenna is a pure pointer — it never duplicates
> markdown content.
**Triggers**: `/feature-define`, define feature, nueva feature, documentar feature, documentar funcionalidad, new feature scaffolding
---
## Process
### Step 0 — Guardrails
1. Refuse to run inside the `agent-config` repo itself. Detect via
`file_exists("install.sh") AND dir_exists("skills/_shared")` OR
`basename(cwd) == "agent-config"`. If true, emit:
> "feature-define only runs inside consumer projects. The agent-config
> repo holds the templates, not project features."
Stop.
2. Require a consumer project root: `dir_exists(".claude")` AND
`file_exists("CLAUDE.md")`. If either is missing, emit:
> "Run /project-setup first — this project is not configured for Claude
> Code yet."
Stop.
3. Locate templates at `~/.claude/skills/_templates/feature/`. Required
files:
- `_template.md` — the 6-section domain knowledge template.
- `SKILL.md.template` — the antenna skill template.
If either is missing, emit:
> "Templates not found at ~/.claude/skills/_templates/feature/. Re-run
> install.sh in your agent-config repo to deploy them."
Stop.
---
### Step 1 — Gather feature information
Ask the user, one question at a time. STOP and wait between questions.
1. **Feature name** (human-readable, e.g. "Checkout Flow"). Derive
`feature_slug` = lowercase + hyphens (e.g. `checkout-flow`). Validate:
- Slug matches `^[a-z][a-z0-9-]*$`. Reject otherwise.
- `ai-context/features/<slug>.md` does NOT already exist. If it does,
ask: "A feature file already exists for `<slug>`. Open it, overwrite,
or pick a new slug?" Default: open.
- `.claude/skills/<slug>/` does NOT already exist. Same handling.
2. **One-line purpose**: what user problem does this feature solve?
3. **Sub-flows or subpages** (optional, multi-line): list each with a
one-line description. Used to populate the Domain Overview bullets.
4. **Triggers**: keywords or phrases that, when the user mentions them,
should activate the antenna skill. Suggest defaults derived from the
feature name; let the user confirm or extend. Comma-separated.
5. **External integrations** (optional, multi-line): systems/APIs this
feature talks to. Used to pre-populate the Integration Points table
header — the user fills the details later.
Do NOT ask for business rules, decisions, or gotchas at scaffolding time.
Those are filled in as the feature is built and learned.
---
### Step 2 — Generate the markdown
1. Read `~/.claude/skills/_templates/feature/_template.md`.
2. Replace the title `<Feature Name>` with the user's feature name.
3. Set `Last updated by:` to the git user name (read from
`git config user.name`; fallback to "human").
4. Set `Last run:` to today's date (YYYY-MM-DD).
5. Pre-populate the Domain Overview placeholder with:
- The one-line purpose from Step 1.
- A bullet list of sub-flows from Step 1 (if provided).
6. If integrations were provided in Step 1, leave the Integration Points
table header in place and add one empty row per integration with the
system name pre-filled.
7. Keep all `[auto-updated]` markers intact — they are required by the
contract (see `feature-domain-expert` Pattern 4).
8. Write to `ai-context/features/<slug>.md`. Create the directory if
absent.
---
### Step 3 — Generate the antenna skill
1. Read `~/.claude/skills/_templates/feature/SKILL.md.template`.
2. Replace placeholders:
- `{{feature_slug}}` → the slug from Step 1.
- `{{feature_name}}` → the human-readable name.
- `{{triggers}}` → comma-separated triggers from Step 1.
3. Write to `.claude/skills/<slug>/SKILL.md`. Create the directory if
absent.
---
### Step 4 — Register the antenna in the project CLAUDE.md
1. Read the project's `CLAUDE.md`.
2. Locate the `## Force-read inline` section. If a sub-section "Feature
skills (project-local)" does NOT exist below it, create it with this
header:
```markdown
### Feature skills (project-local)
Each feature with non-trivial domain logic has an antenna skill that
forces a read of `ai-context/features/<slug>.md` when its triggers fire.
| Feature | Antenna | Domain knowledge |
|---------|---------|------------------|
```
3. Append a row for the new feature:
```markdown
| <Feature Name> | `.claude/skills/<slug>/SKILL.md` | `ai-context/features/<slug>.md` |
```
4. If the `Force-read inline` section does not exist at all in the project
CLAUDE.md, do NOT auto-create it — emit a warning instead:
> "Project CLAUDE.md has no '## Force-read inline' section. Add the
> Feature skills block manually (template available in
> docs/templates/project-claude-template.md)."
---
### Step 5 — Summarize and next steps
Emit:
```
Created:
- ai-context/features/<slug>.md (domain knowledge — fill in business
rules, integrations, gotchas as you learn them)
- .claude/skills/<slug>/SKILL.md (antenna — auto-activates on triggers:
<triggers>)
Registered in: CLAUDE.md → Force-read inline → Feature skills (project-local)
Next steps:
1. Open ai-context/features/<slug>.md and add at least one Business Rule
(BR-1). Empty feature files are noise.
2. Restart Claude Code to pick up the new antenna skill in
available-skills.
3. When the feature ships its first change, use /sdd-propose <change> —
the markdown will be preloaded automatically via slug matching.
```
---
## Rules
- MUST NOT run inside the agent-config repo. Templates live there; features
do not.
- MUST refuse if the project is not Claude-configured (no `.claude/` or
`CLAUDE.md`).
- MUST use the canonical 6-section template — never invent new sections.
The contract is owned by `feature-domain-expert`.
- MUST preserve `[auto-updated]` markers in the generated markdown so
`codebase-teach` can later coexist without overwriting human content.
- The antenna skill MUST remain a pure pointer. If the user asks to embed
domain content in the skill, refuse and direct them to edit the markdown
instead.
- MUST NOT pre-populate Business Rules, Decision Log, or Known Gotchas.
Those grow as the feature is built — pre-filling creates fake history.
- MUST register the antenna in the project CLAUDE.md when a Force-read
inline section exists; emit a warning otherwise (no silent skip).
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.