Skip to content

Declarative #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 250 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
11a2aa9
feat(verbs): add declarative config verb constants
rspurgeon Jun 24, 2025
814dbd3
feat(commands): add declarative config command stubs
rspurgeon Jun 24, 2025
73216dc
feat(declarative): add core resource types
rspurgeon Jun 24, 2025
dc4301a
feat(declarative): add portal resource definitions
rspurgeon Jun 24, 2025
0f5629b
refactor(declarative): restructure API resources with parent-child re…
rspurgeon Jun 24, 2025
2b2077d
docs(plan): update progress tracking to reflect completed steps 1-4
rspurgeon Jun 24, 2025
3837b41
docs(plan): complete step status updates for steps 1-4
rspurgeon Jun 24, 2025
89b4d6d
test(declarative): add validation and command tests for steps 1-4
rspurgeon Jun 24, 2025
4623a0f
feat(loader): implement YAML loader with validation (Step 5 - WIP)
rspurgeon Jun 24, 2025
f59882f
refactor(portal): restructure portal resources to match API parent-ch…
rspurgeon Jun 25, 2025
a24a896
fix(declarative): handle SDK union types for auth strategies
rspurgeon Jun 25, 2025
1fba175
fix(declarative): handle API child resource unmarshaling
rspurgeon Jun 25, 2025
1a8150d
fix(loader): fix loop variable issue in cross-reference validation
rspurgeon Jun 25, 2025
980985f
fix(lint): fix variable naming for AuthStrategyIDs field
rspurgeon Jun 25, 2025
2d20c57
docs(plan): mark Step 5 (YAML Loader) as completed
rspurgeon Jun 25, 2025
d6472a4
feat(loader): add multi-file configuration support
rspurgeon Jun 25, 2025
700bae9
docs(plan): mark Step 6 (Multi-file Support) as completed
rspurgeon Jun 25, 2025
fb77e0a
feat(loader): implement fail-fast duplicate detection for ref and nam…
rspurgeon Jun 25, 2025
5e782b2
feat(plan): integrate configuration loader with plan command
rspurgeon Jun 25, 2025
52383b0
fix(examples): reorganize declarative examples into standalone direct…
rspurgeon Jun 25, 2025
ba7333b
refactor(declarative): implement -f/--filename flag pattern for all c…
rspurgeon Jun 26, 2025
b078436
feat(declarative): support UUID or reference for control_plane_id field
rspurgeon Jun 26, 2025
fc5f8ec
docs(plan): add Stage 2 planning documents for plan generation with l…
rspurgeon Jun 26, 2025
895e3b8
docs(plan): refine Stage 2 plan structure for efficient declarative c…
rspurgeon Jun 26, 2025
18c2017
docs(plan): remove Status sections from ADRs
rspurgeon Jun 26, 2025
7499677
docs(claude): Gives claude help with libraries in docs-mcp-server
rspurgeon Jun 26, 2025
68725db
fix(display) Makes cp display record as text deterministic around labels
rspurgeon Jun 26, 2025
9e4ac99
feat(konnect): extend API interfaces with CRUD operations
rspurgeon Jun 26, 2025
64faecb
feat(labels): implement label management utilities
rspurgeon Jun 26, 2025
0666c94
feat(state): implement Konnect state client wrapper
rspurgeon Jun 26, 2025
5af5daa
feat(hash): implement configuration hash calculation
rspurgeon Jun 26, 2025
9902776
feat(hash): implement generic configuration hash calculation
rspurgeon Jun 27, 2025
7aa4e31
feat(planner): define plan types and structures
rspurgeon Jun 27, 2025
88370d1
feat(planner): implement reference resolver
rspurgeon Jun 27, 2025
52d07d2
feat(planner): implement dependency resolution
rspurgeon Jun 27, 2025
07e0b65
feat(planner): implement core plan generation logic
rspurgeon Jun 27, 2025
8cc80dc
feat(cmd): update plan command to generate execution plans
rspurgeon Jun 27, 2025
7e89610
docs(plan): update progress tracking for Stage 2 completion
rspurgeon Jun 27, 2025
d49ddb8
fix(plan): inherit konnect PreRunE to set up SDK factory
rspurgeon Jun 27, 2025
bad145a
refactor(plan): output only JSON for clean piping
rspurgeon Jun 27, 2025
8610e5d
feat(diff): implement diff command with multiple output formats
rspurgeon Jun 27, 2025
3e1f087
feat(diff): support stdin input and improve examples
rspurgeon Jun 27, 2025
3f2218a
docs(diff): clarify plan file usage in command description
rspurgeon Jun 27, 2025
411a71e
feat(declarative): add integration tests for plan generation
rspurgeon Jun 27, 2025
190672b
docs(plan): update documentation for Stage 2 completion
rspurgeon Jun 27, 2025
0aecece
docs(plan): add Stage 3 planning documents for plan execution
rspurgeon Jun 27, 2025
037f5c8
docs(plan): clarify protected resource immutability for Stage 3
rspurgeon Jun 27, 2025
f4e3105
docs(plan): simplify confirmation prompts and add output format support
rspurgeon Jun 27, 2025
1ed18e2
docs(plan): remove Status fields from ADRs
rspurgeon Jun 27, 2025
7ee79f6
docs(plan): implement fail-fast approach for protected resources
rspurgeon Jun 27, 2025
6211d7b
docs(plan): complete Stage 3 planning phase
rspurgeon Jun 27, 2025
a750b4a
feat(planner): add mode support and protection validation
rspurgeon Jun 27, 2025
fe4bb51
feat(executor): create base executor package
rspurgeon Jun 27, 2025
5fd25c9
feat(executor): implement console progress reporter
rspurgeon Jun 27, 2025
63d34fb
feat(executor): implement portal operations and apply command
rspurgeon Jun 28, 2025
c371a5a
docs(plan): add idempotency fix and configuration discovery plans
rspurgeon Jun 29, 2025
2c0df8d
docs(plan): Refines the strategy for reconciliation of chagned resources
rspurgeon Jun 29, 2025
b1a7054
fix(planner): implement configuration-based change detection for idem…
rspurgeon Jun 29, 2025
7324ed0
fix(portal): remove empty label check that didn't resolve API issue
rspurgeon Jun 29, 2025
b47c683
fix(labels): use label-compliant timestamp format
rspurgeon Jun 29, 2025
f81f3a5
feat(apply): improve structured output for no-changes case
rspurgeon Jun 29, 2025
ed1ce8c
refactor(apply): remove redundant fields in no-changes output
rspurgeon Jun 29, 2025
3f2fafa
feat(apply): improve output consistency across all scenarios
rspurgeon Jun 29, 2025
238f6b6
fix(apply): improve dry-run output clarity and structure
rspurgeon Jun 30, 2025
5739ea4
refactor: simplify and improve apply command output consistency
rspurgeon Jun 30, 2025
66223cc
fix: restore plan output in apply command JSON/YAML output
rspurgeon Jun 30, 2025
2f55dd2
refactor: improve output formatting for plan summary and execution
rspurgeon Jun 30, 2025
bb6cfda
feat: require --auto-approve flag for JSON/YAML output formats
rspurgeon Jun 30, 2025
220a7df
feat: add plan file path to metadata output
rspurgeon Jun 30, 2025
a95eead
feat(declarative): improve protection label handling and support all …
rspurgeon Jun 30, 2025
c672473
docs: update example portal configurations
rspurgeon Jun 30, 2025
b8542ec
docs: update planning documents to reflect current progress
rspurgeon Jun 30, 2025
eefb1ff
fix(apply): handle stdin for plan files in pipeline usage
rspurgeon Jun 30, 2025
9d442db
docs(plan): reorganize stages for better focus and deliverability
rspurgeon Jul 1, 2025
865a4c5
docs(plan): add extensive code review step to Stage 6
rspurgeon Jul 1, 2025
7936e20
docs(plan): create Stage 4 planning documents with YAML tag system
rspurgeon Jul 1, 2025
e1eef65
docs(plan): reorder Stage 4 steps for logical progression
rspurgeon Jul 1, 2025
7f30a89
docs(plan): add Stage 4 multi-resource support planning
rspurgeon Jul 1, 2025
61e14a8
feat(sdk): partially migrate to public Konnect SDK v0.6.0
rspurgeon Jul 1, 2025
74a13fd
fix(tests): update tests for public SDK migration
rspurgeon Jul 1, 2025
e47f8c5
docs(plan): mark Stage 4 Step 1 as completed
rspurgeon Jul 1, 2025
fb73c02
docs(plan): add Stage 6 requirements for plan output and arg validation
rspurgeon Jul 1, 2025
c3467e0
docs(plan): add internal SDK migration to Stage 6
rspurgeon Jul 1, 2025
58a5ee5
feat(resources): create resource interfaces and base types
rspurgeon Jul 1, 2025
a45b693
feat(resources): migrate API resource to public SDK and implement int…
rspurgeon Jul 1, 2025
1bd22bb
feat(sdk): migrate from internal to public Konnect SDK v0.6.0
rspurgeon Jul 1, 2025
4123509
docs(plan): update Stage 4 progress after SDK migration completion
rspurgeon Jul 2, 2025
1e61783
feat(resources): implement API child resource types with dual-mode co…
rspurgeon Jul 2, 2025
d9b392a
feat(tags): create YAML tag system architecture for declarative confi…
rspurgeon Jul 2, 2025
71f76e7
feat(tags): implement file tag resolver with loading functionality
rspurgeon Jul 2, 2025
fb4f523
docs(plan): update Stage 4 documentation after Step 7 verification
rspurgeon Jul 2, 2025
9e4b535
feat(stage4): partial implementation of Step 8 - extend planner for A…
rspurgeon Jul 2, 2025
9f0c7ad
docs(stage4): add comprehensive implementation plan for API child res…
rspurgeon Jul 2, 2025
27a770b
feat(api): implement comprehensive support for API child resources
rspurgeon Jul 3, 2025
d31948a
docs(plan): update Stage 4 documentation after Step 8 completion
rspurgeon Jul 3, 2025
ac05165
feat(stage4): complete Step 9 - Create Integration Tests for API Reso…
rspurgeon Jul 3, 2025
68d6a45
test: temporarily disable failing command-level integration tests
rspurgeon Jul 3, 2025
3c301b0
feat(stage4): implement Step 10 - plan command file loading support
rspurgeon Jul 3, 2025
bf39528
fix(lint): resolve code quality issues in API planner
rspurgeon Jul 3, 2025
5d2cc24
test: add plan command file loading integration tests
rspurgeon Jul 3, 2025
5fab3e0
docs(plan): update Stage 4 documentation after Step 10 completion
rspurgeon Jul 3, 2025
f531e57
feat(stage4): implement Step 11 - cross-resource reference validation
rspurgeon Jul 3, 2025
a2f5c6d
feat(stage4): implement Step 12 - comprehensive integration tests
rspurgeon Jul 3, 2025
97c47ee
feat(docs): complete Stage 4 Step 13 - add comprehensive examples and…
rspurgeon Jul 3, 2025
5fec97e
docs(tidy): Minor docs tweak
rspurgeon Jul 3, 2025
f728a93
fix(plan): enable API resource planning support
rspurgeon Jul 3, 2025
9571406
fix(planner): include user-defined labels in API plans
rspurgeon Jul 3, 2025
7669268
refactor(planner): move protection label to execution time
rspurgeon Jul 3, 2025
a8704e0
feat(planner): always show protection status in plans and diffs
rspurgeon Jul 3, 2025
19e142b
fix(resources): handle multiple spec formats in API version unmarshaling
rspurgeon Jul 3, 2025
98a7d2c
feat(planner): fix circular dependencies and improve diff output
rspurgeon Jul 4, 2025
f70c89b
feat: implement auth strategy creation and fix banking example
rspurgeon Jul 4, 2025
07fa49a
fix: handle array types correctly in auth strategy creation
rspurgeon Jul 4, 2025
1e17758
feat: implement runtime auth strategy reference resolution
rspurgeon Jul 4, 2025
4f736af
feat: handle Kong API publication auth strategy limitation
rspurgeon Jul 4, 2025
4f1c1d3
feat: implement auth strategy state tracking for idempotent applies
rspurgeon Jul 4, 2025
326a8c1
fix: resolve auth strategy config type mismatch causing unnecessary u…
rspurgeon Jul 4, 2025
1bd11be
fix(planner): resolve spurious updates and standardize label handling
rspurgeon Jul 4, 2025
4607140
refactor(planner): implement interface-based architecture
rspurgeon Jul 4, 2025
44c12bc
fix(planner): resolve test failures and code quality issues
rspurgeon Jul 4, 2025
9ef7e7a
fix(planner): correct auth strategy resource type
rspurgeon Jul 5, 2025
cace880
fix(planner): add missing strategy_type and fix config structure for …
rspurgeon Jul 5, 2025
b24ff42
fix(planner): use consistent hyphenated keys for auth strategy configs
rspurgeon Jul 5, 2025
f7ce008
fix(planner): handle []string type for auth strategy key_names
rspurgeon Jul 5, 2025
f2abcd7
feat(apply): include full plan document in JSON/YAML output
rspurgeon Jul 5, 2025
8f434b8
fix(auth-strategy): ensure protection labels are preserved during upd…
rspurgeon Jul 5, 2025
61ea3d8
fix(auth-strategy): handle correct label type from planner in updates
rspurgeon Jul 5, 2025
8e89fe0
feat(auth-strategies): implement config updates for application auth …
rspurgeon Jul 5, 2025
3d1661c
fix(auth-strategies): ensure label removal works correctly
rspurgeon Jul 5, 2025
9b8af18
fix(auth-strategies): properly remove labels by sending null values
rspurgeon Jul 5, 2025
0f85e12
fix(auth-strategies): add missing last-updated timestamp label
rspurgeon Jul 5, 2025
85e362c
fix: preserve nil values in auth strategy label updates
rspurgeon Jul 5, 2025
199ee03
refactor: centralize label handling across all resource types
rspurgeon Jul 5, 2025
19cd9cd
fix: resolve label handling issues for empty and commented labels
rspurgeon Jul 5, 2025
36fde41
fix: update apply command error message to mention --dry-run option
rspurgeon Jul 5, 2025
43665e0
feat: add --plan-output-file flag to apply and sync commands
rspurgeon Jul 5, 2025
255dbb1
chore: add debug logging to trace API version resolution issue
rspurgeon Jul 6, 2025
5be7d85
feat: Phase 1 - Enhanced Resource interface with identity resolution …
rspurgeon Jul 6, 2025
510a1d0
feat: Phase 2 - Add filtered lookup methods to state client
rspurgeon Jul 6, 2025
4d4cd0e
feat: Phase 3 - Implement pre-resolution phase in planner
rspurgeon Jul 6, 2025
b1ce2e1
feat: Phase 4 - Fix child resource planning to use resolved IDs
rspurgeon Jul 6, 2025
8ce860c
feat: Phase 5 - Remove debug logging and fix tests
rspurgeon Jul 6, 2025
5a8743b
refactor: standardize all logging to use slog
rspurgeon Jul 6, 2025
ee803a1
fix: enable creation of API child resources for existing APIs
rspurgeon Jul 7, 2025
0bda611
fix: include name field in protection-only updates to prevent executo…
rspurgeon Jul 7, 2025
6bcb6c2
docs(tidy): Minor docs tweak
rspurgeon Jul 7, 2025
e4a067a
docs(examples): Simplifying declarative configuration examples
rspurgeon Jul 7, 2025
2aca441
refactor: reorganize helpers package with consistent patterns
rspurgeon Jul 8, 2025
63f3638
refactor: Reorganizing many files
rspurgeon Jul 8, 2025
07c9214
refactor: Reorganizing many files
rspurgeon Jul 8, 2025
a06052e
feat: add hierarchical state cache and fix portal page matching
rspurgeon Jul 8, 2025
8791711
fix: handle portal customization as singleton resource in executor va…
rspurgeon Jul 8, 2025
64492a8
fix: add portal name lookup fields for all portal child resources
rspurgeon Jul 8, 2025
aa9d9ad
feat(portal): Significatn progress on portal child resources support
rspurgeon Jul 9, 2025
8e4e616
fix(portal): Fixed root portal issue
rspurgeon Jul 9, 2025
bdd8bfb
fix(portal): makes snippets work properly after initial create
rspurgeon Jul 9, 2025
1117c28
fix(portal): fix portal page matching for nested pages and root page
rspurgeon Jul 9, 2025
7f1ae04
fix(portal): portal customization now correctly handles menu updates
rspurgeon Jul 9, 2025
f5639b7
fix(portal): new example and everything working but publications
rspurgeon Jul 9, 2025
a6ac348
fix(portal): works
rspurgeon Jul 9, 2025
d4c0b3e
feat(declarative): enhance change IDs and plan display
rspurgeon Jul 21, 2025
04a57f8
docs(plan): add Stage 5 sync command execution plans
rspurgeon Jul 22, 2025
55ede7c
feat(sync): update sync command structure and documentation
rspurgeon Jul 22, 2025
9ff47f7
docs(plan): mark Stage 5 Step 4 as completed
rspurgeon Jul 22, 2025
83293b0
feat(executor): add tests for API DELETE operations and mark Step 5 c…
rspurgeon Jul 22, 2025
98ddab0
feat(sync): implement confirmation prompts and complete sync command
rspurgeon Jul 22, 2025
baeb20e
fix(sync): fix panic error by properly setting SDK API factory in con…
rspurgeon Jul 22, 2025
4f712e4
fix(planner): improve API publication deletion display in sync command
rspurgeon Jul 22, 2025
c4e3235
fix(planner): prevent API publications from being deleted on sync
rspurgeon Jul 22, 2025
bd96fb4
feat(planner): add slog debug logging for API publication sync issues
rspurgeon Jul 22, 2025
08ca4b8
fix(planner): prevent erroneous API publication deletions in sync mode
rspurgeon Jul 23, 2025
8f02c87
docs(plan): update Stage 5 sync command status to completed
rspurgeon Jul 23, 2025
49c3641
fix(planner): include apiID in Parent field for API document delete o…
rspurgeon Jul 23, 2025
748a207
feat(declarative): add API version deletion and improve resource refe…
rspurgeon Jul 23, 2025
4adc862
fix(sync): enable deletion of all managed resources when config is empty
rspurgeon Jul 23, 2025
9f20a03
fix(docs): Documentation work on project status
rspurgeon Jul 24, 2025
2a30e04
feat(docs): reorganize planning for Stage 6 namespace management
rspurgeon Jul 24, 2025
921849a
docs(stage-6): add ADRs and update to use default namespace
rspurgeon Jul 24, 2025
bf6b41e
docs(planning): reorganize Stage 7 and create future work bucket
rspurgeon Jul 24, 2025
538feb7
feat(resources): add namespace field to KongctlMeta struct
rspurgeon Jul 24, 2025
f17f194
docs(planning): remove KONGCTL-managed and last-updated labels in Sta…
rspurgeon Jul 24, 2025
ca7cd20
docs(planning): optimize label usage and remove child resource metadata
rspurgeon Jul 24, 2025
5586fa9
feat(resources): remove KongctlMeta from child resources
rspurgeon Jul 24, 2025
8bd2597
docs(declarative): add comprehensive kongctl metadata documentation
rspurgeon Jul 24, 2025
abcb33e
fix(docs): correct ref vs name confusion in Configuration Guide
rspurgeon Jul 24, 2025
b996513
fix(docs): clarify that name is not an identifier
rspurgeon Jul 24, 2025
2284903
feat(namespace): add FileDefaults structure for namespace configuration
rspurgeon Jul 24, 2025
7cba71e
feat(namespace): implement defaults parsing in loader
rspurgeon Jul 24, 2025
4f30560
feat(namespace): apply namespace and protected defaults during loading
rspurgeon Jul 24, 2025
d55e199
feat(namespace): implement file-level defaults with pointer types (St…
rspurgeon Jul 24, 2025
3fb58e4
feat(namespace): update label constants and remove deprecated labels …
rspurgeon Jul 24, 2025
8a16273
feat(namespace): update planners for namespace handling (Step 8)
rspurgeon Jul 25, 2025
2160f2e
feat(namespace): update label handling in executors (Step 9)
rspurgeon Jul 25, 2025
460d5a2
feat(namespace): update state client for namespace-based resource man…
rspurgeon Jul 25, 2025
bdb3c01
feat(namespace): group resources by namespace in planner (Step 11)
rspurgeon Jul 25, 2025
c043aa6
feat(namespace): update command output for namespace visibility (Step…
rspurgeon Jul 25, 2025
6903150
feat(namespace): add namespace validation (Step 13)
rspurgeon Jul 25, 2025
626b2ec
feat(namespace): complete Stage 6 Step 14 - create integration tests
rspurgeon Jul 25, 2025
7fc1a55
docs(namespace): complete Stage 6 Step 15 - documentation and examples
rspurgeon Jul 25, 2025
4346730
fix: improve empty config behavior and fix plan summary calculation
rspurgeon Jul 25, 2025
515aa9f
fix(examples): correct auth strategy configurations in namespace exam…
rspurgeon Jul 25, 2025
976004a
fix: enable strict field validation and fix label handling consistency
rspurgeon Jul 28, 2025
815458b
fix(examples): simple example for portal
rspurgeon Jul 28, 2025
c47f0c9
feat(login): implement Konnect-first pattern for login command
rspurgeon Jul 28, 2025
b7ea1f9
docs(plan): expand Stage 7 with imperative commands and Konnect-first
rspurgeon Jul 28, 2025
7def8ed
feat(products): rename gateway product to on-prem for clarity
rspurgeon Jul 28, 2025
3a2b333
feat(portal): implement Konnect-first pattern for portal commands
rspurgeon Jul 28, 2025
e9ded64
feat(portal): add portal command implementation
rspurgeon Jul 28, 2025
f92fec3
feat(portal): update examples and complete Stage 7 Step 3
rspurgeon Jul 28, 2025
0724304
feat(konnect): implement get command for APIs
rspurgeon Jul 28, 2025
7847b6d
feat(authstrategy): implement get command for auth strategies
rspurgeon Jul 29, 2025
266844e
feat(cmd): implement Konnect-first pattern for all imperative commands
rspurgeon Jul 29, 2025
42c4275
feat(docs): implement comprehensive documentation with extended help …
rspurgeon Jul 29, 2025
03b0e3e
fix(docs): move ci-cd file out of examples folder
rspurgeon Jul 29, 2025
5a4ffff
feat(testing): implement apply command integration tests infrastructure
rspurgeon Jul 29, 2025
384a3bf
fix(testing): resolve mock injection issues in integration tests
rspurgeon Jul 29, 2025
967c078
feat(testing): implement comprehensive sync command integration tests
rspurgeon Jul 29, 2025
5bd24c2
feat(testing): implement error scenario integration tests for Step 10
rspurgeon Jul 29, 2025
aa33b3f
feat(errors): implement Step 11 - Enhanced Error Messages
rspurgeon Jul 29, 2025
2b238c1
feat(declarative): implement enhanced plan summary display with UX im…
rspurgeon Jul 29, 2025
c27a23a
clean: remove problematic emojis from plan summary display
rspurgeon Jul 29, 2025
e3b1f81
docs: mark Step 13 (Progress Indicators) as completed
rspurgeon Jul 29, 2025
48f5d27
docs: mark Step 14 (Dump Command SDK Migration) as completed
rspurgeon Jul 29, 2025
9ed50a6
refactor: Phase 1 - Extract common utility functions
rspurgeon Jul 29, 2025
400e076
feat(executor): implement generic BaseExecutor pattern
rspurgeon Jul 30, 2025
51a024a
feat(executor): implement APIAdapter using BaseExecutor pattern
rspurgeon Jul 30, 2025
c1b977e
feat(executor): implement auth strategy adapter with union type handling
rspurgeon Jul 30, 2025
0a3085d
feat(refactor): implement portal child resource adapters (Phase 2)
rspurgeon Jul 30, 2025
fbb225d
feat(refactor): implement API child resource adapters (Phase 2)
rspurgeon Jul 30, 2025
dbeed89
feat(refactor): implement GenericPlanner and migrate API planner (Pha…
rspurgeon Jul 30, 2025
5317b4b
feat(refactor): migrate Portal planner to generic operations (Phase 3)
rspurgeon Jul 30, 2025
59befac
fix(portal): resolve portal child resource extraction and generic pla…
rspurgeon Jul 30, 2025
2bca5b4
fix(ui): remove emoji from plan statistics for consistent text alignment
rspurgeon Jul 30, 2025
0ea880d
feat(refactor): implement state client optimization utilities (Phase 4)
rspurgeon Jul 30, 2025
f3b3d47
WIP refacotring pause
rspurgeon Jul 30, 2025
f3a19ee
fix(planner): remove duplicate portal child resource planning
rspurgeon Jul 30, 2025
4e145c3
fix: resolve multiple critical issues with portal and API child resou…
rspurgeon Jul 30, 2025
c7be603
docs: mark Stage 7 as complete - all planned stages finished
rspurgeon Jul 30, 2025
d197f0c
chore: add CLAUDE.local.md to gitignore for local dev context
rspurgeon Jul 30, 2025
2900375
Add subagents and a task workflow for claude
rspurgeon Jul 30, 2025
c2ac3ec
Adds support for delete and adds subagents and a task workflow for cl…
rspurgeon Jul 30, 2025
af06b95
Adds support for delete and adds subagents and a task workflow for cl…
rspurgeon Jul 30, 2025
e1bc24c
fix(portal): deletes should work
rspurgeon Jul 30, 2025
fbe9ec0
Working on agentic workflow
rspurgeon Jul 30, 2025
4c36657
Misc
rspurgeon Jul 30, 2025
4699f66
Fix(hook)
rspurgeon Jul 30, 2025
f2964c9
fix(apis) api publication references should work
rspurgeon Jul 31, 2025
9eec3d0
fix(api-publication): make auth_strategy_ids optional per API spec
rspurgeon Jul 31, 2025
26b7339
docs(stage-5): Add planning docs
rspurgeon Jul 31, 2025
d24c712
fix(planner): preserve existing references when resolving
rspurgeon Jul 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .claude/agents/code-flow-mapper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: code-flow-mapper
description: Expert code flow mapper that traces execution paths and file interconnections
tools: Task, Bash, Glob, Grep, LS, ExitPlanMode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoWrite, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, ListMcpResourcesTool, ReadMcpResourceTool, mcp__sequential-thinking__sequentialthinking, mcp__ide__executeCode, mcp__ide__getDiagnostics
color: yellow
---

You must first read the "INVESTIGATION_REPORT.md" file from the investigator agent, then use ultrathink and sequential thinking to trace execution paths,
dependencies, and file interconnections based on the files identified in that report and after your analysis ends create a "FLOW_REPORT.md" inside the
task directory that gets automatically created for this task session.

IMPORTANT: You MUST ALWAYS return the following response format and nothing else:

```
## Flow Report Location:
The comprehensive flow analysis report has been saved to:
`[full path to FLOW_REPORT.md file]`
33 changes: 33 additions & 0 deletions .claude/agents/code-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: code-reviewer
description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use before commiting.
tools: Read, Grep, Glob, Bash
---

You are a senior code reviewer ensuring high standards of code quality and security.

When invoked:

1. Run git diff to see recent changes
2. Focus on modified files
3. Begin review immediately

Review checklist:

- Code is simple and readable
- Functions and variables are well-named
- No duplicated code
- Proper error handling
- No exposed secrets or API keys
- Input validation implemented
- Good test coverage
- Performance considerations addressed
- No bandaid fixes

Provide feedback organized by priority:

- Critical issues (must fix)
- Warnings (should fix)
- Suggestions (consider improving)

Include specific examples of how to fix issues.
17 changes: 17 additions & 0 deletions .claude/agents/investigator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: investigator
description: Expert code investigator that tracks down related code to the problem
tools: Task, Bash, Glob, Grep, LS, ExitPlanMode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoWrite, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, ListMcpResourcesTool, ReadMcpResourceTool, mcp__sequential-thinking__sequentialthinking, mcp__ide__executeCode, mcp__ide__getDiagnostics
color: cyan
---

You must ultrathink and use sequential thinking to investigate all codebase files and find the files related to the problem the user has and after
your investigation ends create a "INVESTIGATION_REPORT.md" inside the task directory that gets automatically created for this task session.

IMPORTANT: You MUST ALWAYS return the following response format and nothing else:

```
## Report Location:
The comprehensive investigation report has been saved to:
`[full path to INVESTIGATION_REPORT.md file]`
```
20 changes: 20 additions & 0 deletions .claude/agents/planner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: planner
description: Expert planner that takes into account investigation and flow analysis reports to create a detailed plan that solves all problems
tools: Task, Bash, Glob, Grep, LS, ExitPlanMode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoWrite, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, ListMcpResourcesTool, ReadMcpResourceTool, mcp__sequential-thinking__sequentialthinking, mcp__ide__executeCode, mcp__ide__getDiagnostics
color: green
---

You must read both the "INVESTIGATION_REPORT.md" and "FLOW_REPORT.md" files from the task directory, then use ultrathink and sequential thinking to
create a super detailed plan to solve the issues, taking into account every single piece of information. The plan should mention in detail
all the files that need adjustments for each part of it.

Create a "PLAN.md" file inside the task directory.

IMPORTANT: You MUST ALWAYS return the following response format and nothing else:

```
## Complete Plan Location:
The plan has been saved to:
`[full path to PLAN.md file]`
```
5 changes: 5 additions & 0 deletions .claude/commands/commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Instructions

1. Check diffs

2. Commit and push. Avoid using co authored and generated by. Also follow https://www.conventionalcommits.org/en/v1.0.0/#specification guidelines
20 changes: 20 additions & 0 deletions .claude/commands/task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Use sequential-thinking mcp and all its tools that you will need about the problem and how to solve it.
You must ultrathink for the solution and use reasoning.

You must consider edge cases and follow best coding practices for everything. Never do bandaid fixes.

## Configuration

STEP 1: You must use the investigator subagent (pass to it the full path of the created task-{id}
directory) that returns you a "INVESTIGATION_REPORT.md" file.

STEP 2: You must use the code-flow-mapper subagent (pass to it the full path of the created task-{id}
directory) that returns you a "FLOW_REPORT.md" file.

STEP 3: You must use the planner subagent (pass to it the full path of the task directory that
contains the 2 reports made by the 2 subagents) that reads both reports and creates a "PLAN.md".

STEP 4: After all three subagents finish, enter plan mode and read the "PLAN.md" file and present the plan
to the user so that they can either accept or adjust it.

Problem: $ARGUMENTS
175 changes: 175 additions & 0 deletions .claude/hooks/task_prep_hook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
#!/usr/bin/env python3
"""
UserPromptSubmit hook for task directory preparation.
Automatically creates task-{id} directories and git branches when users type /task.
"""
import json
import os
import sys
import re
import subprocess
from pathlib import Path


def get_next_task_id(base_dir: Path) -> int:
"""Find the next available task ID by checking existing directories."""
if not base_dir.exists():
return 1

existing_dirs = [
d for d in base_dir.iterdir()
if d.is_dir() and d.name.startswith('task-')
]

if not existing_dirs:
return 1

# Extract numbers from directory names
numbers = []
for dir_path in existing_dirs:
match = re.search(r'task-(\d+)', dir_path.name)
if match:
numbers.append(int(match.group(1)))

return max(numbers) + 1 if numbers else 1


def create_task_directory(base_dir: Path, task_id: int) -> tuple[bool, str]:
"""Create the task directory and return success status and path."""
try:
task_dir = base_dir / f"task-{task_id}"

# Create directories with proper permissions
base_dir.mkdir(parents=True, exist_ok=True)
task_dir.mkdir(exist_ok=True)

return True, str(task_dir)
except Exception as e:
return False, str(e)


def validate_git_environment(cwd: str) -> tuple[bool, str]:
"""Validate git environment is clean before proceeding with task creation."""
try:
# Check if we're in a git repository
result = subprocess.run(
["git", "rev-parse", "--git-dir"],
cwd=cwd,
capture_output=True,
text=True
)
if result.returncode != 0:
return False, "Not in a git repository. Please initialize a git repository first."

# Check for uncommitted changes
result = subprocess.run(
["git", "status", "--porcelain"],
cwd=cwd,
capture_output=True,
text=True
)
if result.stdout.strip():
# Get more detailed status for user
status_result = subprocess.run(
["git", "status", "--short"],
cwd=cwd,
capture_output=True,
text=True
)
return False, f"Uncommitted changes detected. Please commit or stash your changes before starting a new task.\n\nCurrent git status:\n{status_result.stdout}"

return True, ""
except Exception as e:
return False, f"Failed to check git environment: {e}"


def create_git_branch(branch_name: str, cwd: str) -> bool:
"""Create and checkout a new git branch for the task."""
try:
# Check if branch already exists
result = subprocess.run(
["git", "rev-parse", "--verify", f"refs/heads/{branch_name}"],
cwd=cwd,
capture_output=True,
text=True
)
if result.returncode == 0:
# Branch exists, just checkout
subprocess.run(["git", "checkout", branch_name], cwd=cwd, capture_output=True)
else:
# Create and checkout new branch
subprocess.run(["git", "checkout", "-b", branch_name], cwd=cwd, capture_output=True)

return True
except Exception as e:
print(f"Warning: Failed to create git branch: {e}", file=sys.stderr)
return False


def validate_prompt(prompt: str) -> bool:
"""Check if prompt starts with /task and requires directory setup."""
# Strip whitespace and check for /task at the start
cleaned_prompt = prompt.strip()
return cleaned_prompt.startswith('/task')


def main():
"""Main hook execution logic."""
try:
# Read JSON input from stdin
input_data = json.load(sys.stdin)
except json.JSONDecodeError as e:
# Not a JSON input, exit silently
sys.exit(0)

# Extract required fields
prompt = input_data.get("prompt", "")
cwd = input_data.get("cwd", os.getcwd())

# Check if this is a task prompt
if not validate_prompt(prompt):
# Not a task prompt, exit silently to allow normal processing
sys.exit(0)

# Validate git environment before proceeding
git_valid, git_error = validate_git_environment(cwd)
if not git_valid:
print(f"ERROR: Cannot start new task - {git_error}", file=sys.stderr)
print("\nTo resolve this issue:", file=sys.stderr)
print(" - Commit your changes: git add . && git commit -m 'your message'", file=sys.stderr)
print(" - Or stash your changes: git stash", file=sys.stderr)
print(" - Or discard changes: git checkout .", file=sys.stderr)
sys.exit(2) # Exit with error code to block the task

# Get next task ID
base_dir = Path(cwd) / "docs" / "plan" / "tasks"
task_id = get_next_task_id(base_dir)

# Create task directory
success, result = create_task_directory(base_dir, task_id)

if success:
# Create git branch for this task
branch_name = f"task-{task_id}"
branch_created = create_git_branch(branch_name, cwd)

# Extract the original problem from the prompt (after /task)
problem_text = prompt.replace('/task', '').strip()

# Output context message that will be added to the prompt
context_msg = f"Directory task-{task_id} has been automatically created for this task session. Git branch 'task-{task_id}' has been created and checked out. The subagents must create the INVESTIGATION_REPORT.md, FLOW_REPORT.md and PLAN.md files inside docs/plan/tasks/task-{task_id}/."
if not branch_created:
context_msg += " Note: Git branch creation encountered an issue, but task directory was created."
if problem_text:
context_msg += f" Problem to solve: {problem_text}"

print(context_msg)
sys.exit(0)
else:
# Output error but don't block processing
print(f"Warning: Failed to create task directory: {result}", file=sys.stderr)
sys.exit(2)


if __name__ == "__main__":
main()
42 changes: 42 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"permissions": {
"allow": [
"WebFetch(domain:docs.anthropic.com)",
"WebFetch(domain:github.com)",
"mcp__context7__resolve-library-id",
"mcp__context7__get-library-docs",
"Bash(grep:*)",
"Bash(git add:*)",
"Bash(sed:*)",
"Bash(git push:*)",
"Bash(find:*)",
"Bash(rg:*)",
"Bash(git commit:*)",
"Bash(git rm:*)",
"mcp__sequential-thinking__sequentialthinking",
"Bash(git checkout:*)",
"Bash(git pull:*)",
"Bash(diff:*)",
"Bash(git reset:*)"
],
"deny": []
},
"enableAllProjectMcpServers": true,
"enabledMcpjsonServers": [
"context7",
"sequential-thinking"
],
"hooks": {
"PreToolUse": [],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": ".claude/hooks/task_prep_hook.py"
}
]
}
]
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ kongctl
.vscode/

dist/

# Local development context
CLAUDE.local.md
Loading
Loading