@jaybeeuu/agent-cortex 1.20.0 → 1.37.1
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/.agents/skills/style-versioning/SKILL.md +101 -0
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +11 -0
- package/.github/workflows/ci.yml +39 -0
- package/.github/workflows/release.yml +58 -0
- package/AGENTS.md +4 -18
- package/CHANGELOG.md +77 -5
- package/extensions/session-start.ts +1 -1
- package/extensions/skill-stats/context-loader.test.ts +1 -1
- package/extensions/skill-stats/node_modules/.bin/pi +21 -0
- package/extensions/skill-stats/node_modules/.bin/tsc +21 -0
- package/extensions/skill-stats/node_modules/.bin/tsserver +21 -0
- package/extensions/skill-stats/node_modules/.bin/tsx +21 -0
- package/package.json +6 -5
- package/plugin.json +1 -1
- package/pnpm-workspace.yaml +1 -0
- package/scripts/publish-release.sh +32 -0
- package/scripts/sync-plugin-version.sh +17 -0
- package/.beads/README.md +0 -81
- package/.beads/config.yaml +0 -1
- package/.beads/issues.jsonl +0 -236
- package/.beads/metadata.json +0 -7
- package/.github/workflows/publish.yml +0 -36
- package/docs/ideas/auto-model-selection.md +0 -75
- package/docs/ideas/improve-pi-system-prompt.md +0 -34
- package/docs/ideas/model-selector.md +0 -40
- package/docs/ideas/pi-task-memory.md +0 -34
- package/docs/ideas/qa-extension.md +0 -43
- package/skills/workflow/using-agent-skills/SKILL.md +0 -109
- package/skills/workflow/using-agent-skills/scripts/validate-skill-structure.test.ts +0 -73
- /package/extensions/{context-loader.md → lib/context-loader.md} +0 -0
- /package/extensions/{context-loader.ts → lib/context-loader.ts} +0 -0
package/.beads/metadata.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: Publish to npm
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
release:
|
|
5
|
-
types: [published]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
permissions:
|
|
11
|
-
contents: read
|
|
12
|
-
id-token: write
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout
|
|
15
|
-
uses: actions/checkout@v4
|
|
16
|
-
- name: Setup Node
|
|
17
|
-
uses: actions/setup-node@v6
|
|
18
|
-
with:
|
|
19
|
-
node-version: 24
|
|
20
|
-
- name: Setup pnpm
|
|
21
|
-
uses: pnpm/action-setup@v4
|
|
22
|
-
with:
|
|
23
|
-
version: 10
|
|
24
|
-
run_install: false
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: pnpm install --frozen-lockfile
|
|
27
|
-
- name: Lint
|
|
28
|
-
run: pnpm lint
|
|
29
|
-
- name: Test
|
|
30
|
-
run: pnpm test
|
|
31
|
-
- name: Build
|
|
32
|
-
run: pnpm build
|
|
33
|
-
- name: Publish to npm
|
|
34
|
-
run: |
|
|
35
|
-
TARBALL=$(pnpm pack | tail -n 1)
|
|
36
|
-
npm publish "$TARBALL"
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Idea: Auto-Model Selection Plugin
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
Backlog idea (not implementation-ready) — **direction: evaluate and adopt existing package**
|
|
5
|
-
|
|
6
|
-
## Why it might be useful
|
|
7
|
-
PI has no intelligent model selection. Users must manually choose models, which means they either over-provision (expensive models for simple tasks) or under-provision (weak models for complex work). Rate limits hit without warning, forcing manual model switching mid-session. An auto-selection plugin would optimize cost/performance by matching model capability to task complexity, and provide seamless fallbacks when rate limits are hit.
|
|
8
|
-
|
|
9
|
-
## How we might do it
|
|
10
|
-
**Evaluate and adopt an existing PI extension** rather than building from scratch. The ecosystem already has well-maintained packages that cover task-based routing and rate-limit fallbacks. The goal is to:
|
|
11
|
-
|
|
12
|
-
1. **Evaluate the top candidates** (see "Packages to evaluate" below)
|
|
13
|
-
2. **Pick the best fit** for agent-cortex's workflow (beads, pipeline stages, HITL/AFK classification)
|
|
14
|
-
3. **Install and configure** it, possibly with light customisation if needed
|
|
15
|
-
4. **Document** the chosen package and configuration in agent-cortex docs
|
|
16
|
-
|
|
17
|
-
## Packages to evaluate (in priority order)
|
|
18
|
-
**Top candidates — cover both task-based routing AND fallbacks:**
|
|
19
|
-
1. **`@kylebrodeur/pi-model-router`** — per-turn routing to high/medium/low tiers based on task intent, context size, budget, with automatic fallback chains and rate-limit recovery. Well-documented fork of yeliu84's original.
|
|
20
|
-
2. **`pi-auto-router`** — multi-provider routing with same-request failover, budget-aware policies, and quota-aware fallback.
|
|
21
|
-
3. **`pi-tiered-router`** — routes different *phases* (planner/validator/executor/tool-parser) to different models. Quality-first, not cost-saving.
|
|
22
|
-
|
|
23
|
-
**Fallback-only (simpler, if routing is overkill):**
|
|
24
|
-
- **`pi-auto-models`** — Claude→Codex quota switching with 429/529 recovery
|
|
25
|
-
- **`pi-provider-fallback`** — cross-provider fallback chain with TUI config
|
|
26
|
-
|
|
27
|
-
**Evaluation criteria:**
|
|
28
|
-
- Does it integrate cleanly with PI's existing provider/model system?
|
|
29
|
-
- Does it respect user's explicit model choice, or override it?
|
|
30
|
-
- How does it handle context window mismatches on fallback?
|
|
31
|
-
- Is it configurable per-project?
|
|
32
|
-
- Does it have fallback chains or just single fallback?
|
|
33
|
-
- Rate-limit detection and retry logic
|
|
34
|
-
- Documentation quality and maintenance status
|
|
35
|
-
|
|
36
|
-
## When to think about it
|
|
37
|
-
- After current feature stabilisation (refactor-to-template epic, npm publishing, system prompt improvements)
|
|
38
|
-
- Not blocked, but benefits from stable extension infrastructure
|
|
39
|
-
|
|
40
|
-
## Priority
|
|
41
|
-
Medium / backlog — valuable for cost optimisation and reliability, but not urgent. Current manual model selection works, just isn't optimal.
|
|
42
|
-
|
|
43
|
-
## Open questions
|
|
44
|
-
- How to classify task complexity? Heuristics (file count, prompt length, keywords)? Or let user tag tasks?
|
|
45
|
-
- What defines a "model class"? Cost tier, context window size, reasoning capability, speed?
|
|
46
|
-
- Should the plugin override the user's explicit model choice, or only activate when no model is selected?
|
|
47
|
-
- How to handle context window mismatches when falling back (e.g., 200k → 128k)?
|
|
48
|
-
- Should this be configurable per-project (different policies for different repos)?
|
|
49
|
-
|
|
50
|
-
## Existing packages in the ecosystem
|
|
51
|
-
Several published packages already address parts of this problem:
|
|
52
|
-
|
|
53
|
-
### Fallback / rate-limit recovery
|
|
54
|
-
- **`pi-provider-fallback`** — cross-provider fallback with interactive TUI config
|
|
55
|
-
- **`pi-auto-models`** — primary/fallback switching on quota (Claude→Codex default), 429/529 recovery
|
|
56
|
-
|
|
57
|
-
### Task-based / tier routing
|
|
58
|
-
- **`pi-model-router`** (yeliu84, forked by @kdejaeger and @kylebrodeur) — per-turn routing to high/medium/low tiers based on task intent, context size, budget, with automatic fallbacks
|
|
59
|
-
- **`pi-model-auto`** — routes by Low/Medium/High/Ultra capability modes per turn
|
|
60
|
-
- **`pi-tiered-router`** — routes different phases (planner/validator/executor/tool-parser) to different models
|
|
61
|
-
|
|
62
|
-
### Full auto-router with failover
|
|
63
|
-
- **`pi-auto-router`** — multi-provider routing with same-request failover, budget-aware policies
|
|
64
|
-
- **`@ifi/pi-extension-adaptive-routing`** — adaptive routing with local telemetry persistence
|
|
65
|
-
|
|
66
|
-
### Model selection (manual)
|
|
67
|
-
- **`pi-model-switch`** — direct model switching tool
|
|
68
|
-
- **`pi-model-select`** — `/select-model` with favourites and fuzzy search
|
|
69
|
-
|
|
70
|
-
## Notes
|
|
71
|
-
- **The ecosystem is active** — this space is already well-served. Before building, evaluate whether an existing package (especially `pi-model-router` or `pi-auto-router`) already meets the need.
|
|
72
|
-
- **Gap analysis needed**: compare existing packages against the original requirements (task-based class selection + rate-limit fallbacks) to see if anything is genuinely missing.
|
|
73
|
-
- **Partial solutions exist in PI core**: OpenRouter's routing config supports fallbacks and provider ordering, but only within OpenRouter. Cross-provider fallback requires an extension.
|
|
74
|
-
- **Implementation approach** (if building): likely a PI extension that registers a "smart-router" provider, which internally delegates to real providers based on task classification and availability.
|
|
75
|
-
- **Research done**: reviewed PI docs on providers, models, and extensions. Searched npm and pi.dev for existing packages.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Idea: Improve PI System Prompt
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
Backlog idea (not implementation-ready)
|
|
5
|
-
|
|
6
|
-
## Why it might be useful
|
|
7
|
-
PI's current system prompt is weak. Agents consistently get off track, spend excessive tokens spinning their wheels or going off on tangents, fail to check in when problems are hit, and generally behave like inexperienced code goblins. This wastes tokens, slows down task completion, and forces the user to constantly redirect the agent. A stronger system prompt would produce more focused, disciplined agents that know when to stop and ask.
|
|
8
|
-
|
|
9
|
-
## How we might do it
|
|
10
|
-
Build improved behavioural instructions into agent-cortex — layered on top of or replacing PI's default system prompt. Key improvements:
|
|
11
|
-
|
|
12
|
-
1. **Loop prevention / circuit-breakers** — hard limits on retry attempts (e.g. 2-attempt limit before stopping and asking), no repeated tool execution without rationale
|
|
13
|
-
2. **Task-focus discipline** — stronger scoping instructions, no tangential refactoring, atomic changes
|
|
14
|
-
3. **Check-in triggers** — explicit rules for when the agent must stop and present options to the user
|
|
15
|
-
|
|
16
|
-
A Gemini-generated execution protocol prompt exists as a possible starting point (see Notes), but will need significant customisation for agent-cortex.
|
|
17
|
-
|
|
18
|
-
## When to think about it
|
|
19
|
-
- Land the current work first (refactor-to-template epic, bead workflow polish, CI/CD pipeline)
|
|
20
|
-
- **Next priority after current work** — this is urgent-ish
|
|
21
|
-
|
|
22
|
-
## Priority
|
|
23
|
-
High — after current work lands. Directly impacts daily productivity and token efficiency.
|
|
24
|
-
|
|
25
|
-
## Open questions
|
|
26
|
-
- Layer on top of PI's default prompt, or replace it entirely?
|
|
27
|
-
- Should PI's current system prompt be reviewed for nonsense that can be chopped out?
|
|
28
|
-
- Which guardrails from the Gemini starter are genuinely useful vs redundant with existing skills (e.g. `git-workflow` already covers destructive commands, `style-code` covers scope discipline)?
|
|
29
|
-
- How should circuit-breakers interact with skills like `run-pipeline-stage` that already have structured workflows?
|
|
30
|
-
|
|
31
|
-
## Notes
|
|
32
|
-
- **Gemini starter prompt** exists (see conversation from 2026-08-05) covering loop prevention, action scope, context management, execution workflow order, and working state maintenance. Useful starting material but needs heavy customisation.
|
|
33
|
-
- **Incompatibility to fix**: the starter's "Working State Maintenance" section proposes `.pi/PLAN.md` files for complex tasks. This is incompatible with agent-cortex — we use **beads (bd)** for task tracking and pipeline stages, not flat markdown plan files. This section needs to be replaced with bead-aware equivalents (e.g. updating bead notes, using pipeline stage state).
|
|
34
|
-
- **Overlap with existing skills**: several guardrails already exist in agent-cortex skills (`git-workflow`, `style-code`, `run-pipeline-stage`). The biggest gaps are **loop prevention / circuit-breakers** and **check-in discipline** — these aren't enforced anywhere today.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# Idea: model-selector
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
Backlog idea (not implementation-ready)
|
|
5
|
-
|
|
6
|
-
## Created
|
|
7
|
-
2026-07-12
|
|
8
|
-
|
|
9
|
-
## Problem
|
|
10
|
-
Selecting the right model for a task is manual and brittle. When a model is unavailable (rate-limited, down, or lacking capability), there's no automatic fallback. You have to know which model IDs to type into `/model` and remember which providers offer which capabilities.
|
|
11
|
-
|
|
12
|
-
## Who benefits
|
|
13
|
-
Anyone using PI who runs multiple models/providers. The extension makes model selection declarative: "I want to write code" → extension picks the best available model (and falls back if limits are hit).
|
|
14
|
-
|
|
15
|
-
## Proposed outcome
|
|
16
|
-
A PI extension that defines an abstraction for selecting models based on task/use case. Users declare "use case → model(s) with fallbacks" in config, and the extension handles selection and failover automatically.
|
|
17
|
-
|
|
18
|
-
Key capabilities:
|
|
19
|
-
- **Use-case profiles**: e.g. `code`, `chat`, `review`, `architect` — each maps to a primary model + ordered fallbacks
|
|
20
|
-
- **Automatic fallback**: if the primary model returns a 429 or error, drop to the next in the chain
|
|
21
|
-
- **Task-based selection**: think "I want this model to write code" instead of choosing a specific model ID
|
|
22
|
-
- **Configurable**: profiles defined in settings.json or a dedicated config file
|
|
23
|
-
|
|
24
|
-
## Validity check
|
|
25
|
-
- Evidence we already have: The existing `tiny-model.ts` lib in this repo already shows the pattern of configuring a model by provider/id string and looking it up via `modelRegistry.find()`. The PI extension API supports `before_provider_response` (for catching 429s) and `model_select` events.
|
|
26
|
-
- Riskiest assumption: That use-case profiles are a useful abstraction — users may prefer to just name a model family and let fallback be implicit.
|
|
27
|
-
- What would invalidate this idea: If PI adds built-in model routing/fallback, or if users find the abstraction adds confusion rather than removing it.
|
|
28
|
-
|
|
29
|
-
## Constraints
|
|
30
|
-
- Must not add LLM calls internally (per extension conventions in AGENTS.md)
|
|
31
|
-
- Must work with the existing `modelRegistry` API — no monkey-patching
|
|
32
|
-
- Storage/config should go in settings.json or `~/.pi/agent-cortex/` (global, cross-project)
|
|
33
|
-
|
|
34
|
-
## Next validation step
|
|
35
|
-
Sketch the config schema and test it against real usage patterns. Does the profile abstraction hold up for the models/providers you actually use?
|
|
36
|
-
|
|
37
|
-
## Notes
|
|
38
|
-
- Initial conversation during planning session 2026-07-12. Idea recorded as backlog, to be fleshed out when time permits.
|
|
39
|
-
- Could draw on patterns from OpenRouter's routing and the existing `modelOverrides` in models.json.
|
|
40
|
-
- The `notify` extension already intercepts provider responses — similar pattern for catching rate limits.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Idea: PI Task Memory Skill
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
Backlog idea (not implementation-ready)
|
|
5
|
-
|
|
6
|
-
## Why it might be useful
|
|
7
|
-
PI has no built-in task memory. Agents lose context between sessions — they can't track what a task has done, what decisions were made, or where they left off. A skill that persists task-scoped knowledge in structured markdown would let agents pick up work without re-discovering context from scratch, and give humans a readable audit trail they can review or promote into real documentation.
|
|
8
|
-
|
|
9
|
-
## How we might do it
|
|
10
|
-
**Possibly build on top of `bd remember`** rather than creating a separate storage system. Worth exploring whether `bd remember`'s existing infrastructure (persistence, cross-session survival, auto-injection) could be extended with task-scoping and structure, vs building something standalone.
|
|
11
|
-
- **Task-linked** — memories keyed to specific bead/task IDs so they can be retrieved in context
|
|
12
|
-
- **Progressively discoverable** — the agent recalls relevant memories as it picks up work, not all at once
|
|
13
|
-
- **Structured** — consistent format that's easy to scan, edit, or promote
|
|
14
|
-
- **Promotable** — easy to elevate a memory into real repo documentation (e.g. `docs/`, `AGENTS.md`) once it's proven stable
|
|
15
|
-
|
|
16
|
-
If `bd remember` turns out to be the right foundation, the skill would add **task-scoping discipline, structure, and a promotion workflow** on top. But that's to be determined.
|
|
17
|
-
|
|
18
|
-
## When to think about it
|
|
19
|
-
- After the current skill set stabilises (refactor-to-template work, bead workflow, CI/CD pipeline)
|
|
20
|
-
- Not blocked by anything, but benefits from a stable foundation
|
|
21
|
-
|
|
22
|
-
## Priority
|
|
23
|
-
Low / backlog — useful but not urgent. Current memory surfaces (bd remember, context-mode) cover some of the gap already.
|
|
24
|
-
|
|
25
|
-
## Open questions
|
|
26
|
-
- What triggers writing a memory? (Agent decides? Skill hook on task close? Specific prompts?)
|
|
27
|
-
- What does "progressively discoverable" mean in practice — agent reads task memories at session start, or on-demand when picking up a task?
|
|
28
|
-
- What does "elevate into docs" look like — export memory to markdown file, or just reference the memory in docs?
|
|
29
|
-
- How to structure memory keys for task-scoping? (e.g. `task-<bead-id>-<topic>`, or a naming convention?)
|
|
30
|
-
|
|
31
|
-
## Notes
|
|
32
|
-
- **What bd remember already provides**: persistent cross-session memories, auto-injection at `bd prime`, searchable via `bd memories <keyword>`, stored in Dolt database.
|
|
33
|
-
- **Worth exploring**: could this skill layer task-scoping discipline (memories keyed to bead IDs), structured format, progressive discovery (not all memories at once), and a promotion workflow on top of `bd remember`? Or does it need its own system?
|
|
34
|
-
- Could be a **PI extension** (event hooks) rather than a skill (invoked on-demand) if memories should be written automatically during task work.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Idea: qa-extension
|
|
2
|
-
|
|
3
|
-
## Status
|
|
4
|
-
Backlog idea (not implementation-ready)
|
|
5
|
-
|
|
6
|
-
## Created
|
|
7
|
-
2026-07-12
|
|
8
|
-
|
|
9
|
-
## Problem
|
|
10
|
-
When an agent needs clarification during a task (e.g. during a grilling session, resolving ambiguity, or making a recommendation), it has no structured way to ask the user a question and wait for an answer. The current workaround is unstructured prompting — the agent guesses, rambles, or proceeds with incomplete information. This makes grilling sessions less productive and wastes turns.
|
|
11
|
-
|
|
12
|
-
## Who benefits
|
|
13
|
-
Anyone using PI agents for interactive work — especially during planning, grilling, and design sessions where the model needs to ask a series of questions one at a time and get focused answers.
|
|
14
|
-
|
|
15
|
-
## Proposed outcome
|
|
16
|
-
A PI extension that registers a `qa` or `ask` tool that the LLM can call to ask the user a question. The tool:
|
|
17
|
-
- Presents the question (and optionally multiple-choice options or a recommendation)
|
|
18
|
-
- Pauses the agent and waits for the user's response
|
|
19
|
-
- Returns the user's answer to the model so it can continue
|
|
20
|
-
- Supports multi-turn Q&A sessions (series of questions)
|
|
21
|
-
|
|
22
|
-
This mirrors the built-in `ask_clarification` / `question` tools in Claude Code, GitHub Copilot Chat, and similar coding agents.
|
|
23
|
-
|
|
24
|
-
## Validity check
|
|
25
|
-
- Evidence we already have: The PI extension API supports custom tools with user interaction via `ctx.ui` (input, confirm, select). The `subagent` extension already demonstrates complex async tool patterns. Claude Code and Copilot both ship this — it's a proven pattern.
|
|
26
|
-
- Riskiest assumption: That the tool execution model in PI can support a "pause and wait for user input" flow without blocking the agent loop awkwardly.
|
|
27
|
-
- What would invalidate this idea: If PI adds a built-in `ask_user` tool, or if the UX of blocking the agent loop for input feels worse than the current unstructured approach.
|
|
28
|
-
|
|
29
|
-
## Constraints
|
|
30
|
-
- Must work in both TUI and RPC modes (graceful fallback in non-interactive modes)
|
|
31
|
-
- Should support at minimum: free-text input, confirm/deny, and multiple-choice selection
|
|
32
|
-
- Questions and answers should be visible in the session history so they survive compaction
|
|
33
|
-
- Must handle abort (Ctrl+C mid-question) gracefully
|
|
34
|
-
|
|
35
|
-
## Next validation step
|
|
36
|
-
1. **Investigate existing extensions first** — search PI's built-in tools, extension registry, and community repos for an existing `ask`/`qa`/`question` tool before building. May already be available.
|
|
37
|
-
2. If no existing extension: check the PI tool execution model to see if a custom tool can return a partial result and then receive follow-up input from the user. Look at how `ctx.ui.input()` and `ctx.ui.confirm()` behave inside tool execution — can they block and return, or do they need a different pattern?
|
|
38
|
-
|
|
39
|
-
## Notes
|
|
40
|
-
- **Needs investigation** — check for existing PI extensions/tools before building.
|
|
41
|
-
- Initial conversation 2026-07-12. Motivated by making grilling sessions more efficient — the grill-me skill asks one question at a time, and a structured Q&A tool would make that flow tighter.
|
|
42
|
-
- Related to `grill-me` skill (`skills/productivity/grill-me/SKILL.md`) — this extension could become the runtime that grill-me delegates its questioning to.
|
|
43
|
-
- Possible names: `/ask`, `qa`, `question` tool.
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: using-agent-skills
|
|
3
|
-
description: Routes incoming work to the right skill and enforces core agent behaviors. Use when starting a session, deciding which skill applies, or when you need to check "which skill should I use?".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Using Agent Skills
|
|
7
|
-
|
|
8
|
-
## When to use
|
|
9
|
-
|
|
10
|
-
- Starting a new session and need to orient on available workflows.
|
|
11
|
-
- A task arrives and you need to decide which skill applies.
|
|
12
|
-
- The user asks "which skill should I use for this?"
|
|
13
|
-
- You want to verify that core operating behaviors are being followed.
|
|
14
|
-
|
|
15
|
-
## Workflow
|
|
16
|
-
|
|
17
|
-
When a task arrives, identify the development phase and apply the corresponding skill:
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
Task arrives
|
|
21
|
-
│
|
|
22
|
-
├── Don't know what to build yet? ──────→ grill-me
|
|
23
|
-
├── Have a rough idea? ─────────────────→ record-idea
|
|
24
|
-
├── New feature / PRD needed? ──────────→ write-a-prd
|
|
25
|
-
├── PRD approved, need tasks? ──────────→ prd-to-tasks
|
|
26
|
-
├── Need a single task tracked? ────────→ create-task
|
|
27
|
-
├── Need to plan a feature end-to-end? ─→ plan
|
|
28
|
-
├── Running beads / task execution? ────→ ralph
|
|
29
|
-
│ └── Single stage? ─────────────────→ run-pipeline-stage
|
|
30
|
-
├── Implementing code? ────────────────→ tdd
|
|
31
|
-
│ └── Designing an interface? ───────→ design-an-interface
|
|
32
|
-
├── Reviewing code? ───────────────────→ style-code
|
|
33
|
-
│ └── Security concerns? ────────────→ review-security
|
|
34
|
-
├── Writing tests? ────────────────────→ style-tests
|
|
35
|
-
├── Writing docs? ─────────────────────→ style-documentation
|
|
36
|
-
├── Writing external comms? ───────────→ style-comms
|
|
37
|
-
├── Stress-testing a plan? ────────────→ grill-with-docs
|
|
38
|
-
├── Planning a refactor? ──────────────→ request-refactor-plan
|
|
39
|
-
├── Evaluating architecture? ──────────→ technical-direction
|
|
40
|
-
├── Finding refactor opportunities? ───→ improve-codebase-architecture
|
|
41
|
-
├── Need task tracking? ───────────────→ bd-tool
|
|
42
|
-
├── Need human review / HITL? ─────────→ hitl-collab
|
|
43
|
-
├── Need a handoff doc? ───────────────→ handoff
|
|
44
|
-
├── Writing a ticket for Jira? ────────→ write-a-ticket
|
|
45
|
-
├── Creating a new skill? ─────────────→ write-a-skill
|
|
46
|
-
├── Refactoring a skill? ──────────────→ refactor-skill
|
|
47
|
-
├── Updating agent docs? ──────────────→ maintain-agent-docs
|
|
48
|
-
└── Setting up beads in a new project? → init-beads
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Core Operating Behaviors
|
|
52
|
-
|
|
53
|
-
These behaviors apply at all times, across all skills. They are non-negotiable.
|
|
54
|
-
|
|
55
|
-
### 1. Surface Assumptions
|
|
56
|
-
|
|
57
|
-
Before implementing anything non-trivial, explicitly state your assumptions. Don't silently fill in ambiguous requirements — surface uncertainty early, it's cheaper than rework.
|
|
58
|
-
|
|
59
|
-
### 2. Manage Confusion Actively
|
|
60
|
-
|
|
61
|
-
When you encounter inconsistencies, conflicting requirements, or unclear specifications: **STOP**. Name the specific confusion, present the tradeoff or ask the clarifying question, and wait for resolution before continuing.
|
|
62
|
-
|
|
63
|
-
### 3. Push Back When Warranted
|
|
64
|
-
|
|
65
|
-
You are not a yes-machine. When an approach has clear problems, point out the issue directly, explain the concrete downside, propose an alternative, and accept the human's decision if they override with full information.
|
|
66
|
-
|
|
67
|
-
### 4. Enforce Simplicity
|
|
68
|
-
|
|
69
|
-
Your natural tendency is to overcomplicate. Before finishing any implementation, ask: Can this be done in fewer lines? Are these abstractions earning their complexity? Prefer the boring, obvious solution.
|
|
70
|
-
|
|
71
|
-
### 5. Maintain Scope Discipline
|
|
72
|
-
|
|
73
|
-
Touch only what you're asked to touch. Do not clean up orthogonal code, refactor adjacent systems, or add features not in the spec. Surgical precision, not unsolicited renovation.
|
|
74
|
-
|
|
75
|
-
### 6. Verify, Don't Assume
|
|
76
|
-
|
|
77
|
-
A task is not complete until verification passes. "Seems right" is never sufficient — there must be evidence: passing tests, build output, or runtime data.
|
|
78
|
-
|
|
79
|
-
## Lifecycle Sequence
|
|
80
|
-
|
|
81
|
-
For a complete feature, the typical skill sequence is:
|
|
82
|
-
|
|
83
|
-
1. `grill-me` → Extract what the user actually wants
|
|
84
|
-
2. `record-idea` → Refine vague ideas
|
|
85
|
-
3. `write-a-prd` → Define what we're building
|
|
86
|
-
4. `prd-to-tasks` → Break into verifiable chunks
|
|
87
|
-
5. `plan` → Orchestrate the full flow end-to-end
|
|
88
|
-
6. `ralph` → Execute all pending beads
|
|
89
|
-
7. `tdd` → Prove each slice works
|
|
90
|
-
8. `style-code` → Review before merge
|
|
91
|
-
9. `review-security` → Check for secrets
|
|
92
|
-
10. `git-workflow` → Clean commit history
|
|
93
|
-
|
|
94
|
-
Not every task needs every skill. A bug fix might only need: `tdd` → `style-code` → `review-security`.
|
|
95
|
-
|
|
96
|
-
## Red Flags
|
|
97
|
-
|
|
98
|
-
- Starting work without checking which skill applies.
|
|
99
|
-
- Skipping verification because "it looks right."
|
|
100
|
-
- Making wrong assumptions without stating them.
|
|
101
|
-
- Overcomplicating code when a simple solution exists.
|
|
102
|
-
- Modifying code orthogonal to the task scope.
|
|
103
|
-
|
|
104
|
-
## Verification checklist
|
|
105
|
-
|
|
106
|
-
- [ ] Correct skill identified before starting work.
|
|
107
|
-
- [ ] Core operating behaviors followed throughout.
|
|
108
|
-
- [ ] Verification completed with evidence (tests, build, runtime).
|
|
109
|
-
- [ ] Scope limited to the task at hand.
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
|
|
4
|
-
const SKILL_PATH = new URL("../SKILL.md", import.meta.url);
|
|
5
|
-
|
|
6
|
-
function readSkill(): string {
|
|
7
|
-
return readFileSync(SKILL_PATH, "utf-8");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
describe("using-agent-skills SKILL.md structure", () => {
|
|
11
|
-
const content = readSkill();
|
|
12
|
-
|
|
13
|
-
it("has required front-matter fields", () => {
|
|
14
|
-
expect(content).toMatch(/^---\n/);
|
|
15
|
-
expect(content).toMatch(/name:\s*using-agent-skills/);
|
|
16
|
-
expect(content).toMatch(/description:/);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("description is ≤ 1024 characters", () => {
|
|
20
|
-
const descMatch = content.match(/description:\s*(.+)/);
|
|
21
|
-
expect(descMatch).toBeTruthy();
|
|
22
|
-
if (descMatch) {
|
|
23
|
-
expect(descMatch[1].length).toBeLessThanOrEqual(1024);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("description includes 'Use when' trigger phrases", () => {
|
|
28
|
-
expect(content).toMatch(/Use when/i);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("has required 'When to use' section", () => {
|
|
32
|
-
expect(content).toMatch(/## When to use/);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it("has required 'Workflow' section", () => {
|
|
36
|
-
expect(content).toMatch(/## Workflow/);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it("has required 'Verification checklist' section", () => {
|
|
40
|
-
expect(content).toMatch(/## Verification checklist/);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("has 'Core Operating Behaviors' section", () => {
|
|
44
|
-
expect(content).toMatch(/## Core Operating Behaviors/);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("has a skill routing decision tree", () => {
|
|
48
|
-
expect(content).toContain("Task arrives");
|
|
49
|
-
expect(content).toContain("→ ralph");
|
|
50
|
-
expect(content).toContain("→ tdd");
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("references existing agent-cortex skills", () => {
|
|
54
|
-
const expectedSkills = [
|
|
55
|
-
"ralph",
|
|
56
|
-
"plan",
|
|
57
|
-
"tdd",
|
|
58
|
-
"bd-tool",
|
|
59
|
-
"git-workflow",
|
|
60
|
-
"review-security",
|
|
61
|
-
"style-code",
|
|
62
|
-
"style-tests",
|
|
63
|
-
];
|
|
64
|
-
for (const skill of expectedSkills) {
|
|
65
|
-
expect(content).toContain(skill);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("is under 150 lines", () => {
|
|
70
|
-
const lines = content.split("\n");
|
|
71
|
-
expect(lines.length).toBeLessThanOrEqual(150);
|
|
72
|
-
});
|
|
73
|
-
});
|
|
File without changes
|
|
File without changes
|