跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
法律与合规

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}.md with status Proposed
  • Auto-generate {REPO_ROOT}/.adlc/drafts/cdr/cdr.md index

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-init to scan existing code
  • Mining git history / issue-linked changes: Use /change-init to recover past decisions from commits + issue trackers
  • Before work is done: Run this after completing the implementation
  • Routine team AI directives validation: Use /team-repair for 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 type
    • rules: Only propose rule CDRs
    • personas: Only propose persona CDRs
    • examples: Only propose example CDRs
    • constitution: Only propose constitution amendment CDRs
    • skills: 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

ScenarioCommandInputOutput
Brownfield (existing code)/levelup-initCodebase scanDiscovered CDRs
Greenfield (session complete)/levelup-specifyCurrent sessionProposed CDRs

Outline

  1. Environment Setup (Phase 0): Resolve paths
  2. Review Session (Phase 1): Review the current session for patterns and evidence
  3. Load Existing CDRs (Phase 2): Read pending CDRs for enrichment
  4. Extract Patterns (Phase 3): Identify reusable patterns by context type + extract paired eval CDRs
  5. Create/Enrich CDRs (Phase 4): Write CDR files with session evidence
  6. Regenerate Index (Phase 5): Update cdr.md
  7. 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:

  1. REPO_ROOT — walk up from cwd to find a directory containing .adlc/, or use git rev-parse --show-toplevel, or use pwd.
  2. TEAM_AI_DIRECTIVES — check TEAM_AI_DIRECTIVES env var, then REPO_ROOT/.adlc/init-options.json → team_ai_directives field, then fallback to REPO_ROOT/team-ai-directives.
  3. CDR_DRAFTS_DIR — REPO_ROOT/.adlc/drafts/cdr
  4. NEXT_CDR — list CDR_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.

  1. What did the user ask for?
  2. What did the agent do? (file changes, key decisions, approach)
  3. What was the outcome?
  4. What files were created/modified? (git diff --stat, git log --oneline -10)
  5. 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

阅读完整来源 ↗