Skip to content
Back to skills

Add Resource Path Convention

ASecurity

Use when writing commands or skills that reference other commands, skills, or scripts — ensures paths resolve correctly across all providers after installation

  • 11 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 29, 2026
developmentnodebackend

Works with

  • cli

Security analysis

A100/100

Scanned November 18, 2026

npx -y skills add brabos-ai/code-addiction --skill add--resource-path-convention --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Resource Path Convention?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add  Resource Path Convention
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/brabos-ai-add-resource-path-convention/badge)](https://www.skillsdirectory.com/skills/brabos-ai-add-resource-path-convention)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add--resource-path-convention
description: Use when writing commands or skills that reference other commands, skills, or scripts — ensures paths resolve correctly across all providers after installation
---

# Resource Path Convention

<!-- uses:
- command: /add-wiki
- script: feature-id.cjs
- script: docs-root.cjs
- mention: add--doc-schemas
-->

Commands and skills in `framwork/.codeadd/` are the source of truth. After build, they are placed in provider-specific directories (`.claude/commands/`, `.agents/skills/`, `.gemini/commands/`, etc.). Hardcoded `.codeadd/` paths to commands or skills break because these directories do not exist in the installed project. Use build-time variables to reference resources.

## When to Use

- Writing a command that references another command (e.g., add-build naming add-review)
- Writing a command or skill that references a skill file
- Reviewing existing commands/skills for broken path references
- Creating new commands in the product registry

## When NOT to Use

- Referencing scripts (`.codeadd/scripts/*.cjs` is always correct — fixed path)
- Referencing project files outside the framework (`src/`, `.codeadd/docs/`, etc.)
- Writing code in `build.js` or `cli/` (these operate on the build/install pipeline, not agent runtime)

## Variables

Build-time variables are available. `build.js` replaces them with the correct provider path during build.

**A fragment's variables are resolved at a different moment, by the same rule.** A fragment under
`fragments/` or `plugins/*/fragments/` is never built: it ships as authored, and the CLI injects it into
the installed commands when a feature or plugin is enabled. The CLI resolves each variable for the
provider of the file it is injecting into, with the rule `build.js` uses —
`cli/tests/fragment-placeholders.test.js` holds the two equal. **Write a fragment exactly as you write a
command.** Until that resolution existed, every variable in a fragment landed raw in the installed file.

### `{{cmd:NAME}}`

Resolves to the full path of a command file for the target provider.

```
{{cmd:add-plan}}

# Claude → .claude/commands/add-plan.md
# Gemini → .gemini/commands/add-plan.toml
```

### `{{skill:NAME/FILE}}`

Resolves to the full path of a skill file. Use `SKILL.md` for the main file, or any sub-file name.

```
{{skill:add--backend-development/SKILL.md}}

# Claude → .claude/skills/add--backend-development/SKILL.md
# Gemini → .gemini/skills/add--backend-development/SKILL.md
```

## .codeadd/scripts/ — literal, no variable

Everything the directory ships is reached by the literal path: `.codeadd/scripts/`.

### Scripts (no variable needed)

Node entries are reached by the literal path — the entries stay the same for every provider and for every install:

```
node .codeadd/scripts/status.cjs
node .codeadd/scripts/done.cjs
```

The shipped `feature-id.cjs` is a Node CommonJS module (global id allocation). Invoke entries with `node .codeadd/scripts/<entry>.cjs`.

### `{{addpath:X}}`

Resolves to the literal `.codeadd/X` path — same across all providers. Use for **runtime paths** that exist in the user's installed project (the installer preserves `.codeadd/`), but are NOT distributed by the build pipeline.

Typical cases: artefacts generated at runtime by commands like `/add-wiki` (which writes `wiki/`), the manifest file, or any artefact materialized in the user's project after install.

```
{{addpath:wiki/domains/backend.md}}  # → .codeadd/wiki/domains/backend.md
{{addpath:manifest.json}}            # → .codeadd/manifest.json
```

**When to use `{{addpath:}}` vs `{{skill:}}`:**

| | `{{skill:NAME/FILE}}` | `{{addpath:skills/NAME/FILE}}` |
|---|---|---|
| Skill exists in the framework's skill source directory | ✅ | ❌ |
| Skill is generated at runtime in user project | ❌ | ✅ |
| Resolves per-provider | ✅ | ❌ (always `.codeadd/`) |

### The docs root is a literal

Outputs live under `.codeadd/docs/` on every provider, always — it never changes and it is data in the user's project, not a framework artefact. Write it literally; there is no variable for it. Searches that name it must pass it explicitly (see `add--doc-schemas`, Docs Branch).

### `{{doc-schema}}`

Resolves to the current doc format version — the one integer declared as `DOC_SCHEMA_VERSION` in `.codeadd/scripts/docs-root.cjs`. Same across all providers, like `{{addpath:}}`. Use it wherever a generated document or a template carries its `schema:` frontmatter line:

```
schema: {{doc-schema}}               # → the integer DOC_SCHEMA_VERSION declares
```

**Never write the number.** A literal `schema: <n>` in markdown source is a build lint warning: the version changes with the doc format, not with the package, and a copy in a file is how the files come to disagree. The variable is refused inside a chosen injection anchor line and inside a `## Materializes` block, as the other variables are.

## Examples

### Correct

```markdown
## STEP 1: Load Context
1. Read {{cmd:add-plan}} — PRIMARY reference
2. Run: node .codeadd/scripts/status.cjs
3. Read {{skill:add--backend-development/SKILL.md}}
4. For layout notation, Read {{skill:add--ux-design/design-contract.md}}
```

### Incorrect

```markdown
## STEP 1: Load Context
Read .codeadd/commands/add-plan.md          ← BROKEN: doesn't exist after install
cat .codeadd/skills/backend-development/SKILL.md  ← BROKEN: wrong path
node .codeadd/scripts/status.cjs             ← CORRECT: scripts are at .codeadd/
```

## Validation Checklist

```
[ ] No raw references to .codeadd/commands/ (use {{cmd:NAME}})
[ ] No raw references to .codeadd/skills/ (use {{skill:NAME/FILE}} for source skills, {{addpath:skills/NAME/FILE}} for runtime-generated skills)
[ ] Script references use .codeadd/scripts/ (literal, no variable)
[ ] Runtime artefacts in installed project use {{addpath:X}}
[ ] Command names match provider-map.json commands keys
[ ] Skill names match provider-map.json skills keys (with add- prefix)
[ ] Skill sub-files exist in the source skill directory
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.