AGENT SKILL

prediction-market-oracle-research

Research prediction markets as data sources or oracle signals for products, agents, dashboards, and corporate decision intelligence. Use for source-grounded analysis of market-implied probabilities, caveats, and integration patterns without investment advice.

License 许可
Apache-2.0
最近更新
2026-11-08
Stars
★ 0
Forks
0

01 前言 Front Matter

name
be-plan
description
Analyze a finalized/reviewing planning-plugin functional spec for {feature} and produce a structured backend implementation plan (plan.json) that be-crud scaffolds from. Use when a planning-plugin spec exists and you need entity/command/query/endpoint mapping before scaffolding. If no spec exists for the feature, this skill stops and points to manual mode (`be-crud {EntityName} field:Type ...`) instead of guessing a plan.
allowed-tools
Read, Write, Glob, Grep, Agent, Bash
argument-hint
<feature-name>
user-invocable
true

03 SKILL.md 正文

Backend Implementation Plan

Analyze a functional specification (planning-plugin output) and produce a structured backend implementation plan (plan.json) that drives spec-aware scaffold generation and TDD implementation.

Instructions

Step 0: Validate Configuration

  1. Read .claude/backend-webflux-plugin.json
  2. If missing, tell the user to run /backend-webflux-plugin:be-init first and stop
  3. pluginRoot: the one line of ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/data/backend-webflux-plugin/pluginRoot (plugin CLAUDE.md § Configuration) — every templates/… path in this document is {pluginRoot}/templates/…, the plugin's own directory, not the project's; missing → stop: start a new session so the hook writes it.
  4. Read config.architecture — currently only cqrs is supported

Step 0.5: Detect Mode

Validate {feature} first: it must match ^[a-z0-9][a-z0-9-]*$ — it is spliced into docs/specs/{feature}/…, {workDocDir}/… and plan.json paths, and ../../other-area would read and write outside them. Reject and stop otherwise.

Auto-detection — check if docs/specs/{feature}/.progress/{feature}.json exists:

  • If not found:

    "No planning-plugin specification found for '{feature}'." "Options:" "1. Create specification first: /planning-plugin:pp-spec {feature}" "2. Use manual mode: /backend-webflux-plugin:be-crud {EntityName} field:Type ..."

    • Stop here.
  • If found: proceed to Step 1

Step 1: Validate Spec

  1. Read docs/specs/{feature}/.progress/{feature}.json

  2. Check status:

    • "reviewing" or "finalized" → proceed
    • If status is "reviewing":

      "The specification is in 'reviewing' status — unresolved review issues may exist." "For the most accurate plan, finalize first: /planning-plugin:pp-review {feature}" "Continue with current spec?"

      • If the user declines, stop here.
    • "drafting" or "analyzing" →

      "The functional specification is not yet complete (status: {status})." "Please finish writing the specification, then try again."

      • Stop here.
  3. Read two language settings:

    • specLanguage: extract workingLanguage from the spec progress file (for locating spec markdown files in docs/specs/{feature}/{specLanguage}/)
    • workingLanguage: read from the backend plugin config (.claude/backend-webflux-plugin.json) for user-facing communication. This ensures consistent output language across all backend skills.
  4. Language name mapping: en = English, ko = Korean, vi = Vietnamese

Communication language: All user-facing output in this skill must be in {workingLanguage} (from backend config).

Step 2: Check UI DSL

  1. Check if docs/specs/{feature}/ui-dsl/manifest.json exists

    • exists → uiDslAvailable = true
    • not exists → uiDslAvailable = false
  2. If uiDslAvailable is false, display recommendation:

    "UI DSL is not available. The plan will be generated by inferring from the spec markdown." "For more accurate entity/field definitions, running /planning-plugin:pp-design {feature} is recommended."

Step 2.5: Check Existing Plan

  1. Check if docs/specs/{feature}/.implementation/backend/plan.json exists → existingPlanExists
  2. If existingPlanExists:

    "An existing backend plan was found (generated at {planGeneratedAt})." "Options:" "1. Regenerate — create a new plan from the current spec (overwrites existing plan)" "2. Cancel — keep the existing plan"

    • Present these options in conversation and wait for the user's reply — this is a plain conversational prompt, not a tool call (there is no AskUserQuestion in this skill's allowed-tools, unlike the explicit Agent(subagent_type: ...) invocation in Step 3).
    • If user chooses 2: stop here.
    • If user chooses 1: proceed (overwrite mode)
  3. If not existingPlanExists: proceed

Step 3: Launch Backend Planner Agent

Create the output directory if it doesn't exist:

docs/specs/{feature}/.implementation/backend/

Subagent Isolation: Pass only the specified parameters below. Do not include conversation history or user feedback from prior steps.

Launch the backend-planner agent (qualified below: backend-springboot-plugin ships an agent of the same name, and a bare name may resolve to it when both are installed) with:

Agent(subagent_type: "backend-webflux-plugin:backend-planner", prompt: "
  Analyze the functional specification for '{feature}' and produce a backend implementation plan.

  Parameters:
  - feature: {feature}
  - specDir: docs/specs/{feature}/{specLanguage}/
  - uiDslDir: docs/specs/{feature}/ui-dsl/ (available: {uiDslAvailable})
  - config: {serialized backend plugin config}
  - pluginRoot: {pluginRoot}
  - projectRoot: {cwd}
  - outputFile: docs/specs/{feature}/.implementation/backend/plan.json

  Follow the process defined in agents/backend-planner.md.
  Write the implementation plan to the outputFile path.
")

Step 4: Display Summary

  1. Read the generated docs/specs/{feature}/.implementation/backend/plan.json
    • If the file is missing, empty, or fails to parse as valid JSON, stop and report exactly: "Plan generation failed — plan.json not found or unreadable at docs/specs/{feature}/.implementation/backend/plan.json. Not verified: entity/command/query counts." Do not construct a summary from assumed or remembered values, and stop here without updating the spec progress file — an unwritten plan has no planGeneratedAt to record.
    • If the file parses but is missing required top-level fields (e.g. no entities, no summary), report exactly which fields are missing and stop for the same reason: a partial plan cannot be safely summarized or handed to be-crud.
  2. Display the summary in the working language, sourcing every count and name directly from the file just read — never from the agent's own chat output, which may have truncated or paraphrased:
Backend Implementation Plan for '{feature}':

  Source: docs/specs/{feature}/ (status: {specStatus}, UI DSL: {available/not available})
  Architecture: {config.architecture}

  Entities:       {count} ({entity names})
  Commands:       {count} ({command names})
  Queries:        {count} ({query names})
  API Endpoints:  {count}
  Exceptions:     {count}
  Test Scenarios: {count}

  Entity scaffold order: {entityDependencyOrder}
  Skipped screens: {skippedScreens count} (frontend-only)

  Plan saved to: docs/specs/{feature}/.implementation/backend/plan.json

  Next steps:
    1. Review the plan and edit if needed
    2. Run /backend-webflux-plugin:be-crud {EntityName} to scaffold from plan
       or  /backend-webflux-plugin:be-crud --all {feature} to scaffold all entities

Example

Walking one concrete feature through the "spec found" branch of Step 0.5 to a populated final summary:

Feature: employee-onboarding. Spec lives at docs/specs/employee-onboarding/en/.

  1. Step 0 — .claude/backend-webflux-plugin.json exists, architecture: "cqrs".

  2. Step 0.5 — docs/specs/employee-onboarding/.progress/employee-onboarding.json exists → proceed to Step 1 (skip the manual-mode message; that path only fires when this file is absent).

  3. Step 1 — status: "finalized" → proceed without confirmation. specLanguage: "en"; workingLanguage: "en" from the backend config.

  4. Step 2 — docs/specs/employee-onboarding/ui-dsl/manifest.json exists → uiDslAvailable = true; no recommendation shown.

  5. Step 2.5 — no existing plan.json for this feature → proceed directly, no options shown.

  6. Step 3 — launch backend-planner with feature: employee-onboarding, the paths above, and outputFile: docs/specs/employee-onboarding/.implementation/backend/plan.json.

  7. Step 4 — plan.json is present and parses; read it and display:

    Backend Implementation Plan for 'employee-onboarding':
    
      Source: docs/specs/employee-onboarding/ (status: finalized, UI DSL: available)
      Architecture: cqrs
    
      Entities:       1 (Employee)
      Commands:       1 (CreateEmployee)
      Queries:        2 (GetEmployeePage, FindEmployee)
      API Endpoints:  3
      Exceptions:     1 (DuplicateEmailException)
      Test Scenarios: 5
    
      Entity scaffold order: [Employee]
      Skipped screens: 1 (frontend-only)
    
      Plan saved to: docs/specs/employee-onboarding/.implementation/backend/plan.json
    
      Next steps:
        1. Review the plan and edit if needed
        2. Run /backend-webflux-plugin:be-crud Employee to scaffold from plan
           or  /backend-webflux-plugin:be-crud --all employee-onboarding to scaffold all entities
    
  8. Step 5 — update implementation.backend in the spec progress file with status: "planned", the planFile path, and planGeneratedAt, preserving every other existing field untouched.

Tricky case — agent failed to write the plan. Same feature, but the backend-planner agent hit an error mid-run (e.g. malformed spec markdown it could not parse) and never wrote plan.json. Step 4.1's file-existence check fails. The correct output is:

Plan generation failed — plan.json not found or unreadable at
docs/specs/employee-onboarding/.implementation/backend/plan.json.
Not verified: entity/command/query counts.

Not a summary with zeroed-out or guessed counts, no "Next steps" block (there is nothing to scaffold from yet), and Step 5 does not run — there is no planGeneratedAt to record and no planFile to point to.

Step 5: Update Spec Progress

  1. Read docs/specs/{feature}/.progress/{feature}.json
  2. Add or update the implementation.backend field:
{
  "implementation": {
    "backend": {
      "status": "planned",
      "planFile": "docs/specs/{feature}/.implementation/backend/plan.json",
      "planGeneratedAt": "{ISO 8601}"
    }
  }
}
  1. Write the updated progress file back. Merge rule: preserve all existing fields in the progress file — only add or update the implementation.backend fields shown above. Do not modify implementation.frontend or any other existing fields.

Step 5.5: Ensure Progress Directory

Ensure the backend pipeline progress directory exists so that be-crud can write entity-level progress files:

  1. Read workDocDir from plugin config
  2. Create {workDocDir}/.progress/ directory if it does not exist (mkdir -p via Bash — the Write tool cannot create an empty directory)

Note: Individual entity progress files are created by be-crud (one per entity). be-plan does not create feature-level progress files to avoid orphan entries that no subsequent skill updates.

04 同仓库更多 Skills