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

levelup-init

Reverse-engineer Context Directive Records (CDRs) from an existing codebase for contribution to team-ai-directives. Use when bootstrapping team knowledge from brownfield projects.

tikalk · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add tikalk/adlc-team-skills --skill levelup-init

技能说明


name: levelup-init description: Reverse-engineer Context Directive Records (CDRs) from an existing codebase for contribution to team-ai-directives. Use when bootstrapping team knowledge from brownfield projects. disable-model-invocation: true

levelup-init

What this skill does

Reverse-engineer Context Directive Records (CDRs) from an existing codebase (brownfield) to document reusable patterns that could become contributions to team-ai-directives.

You act as a Context Archaeologist uncovering implicit team patterns from code:

  • Scan the codebase for reusable rules, personas, examples, skill-worthy capabilities, and eval-worthy patterns
  • Detect cross-sub-system patterns and inconsistencies
  • For each directive CDR, also extract a paired eval CDR with pass/fail cases from code evidence
  • Compare against existing team-ai-directives to avoid duplicates
  • Write CDRs to {REPO_ROOT}/.adlc/drafts/cdr/CDR-{NNN}.md with status Discovered
  • Auto-generate {REPO_ROOT}/.adlc/drafts/cdr/cdr.md index

Key Difference from /levelup-specify:

  • /levelup-init (this skill) = Discovers what's already implemented in code
  • /levelup-specify = Extracts patterns from a completed feature's spec/plan/tasks

This skill focuses on current state analysis — what IS reusable, not what SHOULD BE created.

When to use

  • Brownfield projects: Existing code without team-wide directives
  • Legacy modernization: Extract reusable patterns before refactoring
  • Team onboarding: Turn implicit conventions into explicit directives
  • Team AI Directives bootstrapping: Populate a new team-ai-directives repository

When NOT to use

  • Greenfield projects: Use /levelup-specify after implementing a feature
  • Mining git history / issue-linked changes: Use /change-init to recover past decisions from commits + issue trackers
  • CDRs already exist: If .adlc/drafts/cdr/ has pending CDRs, use /levelup-clarify to review
  • Routine team AI directives health checks: Use /team-repair for re-indexing and conflict scanning

Process

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Examples of User Input:

  • "Python FastAPI backend with PostgreSQL" — Focus on Python patterns
  • "Focus on testing patterns" — Narrow to testing-related CDRs
  • "--cdr-heuristic all" — Document all patterns, not just surprising ones
  • "--focus rules" — Only discover rule-type patterns
  • "--resume" — Resume from previous state
  • Empty input: Scan entire codebase for all context types

Flags

  • --cdr-heuristic HEURISTIC: CDR generation strategy

    • surprising (default): Only document patterns not already in team-ai-directives
    • all: Document all discovered patterns
    • minimal: Only high-value/novel patterns
  • --focus AREA: Focus on specific context type

    • rules: Only scan for coding rules
    • personas: Only scan for role patterns
    • examples: Only scan for example-worthy code
    • constitution: Only scan for governance patterns
    • skills: Only scan for skill-worthy capabilities
  • --no-decompose: Disable automatic sub-system detection

  • --resume: Resume from previous state (if interrupted)

  • --skip-constitution: Skip constitution generation phase

Role & Context

You are orchestrating a multi-agent analysis pipeline with three specialized agents:

  1. Discovery Agent: Scans each sub-system for raw patterns
  2. Pattern Agent: Classifies and scores patterns for reusability
  3. Synthesis Agent: Performs cross-sub-system analysis and generates CDRs

Brownfield vs Greenfield

ScenarioCommandInputOutput
Brownfield (existing code)/levelup-initCodebase scanDiscovered CDRs
Greenfield (feature complete)/levelup-specifyFeature artifactsProposed CDRs

Cross-Sub-System Analysis

The Synthesis Agent detects:

Pattern TypeCriteriaAction
Cross-cuttingPattern in ≥50% of sub-systemsHigh-priority CDR
InconsistentSame concern, different implementationsInconsistency CDR
Project-specificOnly in 1 sub-system, low reuseLower priority or skip
GapHigh value, not in team-directivesRecommended CDR

Outline

  1. Validate Environment (Phase 1): Ensure team-ai-directives is configured
  2. Sub-System Detection (Phase 2): Identify sub-systems from code structure
  3. Environment Setup (Phase 3): Resolve paths and initialize state
  4. Load Team Directives (Phase 4): Read existing TD for comparison
  5. Discovery Agent (Phase 5): Scan each sub-system for patterns
  6. Pattern Agent (Phase 6): Classify and score patterns per sub-system
  7. Synthesis Agent (Phase 7): Cross-sub-system analysis
  8. Constitution Generation (Phase 8): Generate/enhance constitution CDR
  9. CDR Generation (Phase 9): Generate final CDRs as individual files
  10. Output (Phase 10): Regenerate cdr.md index and present summary

Execution Steps

Phase 1: Validate Environment

Run the setup script from repository root:

scripts/bash/setup-levelup-init.sh

Parse the JSON output for REPO_ROOT, CDR_DRAFTS_DIR, TEAM_AI_DIRECTIVES, NEXT_CDR, etc.

If the setup script is unavailable or fails, resolve manually:

  1. REPO_ROOT — walk up from cwd to find .adlc/, or git rev-parse --show-toplevel, or pwd.
  2. TEAM_AI_DIRECTIVES — TEAM_AI_DIRECTIVES env var, then .adlc/init-options.json → team_ai_directives, then REPO_ROOT/team-ai-directives.
  3. CDR_DRAFTS_DIR — REPO_ROOT/.adlc/drafts/cdr
  4. NEXT_CDR — list CDR_DRAFTS_DIR/CDR-*.md, find highest number, increment, zero-pad to 3 digits.

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

Ph

阅读完整来源 ↗