Skip to content

Commit 7e7216e

Browse files
committed
Add requirement for skill custom registry
1 parent 5d59c4d commit 7e7216e

File tree

8 files changed

+475
-5
lines changed

8 files changed

+475
-5
lines changed

.ai-devkit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"testing"
1313
],
1414
"createdAt": "2025-12-28T13:35:45.251Z",
15-
"updatedAt": "2026-01-25T14:05:14.517Z"
15+
"updatedAt": "2026-01-26T20:02:55.191Z"
1616
}

AGENTS.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,56 @@ This project uses ai-devkit for structured AI-assisted development. Phase docume
2828
- For new features, start with requirements clarification
2929
- Update phase docs when significant changes or decisions are made
3030

31+
## Skills (Extend Your Capabilities)
32+
Skills are packaged capabilities that teach you new competencies, patterns, and best practices. Check for installed skills in the project's skill directory and use them to enhance your work.
33+
34+
### Using Installed Skills
35+
1. **Check for skills**: Look for `SKILL.md` files in the project's skill directory
36+
2. **Read skill instructions**: Each skill contains detailed guidance on when and how to use it
37+
3. **Apply skill knowledge**: Follow the patterns, commands, and best practices defined in the skill
38+
39+
### Key Installed Skills
40+
- **memory**: Use AI DevKit's memory service via CLI commands when MCP is unavailable. Read the skill for detailed `memory store` and `memory search` command usage.
41+
42+
### When to Reference Skills
43+
- Before implementing features that match a skill's domain
44+
- When MCP tools are unavailable but skill provides CLI alternatives
45+
- To follow established patterns and conventions defined in skills
46+
47+
## Knowledge Memory (Always Use When Helpful)
48+
The AI assistant should proactively use knowledge memory throughout all interactions.
49+
50+
> **Tip**: If MCP is unavailable, use the **memory skill** for detailed CLI command reference.
51+
52+
### When to Search Memory
53+
- Before starting any task, search for relevant project conventions, patterns, or decisions
54+
- When you need clarification on how something was done before
55+
- To check for existing solutions to similar problems
56+
- To understand project-specific terminology or standards
57+
58+
**How to search**:
59+
- Use `memory.searchKnowledge` MCP tool with relevant keywords, tags, and scope
60+
- If MCP tools are unavailable, use `npx ai-devkit memory search` CLI command (see memory skill for details)
61+
- Example: Search for "authentication patterns" when implementing auth features
62+
63+
### When to Store Memory
64+
- After making important architectural or design decisions
65+
- When discovering useful patterns or solutions worth reusing
66+
- If the user explicitly asks to "remember this" or save guidance
67+
- When you establish new conventions or standards for the project
68+
69+
**How to store**:
70+
- Use `memory.storeKnowledge` MCP tool
71+
- If MCP tools are unavailable, use `npx ai-devkit memory store` CLI command (see memory skill for details)
72+
- Include clear title, detailed content, relevant tags, and appropriate scope
73+
- Make knowledge specific and actionable, not generic advice
74+
75+
### Memory Best Practices
76+
- **Be Proactive**: Search memory before asking the user repetitive questions
77+
- **Be Specific**: Store knowledge that's actionable and reusable
78+
- **Use Tags**: Tag knowledge appropriately for easy discovery (e.g., "api", "testing", "architecture")
79+
- **Scope Appropriately**: Use `global` for general patterns, `project:<name>` for project-specific knowledge
80+
3181
## Testing & Quality
3282
- Write tests alongside implementation
3383
- Follow the testing strategy defined in `docs/ai/testing/`
@@ -47,5 +97,5 @@ When working on this project, you can run commands to:
4797
- Review architectural decisions (`review-design`)
4898
- Plan and execute tasks (`execute-plan`)
4999
- Verify implementation against design (`check-implementation`)
50-
- Suggest missing tests (`suggest-tests`)
51-
- Perform structured code reviews (`code-review`)
100+
- Writing tests (`writing-test`)
101+
- Perform structured code reviews (`code-review`)

CLAUDE.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,56 @@ This project uses ai-devkit for structured AI-assisted development. Phase docume
2828
- For new features, start with requirements clarification
2929
- Update phase docs when significant changes or decisions are made
3030

31+
## Skills (Extend Your Capabilities)
32+
Skills are packaged capabilities that teach you new competencies, patterns, and best practices. Check for installed skills in the project's skill directory and use them to enhance your work.
33+
34+
### Using Installed Skills
35+
1. **Check for skills**: Look for `SKILL.md` files in the project's skill directory
36+
2. **Read skill instructions**: Each skill contains detailed guidance on when and how to use it
37+
3. **Apply skill knowledge**: Follow the patterns, commands, and best practices defined in the skill
38+
39+
### Key Installed Skills
40+
- **memory**: Use AI DevKit's memory service via CLI commands when MCP is unavailable. Read the skill for detailed `memory store` and `memory search` command usage.
41+
42+
### When to Reference Skills
43+
- Before implementing features that match a skill's domain
44+
- When MCP tools are unavailable but skill provides CLI alternatives
45+
- To follow established patterns and conventions defined in skills
46+
47+
## Knowledge Memory (Always Use When Helpful)
48+
The AI assistant should proactively use knowledge memory throughout all interactions.
49+
50+
> **Tip**: If MCP is unavailable, use the **memory skill** for detailed CLI command reference.
51+
52+
### When to Search Memory
53+
- Before starting any task, search for relevant project conventions, patterns, or decisions
54+
- When you need clarification on how something was done before
55+
- To check for existing solutions to similar problems
56+
- To understand project-specific terminology or standards
57+
58+
**How to search**:
59+
- Use `memory.searchKnowledge` MCP tool with relevant keywords, tags, and scope
60+
- If MCP tools are unavailable, use `npx ai-devkit memory search` CLI command (see memory skill for details)
61+
- Example: Search for "authentication patterns" when implementing auth features
62+
63+
### When to Store Memory
64+
- After making important architectural or design decisions
65+
- When discovering useful patterns or solutions worth reusing
66+
- If the user explicitly asks to "remember this" or save guidance
67+
- When you establish new conventions or standards for the project
68+
69+
**How to store**:
70+
- Use `memory.storeKnowledge` MCP tool
71+
- If MCP tools are unavailable, use `npx ai-devkit memory store` CLI command (see memory skill for details)
72+
- Include clear title, detailed content, relevant tags, and appropriate scope
73+
- Make knowledge specific and actionable, not generic advice
74+
75+
### Memory Best Practices
76+
- **Be Proactive**: Search memory before asking the user repetitive questions
77+
- **Be Specific**: Store knowledge that's actionable and reusable
78+
- **Use Tags**: Tag knowledge appropriately for easy discovery (e.g., "api", "testing", "architecture")
79+
- **Scope Appropriately**: Use `global` for general patterns, `project:<name>` for project-specific knowledge
80+
3181
## Testing & Quality
3282
- Write tests alongside implementation
3383
- Follow the testing strategy defined in `docs/ai/testing/`
@@ -47,5 +97,5 @@ When working on this project, you can run commands to:
4797
- Review architectural decisions (`review-design`)
4898
- Plan and execute tasks (`execute-plan`)
4999
- Verify implementation against design (`check-implementation`)
50-
- Suggest missing tests (`suggest-tests`)
51-
- Perform structured code reviews (`code-review`)
100+
- Writing tests (`writing-test`)
101+
- Perform structured code reviews (`code-review`)
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
phase: design
3+
title: System Design & Architecture
4+
description: Define the technical architecture, components, and data models
5+
---
6+
7+
# System Design & Architecture
8+
9+
## Architecture Overview
10+
11+
**What is the high-level system structure?**
12+
13+
- Add a registry resolution layer that merges default and custom registries before skill operations.
14+
- Default registry remains fetched from the current remote registry JSON.
15+
- Custom registries are read from a global `.ai-devkit.json`.
16+
- Skill commands use the merged registry map with local overrides.
17+
18+
```mermaid
19+
graph TD
20+
CLI[ai-devkit skill commands] --> SkillManager
21+
SkillManager --> RegistryResolver
22+
RegistryResolver --> DefaultRegistry[Remote registry.json]
23+
RegistryResolver --> GlobalConfig[~/.ai-devkit/.ai-devkit.json]
24+
RegistryResolver --> MergedRegistry[merged registries map]
25+
SkillManager --> Cache[~/.ai-devkit/skills]
26+
```
27+
28+
## Data Models
29+
30+
**What data do we need to manage?**
31+
32+
- Global config (new or extended):
33+
- `skills.registries` (map of `registryId -> gitUrl`)
34+
- Registry JSON (existing):
35+
- `registries` map of registry IDs to Git URLs
36+
37+
Example global config snippet:
38+
39+
```json
40+
{
41+
"skills": {
42+
"registries": {
43+
"my-org/skills": "git@github.com:my-org/skills.git",
44+
"me/personal-skills": "https://github.com/me/personal-skills.git"
45+
}
46+
}
47+
}
48+
```
49+
50+
## API Design
51+
52+
**How do components communicate?**
53+
54+
- CLI commands (`skill add`, `skill list`, `skill remove`, `skill update`, `skill search`) call `SkillManager`.
55+
- `SkillManager` uses a new helper (e.g., `RegistryResolver`) to:
56+
- Load default registry (remote JSON).
57+
- Load custom registries from global config.
58+
- Merge with custom overrides on conflict.
59+
- No external API changes; internal interface remains synchronous with current workflow.
60+
61+
## Component Breakdown
62+
63+
**What are the major building blocks?**
64+
65+
- `SkillManager`: update to use merged registries for all commands.
66+
- `GlobalConfigManager` (new): read/write `~/.ai-devkit/.ai-devkit.json`.
67+
- `RegistryResolver` (new or within SkillManager): merge registry sources.
68+
- Cache handler (existing): reuse `~/.ai-devkit/skills`.
69+
70+
## Design Decisions
71+
72+
**Why did we choose this approach?**
73+
74+
- Use existing registry format to avoid new parsing logic.
75+
- Keep CLI UX unchanged by merging sources before lookup.
76+
- Local override provides predictable behavior for conflicts.
77+
- Cache reuse enables offline workflows without new storage systems.
78+
79+
Alternatives considered:
80+
81+
- Separate registry list files per project (rejected: requirement is global).
82+
- Display registry source in list output (rejected: keep seamless UX).
83+
84+
## Non-Functional Requirements
85+
86+
**How should the system perform?**
87+
88+
- Performance: avoid repeated registry downloads by caching and only fetching when needed.
89+
- Scalability: support many registries by merging maps and cloning on demand.
90+
- Security: rely on git and local credentials; no credential handling in CLI.
91+
- Reliability: fall back to cache when remote registry is unavailable.
92+
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
phase: implementation
3+
title: Implementation Guide
4+
description: Technical implementation notes, patterns, and code guidelines
5+
---
6+
7+
# Implementation Guide
8+
9+
## Development Setup
10+
**How do we get started?**
11+
12+
- Ensure git is installed and available in PATH.
13+
- Identify the global config location (assumed: `~/.ai-devkit/.ai-devkit.json`).
14+
- Prepare a sample custom registry repo for local testing.
15+
16+
## Code Structure
17+
**How is the code organized?**
18+
19+
- `packages/cli/src/lib/SkillManager.ts`: main skill command logic
20+
- `packages/cli/src/lib/Config.ts`: project config manager (existing)
21+
- New: `GlobalConfigManager` for global `.ai-devkit.json`
22+
- New or inline: registry merge helper (e.g., `RegistryResolver`)
23+
24+
## Implementation Notes
25+
**Key technical details to remember:**
26+
27+
### Core Features
28+
- Load default registry from remote `registry.json` (current behavior).
29+
- Load custom registries from global config using the same `registries` map format.
30+
- Merge registries with custom entries overriding default on registry ID collision.
31+
- Use the merged registry map for all skill commands.
32+
- When remote registry fetch fails, fall back to cached registry data if available.
33+
34+
### Patterns & Best Practices
35+
- Keep registry merging logic centralized to avoid command drift.
36+
- Use explicit, user-facing errors when registry IDs or skills are not found.
37+
- Preserve existing cache behavior to maintain offline support.
38+
39+
## Integration Points
40+
**How do pieces connect?**
41+
42+
- `SkillManager` calls into registry resolver for merged registry map.
43+
- Registry resolver reads:
44+
- Remote default registry JSON
45+
- Global config `skillRegistries.registries`
46+
- Repository cloning remains in `cloneRepositoryToCache`.
47+
48+
## Error Handling
49+
**How do we handle failures?**
50+
51+
- If registry fetch fails but cache exists, continue with cache.
52+
- If a registry ID is missing in the merged map, return available registry IDs.
53+
- If skill path or `SKILL.md` missing, show a clear error.
54+
55+
## Performance Considerations
56+
**How do we keep it fast?**
57+
58+
- Avoid re-cloning registries when cache exists.
59+
- Keep registry JSON fetch to a single request per command invocation.
60+
61+
## Security Notes
62+
**What security measures are in place?**
63+
64+
- No credential handling in CLI; rely on user-managed git credentials.
65+
- Do not execute any scripts from cloned repositories.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
phase: planning
3+
title: Project Planning & Task Breakdown
4+
description: Break down work into actionable tasks and estimate timeline
5+
---
6+
7+
# Project Planning & Task Breakdown
8+
9+
## Milestones
10+
**What are the major checkpoints?**
11+
12+
- [ ] Milestone 1: Global registry config support and merge logic
13+
- [ ] Milestone 2: Skill commands updated and tested
14+
- [ ] Milestone 3: Documentation and testing finalized
15+
16+
## Task Breakdown
17+
**What specific work needs to be done?**
18+
19+
### Phase 1: Foundation
20+
- [ ] Task 1.1: Define global config schema for `skillRegistries`
21+
- [ ] Task 1.2: Add global config manager for `~/.ai-devkit/.ai-devkit.json`
22+
- [ ] Task 1.3: Update types to include optional `skillRegistries`
23+
24+
### Phase 2: Core Features
25+
- [ ] Task 2.1: Implement registry merge logic (custom overrides default)
26+
- [ ] Task 2.2: Update `SkillManager` to use merged registries for all commands
27+
- [ ] Task 2.3: Ensure offline behavior uses cached registries when remote fetch fails
28+
29+
### Phase 3: Integration & Polish
30+
- [ ] Task 3.1: Add unit tests for registry merging and config parsing
31+
- [ ] Task 3.2: Add integration tests for skill commands with custom registries
32+
- [ ] Task 3.3: Update docs and finalize testing notes
33+
34+
## Dependencies
35+
**What needs to happen in what order?**
36+
37+
- Global config schema and manager must be in place before skill command updates.
38+
- Merge logic should be implemented before modifying command behavior.
39+
- Tests depend on updated `SkillManager` behavior and new config handling.
40+
41+
## Timeline & Estimates
42+
**When will things be done?**
43+
44+
- Phase 1: 0.5-1 day
45+
- Phase 2: 1-2 days
46+
- Phase 3: 0.5-1 day
47+
48+
## Risks & Mitigation
49+
**What could go wrong?**
50+
51+
- Registry conflicts cause unexpected behavior → enforce clear override rules.
52+
- Remote registry fetch failure breaks commands → fallback to cache and log.
53+
- Config path ambiguity → document and test explicit path.
54+
55+
## Resources Needed
56+
**What do we need to succeed?**
57+
58+
- Access to a sample custom registry repo for testing
59+
- Git installed and available in CI/dev environments
60+
- Updated documentation and test templates

0 commit comments

Comments
 (0)