Metal

From pjt222/agent-almanac · View interactive version

Metal is an AI agent skill from the GitHub repository pjt222/agent-almanac. Extract the conceptual essence of a repository as skills, agents, and teams — the project's roles, procedures, and coordination patterns expressed as agentskills.io-standard definitions. Reads an arbitrary codebase and produces generalized definitions that capture WHAT the project does and WHO opera

How to use this skill

Skill file

Metal

Extract the conceptual DNA of a repository — its roles, procedures, and coordination patterns — as generalized agentskills.io definitions. Like extracting noble metal from ore, the skill separates what a project IS (its essence) from what it DOES (its implementation), producing reusable skill, agent, and team definitions that capture the project's organizational genome without reproducing its codebase.

When to Use

Inputs

The Ore Test

The central quality criterion for all extraction:

Could this concept exist in a completely different implementation?

If YES — it is metal (essence). Extract it.

If NO — it is gangue (implementation detail). Leave it behind.

Example: A weather app's concept "integrate external data source" is metal — it applies to any project fetching third-party data. But "parse OpenWeatherMap v3 JSON response" is gangue — it is specific to one API.

Extracted skills should describe the CLASS of task, not the specific instance. Extracted agents should describe the ROLE, not the person. Extracted teams should describe the COORDINATION PATTERN, not the org chart.

Procedure

Step 1: Prospect — Survey the Ore Body

Survey the repository structure without judgment. Map the terrain before mining.

  1. Glob the directory tree to understand the project's shape:
  1. Read the project's self-description (README, package manifest) to understand its declared purpose
  2. Count files by type/language to gauge scope and identify the primary technology
  3. Identify the project's boundary — where it begins and ends, what it depends on vs what it provides
  4. Produce the Prospect Report:
Project: [name]
Declared Purpose: [from README/manifest]
Languages: [primary, secondary]
Size: [file count, approx LOC]
Shape: [monorepo/library/app/framework/docs]
External Surface: [CLI/API/UI/library exports/none]

Got: A factual survey — what is here, how large, what does the project claim to be. No classification or judgment yet. The report reads like a geological survey, not a review.

If fail: If the repository has no README or manifest, infer purpose from directory names, file contents, and test descriptions. If the project is too large (>1000 source files), narrow the scope to the most active directories (use git log frequency or README references).

Step 2: Assay — Analyze the Composition

Read representative files to understand what the project DOES at the conceptual level.

  1. Sample 5-10 representative files from different areas of the project — diverse, not exhaustive:
  1. For each sampled area, identify:
  1. For each finding, classify as:
  1. Produce the Assay Report: a table of domains, verbs, roles, and flows with essential/accidental tags

Got: A conceptual map of the project that reads like a domain glossary, not a code walkthrough. Someone unfamiliar with the tech stack should understand what the project does from this report.

If fail: If the codebase is opaque (heavy metaprogramming, generated code, or obfuscated), lean on tests and documentation rather than source code. If no tests exist, read commit messages for intent.

Step 3: Meditate — Release Implementation Bias

Pause to clear the cognitive anchoring from reading code.

  1. Notice which framework, language, or architectural pattern is dominating your mental model — label it
  2. Release attachment to the HOW: "This project uses React" becomes "This project has a user interface layer." "This uses PostgreSQL" becomes "This has persistent structured storage."
  3. For each finding in the Assay Report, apply the Ore Test:
  1. Rewrite any findings that failed the Ore Test at a higher abstraction level
  2. If multiple perspectives help, consider the project through these lenses:

Got: The Assay Report is now free of framework-specific language. Every finding passes the Ore Test. The concepts feel portable — they could apply to a project in any language or framework.

If fail: If bias persists (findings keep referencing specific technologies), try inverting: "If this project were rewritten in a completely different stack, which concepts would survive?" Only those are metal.

Step 4: Smelt — Separate Metal from Slag

The core extraction step. Classify each essential concept into skills, agents, or teams.

  1. For each essential concept from the purified Assay Report, determine its type:
Classification Criteria:
+--------+----------------------------+----------------------------+----------------------------+
| Type   | What to Look For           | Naming Convention          | Test Question              |
+--------+----------------------------+----------------------------+----------------------------+
| SKILL  | Repeatable procedures,     | Verb-first kebab-case:     | "Could an agent follow     |
|        | workflows, transformations | validate-input,            | this as a step-by-step     |
|        | with clear inputs/outputs  | deploy-artifact            | procedure?"                |
+--------+----------------------------+----------------------------+----------------------------+
| AGENT  | Persistent roles, domain   | Noun/role kebab-case:      | "Does this require ongoing |
|        | expertise, judgment calls, | data-engineer,             | context, expertise, or a   |
|        | communication styles       | quality-reviewer           | specific communication     |
|        |                            |                            | style?"                    |
+--------+----------------------------+----------------------------+----------------------------+
| TEAM   | Multi-role coordination,   | Group descriptor:          | "Does this need more than  |
|        | handoffs, reviews,         | pipeline-ops,              | one distinct perspective   |
|        | parallel workstreams       | review-board               | to accomplish?"            |
+--------+----------------------------+----------------------------+----------------------------+
  1. For each extracted element:
  1. Guard against common classification errors:

Got: A classified inventory where each item has a type (skill/agent/team), a generalized name, and a one-line description. No item references the source project's specific technologies, APIs, or data structures.

If fail: If classification is ambiguous (is this a skill or an agent?), ask: "Is this about DOING something (skill) or BEING someone who does things (agent)?" A skill is a recipe; an agent is a chef. If still unclear, default to skill — skills are easier to compose later.

Step 5: Heal — Verify Extraction Quality

Assess whether the extraction is honest — neither too much nor too little.

  1. Over-extraction check: Read each extracted definition and ask:
  1. Under-extraction check: Show only the extracted definitions (without the source project) and ask:
  1. Generalization check: For each definition:
  1. Balance check: Review the extraction ratios:

Got: Confidence that the extraction is at the right level of abstraction. Each definition is a seed that could grow in different soil, not a cutting that survives only in the original garden.

If fail: If over-extracted, raise the abstraction level — merge specific skills into broader ones, collapse similar agents into a single role. If under-extracted, return to Step 2 and sample additional files. If generalization check fails, strip technology references and rewrite descriptions.

Step 6: Cast — Pour the Metal into Forms

Produce the agentskills.io-standard output documents.

  1. For each extracted skill, write a skeletal definition:
# Skill: [generalized-name]
name: [generalized-name]
description: [one-line, framework-agnostic]
domain: [closest domain from the 52 existing domains, or suggest a new one]
complexity: [basic/intermediate/advanced]
# Concept-level procedure (3-5 steps, NOT full implementation):
# Step 1: [high-level action]
# Step 2: [high-level action]
# Step 3: [high-level action]
# Derived from: [source concept in original project]
  1. For each extracted agent, write a skeletal definition:
# Agent: [role-name]
name: [role-name]
description: [one-line purpose]
tools: [minimal tool set needed]
skills: [list of extracted skills this agent would carry]
# Derived from: [source role/module in original project]
  1. For each extracted team, write a skeletal definition:
# Team: [group-name]
name: [group-name]
description: [one-line purpose]
lead: [lead agent from extracted agents]
members: [list of member agents]
coordination: [hub-and-spoke/sequential/parallel/adaptive]
# Derived from: [source workflow/process in original project]
  1. Compile all extractions into the Assay Report — a single document with sections for Skills, Agents, and Teams, plus a summary table

Got: A structured report containing all extracted definitions in agentskills.io format. Each definition is skeletal (concept-level, not implementation-level) and could serve as a starting point for the create-skill, create-agent, or create-team skills to flesh out.

If fail: If the output exceeds 15 items, prioritize by centrality — keep the concepts that are most unique to this project's domain. Generic concepts (like "manage-configuration") that exist in most projects should be dropped unless they have an unusual twist.

Step 7: Temper — Final Validation

Verify the complete extraction and produce the summary.

  1. Count the extractions: N skills, N agents, N teams
  2. Assess coverage: do they span the project's major domains?
  3. Verify independence: read each definition WITHOUT the source project context — does it stand alone?
  4. Run the Ore Test one final time on the complete set:
Temper Assessment:
+-----+---------------------------+----------+------------------------------------+
| #   | Name                      | Type     | Ore Test Result                    |
+-----+---------------------------+----------+------------------------------------+
| 1   | [name]                    | skill    | PASS / FAIL (reason)               |
| 2   | [name]                    | agent    | PASS / FAIL (reason)               |
| ... | ...                       | ...      | ...                                |
+-----+---------------------------+----------+------------------------------------+
  1. Produce the final summary:

Got: A validated Assay Report with a summary table, confidence assessment, and actionable next steps. The report is self-contained — someone who has never seen the source project can read it and understand the extracted concepts.

If fail: If more than 20% of items fail the final Ore Test, return to Step 4 (Smelt) and re-extract at a higher abstraction level. If coverage is below 60% of identified domains, return to Step 2 (Assay) and sample additional files.

Validation Checklist

Pitfalls

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.