diff options
Diffstat (limited to 'modules/development/pi-coding-agent/skills')
12 files changed, 501 insertions, 0 deletions
diff --git a/modules/development/pi-coding-agent/skills/architecture/SKILL.md b/modules/development/pi-coding-agent/skills/architecture/SKILL.md new file mode 100644 index 0000000..9b2b53d --- /dev/null +++ b/modules/development/pi-coding-agent/skills/architecture/SKILL.md @@ -0,0 +1,42 @@ +--- +name: architecture +description: "Understand module boundaries, dependencies, data flow, public interfaces, and risks before making structural changes." +--- + +# Architecture Skill + +Understand existing boundaries and dependencies before proposing structural changes; useful for large repositories. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** For a large codebase, you might spawn a **scout** to map module boundaries in the `auth` package, another **scout** to trace data flow in the `payment` pipeline, and a **reviewer** to verify that the proposed interface changes don't break downstream consumers—all running in parallel. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Analysis + +### 1. Module Boundaries +- Identify public vs private APIs +- Find circular dependencies +- Map ownership areas + +### 2. Dependencies +- External vs internal deps +- Dependency direction +- Coupling strength + +### 3. Data Flow +- Trace key data paths +- Identify transformation points +- Find single sources of truth + +### 4. Public Interfaces +- Document stable contracts +- Identify breaking change risks +- Plan migration strategies + +### 5. Risks +- Migration complexity +- Testing implications +- Rollback feasibility diff --git a/modules/development/pi-coding-agent/skills/code-review/SKILL.md b/modules/development/pi-coding-agent/skills/code-review/SKILL.md new file mode 100644 index 0000000..bdbacd0 --- /dev/null +++ b/modules/development/pi-coding-agent/skills/code-review/SKILL.md @@ -0,0 +1,44 @@ +--- +name: code-review +description: "Review diffs for correctness, edge cases, regressions, API compatibility, maintainability, and missing tests." +--- + +# Code Review Skill + +Review diffs for correctness, edge cases, regressions, API compatibility, maintainability, and missing tests. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** For a large pull request, you could assign one **scout** to read the changed files in the `api` layer, another **scout** to inspect the `database` migrations, and a **reviewer** to check each area for correctness, edge cases, and API compatibility—then aggregate their findings into a single review. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Checklist + +### Correctness +- [ ] Logic matches requirements +- [ ] Edge cases handled +- [ ] No off-by-one errors +- [ ] Proper error handling + +### Regressions +- [ ] Existing tests pass +- [ ] No broken functionality +- [ ] Migration path for breaking changes + +### API Compatibility +- [ ] Public interfaces preserved +- [ ] Version compatibility maintained +- [ ] Deprecation warnings where needed + +### Maintainability +- [ ] Code is readable +- [ ] Appropriate abstraction level +- [ ] No unnecessary complexity +- [ ] Consistent with codebase style + +### Tests +- [ ] New functionality tested +- [ ] Edge cases covered +- [ ] Regression tests added diff --git a/modules/development/pi-coding-agent/skills/debugging/SKILL.md b/modules/development/pi-coding-agent/skills/debugging/SKILL.md new file mode 100644 index 0000000..6592a84 --- /dev/null +++ b/modules/development/pi-coding-agent/skills/debugging/SKILL.md @@ -0,0 +1,52 @@ +--- +name: debugging +description: "A systematic workflow; reproduce -> inspect logs/errors -> isolate cause -> form hypothesis -> test -> fix -> regression test." +--- + +# Debugging Skill + +A systematic workflow: reproduce -> inspect logs/errors -> isolate cause -> form hypothesis -> test -> fix -> regression test. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** When debugging a flaky test, spawn a **scout** to reproduce the issue in a clean environment, another **scout** to analyze the relevant log files, and an **implementer** to apply a targeted fix while a **reviewer** runs the regression suite—all in parallel. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Workflow + +### 1. Reproduce +- Create minimal reproduction case +- Document exact steps +- Verify consistent failure + +### 2. Inspect +- Read error messages fully +- Check logs and stack traces +- Examine relevant code paths + +### 3. Isolate +- Narrow down the failing component +- Use binary search if needed +- Add temporary logging + +### 4. Hypothesize +- Form specific, testable hypotheses +- Prioritize by likelihood +- Consider recent changes + +### 5. Test +- Verify each hypothesis +- Use debuggers, prints, or tests +- Document findings + +### 6. Fix +- Make minimal targeted change +- Address root cause, not symptom +- Follow existing patterns + +### 7. Regression Test +- Run existing test suite +- Add test for the bug +- Verify fix doesn't break other things diff --git a/modules/development/pi-coding-agent/skills/dependency-management/SKILL.md b/modules/development/pi-coding-agent/skills/dependency-management/SKILL.md new file mode 100644 index 0000000..a36f80f --- /dev/null +++ b/modules/development/pi-coding-agent/skills/dependency-management/SKILL.md @@ -0,0 +1,37 @@ +--- +name: dependency-management +description: "Investigate whether a dependency is actually necessary, check existing versions/conventions, minimize dependency additions, and update lockfiles deliberately." +--- + +# Dependency Management Skill + +Investigate whether a dependency is actually necessary, check existing versions/conventions, minimize dependency additions, and update lockfiles deliberately. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** To evaluate a new dependency, use a **scout** to check if the functionality exists in the standard library, another **scout** to compare versions and licensing of alternatives, and a **reviewer** to verify the lockfile update doesn't introduce transitive conflicts. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Process + +### 1. Necessity +- Can this be done with stdlib? +- Is there an existing internal utility? +- What's the maintenance cost? + +### 2. Conventions +- Check existing similar dependencies +- Follow version pinning policy +- Use approved registries + +### 3. Minimize +- Prefer fewer, well-maintained deps +- Avoid transitive dependency bloat +- Consider vendoring for small utils + +### 4. Update +- Update lockfiles atomically +- Test after updates +- Document breaking changes diff --git a/modules/development/pi-coding-agent/skills/documentation/SKILL.md b/modules/development/pi-coding-agent/skills/documentation/SKILL.md new file mode 100644 index 0000000..d7ad4bf --- /dev/null +++ b/modules/development/pi-coding-agent/skills/documentation/SKILL.md @@ -0,0 +1,32 @@ +--- +name: documentation +description: "Generate/update README/API/architecture docs from the actual implementation rather than inventing behavior." +--- + +# Documentation Skill + +Generate/update README/API/architecture docs from the actual implementation rather than inventing behavior. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** For a new feature, assign a **scout** to extract API signatures from the `service` module, another **scout** to gather usage examples from the `cli` package, and an **implementer** to generate the corresponding README and API docs sections simultaneously. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Principles + +### Source of Truth +- Read code first +- Document what exists +- Don't speculate on behavior + +### Types +- README: project overview, setup, usage +- API: public interfaces, parameters, returns +- Architecture: module boundaries, data flow + +### Maintenance +- Update with code changes +- Delete stale documentation +- Link to code references diff --git a/modules/development/pi-coding-agent/skills/git/SKILL.md b/modules/development/pi-coding-agent/skills/git/SKILL.md new file mode 100644 index 0000000..df60f8f --- /dev/null +++ b/modules/development/pi-coding-agent/skills/git/SKILL.md @@ -0,0 +1,38 @@ +--- +name: git +description: "Inspect status/diff/history, preserve user work, create focused commits when requested, help with merges/rebases/conflicts." +--- + +# Git Skill + +Inspect status/diff/history, preserve user work, create focused commits when requested, help with merges/rebases/conflicts. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** When preparing a complex merge, spawn a **scout** to analyze the commit history of the `feature` branch, another **scout** to inspect the conflicting files in `core`, and a **reviewer** to verify the merged result passes all tests before pushing. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Operations + +### Inspect +- `git status` - working tree state +- `git diff` - unstaged changes +- `git diff --cached` - staged changes +- `git log --oneline -20` - recent history + +### Preserve +- Never discard user changes +- Stash before risky operations +- Backup before rewrites + +### Commit +- One logical change per commit +- Clear, imperative messages +- Reference issues when applicable +- Use strict commit message formats + +### Merge +- Prefer merge with commits +- Resolve conflicts incrementally diff --git a/modules/development/pi-coding-agent/skills/performance-analysis/SKILL.md b/modules/development/pi-coding-agent/skills/performance-analysis/SKILL.md new file mode 100644 index 0000000..0a65471 --- /dev/null +++ b/modules/development/pi-coding-agent/skills/performance-analysis/SKILL.md @@ -0,0 +1,37 @@ +--- +name: performance-analysis +description: "Measure before optimizing, identify likely bottlenecks, make a targeted change, and verify the effect." +--- + +# Performance Analysis Skill + +Measure before optimizing, identify likely bottlenecks, make a targeted change, and verify the effect. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** To optimize a slow endpoint, run a **scout** to profile CPU usage in the `handler` function, another **scout** to measure I/O latency in the `storage` layer, and an **implementer** to apply algorithmic improvements while a **reviewer** compares benchmarks against the baseline. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Workflow + +### 1. Measure +- Profile before changes +- Establish baseline metrics +- Identify hot paths + +### 2. Analyze +- Find actual bottlenecks +- Distinguish CPU vs I/O vs memory +- Consider algorithmic complexity + +### 3. Target +- One bottleneck at a time +- Minimal, focused change +- Prefer algorithmic improvements + +### 4. Verify +- Re-measure after change +- Compare to baseline +- Check for regressions diff --git a/modules/development/pi-coding-agent/skills/refactoring/SKILL.md b/modules/development/pi-coding-agent/skills/refactoring/SKILL.md new file mode 100644 index 0000000..09f01fa --- /dev/null +++ b/modules/development/pi-coding-agent/skills/refactoring/SKILL.md @@ -0,0 +1,40 @@ +--- +name: refactoring +description: "Explicitly preserve behavior while improving structure; identify unnecessary abstraction and avoid scope creep." +--- + +# Refactoring Skill + +Explicitly preserve behavior while improving structure; identify unnecessary abstraction and avoid scope creep. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** When refactoring a legacy module, use a **scout** to identify all call sites of the `legacy::utils` functions, another **scout** to map the test coverage for each, and an **implementer** to inline or replace them incrementally while a **reviewer** ensures behavior is preserved. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Principles + +### Preserve Behavior +- Run tests before and after +- Make incremental changes +- Verify at each step + +### Improve Structure +- Reduce duplication +- Clarify intent +- Improve modularity + +### Avoid Scope Creep +- One refactoring at a time +- No new features +- No style-only changes in same commit + +### Identify Unnecessary Abstraction +- Remove unused interfaces +- Inline single-use functions +- Flatten deep hierarchies + +### Run tools +- Use refactoring tools like formatters/linters when available diff --git a/modules/development/pi-coding-agent/skills/release/SKILL.md b/modules/development/pi-coding-agent/skills/release/SKILL.md new file mode 100644 index 0000000..a81acfd --- /dev/null +++ b/modules/development/pi-coding-agent/skills/release/SKILL.md @@ -0,0 +1,42 @@ +--- +name: release +description: "Build -> test -> inspect artifacts -> changelog/versioning -> package/release checks." +--- + +# Release Skill + +Build -> test -> inspect artifacts -> changelog/versioning -> package/release checks. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** For a multi-platform release, assign a **scout** to build the Linux artifact, another **scout** to build the macOS artifact, a third to run the integration test suite, and a **reviewer** to verify version tags and changelog entries before publishing. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Process + +### 1. Build +- Clean build +- Verify build succeeds +- Check artifact integrity + +### 2. Test +- Full test suite +- Integration tests +- Smoke tests on artifacts + +### 3. Inspect +- Verify artifact contents +- Check version numbers +- Validate metadata + +### 4. Changelog/Versioning +- Generate changelog +- Follow semver +- Tag release + +### 5. Package/Release +- Publish to registry +- Verify published artifact +- Announce if needed diff --git a/modules/development/pi-coding-agent/skills/research/SKILL.md b/modules/development/pi-coding-agent/skills/research/SKILL.md new file mode 100644 index 0000000..c906a1c --- /dev/null +++ b/modules/development/pi-coding-agent/skills/research/SKILL.md @@ -0,0 +1,38 @@ +--- +name: research +description: "For unfamiliar APIs or libraries; identify authoritative sources, compare alternatives, verify version-specific behavior, and separate verified facts from assumptions." +--- + +# Research Skill + +For unfamiliar APIs or libraries: identify authoritative sources, compare alternatives, verify version-specific behavior, and separate verified facts from assumptions. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** When evaluating a new library, spawn a **scout** to read the official documentation, another **scout** to search for community benchmarks, and a **reviewer** to compare the findings against your project's requirements and version constraints. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Process + +### 1. Identify Sources +- Official documentation +- Source repository +- Specifications/RFCs +- Release notes/changelogs + +### 2. Compare +- Multiple sources for verification +- Version-specific differences +- Community best practices + +### 3. Verify +- Test assumptions with code +- Check version compatibility +- Note deprecations + +### 4. Distinguish +- Mark verified vs. inferred +- Cite sources +- Flag uncertainties diff --git a/modules/development/pi-coding-agent/skills/security-review/SKILL.md b/modules/development/pi-coding-agent/skills/security-review/SKILL.md new file mode 100644 index 0000000..3f534ab --- /dev/null +++ b/modules/development/pi-coding-agent/skills/security-review/SKILL.md @@ -0,0 +1,57 @@ +--- +name: security-review +description: "Look for secrets, injection, unsafe shell execution, auth/authz mistakes, dependency risks, path traversal, SSRF, insecure defaults, etc." +--- + +# Security Review Skill + +Look for secrets, injection, unsafe shell execution, auth/authz mistakes, dependency risks, path traversal, SSRF, insecure defaults, etc. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** For a security audit, run a **scout** to scan for injection vulnerabilities in the input validators, another **scout** to review authentication flows for authz mistakes, and a **reviewer** to check for path traversal and SSRF in file-handling code—all in parallel. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Checklist + +### Secrets & Credentials +- [ ] No hardcoded secrets +- [ ] No keys in config files +- [ ] Environment variables used properly + +### Injection +- [ ] SQL injection prevention +- [ ] Command injection prevention +- [ ] XSS prevention + +### Shell Execution +- [ ] No unsanitized user input in shell +- [ ] Use exec over shell when possible +- [ ] Validate and escape inputs + +### Auth/Authz +- [ ] Proper authentication checks +- [ ] Authorization on all endpoints +- [ ] No broken access control + +### Dependencies +- [ ] Known vulnerabilities checked +- [ ] Minimal dependency surface +- [ ] Lockfiles maintained + +### Path Traversal +- [ ] Input validation on file paths +- [ ] Canonical path resolution +- [ ] Sandboxed file operations + +### SSRF +- [ ] URL validation +- [ ] Internal network blocking +- [ ] Allowlist for external calls + +### Insecure Defaults +- [ ] Secure defaults enabled +- [ ] Debug endpoints disabled +- [ ] Proper CORS configuration diff --git a/modules/development/pi-coding-agent/skills/testing/SKILL.md b/modules/development/pi-coding-agent/skills/testing/SKILL.md new file mode 100644 index 0000000..4785fe7 --- /dev/null +++ b/modules/development/pi-coding-agent/skills/testing/SKILL.md @@ -0,0 +1,42 @@ +--- +name: testing +description: "Figure out the project's existing test strategy, add targeted tests, run the smallest useful test set, then broaden validation." +--- + +# Testing Skill + +Figure out the project's existing test strategy, add targeted tests, run the smallest useful test set, then broaden validation. + +## Subagents +When you need to delegate sub‑tasks, use the `pi-subagents` skill. + +**Example:** To expand test coverage, assign a **scout** to run the existing unit test suite and report gaps, another **scout** to generate property-based tests for the `parser` module, and an **implementer** to add integration tests for the `api` endpoints while a **reviewer** verifies the new tests pass. + +*You may adapt the delegation pattern to fit the exact requirements of the codebase.* + +## Process + +### 1. Discover +- Find test framework and conventions +- Locate existing test files +- Understand test organization + +### 2. Target +- Write tests for the specific change +- Focus on behavior, not implementation +- Cover edge cases and error paths + +### 3. Run Small +- Execute only affected tests first +- Use test filtering if available +- Verify new tests pass + +### 4. Broaden +- Run full test suite +- Check for flaky tests +- Validate integration points + +### 5. Report +- Document what was tested +- Note any skipped tests +- Report coverage gaps |
