aiblueprint-cli 1.4.59 → 1.4.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -36
- package/agents-config/agents/action.md +1 -1
- package/agents-config/agents/explore-codebase.md +53 -53
- package/agents-config/agents/explore-docs.md +50 -69
- package/agents-config/agents/websearch.md +36 -40
- package/agents-config/claude-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
- package/agents-config/claude-config/scripts/CLAUDE.md +10 -4
- package/agents-config/claude-config/scripts/bun.lockb +0 -0
- package/agents-config/claude-config/scripts/package.json +22 -30
- package/agents-config/claude-config/scripts/statusline/CLAUDE.md +37 -155
- package/agents-config/claude-config/scripts/statusline/README.md +18 -94
- package/agents-config/claude-config/scripts/statusline/defaults.json +13 -10
- package/agents-config/claude-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -4
- package/agents-config/claude-config/scripts/statusline/fixtures/test-input.json +4 -4
- package/agents-config/claude-config/scripts/statusline/src/commands/interactive-config.ts +403 -0
- package/agents-config/claude-config/scripts/statusline/src/index.ts +33 -82
- package/agents-config/claude-config/scripts/statusline/src/lib/config-types.ts +7 -1
- package/agents-config/claude-config/scripts/statusline/src/lib/formatters.ts +40 -0
- package/agents-config/claude-config/scripts/statusline/src/lib/presets.ts +13 -13
- package/agents-config/claude-config/scripts/statusline/src/lib/render-pure.ts +24 -5
- package/agents-config/claude-config/scripts/statusline/statusline.config.free.json +79 -0
- package/agents-config/claude-config/scripts/statusline/statusline.config.json +77 -77
- package/agents-config/commands/prompts/create-vitejs-app.md +272 -0
- package/agents-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
- package/agents-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
- package/agents-config/commands/prompts/nextjs-setup-project.md +200 -0
- package/agents-config/commands/prompts/prompt.md +55 -0
- package/agents-config/commands/prompts/saas-challenge-idea.md +135 -0
- package/agents-config/commands/prompts/saas-create-architecture.md +242 -0
- package/agents-config/commands/prompts/saas-create-headline.md +132 -0
- package/agents-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
- package/agents-config/commands/prompts/saas-create-legals-docs.md +176 -0
- package/agents-config/commands/prompts/saas-create-logos.md +240 -0
- package/agents-config/commands/prompts/saas-create-prd.md +195 -0
- package/agents-config/commands/prompts/saas-create-tasks.md +240 -0
- package/agents-config/commands/prompts/saas-define-pricing.md +293 -0
- package/agents-config/commands/prompts/saas-find-domain-name.md +190 -0
- package/agents-config/commands/prompts/saas-implement-landing-page.md +257 -0
- package/agents-config/commands/prompts/setup-tmux.md +160 -0
- package/agents-config/commands/prompts/tools.md +148 -0
- package/agents-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
- package/agents-config/scripts/CLAUDE.md +37 -0
- package/agents-config/scripts/biome.json +37 -0
- package/agents-config/scripts/bun.lockb +0 -0
- package/agents-config/scripts/package.json +24 -0
- package/agents-config/scripts/statusline/CLAUDE.md +87 -0
- package/agents-config/scripts/statusline/README.md +117 -0
- package/agents-config/scripts/statusline/__tests__/context.test.ts +229 -0
- package/agents-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
- package/agents-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
- package/agents-config/scripts/statusline/defaults.json +82 -0
- package/agents-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
- package/agents-config/scripts/statusline/fixtures/test-input.json +35 -0
- package/agents-config/scripts/statusline/src/commands/interactive-config.ts +403 -0
- package/agents-config/scripts/statusline/src/index.ts +141 -0
- package/agents-config/scripts/statusline/src/lib/config-types.ts +110 -0
- package/agents-config/scripts/statusline/src/lib/config.ts +21 -0
- package/agents-config/scripts/statusline/src/lib/context.ts +103 -0
- package/agents-config/scripts/statusline/src/lib/formatters.ts +426 -0
- package/agents-config/scripts/statusline/src/lib/git.ts +100 -0
- package/agents-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
- package/agents-config/scripts/statusline/src/lib/presets.ts +177 -0
- package/agents-config/scripts/statusline/src/lib/render-pure.ts +516 -0
- package/agents-config/scripts/statusline/src/lib/types.ts +36 -0
- package/agents-config/scripts/statusline/src/lib/utils.ts +15 -0
- package/agents-config/scripts/statusline/statusline.config.free.json +79 -0
- package/agents-config/scripts/statusline/statusline.config.json +79 -0
- package/agents-config/scripts/statusline/test-with-fixtures.ts +37 -0
- package/agents-config/scripts/statusline/test.ts +20 -0
- package/agents-config/scripts/statusline/tsconfig.json +27 -0
- package/agents-config/scripts/tsconfig.json +27 -0
- package/agents-config/skills/{subagent-creator → agents-managers}/SKILL.md +47 -47
- package/agents-config/skills/{subagent-creator/references/subagents.md → agents-managers/references/agents.md} +45 -45
- package/agents-config/skills/{subagent-creator → agents-managers}/references/context-management.md +20 -20
- package/agents-config/skills/{subagent-creator → agents-managers}/references/debugging-agents.md +27 -27
- package/agents-config/skills/{subagent-creator → agents-managers}/references/error-handling-and-recovery.md +19 -19
- package/agents-config/skills/{subagent-creator → agents-managers}/references/evaluation-and-testing.md +29 -29
- package/agents-config/skills/{subagent-creator → agents-managers}/references/orchestration-patterns.md +5 -5
- package/agents-config/skills/{subagent-creator/references/writing-subagent-prompts.md → agents-managers/references/writing-agent-prompts.md} +23 -23
- package/agents-config/skills/codex-environment/SKILL.md +2 -0
- package/agents-config/skills/commit/SKILL.md +2 -0
- package/agents-config/skills/create-pr/SKILL.md +2 -0
- package/agents-config/skills/environments-manager/SKILL.md +271 -0
- package/agents-config/skills/environments-manager/examples/claude/.worktreeinclude +3 -0
- package/agents-config/skills/environments-manager/examples/claude/commands/dev.md +5 -0
- package/agents-config/skills/environments-manager/examples/claude/commands/lint.md +5 -0
- package/agents-config/skills/environments-manager/examples/claude/commands/test.md +5 -0
- package/agents-config/skills/environments-manager/examples/claude/commands/typecheck.md +5 -0
- package/agents-config/skills/environments-manager/examples/claude/settings.json +24 -0
- package/agents-config/skills/environments-manager/examples/codex/environments/environment.toml +29 -0
- package/agents-config/skills/environments-manager/examples/cursor/worktrees.json +3 -0
- package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-create.sh +96 -0
- package/agents-config/skills/environments-manager/examples/scripts/claude-worktree-remove.sh +66 -0
- package/agents-config/skills/environments-manager/examples/scripts/dev.sh +15 -0
- package/agents-config/skills/environments-manager/examples/scripts/worktree-down.sh +22 -0
- package/agents-config/skills/environments-manager/examples/scripts/worktree-up.sh +50 -0
- package/agents-config/skills/environments-manager/references/claude.md +156 -0
- package/agents-config/skills/environments-manager/references/codex.md +97 -0
- package/agents-config/skills/environments-manager/references/cursor.md +88 -0
- package/agents-config/skills/fix-pr-comments/SKILL.md +2 -0
- package/agents-config/skills/grill-me/SKILL.md +10 -0
- package/agents-config/skills/merge/SKILL.md +2 -0
- package/agents-config/skills/rules-manager/SKILL.md +191 -0
- package/agents-config/skills/rules-manager/references/agents-vs-claude.md +66 -0
- package/agents-config/skills/rules-manager/references/examples.md +117 -0
- package/agents-config/skills/skill-manager/SKILL.md +83 -0
- package/agents-config/skills/skill-manager/references/claude-code.md +81 -0
- package/agents-config/skills/skill-manager/references/codex.md +288 -0
- package/agents-config/skills/skill-manager/references/cursor.md +125 -0
- package/agents-config/skills/ultrathink/SKILL.md +2 -0
- package/package.json +1 -1
- package/agents-config/claude-config/scripts/statusline/data/.gitignore +0 -8
- package/agents-config/claude-config/scripts/statusline/data/.gitkeep +0 -0
- package/agents-config/claude-config/scripts/statusline/docs/ARCHITECTURE.md +0 -166
- package/agents-config/claude-config/scripts/statusline/src/tests/spend-v2.test.ts +0 -306
- package/agents-config/skills/apex/SKILL.md +0 -261
- package/agents-config/skills/apex/scripts/setup-templates.sh +0 -100
- package/agents-config/skills/apex/scripts/update-progress.sh +0 -80
- package/agents-config/skills/apex/steps/step-00-init.md +0 -267
- package/agents-config/skills/apex/steps/step-00b-branch.md +0 -126
- package/agents-config/skills/apex/steps/step-00b-economy.md +0 -244
- package/agents-config/skills/apex/steps/step-00b-interactive.md +0 -153
- package/agents-config/skills/apex/steps/step-01-analyze.md +0 -361
- package/agents-config/skills/apex/steps/step-02-plan.md +0 -264
- package/agents-config/skills/apex/steps/step-03-execute.md +0 -239
- package/agents-config/skills/apex/steps/step-04-validate.md +0 -251
- package/agents-config/skills/apex/templates/00-context.md +0 -43
- package/agents-config/skills/apex/templates/01-analyze.md +0 -10
- package/agents-config/skills/apex/templates/02-plan.md +0 -10
- package/agents-config/skills/apex/templates/03-execute.md +0 -10
- package/agents-config/skills/apex/templates/04-validate.md +0 -10
- package/agents-config/skills/apex/templates/README.md +0 -176
- package/agents-config/skills/apex/templates/step-complete.md +0 -7
- package/agents-config/skills/claude-memory/SKILL.md +0 -293
- package/agents-config/skills/claude-memory/references/comprehensive-example.md +0 -175
- package/agents-config/skills/claude-memory/references/optimize-guide.md +0 -300
- package/agents-config/skills/claude-memory/references/project-patterns.md +0 -334
- package/agents-config/skills/claude-memory/references/prompting-techniques.md +0 -411
- package/agents-config/skills/claude-memory/references/rules-directory-guide.md +0 -298
- package/agents-config/skills/claude-memory/references/section-templates.md +0 -347
- package/agents-config/skills/fix-errors/SKILL.md +0 -61
- package/agents-config/skills/fix-grammar/SKILL.md +0 -59
- package/agents-config/skills/ralph-loop/SKILL.md +0 -117
- package/agents-config/skills/ralph-loop/scripts/setup.sh +0 -278
- package/agents-config/skills/ralph-loop/steps/step-00-init.md +0 -215
- package/agents-config/skills/ralph-loop/steps/step-01-interactive-prd.md +0 -366
- package/agents-config/skills/ralph-loop/steps/step-02-create-stories.md +0 -273
- package/agents-config/skills/ralph-loop/steps/step-03-finish.md +0 -245
- package/agents-config/skills/skill-creator/LICENSE.txt +0 -202
- package/agents-config/skills/skill-creator/SKILL.md +0 -421
- package/agents-config/skills/skill-creator/package.json +0 -5
- package/agents-config/skills/skill-creator/references/output-patterns.md +0 -82
- package/agents-config/skills/skill-creator/references/progressive-disclosure-patterns.md +0 -374
- package/agents-config/skills/skill-creator/references/prompting-integration.md +0 -363
- package/agents-config/skills/skill-creator/references/real-world-examples.md +0 -513
- package/agents-config/skills/skill-creator/references/script-patterns.md +0 -385
- package/agents-config/skills/skill-creator/references/workflows.md +0 -28
- package/agents-config/skills/skill-creator/references/xml-tag-guide.md +0 -606
- package/agents-config/skills/skill-creator/scripts/init-skill.ts +0 -214
- package/agents-config/skills/skill-creator/scripts/package-skill.ts +0 -146
- package/agents-config/skills/skill-creator/scripts/validate.ts +0 -138
- package/agents-config/skills/workflow-apex-free/SKILL.md +0 -261
- package/agents-config/skills/workflow-apex-free/scripts/setup-templates.sh +0 -100
- package/agents-config/skills/workflow-apex-free/scripts/update-progress.sh +0 -80
- package/agents-config/skills/workflow-apex-free/steps/step-00-init.md +0 -267
- package/agents-config/skills/workflow-apex-free/steps/step-00b-branch.md +0 -126
- package/agents-config/skills/workflow-apex-free/steps/step-00b-economy.md +0 -244
- package/agents-config/skills/workflow-apex-free/steps/step-00b-interactive.md +0 -153
- package/agents-config/skills/workflow-apex-free/steps/step-01-analyze.md +0 -361
- package/agents-config/skills/workflow-apex-free/steps/step-02-plan.md +0 -264
- package/agents-config/skills/workflow-apex-free/steps/step-03-execute.md +0 -239
- package/agents-config/skills/workflow-apex-free/steps/step-04-validate.md +0 -251
- package/agents-config/skills/workflow-apex-free/templates/00-context.md +0 -43
- package/agents-config/skills/workflow-apex-free/templates/01-analyze.md +0 -10
- package/agents-config/skills/workflow-apex-free/templates/02-plan.md +0 -10
- package/agents-config/skills/workflow-apex-free/templates/03-execute.md +0 -10
- package/agents-config/skills/workflow-apex-free/templates/04-validate.md +0 -10
- package/agents-config/skills/workflow-apex-free/templates/README.md +0 -176
- package/agents-config/skills/workflow-apex-free/templates/step-complete.md +0 -7
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# OpenAI Codex Skills
|
|
2
|
+
|
|
3
|
+
Official docs: https://developers.openai.com/codex/skills
|
|
4
|
+
Examples: https://github.com/openai/skills
|
|
5
|
+
|
|
6
|
+
## Layout
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
skill-name/
|
|
10
|
+
├── SKILL.md # required
|
|
11
|
+
├── agents/
|
|
12
|
+
│ └── openai.yaml # optional: UI metadata, MCP deps, default prompt
|
|
13
|
+
├── assets/ # icons referenced by openai.yaml, output templates
|
|
14
|
+
├── references/ # loaded on demand
|
|
15
|
+
└── scripts/ # executable code
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Storage locations (scan order)
|
|
19
|
+
|
|
20
|
+
| Scope | Path | Use |
|
|
21
|
+
| :------- | :------------------------------ | :----------------------------------- |
|
|
22
|
+
| REPO | `$CWD/.agents/skills` | Skill scoped to working folder |
|
|
23
|
+
| REPO | `$CWD/../.agents/skills` | Shared across nested module |
|
|
24
|
+
| REPO | `$REPO_ROOT/.agents/skills` | Repo-wide for everyone |
|
|
25
|
+
| USER | `~/.agents/skills` | Personal, any repo |
|
|
26
|
+
| ADMIN | `/etc/codex/skills` | Machine/container-wide |
|
|
27
|
+
| SYSTEM | bundled with Codex | Built-ins |
|
|
28
|
+
|
|
29
|
+
Codex walks CWD up to repo root collecting `.agents/skills` at each level. Symlinks are followed. Same `name` in two scopes is NOT merged - both appear in the selector.
|
|
30
|
+
|
|
31
|
+
## SKILL.md (required, minimal)
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
---
|
|
35
|
+
name: skill-name
|
|
36
|
+
description: Explain exactly when this skill should and should not trigger.
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
Imperative instructions for Codex.
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Only `name` and `description` are required. The description is what triggers implicit invocation - front-load the use case and trigger words. Codex caps the initial skill list at ~2% of context (or ~8000 chars); descriptions get shortened first, so the important phrases must come first.
|
|
43
|
+
|
|
44
|
+
## Invocation
|
|
45
|
+
|
|
46
|
+
- **Explicit**: user types `$skill-name` in CLI/IDE, or `/skills` to browse.
|
|
47
|
+
- **Implicit**: Codex picks the skill when the user's prompt matches the description.
|
|
48
|
+
|
|
49
|
+
To block implicit picking (e.g., for side-effecting skills), set `policy.allow_implicit_invocation: false` in `openai.yaml`. `$skill-name` still works.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
# `agents/openai.yaml` - the optional UX layer
|
|
54
|
+
|
|
55
|
+
`openai.yaml` is product-specific config the **harness** reads, not the model. It controls how the skill appears in the Codex app/IDE (icon, name, color, blurb), how it can be invoked, and what MCP servers it needs to function. The skill still works without it - this layer makes it feel native.
|
|
56
|
+
|
|
57
|
+
## When to add it
|
|
58
|
+
|
|
59
|
+
- **Skip** for a personal, instruction-only skill in your own repo. SKILL.md alone is fine.
|
|
60
|
+
- **Add it** when you want the skill to look polished in the Codex app skill picker (real icon, brand color, friendly name).
|
|
61
|
+
- **Required** if the skill needs an MCP server (Figma, Notion, Linear, GitHub, etc.) to function - that's how Codex knows to connect.
|
|
62
|
+
- **Required** if you want to disable implicit invocation for safety.
|
|
63
|
+
|
|
64
|
+
## Full schema with constraints
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
interface:
|
|
68
|
+
display_name: "Optional user-facing name"
|
|
69
|
+
short_description: "Optional user-facing description"
|
|
70
|
+
icon_small: "./assets/small-400px.png"
|
|
71
|
+
icon_large: "./assets/large-logo.svg"
|
|
72
|
+
brand_color: "#3B82F6"
|
|
73
|
+
default_prompt: "Use $skill-name to draft a concise weekly status update."
|
|
74
|
+
|
|
75
|
+
policy:
|
|
76
|
+
allow_implicit_invocation: false
|
|
77
|
+
|
|
78
|
+
dependencies:
|
|
79
|
+
tools:
|
|
80
|
+
- type: "mcp"
|
|
81
|
+
value: "github"
|
|
82
|
+
description: "GitHub MCP server"
|
|
83
|
+
transport: "streamable_http"
|
|
84
|
+
url: "https://api.githubcopilot.com/mcp/"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Top-level rules**
|
|
88
|
+
|
|
89
|
+
- Quote every string value. Leave keys unquoted.
|
|
90
|
+
- Paths in `icon_small` / `icon_large` are relative to the skill directory. Convention: put icons under `./assets/`.
|
|
91
|
+
|
|
92
|
+
### `interface` fields (UI metadata)
|
|
93
|
+
|
|
94
|
+
| Field | Purpose | Notes |
|
|
95
|
+
| :------------------ | :-------------------------------------------- | :----------------------------------------------------------------------------------- |
|
|
96
|
+
| `display_name` | Human-facing title in skill lists/chips | Keep short. Don't repeat the `name` slug. |
|
|
97
|
+
| `short_description` | One-line blurb for skill picker | **25-64 chars**. Skim-readable. |
|
|
98
|
+
| `icon_small` | Small icon path | Use `./assets/<file>`. PNG or SVG. Used in chips/lists. |
|
|
99
|
+
| `icon_large` | Large logo path | Used on the skill detail card. |
|
|
100
|
+
| `brand_color` | Hex color for UI accents | Format `"#RRGGBB"`. Picks badge / pill color. |
|
|
101
|
+
| `default_prompt` | Example prompt inserted when invoking | **Must mention the skill as `$skill-name`** (e.g., "Use `$weekly-status` to draft…") |
|
|
102
|
+
|
|
103
|
+
### `policy` field
|
|
104
|
+
|
|
105
|
+
- `allow_implicit_invocation` (default: `true`). Set to `false` for skills with side effects (deploy, post, write). Users can still trigger with `$skill-name`.
|
|
106
|
+
|
|
107
|
+
### `dependencies.tools` (MCP)
|
|
108
|
+
|
|
109
|
+
Only `type: "mcp"` is supported today. Each entry:
|
|
110
|
+
|
|
111
|
+
| Field | Required | Description |
|
|
112
|
+
| :------------ | :------- | :----------------------------------------------------------------------- |
|
|
113
|
+
| `type` | yes | Always `"mcp"` for now |
|
|
114
|
+
| `value` | yes | Server identifier. Must match `[mcp_servers.<value>]` in `config.toml` |
|
|
115
|
+
| `description` | yes | Human-readable purpose |
|
|
116
|
+
| `transport` | yes | Always `"streamable_http"` for remote MCP servers |
|
|
117
|
+
| `url` | yes | HTTPS endpoint of the MCP server |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Wiring an MCP-backed skill end-to-end
|
|
122
|
+
|
|
123
|
+
Two files have to agree:
|
|
124
|
+
|
|
125
|
+
**1. Skill declares the dependency** (`<skill>/agents/openai.yaml`)
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
dependencies:
|
|
129
|
+
tools:
|
|
130
|
+
- type: "mcp"
|
|
131
|
+
value: "figma"
|
|
132
|
+
description: "Figma MCP server for design-to-code"
|
|
133
|
+
transport: "streamable_http"
|
|
134
|
+
url: "https://mcp.figma.com/mcp"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**2. User configures the server** (`~/.codex/config.toml`)
|
|
138
|
+
|
|
139
|
+
```toml
|
|
140
|
+
rmcp_client = true # required feature flag for remote MCP
|
|
141
|
+
|
|
142
|
+
[mcp_servers.figma]
|
|
143
|
+
url = "https://mcp.figma.com/mcp"
|
|
144
|
+
bearer_token_env_var = "FIGMA_OAUTH_TOKEN"
|
|
145
|
+
# optional:
|
|
146
|
+
# http_headers = { "X-Figma-Region" = "us" }
|
|
147
|
+
# startup_timeout_sec = 10
|
|
148
|
+
# tool_timeout_sec = 30
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The token itself lives in the environment:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
export FIGMA_OAUTH_TOKEN="…"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Restart Codex after editing `config.toml` or the env var.
|
|
158
|
+
|
|
159
|
+
**Real-world reference table**
|
|
160
|
+
|
|
161
|
+
| Skill | MCP `value` | URL | Env var |
|
|
162
|
+
| :----------------------------- | :---------- | :--------------------------- | :-------------------- |
|
|
163
|
+
| `figma` | `figma` | `https://mcp.figma.com/mcp` | `FIGMA_OAUTH_TOKEN` |
|
|
164
|
+
| `notion-knowledge-capture` | `notion` | `https://mcp.notion.com/mcp` | `NOTION_OAUTH_TOKEN` |
|
|
165
|
+
| `notion-meeting-intelligence` | `notion` | `https://mcp.notion.com/mcp` | `NOTION_OAUTH_TOKEN` |
|
|
166
|
+
| `notion-spec-to-implementation`| `notion` | `https://mcp.notion.com/mcp` | `NOTION_OAUTH_TOKEN` |
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Enable/disable a skill without deleting
|
|
171
|
+
|
|
172
|
+
`~/.codex/config.toml`:
|
|
173
|
+
|
|
174
|
+
```toml
|
|
175
|
+
[[skills.config]]
|
|
176
|
+
path = "/absolute/path/to/skill/SKILL.md"
|
|
177
|
+
enabled = false
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Restart Codex after editing.
|
|
181
|
+
|
|
182
|
+
## Distribution
|
|
183
|
+
|
|
184
|
+
For sharing beyond one repo, bundle as a **plugin**. Plugins can hold one or more skills plus MCP server config and app mappings. `.agents/skills/` is for local authoring; plugins are for distribution. `$skill-installer <name>` pulls curated skills locally.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Recipes
|
|
189
|
+
|
|
190
|
+
### Pure instruction-only skill (no UI polish, no MCP)
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
weekly-status/
|
|
194
|
+
└── SKILL.md
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
---
|
|
199
|
+
name: weekly-status
|
|
200
|
+
description: Draft a concise weekly status update. Use when the user asks to "write my weekly status", "summarize the week", or "draft a standup update".
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
Draft a 4-bullet status:
|
|
204
|
+
1. Shipped this week (link PRs)
|
|
205
|
+
2. In progress with current blockers
|
|
206
|
+
3. Coming next week
|
|
207
|
+
4. Asks / decisions needed
|
|
208
|
+
|
|
209
|
+
Keep each bullet under 20 words. No emoji. No filler.
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Polished skill with branded UI
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
weekly-status/
|
|
216
|
+
├── SKILL.md
|
|
217
|
+
├── agents/openai.yaml
|
|
218
|
+
└── assets/
|
|
219
|
+
├── small-400px.png
|
|
220
|
+
└── large-logo.svg
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
```yaml
|
|
224
|
+
interface:
|
|
225
|
+
display_name: "Weekly Status"
|
|
226
|
+
short_description: "Draft a concise weekly status update"
|
|
227
|
+
icon_small: "./assets/small-400px.png"
|
|
228
|
+
icon_large: "./assets/large-logo.svg"
|
|
229
|
+
brand_color: "#7C3AED"
|
|
230
|
+
default_prompt: "Use $weekly-status to draft this week's update from my recent PRs."
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Side-effecting skill (block implicit)
|
|
234
|
+
|
|
235
|
+
```yaml
|
|
236
|
+
interface:
|
|
237
|
+
display_name: "Deploy Production"
|
|
238
|
+
short_description: "Ship the current branch to prod"
|
|
239
|
+
brand_color: "#DC2626"
|
|
240
|
+
default_prompt: "Use $deploy-prod to release the current branch."
|
|
241
|
+
|
|
242
|
+
policy:
|
|
243
|
+
allow_implicit_invocation: false # user must type $deploy-prod
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### MCP-backed skill (Figma example)
|
|
247
|
+
|
|
248
|
+
```yaml
|
|
249
|
+
interface:
|
|
250
|
+
display_name: "Figma"
|
|
251
|
+
short_description: "Implement designs from Figma nodes"
|
|
252
|
+
icon_small: "./assets/figma-small.svg"
|
|
253
|
+
icon_large: "./assets/figma.png"
|
|
254
|
+
brand_color: "#F24E1E"
|
|
255
|
+
default_prompt: "Use $figma to implement the selected node."
|
|
256
|
+
|
|
257
|
+
dependencies:
|
|
258
|
+
tools:
|
|
259
|
+
- type: "mcp"
|
|
260
|
+
value: "figma"
|
|
261
|
+
description: "Figma design context"
|
|
262
|
+
transport: "streamable_http"
|
|
263
|
+
url: "https://mcp.figma.com/mcp"
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Skill body then calls the MCP tools in a deterministic sequence (e.g., for Figma: `get_design_context` → `get_metadata` if truncated → `get_screenshot` for parity).
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Common mistakes
|
|
271
|
+
|
|
272
|
+
- **Description is a label, not a trigger.** "Figma helper" → "Use when the user asks to implement a Figma design, build UI from a Figma node, or convert a Figma URL to code."
|
|
273
|
+
- **Forgot to quote string values** in YAML. Unquoted hex colors / URLs blow up parsing.
|
|
274
|
+
- **`default_prompt` doesn't reference `$skill-name`**. Per the schema constraint, it must.
|
|
275
|
+
- **MCP `value` mismatch.** The string in `openai.yaml` must match the `[mcp_servers.<value>]` block in `config.toml` exactly.
|
|
276
|
+
- **Forgot `rmcp_client = true`** in `config.toml` - MCP connections silently fail.
|
|
277
|
+
- **Bearer token has quotes.** `bearer_token_env_var` resolves to the raw env value; if you wrap it in quotes when exporting, OAuth errors out.
|
|
278
|
+
- **Adding `openai.yaml` for a personal skill that nobody else sees.** It's overhead. Skip it.
|
|
279
|
+
- **Putting README/CHANGELOG/INSTALL files next to SKILL.md.** Codex doesn't read them, they're clutter.
|
|
280
|
+
|
|
281
|
+
## Best practices
|
|
282
|
+
|
|
283
|
+
- One job per skill. Split rather than bloat.
|
|
284
|
+
- Instructions over scripts unless determinism matters.
|
|
285
|
+
- Imperative steps with explicit inputs and outputs.
|
|
286
|
+
- Re-read the `description`: would it actually match the prompts you have in mind? Test against 3 real phrasings.
|
|
287
|
+
- Keep `short_description` skim-readable (25-64 chars).
|
|
288
|
+
- Pre-size icons before shipping: small ~400px, large ~1024px square. Match `brand_color` to the icon for cohesion.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Cursor Rules
|
|
2
|
+
|
|
3
|
+
Official docs: https://cursor.com/docs/rules.md
|
|
4
|
+
|
|
5
|
+
Cursor calls them "rules", not skills. Same idea: persistent instructions injected into the model context. Four kinds:
|
|
6
|
+
|
|
7
|
+
| Kind | Location | Notes |
|
|
8
|
+
| :------------ | :------------------------- | :--------------------------------- |
|
|
9
|
+
| Project Rules | `.cursor/rules/*.md(c)` | Version-controlled, scoped to repo |
|
|
10
|
+
| User Rules | Cursor Settings → Rules | Global, chat-only |
|
|
11
|
+
| Team Rules | Cursor dashboard | Team/Enterprise plans |
|
|
12
|
+
| AGENTS.md | project root + subdirs | Plain markdown, no frontmatter |
|
|
13
|
+
|
|
14
|
+
Precedence when merging: **Team Rules → Project Rules → User Rules**. Earlier source wins on conflict.
|
|
15
|
+
|
|
16
|
+
## Project rule file: `.cursor/rules/<name>.mdc`
|
|
17
|
+
|
|
18
|
+
Use `.mdc` when you need frontmatter, `.md` for content-only. Frontmatter has three fields:
|
|
19
|
+
|
|
20
|
+
| `alwaysApply` | `description` | `globs` | Behavior |
|
|
21
|
+
| :------------ | :------------ | :-------- | :------------------------------------------------------ |
|
|
22
|
+
| `true` | - | - | Always included. `description`/`globs` ignored. |
|
|
23
|
+
| `false` | - | provided | Auto-attached when a matching file is in context. |
|
|
24
|
+
| `false` | provided | omitted | Agent reads description, pulls in when relevant. |
|
|
25
|
+
| `false` | omitted | omitted | Manual only - included when `@`-mentioned in chat. |
|
|
26
|
+
|
|
27
|
+
### Four templates
|
|
28
|
+
|
|
29
|
+
**Always applied**
|
|
30
|
+
|
|
31
|
+
```md
|
|
32
|
+
---
|
|
33
|
+
alwaysApply: true
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
- All source files must include the company copyright header
|
|
37
|
+
- Never modify generated files in `dist/` or `build/`
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Auto-attached by file pattern**
|
|
41
|
+
|
|
42
|
+
```md
|
|
43
|
+
---
|
|
44
|
+
globs: src/components/**/*.tsx
|
|
45
|
+
alwaysApply: false
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
- Use named exports, not default exports
|
|
49
|
+
- Co-locate styles in a CSS module next to the component
|
|
50
|
+
- Keep components under 200 lines
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Agent-selected by description**
|
|
54
|
+
|
|
55
|
+
```md
|
|
56
|
+
---
|
|
57
|
+
description: RPC service conventions and patterns for the backend
|
|
58
|
+
alwaysApply: false
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
- Define each service in its own file under `src/services/`
|
|
62
|
+
- Validate inputs at the service boundary
|
|
63
|
+
- Reference `@service-template.ts` for boilerplate
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Manual via @-mention**
|
|
67
|
+
|
|
68
|
+
```md
|
|
69
|
+
---
|
|
70
|
+
alwaysApply: false
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
- Every database migration must have `up` and `down`
|
|
74
|
+
- Never alter a column type in-place
|
|
75
|
+
|
|
76
|
+
@migration-template.sql
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Glob examples
|
|
80
|
+
|
|
81
|
+
| Pattern | Matches |
|
|
82
|
+
| :------------------------------- | :----------------------------------- |
|
|
83
|
+
| `*.ts` | `.ts` files at root |
|
|
84
|
+
| `**/*.ts` | `.ts` files anywhere |
|
|
85
|
+
| `src/**` | everything under `src/` |
|
|
86
|
+
| `src/**/*.tsx` | `.tsx` files anywhere under `src/` |
|
|
87
|
+
| `docs/**/*.md, docs/**/*.mdx` | comma-separate multiple patterns |
|
|
88
|
+
| `tailwind.config.*` | any extension |
|
|
89
|
+
|
|
90
|
+
### Referencing files
|
|
91
|
+
|
|
92
|
+
`@filename.ts` inside a rule attaches that file to the context when the rule fires. Use this to point at canonical templates instead of copying code.
|
|
93
|
+
|
|
94
|
+
## AGENTS.md (no frontmatter)
|
|
95
|
+
|
|
96
|
+
Plain markdown in project root or subdirectories. No fields, no globs - just instructions.
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
# Project Instructions
|
|
100
|
+
|
|
101
|
+
## Code Style
|
|
102
|
+
- Use TypeScript for all new files
|
|
103
|
+
- Prefer functional components in React
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Nested support: `frontend/AGENTS.md` applies inside `frontend/`, combined with the root file. More specific wins.
|
|
107
|
+
|
|
108
|
+
## User Rules
|
|
109
|
+
|
|
110
|
+
Free-form global preferences set in Cursor Settings. Chat-only (not Inline Edit / Cmd-K).
|
|
111
|
+
|
|
112
|
+
## Best practices
|
|
113
|
+
|
|
114
|
+
- Keep rules under 500 lines; split into composable rules instead.
|
|
115
|
+
- Concrete examples beat vague guidance.
|
|
116
|
+
- Reference files with `@name.ts` rather than copying code (stays in sync).
|
|
117
|
+
- Skip style guides Cursor already knows. Add a rule when you see the same mistake twice.
|
|
118
|
+
- Check rules into git so the team benefits.
|
|
119
|
+
|
|
120
|
+
## Common mistakes
|
|
121
|
+
|
|
122
|
+
- Using `alwaysApply: true` for rules that only matter in one directory - use `globs` instead.
|
|
123
|
+
- Description that's a label, not a trigger ("Backend stuff" → "RPC service conventions and patterns for the backend").
|
|
124
|
+
- Copying entire style guides instead of using a linter.
|
|
125
|
+
- Manual rule (no globs, no description, `alwaysApply: false`) without telling the user it must be `@`-mentioned.
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# Statusline Architecture - Session & Period Tracking
|
|
2
|
-
|
|
3
|
-
## Concepts Fondamentaux
|
|
4
|
-
|
|
5
|
-
### Session Claude Code
|
|
6
|
-
|
|
7
|
-
Une **session** est créée chaque fois qu'on ouvre un chat avec Claude Code.
|
|
8
|
-
|
|
9
|
-
Caractéristiques:
|
|
10
|
-
- **ID unique**: `session_id` (UUID)
|
|
11
|
-
- **Coût cumulatif**: Le coût total de la session qui AUGMENTE au fil du temps
|
|
12
|
-
- **Persistance**: Une session peut durer des heures/jours
|
|
13
|
-
- **Commande /clear**: Efface la conversation mais GARDE la même session
|
|
14
|
-
- **Le coût ne reset jamais**: Si une session a coûté $10, puis on fait /clear, le coût reste $10 et continue d'augmenter
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Session "abc-123"
|
|
18
|
-
├── Début: $0
|
|
19
|
-
├── Après 1h: $5
|
|
20
|
-
├── /clear (conversation effacée)
|
|
21
|
-
├── Après 2h: $12 (coût continue d'augmenter)
|
|
22
|
-
├── Fermeture terminal
|
|
23
|
-
├── Réouverture (même session)
|
|
24
|
-
└── Après 3h: $18 (toujours cumulatif)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Période (5 heures)
|
|
28
|
-
|
|
29
|
-
Une **période** est une fenêtre de 5 heures pour le rate limiting d'Anthropic.
|
|
30
|
-
|
|
31
|
-
Caractéristiques:
|
|
32
|
-
- **resets_at**: Timestamp de fin de période (ex: "2025-12-09T10:00:00.000Z")
|
|
33
|
-
- **Durée fixe**: 5 heures
|
|
34
|
-
- **Indépendant des sessions**: Les sessions peuvent traverser plusieurs périodes
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
Période A (05:00-10:00) Période B (10:00-15:00)
|
|
38
|
-
├────────────────────┤ ├────────────────────┤
|
|
39
|
-
Session 1: +$5 Session 1: +$3 (continue)
|
|
40
|
-
Session 2: +$8 Session 3: +$10 (nouvelle)
|
|
41
|
-
───────────── ─────────────
|
|
42
|
-
Total: $13 Total: $13
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Le Problème Actuel
|
|
46
|
-
|
|
47
|
-
### Bug: Double Comptage
|
|
48
|
-
|
|
49
|
-
Quand on calcule le coût d'une période en sommant les coûts totaux des sessions:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
Session X: coût total = $24
|
|
53
|
-
Session X: last_resets_at = période actuelle
|
|
54
|
-
|
|
55
|
-
getCurrentPeriodCost() retourne $24 ❌ FAUX!
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Mais si la session X avait déjà $10 AVANT cette période:
|
|
59
|
-
- Coût réel de cette période = $24 - $10 = $14
|
|
60
|
-
- On affiche $24 au lieu de $14 = **double comptage**
|
|
61
|
-
|
|
62
|
-
### Scénario Réel
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
1. Période A: Session X coûte $10, on compte $10 ✓
|
|
66
|
-
2. Période B commence
|
|
67
|
-
3. Session X continue, coût monte à $24
|
|
68
|
-
4. On calcule période B: on voit session X = $24
|
|
69
|
-
5. On affiche $24 pour période B ❌
|
|
70
|
-
6. Mais on avait déjà compté $10 en période A!
|
|
71
|
-
7. Total affiché: $10 + $24 = $34
|
|
72
|
-
8. Total réel: $24
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Solution: Tracking des Deltas par Session
|
|
76
|
-
|
|
77
|
-
### Nouvelle Structure de Données
|
|
78
|
-
|
|
79
|
-
On doit tracker pour chaque session:
|
|
80
|
-
- Combien on a DÉJÀ compté
|
|
81
|
-
- Dans quelle période on l'a compté
|
|
82
|
-
|
|
83
|
-
```sql
|
|
84
|
-
-- Table: sessions
|
|
85
|
-
session_id TEXT PRIMARY KEY
|
|
86
|
-
total_cost REAL -- Coût total actuel de la session
|
|
87
|
-
cwd TEXT
|
|
88
|
-
date TEXT
|
|
89
|
-
duration_ms INTEGER
|
|
90
|
-
lines_added INTEGER
|
|
91
|
-
lines_removed INTEGER
|
|
92
|
-
|
|
93
|
-
-- Table: session_period_tracking
|
|
94
|
-
session_id TEXT
|
|
95
|
-
period_id TEXT -- resets_at normalisé
|
|
96
|
-
counted_cost REAL -- Combien on a compté pour cette période
|
|
97
|
-
last_update INTEGER -- Timestamp
|
|
98
|
-
PRIMARY KEY (session_id, period_id)
|
|
99
|
-
|
|
100
|
-
-- Table: periods
|
|
101
|
-
period_id TEXT PRIMARY KEY -- resets_at normalisé
|
|
102
|
-
total_cost REAL -- Somme des deltas de toutes les sessions
|
|
103
|
-
utilization INTEGER
|
|
104
|
-
date TEXT
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Algorithme Correct
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
Quand saveSession(session_id, new_cost, current_period):
|
|
111
|
-
1. Chercher session dans DB
|
|
112
|
-
2. Si existe:
|
|
113
|
-
old_cost = session.total_cost
|
|
114
|
-
delta = new_cost - old_cost
|
|
115
|
-
Sinon:
|
|
116
|
-
delta = new_cost
|
|
117
|
-
|
|
118
|
-
3. Chercher tracking pour (session_id, current_period)
|
|
119
|
-
4. Si existe:
|
|
120
|
-
// Déjà compté dans cette période, calculer le vrai delta
|
|
121
|
-
already_counted = tracking.counted_cost
|
|
122
|
-
period_delta = delta // Le delta depuis la dernière update
|
|
123
|
-
Sinon:
|
|
124
|
-
// Nouvelle session dans cette période
|
|
125
|
-
period_delta = delta
|
|
126
|
-
|
|
127
|
-
5. Mettre à jour:
|
|
128
|
-
- session.total_cost = new_cost
|
|
129
|
-
- tracking.counted_cost += period_delta
|
|
130
|
-
- period.total_cost += period_delta
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Exemple Concret
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
Session X traverse 2 périodes:
|
|
137
|
-
|
|
138
|
-
Période A:
|
|
139
|
-
- Session X: $0 → $10
|
|
140
|
-
- tracking(X, A).counted_cost = $10
|
|
141
|
-
- period(A).total_cost = $10
|
|
142
|
-
|
|
143
|
-
Période B:
|
|
144
|
-
- Session X: $10 → $24
|
|
145
|
-
- delta = $24 - $10 = $14
|
|
146
|
-
- tracking(X, B).counted_cost = $14
|
|
147
|
-
- period(B).total_cost = $14
|
|
148
|
-
|
|
149
|
-
Calcul période B:
|
|
150
|
-
- On lit period(B).total_cost = $14 ✓ CORRECT!
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## Avantages SQLite
|
|
154
|
-
|
|
155
|
-
1. **Transactions ACID**: Pas de corruption de données
|
|
156
|
-
2. **Requêtes complexes**: Agrégations, joins faciles
|
|
157
|
-
3. **Index**: Performance pour les lookups par session_id
|
|
158
|
-
4. **Single file**: Toujours portable
|
|
159
|
-
5. **Intégrité référentielle**: FK entre tables
|
|
160
|
-
|
|
161
|
-
## Migration
|
|
162
|
-
|
|
163
|
-
1. Créer nouveau fichier `statusline.db`
|
|
164
|
-
2. Migrer données existantes de spend.json et daily-usage.json
|
|
165
|
-
3. Recalculer les period_costs correctement
|
|
166
|
-
4. Supprimer les anciens fichiers JSON
|