claude-code-pilot 3.0.0 → 3.1.0
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 +76 -97
- package/bin/install.js +13 -13
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/agents/doc-updater.md +1 -1
- package/src/agents/gan-evaluator.md +209 -0
- package/src/agents/gan-generator.md +131 -0
- package/src/agents/gan-planner.md +99 -0
- package/src/agents/harness-optimizer.md +35 -0
- package/src/agents/loop-operator.md +36 -0
- package/src/agents/opensource-forker.md +198 -0
- package/src/agents/opensource-packager.md +249 -0
- package/src/agents/opensource-sanitizer.md +188 -0
- package/src/agents/performance-optimizer.md +446 -0
- package/src/available-rules/README.md +1 -1
- package/src/commands/{aside.md → ccp/aside.md} +14 -13
- package/src/commands/{build-fix.md → ccp/build-fix.md} +5 -0
- package/src/commands/{checkpoint.md → ccp/checkpoint.md} +12 -7
- package/src/commands/{code-review.md → ccp/code-review.md} +5 -0
- package/src/commands/{context-budget.md → ccp/context-budget.md} +2 -1
- package/src/commands/{cpp-build.md → ccp/cpp-build.md} +6 -5
- package/src/commands/{cpp-review.md → ccp/cpp-review.md} +7 -6
- package/src/commands/{cpp-test.md → ccp/cpp-test.md} +6 -5
- package/src/commands/ccp/docs-update.md +48 -0
- package/src/commands/{docs.md → ccp/docs.md} +4 -3
- package/src/commands/{e2e.md → ccp/e2e.md} +7 -6
- package/src/commands/{eval.md → ccp/eval.md} +10 -5
- package/src/commands/{evolve.md → ccp/evolve.md} +3 -3
- package/src/commands/{go-build.md → ccp/go-build.md} +6 -5
- package/src/commands/{go-review.md → ccp/go-review.md} +7 -6
- package/src/commands/{go-test.md → ccp/go-test.md} +6 -5
- package/src/commands/{gradle-build.md → ccp/gradle-build.md} +1 -0
- package/src/commands/{harness-audit.md → ccp/harness-audit.md} +6 -1
- package/src/commands/{kotlin-build.md → ccp/kotlin-build.md} +6 -5
- package/src/commands/{kotlin-review.md → ccp/kotlin-review.md} +7 -6
- package/src/commands/{kotlin-test.md → ccp/kotlin-test.md} +6 -5
- package/src/commands/{learn.md → ccp/learn.md} +7 -2
- package/src/commands/{model-route.md → ccp/model-route.md} +6 -1
- package/src/commands/{orchestrate.md → ccp/orchestrate.md} +4 -3
- package/src/commands/{plan.md → ccp/plan.md} +6 -5
- package/src/commands/ccp/profile-user.md +46 -0
- package/src/commands/{prompt-optimize.md → ccp/prompt-optimize.md} +3 -2
- package/src/commands/{prune.md → ccp/prune.md} +4 -4
- package/src/commands/{python-review.md → ccp/python-review.md} +7 -6
- package/src/commands/{quality-gate.md → ccp/quality-gate.md} +6 -1
- package/src/commands/{refactor-clean.md → ccp/refactor-clean.md} +5 -0
- package/src/commands/{resume-session.md → ccp/resume-session.md} +9 -8
- package/src/commands/ccp/review.md +37 -0
- package/src/commands/{rules-distill.md → ccp/rules-distill.md} +2 -1
- package/src/commands/{rust-build.md → ccp/rust-build.md} +6 -5
- package/src/commands/{rust-review.md → ccp/rust-review.md} +7 -6
- package/src/commands/{rust-test.md → ccp/rust-test.md} +6 -5
- package/src/commands/{save-session.md → ccp/save-session.md} +2 -1
- package/src/commands/ccp/secure-phase.md +35 -0
- package/src/commands/{sessions.md → ccp/sessions.md} +29 -24
- package/src/commands/{setup-pm.md → ccp/setup-pm.md} +1 -0
- package/src/commands/{setup-refresh.md → ccp/setup-refresh.md} +4 -3
- package/src/commands/{setup.md → ccp/setup.md} +24 -23
- package/src/commands/{skill-create.md → ccp/skill-create.md} +8 -8
- package/src/commands/{skill-health.md → ccp/skill-health.md} +5 -5
- package/src/commands/{tdd.md → ccp/tdd.md} +9 -8
- package/src/commands/{test-coverage.md → ccp/test-coverage.md} +5 -0
- package/src/commands/{tool-guide.md → ccp/tool-guide.md} +2 -1
- package/src/commands/{update-codemaps.md → ccp/update-codemaps.md} +5 -0
- package/src/commands/{update-docs.md → ccp/update-docs.md} +5 -0
- package/src/commands/{verify.md → ccp/verify.md} +5 -0
- package/src/commands/ccp/workstreams.md +68 -0
- package/src/examples/CLAUDE.md +4 -4
- package/src/examples/django-api-CLAUDE.md +5 -5
- package/src/examples/go-microservice-CLAUDE.md +6 -6
- package/src/examples/rust-api-CLAUDE.md +4 -4
- package/src/examples/saas-nextjs-CLAUDE.md +8 -8
- package/src/hooks/session-start.js +1 -1
- package/src/pilot/references/mcp-servers.json +1 -1
- package/src/pilot/workflows/docs-update.md +1165 -0
- package/src/pilot/workflows/help.md +48 -56
- package/src/pilot/workflows/profile-user.md +452 -0
- package/src/pilot/workflows/review.md +244 -0
- package/src/pilot/workflows/secure-phase.md +164 -0
- package/src/rules/common/code-review.md +124 -0
- package/src/rules/zh/README.md +108 -0
- package/src/rules/zh/agents.md +50 -0
- package/src/rules/zh/code-review.md +124 -0
- package/src/rules/zh/coding-style.md +48 -0
- package/src/rules/zh/development-workflow.md +44 -0
- package/src/rules/zh/git-workflow.md +24 -0
- package/src/rules/zh/hooks.md +30 -0
- package/src/rules/zh/patterns.md +31 -0
- package/src/rules/zh/performance.md +55 -0
- package/src/rules/zh/security.md +29 -0
- package/src/rules/zh/testing.md +29 -0
- package/src/skills/autonomous-agent-harness/SKILL.md +267 -0
- package/src/skills/autonomous-loops/SKILL.md +610 -0
- package/src/skills/bun-runtime/SKILL.md +84 -0
- package/src/skills/content-hash-cache-pattern/SKILL.md +161 -0
- package/src/skills/context-budget/SKILL.md +3 -3
- package/src/skills/continuous-learning-v2/SKILL.md +4 -4
- package/src/skills/continuous-learning-v2/agents/observer.md +1 -1
- package/src/skills/cost-aware-llm-pipeline/SKILL.md +183 -0
- package/src/skills/design-system/SKILL.md +82 -0
- package/src/skills/eval-harness/SKILL.md +270 -0
- package/src/skills/flutter-dart-code-review/SKILL.md +435 -0
- package/src/skills/gan-style-harness/SKILL.md +278 -0
- package/src/skills/git-workflow/SKILL.md +715 -0
- package/src/skills/hexagonal-architecture/SKILL.md +276 -0
- package/src/skills/iterative-retrieval/SKILL.md +211 -0
- package/src/skills/laravel-plugin-discovery/SKILL.md +229 -0
- package/src/skills/nextjs-turbopack/SKILL.md +44 -0
- package/src/skills/nuxt4-patterns/SKILL.md +100 -0
- package/src/skills/opensource-pipeline/SKILL.md +255 -0
- package/src/skills/perl-security/SKILL.md +503 -0
- package/src/skills/project-flow-ops/SKILL.md +111 -0
- package/src/skills/project-guidelines-example/SKILL.md +349 -0
- package/src/skills/prompt-optimizer/SKILL.md +38 -38
- package/src/skills/pytorch-patterns/SKILL.md +396 -0
- package/src/skills/regex-vs-llm-structured-text/SKILL.md +220 -0
- package/src/skills/repo-scan/SKILL.md +78 -0
- package/src/skills/rules-distill/SKILL.md +264 -0
- package/src/skills/rules-distill/scripts/scan-rules.sh +58 -0
- package/src/skills/rules-distill/scripts/scan-skills.sh +129 -0
- package/src/skills/swift-concurrency-6-2/SKILL.md +216 -0
- package/src/skills/token-budget-advisor/SKILL.md +133 -0
- package/src/skills/verification-loop/SKILL.md +1 -1
- package/src/skills/workspace-surface-audit/SKILL.md +125 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: project-guidelines-example
|
|
3
|
+
description: "Example project-specific skill template based on a real production application."
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project Guidelines Skill (Example)
|
|
8
|
+
|
|
9
|
+
This is an example of a project-specific skill. Use this as a template for your own projects.
|
|
10
|
+
|
|
11
|
+
Based on a real production application: [Zenith](https://zenith.chat) - AI-powered customer discovery platform.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
Reference this skill when working on the specific project it's designed for. Project skills contain:
|
|
16
|
+
- Architecture overview
|
|
17
|
+
- File structure
|
|
18
|
+
- Code patterns
|
|
19
|
+
- Testing requirements
|
|
20
|
+
- Deployment workflow
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Architecture Overview
|
|
25
|
+
|
|
26
|
+
**Tech Stack:**
|
|
27
|
+
- **Frontend**: Next.js 15 (App Router), TypeScript, React
|
|
28
|
+
- **Backend**: FastAPI (Python), Pydantic models
|
|
29
|
+
- **Database**: Supabase (PostgreSQL)
|
|
30
|
+
- **AI**: Claude API with tool calling and structured output
|
|
31
|
+
- **Deployment**: Google Cloud Run
|
|
32
|
+
- **Testing**: Playwright (E2E), pytest (backend), React Testing Library
|
|
33
|
+
|
|
34
|
+
**Services:**
|
|
35
|
+
```
|
|
36
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
37
|
+
│ Frontend │
|
|
38
|
+
│ Next.js 15 + TypeScript + TailwindCSS │
|
|
39
|
+
│ Deployed: Vercel / Cloud Run │
|
|
40
|
+
└─────────────────────────────────────────────────────────────┘
|
|
41
|
+
│
|
|
42
|
+
▼
|
|
43
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
44
|
+
│ Backend │
|
|
45
|
+
│ FastAPI + Python 3.11 + Pydantic │
|
|
46
|
+
│ Deployed: Cloud Run │
|
|
47
|
+
└─────────────────────────────────────────────────────────────┘
|
|
48
|
+
│
|
|
49
|
+
┌───────────────┼───────────────┐
|
|
50
|
+
▼ ▼ ▼
|
|
51
|
+
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
52
|
+
│ Supabase │ │ Claude │ │ Redis │
|
|
53
|
+
│ Database │ │ API │ │ Cache │
|
|
54
|
+
└──────────┘ └──────────┘ └──────────┘
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## File Structure
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
project/
|
|
63
|
+
├── frontend/
|
|
64
|
+
│ └── src/
|
|
65
|
+
│ ├── app/ # Next.js app router pages
|
|
66
|
+
│ │ ├── api/ # API routes
|
|
67
|
+
│ │ ├── (auth)/ # Auth-protected routes
|
|
68
|
+
│ │ └── workspace/ # Main app workspace
|
|
69
|
+
│ ├── components/ # React components
|
|
70
|
+
│ │ ├── ui/ # Base UI components
|
|
71
|
+
│ │ ├── forms/ # Form components
|
|
72
|
+
│ │ └── layouts/ # Layout components
|
|
73
|
+
│ ├── hooks/ # Custom React hooks
|
|
74
|
+
│ ├── lib/ # Utilities
|
|
75
|
+
│ ├── types/ # TypeScript definitions
|
|
76
|
+
│ └── config/ # Configuration
|
|
77
|
+
│
|
|
78
|
+
├── backend/
|
|
79
|
+
│ ├── routers/ # FastAPI route handlers
|
|
80
|
+
│ ├── models.py # Pydantic models
|
|
81
|
+
│ ├── main.py # FastAPI app entry
|
|
82
|
+
│ ├── auth_system.py # Authentication
|
|
83
|
+
│ ├── database.py # Database operations
|
|
84
|
+
│ ├── services/ # Business logic
|
|
85
|
+
│ └── tests/ # pytest tests
|
|
86
|
+
│
|
|
87
|
+
├── deploy/ # Deployment configs
|
|
88
|
+
├── docs/ # Documentation
|
|
89
|
+
└── scripts/ # Utility scripts
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Code Patterns
|
|
95
|
+
|
|
96
|
+
### API Response Format (FastAPI)
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from pydantic import BaseModel
|
|
100
|
+
from typing import Generic, TypeVar, Optional
|
|
101
|
+
|
|
102
|
+
T = TypeVar('T')
|
|
103
|
+
|
|
104
|
+
class ApiResponse(BaseModel, Generic[T]):
|
|
105
|
+
success: bool
|
|
106
|
+
data: Optional[T] = None
|
|
107
|
+
error: Optional[str] = None
|
|
108
|
+
|
|
109
|
+
@classmethod
|
|
110
|
+
def ok(cls, data: T) -> "ApiResponse[T]":
|
|
111
|
+
return cls(success=True, data=data)
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def fail(cls, error: str) -> "ApiResponse[T]":
|
|
115
|
+
return cls(success=False, error=error)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Frontend API Calls (TypeScript)
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
interface ApiResponse<T> {
|
|
122
|
+
success: boolean
|
|
123
|
+
data?: T
|
|
124
|
+
error?: string
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function fetchApi<T>(
|
|
128
|
+
endpoint: string,
|
|
129
|
+
options?: RequestInit
|
|
130
|
+
): Promise<ApiResponse<T>> {
|
|
131
|
+
try {
|
|
132
|
+
const response = await fetch(`/api${endpoint}`, {
|
|
133
|
+
...options,
|
|
134
|
+
headers: {
|
|
135
|
+
'Content-Type': 'application/json',
|
|
136
|
+
...options?.headers,
|
|
137
|
+
},
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
if (!response.ok) {
|
|
141
|
+
return { success: false, error: `HTTP ${response.status}` }
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return await response.json()
|
|
145
|
+
} catch (error) {
|
|
146
|
+
return { success: false, error: String(error) }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Claude AI Integration (Structured Output)
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from anthropic import Anthropic
|
|
155
|
+
from pydantic import BaseModel
|
|
156
|
+
|
|
157
|
+
class AnalysisResult(BaseModel):
|
|
158
|
+
summary: str
|
|
159
|
+
key_points: list[str]
|
|
160
|
+
confidence: float
|
|
161
|
+
|
|
162
|
+
async def analyze_with_claude(content: str) -> AnalysisResult:
|
|
163
|
+
client = Anthropic()
|
|
164
|
+
|
|
165
|
+
response = client.messages.create(
|
|
166
|
+
model="claude-sonnet-4-5-20250514",
|
|
167
|
+
max_tokens=1024,
|
|
168
|
+
messages=[{"role": "user", "content": content}],
|
|
169
|
+
tools=[{
|
|
170
|
+
"name": "provide_analysis",
|
|
171
|
+
"description": "Provide structured analysis",
|
|
172
|
+
"input_schema": AnalysisResult.model_json_schema()
|
|
173
|
+
}],
|
|
174
|
+
tool_choice={"type": "tool", "name": "provide_analysis"}
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
# Extract tool use result
|
|
178
|
+
tool_use = next(
|
|
179
|
+
block for block in response.content
|
|
180
|
+
if block.type == "tool_use"
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
return AnalysisResult(**tool_use.input)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Custom Hooks (React)
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { useState, useCallback } from 'react'
|
|
190
|
+
|
|
191
|
+
interface UseApiState<T> {
|
|
192
|
+
data: T | null
|
|
193
|
+
loading: boolean
|
|
194
|
+
error: string | null
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function useApi<T>(
|
|
198
|
+
fetchFn: () => Promise<ApiResponse<T>>
|
|
199
|
+
) {
|
|
200
|
+
const [state, setState] = useState<UseApiState<T>>({
|
|
201
|
+
data: null,
|
|
202
|
+
loading: false,
|
|
203
|
+
error: null,
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
const execute = useCallback(async () => {
|
|
207
|
+
setState(prev => ({ ...prev, loading: true, error: null }))
|
|
208
|
+
|
|
209
|
+
const result = await fetchFn()
|
|
210
|
+
|
|
211
|
+
if (result.success) {
|
|
212
|
+
setState({ data: result.data!, loading: false, error: null })
|
|
213
|
+
} else {
|
|
214
|
+
setState({ data: null, loading: false, error: result.error! })
|
|
215
|
+
}
|
|
216
|
+
}, [fetchFn])
|
|
217
|
+
|
|
218
|
+
return { ...state, execute }
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Testing Requirements
|
|
225
|
+
|
|
226
|
+
### Backend (pytest)
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
# Run all tests
|
|
230
|
+
poetry run pytest tests/
|
|
231
|
+
|
|
232
|
+
# Run with coverage
|
|
233
|
+
poetry run pytest tests/ --cov=. --cov-report=html
|
|
234
|
+
|
|
235
|
+
# Run specific test file
|
|
236
|
+
poetry run pytest tests/test_auth.py -v
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Test structure:**
|
|
240
|
+
```python
|
|
241
|
+
import pytest
|
|
242
|
+
from httpx import AsyncClient
|
|
243
|
+
from main import app
|
|
244
|
+
|
|
245
|
+
@pytest.fixture
|
|
246
|
+
async def client():
|
|
247
|
+
async with AsyncClient(app=app, base_url="http://test") as ac:
|
|
248
|
+
yield ac
|
|
249
|
+
|
|
250
|
+
@pytest.mark.asyncio
|
|
251
|
+
async def test_health_check(client: AsyncClient):
|
|
252
|
+
response = await client.get("/health")
|
|
253
|
+
assert response.status_code == 200
|
|
254
|
+
assert response.json()["status"] == "healthy"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Frontend (React Testing Library)
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Run tests
|
|
261
|
+
npm run test
|
|
262
|
+
|
|
263
|
+
# Run with coverage
|
|
264
|
+
npm run test -- --coverage
|
|
265
|
+
|
|
266
|
+
# Run E2E tests
|
|
267
|
+
npm run test:e2e
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Test structure:**
|
|
271
|
+
```typescript
|
|
272
|
+
import { render, screen, fireEvent } from '@testing-library/react'
|
|
273
|
+
import { WorkspacePanel } from './WorkspacePanel'
|
|
274
|
+
|
|
275
|
+
describe('WorkspacePanel', () => {
|
|
276
|
+
it('renders workspace correctly', () => {
|
|
277
|
+
render(<WorkspacePanel />)
|
|
278
|
+
expect(screen.getByRole('main')).toBeInTheDocument()
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
it('handles session creation', async () => {
|
|
282
|
+
render(<WorkspacePanel />)
|
|
283
|
+
fireEvent.click(screen.getByText('New Session'))
|
|
284
|
+
expect(await screen.findByText('Session created')).toBeInTheDocument()
|
|
285
|
+
})
|
|
286
|
+
})
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Deployment Workflow
|
|
292
|
+
|
|
293
|
+
### Pre-Deployment Checklist
|
|
294
|
+
|
|
295
|
+
- [ ] All tests passing locally
|
|
296
|
+
- [ ] `npm run build` succeeds (frontend)
|
|
297
|
+
- [ ] `poetry run pytest` passes (backend)
|
|
298
|
+
- [ ] No hardcoded secrets
|
|
299
|
+
- [ ] Environment variables documented
|
|
300
|
+
- [ ] Database migrations ready
|
|
301
|
+
|
|
302
|
+
### Deployment Commands
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# Build and deploy frontend
|
|
306
|
+
cd frontend && npm run build
|
|
307
|
+
gcloud run deploy frontend --source .
|
|
308
|
+
|
|
309
|
+
# Build and deploy backend
|
|
310
|
+
cd backend
|
|
311
|
+
gcloud run deploy backend --source .
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Environment Variables
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
# Frontend (.env.local)
|
|
318
|
+
NEXT_PUBLIC_API_URL=https://api.example.com
|
|
319
|
+
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
|
|
320
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ...
|
|
321
|
+
|
|
322
|
+
# Backend (.env)
|
|
323
|
+
DATABASE_URL=postgresql://...
|
|
324
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
325
|
+
SUPABASE_URL=https://xxx.supabase.co
|
|
326
|
+
SUPABASE_KEY=eyJ...
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Critical Rules
|
|
332
|
+
|
|
333
|
+
1. **No emojis** in code, comments, or documentation
|
|
334
|
+
2. **Immutability** - never mutate objects or arrays
|
|
335
|
+
3. **TDD** - write tests before implementation
|
|
336
|
+
4. **80% coverage** minimum
|
|
337
|
+
5. **Many small files** - 200-400 lines typical, 800 max
|
|
338
|
+
6. **No console.log** in production code
|
|
339
|
+
7. **Proper error handling** with try/catch
|
|
340
|
+
8. **Input validation** with Pydantic/Zod
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Related Skills
|
|
345
|
+
|
|
346
|
+
- `coding-standards.md` - General coding best practices
|
|
347
|
+
- `backend-patterns.md` - API and database patterns
|
|
348
|
+
- `frontend-patterns.md` - React and Next.js patterns
|
|
349
|
+
- `tdd-workflow/` - Test-driven development methodology
|
|
@@ -32,13 +32,13 @@ and output a complete optimized prompt the user can paste and run.
|
|
|
32
32
|
- User pastes a draft prompt and asks for feedback or enhancement
|
|
33
33
|
- User says "I don't know how to prompt for this"
|
|
34
34
|
- User says "how should I use Claude Code for..."
|
|
35
|
-
- User explicitly invokes `/prompt-optimize`
|
|
35
|
+
- User explicitly invokes `/ccp:prompt-optimize`
|
|
36
36
|
|
|
37
37
|
### Do Not Use When
|
|
38
38
|
|
|
39
39
|
- User wants the task done directly (just execute it)
|
|
40
40
|
- User says "优化代码", "优化性能", "optimize this code", "optimize performance" — these are refactoring tasks, not prompt optimization
|
|
41
|
-
- User is asking about project configuration (use `/setup` instead)
|
|
41
|
+
- User is asking about project configuration (use `/ccp:setup` instead)
|
|
42
42
|
- User wants a skill inventory (check `.claude/skills/` directory instead)
|
|
43
43
|
- User says "just do it" or "直接做"
|
|
44
44
|
|
|
@@ -105,8 +105,8 @@ from the prompt description alone and mark the estimate as uncertain.
|
|
|
105
105
|
|-------|-----------|---------------|
|
|
106
106
|
| TRIVIAL | Single file, < 50 lines | Direct execution |
|
|
107
107
|
| LOW | Single component or module | Single command or skill |
|
|
108
|
-
| MEDIUM | Multiple components, same domain | Command chain + /verify |
|
|
109
|
-
| HIGH | Cross-domain, 5+ files | /plan first, then phased execution |
|
|
108
|
+
| MEDIUM | Multiple components, same domain | Command chain + /ccp:verify |
|
|
109
|
+
| HIGH | Cross-domain, 5+ files | /ccp:plan first, then phased execution |
|
|
110
110
|
| EPIC | Multi-session, multi-PR, architectural shift | Use blueprint skill for multi-session plan |
|
|
111
111
|
|
|
112
112
|
### Phase 3: Component Matching
|
|
@@ -117,15 +117,15 @@ Map intent + scope + tech stack (from Phase 0) to specific available components.
|
|
|
117
117
|
|
|
118
118
|
| Intent | Commands | Skills | Agents |
|
|
119
119
|
|--------|----------|--------|--------|
|
|
120
|
-
| New Feature | /plan, /tdd, /code-review, /verify | tdd-workflow, verification-loop | planner, tdd-guide, code-reviewer |
|
|
121
|
-
| Bug Fix | /tdd, /build-fix, /verify | tdd-workflow | tdd-guide, build-error-resolver |
|
|
122
|
-
| Refactor | /refactor-clean, /code-review, /verify | verification-loop | refactor-cleaner, code-reviewer |
|
|
123
|
-
| Research | /plan | search-first, iterative-retrieval | — |
|
|
124
|
-
| Testing | /tdd, /e2e, /test-coverage | tdd-workflow, e2e-testing | tdd-guide, e2e-runner |
|
|
125
|
-
| Review | /code-review | security-review | code-reviewer, security-reviewer |
|
|
126
|
-
| Documentation | /update-docs, /update-codemaps | — | doc-updater |
|
|
127
|
-
| Infrastructure | /plan, /verify | docker-patterns, deployment-patterns, database-migrations | architect |
|
|
128
|
-
| Design (MEDIUM-HIGH) | /plan | — | planner, architect |
|
|
120
|
+
| New Feature | /ccp:plan, /ccp:tdd, /ccp:code-review, /ccp:verify | tdd-workflow, verification-loop | planner, tdd-guide, code-reviewer |
|
|
121
|
+
| Bug Fix | /ccp:tdd, /ccp:build-fix, /ccp:verify | tdd-workflow | tdd-guide, build-error-resolver |
|
|
122
|
+
| Refactor | /ccp:refactor-clean, /ccp:code-review, /ccp:verify | verification-loop | refactor-cleaner, code-reviewer |
|
|
123
|
+
| Research | /ccp:plan | search-first, iterative-retrieval | — |
|
|
124
|
+
| Testing | /ccp:tdd, /ccp:e2e, /ccp:test-coverage | tdd-workflow, e2e-testing | tdd-guide, e2e-runner |
|
|
125
|
+
| Review | /ccp:code-review | security-review | code-reviewer, security-reviewer |
|
|
126
|
+
| Documentation | /ccp:update-docs, /ccp:update-codemaps | — | doc-updater |
|
|
127
|
+
| Infrastructure | /ccp:plan, /ccp:verify | docker-patterns, deployment-patterns, database-migrations | architect |
|
|
128
|
+
| Design (MEDIUM-HIGH) | /ccp:plan | — | planner, architect |
|
|
129
129
|
| Design (EPIC) | — | blueprint (invoke as skill) | planner, architect |
|
|
130
130
|
|
|
131
131
|
#### By Tech Stack
|
|
@@ -172,7 +172,7 @@ Determine where this prompt sits in the development lifecycle:
|
|
|
172
172
|
Research → Plan → Implement (TDD) → Review → Verify → Commit
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
For MEDIUM+ tasks, always start with /plan. For EPIC tasks, use blueprint skill.
|
|
175
|
+
For MEDIUM+ tasks, always start with /ccp:plan. For EPIC tasks, use blueprint skill.
|
|
176
176
|
|
|
177
177
|
**Model recommendation** (include in output):
|
|
178
178
|
|
|
@@ -186,10 +186,10 @@ For MEDIUM+ tasks, always start with /plan. For EPIC tasks, use blueprint skill.
|
|
|
186
186
|
**Multi-prompt splitting** (for HIGH/EPIC scope):
|
|
187
187
|
|
|
188
188
|
For tasks that exceed a single session, split into sequential prompts:
|
|
189
|
-
- Prompt 1: Research + Plan (use search-first skill, then /plan)
|
|
190
|
-
- Prompt 2-N: Implement one phase per prompt (each ends with /verify)
|
|
191
|
-
- Final Prompt: Integration test + /code-review across all phases
|
|
192
|
-
- Use /save-session and /resume-session to preserve context between sessions
|
|
189
|
+
- Prompt 1: Research + Plan (use search-first skill, then /ccp:plan)
|
|
190
|
+
- Prompt 2-N: Implement one phase per prompt (each ends with /ccp:verify)
|
|
191
|
+
- Final Prompt: Integration test + /ccp:code-review across all phases
|
|
192
|
+
- Use /ccp:save-session and /ccp:resume-session to preserve context between sessions
|
|
193
193
|
|
|
194
194
|
---
|
|
195
195
|
|
|
@@ -215,7 +215,7 @@ If Phase 0 auto-detected the answer, state it instead of asking.
|
|
|
215
215
|
|
|
216
216
|
| Type | Component | Purpose |
|
|
217
217
|
|------|-----------|---------|
|
|
218
|
-
| Command | /plan | Plan architecture before coding |
|
|
218
|
+
| Command | /ccp:plan | Plan architecture before coding |
|
|
219
219
|
| Skill | tdd-workflow | TDD methodology guidance |
|
|
220
220
|
| Agent | code-reviewer | Post-implementation review |
|
|
221
221
|
| Model | Sonnet 4.6 | Recommended for this scope |
|
|
@@ -240,14 +240,14 @@ A compact version for experienced users. Vary by intent type:
|
|
|
240
240
|
|
|
241
241
|
| Intent | Quick Pattern |
|
|
242
242
|
|--------|--------------|
|
|
243
|
-
| New Feature | `/plan [feature]. /tdd to implement. /code-review. /verify.` |
|
|
244
|
-
| Bug Fix | `/tdd — write failing test for [bug]. Fix to green. /verify.` |
|
|
245
|
-
| Refactor | `/refactor-clean [scope]. /code-review. /verify.` |
|
|
246
|
-
| Research | `Use search-first skill for [topic]. /plan based on findings.` |
|
|
247
|
-
| Testing | `/tdd [module]. /e2e for critical flows. /test-coverage.` |
|
|
248
|
-
| Review | `/code-review. Then use security-reviewer agent.` |
|
|
249
|
-
| Docs | `/update-docs. /update-codemaps.` |
|
|
250
|
-
| EPIC | `Use blueprint skill for "[objective]". Execute phases with /verify gates.` |
|
|
243
|
+
| New Feature | `/ccp:plan [feature]. /ccp:tdd to implement. /ccp:code-review. /ccp:verify.` |
|
|
244
|
+
| Bug Fix | `/ccp:tdd — write failing test for [bug]. Fix to green. /ccp:verify.` |
|
|
245
|
+
| Refactor | `/ccp:refactor-clean [scope]. /ccp:code-review. /ccp:verify.` |
|
|
246
|
+
| Research | `Use search-first skill for [topic]. /ccp:plan based on findings.` |
|
|
247
|
+
| Testing | `/ccp:tdd [module]. /ccp:e2e for critical flows. /ccp:test-coverage.` |
|
|
248
|
+
| Review | `/ccp:code-review. Then use security-reviewer agent.` |
|
|
249
|
+
| Docs | `/ccp:update-docs. /ccp:update-codemaps.` |
|
|
250
|
+
| EPIC | `Use blueprint skill for "[objective]". Execute phases with /ccp:verify gates.` |
|
|
251
251
|
|
|
252
252
|
### Section 5: Enhancement Rationale
|
|
253
253
|
|
|
@@ -291,11 +291,11 @@ A compact version for experienced users. Vary by intent type:
|
|
|
291
291
|
- 包含:邮箱/密码登录表单、表单验证、错误提示、加载状态、响应式布局
|
|
292
292
|
|
|
293
293
|
工作流:
|
|
294
|
-
1. /plan 先规划组件结构和认证流程,参考现有页面的模式
|
|
295
|
-
2. /tdd 测试先行:编写登录表单的单元测试和认证流程的集成测试
|
|
294
|
+
1. /ccp:plan 先规划组件结构和认证流程,参考现有页面的模式
|
|
295
|
+
2. /ccp:tdd 测试先行:编写登录表单的单元测试和认证流程的集成测试
|
|
296
296
|
3. 实现登录页面和认证逻辑
|
|
297
|
-
4. /code-review 审查实现
|
|
298
|
-
5. /verify 验证所有测试通过且页面正常渲染
|
|
297
|
+
4. /ccp:code-review 审查实现
|
|
298
|
+
5. /ccp:verify 验证所有测试通过且页面正常渲染
|
|
299
299
|
|
|
300
300
|
安全要求:
|
|
301
301
|
- 密码不明文传输
|
|
@@ -339,11 +339,11 @@ Requirements:
|
|
|
339
339
|
- Follow existing API patterns in the codebase
|
|
340
340
|
|
|
341
341
|
Workflow:
|
|
342
|
-
1. /plan the endpoint structure, middleware chain, and validation logic
|
|
343
|
-
2. /tdd — write table-driven tests for success, validation failure, auth failure, not-found
|
|
342
|
+
1. /ccp:plan the endpoint structure, middleware chain, and validation logic
|
|
343
|
+
2. /ccp:tdd — write table-driven tests for success, validation failure, auth failure, not-found
|
|
344
344
|
3. Implement following existing handler patterns
|
|
345
|
-
4. /go-review
|
|
346
|
-
5. /verify — run full test suite, confirm no regressions
|
|
345
|
+
4. /ccp:go-review
|
|
346
|
+
5. /ccp:verify — run full test suite, confirm no regressions
|
|
347
347
|
|
|
348
348
|
Do not:
|
|
349
349
|
- Modify existing endpoints
|
|
@@ -376,8 +376,8 @@ The blueprint should produce phases like:
|
|
|
376
376
|
- Phase 4: Verify with integration tests, then extract next service
|
|
377
377
|
- Phase N: Decommission monolith
|
|
378
378
|
|
|
379
|
-
Each phase = 1 PR, with /verify gates between phases.
|
|
380
|
-
Use /save-session between phases. Use /resume-session to continue.
|
|
379
|
+
Each phase = 1 PR, with /ccp:verify gates between phases.
|
|
380
|
+
Use /ccp:save-session between phases. Use /ccp:resume-session to continue.
|
|
381
381
|
Use git worktrees for parallel service extraction when dependencies allow.
|
|
382
382
|
|
|
383
383
|
Recommended: Opus 4.6 for blueprint planning, Sonnet 4.6 for phase execution.
|
|
@@ -389,7 +389,7 @@ Recommended: Opus 4.6 for blueprint planning, Sonnet 4.6 for phase execution.
|
|
|
389
389
|
|
|
390
390
|
| Component | When to Reference |
|
|
391
391
|
|-----------|------------------|
|
|
392
|
-
| `/setup` | User hasn't configured their project yet |
|
|
392
|
+
| `/ccp:setup` | User hasn't configured their project yet |
|
|
393
393
|
| `.claude/skills/` | Browse installed skills directory |
|
|
394
394
|
| `search-first` | Research phase in optimized prompts |
|
|
395
395
|
| `blueprint` | EPIC-scope optimized prompts (invoke as skill, not command) |
|