Skip to content

Commit c799173

Browse files
authored
align context and skills consistency (#192) (#198)
* fix(context): migrate delegation references to split workflow files * chore(ci): add markdown link validation with regex skip rules * fix(context): migrate index references to navigation * fix(agent): allow limited bash for task status updates * refactor(skills): migrate to .opencode/skills and normalize skill files * fix(agent): align subagent permissions and workflow structure * docs: reconcile workflow examples and design iteration references * feat(skill): enforce schema checks in task validate command * fix(install): improve colored output and skills collision grouping
1 parent f1dd4b7 commit c799173

File tree

61 files changed

+661
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+661
-268
lines changed

.github/workflows/validate-registry.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,30 @@ jobs:
195195
echo "See [CONTRIBUTING.md](docs/contributing/CONTRIBUTING.md) for details" >> $GITHUB_STEP_SUMMARY
196196
exit 1
197197
fi
198+
199+
- name: Validate markdown context links
200+
if: github.event.inputs.skip_validation != 'true'
201+
id: validate_context_links
202+
run: |
203+
echo "## 🔗 Context Link Validation" >> $GITHUB_STEP_SUMMARY
204+
echo "" >> $GITHUB_STEP_SUMMARY
205+
206+
if bun run scripts/validation/validate-markdown-links.ts > /tmp/context-link-validation.txt 2>&1; then
207+
echo "context_links=passed" >> $GITHUB_OUTPUT
208+
echo "✅ Context markdown links are valid!" >> $GITHUB_STEP_SUMMARY
209+
echo "" >> $GITHUB_STEP_SUMMARY
210+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
211+
cat /tmp/context-link-validation.txt >> $GITHUB_STEP_SUMMARY
212+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
213+
else
214+
echo "context_links=failed" >> $GITHUB_OUTPUT
215+
echo "❌ Context markdown link validation failed!" >> $GITHUB_STEP_SUMMARY
216+
echo "" >> $GITHUB_STEP_SUMMARY
217+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
218+
cat /tmp/context-link-validation.txt >> $GITHUB_STEP_SUMMARY
219+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
220+
exit 1
221+
fi
198222
199223
- name: Validate registry
200224
if: github.event.inputs.skip_validation != 'true'
@@ -308,12 +332,14 @@ jobs:
308332
echo "" >> $GITHUB_STEP_SUMMARY
309333
310334
PROMPT_VALID="${{ steps.validate_prompts.outputs.prompt_validation }}"
335+
CONTEXT_LINKS_VALID="${{ steps.validate_context_links.outputs.context_links }}"
311336
REGISTRY_VALID="${{ steps.validate.outputs.validation }}"
312-
313-
if [ "$PROMPT_VALID" = "passed" ] && [ "$REGISTRY_VALID" = "passed" ]; then
337+
338+
if [ "$PROMPT_VALID" = "passed" ] && [ "$CONTEXT_LINKS_VALID" = "passed" ] && [ "$REGISTRY_VALID" = "passed" ]; then
314339
echo "### ✅ All Validations Passed" >> $GITHUB_STEP_SUMMARY
315340
echo "" >> $GITHUB_STEP_SUMMARY
316341
echo "- ✅ Prompt library structure is valid" >> $GITHUB_STEP_SUMMARY
342+
echo "- ✅ Context markdown links are valid" >> $GITHUB_STEP_SUMMARY
317343
echo "- ✅ Registry paths are valid" >> $GITHUB_STEP_SUMMARY
318344
echo "" >> $GITHUB_STEP_SUMMARY
319345
echo "This PR is ready for review!" >> $GITHUB_STEP_SUMMARY
@@ -326,7 +352,13 @@ jobs:
326352
else
327353
echo "- ✅ Prompt library validation passed" >> $GITHUB_STEP_SUMMARY
328354
fi
329-
355+
356+
if [ "$CONTEXT_LINKS_VALID" != "passed" ]; then
357+
echo "- ❌ Context markdown link validation failed" >> $GITHUB_STEP_SUMMARY
358+
else
359+
echo "- ✅ Context markdown link validation passed" >> $GITHUB_STEP_SUMMARY
360+
fi
361+
330362
if [ "$REGISTRY_VALID" != "passed" ]; then
331363
echo "- ❌ Registry validation failed" >> $GITHUB_STEP_SUMMARY
332364
else
@@ -339,7 +371,7 @@ jobs:
339371
340372
- name: Fail if validation failed
341373
if: |
342-
(steps.validate_prompts.outputs.prompt_validation == 'failed' || steps.validate.outputs.validation == 'failed') &&
374+
(steps.validate_prompts.outputs.prompt_validation == 'failed' || steps.validate_context_links.outputs.context_links == 'failed' || steps.validate.outputs.validation == 'failed') &&
343375
github.event.inputs.skip_validation != 'true'
344376
run: |
345377
echo "❌ Validation failed - blocking PR merge"

.opencode/agent/core/openagent.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ WHY THIS MATTERS:
4242
- Docs without standards/documentation.md → Wrong tone, missing sections, poor structure
4343
- Tests without standards/test-coverage.md → Wrong framework, incomplete coverage
4444
- Review without workflows/code-review.md → Missed quality checks, incomplete analysis
45-
- Delegation without workflows/task-delegation.md → Wrong context passed to subagents
45+
- Delegation without workflows/task-delegation-basics.md → Wrong context passed to subagents
4646

4747
Required context files:
4848
- Code tasks → .opencode/context/core/standards/code-quality.md
4949
- Docs tasks → .opencode/context/core/standards/documentation.md
5050
- Tests tasks → .opencode/context/core/standards/test-coverage.md
5151
- Review tasks → .opencode/context/core/workflows/code-review.md
52-
- Delegation → .opencode/context/core/workflows/task-delegation.md
52+
- Delegation → .opencode/context/core/workflows/task-delegation-basics.md
5353

5454
CONSEQUENCE OF SKIPPING: Work that doesn't match project standards = wasted effort + rework
5555
</critical_context_requirement>
@@ -248,7 +248,7 @@ task(
248248
- docs (write/edit docs) → Read .opencode/context/core/standards/documentation.md NOW
249249
- tests (write/edit tests) → Read .opencode/context/core/standards/test-coverage.md NOW
250250
- review (code review) → Read .opencode/context/core/workflows/code-review.md NOW
251-
- delegate (using task tool) → Read .opencode/context/core/workflows/task-delegation.md NOW
251+
- delegate (using task tool) → Read .opencode/context/core/workflows/task-delegation-basics.md NOW
252252
- bash-only → No context needed, proceed to 3.2
253253
254254
NOTE: Load all files discovered by ContextScout in Stage 1.5 if not already loaded.
@@ -262,7 +262,7 @@ task(
262262
IF docs task → .opencode/context/core/standards/documentation.md (MANDATORY)
263263
IF tests task → .opencode/context/core/standards/test-coverage.md (MANDATORY)
264264
IF review task → .opencode/context/core/workflows/code-review.md (MANDATORY)
265-
IF delegation → .opencode/context/core/workflows/task-delegation.md (MANDATORY)
265+
IF delegation → .opencode/context/core/workflows/task-delegation-basics.md (MANDATORY)
266266
IF bash-only → No context required
267267
268268
WHEN DELEGATING TO SUBAGENTS:
@@ -305,10 +305,10 @@ task(
305305
1. **Identify Parallel Batches** (use task-cli.ts):
306306
```bash
307307
# Get all parallel-ready tasks
308-
bash .opencode/skill/task-management/router.sh parallel {feature}
308+
bash .opencode/skills/task-management/router.sh parallel {feature}
309309
310310
# Get next eligible tasks
311-
bash .opencode/skill/task-management/router.sh next {feature}
311+
bash .opencode/skills/task-management/router.sh next {feature}
312312
```
313313
314314
2. **Build Execution Plan**:
@@ -346,7 +346,7 @@ task(
346346
347347
4. **Verify Batch 1 Complete**:
348348
```bash
349-
bash .opencode/skill/task-management/router.sh status {feature}
349+
bash .opencode/skills/task-management/router.sh status {feature}
350350
```
351351
Confirm tasks 01, 02, 03 all show status: "completed"
352352
@@ -611,7 +611,7 @@ task(
611611
</route>
612612
</specialized_routing>
613613

614-
<process ref=".opencode/context/core/workflows/task-delegation.md">Full delegation template & process</process>
614+
<process ref=".opencode/context/core/workflows/task-delegation-basics.md">Full delegation template & process</process>
615615
</delegation_rules>
616616

617617
<principles>
@@ -624,14 +624,14 @@ task(
624624
</principles>
625625

626626
<static_context>
627-
Context index: .opencode/context/index.md
627+
Context index: .opencode/context/navigation.md
628628

629629
Load index when discovering contexts by keywords. For common tasks:
630630
- Code tasks → .opencode/context/core/standards/code-quality.md
631631
- Docs tasks → .opencode/context/core/standards/documentation.md
632632
- Tests tasks → .opencode/context/core/standards/test-coverage.md
633633
- Review tasks → .opencode/context/core/workflows/code-review.md
634-
- Delegation → .opencode/context/core/workflows/task-delegation.md
634+
- Delegation → .opencode/context/core/workflows/task-delegation-basics.md
635635

636636
Full index includes all contexts with triggers and dependencies.
637637
Context files loaded per @critical_context_requirement.

.opencode/agent/core/opencoder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ Code Standards
329329
330330
3. Validate batch completion:
331331
```bash
332-
bash .opencode/skill/task-management/router.sh status {feature}
332+
bash .opencode/skills/task-management/router.sh status {feature}
333333
```
334334
- Check all subtasks in batch have status: "completed"
335335
- Verify deliverables exist

.opencode/agent/subagents/code/coder-agent.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ description: Executes coding subtasks in sequence, ensuring completion as specif
44
mode: subagent
55
temperature: 0
66
permission:
7+
bash:
8+
"*": "deny"
9+
"bash .opencode/skills/task-management/router.sh complete*": "allow"
10+
"bash .opencode/skills/task-management/router.sh status*": "allow"
711
edit:
812
"**/*.env*": "deny"
913
"**/*.key": "deny"
@@ -35,7 +39,7 @@ permission:
3539
<system>Subtask execution engine within the OpenAgents task management pipeline</system>
3640
<domain>Software implementation — coding, file creation, integration</domain>
3741
<task>Implement atomic subtasks from JSON definitions, following project standards discovered via ContextScout</task>
38-
<constraints>No bash access. Sequential execution. Self-review mandatory before handoff.</constraints>
42+
<constraints>Limited bash access for task status updates only. Sequential execution. Self-review mandatory before handoff.</constraints>
3943
<tier level="1" desc="Critical Operations">
4044
- @context_first: ContextScout ALWAYS before coding
4145
- @external_scout_mandatory: ExternalScout for any external package
@@ -193,17 +197,17 @@ Update subtask status and report completion to orchestrator:
193197
**8.1 Update Subtask Status** (REQUIRED for parallel execution tracking):
194198
```bash
195199
# Mark this subtask as completed using task-cli.ts
196-
bash .opencode/skill/task-management/router.sh complete {feature} {seq} "{completion_summary}"
200+
bash .opencode/skills/task-management/router.sh complete {feature} {seq} "{completion_summary}"
197201
```
198202

199203
Example:
200204
```bash
201-
bash .opencode/skill/task-management/router.sh complete auth-system 01 "Implemented JWT authentication with refresh tokens"
205+
bash .opencode/skills/task-management/router.sh complete auth-system 01 "Implemented JWT authentication with refresh tokens"
202206
```
203207

204208
**8.2 Verify Status Update**:
205209
```bash
206-
bash .opencode/skill/task-management/router.sh status {feature}
210+
bash .opencode/skills/task-management/router.sh status {feature}
207211
```
208212
Confirm your subtask now shows: `status: "completed"`
209213

.opencode/agent/subagents/core/batch-executor.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permission:
77
bash:
88
"*": "deny"
99
"npx ts-node*task-cli*": "allow"
10-
"bash .opencode/skill/task-management/router.sh*": "allow"
10+
"bash .opencode/skills/task-management/router.sh*": "allow"
1111
edit:
1212
"**/*.env*": "deny"
1313
"**/*.key": "deny"
@@ -19,6 +19,7 @@ permission:
1919
contextscout: "allow"
2020
externalscout: "allow"
2121
coderagent: "allow"
22+
OpenFrontendSpecialist: "allow"
2223
---
2324

2425
# BatchExecutor
@@ -165,7 +166,7 @@ While waiting, you can optionally:
165166

166167
```bash
167168
# Check status of all subtasks in this batch
168-
bash .opencode/skill/task-management/router.sh status {feature}
169+
bash .opencode/skills/task-management/router.sh status {feature}
169170
```
170171

171172
Expected output:
@@ -235,7 +236,7 @@ Batch 2 depends on: 01, 02, 03 (all now satisfied).
235236
1. **Detect failure** from CoderAgent return
236237
2. **Check status** of other tasks in batch:
237238
```bash
238-
bash .opencode/skill/task-management/router.sh status {feature}
239+
bash .opencode/skills/task-management/router.sh status {feature}
239240
```
240241
3. **Report to orchestrator**:
241242
```
@@ -261,7 +262,7 @@ If CoderAgent reports completion but status doesn't show completed:
261262
2. **Check if CoderAgent actually ran task-cli.ts complete**
262263
3. **Manually mark complete** if needed:
263264
```bash
264-
bash .opencode/skill/task-management/router.sh complete {feature} {seq} "{summary}"
265+
bash .opencode/skills/task-management/router.sh complete {feature} {seq} "{summary}"
265266
```
266267
4. **Report discrepancy** to orchestrator
267268

.opencode/agent/subagents/core/externalscout.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ temperature: 0.1
66
permission:
77
read:
88
"**/*": "deny"
9-
".opencode/skill/context7/**": "allow"
9+
".opencode/skills/context7/**": "allow"
1010
".tmp/external-context/**": "allow"
1111
bash:
1212
"*": "deny"
@@ -30,14 +30,14 @@ permission:
3030
<critical_rules priority="absolute" enforcement="strict">
3131
<rule id="tool_usage">
3232
ALLOWED:
33-
- read: ONLY .opencode/skill/context7/** and .tmp/external-context/**
33+
- read: ONLY .opencode/skills/context7/** and .tmp/external-context/**
3434
- bash: ONLY curl to context7.com
3535
- skill: ONLY context7
3636
- grep: ONLY within .tmp/external-context/
3737
- webfetch: Any URL
3838
- write: ONLY to .tmp/external-context/**
3939
- edit: ONLY .tmp/external-context/**
40-
- glob: ONLY .opencode/skill/context7/** and .tmp/external-context/**
40+
- glob: ONLY .opencode/skills/context7/** and .tmp/external-context/**
4141

4242
NEVER use: task | todoread | todowrite
4343
NEVER read: Project files, source code, or any files outside allowed paths
@@ -125,7 +125,7 @@ permission:
125125
<stage id="1" name="DetectLibrary">
126126
<action>Identify library/framework from user query AND understand tech stack context</action>
127127
<process>
128-
1. Read `.opencode/skill/context7/library-registry.md`
128+
1. Read `.opencode/skills/context7/library-registry.md`
129129
2. Match query against library names, package names, and aliases
130130
3. Extract library ID and official docs URL
131131
4. **Detect tech stack context** from user query:
@@ -244,7 +244,7 @@ permission:
244244

245245
## Quick Reference
246246

247-
**Library Registry**: `.opencode/skill/context7/library-registry.md` — Supported libraries, IDs, and official docs links
247+
**Library Registry**: `.opencode/skills/context7/library-registry.md` — Supported libraries, IDs, and official docs links
248248

249249
**Supported Libraries**: Drizzle | Prisma | Better Auth | NextAuth.js | Clerk | Next.js | React | TanStack Query/Router | Cloudflare Workers | AWS Lambda | Vercel | Shadcn/ui | Radix UI | Tailwind CSS | Zustand | Jotai | Zod | React Hook Form | Vitest | Playwright
250250

.opencode/agent/subagents/core/task-manager.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ WHY THIS MATTERS:
5656
- Expect the calling agent to supply relevant context file paths; request them if absent.
5757
- Use the task tool ONLY for ContextScout discovery, never to delegate task planning to TaskManager.
5858
- Do NOT create session bundles or write `.tmp/sessions/**` files.
59-
- Do NOT read `.opencode/context/core/workflows/task-delegation.md` or follow delegation workflows.
59+
- Do NOT read `.opencode/context/core/workflows/task-delegation-basics.md` or follow delegation workflows.
6060
- Your output (JSON files) is your primary communication channel.
6161
</with_meta_agent>
6262

@@ -85,7 +85,7 @@ WHY THIS MATTERS:
8585

8686
2. Check current task state:
8787
```bash
88-
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skill/task-management/scripts/task-cli.ts status
88+
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skills/task-management/scripts/task-cli.ts status
8989
```
9090

9191
3. If context bundle provided, load and extract:
@@ -207,13 +207,14 @@ WHY THIS MATTERS:
207207

208208
**FRONTEND RULE**: If a task involves UI design, styling, or frontend implementation:
209209
1. Set `suggested_agent`: "OpenFrontendSpecialist"
210-
2. Include `.opencode/context/ui/web/ui-styling-standards.md` and `.opencode/context/core/workflows/design-iteration.md` in `context_files`.
211-
3. Ensure `acceptance_criteria` includes "Follows 4-stage design workflow" and "Responsive at all breakpoints".
212-
4. **PARALLELIZATION**: Design tasks can run in parallel (`parallel: true`) since design work is isolated and doesn't affect backend/logic implementation. Only mark `parallel: false` if design depends on backend API contracts or data structures.
210+
2. Include `.opencode/context/ui/web/ui-styling-standards.md` and `.opencode/context/core/workflows/design-iteration-overview.md` in `context_files`.
211+
3. If the design task is stage-specific, also include the relevant stage file(s): `design-iteration-stage-layout.md`, `design-iteration-stage-theme.md`, `design-iteration-stage-animation.md`, `design-iteration-stage-implementation.md`.
212+
4. Ensure `acceptance_criteria` includes "Follows 4-stage design workflow" and "Responsive at all breakpoints".
213+
5. **PARALLELIZATION**: Design tasks can run in parallel (`parallel: true`) since design work is isolated and doesn't affect backend/logic implementation. Only mark `parallel: false` if design depends on backend API contracts or data structures.
213214

214215
4. Validate with CLI:
215216
```bash
216-
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skill/task-management/scripts/task-cli.ts validate {feature}
217+
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skills/task-management/scripts/task-cli.ts validate {feature}
217218
```
218219

219220
5. Report creation:
@@ -242,7 +243,7 @@ WHY THIS MATTERS:
242243

243244
3. If all criteria pass:
244245
```bash
245-
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skill/task-management/scripts/task-cli.ts complete {feature} {seq} "{summary}"
246+
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skills/task-management/scripts/task-cli.ts complete {feature} {seq} "{summary}"
246247
```
247248

248249
4. If criteria fail:
@@ -252,7 +253,7 @@ WHY THIS MATTERS:
252253

253254
5. Check for next task:
254255
```bash
255-
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skill/task-management/scripts/task-cli.ts next {feature}
256+
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skills/task-management/scripts/task-cli.ts next {feature}
256257
```
257258
</process>
258259
<checkpoint>Task verified and status updated</checkpoint>
@@ -264,7 +265,7 @@ WHY THIS MATTERS:
264265
<process>
265266
1. Verify all tasks complete:
266267
```bash
267-
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skill/task-management/scripts/task-cli.ts status {feature}
268+
npx ts-node --compiler-options '{"module":"commonjs"}' .opencode/skills/task-management/scripts/task-cli.ts status {feature}
268269
```
269270

270271
2. If completed_count == subtask_count:
@@ -329,7 +330,7 @@ Use task-cli.ts for all status operations:
329330
| `complete feature seq "summary"` | After verifying task completion |
330331
| `validate [feature]` | After creating files |
331332

332-
Script location: `.opencode/skill/task-management/scripts/task-cli.ts`
333+
Script location: `.opencode/skills/task-management/scripts/task-cli.ts`
333334
</cli_integration>
334335

335336
<quality_standards>
@@ -364,4 +365,3 @@ Script location: `.opencode/skill/task-management/scripts/task-cli.ts`
364365
<lazy_loading>Reference context files, don't embed content</lazy_loading>
365366
<no_self_delegation>Do not create session bundles or delegate to TaskManager; execute directly</no_self_delegation>
366367
</principles>
367-

.opencode/agent/subagents/system-builder/command-creator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ temperature: 0.1
144144
```
145145
</template>
146146
<output>Complete command files</output>
147-
</step_5>
147+
</step_4>
148148

149149
<step_5>
150150
<action>Create command usage guide</action>

0 commit comments

Comments
 (0)