planflow-ai 1.0.7 → 1.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/.claude/commands/brain.md +251 -0
- package/.claude/commands/create-contract.md +37 -211
- package/.claude/commands/create-plan.md +45 -235
- package/.claude/commands/discovery-plan.md +97 -353
- package/.claude/commands/execute-plan.md +93 -376
- package/.claude/commands/flow.md +55 -20
- package/.claude/commands/learn.md +245 -0
- package/.claude/commands/review-code.md +51 -279
- package/.claude/commands/review-pr.md +45 -475
- package/.claude/commands/setup.md +47 -907
- package/.claude/commands/write-tests.md +35 -277
- package/.claude/resources/core/_index.md +166 -0
- package/.claude/resources/core/agent-profiles.md +107 -0
- package/.claude/resources/core/audit-trail.md +180 -0
- package/.claude/resources/core/autopilot-mode.md +384 -0
- package/.claude/resources/core/brain-capture.md +424 -0
- package/.claude/{rules → resources}/core/complexity-scoring.md +30 -1
- package/.claude/resources/core/orchestration-workflows.md +178 -0
- package/.claude/{rules → resources}/core/project-ledger.md +57 -0
- package/.claude/resources/core/resource-capture.md +91 -0
- package/.claude/resources/core/tech-detection.md +82 -0
- package/.claude/resources/languages/_index.md +124 -0
- package/.claude/resources/languages/go-patterns.md +337 -0
- package/.claude/resources/languages/python-patterns.md +249 -0
- package/.claude/resources/languages/rust-patterns.md +363 -0
- package/.claude/resources/languages/typescript-patterns.md +220 -0
- package/.claude/resources/patterns/_index.md +259 -0
- package/.claude/resources/patterns/autopilot-progress-patterns.md +124 -0
- package/.claude/resources/patterns/brain-patterns.md +252 -0
- package/.claude/{rules → resources}/patterns/discovery-patterns.md +62 -6
- package/.claude/{rules → resources}/patterns/discovery-templates.md +14 -0
- package/.claude/resources/patterns/handoff-patterns.md +160 -0
- package/.claude/resources/patterns/parallel-review-patterns.md +164 -0
- package/.claude/{rules → resources}/patterns/plans-patterns.md +28 -9
- package/.claude/{rules → resources}/patterns/plans-templates.md +105 -10
- package/.claude/{rules → resources}/patterns/review-code-templates.md +23 -4
- package/.claude/{rules → resources}/patterns/review-pr-patterns.md +30 -9
- package/.claude/resources/patterns/security-scan-patterns.md +137 -0
- package/.claude/resources/skills/_index.md +190 -0
- package/.claude/resources/skills/brain-skill.md +144 -0
- package/.claude/resources/skills/create-contract-skill.md +220 -0
- package/.claude/resources/skills/create-plan-skill.md +356 -0
- package/.claude/resources/skills/discovery-skill.md +415 -0
- package/.claude/resources/skills/execute-plan-skill.md +760 -0
- package/.claude/resources/skills/learn-skill.md +140 -0
- package/.claude/resources/skills/review-code-skill.md +390 -0
- package/.claude/resources/skills/review-pr-skill.md +482 -0
- package/.claude/resources/skills/setup-skill.md +990 -0
- package/.claude/resources/skills/write-tests-skill.md +312 -0
- package/.claude/resources/tools/_index.md +110 -0
- package/.claude/{rules → resources}/tools/interactive-questions-tool.md +2 -2
- package/.claude/{rules → resources}/tools/plan-mode-tool.md +2 -2
- package/.claude/{rules → resources}/tools/reference-expansion-tool.md +36 -36
- package/README.md +3 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +27 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/sessions.d.ts +34 -0
- package/dist/cli/commands/sessions.d.ts.map +1 -0
- package/dist/cli/commands/sessions.js +128 -0
- package/dist/cli/commands/sessions.js.map +1 -0
- package/dist/cli/commands/update.d.ts +17 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +84 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +31 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +213 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/handlers/claude.d.ts +2 -2
- package/dist/cli/handlers/claude.d.ts.map +1 -1
- package/dist/cli/handlers/claude.js +116 -4
- package/dist/cli/handlers/claude.js.map +1 -1
- package/dist/cli/handlers/clawhub.d.ts +9 -0
- package/dist/cli/handlers/clawhub.d.ts.map +1 -0
- package/dist/cli/handlers/clawhub.js +67 -0
- package/dist/cli/handlers/clawhub.js.map +1 -0
- package/dist/cli/handlers/codex.d.ts.map +1 -1
- package/dist/cli/handlers/codex.js +11 -0
- package/dist/cli/handlers/codex.js.map +1 -1
- package/dist/cli/handlers/cursor.d.ts +1 -1
- package/dist/cli/handlers/cursor.d.ts.map +1 -1
- package/dist/cli/handlers/cursor.js +28 -2
- package/dist/cli/handlers/cursor.js.map +1 -1
- package/dist/cli/handlers/shared.d.ts +19 -0
- package/dist/cli/handlers/shared.d.ts.map +1 -1
- package/dist/cli/handlers/shared.js +1343 -4
- package/dist/cli/handlers/shared.js.map +1 -1
- package/dist/cli/index.js +87 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/types.d.ts +3 -1
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/utils/detect-stack.d.ts +39 -0
- package/dist/cli/utils/detect-stack.d.ts.map +1 -0
- package/dist/cli/utils/detect-stack.js +239 -0
- package/dist/cli/utils/detect-stack.js.map +1 -0
- package/dist/cli/utils/files.d.ts +35 -0
- package/dist/cli/utils/files.d.ts.map +1 -1
- package/dist/cli/utils/files.js +104 -2
- package/dist/cli/utils/files.js.map +1 -1
- package/dist/cli/utils/hooks.d.ts +42 -0
- package/dist/cli/utils/hooks.d.ts.map +1 -0
- package/dist/cli/utils/hooks.js +98 -0
- package/dist/cli/utils/hooks.js.map +1 -0
- package/dist/cli/utils/ledger.d.ts +38 -0
- package/dist/cli/utils/ledger.d.ts.map +1 -0
- package/dist/cli/utils/ledger.js +148 -0
- package/dist/cli/utils/ledger.js.map +1 -0
- package/dist/cli/utils/phase-hooks.d.ts +53 -0
- package/dist/cli/utils/phase-hooks.d.ts.map +1 -0
- package/dist/cli/utils/phase-hooks.js +122 -0
- package/dist/cli/utils/phase-hooks.js.map +1 -0
- package/dist/cli/utils/platform-hooks.d.ts +31 -0
- package/dist/cli/utils/platform-hooks.d.ts.map +1 -0
- package/dist/cli/utils/platform-hooks.js +101 -0
- package/dist/cli/utils/platform-hooks.js.map +1 -0
- package/dist/cli/utils/prompts.d.ts +5 -0
- package/dist/cli/utils/prompts.d.ts.map +1 -1
- package/dist/cli/utils/prompts.js +42 -6
- package/dist/cli/utils/prompts.js.map +1 -1
- package/dist/cli/utils/sessions.d.ts +82 -0
- package/dist/cli/utils/sessions.d.ts.map +1 -0
- package/dist/cli/utils/sessions.js +203 -0
- package/dist/cli/utils/sessions.js.map +1 -0
- package/dist/test/setup.js +1 -1
- package/dist/test/setup.js.map +1 -1
- package/package.json +5 -2
- package/rules/core/_index.mdc +57 -5
- package/rules/core/agent-profiles.mdc +111 -0
- package/rules/core/audit-trail.mdc +114 -0
- package/rules/core/autopilot-mode.mdc +255 -91
- package/rules/core/brain-capture.mdc +112 -0
- package/rules/core/orchestration-workflows.mdc +139 -0
- package/rules/core/project-ledger.mdc +2 -2
- package/rules/core/resource-capture.mdc +90 -0
- package/rules/patterns/_index.mdc +70 -0
- package/rules/patterns/autopilot-progress-patterns.mdc +124 -0
- package/rules/patterns/brain-patterns.mdc +79 -0
- package/rules/patterns/discovery-patterns.mdc +152 -6
- package/rules/patterns/discovery-templates.mdc +2 -0
- package/rules/patterns/handoff-patterns.mdc +164 -0
- package/rules/patterns/parallel-review-patterns.mdc +168 -0
- package/rules/patterns/plans-patterns.mdc +28 -9
- package/rules/patterns/plans-templates.mdc +59 -0
- package/rules/patterns/review-code-templates.mdc +2 -0
- package/rules/patterns/security-scan-patterns.mdc +141 -0
- package/rules/skills/_index.mdc +12 -1
- package/rules/skills/brain-skill.mdc +71 -0
- package/rules/skills/create-contract-skill.mdc +15 -30
- package/rules/skills/create-plan-skill.mdc +115 -30
- package/rules/skills/discovery-skill.mdc +154 -34
- package/rules/skills/execute-plan-skill.mdc +264 -3
- package/rules/skills/learn-skill.mdc +92 -0
- package/rules/skills/review-code-skill.mdc +123 -39
- package/rules/skills/review-pr-skill.mdc +82 -93
- package/rules/skills/setup-skill.mdc +91 -0
- package/rules/skills/write-tests-skill.mdc +18 -0
- package/scripts/hooks/pre-compact.cjs +85 -0
- package/scripts/hooks/session-end.cjs +284 -0
- package/scripts/hooks/session-start.cjs +145 -0
- package/skills/plan-flow/SKILL.md +16 -2
- package/skills/plan-flow/brain/SKILL.md +64 -0
- package/skills/plan-flow/create-contract/SKILL.md +11 -0
- package/skills/plan-flow/create-plan/SKILL.md +12 -0
- package/skills/plan-flow/discovery/SKILL.md +12 -0
- package/skills/plan-flow/execute-plan/SKILL.md +10 -0
- package/skills/plan-flow/learn/SKILL.md +49 -0
- package/skills/plan-flow/review-code/SKILL.md +12 -0
- package/skills/plan-flow/review-pr/SKILL.md +12 -0
- package/skills/plan-flow/setup/SKILL.md +10 -0
- package/skills/plan-flow/write-tests/SKILL.md +10 -0
- package/templates/shared/AGENTS.md.template +11 -0
- package/templates/shared/CLAUDE.md.template +24 -5
- package/templates/shared/hooks.json.example +7 -0
- package/templates/shared/session-hooks-instructions.md +29 -0
- package/.claude/rules/core/autopilot-mode.md +0 -188
- package/.claude/rules/languages/python-patterns.md +0 -6
- package/.claude/rules/languages/typescript-patterns.md +0 -7
- /package/.claude/{rules → resources}/patterns/contract-patterns.md +0 -0
- /package/.claude/{rules → resources}/patterns/jest-patterns.md +0 -0
- /package/.claude/{rules → resources}/patterns/pytest-patterns.md +0 -0
- /package/.claude/{rules → resources}/tools/auth-pr-tool.md +0 -0
- /package/.claude/{rules → resources}/tools/jest-testing-tool.md +0 -0
- /package/.claude/{rules → resources}/tools/pytest-testing-tool.md +0 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Manual brain entry - capture meeting notes, ideas, brainstorms, and insights into the project brain
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Brain: Manual Knowledge Capture
|
|
6
|
+
|
|
7
|
+
## Command Description
|
|
8
|
+
|
|
9
|
+
This command allows manual brain entries for capturing meeting notes, brainstorms, ad-hoc ideas, and insights that don't come from automatic skill execution. Supports two modes: free-text (default) and guided prompts.
|
|
10
|
+
|
|
11
|
+
**Output**: Brain entries in `flow/brain/` with `[[wiki-links]]` for Obsidian compatibility.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## Help
|
|
17
|
+
|
|
18
|
+
**If the user invokes this command with `-help`, display only this section and stop:**
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
/brain - Manual Brain Entry
|
|
22
|
+
|
|
23
|
+
DESCRIPTION:
|
|
24
|
+
Capture meeting notes, brainstorms, ideas, and insights into the
|
|
25
|
+
project brain. Creates Obsidian-compatible markdown with [[wiki-links]].
|
|
26
|
+
|
|
27
|
+
USAGE:
|
|
28
|
+
/brain <free text> Free-text mode (default)
|
|
29
|
+
/brain -guided Guided mode with structured questions
|
|
30
|
+
/brain -help Show this help
|
|
31
|
+
|
|
32
|
+
ARGUMENTS:
|
|
33
|
+
free text Unstructured text to parse and categorize
|
|
34
|
+
-guided Triggers structured question mode
|
|
35
|
+
|
|
36
|
+
EXAMPLES:
|
|
37
|
+
/brain Had a call with the team about auth flow. Decision: use JWT with refresh tokens.
|
|
38
|
+
/brain Discovered that the API rate limits at 100 req/min. Need to add throttling.
|
|
39
|
+
/brain -guided
|
|
40
|
+
|
|
41
|
+
OUTPUT:
|
|
42
|
+
- Writes to appropriate flow/brain/ subdirectory
|
|
43
|
+
- Creates [[wiki-links]] to related entries
|
|
44
|
+
- Updates flow/brain/index.md if needed
|
|
45
|
+
|
|
46
|
+
MODES:
|
|
47
|
+
Free-text: Parses input, extracts entities, categorizes, writes entry
|
|
48
|
+
Guided: Asks structured questions about work, insights, meetings, decisions
|
|
49
|
+
|
|
50
|
+
BRAIN STRUCTURE:
|
|
51
|
+
flow/brain/
|
|
52
|
+
├── index.md # Brain index (always loaded at session start)
|
|
53
|
+
├── features/ # Feature history and context
|
|
54
|
+
├── errors/ # Reusable error patterns
|
|
55
|
+
├── decisions/ # Decision records
|
|
56
|
+
└── sessions/ # Daily activity logs
|
|
57
|
+
|
|
58
|
+
RELATED COMMANDS:
|
|
59
|
+
/setup Creates brain directory structure
|
|
60
|
+
/discovery-plan Auto-captures to brain after completion
|
|
61
|
+
/execute-plan Auto-captures to brain after completion
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
> **AGENT_PROFILE: write-restricted**
|
|
67
|
+
> See `.claude/resources/core/agent-profiles.md` for tool access rules.
|
|
68
|
+
|
|
69
|
+
## Critical Rules
|
|
70
|
+
|
|
71
|
+
| Rule | Description |
|
|
72
|
+
| ------------------------ | -------------------------------------------------------- |
|
|
73
|
+
| **Brain Only** | ONLY write to `flow/brain/` - no source code, no config |
|
|
74
|
+
| **Wiki-Links** | All cross-references use `[[kebab-case-name]]` format |
|
|
75
|
+
| **Index Caps** | Max 5 errors, 3 decisions, 3 cross-project in index |
|
|
76
|
+
| **No Code** | Brain is for knowledge capture, never write source code |
|
|
77
|
+
| **Complete and Stop** | After writing entry, STOP and wait for user |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Instructions
|
|
82
|
+
|
|
83
|
+
### Step 1: Validate Inputs
|
|
84
|
+
|
|
85
|
+
| Input | Required | Description |
|
|
86
|
+
| ----------- | -------- | ---------------------------------------------- |
|
|
87
|
+
| `content` | Yes | Free-text or triggered by `-guided` flag |
|
|
88
|
+
| `-guided` | Optional | Triggers structured question mode |
|
|
89
|
+
|
|
90
|
+
If no content and no `-guided` flag, ask:
|
|
91
|
+
|
|
92
|
+
```markdown
|
|
93
|
+
What would you like to capture? You can:
|
|
94
|
+
1. Type free text and I'll categorize it automatically
|
|
95
|
+
2. Use `/brain -guided` for structured prompts
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
### Step 2: Ensure Brain Directory Exists
|
|
101
|
+
|
|
102
|
+
Check if `flow/brain/` exists. If not, create:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
mkdir -p flow/brain/features flow/brain/errors flow/brain/decisions flow/brain/sessions
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Check if `flow/brain/index.md` exists. If not, create initial index:
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
# Project Brain
|
|
112
|
+
|
|
113
|
+
## Active Features
|
|
114
|
+
_No features tracked yet._
|
|
115
|
+
|
|
116
|
+
## Recent Errors
|
|
117
|
+
_No errors captured yet._
|
|
118
|
+
|
|
119
|
+
## Recent Decisions
|
|
120
|
+
_No decisions recorded yet._
|
|
121
|
+
|
|
122
|
+
## Cross-Project Patterns
|
|
123
|
+
_No cross-project patterns yet._
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### Step 3: Invoke Brain Skill
|
|
129
|
+
|
|
130
|
+
The skill will handle:
|
|
131
|
+
|
|
132
|
+
**Free-text mode**:
|
|
133
|
+
1. Parse input text
|
|
134
|
+
2. Extract entities (features, technologies, people, errors, decisions)
|
|
135
|
+
3. Categorize into appropriate brain subdirectory
|
|
136
|
+
4. Create/update brain files with `[[wiki-links]]`
|
|
137
|
+
5. Update `flow/brain/index.md` if needed
|
|
138
|
+
|
|
139
|
+
**Guided mode** (`-guided`):
|
|
140
|
+
1. Ask structured questions via `AskUserQuestion`
|
|
141
|
+
2. Gather responses and follow-up text
|
|
142
|
+
3. Generate properly formatted brain files
|
|
143
|
+
4. Link everything with `[[wiki-links]]`
|
|
144
|
+
5. Update `flow/brain/index.md`
|
|
145
|
+
|
|
146
|
+
See: `.claude/resources/skills/brain-skill.md`
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### Step 4: Present Results
|
|
151
|
+
|
|
152
|
+
After the skill completes:
|
|
153
|
+
|
|
154
|
+
**Free-text result**:
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
Brain entry captured!
|
|
158
|
+
|
|
159
|
+
**Written to**: flow/brain/[subdirectory]/[file].md
|
|
160
|
+
**Links created**: [[feature-1]], [[error-name]]
|
|
161
|
+
**Index updated**: Yes/No
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Guided result**:
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
Brain entry captured!
|
|
168
|
+
|
|
169
|
+
**Topics covered**:
|
|
170
|
+
- Feature: [[feature-name]] - summary
|
|
171
|
+
- Decision: [[decision-name]] - choice
|
|
172
|
+
- Meeting notes added to [[YYYY-MM-DD]]
|
|
173
|
+
|
|
174
|
+
**Index updated**: Yes
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Flow Diagram
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
+------------------------------------------+
|
|
183
|
+
| /brain COMMAND |
|
|
184
|
+
+------------------------------------------+
|
|
185
|
+
|
|
|
186
|
+
v
|
|
187
|
+
+------------------------------------------+
|
|
188
|
+
| Step 1: Validate Inputs |
|
|
189
|
+
| - Check for content or -guided flag |
|
|
190
|
+
+------------------------------------------+
|
|
191
|
+
|
|
|
192
|
+
v
|
|
193
|
+
+------------------------------------------+
|
|
194
|
+
| Step 2: Ensure Brain Directory |
|
|
195
|
+
| - Create flow/brain/ if needed |
|
|
196
|
+
| - Create index.md if needed |
|
|
197
|
+
+------------------------------------------+
|
|
198
|
+
|
|
|
199
|
+
v
|
|
200
|
+
+------------------------------------------+
|
|
201
|
+
| Step 3: Invoke Brain Skill |
|
|
202
|
+
| - Free-text: parse, extract, categorize |
|
|
203
|
+
| - Guided: structured questions |
|
|
204
|
+
| - See brain-skill.md |
|
|
205
|
+
+------------------------------------------+
|
|
206
|
+
|
|
|
207
|
+
v
|
|
208
|
+
+------------------------------------------+
|
|
209
|
+
| Step 4: Present Results |
|
|
210
|
+
| - Show files written |
|
|
211
|
+
| - Show links created |
|
|
212
|
+
| - Show index update status |
|
|
213
|
+
+------------------------------------------+
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Context Optimization
|
|
219
|
+
|
|
220
|
+
### Recommended Loading Order
|
|
221
|
+
|
|
222
|
+
1. **Always load first**: This command file (`commands/brain.md`)
|
|
223
|
+
2. **Load indexes**: Load `_index.md` files for relevant folders
|
|
224
|
+
3. **Expand on-demand**: Use reference codes to load specific sections when needed
|
|
225
|
+
|
|
226
|
+
### Reference Codes for Brain
|
|
227
|
+
|
|
228
|
+
| Code | Description | When to Expand |
|
|
229
|
+
|------|-------------|----------------|
|
|
230
|
+
| SKL-BR-1 | Brain skill restrictions | Understanding allowed actions |
|
|
231
|
+
| SKL-BR-2 | Brain skill workflow | Processing entries |
|
|
232
|
+
| SKL-BR-3 | Output format and validation | Formatting output |
|
|
233
|
+
| PTN-BR-1 | Directory structure and naming | Creating brain files |
|
|
234
|
+
| PTN-BR-2 | Wiki-link patterns | Creating cross-references |
|
|
235
|
+
| PTN-BR-3 | Feature status lifecycle | Updating feature entries |
|
|
236
|
+
| COR-BR-1 | Session start behavior | Understanding brain loading |
|
|
237
|
+
| COR-BR-2 | File templates | Creating new brain files |
|
|
238
|
+
| COR-BR-3 | Index management caps | Enforcing index limits |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Related Resources
|
|
243
|
+
|
|
244
|
+
| Resource | Purpose |
|
|
245
|
+
| --------------------------- | --------------------------------- |
|
|
246
|
+
| `resources/skills/_index.md` | Index of skills with reference codes |
|
|
247
|
+
| `resources/patterns/_index.md` | Index of patterns with reference codes |
|
|
248
|
+
| `resources/core/_index.md` | Index of core rules with reference codes |
|
|
249
|
+
| `brain-skill.md` | Skill that processes brain entries |
|
|
250
|
+
| `brain-patterns.md` | File naming and link conventions |
|
|
251
|
+
| `brain-capture.md` | Processing rules and templates |
|
|
@@ -55,6 +55,13 @@ RELATED COMMANDS:
|
|
|
55
55
|
|
|
56
56
|
---
|
|
57
57
|
|
|
58
|
+
> **MODE: Research**
|
|
59
|
+
> Explore before concluding. Read 3x more than you write. Prefer Read/Grep/Glob/WebSearch tools.
|
|
60
|
+
> Ask clarifying questions when uncertain. Don't jump to implementation.
|
|
61
|
+
|
|
62
|
+
> **AGENT_PROFILE: read-only**
|
|
63
|
+
> See `.claude/resources/core/agent-profiles.md` for tool access rules.
|
|
64
|
+
|
|
58
65
|
## Critical Rules
|
|
59
66
|
|
|
60
67
|
| Rule | Description |
|
|
@@ -111,7 +118,7 @@ The skill will:
|
|
|
111
118
|
3. Ask clarifying questions via Interactive Questions Tool
|
|
112
119
|
4. Generate contract document
|
|
113
120
|
|
|
114
|
-
See: `.claude/
|
|
121
|
+
See: `.claude/resources/skills/create-contract-skill.md`
|
|
115
122
|
|
|
116
123
|
---
|
|
117
124
|
|
|
@@ -204,9 +211,9 @@ This command uses hierarchical context loading to reduce context consumption. In
|
|
|
204
211
|
|
|
205
212
|
| Index | When to Load |
|
|
206
213
|
|-------|--------------|
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
214
|
+
| `resources/patterns/_index.md` | To find contract patterns |
|
|
215
|
+
| `resources/skills/_index.md` | To understand skill workflow |
|
|
216
|
+
| `resources/tools/_index.md` | When using interactive questions |
|
|
210
217
|
|
|
211
218
|
### Reference Codes for Contract Creation
|
|
212
219
|
|
|
@@ -222,7 +229,7 @@ This command uses hierarchical context loading to reduce context consumption. In
|
|
|
222
229
|
|
|
223
230
|
When executing this command:
|
|
224
231
|
|
|
225
|
-
1. **Start with indexes**: Read `
|
|
232
|
+
1. **Start with indexes**: Read `resources/patterns/_index.md` and `resources/skills/_index.md`
|
|
226
233
|
2. **Identify needed codes**: Based on current step, identify which codes are relevant
|
|
227
234
|
3. **Expand as needed**: Use the Read tool with specific line ranges from the index
|
|
228
235
|
4. **Don't expand everything**: Only load content required for the current step
|
|
@@ -233,9 +240,9 @@ When executing this command:
|
|
|
233
240
|
|
|
234
241
|
| Resource | Purpose |
|
|
235
242
|
| ------------------------------ | -------------------------------------- |
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
243
|
+
| `resources/skills/_index.md` | Index of skills with reference codes |
|
|
244
|
+
| `resources/patterns/_index.md` | Index of patterns with reference codes |
|
|
245
|
+
| `resources/tools/_index.md` | Index of tools with reference codes |
|
|
239
246
|
| `create-contract-skill.md` | Skill that creates the contract |
|
|
240
247
|
| `contract-patterns.md` | Rules and patterns for contracts |
|
|
241
248
|
| `interactive-questions-tool.md` | Interactive Questions UI workflow |
|
|
@@ -244,225 +251,44 @@ When executing this command:
|
|
|
244
251
|
|
|
245
252
|
---
|
|
246
253
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
## Restrictions - CONTRACT CREATION ONLY
|
|
251
|
-
|
|
252
|
-
This skill is **strictly for creating contract documents**. The process:
|
|
253
|
-
|
|
254
|
-
1. **Fetches** information from the source URL
|
|
255
|
-
2. **Analyzes** the API structure and schemas
|
|
256
|
-
3. **Asks** clarifying questions via Interactive Questions Tool
|
|
257
|
-
4. **Generates** a contract markdown file
|
|
258
|
-
|
|
259
|
-
**No code, no implementation, no source file modifications.**
|
|
260
|
-
|
|
261
|
-
### NEVER Do These Actions
|
|
262
|
-
|
|
263
|
-
| Forbidden Action | Reason |
|
|
264
|
-
| -------------------------------------- | ----------------------------------- |
|
|
265
|
-
| Create/edit source code files | Contract creation only |
|
|
266
|
-
| Write implementation code | Contracts describe, not implement |
|
|
267
|
-
| Modify configuration files | No codebase changes |
|
|
268
|
-
| Run build or test commands | No execution commands |
|
|
269
|
-
| Create files outside `flow/contracts/` | Only write contract documents |
|
|
270
|
-
|
|
271
|
-
### Allowed Actions
|
|
272
|
-
|
|
273
|
-
| Allowed Action | Purpose |
|
|
274
|
-
| -------------------------------------- | ------------------------------------ |
|
|
275
|
-
| Use Web Search tool | Fetch documentation from URLs |
|
|
276
|
-
| Read repository files | Analyze API structure |
|
|
277
|
-
| Use Interactive Questions Tool | Gather requirements from user |
|
|
278
|
-
| Write to `flow/contracts/` | Save contract document |
|
|
279
|
-
| Read project rule files | Understand patterns to follow |
|
|
280
|
-
|
|
281
|
-
> **Important**: The ONLY writable location is `flow/contracts/`. No source code or other files should be modified.
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## Inputs
|
|
286
|
-
|
|
287
|
-
| Input | Required | Description |
|
|
288
|
-
| ------------- | -------- | ---------------------------------------------------- |
|
|
289
|
-
| `source_url` | Yes | Documentation URL or repository URL |
|
|
290
|
-
| `description` | Yes | What the user wants to integrate on the frontend |
|
|
291
|
-
|
|
292
|
-
---
|
|
293
|
-
|
|
294
|
-
## Workflow
|
|
254
|
+
## Compaction Suggestion
|
|
295
255
|
|
|
296
|
-
|
|
256
|
+
After contract creation completes, suggest context cleanup if the contract was complex (> 5 endpoints):
|
|
297
257
|
|
|
298
|
-
|
|
258
|
+
> Contract created. Consider running `/compact` to free context before the next task.
|
|
299
259
|
|
|
300
|
-
|
|
301
|
-
| ---------------- | ---------------------------------------------- |
|
|
302
|
-
| Documentation | Contains `/docs`, `/api`, swagger, openapi |
|
|
303
|
-
| Repository | Contains github.com, gitlab.com, bitbucket.org |
|
|
304
|
-
| OpenAPI Spec | Ends with `.json`, `.yaml`, `/swagger` |
|
|
260
|
+
Skip if autopilot is ON.
|
|
305
261
|
|
|
306
262
|
---
|
|
307
263
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
If the source is a documentation URL:
|
|
311
|
-
|
|
312
|
-
1. Use Web Search tool to fetch documentation content
|
|
313
|
-
2. Extract key information:
|
|
314
|
-
- API endpoints
|
|
315
|
-
- Request/response schemas
|
|
316
|
-
- Authentication methods
|
|
317
|
-
- Error formats
|
|
318
|
-
- Rate limits
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
### Step 2B: Handle Repository URL
|
|
323
|
-
|
|
324
|
-
If the source is a repository URL:
|
|
325
|
-
|
|
326
|
-
1. Analyze repository structure
|
|
327
|
-
2. Identify relevant files:
|
|
328
|
-
- API route definitions
|
|
329
|
-
- Type definitions
|
|
330
|
-
- Schema files
|
|
331
|
-
- README/docs
|
|
332
|
-
3. Read and extract key information
|
|
333
|
-
|
|
334
|
-
---
|
|
335
|
-
|
|
336
|
-
### Step 3: Ask Clarifying Questions
|
|
337
|
-
|
|
338
|
-
**Use Interactive Questions Tool** to gather requirements.
|
|
264
|
+
## Brain Capture
|
|
339
265
|
|
|
340
|
-
|
|
266
|
+
After contract creation completes, append a brain-capture block. See `.claude/resources/core/brain-capture.md` for processing rules.
|
|
341
267
|
|
|
342
|
-
|
|
343
|
-
2. Call `Ask the user directly in conversation` tool for each question about:
|
|
344
|
-
- **Scope**: Which specific endpoints/features are needed?
|
|
345
|
-
- **Authentication**: How will the FE authenticate?
|
|
346
|
-
- **Error Handling**: How should the FE handle errors?
|
|
347
|
-
- **Caching**: Any caching requirements?
|
|
348
|
-
3. Wait for all responses
|
|
349
|
-
4. Call `SwitchMode` tool to return to Agent mode
|
|
350
|
-
5. Document answers for use in the contract document
|
|
268
|
+
**Capture the following**:
|
|
351
269
|
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
### Step 4: Generate Contract Document
|
|
355
|
-
|
|
356
|
-
Create the contract with all gathered information:
|
|
357
|
-
|
|
358
|
-
**Location**: `flow/contracts/<service_name>_contract.md`
|
|
359
|
-
|
|
360
|
-
**Required Sections**:
|
|
361
|
-
|
|
362
|
-
1. Overview
|
|
363
|
-
2. Authentication
|
|
364
|
-
3. Endpoints (with request/response schemas)
|
|
365
|
-
4. Error Handling
|
|
366
|
-
5. Integration Notes
|
|
367
|
-
6. Usage Examples
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
## Output Format
|
|
372
|
-
|
|
373
|
-
### Contract Template
|
|
374
|
-
|
|
375
|
-
```markdown
|
|
376
|
-
# Integration Contract: [Service Name]
|
|
377
|
-
|
|
378
|
-
## Overview
|
|
379
|
-
|
|
380
|
-
**Source**: [URL]
|
|
381
|
-
**Description**: [What this integration provides]
|
|
382
|
-
**Version**: [API version if applicable]
|
|
383
|
-
|
|
384
|
-
## Authentication
|
|
385
|
-
|
|
386
|
-
**Method**: [Bearer token, API key, OAuth, etc.]
|
|
387
|
-
**Header**: [Authorization header format]
|
|
388
|
-
**Token Source**: [Where FE gets the token]
|
|
389
|
-
|
|
390
|
-
## Endpoints
|
|
391
|
-
|
|
392
|
-
### [Endpoint Name]
|
|
393
|
-
|
|
394
|
-
**Method**: [GET/POST/PUT/DELETE]
|
|
395
|
-
**URL**: [Endpoint URL]
|
|
396
|
-
**Description**: [What this endpoint does]
|
|
397
|
-
|
|
398
|
-
**Request**:
|
|
399
|
-
```typescript
|
|
400
|
-
interface RequestBody {
|
|
401
|
-
// Request schema
|
|
402
|
-
}
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
**Response**:
|
|
406
|
-
```typescript
|
|
407
|
-
interface Response {
|
|
408
|
-
// Response schema
|
|
409
|
-
}
|
|
410
270
|
```
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
271
|
+
<!-- brain-capture
|
|
272
|
+
skill: create-contract
|
|
273
|
+
feature: [service name]
|
|
274
|
+
status: completed
|
|
275
|
+
data:
|
|
276
|
+
service_name: [API/service name]
|
|
277
|
+
endpoints_documented: [count]
|
|
278
|
+
auth_type: [detected auth type]
|
|
279
|
+
contract_doc: [path to contract document]
|
|
280
|
+
-->
|
|
417
281
|
```
|
|
418
282
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
| Status Code | Meaning | FE Action |
|
|
422
|
-
| ----------- | -------------------- | ------------------------- |
|
|
423
|
-
| 400 | Bad Request | Show validation error |
|
|
424
|
-
| 401 | Unauthorized | Redirect to login |
|
|
425
|
-
| 404 | Not Found | Show not found message |
|
|
426
|
-
| 500 | Server Error | Show generic error |
|
|
427
|
-
|
|
428
|
-
## Integration Notes
|
|
429
|
-
|
|
430
|
-
### Rate Limits
|
|
431
|
-
[Any rate limiting information]
|
|
432
|
-
|
|
433
|
-
### Caching
|
|
434
|
-
[Caching recommendations]
|
|
435
|
-
|
|
436
|
-
### Pagination
|
|
437
|
-
[Pagination format if applicable]
|
|
438
|
-
|
|
439
|
-
## Usage Examples
|
|
440
|
-
|
|
441
|
-
### [Use Case 1]
|
|
442
|
-
[Code example or description]
|
|
443
|
-
```
|
|
283
|
+
Update `flow/brain/features/[service-name].md` with contract context and update `flow/brain/index.md`.
|
|
444
284
|
|
|
445
285
|
---
|
|
446
286
|
|
|
447
|
-
##
|
|
287
|
+
## Resource Capture
|
|
448
288
|
|
|
449
|
-
|
|
289
|
+
During this skill's execution, watch for valuable reference materials worth preserving. See `.claude/resources/core/resource-capture.md` for capture rules, file format, and naming conventions.
|
|
450
290
|
|
|
451
|
-
|
|
452
|
-
- [ ] File uses naming: `<service_name>_contract.md`
|
|
453
|
-
- [ ] All requested endpoints are documented
|
|
454
|
-
- [ ] Authentication method is clear
|
|
455
|
-
- [ ] Request/response schemas are defined
|
|
456
|
-
- [ ] Error handling is documented
|
|
457
|
-
- [ ] **NO implementation code is included**
|
|
458
|
-
- [ ] **NO source files were created or modified**
|
|
459
|
-
|
|
460
|
-
---
|
|
291
|
+
At natural break points, if you encounter information that could be useful for future development (API specs, architecture notes, config references, domain knowledge, etc.), ask the user: "I found something that could be useful for future reference: _{brief description}_. Should I save it to `flow/resources/`?"
|
|
461
292
|
|
|
462
|
-
|
|
293
|
+
Only save if the user approves. Do not re-ask if declined.
|
|
463
294
|
|
|
464
|
-
| File | Purpose |
|
|
465
|
-
| -------------------------------------------------- | --------------------------------- |
|
|
466
|
-
| `.claude/rules/patterns/contract-patterns.md` | Rules and patterns for contracts |
|
|
467
|
-
| `.claude/rules/tools/interactive-questions-tool.md` | Interactive Questions workflow |
|
|
468
|
-
| `flow/contracts/` | Output folder for contracts |
|