Skip to content

Commit 58caa72

Browse files
committed
refactor: move CCG guidance into agent skills
1 parent 07878b4 commit 58caa72

24 files changed

Lines changed: 619 additions & 875 deletions

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Main commands:
4444
- `ccg search <query>` - full-text search (includes annotations)
4545
- `ccg lint [--strict]` - check documentation quality
4646
- `/ccg-annotate annotate [file|dir]` - AI annotation generation workflow
47-
- `ccg example [language]`, `ccg tags` - annotation examples and tag reference
4847

4948
Use `.ccg.yaml` to manage project defaults such as exclude patterns and DB settings.
5049

guide/annotations.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,13 @@ Agent: reads code → generates @intent, @domainRule, @sideEffect, @mutates
108108
→ now searchable by business context
109109
```
110110

111-
### CLI
112-
113-
```bash
114-
# Show annotation examples
115-
ccg example go
116-
ccg example python
117-
118-
# Full tag reference
119-
ccg tags
120-
```
121-
122111
### Skill
123112

124113
Use directly in a skill-capable coding agent with the `/ccg-annotate` skill:
125114

126115
```
127116
/ccg-annotate annotate internal/ — AI-generate annotations
128117
```
118+
119+
The project-local skill keeps its complete tag contract and comment-syntax
120+
examples in [`skills/ccg-annotate/references/annotation-reference.md`](../skills/ccg-annotate/references/annotation-reference.md).

guide/cli-reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ ccg update ./backend --namespace backend
4848
| `ccg docs --rag-index-dir <dir>` | Override the legacy-named Wiki index output directory (default `.ccg` or `rag.index_dir`) |
4949
| `ccg docs --prune=false` | Regenerate docs without deleting older generator-managed files |
5050
| `ccg docs --exclude <pat>` | Exclude files/paths from generated docs (repeatable) |
51-
| `ccg languages` | List supported languages and extensions |
52-
| `ccg example [language]` | Show annotation writing example |
53-
| `ccg tags` | Show all annotation tag reference |
5451
| `ccg hooks install` | Install pre-commit git hook |
5552
| `ccg hooks install --lint-strict` | Install hook that blocks commit on issues |
5653
| `ccg lint [--out dir]` | 8-category docs lint |

guide/development.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,24 @@ The dist directory is ignored by git and packaged separately for releases:
126126
make wiki-build
127127
```
128128

129+
## Skill Contract
130+
131+
Each project-local skill under `skills/` declares:
132+
133+
- trigger-rich `name` and `description` frontmatter
134+
- semantic `metadata.version`
135+
- `metadata.openclaw.category` and `domain`
136+
- required binaries and prerequisite skills under `metadata.requires`
137+
- `metadata.cliHelp` only when the skill has a direct CLI help surface
138+
139+
Keep detailed variants in directly linked `references/` files and keep core
140+
`SKILL.md` instructions host-neutral. Validate metadata, dependencies, direct
141+
reference links, and removed-command drift with:
142+
143+
```bash
144+
go test ./internal/cli -run TestProjectSkills -count=1
145+
```
146+
129147
## Conventions
130148

131149
- TDD: Red → Green → Refactor

guide/ko/annotations.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,13 @@ Agent: 코드 분석 → @intent, @domainRule, @sideEffect, @mutates 생성
104104
→ 이제 비즈니스 컨텍스트로 검색 가능
105105
```
106106

107-
### CLI
108-
109-
```bash
110-
# 어노테이션 예시 보기
111-
ccg example go
112-
ccg example python
113-
114-
# 전체 태그 레퍼런스
115-
ccg tags
116-
```
117-
118107
### 스킬 (Skill)
119108

120109
스킬을 지원하는 코딩 에이전트에서 `/ccg-annotate` 스킬을 직접 사용하십시오:
121110

122111
```
123112
/ccg-annotate annotate internal/ — AI를 사용하여 어노테이션 자동 생성
124113
```
114+
115+
전체 태그 계약과 언어별 주석 문법 예시는 프로젝트 로컬 skill의
116+
[`skills/ccg-annotate/references/annotation-reference.md`](../../skills/ccg-annotate/references/annotation-reference.md)에 있습니다.

guide/ko/cli-reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ ccg update ./backend --namespace backend
5050
| `ccg docs --rag-index-dir <dir>` | legacy 이름을 유지한 Wiki index 출력 디렉터리 지정 (기본 `.ccg` 또는 `rag.index_dir`) |
5151
| `ccg docs --prune=false` | 기존 generator-managed 문서를 삭제하지 않고 문서만 다시 생성 |
5252
| `ccg docs --exclude <pat>` | 문서 생성 대상에서 파일/경로 제외 (반복 가능) |
53-
| `ccg languages` | 지원되는 언어 및 확장자 목록 출력 |
54-
| `ccg example [language]` | 어노테이션 작성 예시 출력 |
55-
| `ccg tags` | 모든 어노테이션 태그 레퍼런스 출력 |
5653
| `ccg hooks install` | pre-commit git 훅 설치 |
5754
| `ccg hooks install --lint-strict` | 문제가 있을 경우 커밋을 차단하는 훅 설치 |
5855
| `ccg lint [--out dir]` | 8가지 카테고리의 문서 린트(lint) 실행 |

guide/ko/development.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@ dist 디렉터리는 git에서 제외하고 release에서 별도 asset으로 패
128128
make wiki-build
129129
```
130130

131+
## Skill 계약 (Skill Contract)
132+
133+
`skills/` 아래의 모든 프로젝트 로컬 skill은 다음을 frontmatter에 선언합니다:
134+
135+
- 실제 trigger가 포함된 `name``description`
136+
- semantic `metadata.version`
137+
- `metadata.openclaw.category``domain`
138+
- `metadata.requires` 아래의 필수 binary와 선행 skill
139+
- 직접 대응하는 CLI help가 있을 때만 `metadata.cliHelp`
140+
141+
세부 variant는 `SKILL.md`에서 직접 연결한 `references/` 파일에 두고, 핵심
142+
`SKILL.md` 지침은 특정 host에 종속되지 않게 유지합니다. metadata, dependency,
143+
직접 reference link, 제거된 command drift는 다음 명령으로 검증합니다:
144+
145+
```bash
146+
go test ./internal/cli -run TestProjectSkills -count=1
147+
```
148+
131149
## 컨벤션 (Conventions)
132150

133151
- TDD: Red → Green → Refactor

internal/cli/config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,12 @@ func TestConfigFlag_LoadsYAML(t *testing.T) {
220220
}
221221

222222
deps, stdout, stderr := newTestDeps()
223-
// tags command doesn't need DB, so it works without InitFunc
224-
if err := executeCmd(deps, stdout, stderr, "--config", cfgFile, "tags"); err != nil {
223+
// version does not need DB, so config loading can be tested without InitFunc.
224+
if err := executeCmd(deps, stdout, stderr, "--config", cfgFile, "version"); err != nil {
225225
t.Fatalf("unexpected error: %v", err)
226226
}
227227

228-
if !strings.Contains(stdout.String(), "@index") {
229-
t.Errorf("expected tags output, got: %s", stdout.String())
228+
if !strings.Contains(stdout.String(), "ccg dev") {
229+
t.Errorf("expected version output, got: %s", stdout.String())
230230
}
231231
}

0 commit comments

Comments
 (0)