Agent-Native Product Transform
ROLE: AG is the transformation orchestrator. AG dispatches Scout (assessment),
Transformer (generation), and Auditor (verification) subagents via task-delegate.
AG does NOT generate project files itself — all generation is done by subagents.
[!IMPORTANT]
This skill transforms a project's agent-facing interface — API design, documentation,
environment abstraction, observability. It does NOT modify application logic or
development process infrastructure. For dev-process changes, use agent-native-devflow.
When to Trigger
- User says "让 agent 更好用这个 SDK"、"改造 API"、"agent-friendly"
- User wants to improve API/CLI usability for LLM agents
- User wants to generate AGENTS.md / CLAUDE.md for an existing project
- After
deep-analysis reveals product-layer gaps (A2-A5)
Maturity Model
| Level |
Name |
Signature |
| L0 |
Absent |
No agent-facing docs, no structured output, no health check |
| L1 |
Ad-hoc |
README exists, CLI has some --help, basic logging |
| L2 |
Structured |
CLAUDE.md + AGENTS.md, consistent CLI, structured errors, health check |
| L3 |
Enforced |
Executable doc-tests, --json on all commands, discovery API, error catalog |
A1 (Conceptual Model) is a prerequisite. If the underlying conceptual model has
poor orthogonality, incomplete abstractions, or missing convenience layers, then
agent-native docs and tooling built on top will be fragile. Use concept-model-review
skill for deep A1 assessment; results feed into this skill's ASSESS phase.
Dimensions
| ID |
Dimension |
What It Means |
Prerequisite? |
| A1 |
Conceptual Model |
Completeness, orthogonality, layering, opening path |
Yes — use concept-model-review |
| A2 |
API Surface |
CLI/API consistency, structured output, error design |
Depends on A1 |
| A3 |
Environment Abstraction |
Portability, setup automation, env detection |
No |
| A4 |
Observability |
Health checks, discovery APIs, structured logging |
No |
| A5 |
Documentation |
CLAUDE.md, AGENTS.md, anti-patterns, executable doc-tests |
Depends on A1 |
| A6 |
Agent Trial (optional) |
End-to-end agent walkthrough, friction log collection |
No |
[!TIP]
A1 assessement is handled by concept-model-review skill (DISCOVER → EVALUATE → PATH DESIGN).
Its output (concept_map.md + evaluation + opening path) feeds directly into this skill's
Phase 1 ASSESS as pre-existing context. If concept-model-review was already run, Scout
can skip A1 and use its output.
[!NOTE]
A6 is optional. Include it when: (1) the project has a runnable workflow,
(2) you want to catch runtime-only issues that static assessment misses.
Smoke tests on quant_trading showed the most severe bugs (ZeroDivisionError,
wrong column names, EOD state traps) were invisible to code reading.
Prompt Files
All subagent prompts live in prompts/. AG reads the template, fills {{PLACEHOLDERS}},
and passes the result to task-delegate.
| File |
Used By |
Placeholders |
scout.txt |
Phase 1 Scout |
PROJECT_PATH, LANGUAGE, AGENT_TRIAL_SECTION, OUTPUT_PATH |
scout_a6_agent_trial.txt |
Injected into Scout when A6 enabled |
(none — paste as-is into AGENT_TRIAL_SECTION) |
transform_a1_api_quality.txt |
Phase 2 A1 Transformer |
PROJECT_PATH, LANGUAGE, ENTRY_POINT, A1_ASSESSMENT, OUTPUT_PATH |
transform_a5_docs.txt |
Phase 2 A5 Transformer |
PROJECT_PATH, LANGUAGE, BUILD_SYSTEM, A5_ASSESSMENT, LINE_LIMIT, OUTPUT_PATH |
transform_a2_api.txt |
Phase 2 A2 Transformer |
PROJECT_PATH, ENTRY_POINT, A2_ASSESSMENT, OUTPUT_PATH |
transform_a4_observability.txt |
Phase 2 A4 Transformer |
PROJECT_PATH, A4_ASSESSMENT, OUTPUT_PATH |
auditor.txt |
Phase 3 Auditor |
(no placeholders — auditor uses project's own docs) |
friction_log_template.txt |
Referenced by Scout A6 + Auditor |
(template only — not a prompt) |
3-Phase Workflow
ASSESS (Scout) → [user ✓] → TRANSFORM (per-dim) → [user ✓] → AUDIT (独立验证)
Phase 1: ASSESS
- AG detects project metadata: language, build system, entry points
- AG prepares Scout prompt from
prompts/scout.txt:
- Fill
{{PROJECT_PATH}}, {{LANGUAGE}}, {{OUTPUT_PATH}}
- If A6 enabled: read
prompts/scout_a6_agent_trial.txt and inject into {{AGENT_TRIAL_SECTION}}
- If A6 disabled: replace
{{AGENT_TRIAL_SECTION}} with empty string
- AG dispatches Scout via task-delegate (read-only assessment)
- AG reads Scout output → writes
maturity_report.md (L0-L3 per dimension)
- ✅ USER CHECKPOINT: present maturity scores, ask which dimensions to transform
TRANSFORM_ID="{YYYYMMDD_HHMM}_{project_name}"
TRANSFORM_DIR="${HOME}/.agent-native-transform/${TRANSFORM_ID}/product"
mkdir -p "${TRANSFORM_DIR}/assess"
# AG reads prompts/scout.txt, fills placeholders, writes to task dir
# Launch via task-delegate
bash ~/agent-skills/task-delegate/scripts/task_launch.sh \
${TRANSFORM_ID}_scout ${PROJECT_DIR} --backend cc
Phase 2: TRANSFORM
AG processes selected dimensions. Recommended order: A1 first (API quality is foundation),
then A5 (docs), A2 (surface), A4 (observability), A3 (environment).
Per dimension, AG:
- Reads the dimension-specific prompt from
prompts/transform_{dim}.txt
- Fills placeholders with project context + assessment findings
- Dispatches Transformer via task-delegate
- Reads output, verifies generated files
- ✅ USER CHECKPOINT per dimension
Phase 3: AUDIT
Executor ≠ Verifier: Auditor runs on a DIFFERENT backend than Transformer.
AG reads prompts/auditor.txt and dispatches the Auditor. The auditor prompt has
expanded checks that align with A5 mandatory documentation items and A6 Agent Trial.
Friction Log Standard
[!TIP]
The standard friction log format is defined in prompts/friction_log_template.txt.
It is used by Scout (A6 sub-task) and Auditor (A6 audit). AG should also use this
format when documenting friction from any manual testing.
Severity classification:
- 🔴 Blocker: Crashes, data loss, cannot proceed
- 🟡 Misleading: Docs say X but reality is Y
- 🟢 Missing: Feature absent, user writes boilerplate
- ⚪ Friction: Works but confusing or surprising
Mandatory Rules
- ASSESS before TRANSFORM — no generation without understanding current state
- User checkpoint after ASSESS — user selects dimensions + targets
- User checkpoint after each TRANSFORM batch — user reviews generated files
- Executor ≠ Verifier — Auditor on different backend than Transformer
- No fabrication — if no real failures exist, use
<!-- TODO: Add after real incidents -->
- Verify all references — every path/command in generated docs must actually exist
- CLAUDE.md length limit — ≤40 lines simple project, ≤80 lines complex
- Prompts in files — all subagent prompts live in
prompts/, not inline in SKILL.md
Anti-Patterns
❌ AG generates CLAUDE.md directly instead of dispatching subagent
→ AG is orchestrator. All file generation goes through task-delegate
❌ Fabricating anti-patterns or troubleshooting entries
→ Empty honesty > fabricated completeness. Use <!-- TODO --> markers
❌ Single monolithic "transform everything" prompt
→ Each dimension gets its own focused prompt file
❌ Transformer and Auditor are the same subagent session
→ Violates Executor ≠ Verifier. Auditor must have fresh eyes
❌ Listing commands in CLAUDE.md without verifying they work
→ Every command must be tested with command -v or --help
❌ Generating 200-line CLAUDE.md for a 10-file project
→ Match doc size to project complexity. Overgeneration breeds staleness
❌ Skipping ASSESS and jumping to TRANSFORM
→ Without baseline, can't measure improvement or set targets
❌ Inlining prompts in SKILL.md instead of using prompts/ files
→ Prompts are versioned separately, easier to iterate
❌ Skipping A6 Agent Trial when user opted in, reporting only static assessment
→ Static reading misses runtime-only bugs (ZeroDivisionError, state traps, wrong column names)
Troubleshooting
| Problem |
Fix |
| Scout can't find CLI entry point |
Specify in prompt: --entry playground or --entry python -m pkg |
| Generated CLAUDE.md references wrong paths |
Re-run with --verify flag — Transformer must ls every path |
| Auditor scores lower than Transformer claimed |
This is EXPECTED. Fix the gaps, don't argue with the auditor |
| Project has no CLI (library only) |
Skip A2. Focus on A5 (documentation) and A4 (discovery API) |
| Doc-test verify directives fail |
Either command changed or was wrong. Update CLAUDE.md |
| AGENTS.md conflicts with CLAUDE.md |
AGENTS.md is cross-tool source of truth. CLAUDE.md adds Claude-specific info only |
| A6 Agent Trial takes too long |
Set a time/friction-count cap in Scout prompt. Stop at 10 friction points |
Composability
| Combination |
Description |
| deep-analysis → agent-native-product |
system_map.md feeds Phase 1 ASSESS |
| agent-native-product → agent-native-devflow |
Product docs inform dev process setup |
| agent-native-product (audit only) |
Re-run Phase 3 periodically to detect drift |
| sdk-audit → agent-native-product |
Existing audit findings feed ASSESS |
| smoke-test → agent-native-product |
Friction log from external test feeds ASSESS + TRANSFORM |
1---2name: agent-native-product3description: Transform an SDK/CLI/API project's interface to be agent-friendly. Assess maturity, generate documentation, audit quality. Trigger: 'agent化改造', 'make API agent-friendly', 'improve agent usability'.4---56# Agent-Native Product Transform78> **ROLE**: AG is the **transformation orchestrator**. AG dispatches Scout (assessment),9> Transformer (generation), and Auditor (verification) subagents via task-delegate.10> AG does NOT generate project files itself — all generation is done by subagents.1112> [!IMPORTANT]13> This skill transforms a project's **agent-facing interface** — API design, documentation,14> environment abstraction, observability. It does NOT modify application logic or15> development process infrastructure. For dev-process changes, use `agent-native-devflow`.1617## When to Trigger1819- User says "让 agent 更好用这个 SDK"、"改造 API"、"agent-friendly"20- User wants to improve API/CLI usability for LLM agents21- User wants to generate AGENTS.md / CLAUDE.md for an existing project22- After `deep-analysis` reveals product-layer gaps (A2-A5)2324## Maturity Model2526| Level | Name | Signature |27|-------|------|-----------|28| **L0** | Absent | No agent-facing docs, no structured output, no health check |29| **L1** | Ad-hoc | README exists, CLI has some --help, basic logging |30| **L2** | Structured | CLAUDE.md + AGENTS.md, consistent CLI, structured errors, health check |31| **L3** | Enforced | Executable doc-tests, --json on all commands, discovery API, error catalog |3233> **A1 (Conceptual Model) is a prerequisite.** If the underlying conceptual model has34> poor orthogonality, incomplete abstractions, or missing convenience layers, then35> agent-native docs and tooling built on top will be fragile. Use `concept-model-review`36> skill for deep A1 assessment; results feed into this skill's ASSESS phase.3738## Dimensions3940| ID | Dimension | What It Means | Prerequisite? |41|----|-----------|---------------|---------------|42| A1 | **Conceptual Model** | Completeness, orthogonality, layering, opening path | **Yes — use `concept-model-review`** |43| A2 | **API Surface** | CLI/API consistency, structured output, error design | Depends on A1 |44| A3 | **Environment Abstraction** | Portability, setup automation, env detection | No |45| A4 | **Observability** | Health checks, discovery APIs, structured logging | No |46| A5 | **Documentation** | CLAUDE.md, AGENTS.md, anti-patterns, executable doc-tests | Depends on A1 |47| A6 | **Agent Trial** _(optional)_ | End-to-end agent walkthrough, friction log collection | No |4849> [!TIP]50> A1 assessement is handled by `concept-model-review` skill (DISCOVER → EVALUATE → PATH DESIGN).51> Its output (`concept_map.md` + evaluation + opening path) feeds directly into this skill's52> Phase 1 ASSESS as pre-existing context. If concept-model-review was already run, Scout53> can skip A1 and use its output.5455> [!NOTE]56> **A6 is optional.** Include it when: (1) the project has a runnable workflow,57> (2) you want to catch runtime-only issues that static assessment misses.58> Smoke tests on quant_trading showed the most severe bugs (ZeroDivisionError,59> wrong column names, EOD state traps) were invisible to code reading.6061## Prompt Files6263All subagent prompts live in `prompts/`. AG reads the template, fills `{{PLACEHOLDERS}}`,64and passes the result to task-delegate.6566| File | Used By | Placeholders |67|------|---------|-------------|68| `scout.txt` | Phase 1 Scout | `PROJECT_PATH`, `LANGUAGE`, `AGENT_TRIAL_SECTION`, `OUTPUT_PATH` |69| `scout_a6_agent_trial.txt` | Injected into Scout when A6 enabled | _(none — paste as-is into `AGENT_TRIAL_SECTION`)_ |70| `transform_a1_api_quality.txt` | Phase 2 A1 Transformer | `PROJECT_PATH`, `LANGUAGE`, `ENTRY_POINT`, `A1_ASSESSMENT`, `OUTPUT_PATH` |71| `transform_a5_docs.txt` | Phase 2 A5 Transformer | `PROJECT_PATH`, `LANGUAGE`, `BUILD_SYSTEM`, `A5_ASSESSMENT`, `LINE_LIMIT`, `OUTPUT_PATH` |72| `transform_a2_api.txt` | Phase 2 A2 Transformer | `PROJECT_PATH`, `ENTRY_POINT`, `A2_ASSESSMENT`, `OUTPUT_PATH` |73| `transform_a4_observability.txt` | Phase 2 A4 Transformer | `PROJECT_PATH`, `A4_ASSESSMENT`, `OUTPUT_PATH` |74| `auditor.txt` | Phase 3 Auditor | _(no placeholders — auditor uses project's own docs)_ |75| `friction_log_template.txt` | Referenced by Scout A6 + Auditor | _(template only — not a prompt)_ |7677## 3-Phase Workflow7879```80ASSESS (Scout) → [user ✓] → TRANSFORM (per-dim) → [user ✓] → AUDIT (独立验证)81```8283### Phase 1: ASSESS84851. AG detects project metadata: language, build system, entry points862. AG prepares Scout prompt from `prompts/scout.txt`:87 - Fill `{{PROJECT_PATH}}`, `{{LANGUAGE}}`, `{{OUTPUT_PATH}}`88 - If A6 enabled: read `prompts/scout_a6_agent_trial.txt` and inject into `{{AGENT_TRIAL_SECTION}}`89 - If A6 disabled: replace `{{AGENT_TRIAL_SECTION}}` with empty string903. AG dispatches **Scout** via task-delegate (read-only assessment)914. AG reads Scout output → writes `maturity_report.md` (L0-L3 per dimension)925. **✅ USER CHECKPOINT**: present maturity scores, ask which dimensions to transform9394```bash95TRANSFORM_ID="{YYYYMMDD_HHMM}_{project_name}"96TRANSFORM_DIR="${HOME}/.agent-native-transform/${TRANSFORM_ID}/product"97mkdir -p "${TRANSFORM_DIR}/assess"9899# AG reads prompts/scout.txt, fills placeholders, writes to task dir100# Launch via task-delegate101bash ~/agent-skills/task-delegate/scripts/task_launch.sh \102 ${TRANSFORM_ID}_scout ${PROJECT_DIR} --backend cc103```104105### Phase 2: TRANSFORM106107AG processes selected dimensions. Recommended order: **A1 first** (API quality is foundation),108then A5 (docs), A2 (surface), A4 (observability), A3 (environment).109110Per dimension, AG:1111. Reads the dimension-specific prompt from `prompts/transform_{dim}.txt`1122. Fills placeholders with project context + assessment findings1133. Dispatches Transformer via task-delegate1144. Reads output, verifies generated files1155. **✅ USER CHECKPOINT** per dimension116117### Phase 3: AUDIT118119**Executor ≠ Verifier**: Auditor runs on a DIFFERENT backend than Transformer.120121AG reads `prompts/auditor.txt` and dispatches the Auditor. The auditor prompt has122expanded checks that align with A5 mandatory documentation items and A6 Agent Trial.123124## Friction Log Standard125126> [!TIP]127> The standard friction log format is defined in `prompts/friction_log_template.txt`.128> It is used by Scout (A6 sub-task) and Auditor (A6 audit). AG should also use this129> format when documenting friction from any manual testing.130131Severity classification:132- 🔴 **Blocker**: Crashes, data loss, cannot proceed133- 🟡 **Misleading**: Docs say X but reality is Y134- 🟢 **Missing**: Feature absent, user writes boilerplate135- ⚪ **Friction**: Works but confusing or surprising136137## Mandatory Rules1381391. **ASSESS before TRANSFORM** — no generation without understanding current state1402. **User checkpoint after ASSESS** — user selects dimensions + targets1413. **User checkpoint after each TRANSFORM batch** — user reviews generated files1424. **Executor ≠ Verifier** — Auditor on different backend than Transformer1435. **No fabrication** — if no real failures exist, use `<!-- TODO: Add after real incidents -->`1446. **Verify all references** — every path/command in generated docs must actually exist1457. **CLAUDE.md length limit** — ≤40 lines simple project, ≤80 lines complex1468. **Prompts in files** — all subagent prompts live in `prompts/`, not inline in SKILL.md147148## Anti-Patterns149150```151❌ AG generates CLAUDE.md directly instead of dispatching subagent152 → AG is orchestrator. All file generation goes through task-delegate153154❌ Fabricating anti-patterns or troubleshooting entries155 → Empty honesty > fabricated completeness. Use <!-- TODO --> markers156157❌ Single monolithic "transform everything" prompt158 → Each dimension gets its own focused prompt file159160❌ Transformer and Auditor are the same subagent session161 → Violates Executor ≠ Verifier. Auditor must have fresh eyes162163❌ Listing commands in CLAUDE.md without verifying they work164 → Every command must be tested with command -v or --help165166❌ Generating 200-line CLAUDE.md for a 10-file project167 → Match doc size to project complexity. Overgeneration breeds staleness168169❌ Skipping ASSESS and jumping to TRANSFORM170 → Without baseline, can't measure improvement or set targets171172❌ Inlining prompts in SKILL.md instead of using prompts/ files173 → Prompts are versioned separately, easier to iterate174175❌ Skipping A6 Agent Trial when user opted in, reporting only static assessment176 → Static reading misses runtime-only bugs (ZeroDivisionError, state traps, wrong column names)177```178179## Troubleshooting180181| Problem | Fix |182|---------|-----|183| Scout can't find CLI entry point | Specify in prompt: `--entry playground` or `--entry python -m pkg` |184| Generated CLAUDE.md references wrong paths | Re-run with `--verify` flag — Transformer must `ls` every path |185| Auditor scores lower than Transformer claimed | This is EXPECTED. Fix the gaps, don't argue with the auditor |186| Project has no CLI (library only) | Skip A2. Focus on A5 (documentation) and A4 (discovery API) |187| Doc-test verify directives fail | Either command changed or was wrong. Update CLAUDE.md |188| AGENTS.md conflicts with CLAUDE.md | AGENTS.md is cross-tool source of truth. CLAUDE.md adds Claude-specific info only |189| A6 Agent Trial takes too long | Set a time/friction-count cap in Scout prompt. Stop at 10 friction points |190191## Composability192193| Combination | Description |194|-------------|-------------|195| deep-analysis → agent-native-product | system_map.md feeds Phase 1 ASSESS |196| agent-native-product → agent-native-devflow | Product docs inform dev process setup |197| agent-native-product (audit only) | Re-run Phase 3 periodically to detect drift |198| sdk-audit → agent-native-product | Existing audit findings feed ASSESS |199| smoke-test → agent-native-product | Friction log from external test feeds ASSESS + TRANSFORM |