Enhance FlowKit: Custom Constitution & Issue-Driven Dev
Hey everyone! Today, we're diving deep into improving FlowKit, focusing on its constitution and a vital principle: Issue-Driven Development. This article will walk you through the problems we've identified, the solutions we're proposing, and why these changes are crucial for FlowKit's future. So, buckle up, and let's get started!
The Problem: FlowKit's Constitution Needs an Overhaul
Currently, FlowKit's constitution is a bit outdated. It's still using a template from the CSV Map Viewer project, which isn't ideal. More importantly, we've realized a crucial principle is missing: Issue-Driven Development. We even stumbled upon this ourselves during development! This means we need to update the constitution to truly reflect FlowKit's purpose and how we want to work.
Here’s a breakdown of the current issues:
- Outdated Principles: Principles I-IV and VI still contain template placeholders. This means they don't accurately describe FlowKit's specific requirements. We need to make these principles FlowKit-specific, ASAP!
- Missing Principle: There's no principle enforcing issue-driven development. Guys, this is a big one! We need to ensure every code change is tied to a specific issue.
- Template Notice: The dreaded template notice is still lurking at the top of the constitution. It's time to say goodbye to that!
- Meta-Framework Focus: FlowKit is a meta-framework, so the constitution needs to clearly reflect workflow automation principles. This will help guide future development and ensure we stay true to FlowKit's core mission.
The Proposed Solution: A Customized Constitution with Issue-Driven Development
To address these issues, we're proposing a comprehensive update to FlowKit's constitution. This includes customizing existing principles and adding a brand-new one focused on issue-driven development. Let's break down the proposed changes:
1. Customizing Existing Principles (I-IV, VI)
We need to rewrite these principles to be specific to FlowKit. Here's what we're thinking:
Principle I: FlowKit is a workflow automation framework for Git/GitHub
- MUST provide slash commands that automate repetitive tasks. This is the heart of FlowKit's functionality. We want to make common Git and GitHub operations a breeze.
- MUST integrate with both
gh CLIand GitHub API (fallback). This ensures flexibility and reliability. We want FlowKit to work seamlessly, no matter the situation. - MUST be Claude Code native. This is crucial for performance and integration within the Claude Code environment. We're building FlowKit to be a first-class citizen in Claude Code.
This principle sets the stage for FlowKit's core functionality. By focusing on workflow automation, seamless integration with Git/GitHub, and Claude Code compatibility, we ensure FlowKit remains a powerful tool for developers. The use of MUST emphasizes the non-negotiable aspects of this principle.
Principle II: FlowKit operates as a local-first tool
- All processing happens locally via bash scripts and Claude Code. This is key for speed and privacy. We want to keep your data safe and your workflows fast.
- No external services required (except GitHub API). This minimizes dependencies and potential points of failure. FlowKit should be self-contained and reliable.
- Works offline for local git operations. This allows you to work even without an internet connection. We want to empower you to be productive anytime, anywhere.
This principle highlights FlowKit's commitment to local processing and minimal external dependencies. This ensures performance, privacy, and reliability. The ability to work offline for local Git operations is a significant advantage, making FlowKit a versatile tool for developers.
Principle III: FlowKit MUST be framework-agnostic
- Works with any project structure. FlowKit shouldn't force you to adopt a specific directory layout or project organization. It should adapt to your existing workflow.
- Configurable via
.claude/commands/and.flowkit/. This provides a flexible way to customize FlowKit's behavior. You should be able to tailor FlowKit to your specific needs. - No assumptions about tech stack. FlowKit should work regardless of the programming languages, frameworks, or tools you use in your project. It's designed to be universal.
This principle emphasizes FlowKit's adaptability and flexibility. By being framework-agnostic, FlowKit can be integrated into any project, regardless of its structure or tech stack. This makes FlowKit a valuable tool for a wide range of developers.
Principle IV: FlowKit MUST support multiple environments
- Works in Claude Code. This is our primary target environment. FlowKit should be seamlessly integrated into the Claude Code workflow.
- Works with standard bash/git tools. This ensures compatibility with existing workflows and tools. FlowKit should be a natural extension of your existing development environment.
- Graceful degradation when tools unavailable. If certain tools are missing, FlowKit should still function, perhaps with reduced functionality. We want FlowKit to be resilient and adaptable.
This principle ensures FlowKit can be used in a variety of environments, from Claude Code to standard bash/git setups. The concept of graceful degradation is crucial for maintaining functionality even when certain tools are unavailable. This makes FlowKit a robust and reliable tool.
Principle VI: FlowKit operations MUST be fast
- Slash commands respond within 2 seconds. This ensures a snappy and responsive user experience. Nobody likes waiting for commands to execute.
- Script execution <5 seconds for common operations. This keeps workflows moving smoothly. Efficiency is key.
- Background operations for long-running tasks. This prevents the UI from freezing and allows you to continue working while long tasks are running. FlowKit should be non-blocking.
This principle focuses on performance, a critical aspect of any workflow automation tool. By setting specific performance targets, we ensure FlowKit remains a fast and efficient tool for developers. The use of background operations for long-running tasks is a key design consideration for maintaining a smooth user experience.
2. Adding New Principle XI: Issue-Driven Development
This is the big one, guys! We need to enshrine Issue-Driven Development into FlowKit's constitution. This means every code change MUST reference a GitHub issue. And, get this: the issue needs to be created before you even start writing code.
Why is this so important?
Without issues, things get messy real quick. There's no audit trail to follow, no clear planning, no agreed-upon acceptance criteria, and no way to understand why decisions were made down the line. FlowKit's entire workflow is built around this concept, so it's crucial to make it a formal principle.
How will this work in practice?
- Issue Creation First: Use
/flowkit-feature-raise,/flowkit-bug-raise, or/flowkit-chore-raiseto create an issue before coding. This sets the stage for a well-defined task. - Branch Naming: Branch names should follow the pattern:
<issue-number>-description. This makes it easy to connect code to specific issues. - Commit Messages: Commits should reference issues using
Closes #<number>in the pull request. This provides a clear link between code changes and the issues they address. - Automatic Linkage: The
/flowkit-startand/flowkit-pr-createcommands will automatically link issues. This streamlines the workflow and reduces manual effort.
Are there any exceptions?
Yes, but they should be rare. Trivial fixes, like typos in comments or README formatting, might not require an issue if the fix time is less than the issue creation time. But, use your judgment here! When in doubt, create an issue.
This new principle is a game-changer for FlowKit. By enforcing issue-driven development, we ensure that every code change is well-planned, documented, and aligned with project goals. This leads to higher quality code, better collaboration, and a more sustainable development process. The automated linkage provided by FlowKit commands makes this principle easy to follow in practice.
Acceptance Criteria: How We'll Know We've Succeeded
To ensure we've successfully updated the constitution, we'll be looking for these things:
- [ ] Principles I-IV customized for FlowKit (no more template text!)
- [ ] Principle VI customized with FlowKit performance targets.
- [ ] Principle XI added: Issue-Driven Development (NON-NEGOTIABLE!)
- [ ] Template notice removed from the top (finally!).
- [ ] Quick Reference section updated with FlowKit commands.
- [ ] Examples updated to reference FlowKit workflows.
- [ ] Constitution commit follows conventional format. We want a clean and clear commit history.
- [ ] Self-referential: This issue itself demonstrates Principle XI! We're practicing what we preach.
Constitutional Alignment: How These Changes Fit In
These changes align perfectly with FlowKit's existing principles:
- Principle VIII (Ship Weekly): This is a small, focused change that can be completed quickly (less than a day's work).
- Principle IX (Tests): Constitution changes are validated by usage. We'll see how these changes work in practice.
- Principle X (Documentation Reflects Reality): Currently, we're violating this principle because the constitution doesn't accurately reflect FlowKit's purpose. This update fixes that!
- NEW Principle XI (Issue-Driven Development): As mentioned before, this issue itself demonstrates the principle we're adding. We're all about walking the walk.
Meta-Observation: Learning from Our Mistakes
It's worth noting that we discovered the need for the Issue-Driven Development principle because we violated it ourselves! We implemented the branch-health command before creating issue #4. This constitution update will help us avoid similar situations in the future. It's all about continuous improvement, right?
Priority and Time Estimate
This is a P1 priority task. It's foundation work that clarifies FlowKit's core principles. We estimate this will take 2-3 hours of effort.
Why? It requires careful thought about FlowKit's architectural principles, but the implementation itself is straightforward Markdown editing. It's a high-impact change that's relatively easy to implement.
Conclusion: A Stronger FlowKit for the Future
By customizing FlowKit's constitution and adding the Issue-Driven Development principle, we're setting the stage for a stronger, more sustainable, and more collaborative development process. These changes will clarify FlowKit's purpose, improve code quality, and ensure that every code change is aligned with project goals. So, let's get to work and make FlowKit even better!