agentleFS
team-attentionteam-attention/hoyeon/skills/compound/SKILL.md

compound

Skill173 starsChanged 8 months agoMITView on GitHub

This skill should be used when the user says "/compound", "compound this", "document learnings", "save what we learned", or after completing a PR. Extracts knowledge from PR context and saves to docs/learnings/.

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use PR number if provided as argument

    line 26
  2. Distinctive:

    If no context files exist AND no PR comments → Notify user and request manual input

    line 51
  3. Very specific:

    Check for duplicates: Search docs/learnings/

    line 94
  4. Distinctive:

    Read template and substitute placeholders

    line 111
  5. Distinctive:

    Add new document link to Related section of existing documents

    line 121

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Compound Skill

Extracts knowledge from PR context and saves structured documentation to docs/learnings/.

Workflow

Phase 1: Context Collection

  1. Identify PR number/branch
    • Use PR number if provided as argument
    • Otherwise, find PR from current branch: gh pr view --json number,body,title
    • If no PR exists: Prompt user to enter PR number directly or confirm proceeding without PR
  2. Extract Plan path
    • Find Plan path pattern in PR body: .hoyeon/specs/{name}/PLAN.md
    • Regex: \.hoyeon/specs/[^/]+/PLAN\.md
    • If no Plan path found: Prompt user to enter spec name directly or select from .hoyeon/specs/ directory listing
  3. Derive Context path
    • Extract spec name from Plan path
    • Context directory: .hoyeon/specs/{name}/context/
  4. Parallel collection (run following commands simultaneously, skip if files don't exist)
    # Context files (treat as empty if not found)
    cat .hoyeon/specs/{name}/context/learnings.json 2>/dev/null || echo ""
    cat .hoyeon/specs/{name}/context/decisions.md 2>/dev/null || echo ""
    cat .hoyeon/specs/{name}/context/issues.json 2>/dev/null || echo ""
    
    # PR comments and reviews (collect as JSON for stability)
    gh pr view {pr_number} --json comments,reviews

Error Handling:

  • If no context files exist AND no PR comments → Notify user and request manual input
  • At least 1 source required to proceed with document generation

Phase 2: Knowledge Extraction & Classification

2.1 Extract Valuable Feedback from PR Comments

Criteria for valuable feedback:

  • Code improvement suggestions
  • Bug/issue identification
  • Pattern/best practice mentions
  • "This would be better" type advice
  • Comments left with approval

Filter out:

  • Simple questions ("What is this?")
  • Confirmation requests ("Is this correct?")
  • Approval-only comments ("LGTM", "Approved")
  • Bot comments

Extraction keywords:

  • "suggest", "recommend", "better", "instead"
  • "pattern", "practice", "convention"
  • "issue", "bug", "fix"
  • "learned", "TIL", "note"

Extracted information:

  • author
  • body
  • file_path (if inline comment)
  • created_at

2.2 Analyze Context Files

FilePurpose
learnings.jsonStructured learnings
decisions.mdDecision rationale
issues.jsonStructured issues

2.3 Synthesize

  1. Assess documentation value from collected sources
  2. Check for duplicates: Search docs/learnings/
  3. Classify problem type - Refer to references/problem-types.md (relative to this skill directory)
  4. Generate tags

Phase 3: Document Generation

  1. Generate YAML frontmatter
    pr_number: {PR_NUMBER}
    date: {YYYY-MM-DD}
    problem_type: {TYPE}
    tags: [{TAGS}]
    plan_path: {PLAN_PATH}
  2. Write document using template
    • Template location: templates/LEARNING_TEMPLATE.md (relative to this skill directory)
    • Read template and substitute placeholders
  3. Determine filename
    • Format: {YYYY-MM-DD}-{short-title}.md
    • Example: 2024-01-15-api-error-handling.md
  4. Save
    • Path: docs/learnings/{filename}.md
  5. Add cross-references (if related documents exist)
    • Add new document link to Related section of existing documents

Usage Examples

# Specify PR number
/compound 123

# Use PR from current branch
/compound

Output

Outputs the created document path and summary:

Created: docs/learnings/2024-01-15-api-error-handling.md

Summary:
- Problem Type: error-handling
- Tags: api, typescript, validation
- Sources: learnings.json, 2 PR comments

<!-- TODO: Future extensions --><!-- - [ ] Session ID based user feedback collection --><!-- - [ ] CLAUDE.md auto-update suggestions --><!-- - [ ] Detect existing document UPDATEs --><!-- - [ ] Auto-categorization by problem_type (docs/solutions/{type}/) -->

Download now (ZIP)

  • Other versions17 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 17

    1. m-xlsea/ruoyi-plus-soybean★ 328same name
    2. garagon/nanostack★ 206same name
    3. ai-native-camp/camp-2★ 19same name
    4. rcelebrone/DotAgents★ 15same name
    5. minhtran3124/agent-harness★ 9same name
    6. Andamio-Platform/coach★ 6same name
    7. chrislacey89/skills★ 3same name
    8. toverux/cantrips★ 3same name
    9. Artifacts7/newsletter-context-kit★ 2same name
    10. dirkkok101/skills★ 2same name

    7 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use brainstorm, ship and 3 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • nicodianskSkill

      brainstorm

      Use when starting creative work - creating features, building components, adding functionality, or modifying behavior. Explores requirements through Socratic dialogue before any implementation.

      Also in 3 projects that use this

    • AWSSkill

      ship

      Finalize dev work on an issue branch — update docs, push, and open a PR.

      Also in 3 projects that use this

    • NVIDIASkill

      research

      Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.

      Also in 3 projects that use this

    • GoogleSkill

      tdd

      Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

      Also in 3 projects that use this

    • MicrosoftSkill

      handoff

      Compact the current conversation into a handoff document for another agent to pick up.

      Also in 3 projects that use this

  • In this repository27 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.