levelup-specify
Extract Context Directive Records (CDRs) from the current session after completing work. Identifies reusable patterns (rules, personas, examples, evals) and captures directive compliance cases for team-ai-directives.
tikalk · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add tikalk/adlc-team-skills --skill levelup-specify技能说明
name: levelup-specify description: Extract Context Directive Records (CDRs) from the current session after completing work. Identifies reusable patterns (rules, personas, examples, evals) and captures directive compliance cases for team-ai-directives. disable-model-invocation: true
levelup-specify
What this skill does
Extract Context Directive Records (CDRs) from the current session after completing work.
This is the primary command for capturing learnings from completed work:
- Review the current session directly (the agent remembers what it did)
- Identify reusable patterns: rules, personas, examples, skills, and constitution amendments
- For each directive CDR, also extract a paired eval CDR with pass/fail cases from the session
- Link CDRs to concrete implementation evidence (files, commits, tests)
- Write CDRs to
{REPO_ROOT}/.adlc/drafts/cdr/CDR-{NNN}.mdwith status Proposed - Auto-generate
{REPO_ROOT}/.adlc/drafts/cdr/cdr.mdindex
Key Difference from /levelup-init:
/levelup-init= Discovers patterns from existing codebase (brownfield)/levelup-specify(this skill) = Extracts patterns from the current session (greenfield)
This skill focuses on session-level learnings — what reusable knowledge emerged from the work just completed.
When to use
- After completing work: Capture reusable patterns from the session
- Contributing back to team AI directives: Turn session work into reusable directives
- Before closing a branch: Extract team-wide learnings
When NOT to use
- Brownfield projects: Use
/levelup-initto scan existing code - Mining git history / issue-linked changes: Use
/change-initto recover past decisions from commits + issue trackers - Before work is done: Run this after completing the implementation
- Routine team AI directives validation: Use
/team-repairfor health checks
Process
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Examples of User Input:
"Focus on error handling patterns"— Extract CDRs related to error handling"Document the testing approach"— Focus on testing patterns"CDR-001"— Enrich an existing CDR with more session evidence"--focus skills"— Only propose skill-type CDRs- Empty input: Extract all patterns from the session trace
Flags
--focus AREA: Focus on specific context typerules: Only propose rule CDRspersonas: Only propose persona CDRsexamples: Only propose example CDRsconstitution: Only propose constitution amendment CDRsskills: Only propose skill CDRs
--cdr-id ID: Enrich an existing CDR with session evidence instead of creating new ones
Role & Context
You are acting as a Context Extractor — identifying reusable patterns from the current session. Your role involves:
- Reading the current session (the agent directly observes what happened)
- Identifying patterns that would benefit other projects
- Creating CDRs for rules, personas, examples, constitution amendments, or skills
- For each directive CDR, extracting a paired eval CDR with pass/fail cases from the session
- Linking CDRs to implementation evidence (code, commits, tests)
Brownfield vs Greenfield
| Scenario | Command | Input | Output |
|---|---|---|---|
| Brownfield (existing code) | /levelup-init | Codebase scan | Discovered CDRs |
| Greenfield (session complete) | /levelup-specify | Current session | Proposed CDRs |
Outline
- Environment Setup (Phase 0): Resolve paths
- Review Session (Phase 1): Review the current session for patterns and evidence
- Load Existing CDRs (Phase 2): Read pending CDRs for enrichment
- Extract Patterns (Phase 3): Identify reusable patterns by context type + extract paired eval CDRs
- Create/Enrich CDRs (Phase 4): Write CDR files with session evidence
- Regenerate Index (Phase 5): Update
cdr.md - Summary (Phase 6): Present extraction results
Execution Steps
Phase 0: Environment Setup
Run the setup script from the skill's base directory:
scripts/bash/setup-levelup-specify.sh
Parse JSON output for paths and next CDR number.
If the setup script is unavailable or fails, resolve paths manually:
REPO_ROOT— walk up from cwd to find a directory containing.adlc/, or usegit rev-parse --show-toplevel, or usepwd.TEAM_AI_DIRECTIVES— checkTEAM_AI_DIRECTIVESenv var, thenREPO_ROOT/.adlc/init-options.json→team_ai_directivesfield, then fallback toREPO_ROOT/team-ai-directives.CDR_DRAFTS_DIR—REPO_ROOT/.adlc/drafts/cdrNEXT_CDR— listCDR_DRAFTS_DIR/CDR-*.md, find the highest number, increment by 1, zero-pad to 3 digits (e.g.,001).
If TEAM_AI_DIRECTIVES is not configured:
Team AI directives repository not configured.
Run: team-setup
Or set: export TEAM_AI_DIRECTIVES=/path/to/team-ai-directives
Phase 1: Review Session
Review the current session to identify what happened. The agent directly observes the session — no trace file is needed.
- What did the user ask for?
- What did the agent do? (file changes, key decisions, approach)
- What was the outcome?
- What files were created/modified? (
git diff --stat,git log --oneline -10) - What reusable patterns emerged?
Also collect implementation evidence:
# Files changed
git diff --stat 2>/dev/null
# Recent commits
git log --oneline -10 2>/dev/null
# New/untracked files
git status --short 2>/dev/null
Phase 2: Load Existing CDRs
Read {REPO_ROOT}/.adlc/drafts/cdr/CDR-*.md:
- If user provided
--cdr-id: load that specific CDR for enrichment - Otherwise: load all pending CDRs (status Discovered/Proposed) to avoid duplicates
Phase 3: Extract Patterns
For each context type, look for reusable patterns from the session and evidence:
Rules: Coding conventions, err
阅读完整来源 ↗