📦 deps(thirdparty): update snapshots
This commit is contained in:
+283
@@ -0,0 +1,283 @@
|
||||
# Preprocessing with `!command`
|
||||
|
||||
Deterministic context injection that runs before Claude sees the prompt.
|
||||
|
||||
## How It Works
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: pr-summary
|
||||
---
|
||||
|
||||
## Current Branch
|
||||
!`git branch --show-current`
|
||||
|
||||
## Recent Commits
|
||||
!`git log --oneline -5`
|
||||
```
|
||||
|
||||
When skill loads:
|
||||
1. Shell commands inside `!` `` ` `` run first
|
||||
2. Output replaces the syntax
|
||||
3. Claude sees rendered output, not commands
|
||||
|
||||
**Claude receives:**
|
||||
```markdown
|
||||
## Current Branch
|
||||
feature/add-auth
|
||||
|
||||
## Recent Commits
|
||||
a1b2c3d Add JWT validation
|
||||
e4f5g6h Implement login endpoint
|
||||
...
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
```markdown
|
||||
# Inline
|
||||
Current branch: !`git branch --show-current`
|
||||
|
||||
# Block
|
||||
## Status
|
||||
!`git status`
|
||||
|
||||
# With formatting
|
||||
- **Diff**: !`gh pr diff`
|
||||
- **Comments**: !`gh pr view --comments`
|
||||
```
|
||||
|
||||
## When to Preprocess
|
||||
|
||||
| Use Case | Command | Why |
|
||||
|----------|---------|-----|
|
||||
| Git state | `!git status` | Snapshot at invocation |
|
||||
| PR context | `!gh pr diff` | Avoid tool call overhead |
|
||||
| Schema info | `!psql -c "\\d users"` | Fresh structure |
|
||||
| Environment | `!echo $NODE_ENV` | Runtime context |
|
||||
| File contents | `!cat config.json` | Static reference |
|
||||
| Versions | `!node --version` | Environment info |
|
||||
|
||||
## When NOT to Preprocess
|
||||
|
||||
| Avoid | Why | Alternative |
|
||||
|-------|-----|-------------|
|
||||
| Dynamic queries | Needs conversation context | Use Bash tool |
|
||||
| Large outputs | Bloats context | Summarize or Read tool |
|
||||
| Mutations | Side effects before thinking | Tool with confirmation |
|
||||
| Secrets | Ends up in context | Environment variables |
|
||||
| Interactive commands | Hangs | Avoid or timeout |
|
||||
|
||||
## Patterns
|
||||
|
||||
### Git Context
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: commit-review
|
||||
---
|
||||
|
||||
## Current State
|
||||
- **Branch**: !`git branch --show-current`
|
||||
- **Status**: !`git status --short`
|
||||
- **Staged**: !`git diff --cached --stat`
|
||||
|
||||
## Recent History
|
||||
!`git log --oneline -10`
|
||||
|
||||
Review changes and suggest commit message.
|
||||
```
|
||||
|
||||
### PR Workflow
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: pr-summary
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Bash(gh:*)
|
||||
---
|
||||
|
||||
## Pull Request
|
||||
|
||||
- **Title**: !`gh pr view --json title -q .title`
|
||||
- **Author**: !`gh pr view --json author -q .author.login`
|
||||
- **State**: !`gh pr view --json state -q .state`
|
||||
|
||||
## Changes
|
||||
!`gh pr diff --stat`
|
||||
|
||||
## Full Diff
|
||||
!`gh pr diff`
|
||||
|
||||
## Comments
|
||||
!`gh pr view --comments`
|
||||
|
||||
Summarize changes, highlight risks, note open discussions.
|
||||
```
|
||||
|
||||
### Database Schema
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: db-aware-query
|
||||
---
|
||||
|
||||
## Schema Reference
|
||||
|
||||
### Users Table
|
||||
!`psql -c "\\d users" --no-psqlrc`
|
||||
|
||||
### Orders Table
|
||||
!`psql -c "\\d orders" --no-psqlrc`
|
||||
|
||||
Write queries aware of this schema.
|
||||
```
|
||||
|
||||
### Environment Info
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: debug-env
|
||||
---
|
||||
|
||||
## Runtime Environment
|
||||
|
||||
| Component | Version |
|
||||
|-----------|---------|
|
||||
| Node | !`node --version` |
|
||||
| npm | !`npm --version` |
|
||||
| TypeScript | !`npx tsc --version` |
|
||||
|
||||
## Config
|
||||
!`cat package.json | jq '{name, version, scripts}'`
|
||||
```
|
||||
|
||||
### Incident Context
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: incident-triage
|
||||
---
|
||||
|
||||
## Current Time
|
||||
!`date -u +"%Y-%m-%dT%H:%M:%SZ"`
|
||||
|
||||
## Recent Errors
|
||||
!`tail -50 /var/log/app.log | grep ERROR`
|
||||
|
||||
## System State
|
||||
!`ps aux | head -10`
|
||||
!`df -h | head -5`
|
||||
|
||||
Assess severity and identify immediate actions.
|
||||
```
|
||||
|
||||
## Combining with Artifacts
|
||||
|
||||
Preprocessing captures **live state**; artifacts capture **work state**:
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: deploy-preflight
|
||||
---
|
||||
|
||||
## Live State (preprocessed)
|
||||
- **Branch**: !`git branch --show-current`
|
||||
- **Clean**: !`git status --porcelain`
|
||||
- **Tests**: !`npm test 2>&1 | tail -5`
|
||||
|
||||
## Work State (from artifacts)
|
||||
Read artifacts/plan.md for deployment checklist.
|
||||
Read artifacts/review-notes.md for outstanding issues.
|
||||
|
||||
Proceed only if live state is clean AND artifacts show ready.
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
Commands that fail show error output:
|
||||
|
||||
```markdown
|
||||
# If git not installed:
|
||||
## Current Branch
|
||||
!`git branch --show-current`
|
||||
|
||||
# Claude sees:
|
||||
## Current Branch
|
||||
bash: git: command not found
|
||||
```
|
||||
|
||||
Handle gracefully in skill:
|
||||
|
||||
```markdown
|
||||
## Prerequisites
|
||||
|
||||
If any preprocessing shows errors (command not found, permission denied),
|
||||
report the issue and do not proceed.
|
||||
```
|
||||
|
||||
## Security Considerations
|
||||
|
||||
**Never preprocess:**
|
||||
- Commands that output secrets (`cat ~/.ssh/id_rsa`)
|
||||
- API calls with credentials in output
|
||||
- Anything that exposes tokens/passwords
|
||||
|
||||
**Safe patterns:**
|
||||
- Git operations (on repo content, not remotes with embedded creds)
|
||||
- System info (versions, paths)
|
||||
- File structure (ls, find)
|
||||
- Log snippets (ensure logs don't contain secrets)
|
||||
|
||||
## Performance
|
||||
|
||||
Preprocessing runs synchronously before skill loads. Keep commands fast:
|
||||
|
||||
| Good | Bad |
|
||||
|------|-----|
|
||||
| `git status` | `git clone ...` |
|
||||
| `head -100 file` | `cat giant-file` |
|
||||
| `ls -la` | `find / -name ...` |
|
||||
| `jq .field file.json` | `curl slow-api` |
|
||||
|
||||
If command might be slow, use tools instead (can stream output, user sees progress).
|
||||
|
||||
## Timeouts
|
||||
|
||||
Preprocessing commands have a **5-second timeout**. Commands exceeding this will:
|
||||
- Be terminated
|
||||
- Show timeout error in output
|
||||
- Still allow skill to load (with error visible)
|
||||
|
||||
**Implications:**
|
||||
- Keep commands under 2 seconds for reliable execution
|
||||
- Network calls are risky (latency varies)
|
||||
- Large file operations may timeout
|
||||
- Complex pipelines may need optimization
|
||||
|
||||
**Workarounds for slow operations:**
|
||||
|
||||
| Slow Pattern | Alternative |
|
||||
|--------------|-------------|
|
||||
| `curl api/endpoint` | Use WebFetch tool instead |
|
||||
| `find / -name ...` | Narrow scope or use Glob tool |
|
||||
| `git log --all` | Limit with `-n 10` |
|
||||
| `npm test` | Run as tool (shows progress) |
|
||||
|
||||
**No timeout control**: You cannot extend the timeout. If a command needs more than 5 seconds, it belongs in a tool call, not preprocessing.
|
||||
|
||||
## Debugging
|
||||
|
||||
If preprocessing seems wrong:
|
||||
|
||||
1. Run commands manually in terminal
|
||||
2. Check shell environment (preprocessing uses default shell)
|
||||
3. Verify paths are absolute or relative to skill location
|
||||
4. Check for quoting issues in complex commands
|
||||
|
||||
```markdown
|
||||
# Debug with echo
|
||||
!`echo "PWD: $(pwd)"`
|
||||
!`echo "PATH: $PATH"`
|
||||
```
|
||||
+331
@@ -0,0 +1,331 @@
|
||||
# State Handoff Patterns
|
||||
|
||||
How to pass state between workflow steps without relying on conversation context.
|
||||
|
||||
## Why File-Based State
|
||||
|
||||
| Problem | File-Based Solution |
|
||||
|---------|---------------------|
|
||||
| Context compaction loses history | Files persist |
|
||||
| Forked skills have no conversation access | Files are accessible |
|
||||
| State scattered across messages | Single source of truth |
|
||||
| Hard to audit what happened | Artifacts are reviewable |
|
||||
|
||||
## Core Pattern
|
||||
|
||||
```text
|
||||
Skill A writes → artifacts/step-a.md
|
||||
↓
|
||||
Skill B reads artifacts/step-a.md → writes artifacts/step-b.md
|
||||
↓
|
||||
Skill C reads artifacts/step-b.md → ...
|
||||
```
|
||||
|
||||
Each skill:
|
||||
1. Reads previous artifact(s)
|
||||
2. Does its work
|
||||
3. Writes its own artifact
|
||||
4. Updates context.md with decisions
|
||||
|
||||
## Artifact Structure
|
||||
|
||||
### Standard Header
|
||||
|
||||
```markdown
|
||||
# {Step Name}: {Brief Description}
|
||||
|
||||
**Generated**: {timestamp}
|
||||
**Input**: artifacts/{previous-step}.md
|
||||
**Status**: complete | partial | blocked
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
### Sections by Step Type
|
||||
|
||||
**Triage/Analysis artifacts:**
|
||||
```markdown
|
||||
## Problem Statement
|
||||
{clear definition}
|
||||
|
||||
## Scope
|
||||
- Files: {list}
|
||||
- Modules: {list}
|
||||
|
||||
## Findings
|
||||
{what was discovered}
|
||||
|
||||
## Risks
|
||||
- {risk 1}
|
||||
- {risk 2}
|
||||
|
||||
## Next Steps
|
||||
- [ ] {action 1}
|
||||
- [ ] {action 2}
|
||||
```
|
||||
|
||||
**Plan artifacts:**
|
||||
```markdown
|
||||
## Goal
|
||||
{what we're trying to achieve}
|
||||
|
||||
## Approach
|
||||
{chosen approach with rationale}
|
||||
|
||||
## Task Breakdown
|
||||
1. {task 1}
|
||||
2. {task 2}
|
||||
3. {task 3}
|
||||
|
||||
## Test Plan
|
||||
- [ ] {test 1}
|
||||
- [ ] {test 2}
|
||||
|
||||
## Rollback Plan
|
||||
{how to undo if needed}
|
||||
```
|
||||
|
||||
**Review artifacts:**
|
||||
```markdown
|
||||
## Summary
|
||||
{brief assessment}
|
||||
|
||||
## Findings
|
||||
| Severity | Issue | Location | Recommendation |
|
||||
|----------|-------|----------|----------------|
|
||||
| {sev} | {desc} | {loc} | {rec} |
|
||||
|
||||
## Concerns
|
||||
- {concern 1}
|
||||
- {concern 2}
|
||||
|
||||
## Approval
|
||||
- [ ] Ready to proceed
|
||||
- [ ] Needs revision
|
||||
```
|
||||
|
||||
**Test artifacts:**
|
||||
```markdown
|
||||
## Commands Run
|
||||
```bash
|
||||
{command 1}
|
||||
{command 2}
|
||||
```
|
||||
|
||||
## Results
|
||||
| Suite | Pass | Fail | Skip |
|
||||
|-------|------|------|------|
|
||||
| {name} | {n} | {n} | {n} |
|
||||
|
||||
## Failures
|
||||
### {test name}
|
||||
- Error: {message}
|
||||
- Fix: {resolution}
|
||||
|
||||
## Coverage
|
||||
{coverage summary}
|
||||
```
|
||||
|
||||
## context.md Pattern
|
||||
|
||||
The shared context.md tracks living state across all steps:
|
||||
|
||||
```markdown
|
||||
# Current Context
|
||||
|
||||
## Task
|
||||
{what we're working on}
|
||||
|
||||
## Decisions Made
|
||||
- {decision 1} — {rationale}
|
||||
- {decision 2} — {rationale}
|
||||
|
||||
## Current Focus
|
||||
{what step we're on, what's next}
|
||||
|
||||
## Blockers
|
||||
- {blocker if any}
|
||||
|
||||
## Open Questions
|
||||
- {question if any}
|
||||
|
||||
---
|
||||
Last updated: {timestamp}
|
||||
```
|
||||
|
||||
### Update Pattern
|
||||
|
||||
Each skill appends to decisions and updates current focus:
|
||||
|
||||
```markdown
|
||||
## Decisions Made
|
||||
- {existing decisions}
|
||||
- Chose X over Y for {reason} — from /plan ← NEW
|
||||
```
|
||||
|
||||
## constraints.md Pattern
|
||||
|
||||
Static project constraints, rarely changed:
|
||||
|
||||
```markdown
|
||||
# Project Constraints
|
||||
|
||||
## Security
|
||||
- No secrets in code
|
||||
- All inputs validated
|
||||
- {project-specific rules}
|
||||
|
||||
## Style
|
||||
- {linting rules}
|
||||
- {naming conventions}
|
||||
|
||||
## Performance
|
||||
- {latency budgets}
|
||||
- {size limits}
|
||||
|
||||
## Testing
|
||||
- {coverage requirements}
|
||||
- {required test types}
|
||||
```
|
||||
|
||||
## Gates Between Steps
|
||||
|
||||
Use artifact existence as gates:
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: ship
|
||||
---
|
||||
|
||||
# Prerequisites
|
||||
|
||||
Check these artifacts exist and show success:
|
||||
- artifacts/test-report.md: all tests passing
|
||||
- artifacts/review-notes.md: no blocking issues
|
||||
- artifacts/preflight.md: all checks green
|
||||
|
||||
If any missing or failing, do not proceed.
|
||||
```
|
||||
|
||||
### Gate Validation Patterns
|
||||
|
||||
```markdown
|
||||
# In skill body:
|
||||
|
||||
Before proceeding, verify:
|
||||
1. artifacts/plan.md exists
|
||||
2. All tasks in plan.md are checked off
|
||||
3. artifacts/test-report.md shows no failures
|
||||
|
||||
If any check fails:
|
||||
- Report what's missing
|
||||
- Do not proceed
|
||||
- Suggest next step
|
||||
```
|
||||
|
||||
## Parallel Workflow Branches
|
||||
|
||||
When workflow branches, use namespaced artifacts:
|
||||
|
||||
```text
|
||||
artifacts/
|
||||
triage.md
|
||||
plan.md
|
||||
security/
|
||||
audit.md
|
||||
review.md
|
||||
performance/
|
||||
profile.md
|
||||
review.md
|
||||
final-review.md ← merges both branches
|
||||
```
|
||||
|
||||
### Merge Pattern
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: final-review
|
||||
---
|
||||
|
||||
Read and merge:
|
||||
- artifacts/security/review.md
|
||||
- artifacts/performance/review.md
|
||||
|
||||
Synthesize into artifacts/final-review.md with:
|
||||
- Combined findings
|
||||
- Priority ranking
|
||||
- Unified recommendation
|
||||
```
|
||||
|
||||
## Failure Recovery
|
||||
|
||||
When a step fails, artifacts capture state for recovery:
|
||||
|
||||
```markdown
|
||||
# artifacts/implement.md
|
||||
|
||||
## Status: blocked
|
||||
|
||||
## Completed
|
||||
- [x] Task 1
|
||||
- [x] Task 2
|
||||
|
||||
## Blocked On
|
||||
- Task 3: {error message}
|
||||
|
||||
## Recovery Steps
|
||||
1. {fix suggestion}
|
||||
2. Retry /implement
|
||||
|
||||
## Context Preserved
|
||||
- Last working state at commit abc123
|
||||
- Rollback with: git checkout abc123
|
||||
```
|
||||
|
||||
## Tips
|
||||
|
||||
### Keep Artifacts Focused
|
||||
|
||||
One purpose per artifact. If an artifact does multiple things, split it.
|
||||
|
||||
### Include Timestamps
|
||||
|
||||
```markdown
|
||||
**Generated**: 2026-01-26T10:30:00Z
|
||||
```
|
||||
|
||||
Helps track freshness and debugging.
|
||||
|
||||
### Link to Source
|
||||
|
||||
```markdown
|
||||
## Findings
|
||||
Issue in `src/auth/login.ts:42` — missing validation
|
||||
```
|
||||
|
||||
Specific file:line references for easy navigation.
|
||||
|
||||
### Self-Contained
|
||||
|
||||
Each artifact should be understandable without reading others:
|
||||
|
||||
```markdown
|
||||
# Review: Authentication Refactor
|
||||
|
||||
**Context**: Refactoring auth module to use JWT (from artifacts/plan.md)
|
||||
|
||||
## Scope Reviewed
|
||||
- src/auth/*.ts
|
||||
- src/middleware/auth.ts
|
||||
```
|
||||
|
||||
### Version Artifacts When Needed
|
||||
|
||||
```text
|
||||
artifacts/
|
||||
plan-v1.md
|
||||
plan-v2.md ← after revision
|
||||
plan-final.md
|
||||
```
|
||||
|
||||
Or use git to track history and keep single files.
|
||||
+676
@@ -0,0 +1,676 @@
|
||||
# Workflow Templates
|
||||
|
||||
Copy/paste templates for common multi-skill workflows. Each workflow uses the shared conventions pattern from the main skill.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Triage → Plan → Implement → Test → Review → Ship](#triage--plan--implement--test--review--ship)
|
||||
- [Spec Gate → Implement → Security Review → Merge](#spec-gate--implement--security-review--merge)
|
||||
- [PR Summary → Review Notes → Update PR](#pr-summary--review-notes--update-pr)
|
||||
- [Repo Bootstrap → Conventions → First Task](#repo-bootstrap--conventions--first-task)
|
||||
- [Incident Triage → Evidence → Hypothesis → Fix → Postmortem](#incident-triage--evidence--hypothesis--fix--postmortem)
|
||||
- [Data Report → Visualize → Publish](#data-report--visualize--publish)
|
||||
- [Council Review → Decision → Implementation](#council-review--decision--implementation)
|
||||
- [Safe Refactor Loop](#safe-refactor-loop)
|
||||
- [Doc-Driven Development](#doc-driven-development)
|
||||
- [Release Workflow](#release-workflow)
|
||||
|
||||
---
|
||||
|
||||
## Triage → Plan → Implement → Test → Review → Ship
|
||||
|
||||
The canonical development workflow. Use for feature work, bug fixes, and improvements.
|
||||
|
||||
### Structure
|
||||
|
||||
```text
|
||||
.claude/skills/
|
||||
triage/SKILL.md
|
||||
plan/SKILL.md
|
||||
implement/SKILL.md
|
||||
test/SKILL.md
|
||||
review/SKILL.md
|
||||
ship/SKILL.md
|
||||
artifacts/
|
||||
triage.md
|
||||
plan.md
|
||||
test-report.md
|
||||
review-notes.md
|
||||
```
|
||||
|
||||
### triage/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: triage
|
||||
description: Turn incoming task into problem statement + acceptance criteria.
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Triage $ARGUMENTS.
|
||||
|
||||
Write artifacts/triage.md:
|
||||
- Problem statement
|
||||
- Suspected scope (files/modules)
|
||||
- Acceptance criteria
|
||||
- Risks + unknowns
|
||||
```
|
||||
|
||||
### plan/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: plan
|
||||
description: Convert triage into implementation plan with checkpoints and rollback.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Read artifacts/triage.md and constraints.md.
|
||||
|
||||
Write artifacts/plan.md:
|
||||
- Approach (1-2 options)
|
||||
- Chosen option + rationale
|
||||
- Task breakdown
|
||||
- Test plan
|
||||
- Rollback plan
|
||||
```
|
||||
|
||||
### implement/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: implement
|
||||
description: Implement the planned changes following artifacts/plan.md.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Follow artifacts/plan.md.
|
||||
- Make minimal diffs
|
||||
- Update context.md with decisions
|
||||
- Prefer small commits
|
||||
```
|
||||
|
||||
### test/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: test
|
||||
description: Run test plan and summarize failures deterministically.
|
||||
disable-model-invocation: true
|
||||
allowed-tools: Read, Bash, Write
|
||||
---
|
||||
|
||||
Run commands from artifacts/plan.md "Test plan".
|
||||
|
||||
Write artifacts/test-report.md:
|
||||
- Commands run
|
||||
- Output summary
|
||||
- Failures and fixes
|
||||
```
|
||||
|
||||
### review/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: review
|
||||
description: Self-review like a strict PR reviewer. Propose follow-ups.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Review diffs and artifacts.
|
||||
|
||||
Write artifacts/review-notes.md:
|
||||
- Risks
|
||||
- Edge cases
|
||||
- Refactor opportunities
|
||||
```
|
||||
|
||||
### ship/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: ship
|
||||
description: Finalize and ship. Only when explicitly invoked.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Checklist:
|
||||
- tests green
|
||||
- artifacts complete
|
||||
- review notes addressed
|
||||
|
||||
Then perform ship steps appropriate to this repo.
|
||||
```
|
||||
|
||||
### State Flow
|
||||
|
||||
```text
|
||||
/triage → artifacts/triage.md
|
||||
↓
|
||||
/plan reads triage.md → artifacts/plan.md
|
||||
↓
|
||||
/implement reads plan.md → code changes + context.md
|
||||
↓
|
||||
/test reads plan.md → artifacts/test-report.md
|
||||
↓
|
||||
/review reads all → artifacts/review-notes.md
|
||||
↓ (gates /ship)
|
||||
/ship reads review-notes.md → commit/PR/deploy
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Spec Gate → Implement → Security Review → Merge
|
||||
|
||||
Adds adversarial security review before merge. Use for security-sensitive features.
|
||||
|
||||
### Structure
|
||||
|
||||
```text
|
||||
.claude/skills/
|
||||
spec-gate/SKILL.md
|
||||
implement/SKILL.md
|
||||
adversarial-review/SKILL.md
|
||||
merge/SKILL.md
|
||||
artifacts/
|
||||
spec.md
|
||||
security-review.md
|
||||
```
|
||||
|
||||
### spec-gate/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: spec-gate
|
||||
description: Write spec and detect prompt-injection/scope ambiguity before coding.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Write artifacts/spec.md:
|
||||
- Goals / non-goals
|
||||
- Constraints
|
||||
- Acceptance criteria
|
||||
- Threat model (where could data leak?)
|
||||
```
|
||||
|
||||
### adversarial-review/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: adversarial-review
|
||||
description: Adversarial review against prompt injection and unsafe tool use.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Review diff and artifacts/spec.md.
|
||||
|
||||
Write artifacts/security-review.md:
|
||||
- Suspicious instructions
|
||||
- Risky tool calls
|
||||
- Recommended restrictions (allowed-tools / hooks)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## PR Summary → Review Notes → Update PR
|
||||
|
||||
Live PR workflow using `gh` CLI preprocessing.
|
||||
|
||||
### pr-summary/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: pr-summary
|
||||
description: Summarize current PR using live gh CLI output.
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Read, Bash(gh:*), Write
|
||||
---
|
||||
|
||||
## Pull Request Context
|
||||
|
||||
- **Diff**: !`gh pr diff`
|
||||
- **Comments**: !`gh pr view --comments`
|
||||
|
||||
Summarize changes and risks in artifacts/pr-summary.md.
|
||||
```
|
||||
|
||||
### review-notes/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: review-notes
|
||||
description: Generate review notes from PR summary.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Write
|
||||
---
|
||||
|
||||
Read artifacts/pr-summary.md.
|
||||
|
||||
Write artifacts/review-notes.md:
|
||||
- Key changes
|
||||
- Concerns
|
||||
- Questions for author
|
||||
```
|
||||
|
||||
### update-pr/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: update-pr
|
||||
description: Update PR description with generated summary.
|
||||
disable-model-invocation: true
|
||||
allowed-tools: Read, Bash(gh:*)
|
||||
---
|
||||
|
||||
Read artifacts/pr-summary.md.
|
||||
Update PR body using gh pr edit.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Repo Bootstrap → Conventions → First Task
|
||||
|
||||
Onboarding workflow for new projects.
|
||||
|
||||
### bootstrap-repo/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: bootstrap-repo
|
||||
description: Initialize .claude/ structure for new project.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Create skeleton:
|
||||
- .claude/skills/_shared/context.md
|
||||
- .claude/skills/_shared/constraints.md
|
||||
- artifacts/ directory
|
||||
|
||||
Populate constraints.md with project defaults.
|
||||
```
|
||||
|
||||
### conventions/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: conventions
|
||||
description: Fill in repo-specific conventions after bootstrap.
|
||||
---
|
||||
|
||||
Read existing codebase patterns.
|
||||
Update constraints.md with:
|
||||
- Style conventions
|
||||
- Testing requirements
|
||||
- Security policies
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Incident Triage → Evidence → Hypothesis → Fix → Postmortem
|
||||
|
||||
Incident response workflow with deterministic evidence gathering.
|
||||
|
||||
### incident-triage/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: incident-triage
|
||||
description: Initial incident assessment and severity classification.
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Assess:
|
||||
- Symptoms
|
||||
- Affected systems
|
||||
- Severity level
|
||||
- Initial timeline
|
||||
|
||||
Write artifacts/incident-triage.md.
|
||||
```
|
||||
|
||||
### gather-evidence/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: gather-evidence
|
||||
description: Collect logs and metrics deterministically.
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Read, Bash(grep:*), Bash(tail:*), Write
|
||||
---
|
||||
|
||||
## Current State
|
||||
|
||||
- **Recent logs**: !`tail -100 /var/log/app.log`
|
||||
- **Error count**: !`grep -c ERROR /var/log/app.log`
|
||||
|
||||
Write artifacts/evidence.md with findings.
|
||||
```
|
||||
|
||||
### hypothesize/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: hypothesize
|
||||
description: Form and rank hypotheses from evidence.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Write
|
||||
---
|
||||
|
||||
Read artifacts/evidence.md.
|
||||
|
||||
Write artifacts/hypothesis.md:
|
||||
- Hypotheses ranked by likelihood
|
||||
- Evidence supporting each
|
||||
- Investigation steps to confirm/reject
|
||||
```
|
||||
|
||||
### postmortem/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: postmortem
|
||||
description: Generate postmortem from incident artifacts.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Write
|
||||
---
|
||||
|
||||
Read all incident artifacts.
|
||||
|
||||
Write artifacts/postmortem.md:
|
||||
- Timeline
|
||||
- Root cause
|
||||
- Contributing factors
|
||||
- Action items
|
||||
- Lessons learned
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Data Report → Visualize → Publish
|
||||
|
||||
Reporting workflow with artifact generation.
|
||||
|
||||
### data-report/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: data-report
|
||||
description: Gather and analyze data for report.
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Read, Bash(*), Write
|
||||
---
|
||||
|
||||
Gather data per $ARGUMENTS.
|
||||
Write artifacts/data-report.md with analysis.
|
||||
```
|
||||
|
||||
### visualize/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: visualize
|
||||
description: Generate visualizations from report data.
|
||||
allowed-tools: Read, Bash(*), Write
|
||||
---
|
||||
|
||||
Read artifacts/data-report.md.
|
||||
Generate charts/diagrams in artifacts/visuals/.
|
||||
```
|
||||
|
||||
### publish-report/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: publish-report
|
||||
description: Compile final report for publishing.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Combine artifacts/data-report.md and artifacts/visuals/.
|
||||
Output final report to artifacts/final-report.md or HTML.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Council Review → Decision → Implementation
|
||||
|
||||
Multi-perspective review pattern. Forces diverse failure modes.
|
||||
|
||||
### council-review/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: council-review
|
||||
description: Gather multiple perspectives on a decision.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Review $ARGUMENTS from perspectives:
|
||||
- Security reviewer
|
||||
- Performance reviewer
|
||||
- UX/Product reviewer
|
||||
- Maintainability reviewer
|
||||
|
||||
Write artifacts/council-review.md with each perspective.
|
||||
```
|
||||
|
||||
### decision/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: decision
|
||||
description: Synthesize council review into decision.
|
||||
---
|
||||
|
||||
Read artifacts/council-review.md.
|
||||
|
||||
Write artifacts/decision.md:
|
||||
- Chosen approach
|
||||
- Rationale
|
||||
- Dissenting views acknowledged
|
||||
- Mitigations for concerns
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Safe Refactor Loop
|
||||
|
||||
Read-only exploration before any changes.
|
||||
|
||||
### explore-safe/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: explore-safe
|
||||
description: Read-only codebase exploration.
|
||||
context: fork
|
||||
agent: Explore
|
||||
allowed-tools: Read, Grep, Glob, Write
|
||||
---
|
||||
|
||||
Explore $ARGUMENTS without making changes.
|
||||
Write artifacts/exploration.md with findings.
|
||||
```
|
||||
|
||||
### refactor-plan/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: refactor-plan
|
||||
description: Plan refactoring from exploration findings.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Write
|
||||
---
|
||||
|
||||
Read artifacts/exploration.md.
|
||||
|
||||
Write artifacts/refactor-plan.md:
|
||||
- Changes needed
|
||||
- Order of operations
|
||||
- Test coverage requirements
|
||||
- Rollback strategy
|
||||
```
|
||||
|
||||
### refactor-execute/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: refactor-execute
|
||||
description: Execute refactoring plan.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Follow artifacts/refactor-plan.md exactly.
|
||||
Run tests after each step.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Doc-Driven Development
|
||||
|
||||
Outline → Spec → Code → Docs Sync
|
||||
|
||||
### outline/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: outline
|
||||
description: Create high-level outline before specifying.
|
||||
context: fork
|
||||
agent: Plan
|
||||
allowed-tools: Read, Write
|
||||
---
|
||||
|
||||
Write artifacts/outline.md with structure and goals.
|
||||
```
|
||||
|
||||
### spec/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: spec
|
||||
description: Detailed specification from outline.
|
||||
---
|
||||
|
||||
Read artifacts/outline.md.
|
||||
Write artifacts/spec.md with full specification.
|
||||
```
|
||||
|
||||
### docs-sync/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: docs-sync
|
||||
description: Sync documentation with implementation.
|
||||
---
|
||||
|
||||
Compare code to artifacts/spec.md.
|
||||
Update documentation to match implementation.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Release Workflow
|
||||
|
||||
Preflight → Build → Deploy (manual) → Verify → Announce
|
||||
|
||||
### preflight/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: preflight
|
||||
description: Pre-release validation checklist.
|
||||
allowed-tools: Read, Bash(*), Write
|
||||
---
|
||||
|
||||
Run preflight checks:
|
||||
- Tests pass
|
||||
- Lint clean
|
||||
- No security warnings
|
||||
- Changelog updated
|
||||
|
||||
Write artifacts/preflight.md with results.
|
||||
Block if any checks fail.
|
||||
```
|
||||
|
||||
### deploy/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: deploy
|
||||
description: Deploy to environment. Manual invocation only.
|
||||
disable-model-invocation: true
|
||||
allowed-tools: Read, Bash(*)
|
||||
---
|
||||
|
||||
Read artifacts/preflight.md (must exist and pass).
|
||||
Deploy to $ARGUMENTS environment.
|
||||
```
|
||||
|
||||
### verify/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: verify
|
||||
description: Post-deploy verification.
|
||||
allowed-tools: Read, Bash(*), Write
|
||||
---
|
||||
|
||||
Verify deployment health:
|
||||
- Health endpoints responding
|
||||
- Key flows working
|
||||
- No error spikes
|
||||
|
||||
Write artifacts/verify.md with results.
|
||||
```
|
||||
|
||||
### announce/SKILL.md
|
||||
|
||||
```markdown
|
||||
---
|
||||
name: announce
|
||||
description: Announce release. Manual invocation only.
|
||||
disable-model-invocation: true
|
||||
---
|
||||
|
||||
Read artifacts/verify.md (must pass).
|
||||
Generate release announcement.
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Pattern Summary
|
||||
|
||||
| Workflow | Key Insight |
|
||||
|----------|-------------|
|
||||
| Triage→Ship | Full development lifecycle with gates |
|
||||
| Spec Gate | Adversarial security review before merge |
|
||||
| PR Summary | Preprocessing with `!gh` for live context |
|
||||
| Bootstrap | Onboarding pattern for new projects |
|
||||
| Incident | Evidence-first debugging with postmortem |
|
||||
| Data Report | Artifact generation with visualization |
|
||||
| Council | Multi-perspective review forces diverse analysis |
|
||||
| Safe Refactor | Read-only exploration before changes |
|
||||
| Doc-Driven | Spec precedes code |
|
||||
| Release | Manual gates for deploy/announce |
|
||||
|
||||
The "secret sauce" isn't the step names—it's the **state handoff discipline** via artifacts.
|
||||
Reference in New Issue
Block a user