Feature Spec from Code
Reverse-engineers one feature from source into a functional spec with file-referenced business rules, states, permissions, and bugs spotted.
Before & after
Same prompt, same agent — the only difference is the skill.
That's a good idea to document your CLI in a PRD format. You should start by describing what the CLI does and who it's for. Then list out the main commands and features. You might want to include some examples of how users would interact with it. It's helpful to explain the design decisions behind why certain features were included. You could also mention any limitations or known issues. A PRD usually includes success metrics so you know if the feature is working well. You might want to include a roadmap of future features. It's useful to have a clear structure so it's easy to skim. Would you like help organizing any particular section?
PRD: AGENTCLI PURPOSE CLI tool enabling agents to execute internal tasks: database queries, credential rotation, report generation. Target: Site Reliability Engineers and Platform Engineers. Success metric: 90% of routine ops tasks automatable via agentcli within 2 months. CORE COMMANDS agentcli db query 'SELECT * FROM users' → CSV or JSON output agentcli secrets rotate cert_name → trigger rotation, verify health agentcli report generate daily → run scheduled reports, output to Cloud Storage agentcli task enqueue job_name --priority high → queue background job DESIGN DECISIONS Why no interactive mode: Agents need fully scripted, reproducible flows. Why Cloud Storage output: Reports live in single source of truth; agents reference by URL. Why rate limits: Prevent cascading failures if agent loops poorly. SUCCESS CRITERIA Adoption: 70%+ of ops runbooks migrated by end Q4 Performance: Average latency under 500ms Reliability: 99.9% uptime, zero security incidents LIMITATIONS No local state: CLI stateless, agent must track IDs No dashboard: Job history requires log queries Rollback story TBD: Long-running jobs cannot reverse in-place ROADMAP Q3 2026: MVP (query, rotate, report, enqueue) Q4 2026: Audit log and approval workflows Q1 2027: Interactive mode for human operators
About this skill
Document how one feature actually works today, straight from the code. Every rule points to the line that enforces it, so PMs, QA, and rebuild teams can trust it.
What it does
- Traces entry points through services to data and external calls
- Writes the user flow, including empty, error, and success states
- Builds business rule, state transition, validation, and permission tables with file:line references
- Lists flags, config defaults, integrations, and side effects
- Flags likely bugs, undocumented policies, and questions needing a product decision
What you get
A feature spec: summary, user flow, business rules, states and transitions, inputs and validation, permissions, integrations, flags, discrepancies, and test coverage notes.
Best for
Teams rebuilding or migrating a legacy feature, onboarding a PM or QA to undocumented code, or preparing for a compliance review.
SKILL.md preview
---
name: feature-spec-from-code
description: Reverse-engineer one feature or module (a page, an endpoint group, a workflow) from source code into a focused functional spec - user-visible behavior, business rules with file references, states, validations, permissions, and a list of places where the code looks inconsistent or undocumented. Use when the user says "document how the refund flow actually works", "what does this module do?", "write a spec for this feature before we rebuild it", or needs to hand one legacy feature to a PM, QA, or a new team. Also triggers on "how does this code handle refunds?", "explain what this module does", or "quick summary of the rules in this endpoint".
---
… (sign up to view the full skill)More business & ops skills
View all Business & Ops skills →Product Practice Diagnostic
Trace a product-team symptom (unused features, roadmap churn, priority fights) to the broken stage of the loop and fix one thing first.
Feature Launch Go-to-Market Plan
Plan one feature launch: tier, plan access, audience messages, readiness gates for support, sales, billing, and docs, and success metrics.
Pricing Tier and Packaging Diagnosis
Finds why your pricing tiers underperform and redesigns value metric, fences, price gaps, and upgrade triggers with a migration plan.
Product Specs, Roadmaps, and Research Decisions
Turn customer evidence into testable PRDs, dependency-aware roadmaps, and stakeholder updates with clear decisions and tradeoffs.