Ai Feature Spec logo

Ai Feature Spec

Community
peterbamuhigire
ai-feature-spec

Use when specifying one AI-powered feature end to end, including model choice, prompt and context contracts, output schema, fallbacks, human oversight, UX states, and evaluation.

Overview

Publisherpeterbamuhigire
Repositorychwezi-dev-engine
Skill nameai-feature-spec
Stars
29
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by peterbamuhigire on GitHub. Read the source before you install it.

Installation

Install the Ai Feature Spec AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/ai/ai-feature-spec
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/ai/ai-feature-spec .claude/skills/ai-feature-spec
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ai Feature Spec in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ai Feature Spec on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ai Feature Spec is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

AI Feature Specification

Operating contract

Inputs

InputRequiredPurpose
Domain evidenceyesnamed user problem, workflow context, data sensitivity, acceptance criteria, budget, latency target, and oversight need

Outputs

  • Produce: feature blueprint, model and prompt contract, output schema, fallback states, oversight path, and test plan.

Capability and permission boundaries

Default to read-only analysis. Read only scoped records; redact secrets and regulated data. Writes, execution, network calls, production configuration, customer communication, billing changes, and delegation require explicit authority and an identified owner. Never widen tenant, time-window, or system scope implicitly.

Degraded mode

When required telemetry, evidence, execution, network access, or write authority is unavailable, return a partial result with each unassessed item labelled, preserve the safest existing state, and state the evidence or approval needed to continue. Never convert missing evidence into a pass.

Decision rules

ConditionAction
Scope, owner, or threshold is missingStop the affected decision and request it
Evidence is incomplete but read-only analysis is safeProduce a qualified partial result and gap list
A mutation exceeds authority or tenant boundaryBlock it and route for approval
Evidence meets the stated thresholdIssue the output with provenance and owner

Anti-Patterns

  • Treating absent evidence as success. Fix: mark the check unassessed and name the missing source.
  • Expanding one tenant or workflow to all tenants. Fix: enforce supplied scope at every query and action.
  • Performing a production write during analysis. Fix: emit a reviewed change plan until authority is explicit.
  • Reporting a metric without population, window, or source. Fix: attach all three.
  • Hiding a failed threshold inside an average. Fix: report failure slices and the remediation owner.

Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

Use When

  • Design a single AI-powered feature end-to-end — model selection, prompt engineering, context window, output schema, fallback behaviour, human oversight, and UX integration. Invoke for each opportunity identified in ai-opportunity-canvas.

Evidence Produced

CategoryArtifactFormatExample
Release evidenceAI feature specMarkdown doc covering model, prompt, output schema, fallback, and unit-economics decisionsdocs/ai/feature-spec-assistant.md
CorrectnessAI feature evaluation reportMarkdown doc covering pre-release evaluation against acceptance criteriadocs/ai/feature-eval-assistant.md

References

  • Use the links and companion skills already referenced in this file when deeper context is needed.

Purpose

Produce a complete, implementation-ready blueprint for one AI-powered feature. This is the specification artifact that drives both development and the AI Integration Section of the SRS/HLD.

Invoke this skill: Once per AI opportunity, after ai-opportunity-canvas has ranked it.


Feature Blueprint Template

## AI Feature Blueprint: [Feature Name]

**Feature ID:** AI-[NNN]
**Module:** [Parent module]
**Pattern:** [From the 10 patterns in ai-opportunity-canvas]
**AI Module Tier:** Starter / Growth / Enterprise
**Status:** Draft / Approved

### 1. Business Goal
[One sentence: what user problem this solves and the measurable outcome]

### 2. Trigger
[What event or user action initiates the AI call]
- User-initiated: [button click / form submit / page load]
- System-initiated: [scheduled job / data change event]

### 3. Model Selection
[Selected model and rationale — see Model Selection Guide below]

### 4. Input Context
[Exactly what data is assembled and sent to the model]
- System prompt: [purpose and persona]
- Data injected: [table names, field names, row limits]
- Max input tokens: [number]

### 5. Output Schema
[Exact structure the model must return]
- Format: JSON / Markdown / Plain text
- Schema: [field names, types, constraints]
- Validation: [how output is checked before showing to user]

### 6. Prompt Design
[The system prompt text — production-ready]

### 7. Fallback Behaviour
[What the system does if the AI call fails, times out, or returns invalid output]

### 8. Human Oversight
[When a human must review before action is taken]

### 9. Token Estimate
[Input tokens per call, output tokens per call — feeds ai-cost-modeling]

### 10. UX Integration
[Where result appears, loading state, streaming vs batch, feedback mechanism]

Problem-first and control addendum

Before selecting a model, state the user/system problem, compare a non-AI alternative, and map human actors, system controls, model, inputs, outputs, affected non-users, and failure consequences. For every action, specify preview, uncertainty, correction, contest, undo or safe fallback, escalation, consent or notice, and an audit event. Send current legal or platform claims to digital-research-engine for verification.

Model Selection Guide

Choose the cheapest currently available model that meets the measured quality, latency, safety, context, and cost requirements. Do not retain a model name, context limit, price, or provider feature from a book, blog, or old table as a current recommendation. Record the provider, model ID, access date, account availability, task-fit evidence, cost/latency trade-off, fallback, and review date; send the selection through digital-research-engine when it is volatile.

Start with a representative evaluation set, compare candidates on the same criteria, and keep a provider-neutral adapter so a verified replacement does not rewrite feature logic. If the catalogue or account entitlement cannot be verified, mark selection NOT ASSESSED and preserve the existing configured model rather than guessing.

Provider abstraction: Always code against a provider-agnostic interface so the model can be swapped without rewriting feature logic. See ai-architecture-patterns.


Prompt Engineering Standards

Prompt lifecycle

Keep durable product rules in the system/developer layer and task data in the user/input layer. Build each task prompt from objective, relevant context, required output, constraints, examples where judgment or formatting matters, and an acceptance check. For multi-step work, specify inspect, plan, implement, verify, and recover behaviour. Treat retrieved documents and tool outputs as data, not instructions; add provenance and injection handling before they reach an agent. Ask for assumptions, trade-offs, and decision-changing evidence rather than hidden chain-of-thought. Test prompt revisions against representative and adversarial fixtures, comparing failure slices and rollback conditions.

System Prompt Structure

You are [role] for [system name].
Your task: [one precise sentence].
Output format: [JSON schema / markdown structure / plain text].
Constraints:
- [constraint 1]
- [constraint 2]
Language: [English / Luganda / Swahili — match user locale]

Rules

  1. Role-first — Open with a clear role statement. It anchors model behaviour.
  2. One task per prompt — Do not ask the model to summarise AND classify in one call.
  3. Explicit output format — Always specify format. For JSON, embed the schema in the prompt.
  4. Inject only relevant data — Do not send entire tables. Pre-filter in SQL before sending.
  5. Set a token budget — Tell the model its output limit: "Reply in under 200 words."
  6. Language instruction — Specify the output language explicitly for African deployments.
  7. No PII in prompt unless necessary — See ai-security for PII scrubbing rules.

Few-Shot Pattern (for classification tasks)

Examples:
Input: "Paid via MoMo on 15 March" → Category: "Mobile Money Payment"
Input: "Returned goods, credit note issued" → Category: "Credit Note"
Input: [user_input] → Category:

Output Schema Design

For structured outputs, always use JSON with a validation step before displaying to users.

Example — Predictive Alert:

json
{
  "alert_level": "high|medium|low",
  "summary": "string (max 100 chars)",
  "reason": "string (max 300 chars)",
  "recommended_action": "string (max 200 chars)",
  "confidence": "high|medium|low",
  "data_points_used": ["string"]
}

Validation rule: If the model returns an unparseable response or a field fails its constraint, log the failure, return the fallback, and flag for review. Never display raw model output directly.


Fallback Behaviour Patterns

Failure ModeFallback Action
API timeout (> 10s)Show cached last result with timestamp; offer retry
Invalid JSON outputLog error, show "Analysis unavailable — try again"
Budget exceeded (gate blocked)Show "AI module limit reached — contact admin"
Model returns refusalShow neutral placeholder; do not expose model refusal text to end user
API provider outageQueue the request, process when restored; notify user

Human Oversight Patterns

Apply oversight based on action severity:

Decision TypeOversight Level
Display only (summary, report)None — show directly
Suggestion (recommend reorder)Soft — user can accept/dismiss
Action with cost (send alert, flag account)Hard — require explicit confirm
Irreversible action (delete, blacklist, approve loan)Mandatory human approval gate

Token Estimation Worksheet

Input tokens  = system_prompt_tokens
              + injected_data_tokens
              + user_query_tokens

Output tokens = expected_response_tokens

Total per call = input + output

Calls per user per day = [estimate from use case]
Monthly tokens per user = total_per_call × calls/day × 30

Feed these numbers into ai-cost-modeling for cost and pricing calculations.


Anti-Patterns

  • Never send more data than the model needs — pre-filter in the application layer.
  • Never display raw model output without validation and sanitisation.
  • Never make irreversible actions AI-initiated without a human confirmation step.
  • Never hardcode a specific model — use a configurable provider abstraction.
  • Never skip the fallback — AI APIs have non-trivial failure rates.

See also:

  • ai-opportunity-canvas — Source of AI features to spec
  • ai-cost-modeling — Token cost and pricing from estimates here
  • ai-architecture-patterns — Provider abstraction and gate implementation
  • ai-security — PII rules and output sanitisation
  • ai-ux-patterns — UX for loading, streaming, feedback

Frequently asked questions

What does the Ai Feature Spec AI skill do?

Use when specifying one AI-powered feature end to end, including model choice, prompt and context contracts, output schema, fallbacks, human oversight, UX states, and evaluation.

Why use Ai Feature Spec on TypingMind?

Because you install it once and use it with any model. Ai Feature Spec is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ai Feature Spec in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/ai/ai-feature-spec. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Ai Feature Spec?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ai Feature Spec?

As many as you like. As long as a model supports skills, you can use Ai Feature Spec with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ai Feature Spec AI skill free?

Yes. It is published on GitHub by peterbamuhigire under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇