Skip to main content

Overview

Feature Implementation is a workflow for building new features, enhancements, and general development work using an AI coding agent backed by CoreStory’s code intelligence. The agent uses CoreStory’s MCP tools to understand your system’s architecture, identify implementation patterns, and navigate to the right code locations before writing a single line — then implements the feature using a test-driven approach. CoreStory serves two roles in this workflow:
  • Expert — answers questions about system architecture, design patterns, naming conventions, and invariants. The agent queries CoreStory to understand how the system works and what patterns to follow before coding.
  • Navigator — points to specific files, extension points, base classes, and data structures. The agent queries CoreStory to understand where to implement and what to reuse.
This playbook shares its six-phase structure with the Bug Resolution playbook. The difference is the starting point: Bug Resolution starts from something broken, Feature Implementation starts from something that needs building. The questions asked in each phase shift accordingly.

Prerequisites

  • CoreStory account with at least one project that has completed ingestion
  • CoreStory MCP server connected to your AI coding agent (see the CoreStory MCP Server Setup Guide)
  • AI coding agent — this playbook includes implementation guides for Claude Code, GitHub Copilot, Cursor, and Factory.ai. The generic workflow applies to any MCP-capable agent.
  • Optional: Ticketing system MCP (GitHub Issues, Jira, Linear, Azure DevOps) for automatic ticket intake

How It Works

The workflow has six phases. Each phase builds on the previous one. Skipping phases — especially the expert and navigator phases — increases the risk of architectural misalignment, missed patterns, and avoidable rework. CoreStory MCP tools used: Optional (if ticketing MCP is connected): the agent also uses the ticketing system’s tools to fetch ticket details and post implementation summaries.

Step-by-Step Walkthrough

Phase 1: Ticket Intake & Context Gathering

Objective: Import ticket details and set up the CoreStory implementation environment. 1.1 — Get ticket details. If a ticketing MCP is connected, the agent fetches the ticket directly:
Extract the user story, acceptance criteria, requirements, and constraints. If no ticketing MCP is available, provide these details in the prompt. 1.2 — Select CoreStory project.
If multiple projects exist, confirm which one maps to the codebase being worked on. 1.3 — Create an implementation conversation.
This conversation persists across the session and captures the full chain of queries and responses — valuable institutional knowledge for future work.

Phase 2: Understanding System Architecture (Expert Phase)

Objective: Understand how the system works and where new code should integrate, before writing anything. Without this phase, the agent risks implementing features that don’t follow existing patterns, break architectural constraints, or duplicate functionality that already exists. 2.1 — Query system architecture. Ask CoreStory about the feature area:
Example for a CSV export feature:
Look for core implementation files, similar existing features (these become reference implementations), utility modules, and integration patterns. 2.2 — Query design patterns and conventions.
Look for class/module structure patterns, naming conventions (e.g., {Format}ExportService), async/sync patterns, error handling approaches, and critical invariants (e.g., “all exports require authentication”). 2.3 — Query historical context.
Look for related PRs and design discussions, past implementations that solved similar problems, and known gotchas.

Phase 3: Implementation Planning (Navigator Phase)

Objective: Map feature requirements to specific code locations and an implementation strategy. 3.1 — Identify extension points.
Look for files to create (with paths), files to modify (with specific sections), base classes to extend, and test file locations. 3.2 — Understand data structures.
Look for primary models/entities, required fields, relationships to other entities, and serialization requirements. 3.3 — Identify reference implementations.
This is one of the highest-value queries. A good reference implementation gives the agent a concrete template to follow — not just abstract patterns, but actual working code in the same codebase.

Phase 4: Test-First Implementation

Objective: Write failing tests that define the feature, then implement code to make them pass. Tests come before implementation code. This is non-negotiable in the workflow — it ensures acceptance criteria are codified, requirements are clearly understood, and regressions are caught immediately. 4.1 — Write acceptance tests from the criteria gathered in Phase 1, following the architecture patterns from Phase 2 and data structures from Phase 3:
4.2 — Validate tests with CoreStory.
4.3 — Verify tests fail. Run the tests and confirm they fail. If they pass, the feature already exists or the tests are wrong — clarify with CoreStory. 4.4 — Implement the feature following patterns from Phase 2:
4.5 — Verify tests pass. Run the specific test file and confirm all tests go green. 4.6 — Validate implementation with CoreStory.

Phase 5: Feature Completion

Objective: Add edge case coverage, ensure quality, prevent regressions. 5.1 — Identify edge cases by querying CoreStory:
Common categories: empty state, large datasets, concurrent access, invalid input, permission boundaries, missing related data. 5.2 — Run the full test suite. Ensure all new tests pass and no existing tests broke. If regressions appear, the implementation introduced unintended side effects — revise the approach. 5.3 — Performance and security validation (when applicable). Add performance tests for features with latency/throughput requirements. Add security tests for features handling sensitive data or authentication.

Phase 6: Completion & Knowledge Capture

Objective: Close the loop — commit, document, and preserve knowledge. 6.1 — Update ticket (if ticketing MCP is connected). Post an implementation summary with files created/modified, pattern followed, test count, and coverage. 6.2 — Commit with rich context. The commit message should document the feature, implementation approach, architectural alignment, and testing scope:
6.3 — Preserve the CoreStory conversation.
This marks the conversation as completed and preserves it for future reference. When someone implements a similar feature later, this conversation provides a blueprint.

Agent Implementation Guides

The skill file shown below is plain markdown. The workflow it encodes works in any agentic harness — only the install location differs. Common conventions:
Want a single install that works across the most harnesses? Append the content to AGENTS.md at your repository root. The AGENTS.md spec is read by Codex, Aider, Cursor, Factory, Jules, Gemini CLI, Windsurf, GitHub Copilot’s coding agent, JetBrains Junie, Warp, and others — so a single file covers most users without harness-specific setup.
If your harness isn’t listed, the SKILL.md content itself is portable — install it wherever your harness loads workflow context and adapt the activation step (auto-trigger, slash command, explicit invocation) to your harness’s conventions. The sections below walk through end-to-end setup (skill file, version control, usage) for the four most common harnesses. If you’re on a different harness, copy the SKILL.md content from any section and install it per the conventions above.

Claude Code

Setup

1. Connect CoreStory MCP server. Run this in your terminal:
Verify the connection works:
2. (Optional) Connect a ticketing system MCP. For automatic ticket intake, add an MCP server for your issue tracker. Each platform offers an official MCP server — check their documentation for current setup instructions: 3. Install the feature implementation skill. Claude Code skills are the primary way to teach Claude Code repeatable workflows. Create the skill directory and file:
Then create .claude/skills/implement-feature/SKILL.md with the contents from the Skill File section below. Commit it to version control so the whole team gets it:

Usage

The skill activates automatically when Claude Code detects feature implementation requests:

Tips

  • Skills auto-load from directories added via --add-dir, so team-shared skills work across machines.
  • Claude Code detects file changes during sessions — you can edit the skill file and it takes effect immediately.
  • Keep the SKILL.md under 500 lines for reliable loading.
  • The skill file includes structured output templates so Claude reports progress at each phase.
  • Let it run. The workflow is designed for autonomous execution. Interrupting mid-phase breaks the chain of context.
  • Provide good acceptance criteria. The quality of the agent’s output is directly proportional to the clarity of the input. Vague tickets produce vague implementations.
  • Use the skill for systematic work, plain prompts for quick tasks. Not every feature needs the full six-phase treatment. A two-line config change doesn’t need a CoreStory investigation.

Skill File

Save as .claude/skills/implement-feature/SKILL.md:

GitHub Copilot

Setup

  1. Configure the CoreStory MCP server in your VS Code settings. Add it to your MCP server configuration (typically in VS Code settings JSON or the MCP configuration UI).
  2. Add custom instructions. Copilot reads project-level instructions from .github/copilot-instructions.md. This is the primary mechanism for teaching Copilot specialized workflows:
Create .github/copilot-instructions.md with the content from the custom instructions file below.
  1. (Optional) Add a reusable prompt file. Prompt files (.github/prompts/implement-feature.prompt.md) provide reusable task templates. See the prompt file below.
  2. Commit to version control:

Usage

In Copilot Chat (agent mode), natural language triggers the workflow:
Or reference the prompt file:

Tips

  • Copilot’s agent mode (available in VS Code) can execute terminal commands and edit files autonomously — this workflow works best in agent mode.
  • You can add path-specific instruction files (e.g., .github/instructions/backend.instructions.md with applyTo: "src/backend/**") for component-specific guidance.
  • On Team/Enterprise plans, organization-level instructions apply across all repositories.
  • Copilot automatically references .github/copilot-instructions.md in chat responses.

Custom Instructions

Save as .github/copilot-instructions.md:

Prompt File (Optional)

Save as .github/prompts/implement-feature.prompt.md:

Cursor

Setup

  1. Configure the CoreStory MCP server in Cursor’s MCP settings (Settings → MCP Servers, or edit the MCP config JSON directly).
  2. Add project rules. Cursor uses rules in .cursor/rules/ directories. Each rule folder contains a RULE.md file:
Create .cursor/rules/implement-feature/RULE.md with the content from the rule file below.
  1. Commit to version control:

Usage

In Cursor’s Composer or Chat, the rule activates automatically for feature-related requests:

Tips

  • Rules with alwaysApply: true load in every session. Set this if your team regularly implements features through Cursor. Otherwise, use alwaysApply: false with a good description so Cursor loads it intelligently when relevant.
  • The legacy .cursorrules file still works but the .cursor/rules/ directory structure is the current recommended approach.
  • Rules apply to Composer and Chat but do not affect Cursor Tab or inline edits (Cmd/Ctrl+K).
  • On Team/Enterprise plans, team rules apply across all members.

Project Rule

Save as .cursor/rules/implement-feature/RULE.md:

Factory.ai

Setup

  1. Configure the CoreStory MCP server in your Factory.ai environment. Verify with the /mcp command that CoreStory tools are accessible.
  2. Add the custom droid. Factory.ai uses droids stored in .factory/droids/ (project-level) or ~/.factory/droids/ (personal):
Create .factory/droids/implement-feature.md with the content from the droid file below.
  1. Commit to version control (for project-level droids):

Usage

Invoke the droid via the Task tool:
Or describe the feature and Factory.ai routes to the droid based on its activation triggers.

Tips

  • Use model: inherit in the YAML frontmatter to use whatever model the session is configured with.
  • The tools field in frontmatter can explicitly list required MCP tools if you want to restrict the droid’s capabilities.
  • The Task tool that invokes droids requires experimental features to be enabled.
  • For complex features, the droid’s CoreStory queries may produce long streaming responses — this is expected.

Custom Droid

Save as .factory/droids/implement-feature.md:

Tips & Best Practices

Start with the expert, not the editor. The most common mistake is jumping straight to implementation. Even experienced developers benefit from the expert phase — CoreStory often surfaces patterns, utilities, and conventions that aren’t obvious from reading code. One conversation per ticket. Don’t reuse CoreStory conversations across unrelated tickets. Each conversation builds a coherent context thread. Mixing topics dilutes the quality of responses. Test at multiple levels. Follow the testing pyramid: many unit tests (fast, isolated), some integration tests, few end-to-end tests. The acceptance tests from Phase 4 are typically integration-level; supplement with unit tests for individual components. Each test should verify one behavior. Resist the temptation to test multiple acceptance criteria in a single test function. Isolated tests are easier to debug when they fail. Name tests descriptively. Pattern: test_[feature]_[scenario]_[expected_outcome]. When a test fails six months later, the name should tell someone what broke without reading the test body. Validate with CoreStory at key transitions. Query CoreStory after writing tests (are they comprehensive?) and after implementing (does this align?). These validation checkpoints catch misalignment early. Feature flags for gradual rollout. If the feature warrants a gradual rollout, ask CoreStory about existing feature flag patterns in the codebase and implement accordingly. Security-sensitive features deserve extra scrutiny. If the feature touches authentication, authorization, or sensitive data, add a dedicated CoreStory query: “What security considerations apply to [feature]? What auth patterns should I follow?” Then add security-specific tests for authentication, authorization, and input sanitization.

Troubleshooting

CoreStory responses are vague or generic. Ask more specific questions. Reference previous findings from the conversation, paste code snippets, and use specific variable or method names. CoreStory responds better to concrete context than abstract questions. CoreStory project not found. Verify ingestion is complete: “Get project stats for [project-id]”. Check the project name spelling. Ensure the MCP token has access to the project’s organization. Tests won’t fail after writing them. The feature may already exist (partially or fully), the tests may not match the actual acceptance criteria, or there may be a test environment issue. Ask CoreStory whether the functionality already exists. Implementation causes regressions in existing tests. Don’t commit. Ask CoreStory about integration impacts: “What other systems or components integrate with [feature area]? What downstream impacts should I consider?” Revise the implementation to avoid the side effect. Ticket is too vague to implement. Ask for clarification. The workflow requires concrete acceptance criteria to produce good tests. If the ticket says “improve the export feature” with no specifics, push back before starting Phase 2. CoreStory response is too large or takes too long. Break the query into smaller, more targeted questions. Instead of “tell me everything about the export system,” ask “what files handle CSV serialization specifically?”